-
Notifications
You must be signed in to change notification settings - Fork 0
/
syscalls_linux.f90
36 lines (27 loc) · 973 Bytes
/
syscalls_linux.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
module syscalls
! Contains generic wrappers for command line argument getter (eg GETARG)
!
! This one is for Linux.
!
! On Cray T90 machines, PXFGETARG gets the command line argument,
! but on almost any other system its GETARG. Man pages usually
! have entries for IARGC and GETARG, as well as IS_NAN (which
! is also the typical NAN tester on other systems).
implicit none
contains
subroutine get_arg(narg,string,nchars,iocheck)
integer,intent(in) :: narg
character(*),intent(out) :: string
integer,intent(out) :: nchars
integer :: iargc
integer :: iocheck
! external :: getarg
iocheck = 0 ! No io status from this particular call
if (iargc()>narg-1) then
call getarg(narg,string)
nchars = len_trim(string)
else
return ! Do nothing if there is no narg_th argument
endif
end subroutine get_arg
end module syscalls