diff --git a/utils/binv.f90 b/utils/binv.f90 index f3bb67db..5cfc6812 100644 --- a/utils/binv.f90 +++ b/utils/binv.f90 @@ -27,13 +27,13 @@ PROGRAM BINV ! get filename - NARG=IARGC() - IF(NARG/=1) THEN - PRINT *,'Usage: binv will print bufrfile inventory by message type' - CALL EXIT(2) - ENDIF + narg=command_argument_count() + if(narg/=1) then + print *,'Usage: binv will print bufrfile inventory by message type' + call exit(2) + endif - call getarg(1,file) + call get_command_argument(1,file) file = TRIM(file)//CHAR(0) inquire(file=file,exist=exist) if (.not.exist) then diff --git a/utils/cmpbqm.F90 b/utils/cmpbqm.F90 index 5cdbeba1..f930cc8e 100644 --- a/utils/cmpbqm.F90 +++ b/utils/cmpbqm.F90 @@ -42,7 +42,7 @@ PROGRAM CMPBQM ! OPEN A FILE - GET A DATE ! ------------------------ - call getarg(1,file); file=trim(adjustl(file)) + call get_command_argument(1,file); file=trim(adjustl(file)) if (file == '') then print *, 'Usage: Usage: cmpbqm will print prep inventory by variable, report type, and qc mark' call exit(2) diff --git a/utils/gettab.f90 b/utils/gettab.f90 index cf7eb8b1..716cbe68 100644 --- a/utils/gettab.f90 +++ b/utils/gettab.f90 @@ -20,7 +20,7 @@ program gettab ! get the filename to open and read - call getarg(1,file); file=trim(adjustl(file)) + call get_command_argument(1,file); file=trim(adjustl(file)) if (file == '') then print *,'Usage: gettab will print the internal BUFR table' call exit(2) diff --git a/utils/readbp.F90 b/utils/readbp.F90 index 5bdb5e46..eebccb7c 100644 --- a/utils/readbp.F90 +++ b/utils/readbp.F90 @@ -55,7 +55,7 @@ PROGRAM READBP ! check for filename argument - narg=iargc() + narg=command_argument_count() 1 if(narg<1) THEN call printx(' ') call printx('Usage: readbp <-s> <-w> <-k> <-r> <-d> <-n> <-h> prep bufrfile ') @@ -82,22 +82,22 @@ PROGRAM READBP iarg=1 do while(iarg<=narg) - call getarg(iarg,file) + call get_command_argument(iarg,file) if(file(1:1)=='-') then if(file(2:2)=='s') then - iarg=iarg+1; call getarg(iarg,sta); nsta=len(trim(sta)) + iarg=iarg+1; call get_command_argument(iarg,sta); nsta=len(trim(sta)) elseif(file(2:2)=='w') then - iarg=iarg+1; call getarg(iarg,val); read(val,*)x1 - iarg=iarg+1; call getarg(iarg,val); read(val,*)x2 - iarg=iarg+1; call getarg(iarg,val); read(val,*)y1 - iarg=iarg+1; call getarg(iarg,val); read(val,*)y2 + iarg=iarg+1; call get_command_argument(iarg,val); read(val,*)x1 + iarg=iarg+1; call get_command_argument(iarg,val); read(val,*)x2 + iarg=iarg+1; call get_command_argument(iarg,val); read(val,*)y1 + iarg=iarg+1; call get_command_argument(iarg,val); read(val,*)y2 window=.true. elseif(file(2:2)=='k') then - iarg=iarg+1; call getarg(iarg,val); read(val,*)ikx + iarg=iarg+1; call get_command_argument(iarg,val); read(val,*)ikx elseif(file(2:2)=='r') then - iarg=iarg+1; call getarg(iarg,val); read(val,*)irt + iarg=iarg+1; call get_command_argument(iarg,val); read(val,*)irt elseif(file(2:2)=='m') then - iarg=iarg+1; call getarg(iarg,val); msg=val(1:8) + iarg=iarg+1; call get_command_argument(iarg,val); msg=val(1:8) elseif(file(2:2)=='d') then iarg=iarg+1; dump=.true. elseif(file(2:2)=='h') then diff --git a/utils/readmp.F90 b/utils/readmp.F90 index 93e81d26..433a2cbb 100644 --- a/utils/readmp.F90 +++ b/utils/readmp.F90 @@ -23,7 +23,7 @@ program readmp ! get the filename to open and read - call getarg(1,file); file=trim(adjustl(file)) + call get_command_argument(1,file); file=trim(adjustl(file)) if (file == '') then print *, 'Usage: readmp will print reports one at a time' call exit(2) @@ -33,7 +33,7 @@ program readmp print *,trim(file)//' does not exist' call exit(3) endif - call getarg(2,go); go=trim(adjustl(go)) ! this for testing ! + call get_command_argument(2,go); go=trim(adjustl(go)) ! this for testing open(lunit,file=file,form='unformatted') ! open the file to bufr and dump the subsets to standard outout one at a time diff --git a/utils/sinv.f90.in b/utils/sinv.f90.in index d86fbf47..8695ce2c 100644 --- a/utils/sinv.f90.in +++ b/utils/sinv.f90.in @@ -33,12 +33,12 @@ program sinv ! get filename argument - narg=iargc() + narg=command_argument_count() if(narg<1) then write(*,*)'Usage: sinv will print inventory of satellites by platform and instrument' call exit(2) endif - call getarg(1,file) + call get_command_argument(1,file) file = trim(adjustl(file)) inquire(file=file,exist=exist) if (.not.exist) call bort(trim(file)//' does not exist') @@ -47,7 +47,7 @@ program sinv call openbf(lunbf,'FIRST',lunbf) ! need to call openbf prior to calling mtinfo if(narg==2) then ! arg 2 would be a user defined table dir - call getarg(2,tbldir) + call get_command_argument(2,tbldir) call mtinfo(tbldir,3,4) else ! otherwise default table dir is used cmtdir = '@MASTER_TABLE_DIR_F@' diff --git a/utils/split_by_subset.f90 b/utils/split_by_subset.f90 index db319d51..a1206e59 100644 --- a/utils/split_by_subset.f90 +++ b/utils/split_by_subset.f90 @@ -31,8 +31,8 @@ program split_by_subset !> get input filename from stdin - if(iargc()==1) then - call getarg(1, finput) + if(command_argument_count()==1) then + call get_command_argument(1, finput) inquire(file=trim(adjustl(finput)), exist=file_exists) if (file_exists) then open(lunit, file=trim(adjustl(finput)), form='unformatted')