From bc8b1a3a1daa419950e5bd7b1b04614d7732b271 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 7 Jul 2023 15:26:46 -0600 Subject: [PATCH 1/2] Fix gen_domain installation instructions --- tools/mapping/gen_domain_files/INSTALL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/mapping/gen_domain_files/INSTALL b/tools/mapping/gen_domain_files/INSTALL index 71d7caefcae..b9d474e0cc9 100644 --- a/tools/mapping/gen_domain_files/INSTALL +++ b/tools/mapping/gen_domain_files/INSTALL @@ -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: From a608d9930fbc0eda44786645bd76be6520487f3c Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 7 Jul 2023 15:27:03 -0600 Subject: [PATCH 2/2] Use standard Fortran functions for getting command-line arguments Resolves ESMCI/cime#4455 --- .../gen_domain_files/src/gen_domain.F90 | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/mapping/gen_domain_files/src/gen_domain.F90 b/tools/mapping/gen_domain_files/src/gen_domain.F90 index f0b97f20e4e..b06f1e7442a 100644 --- a/tools/mapping/gen_domain_files/src/gen_domain.F90 +++ b/tools/mapping/gen_domain_files/src/gen_domain.F90 @@ -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 @@ -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')