support F03 intrinsics for argument capture

use Fortran 2003 intrinsics COMMAND_ARGUMENT_COUNT and GET_COMMAND_ARGUMENT 
instead of the non-portable iargc and getarg routines.

this code is unused unless the user sets USE_FORTRAN2003 in their compilation 
environment.
This commit is contained in:
Jeff Hammond 2015-05-19 19:01:58 +00:00
parent 2201d8b21b
commit 1daab55b87
4 changed files with 17 additions and 2 deletions

View file

@ -45,6 +45,9 @@ ifeq ($(HOSTNAME),cu0login5)
LIB_DEFINES += -DDFLT_TOT_MEM=419430400
endif
ifdef USE_FORTRAN2003
LIB_DEFINES += -DUSE_FORTRAN2003
endif
# END_WIN32_IGNORE

View file

@ -27,7 +27,7 @@ c
external ipxfargc
nargs =ipxfargc()
#else
#if defined(EXT_INT)
#if defined(EXT_INT) && !defined(USE_FORTRAN2003)
integer*4 iargc
#else
integer iargc
@ -36,7 +36,11 @@ c
external iargc
#endif
c
#if defined(USE_FORTRAN2003)
nargs = command_argument_count()
#else
nargs = iargc()
#endif
#endif
do arg = 1, nargs
call util_getarg(arg,test)

View file

@ -174,7 +174,7 @@ endif
fortchar.o seq_output.o ga_mat2col.o \
util_ch_brd.o two_ind_trn.o \
util_pname.o sread.o swrite.o \
banner.o util_print.o util_module_avail.o \
banner.o util_print.o \
util_version.o util_nwchem_version.o util_ga_version.o \
util_nwchem_paper.o util_nwchem_srcdir.o utilc_nwchem_srcdir.o \
mk_fit_xf.o \
@ -286,6 +286,10 @@ ifdef TCE_CUDA
OBJ += util_cuda_support.o
endif
ifdef USE_FORTRAN2003
LIB_DEFINES += -DUSE_FORTRAN2003
endif
include ../config/makelib.h

View file

@ -8,6 +8,9 @@
#include "errquit.fh"
integer iarg_in
character*(*) arg
#if defined(USE_FORTRAN2003)
call get_command_argument(iarg_in,arg)
#else
#if defined(EXT_INT) && !( __GNUC__ >= 4)
integer*4 iarg
#else
@ -40,5 +43,6 @@ c
call getarg(iarg,arg)
#endif
*
#endif
return
end