refactor: replace non-standard GNU Fortran extensions with standard intrinsics
This commit is contained in:
parent
962704e5f7
commit
2c84fe09d3
3 changed files with 13 additions and 23 deletions
|
|
@ -125,16 +125,15 @@ contains
|
||||||
subroutine openmpi_get_command_line
|
subroutine openmpi_get_command_line
|
||||||
implicit none
|
implicit none
|
||||||
|
|
||||||
character*80 :: tmp_str
|
character(len=80) :: tmp_str
|
||||||
integer :: iargc
|
|
||||||
|
|
||||||
! reading the run_name from the command line
|
! reading the run_name from the command line
|
||||||
if(iargc().eq.0) then
|
if(command_argument_count().eq.0) then
|
||||||
call getarg(0,tmp_str)
|
call get_command_argument(0,tmp_str)
|
||||||
print*, 'Format: ',trim(tmp_str),' (run name) ["split"/"never"]'
|
print*, 'Format: ',trim(tmp_str),' (run name) ["split"/"never"]'
|
||||||
stop
|
stop
|
||||||
end if
|
end if
|
||||||
call getarg(1,run_name_local)
|
call get_command_argument(1,run_name_local)
|
||||||
if(len_trim(run_name_local).ne.10) then
|
if(len_trim(run_name_local).ne.10) then
|
||||||
print *, 'Run name: "',run_name_local,'"'
|
print *, 'Run name: "',run_name_local,'"'
|
||||||
print *, ' "1234567890"'
|
print *, ' "1234567890"'
|
||||||
|
|
@ -143,7 +142,7 @@ contains
|
||||||
end if
|
end if
|
||||||
|
|
||||||
! getting the split parameter, if it's there
|
! getting the split parameter, if it's there
|
||||||
if(iargc().eq.2) call getarg(2,split)
|
if(command_argument_count().eq.2) call get_command_argument(2,split)
|
||||||
|
|
||||||
|
|
||||||
end subroutine openmpi_get_command_line
|
end subroutine openmpi_get_command_line
|
||||||
|
|
|
||||||
|
|
@ -172,14 +172,8 @@ MODULE post
|
||||||
real(real64) :: dt,dummyu
|
real(real64) :: dt,dummyu
|
||||||
INTEGER :: ncyc
|
INTEGER :: ncyc
|
||||||
|
|
||||||
integer(8) :: ctime_i
|
|
||||||
character(len=30) :: date
|
character(len=30) :: date
|
||||||
|
integer :: date_values(8)
|
||||||
REAL*4 :: e, t(2)
|
|
||||||
REAL*4 :: e0, t0(2)
|
|
||||||
REAL*4 :: e1, t1(2)
|
|
||||||
|
|
||||||
e0 = etime(t0)
|
|
||||||
|
|
||||||
OPEN(num,FORM='unformatted',STATUS='unknown')
|
OPEN(num,FORM='unformatted',STATUS='unknown')
|
||||||
|
|
||||||
|
|
@ -210,18 +204,15 @@ MODULE post
|
||||||
|
|
||||||
CLOSE (num)
|
CLOSE (num)
|
||||||
|
|
||||||
e = etime(t)
|
call date_and_time(values=date_values)
|
||||||
|
write(date, '(I4.4,"-",I2.2,"-",I2.2," ",I2.2,":",I2.2,":",I2.2)') &
|
||||||
ctime_i = time8()
|
date_values(1), date_values(2), date_values(3), &
|
||||||
call ctime(ctime_i,date)
|
date_values(5), date_values(6), date_values(7)
|
||||||
|
|
||||||
WRITE(*,'(a,a,i2,a,i1,a,i4,a,i4,a,i4)') &
|
WRITE(*,'(a,a,i2,a,i1,a,i4,a,i4,a,i4)') &
|
||||||
date, "PID", myid, "|PASS", ipass, "|fort.", num, &
|
date, "PID", myid, "|PASS", ipass, "|fort.", num, &
|
||||||
"|", nprogress, "/", endnum-startnum+1
|
"|", nprogress, "/", endnum-startnum+1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
END SUBROUTINE READ_FILE
|
END SUBROUTINE READ_FILE
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,9 +48,9 @@
|
||||||
WRITE(*,*) " -v print version information"
|
WRITE(*,*) " -v print version information"
|
||||||
WRITE(*,*) " -x print latex equations"
|
WRITE(*,*) " -x print latex equations"
|
||||||
ELSE IF(num1char=="-v") THEN
|
ELSE IF(num1char=="-v") THEN
|
||||||
WRITE(*,*) input_string(1:lnblnk(input_string))
|
WRITE(*,*) input_string(1:len_trim(input_string))
|
||||||
ELSE IF(num1char=="-x") THEN
|
ELSE IF(num1char=="-x") THEN
|
||||||
WRITE(*,*) latex_string(1:lnblnk(latex_string))
|
WRITE(*,*) latex_string(1:len_trim(latex_string))
|
||||||
ELSE
|
ELSE
|
||||||
WRITE(*,*) 'ERROR, OPTION NOT SUPPORTED ', num1char
|
WRITE(*,*) 'ERROR, OPTION NOT SUPPORTED ', num1char
|
||||||
END IF
|
END IF
|
||||||
|
|
@ -61,7 +61,7 @@
|
||||||
|
|
||||||
CALL m_openmpi_init
|
CALL m_openmpi_init
|
||||||
|
|
||||||
if (iammaster) write(*,*) input_string(1:lnblnk(input_string))
|
if (iammaster) write(*,*) input_string(1:len_trim(input_string))
|
||||||
|
|
||||||
CALL main
|
CALL main
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue