Skip to content

Commit

Permalink
Merge pull request #4457 from billsacks/gen_domain_args
Browse files Browse the repository at this point in the history
Use standard Fortran functions for getting command-line arguments
  • Loading branch information
jedwards4b authored Jul 10, 2023
2 parents aac3b5a + a608d99 commit 5877fde
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion tools/mapping/gen_domain_files/INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ HOW TO BUILD
============

(1) $ cd src
(2) $ ../../../configure --macros-format Makefile --mpilib mpi-serial
(2) $ ../../../../CIME/scripts/configure --macros-format Makefile --mpilib mpi-serial
Bash users:
(3) $ (. ./.env_mach_specific.sh ; gmake)
csh users:
Expand Down
18 changes: 9 additions & 9 deletions tools/mapping/gen_domain_files/src/gen_domain.F90
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ program fmain
set_omask = .false.

! Make sure we have arguments
nargs = iargc()
nargs = command_argument_count()
if (nargs == 0) then
write(6,*)'invoke gen_domain -h for usage'
stop
Expand All @@ -64,47 +64,47 @@ program fmain
n = 1
do while (n <= nargs)
arg = ' '
call getarg (n, arg)
call get_command_argument (n, arg)
n = n + 1

select case (arg)
case ('-m')
! input mapping file
call getarg (n, arg)
call get_command_argument (n, arg)
n = n + 1
fmap = trim(arg)
cmdline = trim(cmdline) // ' -m ' // trim(arg)
case ('-o')
! output ocean grid name
call getarg (n, arg)
call get_command_argument (n, arg)
n = n + 1
fn1_out = trim(arg)
cmdline = trim(cmdline) // ' -o ' // trim(arg)
case ('-l')
! output land grid name
call getarg (n, arg)
call get_command_argument (n, arg)
n = n + 1
fn2_out = trim(arg)
cmdline = trim(cmdline) // ' -l ' // trim(arg)
case ('-p')
! set pole on this grid [0,1,2]
call getarg (n, arg)
call get_command_argument (n, arg)
n = n + 1
set_fv_pole_yc = ichar(trim(arg))-48
write(6,*)'set_fv_pole_yc is ',set_fv_pole_yc
case ('--fminval')
! set fminval (min allowable land fraction)
call getarg (n, arg)
call get_command_argument (n, arg)
n = n + 1
read(arg,*) fminval
case ('--fmaxval')
! set fminval (min allowable land fraction)
call getarg (n, arg)
call get_command_argument (n, arg)
n = n + 1
read(arg,*) fmaxval
case ('-c')
! user comment
call getarg (n, arg)
call get_command_argument (n, arg)
n = n + 1
usercomment = trim(arg)
case ('--set-omask')
Expand Down

0 comments on commit 5877fde

Please sign in to comment.