V3FIT
getcarg.f90
1  SUBROUTINE getcarg(narg, arg, numargs)
2  IMPLICIT NONE
3 !-----------------------------------------------
4 ! D u m m y A r g u m e n t s
5 !-----------------------------------------------
6  INTEGER, INTENT(in) :: narg
7  INTEGER, INTENT(out) :: numargs
8  CHARACTER(LEN=*), INTENT(out) :: arg
9 !-----------------------------------------------
10 ! L o c a l V a r i a b l e s
11 !-----------------------------------------------
12  INTEGER :: numchars
13 !-----------------------------------------------
14 #if defined(WIN32)
15  INTEGER :: nargs
16  numargs = nargs() - 1
17  CALL getarg(narg, arg, numchars)
18 #elif defined(LINUX) || defined(DARWIN)
19  INTEGER iargc
20  numargs = iargc()
21  CALL getarg(narg, arg)
22 #elif defined(VMS)
23  CALL lib$get_foreign(arg,,numchars)
24  numargs = min(1,numchars)
25 #elif defined(CRAY)
26  INTEGER :: ier
27  INTEGER ipxfargc
28  numargs = ipxfargc()
29  CALL pxfgetarg(narg, arg, numchars, ier)
30 #elif defined(MACOSX)
31  numargs = command_argument_count()
32  CALL get_command_argument(narg,arg)
33 #else
34  INTEGER iargc, getarg
35  numargs = iargc()
36  numchars = getarg(narg, arg)
37 #endif
38  END SUBROUTINE getcarg