diff --git a/.github/PULL_REQUEST_TEMPLATE b/.github/PULL_REQUEST_TEMPLATE index 348467417..2af60f94e 100644 --- a/.github/PULL_REQUEST_TEMPLATE +++ b/.github/PULL_REQUEST_TEMPLATE @@ -24,7 +24,7 @@ Add any links to external PRs. For example: If this PR is contributing new capabilities that need to be documented, please also include updates to the RST files in the ufs-srweather-app repository (docs/UsersGuide/source) as supporting material. ## ISSUE (optional): -If this PR is resolving or referencing one or more issues, in this repository or elewhere, list them here. For example, "Fixes issue mentioned in #123" or "Related to bug in https://github.com/NOAA-EMC/other_repository/pull/63" +If this PR is resolving or referencing one or more issues, in this repository or elewhere, list them here. For example, "Fixes issue mentioned in #123" or "Related to bug in https://github.com/ufs-community/other_repository/pull/63" ## CONTRIBUTORS (optional): If others have contributed to this work aside from the PR author, list them here diff --git a/docs/UsersGuide/source/Chapter3.rst b/docs/UsersGuide/source/Chapter3.rst index b2ee6acf8..46f16c792 100644 --- a/docs/UsersGuide/source/Chapter3.rst +++ b/docs/UsersGuide/source/Chapter3.rst @@ -5,7 +5,7 @@ Configuring the FV3SAR Workflow *************************************** The following steps describe how to create a user-specific configuration -file in order to un your experiment in a given environment. +file in order to run your experiment in a given environment. 1. Create a user-specific configuration file named ``config.sh`` in the subdirectory ``ush`` under the ``$BASEDIR/regional_workflow`` directory containing appropriate @@ -46,7 +46,7 @@ file in order to un your experiment in a given environment. # BASEDIR="/path/to/directory/of/regional_workflow/and/NEMSfv3gfs/clones" TMPDIR="/path/to/temporary/work/directories" - UPPDIR="/scratch3/BMC/det/beck/FV3-CAM/EMC_post/sorc/ncep_post.fd" + UPPDIR="/path/to/UPP/executable/directory" CCPP="false" # CDATE="2018060400" diff --git a/scripts/exregional_make_grid.sh b/scripts/exregional_make_grid.sh index 2b876401d..ebc580a4d 100755 --- a/scripts/exregional_make_grid.sh +++ b/scripts/exregional_make_grid.sh @@ -92,7 +92,7 @@ case "$MACHINE" in module list { restore_shell_opts; } > /dev/null 2>&1 export NODES=1 - export APRUN="aprun -n 1 -N 1 -j 1 -d 1 -cc depth" + export RUN_CMD_SERIAL="aprun -n 1 -N 1 -j 1 -d 1 -cc depth" export KMP_AFFINITY=disabled ulimit -s unlimited ulimit -a @@ -102,56 +102,25 @@ case "$MACHINE" in { save_shell_opts; set +x; } > /dev/null 2>&1 module list { restore_shell_opts; } > /dev/null 2>&1 - export APRUN="mpirun" + export RUN_CMD_SERIAL="mpirun" ulimit -s unlimited ;; - "HERA") - APRUN="time" - ;; - - "ORION") - ulimit -s unlimited - ulimit -a - APRUN="time" - ;; - - "JET") - APRUN="time" - ulimit -a - ;; - - "ODIN") - export APRUN="srun -n 1" - ulimit -s unlimited - ulimit -a - ;; - - "CHEYENNE") - APRUN="time" - ;; - - "STAMPEDE") - export APRUN="time" - ulimit -s unlimited - ulimit -a - ;; - - "MACOS") - APRUN=time - ;; - - "LINUX") - APRUN=time - ;; - *) - print_err_msg_exit "\ -Run command has not been specified for this machine: - MACHINE = \"$MACHINE\"" + source ${MACHINE_FILE} ;; esac + +if [ -z ${RUN_CMD_SERIAL:-} ] ; then + print_err_msg_exit " \ + Run command was not set in machine file. \ + Please set RUN_CMD_SERIAL for your platform" +else + RUN_CMD_SERIAL=$(eval echo ${RUN_CMD_SERIAL}) + print_info_msg "$VERBOSE" " + All executables will be submitted with command \'${RUN_CMD_SERIAL}\'." +fi # #----------------------------------------------------------------------- # @@ -311,7 +280,7 @@ if [ "${GRID_GEN_METHOD}" = "GFDLgrid" ]; then # for the 6 global tiles. However, after this call we will only need the # regional grid file. # - $APRUN ${exec_fp} \ + $RUN_CMD_SERIAL ${exec_fp} \ --grid_type gnomonic_ed \ --nlon ${nx_t6sg} \ --grid_name ${grid_name} \ @@ -385,7 +354,7 @@ $settings" # # Call the executable that generates the grid file. # - $APRUN ${exec_fp} ${rgnl_grid_nml_fp} || \ + $RUN_CMD_SERIAL ${exec_fp} ${rgnl_grid_nml_fp} || \ print_err_msg_exit "\ Call to executable (exec_fp) that generates a ESGgrid-type regional grid returned with nonzero exit code: @@ -424,7 +393,7 @@ cubed-sphere grid equivalent resolution does not exist: Please ensure that you've built this executable." fi -$APRUN ${exec_fp} "${grid_fp}" || \ +$RUN_CMD_SERIAL ${exec_fp} "${grid_fp}" || \ print_err_msg_exit "\ Call to executable (exec_fp) that calculates the regional grid's global uniform cubed-sphere grid equivalent resolution returned with nonzero exit @@ -519,7 +488,7 @@ fi exec_fn="shave" exec_fp="$EXECDIR/${exec_fn}" if [ ! -f "${exec_fp}" ]; then - print_err_msg_exit "\ + print_err_msg_exit " \ The executable (exec_fp) for \"shaving\" down the halo in the grid file does not exist: exec_fp = \"${exec_fp}\" @@ -553,7 +522,7 @@ printf "%s %s %s %s %s\n" \ $NX $NY ${NH3} \"${unshaved_fp}\" \"${shaved_fp}\" \ > ${nml_fn} -$APRUN ${exec_fp} < ${nml_fn} || \ +$RUN_CMD_SERIAL ${exec_fp} < ${nml_fn} || \ print_err_msg_exit "\ Call to executable (exec_fp) to generate a grid file with a ${NH3}-cell-wide halo from the grid file with a ${NHW}-cell-wide halo returned with nonzero @@ -579,7 +548,7 @@ printf "%s %s %s %s %s\n" \ $NX $NY ${NH4} \"${unshaved_fp}\" \"${shaved_fp}\" \ > ${nml_fn} -$APRUN ${exec_fp} < ${nml_fn} || \ +$RUN_CMD_SERIAL ${exec_fp} < ${nml_fn} || \ print_err_msg_exit "\ Call to executable (exec_fp) to generate a grid file with a ${NH4}-cell-wide halo from the grid file with a ${NHW}-cell-wide halo returned with nonzero @@ -603,7 +572,8 @@ cd_vrfy - make_grid_mosaic_file \ grid_dir="${GRID_DIR}" \ grid_fn="${CRES}${DOT_OR_USCORE}grid.tile${TILE_RGNL}.halo${NHW}.nc" \ - mosaic_fn="${CRES}${DOT_OR_USCORE}mosaic.halo${NHW}.nc" || \ + mosaic_fn="${CRES}${DOT_OR_USCORE}mosaic.halo${NHW}.nc" \ + run_cmd="${RUN_CMD_SERIAL}" || \ print_err_msg_exit "\ Call to function to generate the mosaic file for a grid with a ${NHW}-cell-wide halo failed." @@ -617,7 +587,8 @@ halo failed." make_grid_mosaic_file \ grid_dir="${GRID_DIR}" \ grid_fn="${CRES}${DOT_OR_USCORE}grid.tile${TILE_RGNL}.halo${NH3}.nc" \ - mosaic_fn="${CRES}${DOT_OR_USCORE}mosaic.halo${NH3}.nc" || \ + mosaic_fn="${CRES}${DOT_OR_USCORE}mosaic.halo${NH3}.nc" \ + run_cmd="${RUN_CMD_SERIAL}" || \ print_err_msg_exit "\ Call to function to generate the mosaic file for a grid with a ${NH3}-cell-wide halo failed." @@ -631,7 +602,8 @@ halo failed." make_grid_mosaic_file \ grid_dir="${GRID_DIR}" \ grid_fn="${CRES}${DOT_OR_USCORE}grid.tile${TILE_RGNL}.halo${NH4}.nc" \ - mosaic_fn="${CRES}${DOT_OR_USCORE}mosaic.halo${NH4}.nc" || \ + mosaic_fn="${CRES}${DOT_OR_USCORE}mosaic.halo${NH4}.nc" \ + run_cmd="${RUN_CMD_SERIAL}" || \ print_err_msg_exit "\ Call to function to generate the mosaic file for a grid with a ${NH4}-cell-wide halo failed." diff --git a/scripts/exregional_make_ics.sh b/scripts/exregional_make_ics.sh index 67915c609..7161f16aa 100755 --- a/scripts/exregional_make_ics.sh +++ b/scripts/exregional_make_ics.sh @@ -90,59 +90,33 @@ case "$MACHINE" in "WCOSS_CRAY") ulimit -s unlimited - APRUN="aprun -b -j1 -n48 -N12 -d1 -cc depth" + RUN_CMD_UTILS="aprun -b -j1 -n48 -N12 -d1 -cc depth" ;; "WCOSS_DELL_P3") ulimit -s unlimited - APRUN="mpirun" + RUN_CMD_UTILS="mpirun" ;; - "HERA") - ulimit -s unlimited - APRUN="srun" - ;; - - "ORION") - ulimit -s unlimited - ulimit -a - APRUN="srun" - ;; - - "JET") - ulimit -s unlimited - APRUN="srun" - ;; - - "ODIN") - APRUN="srun" - ;; - - "CHEYENNE") - nprocs=$(( NNODES_MAKE_ICS*PPN_MAKE_ICS )) - APRUN="mpirun -np $nprocs" + *) + source ${MACHINE_FILE} ;; - "STAMPEDE") - APRUN="ibrun" - ;; +esac - "MACOS") - APRUN=$RUN_CMD_UTILS - ;; +nprocs=$(( NNODES_MAKE_ICS*PPN_MAKE_ICS )) - "LINUX") - ulimit -s unlimited - APRUN=$RUN_CMD_UTILS - ;; +if [ -z ${RUN_CMD_UTILS:-} ] ; then + print_err_msg_exit "\ + Run command was not set in machine file. \ + Please set RUN_CMD_UTILS for your platform" +else + RUN_CMD_UTILS=$(eval echo ${RUN_CMD_UTILS}) + print_info_msg "$VERBOSE" " + All executables will be submitted with command \'${RUN_CMD_UTILS}\'." +fi - *) - print_err_msg_exit "\ -Run command has not been specified for this machine: - MACHINE = \"$MACHINE\"" - ;; -esac # #----------------------------------------------------------------------- # @@ -618,14 +592,14 @@ $settings" #----------------------------------------------------------------------- # # NOTE: -# Often when the chgres_cube.exe run fails, it still returns a zero re- -# turn code, so the failure isn't picked up the the logical OR (||) be- -# low. That should be fixed. This might be due to the APRUN command - -# maybe that is returning a zero exit code even though the exit code -# of chgres_cube is nonzero. -# A similar thing happens in the forecast task. -# -${APRUN} ${exec_fp} || \ +# Often when the chgres_cube.exe run fails, it still returns a zero +# return code, so the failure isn't picked up the the logical OR (||) +# below. That should be fixed. This might be due to the RUN_CMD_UTILS +# command - maybe that is returning a zero exit code even though the +# exit code of chgres_cube is nonzero. A similar thing happens in the +# forecast task. +# +${RUN_CMD_UTILS} ${exec_fp} || \ print_err_msg_exit "\ Call to executable (exec_fp) to generate surface and initial conditions (ICs) files for the FV3-LAM failed: @@ -685,7 +659,7 @@ Please check the following user defined variables: cp_vrfy ${fvcom_data_fp} ${ics_dir}/fvcom.nc cd_vrfy ${ics_dir} - ${APRUN} ${fvcom_exec_fn} sfc_data.tile${TILE_RGNL}.halo${NH0}.nc fvcom.nc ${FVCOM_WCSTART} ${fvcom_time}|| \ + ${RUN_CMD_UTILS} ${fvcom_exec_fn} sfc_data.tile${TILE_RGNL}.halo${NH0}.nc fvcom.nc ${FVCOM_WCSTART} ${fvcom_time}|| \ print_err_msg_exit "\ Call to executable (fvcom_exe) to modify sfc fields for FV3-LAM failed: fvcom_exe = \"${fvcom_exe}\" diff --git a/scripts/exregional_make_lbcs.sh b/scripts/exregional_make_lbcs.sh index c28fe24eb..f123dfc40 100755 --- a/scripts/exregional_make_lbcs.sh +++ b/scripts/exregional_make_lbcs.sh @@ -90,58 +90,31 @@ case "$MACHINE" in "WCOSS_CRAY") ulimit -s unlimited - APRUN="aprun -b -j1 -n48 -N12 -d1 -cc depth" + RUN_CMD_UTILS="aprun -b -j1 -n48 -N12 -d1 -cc depth" ;; "WCOSS_DELL_P3") ulimit -s unlimited - APRUN="mpirun" - ;; - - "HERA") - ulimit -s unlimited - APRUN="srun" - ;; - - "ORION") - ulimit -s unlimited - APRUN="srun" - ;; - - "JET") - ulimit -s unlimited - APRUN="srun" - ;; - - "ODIN") - APRUN="srun" - ;; - - "CHEYENNE") - nprocs=$(( NNODES_MAKE_LBCS*PPN_MAKE_LBCS )) - APRUN="mpirun -np $nprocs" - ;; - - "STAMPEDE") - APRUN="ibrun" - ;; - - "MACOS") - APRUN=$RUN_CMD_UTILS - ;; - - "LINUX") - ulimit -s unlimited - APRUN=$RUN_CMD_UTILS + RUN_CMD_UTILS="mpirun" ;; *) - print_err_msg_exit "\ -Run command has not been specified for this machine: - MACHINE = \"$MACHINE\"" + source ${MACHINE_FILE} ;; esac + +nprocs=$(( NNODES_MAKE_LBCS*PPN_MAKE_LBCS )) + +if [ -z ${RUN_CMD_UTILS:-} ] ; then + print_err_msg_exit "\ + Run command was not set in machine file. \ + Please set RUN_CMD_UTILS for your platform" +else + RUN_CMD_UTILS=$(eval echo ${RUN_CMD_UTILS}) + print_info_msg "$VERBOSE" " + All executables will be submitted with command \'${RUN_CMD_UTILS}\'." +fi # #----------------------------------------------------------------------- # @@ -532,14 +505,14 @@ $settings" #----------------------------------------------------------------------- # # NOTE: -# Often when the chgres_cube.exe run fails, it still returns a zero re- -# turn code, so the failure isn't picked up the the logical OR (||) be- -# low. That should be fixed. This might be due to the APRUN command - -# maybe that is returning a zero exit code even though the exit code -# of chgres_cube is nonzero. -# A similar thing happens in the forecast task. -# - ${APRUN} ${exec_fp} || \ +# Often when the chgres_cube.exe run fails, it still returns a zero +# return code, so the failure isn't picked up the the logical OR (||) +# below. That should be fixed. This might be due to the RUN_CMD_UTILS +# command - maybe that is returning a zero exit code even though the +# exit code of chgres_cube is nonzero. A similar thing happens in the +# forecast task. +# + ${RUN_CMD_UTILS} ${exec_fp} || \ print_err_msg_exit "\ Call to executable (exec_fp) to generate lateral boundary conditions (LBCs) file for the FV3-LAM for forecast hour fhr failed: diff --git a/scripts/exregional_make_orog.sh b/scripts/exregional_make_orog.sh index afd40d74d..430aa6a8d 100755 --- a/scripts/exregional_make_orog.sh +++ b/scripts/exregional_make_orog.sh @@ -104,7 +104,7 @@ case "$MACHINE" in module list { restore_shell_opts; } > /dev/null 2>&1 NODES=1 - APRUN="aprun -n 1 -N 1 -j 1 -d 1 -cc depth" + RUN_CMD_SERIAL="aprun -n 1 -N 1 -j 1 -d 1 -cc depth" ulimit -s unlimited ulimit -a ;; @@ -112,58 +112,24 @@ case "$MACHINE" in "WCOSS_DELL_P3") ulimit -s unlimited ulimit -a - APRUN="mpirun" - ;; - - "HERA") - ulimit -s unlimited - ulimit -a - APRUN="time" - ;; - - "ORION") - ulimit -s unlimited - ulimit -a - APRUN="time" - ;; - - "JET") - ulimit -s unlimited - ulimit -a - APRUN="time" - ;; - - "ODIN") - APRUN="srun -n 1" - ulimit -s unlimited - ulimit -a - ;; - - "CHEYENNE") - APRUN="time" - ;; - - "STAMPEDE") - APRUN="time" - ;; - - "MACOS") - APRUN=time - ;; - - "LINUX") - APRUN=time - ulimit -s unlimited - ulimit -a + RUN_CMD_SERIAL="mpirun" ;; *) - print_err_msg_exit "\ -Run command has not been specified for this machine: - MACHINE = \"$MACHINE\"" + source ${MACHINE_FILE} ;; esac + +if [ -z ${RUN_CMD_SERIAL:-} ] ; then + print_err_msg_exit "\ + Run command was not set in machine file. \ + Please set RUN_CMD_SERIAL for your platform" +else + RUN_CMD_SERIAL=$(eval echo ${RUN_CMD_SERIAL}) + print_info_msg "$VERBOSE" " + All executables will be submitted with command \'${RUN_CMD_SERIAL}\'." +fi # #----------------------------------------------------------------------- # @@ -297,7 +263,7 @@ cat "${input_redirect_fn}" print_info_msg "$VERBOSE" "\ Starting orography file generation..." -$APRUN "${exec_fp}" < "${input_redirect_fn}" || \ +${RUN_CMD_SERIAL} "${exec_fp}" < "${input_redirect_fn}" || \ print_err_msg_exit "\ Call to executable (exec_fp) that generates the raw orography file returned with nonzero exit code: @@ -369,7 +335,7 @@ Please ensure that you've built this executable." print_info_msg "$VERBOSE" " Starting orography file generation..." - $APRUN "${exec_fp}" < "${input_redirect_fn}" || \ + ${RUN_CMD_SERIAL} "${exec_fp}" < "${input_redirect_fn}" || \ print_err_msg_exit "\ Call to executable (exec_fp) that generates the GSL orography GWD data files returned with nonzero exit code: @@ -517,7 +483,7 @@ cd_vrfy "${filter_dir}" print_info_msg "$VERBOSE" " Starting filtering of orography..." -$APRUN "${exec_fp}" || \ +${RUN_CMD_SERIAL} "${exec_fp}" || \ print_err_msg_exit "\ Call to executable that generates filtered orography file returned with non-zero exit code." @@ -586,7 +552,7 @@ printf "%s %s %s %s %s\n" \ $NX $NY ${NH0} \"${unshaved_fp}\" \"${shaved_fp}\" \ > ${nml_fn} -$APRUN ${exec_fp} < ${nml_fn} || \ +${RUN_CMD_SERIAL} ${exec_fp} < ${nml_fn} || \ print_err_msg_exit "\ Call to executable (exec_fp) to generate a (filtered) orography file with a ${NH0}-cell-wide halo from the orography file with a {NHW}-cell-wide halo @@ -612,7 +578,7 @@ printf "%s %s %s %s %s\n" \ $NX $NY ${NH4} \"${unshaved_fp}\" \"${shaved_fp}\" \ > ${nml_fn} -$APRUN ${exec_fp} < ${nml_fn} || \ +${RUN_CMD_SERIAL} ${exec_fp} < ${nml_fn} || \ print_err_msg_exit "\ Call to executable (exec_fp) to generate a (filtered) orography file with a ${NH4}-cell-wide halo from the orography file with a {NHW}-cell-wide halo diff --git a/scripts/exregional_make_sfc_climo.sh b/scripts/exregional_make_sfc_climo.sh index bc51ea137..ada492987 100755 --- a/scripts/exregional_make_sfc_climo.sh +++ b/scripts/exregional_make_sfc_climo.sh @@ -139,7 +139,7 @@ EOF case "$MACHINE" in "WCOSS_CRAY") - APRUN=${APRUN:-"aprun -j 1 -n 6 -N 6"} + RUN_CMD_UTILS=${APRUN:-"aprun -j 1 -n 6 -N 6"} ;; "WCOSS_DELL_P3") @@ -150,51 +150,26 @@ case "$MACHINE" in export threads=1 export MP_LABELIO=yes export OMP_NUM_THREADS=$threads - APRUN="mpirun" - ;; - - "HERA") - APRUN="srun" - ;; - - "ORION") - APRUN="srun" - ;; - - "JET") - APRUN="srun" - ;; - - "CHEYENNE") - nprocs=$(( NNODES_MAKE_SFC_CLIMO*PPN_MAKE_SFC_CLIMO )) - APRUN="mpirun -np $nprocs" - ;; - - "ODIN") - nprocs=$(( NNODES_MAKE_SFC_CLIMO*PPN_MAKE_SFC_CLIMO )) - APRUN="srun -n $nprocs" - ;; - - "STAMPEDE") - nprocs=$(( NNODES_MAKE_SFC_CLIMO*PPN_MAKE_SFC_CLIMO )) - APRUN="ibrun -np ${nprocs}" - ;; - - "MACOS") - APRUN=$RUN_CMD_UTILS - ;; - - "LINUX") - APRUN=$RUN_CMD_UTILS + RUN_CMD_UTILS="mpirun" ;; *) - print_err_msg_exit "\ -Run command has not been specified for this machine: - MACHINE = \"$MACHINE\"" + source ${MACHINE_FILE} ;; esac + +nprocs=$(( NNODES_MAKE_SFC_CLIMO*PPN_MAKE_SFC_CLIMO )) + +if [ -z ${RUN_CMD_UTILS:-} ] ; then + print_err_msg_exit "\ + Run command was not set in machine file. \ + Please set RUN_CMD_UTILS for your platform" +else + RUN_CMD_UTILS=$(eval echo ${RUN_CMD_UTILS}) + print_info_msg "$VERBOSE" " + All executables will be submitted with command \'${RUN_CMD_UTILS}\'." +fi # #----------------------------------------------------------------------- # @@ -214,7 +189,7 @@ does not exist: Please ensure that you've built this executable." fi -$APRUN ${exec_fp} || \ +${RUN_CMD_UTILS} ${exec_fp} || \ print_err_msg_exit "\ Call to executable (exec_fp) to generate surface climatology files returned with nonzero exit code: diff --git a/scripts/exregional_run_fcst.sh b/scripts/exregional_run_fcst.sh index 513aa6634..10e1d6240 100755 --- a/scripts/exregional_run_fcst.sh +++ b/scripts/exregional_run_fcst.sh @@ -106,71 +106,35 @@ case "$MACHINE" in ulimit -a if [ ${PE_MEMBER01} -gt 24 ];then - APRUN="aprun -b -j1 -n${PE_MEMBER01} -N24 -d1 -cc depth" + RUN_CMD_FCST="aprun -b -j1 -n${PE_MEMBER01} -N24 -d1 -cc depth" else - APRUN="aprun -b -j1 -n${PE_MEMBER01} -N${PE_MEMBER01} -d1 -cc depth" + RUN_CMD_FCST="aprun -b -j1 -n${PE_MEMBER01} -N${PE_MEMBER01} -d1 -cc depth" fi ;; "WCOSS_DELL_P3") ulimit -s unlimited ulimit -a - APRUN="mpirun -l -np ${PE_MEMBER01}" - ;; - - "HERA") - ulimit -s unlimited - ulimit -a - APRUN="srun" - ;; - - "ORION") - ulimit -s unlimited - ulimit -a - APRUN="srun -n ${PE_MEMBER01}" - ;; - - "JET") - ulimit -s unlimited - ulimit -a - APRUN="srun" - ;; - - "ODIN") - module list - ulimit -s unlimited - ulimit -a - APRUN="srun -n ${PE_MEMBER01}" - ;; - - "CHEYENNE") - module list - nprocs=$(( NNODES_RUN_FCST*PPN_RUN_FCST )) - APRUN="mpirun -np $nprocs" - ;; - - "STAMPEDE") - module list - APRUN="ibrun -np ${PE_MEMBER01}" - ;; - - "MACOS") - APRUN=$RUN_CMD_FCST - ;; - - "LINUX") - ulimit -s unlimited - ulimit -a - APRUN=$RUN_CMD_FCST + RUN_CMD_FCST="mpirun -l -np ${PE_MEMBER01}" ;; *) - print_err_msg_exit "\ -Run command has not been specified for this machine: - MACHINE = \"$MACHINE\"" + source ${MACHINE_FILE} ;; esac + +nprocs=$(( NNODES_RUN_FCST*PPN_RUN_FCST )) + +if [ -z ${RUN_CMD_FCST:-} ] ; then + print_err_msg_exit "\ + Run command was not set in machine file. \ + Please set RUN_CMD_FCST for your platform" +else + RUN_CMD_FCST=$(eval echo ${RUN_CMD_FCST}) + print_info_msg "$VERBOSE" " + All executables will be submitted with command \'${RUN_CMD_FCST}\'." +fi # #----------------------------------------------------------------------- # @@ -555,7 +519,7 @@ Call to function to create a diag table file for the current cycle's # #----------------------------------------------------------------------- # -$APRUN ${FV3_EXEC_FP} || print_err_msg_exit "\ +${RUN_CMD_FCST} ${FV3_EXEC_FP} || print_err_msg_exit "\ Call to executable to run FV3-LAM forecast returned with nonzero exit code." # diff --git a/scripts/exregional_run_post.sh b/scripts/exregional_run_post.sh index 025edd46e..a9b07efef 100755 --- a/scripts/exregional_run_post.sh +++ b/scripts/exregional_run_post.sh @@ -104,7 +104,7 @@ case "$MACHINE" in export MP_LABELIO=yes export OMP_NUM_THREADS=$threads - APRUN="aprun -j 1 -n${ntasks} -N${ptile} -d${threads} -cc depth" + RUN_CMD_POST="aprun -j 1 -n${ntasks} -N${ptile} -d${threads} -cc depth" ;; "WCOSS_DELL_P3") @@ -117,53 +117,25 @@ case "$MACHINE" in export MP_LABELIO=yes export OMP_NUM_THREADS=$threads - APRUN="mpirun" - ;; - - "HERA") - APRUN="srun" - ;; - - "ORION") - ulimit -s unlimited - ulimit -a - APRUN="srun" - ;; - - "JET") - APRUN="srun" - ;; - - "ODIN") - APRUN="srun -n 1" - ;; - - "CHEYENNE") - module list - nprocs=$(( NNODES_RUN_POST*PPN_RUN_POST )) - APRUN="mpirun -np $nprocs" - ;; - - "STAMPEDE") - nprocs=$(( NNODES_RUN_POST*PPN_RUN_POST )) - APRUN="ibrun -n $nprocs" - ;; - - "MACOS") - APRUN=$RUN_CMD_POST - ;; - - "LINUX") - APRUN=$RUN_CMD_POST + RUN_CMD_POST="mpirun" ;; *) - print_err_msg_exit "\ -Run command has not been specified for this machine: - MACHINE = \"$MACHINE\"" + source ${MACHINE_FILE} ;; esac + +nprocs=$(( NNODES_RUN_POST*PPN_RUN_POST )) +if [ -z ${RUN_CMD_POST:-} ] ; then + print_err_msg_exit "\ + Run command was not set in machine file. \ + Please set RUN_CMD_POST for your platform" +else + RUN_CMD_POST=$(eval echo ${RUN_CMD_POST}) + print_info_msg "$VERBOSE" " + All executables will be submitted with command \'${RUN_CMD_POST}\'." +fi # #----------------------------------------------------------------------- # @@ -294,7 +266,7 @@ EOF print_info_msg "$VERBOSE" " Starting post-processing for fhr = $fhr hr..." -${APRUN} ${EXECDIR}/upp.x < itag || print_err_msg_exit "\ +${RUN_CMD_POST} ${EXECDIR}/upp.x < itag || print_err_msg_exit "\ Call to executable to run post for forecast hour $fhr returned with non- zero exit code." # diff --git a/tests/WE2E/run_WE2E_tests.sh b/tests/WE2E/run_WE2E_tests.sh index 15db83c3d..776c80d28 100755 --- a/tests/WE2E/run_WE2E_tests.sh +++ b/tests/WE2E/run_WE2E_tests.sh @@ -89,6 +89,7 @@ Usage: [use_cron_to_relaunch=\"...\"] \\ [cron_relaunch_intvl_mnts=\"...\"] \\ [verbose=\"...\"] \\ + [machine_file=\"...\"] \\ [stmp=\"...\"] \\ [ptmp=\"...\"] @@ -170,6 +171,10 @@ Note that it is not possible to specify a different value for VERBOSE for each test via this argument; either all tests will have VERBOSE set to \"TRUE\" or all will have it set to \"FALSE\". +machine_file: +Optional argument to set the full path to a machine configuration file. +If not set, a supported platform machine file may be used. + stmp: Argument used to explicitly set the experiment variable STMP in the experiment configuration files of all the WE2E tests the user wants to @@ -225,6 +230,7 @@ valid_args=( \ "use_cron_to_relaunch" \ "cron_relaunch_intvl_mnts" \ "verbose" \ + "machine_file" \ "stmp" \ "ptmp" \ ) @@ -664,6 +670,13 @@ Please correct and rerun." CRON_RELAUNCH_INTVL_MNTS=${cron_relaunch_intvl_mnts:-"02"} VERBOSE=${verbose:-"TRUE"} + MACHINE_FILE=${machine_file:-"${ushdir}/machine/${machine,,}.sh"} + + # Set the machine-specific configuration settings by sourcing the + # machine file in the ush directory + + source $MACHINE_FILE + expt_config_str=${expt_config_str}"\ # # The machine on which to run, the account to which to charge computational @@ -689,6 +702,10 @@ EXPT_SUBDIR=\"${EXPT_SUBDIR}\" USE_CRON_TO_RELAUNCH=\"${USE_CRON_TO_RELAUNCH}\" CRON_RELAUNCH_INTVL_MNTS=\"${CRON_RELAUNCH_INTVL_MNTS}\" # +# Path to machine configuration file. +# +MACHINE_FILE=\"${MACHINE_FILE}\" +# # Flag specifying whether to run in verbose mode. # VERBOSE=\"${VERBOSE}\"" @@ -729,17 +746,9 @@ VERBOSE=\"${VERBOSE}\"" [ "${RUN_TASK_MAKE_OROG}" = "FALSE" ] || \ [ "${RUN_TASK_MAKE_SFC_CLIMO}" = "FALSE" ]; then - if [ "$MACHINE" = "WCOSS_CRAY" ]; then - pregen_basedir="/gpfs/hps3/emc/meso/noscrub/UFS_SRW_App/FV3LAM_pregen" - elif [ "$MACHINE" = "WCOSS_DELL_P3" ]; then - pregen_basedir="/gpfs/dell2/emc/modeling/noscrub/UFS_SRW_App/FV3LAM_pregen" - elif [ "$MACHINE" = "HERA" ]; then - pregen_basedir="/scratch2/BMC/det/FV3LAM_pregen" - elif [ "$MACHINE" = "JET" ]; then - pregen_basedir="/mnt/lfs4/BMC/wrfruc/FV3-LAM/pregen" - elif [ "$MACHINE" = "CHEYENNE" ]; then - pregen_basedir="/glade/p/ral/jntp/UFS_CAM/FV3LAM_pregen" - else + pregen_basedir=${TEST_PREGEN_BASEDIR:-} + + if [ ! -d "${pregen_basedir:-}" ] ; then print_err_msg_exit "\ The base directory (pregen_basedir) in which the pregenerated grid, orography, and/or surface climatology files are located has not been @@ -837,37 +846,7 @@ SFC_CLIMO_DIR=\"${SFC_CLIMO_DIR}\"" # RUN=\"\${EXPT_SUBDIR}\" envir=\"\${EXPT_SUBDIR}\"" -# -# Set FIXLAM_NCO_BASEDIR. -# - if [ "$MACHINE" = "WCOSS_CRAY" ]; then - FIXLAM_NCO_BASEDIR="/gpfs/hps3/emc/meso/noscrub/UFS_SRW_App/FV3LAM_pregen" - elif [ "$MACHINE" = "WCOSS_DELL_P3" ]; then - FIXLAM_NCO_BASEDIR="/gpfs/dell2/emc/modeling/noscrub/UFS_SRW_App/FV3LAM_pregen" - elif [ "$MACHINE" = "HERA" ]; then - FIXLAM_NCO_BASEDIR="/scratch2/BMC/det/FV3LAM_pregen" - elif [ "$MACHINE" = "JET" ]; then - FIXLAM_NCO_BASEDIR="/mnt/lfs4/BMC/wrfruc/FV3-LAM/pregen" - elif [ "$MACHINE" = "CHEYENNE" ]; then - FIXLAM_NCO_BASEDIR="/needs/to/be/specified" - else - print_err_msg_exit "\ -The base directory (FIXLAM_NCO_BASEDIR) in which the pregenerated grid, -orography, and surface climatology \"fixed\" files used in NCO mode are -located has not been specified for this machine (MACHINE): - MACHINE= \"${MACHINE}\"" - fi - expt_config_str=${expt_config_str}" -# -# The base directory in which the pregenerated grid, orography, and surface -# climatology \"fixed\" files used in NCO mode are located. In NCO mode, -# the workflow scripts will create symlinks (in the directory specified -# by FIXLAM) to files in a subdirectory under FIXLAM_NCO_BASDEDIR, where -# the name of the subdirectory is the name of the predefined grid specified -# by PREDEF_GRID_NAME. -# -FIXLAM_NCO_BASEDIR=\"${FIXLAM_NCO_BASEDIR}\"" # # Set COMINgfs if using the FV3GFS or the GSMGFS as the external model # for ICs or LBCs. @@ -877,17 +856,9 @@ FIXLAM_NCO_BASEDIR=\"${FIXLAM_NCO_BASEDIR}\"" [ "${EXTRN_MDL_NAME_LBCS}" = "FV3GFS" ] || \ [ "${EXTRN_MDL_NAME_LBCS}" = "GSMGFS" ]; then - if [ "$MACHINE" = "WCOSS_CRAY" ]; then - COMINgfs="/gpfs/hps3/emc/meso/noscrub/UFS_SRW_App/COMGFS" - elif [ "$MACHINE" = "WCOSS_DELL_P3" ]; then - COMINgfs="/gpfs/dell2/emc/modeling/noscrub/UFS_SRW_App/COMGFS" - elif [ "$MACHINE" = "HERA" ]; then - COMINgfs="/scratch2/NCEPDEV/fv3-cam/noscrub/UFS_SRW_App/COMGFS" - elif [ "$MACHINE" = "JET" ]; then - COMINgfs="/lfs1/HFIP/hwrf-data/hafs-input/COMGFS" - elif [ "$MACHINE" = "CHEYENNE" ]; then - COMINgfs="/glade/scratch/ketefian/NCO_dirs/COMGFS" - else + COMINgfs=${TEST_COMINgfs:-} + + if [ ! -d "${COMINgfs:-}" ] ; then print_err_msg_exit "\ The directory (COMINgfs) that needs to be specified when running the workflow in NCO mode (RUN_ENVIR set to \"nco\") AND using the FV3GFS or @@ -931,19 +902,8 @@ PTMP=\"${PTMP}\"" # if [ "${USE_USER_STAGED_EXTRN_FILES}" = "TRUE" ]; then - if [ "$MACHINE" = "WCOSS_CRAY" ]; then - extrn_mdl_source_basedir="/gpfs/hps3/emc/meso/noscrub/UFS_SRW_App/extrn_mdl_files" - elif [ "$MACHINE" = "WCOSS_DELL_P3" ]; then - extrn_mdl_source_basedir="/gpfs/dell2/emc/modeling/noscrub/UFS_SRW_App/extrn_mdl_files" - elif [ "$MACHINE" = "HERA" ]; then - extrn_mdl_source_basedir="/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/staged_extrn_mdl_files" - elif [ "$MACHINE" = "JET" ]; then - extrn_mdl_source_basedir="/mnt/lfs1/BMC/gsd-fv3/Gerard.Ketefian/UFS_CAM/staged_extrn_mdl_files" - elif [ "$MACHINE" = "CHEYENNE" ]; then - extrn_mdl_source_basedir="/glade/p/ral/jntp/UFS_SRW_app/staged_extrn_mdl_files" - elif [ "$MACHINE" = "ORION" ]; then - extrn_mdl_source_basedir="/work/noaa/gsd-fv3-dev/gsketefia/UFS/staged_extrn_mdl_files" - else + extrn_mdl_source_basedir=${TEST_EXTRN_MDL_SOURCE_BASEDIR:-} + if [ ! -d "${extrn_mdl_source_basedir:-}" ] ; then print_err_msg_exit "\ The base directory (extrn_mdl_source_basedir) in which the user-staged external model files should be located has not been specified for this @@ -1017,7 +977,7 @@ EXTRN_MDL_FILES_LBCS=( $( printf "\"%s\" " "${EXTRN_MDL_FILES_LBCS[@]}" ))" # #----------------------------------------------------------------------- # -# Set MET and MET+ paths, if necessary. +# Check that MET directories have been set appropriately, if needed. # #----------------------------------------------------------------------- # @@ -1026,51 +986,54 @@ EXTRN_MDL_FILES_LBCS=( $( printf "\"%s\" " "${EXTRN_MDL_FILES_LBCS[@]}" ))" [ "${RUN_TASK_VX_ENSGRID}" = "TRUE" ] || \ [ "${RUN_TASK_VX_ENSPOINT}" = "TRUE" ]; then - if [ "$MACHINE" = "WCOSS_CRAY" ]; then - met_install_dir="/gpfs/hps3/emc/meso/noscrub/emc.metplus/met/10.0.0" - metplus_path="/gpfs/hps3/emc/meso/noscrub/emc.metplus/METplus/METplus-4.0.0" - ccpa_obs_dir="/gpfs/hps3/emc/meso/noscrub/UFS_SRW_App/obs_data/ccpa/proc" - mrms_obs_dir="/gpfs/hps3/emc/meso/noscrub/UFS_SRW_App/obs_data/mrms/proc" - ndas_obs_dir="/gpfs/hps3/emc/meso/noscrub/UFS_SRW_App/obs_data/ndas/proc" - met_bin_exec="exec" - elif [ "$MACHINE" = "WCOSS_DELL_P3" ]; then - met_install_dir="/gpfs/dell2/emc/verification/noscrub/emc.metplus/met/10.0.0" - metplus_path="/gpfs/dell2/emc/verification/noscrub/emc.metplus/METplus/METplus-4.0.0" - ccpa_obs_dir="/gpfs/dell2/emc/modeling/noscrub/UFS_SRW_App/obs_data/ccpa/proc" - mrms_obs_dir="/gpfs/dell2/emc/modeling/noscrub/UFS_SRW_App/obs_data/mrms/proc" - ndas_obs_dir="/gpfs/dell2/emc/modeling/noscrub/UFS_SRW_App/obs_data/ndas/proc" - met_bin_exec="exec" - elif [ "$MACHINE" = "HERA" ]; then - met_install_dir="/contrib/met/10.0.0" - metplus_path="/contrib/METplus/METplus-4.0.0" - ccpa_obs_dir="/scratch2/BMC/det/UFS_SRW_app/develop/obs_data/ccpa/proc" - mrms_obs_dir="/scratch2/BMC/det/UFS_SRW_app/develop/obs_data/mrms/proc" - ndas_obs_dir="/scratch2/BMC/det/UFS_SRW_app/develop/obs_data/ndas/proc" - met_bin_exec="bin" - elif [ "$MACHINE" = "CHEYENNE" ]; then - met_install_dir="/glade/p/ral/jntp/MET/MET_releases/10.0.0" - metplus_path="/glade/p/ral/jntp/MET/METplus/METplus-4.0.0" - ccpa_obs_dir="/glade/p/ral/jntp/UFS_SRW_app/develop/obs_data/ccpa/proc" - mrms_obs_dir="/glade/p/ral/jntp/UFS_SRW_app/develop/obs_data/mrms/proc" - ndas_obs_dir="/glade/p/ral/jntp/UFS_SRW_app/develop/obs_data/ndas/proc" - met_bin_exec="bin" - else - print_err_msg_exit "\ -The MET and MET+ paths (MET_INSTALL_DIR and MET_INSTALL_DIR) or the observation directories -(CCPA_OBS_DIR, MRMS_OBS_DIR, NDAS_OBS_DIR) have not been specified for this machine (MACHINE): - MACHINE= \"${MACHINE}\"" + check=0 + if [ ! -d ${MET_INSTALL_DIR} ] ; then + print_info_msg "\ + The MET installation location must be set for this machine! + MET_INSTALL_DIR = \"${MET_INSTALL_DIR}\"" + check=1 fi - expt_config_str=${expt_config_str}" -# -# MET and MET+ paths. -# -METPLUS_PATH=\"${metplus_path}\" -MET_INSTALL_DIR=\"${met_install_dir}\" -CCPA_OBS_DIR=\"${ccpa_obs_dir}\" -MRMS_OBS_DIR=\"${mrms_obs_dir}\" -NDAS_OBS_DIR=\"${ndas_obs_dir}\" -MET_BIN_EXEC=\"${met_bin_exec}\"" + if [ ! -d ${METPLUS_PATH} ] ; then + print_info_msg "\ + The MET+ installation location must be set for this machine! + METPLUS_PATH = \"${METPLUS_PATH}\"" + check=1 + fi + + if [ -z ${MET_BIN_EXEC} ] ; then + print_info_msg "\ + The MET execution command must be set for this machine! + MET_BIN_EXEC = \"${MET_BIN_EXEC}\"" + check=1 + fi + + if [ ! -d ${CCPA_OBS_DIR} ] ; then + print_info_msg "\ + The CCPA observation location must be set for this machine! + CCPA_OBS_DIR = \"${CCPA_OBS_DIR}\"" + check=1 + fi + + if [ ! -d ${MRMS_OBS_DIR} ] ; then + print_info_msg "\ + The MRMS observation location must be set for this machine! + MRMS_OBS_DIR = \"${MRMS_OBS_DIR}\"" + check=1 + fi + + if [ ! -d ${NDAS_OBS_DIR} ] ; then + print_info_msg "\ + The NDAS observation location must be set for this machine! + NDAS_OBS_DIR = \"${NDAS_OBS_DIR}\"" + check=1 + fi + + if [ ${check} = 1 ] ; then + print_err_msg_exit "\ + Please set MET variables in the machine file for \ + MACHINE = \"${MACHINE}\"" + fi fi # @@ -1147,16 +1110,11 @@ MAXTRIES_RUN_POST=\"${MAXTRIES_RUN_POST}\"" # #----------------------------------------------------------------------- # - if [ ! -z "${EXTRN_MDL_SYSBASEDIR_ICS}" ]; then + if [ -n "${EXTRN_MDL_SYSBASEDIR_ICS}" ]; then if [ "${EXTRN_MDL_SYSBASEDIR_ICS}" = "set_to_non_default_location_in_testing_script" ]; then - EXTRN_MDL_SYSBASEDIR_ICS="" - if [ "$MACHINE" = "HERA" ]; then - if [ "${EXTRN_MDL_NAME_ICS}" = "FV3GFS" ]; then - EXTRN_MDL_SYSBASEDIR_ICS="/scratch2/BMC/det/UFS_SRW_app/dummy_FV3GFS_sys_dir" - fi - fi + EXTRN_MDL_SYSBASEDIR_ICS="${TEST_ALT_EXTRN_MDL_SYSBASEDIR_ICS:-}" if [ -z "${EXTRN_MDL_SYSBASEDIR_ICS}" ]; then print_err_msg_exit "\ @@ -1167,19 +1125,21 @@ initial conditions (EXTRN_MDL_NAME_ICS) combination: EXTRN_MDL_NAME_ICS = \"${EXTRN_MDL_NAME_ICS}\"" fi - else + # Maintain any templates in EXTRN_MDL_SYSBASEDIR_ICS -- don't use + # quotes. + set_bash_param "${expt_config_fp}" \ + "EXTRN_MDL_SYSBASEDIR_ICS" ${EXTRN_MDL_SYSBASEDIR_ICS} - if [ ! -d "${EXTRN_MDL_SYSBASEDIR_ICS}" ]; then - print_err_msg_exit "\ + fi + + # Check the base directory for the specified location. + if [ ! -d "$(dirname ${EXTRN_MDL_SYSBASEDIR_ICS%%\$*})" ]; then + print_err_msg_exit "\ The non-default location specified by EXTRN_MDL_SYSBASEDIR_ICS does not exist or is not a directory: EXTRN_MDL_NAME_ICS = \"${EXTRN_MDL_NAME_ICS}\"" - fi - fi - set_bash_param "${expt_config_fp}" \ - "EXTRN_MDL_SYSBASEDIR_ICS" "${EXTRN_MDL_SYSBASEDIR_ICS}" fi # @@ -1189,16 +1149,11 @@ exist or is not a directory: # #----------------------------------------------------------------------- # - if [ ! -z "${EXTRN_MDL_SYSBASEDIR_LBCS}" ]; then + if [ -n "${EXTRN_MDL_SYSBASEDIR_LBCS}" ]; then if [ "${EXTRN_MDL_SYSBASEDIR_LBCS}" = "set_to_non_default_location_in_testing_script" ]; then - EXTRN_MDL_SYSBASEDIR_LBCS="" - if [ "$MACHINE" = "HERA" ]; then - if [ "${EXTRN_MDL_NAME_LBCS}" = "FV3GFS" ]; then - EXTRN_MDL_SYSBASEDIR_LBCS="/scratch2/BMC/det/UFS_SRW_app/dummy_FV3GFS_sys_dir" - fi - fi + EXTRN_MDL_SYSBASEDIR_LBCS="${TEST_ALT_EXTRN_MDL_SYSBASEDIR_LBCS:-}" if [ -z "${EXTRN_MDL_SYSBASEDIR_LBCS}" ]; then print_err_msg_exit "\ @@ -1209,19 +1164,21 @@ initial conditions (EXTRN_MDL_NAME_LBCS) combination: EXTRN_MDL_NAME_LBCS = \"${EXTRN_MDL_NAME_LBCS}\"" fi - else + # Maintain any templates in EXTRN_MDL_SYSBASEDIR_ICS -- don't use + # quotes. + set_bash_param "${expt_config_fp}" \ + "EXTRN_MDL_SYSBASEDIR_LBCS" ${EXTRN_MDL_SYSBASEDIR_LBCS} - if [ ! -d "${EXTRN_MDL_SYSBASEDIR_LBCS}" ]; then - print_err_msg_exit "\ + fi + + # Check the base directory for the specified location. + if [ ! -d "$(dirname ${EXTRN_MDL_SYSBASEDIR_LBCS%%\$*})" ]; then + print_err_msg_exit "\ The non-default location specified by EXTRN_MDL_SYSBASEDIR_LBCS does not exist or is not a directory: EXTRN_MDL_NAME_LBCS = \"${EXTRN_MDL_NAME_LBCS}\"" - fi - fi - set_bash_param "${expt_config_fp}" \ - "EXTRN_MDL_SYSBASEDIR_LBCS" "${EXTRN_MDL_SYSBASEDIR_LBCS}" fi # diff --git a/update_fork.pl b/update_fork.pl index 29dec44db..17cb67dc1 100755 --- a/update_fork.pl +++ b/update_fork.pl @@ -17,7 +17,7 @@ # 4. If all went well, you should see one of two different messages at the end: # - If your fork is already up-to-date, you should see "Already up-to-date." # - If your fork is not up-to-date, this script initiates a fast-forward merge to bring your fork -# up to date with the develop of the main repository (https://github.com/NOAA-EMC/regional_workflow). +# up to date with the develop of the main repository (https://github.com/ufs-community/regional_workflow). # Near the end git will print a line of statistics describing what changed, which will look # something like this: # @@ -55,7 +55,7 @@ } print "Username = $username\n"; -my $main_repo = "https://$username\@github.com/NOAA-EMC/regional_workflow.git"; +my $main_repo = "https://$username\@github.com/ufs-community/regional_workflow.git"; my $fork = "https://$username\@github.com/$username/regional_workflow.git"; # Set main repository as a remote repository named "upstream", per standard git conventions diff --git a/ush/bash_utils/boolify.sh b/ush/bash_utils/boolify.sh new file mode 100644 index 000000000..fe32090fd --- /dev/null +++ b/ush/bash_utils/boolify.sh @@ -0,0 +1,69 @@ +# +#----------------------------------------------------------------------- +# +# This file defines a function used to change a variety of input boolean +# strings to standard TRUE and FALSE +# +#----------------------------------------------------------------------- +# + +function boolify() { +# +#----------------------------------------------------------------------- +# +# Save current shell options (in a global array). Then set new options +# for this script/function. +# +#----------------------------------------------------------------------- +# + { save_shell_opts; set -u +x; } > /dev/null 2>&1 +# +#----------------------------------------------------------------------- +# +# Get the name of this function and input. +# +#----------------------------------------------------------------------- +# + local func_name="${FUNCNAME[0]}" + local input uc_input + + if [ "$#" -eq 1 ]; then + input="$1" + else + + print_err_msg_exit " +Incorrect number of arguments specified: + + Function name: \"${func_name}\" + Number of arguments specified: $# + +Usage: + + ${func_name} string + +where: + + string: + This is the string that should be converted to TRUE or FALSE +" + fi + + uc_input=$(echo_uppercase $input) + if [ "$uc_input" = "TRUE" ] || \ + [ "$uc_input" = "YES" ]; then + echo "TRUE" + elif [ "$uc_input" = "FALSE" ] || \ + [ "$uc_input" = "NO" ]; then + echo "FALSE" + fi + + # + #----------------------------------------------------------------------- + # + # Restore the shell options saved at the beginning of this script/func- + # tion. + # + #----------------------------------------------------------------------- + # + { restore_shell_opts; } > /dev/null 2>&1 +} diff --git a/ush/config_defaults.sh b/ush/config_defaults.sh index afb942856..e7860e021 100644 --- a/ush/config_defaults.sh +++ b/ush/config_defaults.sh @@ -48,6 +48,11 @@ RUN_ENVIR="nco" # Please see ush/valid_param_vals.sh for a full list of supported # platforms. # +# MACHINE_FILE: +# Path to a configuration file with machine-specific settings. If none +# is provided, setup.sh will attempt to set the path to for a supported +# platform. +# # ACCOUNT: # The account under which to submit jobs to the queue. # @@ -132,6 +137,7 @@ RUN_ENVIR="nco" #----------------------------------------------------------------------- # MACHINE="BIG_COMPUTER" +MACHINE_FILE="" ACCOUNT="project_name" WORKFLOW_MANAGER="none" NCORES_PER_NODE="" @@ -574,12 +580,12 @@ WRITE_DOPOST="FALSE" #----------------------------------------------------------------------- # MODEL="" -MET_INSTALL_DIR="/path/to/MET" +MET_INSTALL_DIR="" MET_BIN_EXEC="bin" -METPLUS_PATH="/path/to/METPlus" -CCPA_OBS_DIR="/path/to/observation-directory/ccpa/proc" -MRMS_OBS_DIR="/path/to/observation-directory/mrms/proc" -NDAS_OBS_DIR="/path/to/observation-directory/ndas/proc" +METPLUS_PATH="" +CCPA_OBS_DIR="" +MRMS_OBS_DIR="" +NDAS_OBS_DIR="" # #----------------------------------------------------------------------- # @@ -663,8 +669,8 @@ FV3GFS_FILE_FMT_LBCS="nemsio" # #----------------------------------------------------------------------- # -EXTRN_MDL_SYSBASEDIR_ICS="" -EXTRN_MDL_SYSBASEDIR_LBCS="" +EXTRN_MDL_SYSBASEDIR_ICS='' +EXTRN_MDL_SYSBASEDIR_LBCS='' # #----------------------------------------------------------------------- # diff --git a/ush/get_extrn_mdl_file_dir_info.sh b/ush/get_extrn_mdl_file_dir_info.sh index fdab7dad4..30a6e2d88 100755 --- a/ush/get_extrn_mdl_file_dir_info.sh +++ b/ush/get_extrn_mdl_file_dir_info.sh @@ -213,7 +213,7 @@ function get_extrn_mdl_file_dir_info() { hh=${cdate:8:2} mn="00" yyyymmdd=${cdate:0:8} - # Julian day -- not 3 digit day of month + # ddd is the Julian day -- not 3 digit day of month ddd=$( $DATE_UTIL --utc --date "${yyyy}-${mm}-${dd} ${hh}:${mn} UTC" "+%j" ) # #----------------------------------------------------------------------- @@ -436,55 +436,11 @@ bination of external model (extrn_mdl_name) and analysis or forecast #----------------------------------------------------------------------- # if [ "${anl_or_fcst}" = "ANL" ]; then - sysbasedir=${EXTRN_MDL_SYSBASEDIR_ICS} + sysdir=$(eval echo ${EXTRN_MDL_SYSBASEDIR_ICS}) elif [ "${anl_or_fcst}" = "FCST" ]; then - sysbasedir=${EXTRN_MDL_SYSBASEDIR_LBCS} + sysdir=$(eval echo ${EXTRN_MDL_SYSBASEDIR_LBCS}) fi - sysdir=$sysbasedir - # Use the basedir unless otherwise specified for special platform - # cases below. - if [ -n "${sysbasedir}" ] ; then - case "${extrn_mdl_name}" in - - "FV3GFS") - case "$MACHINE" in - "WCOSS_CRAY") - sysdir="$sysbasedir/gfs.${yyyymmdd}/${hh}/atmos" - ;; - "WCOSS_DELL_P3") - sysdir="$sysbasedir/gfs.${yyyymmdd}/${hh}/atmos" - ;; - "HERA") - sysdir="$sysbasedir/gfs.${yyyymmdd}/${hh}/atmos" - ;; - "ODIN") - sysdir="$sysbasedir/${yyyymmdd}" - ;; - "CHEYENNE") - sysdir="$sysbasedir/gfs.${yyyymmdd}/${hh}" - ;; - esac - ;; - - "RAP") - case "$MACHINE" in - "JET") - sysdir="$sysbasedir/${yyyymmdd}${hh}/postprd" - ;; - esac - ;; - - "HRRR") - case "$MACHINE" in - "JET") - sysdir="$sysbasedir/${yyyymmdd}${hh}/postprd" - ;; - esac - ;; - - esac - fi # #----------------------------------------------------------------------- # diff --git a/ush/load_modules_run_task.sh b/ush/load_modules_run_task.sh index 59e3e156f..28b0f5647 100755 --- a/ush/load_modules_run_task.sh +++ b/ush/load_modules_run_task.sh @@ -132,8 +132,6 @@ jjob_fp="$2" #----------------------------------------------------------------------- # -module purge - machine=$(echo_lowercase $MACHINE) env_fp="${SR_WX_APP_TOP_DIR}/env/${BUILD_ENV_FN}" module use "${SR_WX_APP_TOP_DIR}/env" diff --git a/ush/machine/cheyenne.sh b/ush/machine/cheyenne.sh new file mode 100755 index 000000000..a707901db --- /dev/null +++ b/ush/machine/cheyenne.sh @@ -0,0 +1,76 @@ +#!/bin/bash + +set -x + +function file_location() { + + # Return the default location of external model files on disk + + local external_file_fmt external_model location + + + external_model=${1} + external_file_fmt=${2} + + case ${external_model} in + + "FV3GFS") + location='/glade/p/ral/jntp/UFS_CAM/COMGFS/gfs.${yyyymmdd}/${hh}' + ;; + "*") + print_info_msg"\ + External model \'${external_model}\' does not have a default + location on Cheyenne. Please set a user-defined file location." + ;; + + esac + echo ${location:-} + +} + +EXTRN_MDL_SYSBASEDIR_ICS=${EXTRN_MDL_SYSBASEDIR_ICS:-$(file_location \ + ${EXTRN_MDL_NAME_ICS} \ + ${FV3GFS_FILE_FMT_ICS})} +EXTRN_MDL_SYSBASEDIR_LBCS=${EXTRN_MDL_SYSBASEDIR_LBCS:-$(file_location \ + ${EXTRN_MDL_NAME_LBCS} \ + ${FV3GFS_FILE_FMT_ICS})} + +# System Installations +MODULE_INIT_PATH=${MODULE_INIT_PATH:-/glade/u/apps/ch/opt/lmod/8.1.7/lmod/8.1.7/init/sh} + +# Architecture information +WORKFLOW_MANAGER="rocoto" +NCORES_PER_NODE="${NCORES_PER_NODE:-36}" +SCHED=${SCHED:-"pbspro"} +QUEUE_DEFAULT=${QUEUE_DEFAULT:-"regular"} +QUEUE_HPSS=${QUEUE_HPSS:-"regular"} +QUEUE_FCST=${QUEUE_FCST:-"regular"} + +# UFS SRW App specific paths +FIXgsm=${FIXgsm:-"/glade/p/ral/jntp/UFS_CAM/fix/fix_am"} +FIXaer=${FIXaer:-"/glade/p/ral/jntp/UFS_CAM/fix/fix_aer"} +FIXlut=${FIXlut:-"/glade/p/ral/jntp/UFS_CAM/fix/fix_lut"} +TOPO_DIR=${TOPO_DIR:-"/glade/p/ral/jntp/UFS_CAM/fix/fix_orog"} +SFC_CLIMO_INPUT_DIR=${SFC_CLIMO_INPUT_DIR:-"/glade/p/ral/jntp/UFS_CAM/fix/climo_fields_netcdf"} +FIXLAM_NCO_BASEDIR=${FIXLAM_NCO_BASEDIR:-"/needs/to/be/specified"} + +RUN_CMD_SERIAL="time" +RUN_CMD_UTILS='mpirun -np $nprocs' +RUN_CMD_FCST='mpirun -np ${PE_MEMBER01}' +RUN_CMD_POST='mpirun -np $nprocs' + +# MET Installation Locations +MET_INSTALL_DIR="/glade/p/ral/jntp/MET/MET_releases/10.0.0" +METPLUS_PATH="/glade/p/ral/jntp/MET/METplus/METplus-4.0.0" +CCPA_OBS_DIR="/glade/p/ral/jntp/UFS_SRW_app/develop/obs_data/ccpa/proc" +MRMS_OBS_DIR="/glade/p/ral/jntp/UFS_SRW_app/develop/obs_data/mrms/proc" +NDAS_OBS_DIR="/glade/p/ral/jntp/UFS_SRW_app/develop/obs_data/ndas/proc" +MET_BIN_EXEC="bin" + +# Test Data Locations +TEST_PREGEN_BASEDIR=/glade/p/ral/jntp/UFS_CAM/FV3LAM_pregen +TEST_COMINgfs=/glade/scratch/ketefian/NCO_dirs/COMGFS +TEST_EXTRN_MDL_SOURCE_BASEDIR=/glade/p/ral/jntp/UFS_SRW_app/staged_extrn_mdl_files + +ulimit -s unlimited +ulimit -a diff --git a/ush/machine/hera.sh b/ush/machine/hera.sh new file mode 100755 index 000000000..864a51c84 --- /dev/null +++ b/ush/machine/hera.sh @@ -0,0 +1,81 @@ +#!/bin/bash + +set -x + +function file_location() { + + # Return the default location of external model files on disk + + local external_file_fmt external_model location + + external_model=${1} + external_file_fmt=${2} + + case ${external_model} in + + "FV3GFS") + location='/scratch1/NCEPDEV/rstprod/com/gfs/prod/gfs.${yyyymmdd}/${hh}/atmos' + ;; + *) + print_info_msg"\ + External model \'${external_model}\' does not have a default + location on Hera. Will try to pull from HPSS" + ;; + + esac + echo ${location:-} +} + + +EXTRN_MDL_SYSBASEDIR_ICS=${EXTRN_MDL_SYSBASEDIR_ICS:-$(file_location \ + ${EXTRN_MDL_NAME_ICS} \ + ${FV3GFS_FILE_FMT_ICS})} +EXTRN_MDL_SYSBASEDIR_LBCS=${EXTRN_MDL_SYSBASEDIR_LBCS:-$(file_location \ + ${EXTRN_MDL_NAME_LBCS} \ + ${FV3GFS_FILE_FMT_ICS})} + +# System Installations +MODULE_INIT_PATH=${MODULE_INIT_PATH:-/apps/lmod/lmod/init/sh} + +# Architecture information +WORKFLOW_MANAGER="rocoto" +NCORES_PER_NODE=${NCORES_PER_NODE:-40} +SCHED=${SCHED:-"slurm"} +PARTITION_DEFAULT=${PARTITION_DEFAULT:-"hera"} +QUEUE_DEFAULT=${QUEUE_DEFAULT:-"batch"} +PARTITION_HPSS=${PARTITION_HPSS:-"service"} +QUEUE_HPSS=${QUEUE_HPSS:-"batch"} +PARTITION_FCST=${PARTITION_FCST:-"hera"} +QUEUE_FCST=${QUEUE_FCST:-"batch"} + +# UFS SRW App specific paths +FIXgsm=${FIXgsm:-"/scratch1/NCEPDEV/global/glopara/fix/fix_am"} +FIXaer=${FIXaer:-"/scratch1/NCEPDEV/global/glopara/fix/fix_aer"} +FIXlut=${FIXlut:-"/scratch1/NCEPDEV/global/glopara/fix/fix_lut"} +TOPO_DIR=${TOPO_DIR:-"/scratch1/NCEPDEV/global/glopara/fix/fix_orog"} +SFC_CLIMO_INPUT_DIR=${SFC_CLIMO_INPUT_DIR:-"/scratch1/NCEPDEV/global/glopara/fix/fix_sfc_climo"} +FIXLAM_NCO_BASEDIR=${FIXLAM_NCO_BASEDIR:-"/scratch2/BMC/det/FV3LAM_pregen"} + +RUN_CMD_SERIAL="time" +RUN_CMD_UTILS="srun" +RUN_CMD_FCST="srun" +RUN_CMD_POST="srun" + +# MET Installation Locations +MET_INSTALL_DIR="/contrib/met/10.0.0" +METPLUS_PATH="/contrib/METplus/METplus-4.0.0" +CCPA_OBS_DIR="/scratch2/BMC/det/UFS_SRW_app/develop/obs_data/ccpa/proc" +MRMS_OBS_DIR="/scratch2/BMC/det/UFS_SRW_app/develop/obs_data/mrms/proc" +NDAS_OBS_DIR="/scratch2/BMC/det/UFS_SRW_app/develop/obs_data/ndas/proc" +MET_BIN_EXEC="bin" + +# Test Data Locations +TEST_PREGEN_BASEDIR=/scratch2/BMC/det/FV3LAM_pregen +TEST_COMINgfs=/scratch2/NCEPDEV/fv3-cam/noscrub/UFS_SRW_App/COMGFS +TEST_EXTRN_MDL_SOURCE_BASEDIR=/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/staged_extrn_mdl_files +TEST_ALT_EXTRN_MDL_SYSBASEDIR_ICS=/scratch2/BMC/det/UFS_SRW_app/dummy_FV3GFS_sys_dir +TEST_ALT_EXTRN_MDL_SYSBASEDIR_LBCS=/scratch2/BMC/det/UFS_SRW_app/dummy_FV3GFS_sys_dir + + +ulimit -s unlimited +ulimit -a diff --git a/ush/machine/jet.sh b/ush/machine/jet.sh new file mode 100755 index 000000000..9b5472ecf --- /dev/null +++ b/ush/machine/jet.sh @@ -0,0 +1,86 @@ +#!/bin/bash + +set -x + +function file_location() { + + # Return the default location of external model files on disk + + local external_file_fmt external_model location + + external_model=${1} + external_file_fmt=${2} + + case ${external_model} in + "FV3GFS") + case $external_file_fmt in + "nemsio") + location='/public/data/grids/gfs/nemsio' + ;; + "grib2") + location='/public/data/grids/gfs/0p25deg/grib2' + ;; + "netcdf") + location='/public/data/grids/gfs/anl/netcdf/' + ;; + esac + ;; + "RAP") + location='/public/data/grids/rap/full/wrfprs/grib2' + ;; + "HRRR") + location='/public/data/grids/hrrr/conus/wrfprs/grib2' + ;; + "*") + print_info_msg"\ + External model \'${external_model}\' does not have a default + location on Jet. Will try to pull from HPSS." + ;; + + esac + echo ${location:-} +} + + +EXTRN_MDL_SYSBASEDIR_ICS=${EXTRN_MDL_SYSBASEDIR_ICS:-$(file_location \ + ${EXTRN_MDL_NAME_ICS} \ + ${FV3GFS_FILE_FMT_ICS})} +EXTRN_MDL_SYSBASEDIR_LBCS=${EXTRN_MDL_SYSBASEDIR_LBCS:-$(file_location \ + ${EXTRN_MDL_NAME_LBCS} \ + ${FV3GFS_FILE_FMT_ICS})} + +# System Installations +MODULE_INIT_PATH=${MODULE_INIT_PATH:-/apps/lmod/lmod/init/sh} + +# Architecture information +WORKFLOW_MANAGER="rocoto" +NCORES_PER_NODE=${NCORES_PER_NODE:-24} +SCHED=${SCHED:-"slurm"} +PARTITION_DEFAULT=${PARTITION_DEFAULT:-"sjet,vjet,kjet,xjet"} +QUEUE_DEFAULT=${QUEUE_DEFAULT:-"batch"} +PARTITION_HPSS=${PARTITION_HPSS:-"service"} +QUEUE_HPSS=${QUEUE_HPSS:-"batch"} +PARTITION_FCST=${PARTITION_FCST:-"sjet,vjet,kjet,xjet"} +QUEUE_FCST=${QUEUE_FCST:-"batch"} + +# UFS SRW App specific paths +FIXgsm=${FIXgsm:-"/lfs4/HFIP/hfv3gfs/glopara/git/fv3gfs/fix/fix_am"} +FIXaer=${FIXaer:-"/lfs4/HFIP/hfv3gfs/glopara/git/fv3gfs/fix/fix_aer"} +FIXlut=${FIXlut:-"/lfs4/HFIP/hfv3gfs/glopara/git/fv3gfs/fix/fix_lut"} +TOPO_DIR=${TOPO_DIR:-"/lfs4/HFIP/hfv3gfs/glopara/git/fv3gfs/fix/fix_orog"} +SFC_CLIMO_INPUT_DIR=${SFC_CLIMO_INPUT_DIR:-"/lfs4/HFIP/hfv3gfs/glopara/git/fv3gfs/fix/fix_sfc_climo"} +FIXLAM_NCO_BASEDIR=${FIXLAM_NCO_BASEDIR:-"/mnt/lfs4/BMC/wrfruc/FV3-LAM/pregen"} + +RUN_CMD_SERIAL="time" +RUN_CMD_UTILS="srun" +RUN_CMD_FCST="srun" +RUN_CMD_POST="srun" + +# Test Data Locations +TEST_PREGEN_BASEDIR=/mnt/lfs4/BMC/wrfruc/FV3-LAM/pregen +TEST_COMINgfs=/lfs1/HFIP/hwrf-data/hafs-input/COMGFS +TEST_EXTRN_MDL_SOURCE_BASEDIR=/mnt/lfs1/BMC/gsd-fv3/Gerard.Ketefian/UFS_CAM/staged_extrn_mdl_files + + +ulimit -s unlimited +ulimit -a diff --git a/ush/machine/odin.sh b/ush/machine/odin.sh new file mode 100755 index 000000000..a9245f521 --- /dev/null +++ b/ush/machine/odin.sh @@ -0,0 +1,64 @@ +#!/bin/bash + +set -x + +function file_location() { + + # Return the default location of external model files on disk + + local external_file_fmt external_model location + + external_model=${1} + external_file_fmt=${2} + + case ${external_model} in + + "GSMGFS") + location='/scratch/ywang/EPIC/GDAS/2019053000_mem001' + ;; + "FV3GFS") + location='/scratch/ywang/test_runs/FV3_regional/gfs/${yyyymmdd}' + ;; + "*") + print_info_msg"\ + External model \'${external_model}\' does not have a default + location on Odin Please set a user-defined file location." + ;; + esac + echo ${location:-} + +} + +EXTRN_MDL_SYSBASEDIR_ICS=${EXTRN_MDL_SYSBASEDIR_ICS:-$(file_location \ + ${EXTRN_MDL_NAME_ICS} \ + ${FV3GFS_FILE_FMT_ICS})} +EXTRN_MDL_SYSBASEDIR_LBCS=${EXTRN_MDL_SYSBASEDIR_LBCS:-$(file_location \ + ${EXTRN_MDL_NAME_LBCS} \ + ${FV3GFS_FILE_FMT_ICS})} + +# Architecture information +WORKFLOW_MANAGER="rocoto" +NCORES_PER_NODE=${NCORES_PER_NODE:-24} +SCHED=${SCHED:-"slurm"} +PARTITION_DEFAULT=${PARTITION_DEFAULT:-"workq"} +QUEUE_DEFAULT=${QUEUE_DEFAULT:-"workq"} +PARTITION_HPSS=${PARTITION_HPSS:-"workq"} +QUEUE_HPSS=${QUEUE_HPSS:-"workq"} +PARTITION_FCST=${PARTITION_FCST:-"workq"} +QUEUE_FCST=${QUEUE_FCST:-"workq"} + +# UFS SRW App specific paths +FIXgsm=${FIXgsm:-"/scratch/ywang/fix/theia_fix/fix_am"} +FIXaer=${FIXaer:-"/scratch/ywang/fix/theia_fix/fix_aer"} +FIXlut=${FIXlut:-"/scratch/ywang/fix/theia_fix/fix_lut"} +TOPO_DIR=${TOPO_DIR:-"/scratch/ywang/fix/theia_fix/fix_orog"} +SFC_CLIMO_INPUT_DIR=${SFC_CLIMO_INPUT_DIR:-"/scratch/ywang/fix/climo_fields_netcdf"} +FIXLAM_NCO_BASEDIR=${FIXLAM_NCO_BASEDIR:-"/needs/to/be/specified"} + +RUN_CMD_SERIAL="srun -n 1" +RUN_CMD_UTILS='srun -n $nprocs' +RUN_CMD_FCST='srun -n ${PE_MEMBER01}' +RUN_CMD_POST="srun -n 1" + +ulimit -s unlimited +ulimit -a diff --git a/ush/machine/orion.sh b/ush/machine/orion.sh new file mode 100755 index 000000000..9ed722375 --- /dev/null +++ b/ush/machine/orion.sh @@ -0,0 +1,67 @@ +#!/bin/bash + +set -x + +function file_location() { + + # Return the default location of external model files on disk + # Orion does not currently have any files staged on disk. + + local external_file_fmt external_model location + + external_model=${1} + external_file_fmt=${2} + + case ${external_model} in + + "*") + print_info_msg"\ + External model \'${external_model}\' does not have a default + location on Orion. Please set a user-defined file location." + ;; + + esac + echo ${location:-} + +} + + +EXTRN_MDL_SYSBASEDIR_ICS=${EXTRN_MDL_SYSBASEDIR_ICS:-$(file_location \ + ${EXTRN_MDL_NAME_ICS} \ + ${FV3GFS_FILE_FMT_ICS})} +EXTRN_MDL_SYSBASEDIR_LBCS=${EXTRN_MDL_SYSBASEDIR_LBCS:-$(file_location \ + ${EXTRN_MDL_NAME_LBCS} \ + ${FV3GFS_FILE_FMT_ICS})} + +# System Installations +MODULE_INIT_PATH=${MODULE_INIT_PATH:-/apps/lmod/lmod/init/sh} + +# Architecture information +WORKFLOW_MANAGER="rocoto" +NCORES_PER_NODE=${NCORES_PER_NODE:-40} +SCHED=${SCHED:-"slurm"} +PARTITION_DEFAULT=${PARTITION_DEFAULT:-"orion"} +QUEUE_DEFAULT=${QUEUE_DEFAULT:-"batch"} +PARTITION_HPSS=${PARTITION_HPSS:-"service"} +QUEUE_HPSS=${QUEUE_HPSS:-"batch"} +PARTITION_FCST=${PARTITION_FCST:-"orion"} +QUEUE_FCST=${QUEUE_FCST:-"batch"} + +# UFS SRW App specific paths +FIXgsm=${FIXgsm:-"/work/noaa/global/glopara/fix/fix_am"} +FIXaer=${FIXaer:-"/work/noaa/global/glopara/fix/fix_aer"} +FIXlut=${FIXlut:-"/work/noaa/global/glopara/fix/fix_lut"} +TOPO_DIR=${TOPO_DIR:-"/work/noaa/global/glopara/fix/fix_orog"} +SFC_CLIMO_INPUT_DIR=${SFC_CLIMO_INPUT_DIR:-"/work/noaa/global/glopara/fix/fix_sfc_climo"} +FIXLAM_NCO_BASEDIR=${FIXLAM_NCO_BASEDIR:-"/needs/to/be/specified"} + +RUN_CMD_SERIAL="time" +RUN_CMD_UTILS="srun" +RUN_CMD_FCST='srun -n ${PE_MEMBER01}' +RUN_CMD_POST="srun" + +# Test Data Locations +TEST_EXTRN_MDL_SOURCE_BASEDIR=/work/noaa/gsd-fv3-dev/gsketefia/UFS/staged_extrn_mdl_files + +ulimit -s unlimited +ulimit -a diff --git a/ush/machine/stampede.sh b/ush/machine/stampede.sh new file mode 100755 index 000000000..0ba943680 --- /dev/null +++ b/ush/machine/stampede.sh @@ -0,0 +1,64 @@ +#!/bin/bash + +set -x + +function file_location() { + + # Return the default location of external model files on disk + + local external_file_fmt external_model location + + external_model=${1} + external_file_fmt=${2} + + case ${external_model} in + + "GSMGFS") + ;& # Fall through. All files in same place + "FV3GFS") + location='/scratch/00315/tg455890/GDAS/20190530/2019053000_mem001' + ;; + "*") + print_err_msg_exit"\ + External model \'${external_model}\' does not have a default + location on Jet Please set a user-defined file location." + ;; + + esac + echo ${location:-} +} + + +SYSBASEDIR_ICS=${EXTRN_MDL_SYSBASEDIR_ICS:-$(file_location \ + ${EXTRN_MDL_NAME_ICS} \ + ${FV3GFS_FILE_FMT_ICS})} +EXTRN_MDL_SYSBASEDIR_LBCS=${EXTRN_MDL_SYSBASEDIR_LBCS:-$(file_location \ + ${EXTRN_MDL_NAME_LBCS} \ + ${FV3GFS_FILE_FMT_ICS})} + +# Architecture information +WORKFLOW_MANAGER="rocoto" +NCORES_PER_NODE="${NCORES_PER_NODE:-68}" +SCHED=${SCHED:-"slurm"} +PARTITION_DEFAULT=${PARTITION_DEFAULT:-"normal"} +QUEUE_DEFAULT=${QUEUE_DEFAULT:-"normal"} +PARTITION_HPSS=${PARTITION_HPSS:-"normal"} +QUEUE_HPSS=${QUEUE_HPSS:-"normal"} +PARTITION_FCST=${PARTITION_FCST:-"normal"} +QUEUE_FCST=${QUEUE_FCST:-"normal"} + +# UFS SRW App specific paths +FIXgsm=${FIXgsm:-"/work/00315/tg455890/stampede2/regional_fv3/fix_am"} +FIXaer=${FIXaer:-"/work/00315/tg455890/stampede2/regional_fv3/fix_aer"} +FIXlut=${FIXlut:-"/work/00315/tg455890/stampede2/regional_fv3/fix_lut"} +TOPO_DIR=${TOPO_DIR:-"/work/00315/tg455890/stampede2/regional_fv3/fix_orog"} +SFC_CLIMO_INPUT_DIR=${SFC_CLIMO_INPUT_DIR:-"/work/00315/tg455890/stampede2/regional_fv3/climo_fields_netcdf"} +FIXLAM_NCO_BASEDIR=${FIXLAM_NCO_BASEDIR:-"/needs/to/be/specified"} + +RUN_CMD_SERIAL="time" +RUN_CMD_UTILS='ibrun -np $nprocs' +RUN_CMD_FCST='ibrun -np $nprocs' +RUN_CMD_POST='ibrun -np $nprocs' + +ulimit -s unlimited +ulimit -a diff --git a/ush/machine/wcoss_cray.sh b/ush/machine/wcoss_cray.sh new file mode 100755 index 000000000..9d2836df5 --- /dev/null +++ b/ush/machine/wcoss_cray.sh @@ -0,0 +1,77 @@ +#!/bin/bash + +set -x + +function file_location() { + + # Return the default location of external model files on disk + + local external_file_fmt external_model location + + external_model=${1} + external_file_fmt=${2} + + case ${external_model} in + + "FV3GFS") + location='/gpfs/dell1/nco/ops/com/gfs/prod/gfs.${yyyymmdd}/${hh}/atmos' + ;; + "RAP") + location='/gpfs/hps/nco/ops/com/rap/prod' + ;; + "HRRR") + location='/gpfs/hps/nco/ops/com/hrrr/prod' + ;; + "NAM") + location='/gpfs/dell1/nco/ops/com/nam/prod' + ;; + "*") + print_err_msg_exit"\ + External model \'${external_model}\' does not have a default + location on Jet Please set a user-defined file location." + ;; + + esac + echo ${location:-} +} + + +EXTRN_MDL_SYSBASEDIR_ICS=${EXTRN_MDL_SYSBASEDIR_ICS:-$(file_location \ + ${EXTRN_MDL_NAME_ICS} \ + ${FV3GFS_FILE_FMT_ICS})} +EXTRN_MDL_SYSBASEDIR_LBCS=${EXTRN_MDL_SYSBASEDIR_LBCS:-$(file_location \ + ${EXTRN_MDL_NAME_LBCS} \ + ${FV3GFS_FILE_FMT_ICS})} + +# System Installations +MODULE_INIT_PATH=${MODULE_INIT_PATH:-/opt/modules/default/init/sh} + +# Architecture information +WORKFLOW_MANAGER="rocoto" +NCORES_PER_NODE=${NCORES_PER_NODE:-24} +SCHED=${SCHED:-"lsfcray"} +QUEUE_DEFAULT=${QUEUE_DEFAULT:-"dev"} +QUEUE_HPSS=${QUEUE_HPSS:-"dev_transfer"} +QUEUE_FCST=${QUEUE_FCST:-"dev"} +RELATIVE_LINK_FLAG="" + +# UFS SRW App specific paths +FIXgsm=${FIXgsm:-"/gpfs/hps3/emc/global/noscrub/emc.glopara/git/fv3gfs/fix/fix_am"} +FIXaer=${FIXaer:-"/gpfs/hps3/emc/global/noscrub/emc.glopara/git/fv3gfs/fix/fix_aer"} +FIXlut=${FIXlut:-"/gpfs/hps3/emc/global/noscrub/emc.glopara/git/fv3gfs/fix/fix_lut"} +TOPO_DIR=${TOPO_DIR:-"/gpfs/hps3/emc/global/noscrub/emc.glopara/git/fv3gfs/fix/fix_orog"} +SFC_CLIMO_INPUT_DIR=${SFC_CLIMO_INPUT_DIR:-"/gpfs/hps3/emc/global/noscrub/emc.glopara/git/fv3gfs/fix/fix_sfc_climo"} +FIXLAM_NCO_BASEDIR=${FIXLAM_NCO_BASEDIR:-"/gpfs/hps3/emc/meso/noscrub/UFS_SRW_App/FV3LAM_pregen"} + +# MET Installation Locations +MET_INSTALL_DIR="/gpfs/hps3/emc/meso/noscrub/emc.metplus/met/10.0.0" +METPLUS_PATH="/gpfs/hps3/emc/meso/noscrub/emc.metplus/METplus/METplus-4.0.0" +CCPA_OBS_DIR="/gpfs/hps3/emc/meso/noscrub/UFS_SRW_App/obs_data/ccpa/proc" +MRMS_OBS_DIR="/gpfs/hps3/emc/meso/noscrub/UFS_SRW_App/obs_data/mrms/proc" +NDAS_OBS_DIR="/gpfs/hps3/emc/meso/noscrub/UFS_SRW_App/obs_data/ndas/proc" +MET_BIN_EXEC="exec" + +# Test Data Locations +TEST_PREGEN_BASEDIR=/gpfs/hps3/emc/meso/noscrub/UFS_SRW_App/FV3LAM_pregen +TEST_COMINgfs=/gpfs/hps3/emc/meso/noscrub/UFS_SRW_App/COMGFS +TEST_EXTRN_MDL_SOURCE_BASEDIR=/gpfs/hps3/emc/meso/noscrub/UFS_SRW_App/extrn_mdl_files diff --git a/ush/machine/wcoss_dell_p3.sh b/ush/machine/wcoss_dell_p3.sh new file mode 100755 index 000000000..8ae99fdc1 --- /dev/null +++ b/ush/machine/wcoss_dell_p3.sh @@ -0,0 +1,78 @@ +#!/bin/bash + +set -x + +function file_location() { + + # Return the default location of external model files on disk + + local external_file_fmt external_model location + + external_model=${1} + external_file_fmt=${2} + + case ${external_model} in + + "FV3GFS") + location='/gpfs/dell1/nco/ops/com/gfs/prod/gfs.${yyyymmdd}/${hh}/atmos' + ;; + "RAP") + location='/gpfs/hps/nco/ops/com/rap/prod' + ;; + "HRRR") + location='/gpfs/hps/nco/ops/com/hrrr/prod' + ;; + "NAM") + location='/gpfs/dell1/nco/ops/com/nam/prod' + ;; + "*") + print_err_msg_exit"\ + External model \'${external_model}\' does not have a default + location on Jet Please set a user-defined file location." + ;; + + esac + echo ${location:-} +} + + +EXTRN_MDL_SYSBASEDIR_ICS=${EXTRN_MDL_SYSBASEDIR_ICS:-$(file_location \ + ${EXTRN_MDL_NAME_ICS} \ + ${FV3GFS_FILE_FMT_ICS})} +EXTRN_MDL_SYSBASEDIR_LBCS=${EXTRN_MDL_SYSBASEDIR_LBCS:-$(file_location \ + ${EXTRN_MDL_NAME_LBCS} \ + ${FV3GFS_FILE_FMT_ICS})} + +# System Installations +MODULE_INIT_PATH=${MODULE_INIT_PATH:-/opt/modules/default/init/sh} + +# Architecture information +WORKFLOW_MANAGER="rocoto" +NCORES_PER_NODE=${NCORES_PER_NODE:-24} +SCHED=${SCHED:-"lsf"} +QUEUE_DEFAULT=${QUEUE_DEFAULT:-"dev"} +QUEUE_HPSS=${QUEUE_HPSS:-"dev_transfer"} +QUEUE_FCST=${QUEUE_FCST:-"dev"} + +# UFS SRW App specific paths +FIXgsm=${FIXgsm:-"/gpfs/dell2/emc/modeling/noscrub/emc.glopara/git/fv3gfs/fix/fix_am"} +FIXaer=${FIXaer:-"/gpfs/dell2/emc/modeling/noscrub/emc.glopara/git/fv3gfs/fix/fix_aer"} +FIXlut=${FIXlut:-"/gpfs/dell2/emc/modeling/noscrub/emc.glopara/git/fv3gfs/fix/fix_lut"} +TOPO_DIR=${TOPO_DIR:-"/gpfs/dell2/emc/modeling/noscrub/emc.glopara/git/fv3gfs/fix/fix_orog"} +SFC_CLIMO_INPUT_DIR=${SFC_CLIMO_INPUT_DIR:-"/gpfs/dell2/emc/modeling/noscrub/emc.glopara/git/fv3gfs/fix/fix_sfc_climo"} +FIXLAM_NCO_BASEDIR=${FIXLAM_NCO_BASEDIR:-"/gpfs/dell2/emc/modeling/noscrub/UFS_SRW_App/FV3LAM_pregen"} + +# MET Installation Locations +MET_INSTALL_DIR="/gpfs/dell2/emc/verification/noscrub/emc.metplus/met/10.0.0" +METPLUS_PATH="/gpfs/dell2/emc/verification/noscrub/emc.metplus/METplus/METplus-4.0.0" +CCPA_OBS_DIR="/gpfs/dell2/emc/modeling/noscrub/UFS_SRW_App/obs_data/ccpa/proc" +MRMS_OBS_DIR="/gpfs/dell2/emc/modeling/noscrub/UFS_SRW_App/obs_data/mrms/proc" +NDAS_OBS_DIR="/gpfs/dell2/emc/modeling/noscrub/UFS_SRW_App/obs_data/ndas/proc" +MET_BIN_EXEC="exec" + + +# Test Data Locations +TEST_PREGEN_BASEDIR=/gpfs/dell2/emc/modeling/noscrub/UFS_SRW_App/FV3LAM_pregen +TEST_COMINgfs=/gpfs/dell2/emc/modeling/noscrub/UFS_SRW_App/COMGFS +TEST_EXTRN_MDL_SOURCE_BASEDIR=/gpfs/dell2/emc/modeling/noscrub/UFS_SRW_App/extrn_mdl_files + diff --git a/ush/make_grid_mosaic_file.sh b/ush/make_grid_mosaic_file.sh index 5adf2ac30..8abba8c33 100644 --- a/ush/make_grid_mosaic_file.sh +++ b/ush/make_grid_mosaic_file.sh @@ -51,6 +51,7 @@ function make_grid_mosaic_file() { "grid_dir" \ "grid_fn" \ "mosaic_fn" \ +"run_cmd" \ ) process_args valid_args "$@" # @@ -166,7 +167,7 @@ Please ensure that you've built this executable." # directory /abc/def and named ghi.nc.nc -- note the double ".nc" # extensions). # - $APRUN "${exec_fp}" \ + ${run_cmd} "${exec_fp}" \ --num_tiles 1 \ --dir "${grid_dir}" \ --tile_file "${grid_fn}" \ diff --git a/ush/set_extrn_mdl_params.sh b/ush/set_extrn_mdl_params.sh index e315c240b..f110a4c26 100644 --- a/ush/set_extrn_mdl_params.sh +++ b/ush/set_extrn_mdl_params.sh @@ -1,116 +1,10 @@ # #----------------------------------------------------------------------- # -# This file defines and then calls a function that sets known locations -# of files on supported platforms. +# This file sets some parameters that are model or mode specific. # #----------------------------------------------------------------------- # -function set_known_sys_dir() { - - # Usage: - # set_known_sys_dir model - # - # model is the name of the external model - # - local known_sys_dir model_name - - model=$1 - # - #----------------------------------------------------------------------- - # - # Set the system directory (i.e. location on disk, not on HPSS) in - # which the files generated by the external model specified by - # EXTRN_MDL_NAME_ICS that are necessary for generating initial - # condition (IC) and surface files for the FV3SAR are stored (usually - # for a limited time, e.g. for the GFS external model, 2 weeks on - # WCOSS and 2 days on hera). If for a given cycle these files are - # available in this system directory, they will be copied over to a - # subdirectory under the cycle directory. If these files are not - # available in the system directory, then we search for them - # elsewhere, e.g. in the mass store (HPSS). - # - #----------------------------------------------------------------------- - # - - # Set some default known locations on supported platforms. Not all - # platforms have known input locations - case "${model}" in - - "GSMGFS") - case "$MACHINE" in - "ODIN") - known_sys_dir=/scratch/ywang/EPIC/GDAS/2019053000_mem001 - ;; - "CHEYENNE") - known_sys_dir=/glade/p/ral/jntp/UFS_CAM/COMGFS - ;; - "STAMPEDE") - known_sys_dir=/scratch/00315/tg455890/GDAS/20190530/2019053000_mem001 - ;; - esac - ;; - - "FV3GFS") - case "$MACHINE" in - "WCOSS_CRAY") - ;& # Fall through - "WCOSS_DELL_P3") - known_sys_dir=/gpfs/dell1/nco/ops/com/gfs/prod - ;; - "HERA") - known_sys_dir=/scratch1/NCEPDEV/rstprod/com/gfs/prod - ;; - "JET") - known_sys_dir=/public/data/grids/gfs/nemsio - ;; - "ODIN") - known_sys_dir=/scratch/ywang/test_runs/FV3_regional/gfs - ;; - "STAMPEDE") - known_sys_dir=/scratch/00315/tg455890/GDAS/20190530/2019053000_mem001 - ;; - "CHEYENNE") - known_sys_dir=/glade/p/ral/jntp/UFS_CAM/COMGFS} - ;; - esac - ;; - - "RAP") - case "$MACHINE" in - "WCOSS_CRAY") - ;& # Fall through - "WCOSS_DELL_P3") - known_sys_dir=/gpfs/hps/nco/ops/com/rap/prod - ;; - esac - ;; - - "HRRR") - case "$MACHINE" in - "WCOSS_CRAY") - ;& # Fall through - "WCOSS_DELL_P3") - known_sys_dir=/gpfs/hps/nco/ops/com/hrrr/prod - ;; - esac - ;; - - "NAM") - case "$MACHINE" in - "WCOSS_CRAY") - ;& # Fall through - "WCOSS_DELL_P3") - known_sys_dir=/gpfs/dell1/nco/ops/com/nam/prod - ;; - esac - ;; - - esac - - echo $known_sys_dir -} - function set_extrn_mdl_params() { # #----------------------------------------------------------------------- @@ -147,6 +41,7 @@ function set_extrn_mdl_params() { ;; esac } + # #----------------------------------------------------------------------- # diff --git a/ush/setup.sh b/ush/setup.sh index d8db064c6..74426ef7d 100755 --- a/ush/setup.sh +++ b/ush/setup.sh @@ -50,6 +50,7 @@ cd_vrfy ${scrfunc_dir} # #----------------------------------------------------------------------- # + . ./source_util_funcs.sh print_info_msg " @@ -132,330 +133,77 @@ fi # #----------------------------------------------------------------------- # -# Make sure that RUN_ENVIR is set to a valid value. +# Make sure that user-defined variables are set to valid values # -#----------------------------------------------------------------------- -# -check_var_valid_value "RUN_ENVIR" "valid_vals_RUN_ENVIR" -# -#----------------------------------------------------------------------- -# -# Make sure that VERBOSE is set to a valid value. +# Set binary switch variables to either "TRUE" or "FALSE" by calling +# boolify so we don't have to consider other valid values later on # #----------------------------------------------------------------------- # +check_var_valid_value "RUN_ENVIR" "valid_vals_RUN_ENVIR" + check_var_valid_value "VERBOSE" "valid_vals_VERBOSE" -# -# Set VERBOSE to either "TRUE" or "FALSE" so we don't have to consider -# other valid values later on. -# -VERBOSE=$(echo_uppercase $VERBOSE) -if [ "$VERBOSE" = "TRUE" ] || \ - [ "$VERBOSE" = "YES" ]; then - VERBOSE="TRUE" -elif [ "$VERBOSE" = "FALSE" ] || \ - [ "$VERBOSE" = "NO" ]; then - VERBOSE="FALSE" -fi -# -#----------------------------------------------------------------------- -# -# Make sure that DEBUG is set to a valid value. -# -#----------------------------------------------------------------------- -# +VERBOSE=$(boolify $VERBOSE) + check_var_valid_value "DEBUG" "valid_vals_DEBUG" -# -# Set DEBUG to either "TRUE" or "FALSE" so we don't have to consider -# other valid values later on. -# -DEBUG=$(echo_uppercase $DEBUG) -if [ "$DEBUG" = "TRUE" ] || \ - [ "$DEBUG" = "YES" ]; then - DEBUG="TRUE" -elif [ "$DEBUG" = "FALSE" ] || \ - [ "$DEBUG" = "NO" ]; then - DEBUG="FALSE" -fi +DEBUG=$(boolify $DEBUG) # #----------------------------------------------------------------------- # -# If DEBUG is set to "TRUE" but VERBOSE is set to "FALSE", reset VERBOSE -# to "TRUE" to print out all of the VERBOSE output (in addition to any -# DEBUG output). +# If DEBUG is set to "TRUE", set VERBOSE to "TRUE" to print out all +# of the VERBOSE output (in addition to any DEBUG output). # #----------------------------------------------------------------------- # -if [ "$DEBUG" = "TRUE" ] && [ "$VERBOSE" = "FALSE" ]; then +if [ "$DEBUG" = "TRUE" ]; then print_info_msg " -Resetting VERBOSE to \"TRUE\" because DEBUG has been set to \"TRUE\"..." - VERBOSE="TRUE" +Setting VERBOSE to \"TRUE\" because DEBUG has been set to \"TRUE\"..." + VERBOSE="TRUE" fi -# -#----------------------------------------------------------------------- -# -# Make sure that USE_CRON_TO_RELAUNCH is set to a valid value. -# -#----------------------------------------------------------------------- -# + check_var_valid_value "USE_CRON_TO_RELAUNCH" "valid_vals_USE_CRON_TO_RELAUNCH" -# -# Set USE_CRON_TO_RELAUNCH to either "TRUE" or "FALSE" so we don't have to consider -# other valid values later on. -# -USE_CRON_TO_RELAUNCH=$(echo_uppercase $USE_CRON_TO_RELAUNCH) -if [ "${USE_CRON_TO_RELAUNCH}" = "TRUE" ] || \ - [ "${USE_CRON_TO_RELAUNCH}" = "YES" ]; then - USE_CRON_TO_RELAUNCH="TRUE" -elif [ "${USE_CRON_TO_RELAUNCH}" = "FALSE" ] || \ - [ "${USE_CRON_TO_RELAUNCH}" = "NO" ]; then - USE_CRON_TO_RELAUNCH="FALSE" -fi -# -#----------------------------------------------------------------------- -# -# Make sure that RUN_TASK_MAKE_GRID is set to a valid value. -# -#----------------------------------------------------------------------- -# +USE_CRON_TO_RELAUNCH=$(boolify $USE_CRON_TO_RELAUNCH) + check_var_valid_value "RUN_TASK_MAKE_GRID" "valid_vals_RUN_TASK_MAKE_GRID" -# -# Set RUN_TASK_MAKE_GRID to either "TRUE" or "FALSE" so we don't have to -# consider other valid values later on. -# -RUN_TASK_MAKE_GRID=$(echo_uppercase $RUN_TASK_MAKE_GRID) -if [ "${RUN_TASK_MAKE_GRID}" = "TRUE" ] || \ - [ "${RUN_TASK_MAKE_GRID}" = "YES" ]; then - RUN_TASK_MAKE_GRID="TRUE" -elif [ "${RUN_TASK_MAKE_GRID}" = "FALSE" ] || \ - [ "${RUN_TASK_MAKE_GRID}" = "NO" ]; then - RUN_TASK_MAKE_GRID="FALSE" -fi -# -#----------------------------------------------------------------------- -# -# Make sure that RUN_TASK_MAKE_OROG is set to a valid value. -# -#----------------------------------------------------------------------- -# +RUN_TASK_MAKE_GRID=$(boolify $RUN_TASK_MAKE_GRID) + check_var_valid_value "RUN_TASK_MAKE_OROG" "valid_vals_RUN_TASK_MAKE_OROG" -# -# Set RUN_TASK_MAKE_OROG to either "TRUE" or "FALSE" so we don't have to -# consider other valid values later on. -# -RUN_TASK_MAKE_OROG=$(echo_uppercase $RUN_TASK_MAKE_OROG) -if [ "${RUN_TASK_MAKE_OROG}" = "TRUE" ] || \ - [ "${RUN_TASK_MAKE_OROG}" = "YES" ]; then - RUN_TASK_MAKE_OROG="TRUE" -elif [ "${RUN_TASK_MAKE_OROG}" = "FALSE" ] || \ - [ "${RUN_TASK_MAKE_OROG}" = "NO" ]; then - RUN_TASK_MAKE_OROG="FALSE" -fi -# -#----------------------------------------------------------------------- -# -# Make sure that RUN_TASK_MAKE_SFC_CLIMO is set to a valid value. -# -#----------------------------------------------------------------------- -# +RUN_TASK_MAKE_OROG=$(boolify $RUN_TASK_MAKE_OROG) + check_var_valid_value \ "RUN_TASK_MAKE_SFC_CLIMO" "valid_vals_RUN_TASK_MAKE_SFC_CLIMO" -# -# Set RUN_TASK_MAKE_SFC_CLIMO to either "TRUE" or "FALSE" so we don't -# have to consider other valid values later on. -# -RUN_TASK_MAKE_SFC_CLIMO=$(echo_uppercase $RUN_TASK_MAKE_SFC_CLIMO) -if [ "${RUN_TASK_MAKE_SFC_CLIMO}" = "TRUE" ] || \ - [ "${RUN_TASK_MAKE_SFC_CLIMO}" = "YES" ]; then - RUN_TASK_MAKE_SFC_CLIMO="TRUE" -elif [ "${RUN_TASK_MAKE_SFC_CLIMO}" = "FALSE" ] || \ - [ "${RUN_TASK_MAKE_SFC_CLIMO}" = "NO" ]; then - RUN_TASK_MAKE_SFC_CLIMO="FALSE" -fi -# -#----------------------------------------------------------------------- -# -# Make sure that RUN_TASK_RUN_POST is set to a valid value. -# -#----------------------------------------------------------------------- -# +RUN_TASK_MAKE_SFC_CLIMO=$(boolify $RUN_TASK_MAKE_SFC_CLIMO) + check_var_valid_value \ "RUN_TASK_RUN_POST" "valid_vals_RUN_TASK_RUN_POST" -# -# Set RUN_TASK_RUN_POST to either "TRUE" or "FALSE" so we don't -# have to consider other valid values later on. -# -RUN_TASK_RUN_POST=$(echo_uppercase $RUN_TASK_RUN_POST) -if [ "${RUN_TASK_RUN_POST}" = "TRUE" ] || \ - [ "${RUN_TASK_RUN_POST}" = "YES" ]; then - RUN_TASK_RUN_POST="TRUE" -elif [ "${RUN_TASK_RUN_POST}" = "FALSE" ] || \ - [ "${RUN_TASK_RUN_POST}" = "NO" ]; then - RUN_TASK_RUN_POST="FALSE" -fi -# -#----------------------------------------------------------------------- -# -# Make sure that RUN_TASK_VX_GRIDSTAT is set to a valid value. -# -#----------------------------------------------------------------------- -# +RUN_TASK_RUN_POST=$(boolify $RUN_TASK_RUN_POST) + check_var_valid_value "RUN_TASK_VX_GRIDSTAT" "valid_vals_RUN_TASK_VX_GRIDSTAT" -# -# Set RUN_TASK_VX_GRIDSTAT to either "TRUE" or "FALSE" so we don't have to -# consider other valid values later on. -# -RUN_TASK_VX_GRIDSTAT=$(echo_uppercase $RUN_TASK_VX_GRIDSTAT) -if [ "${RUN_TASK_VX_GRIDSTAT}" = "TRUE" ] || \ - [ "${RUN_TASK_VX_GRIDSTAT}" = "YES" ]; then - RUN_TASK_VX_GRIDSTAT="TRUE" -elif [ "${RUN_TASK_VX_GRIDSTAT}" = "FALSE" ] || \ - [ "${RUN_TASK_VX_GRIDSTAT}" = "NO" ]; then - RUN_TASK_VX_GRIDSTAT="FALSE" -fi -# -#----------------------------------------------------------------------- -# -# Make sure that RUN_TASK_VX_POINTSTAT is set to a valid value. -# -#----------------------------------------------------------------------- -# +RUN_TASK_VX_GRIDSTAT=$(boolify $RUN_TASK_VX_GRIDSTAT) + check_var_valid_value "RUN_TASK_VX_POINTSTAT" "valid_vals_RUN_TASK_VX_POINTSTAT" -# -# Set RUN_TASK_VX_POINTSTAT to either "TRUE" or "FALSE" so we don't have to -# consider other valid values later on. -# -RUN_TASK_VX_POINTSTAT=$(echo_uppercase $RUN_TASK_VX_POINTSTAT) -if [ "${RUN_TASK_VX_POINTSTAT}" = "TRUE" ] || \ - [ "${RUN_TASK_VX_POINTSTAT}" = "YES" ]; then - RUN_TASK_VX_POINTSTAT="TRUE" -elif [ "${RUN_TASK_VX_POINTSTAT}" = "FALSE" ] || \ - [ "${RUN_TASK_VX_POINTSTAT}" = "NO" ]; then - RUN_TASK_VX_POINTSTAT="FALSE" -fi +RUN_TASK_VX_POINTSTAT=$(boolify $RUN_TASK_VX_POINTSTAT) -# -#----------------------------------------------------------------------- -# -# Make sure that RUN_TASK_VX_ENSGRID is set to a valid value. -# -#----------------------------------------------------------------------- -# check_var_valid_value "RUN_TASK_VX_ENSGRID" "valid_vals_RUN_TASK_VX_ENSGRID" -# -# Set RUN_TASK_VX_ENSGRID to either "TRUE" or "FALSE" so we don't have to -# consider other valid values later on. -# -RUN_TASK_VX_ENSGRID=$(echo_uppercase $RUN_TASK_VX_ENSGRID) -if [ "${RUN_TASK_VX_ENSGRID}" = "TRUE" ] || \ - [ "${RUN_TASK_VX_ENSGRID}" = "YES" ]; then - RUN_TASK_VX_ENSGRID="TRUE" -elif [ "${RUN_TASK_VX_ENSGRID}" = "FALSE" ] || \ - [ "${RUN_TASK_VX_ENSGRID}" = "NO" ]; then - RUN_TASK_VX_ENSGRID="FALSE" -fi +RUN_TASK_VX_ENSGRID=$(boolify $RUN_TASK_VX_ENSGRID) -# -# -#----------------------------------------------------------------------- -# -# Make sure that RUN_TASK_VX_ENSPOINT is set to a valid value. -# -#----------------------------------------------------------------------- -# check_var_valid_value "RUN_TASK_VX_ENSPOINT" "valid_vals_RUN_TASK_VX_ENSPOINT" -# -# Set RUN_TASK_VX_ENSPOINT to either "TRUE" or "FALSE" so we don't have to -# consider other valid values later on. -# -RUN_TASK_VX_ENSPOINT=$(echo_uppercase $RUN_TASK_VX_ENSPOINT) -if [ "${RUN_TASK_VX_ENSPOINT}" = "TRUE" ] || \ - [ "${RUN_TASK_VX_ENSPOINT}" = "YES" ]; then - RUN_TASK_VX_ENSPOINT="TRUE" -elif [ "${RUN_TASK_VX_ENSPOINT}" = "FALSE" ] || \ - [ "${RUN_TASK_VX_ENSPOINT}" = "NO" ]; then - RUN_TASK_VX_ENSPOINT="FALSE" -fi -# -#----------------------------------------------------------------------- -# -# Make sure that DO_SHUM is set to a valid value. -# -#----------------------------------------------------------------------- -# +RUN_TASK_VX_ENSPOINT=$(boolify $RUN_TASK_VX_ENSPOINT) + +check_var_valid_value "USE_FVCOM" "valid_vals_USE_FVCOM" +USE_FVCOM=$(boolify $USE_FVCOM) + check_var_valid_value "DO_SHUM" "valid_vals_DO_SHUM" -# -# Set DO_SHUM to either "TRUE" or "FALSE" so we don't -# have to consider other valid values later on. -# -DO_SHUM=$(echo_uppercase $DO_SHUM) -if [ "${DO_SHUM}" = "TRUE" ] || \ - [ "${DO_SHUM}" = "YES" ]; then - DO_SHUM="TRUE" -elif [ "${DO_SHUM}" = "FALSE" ] || \ - [ "${DO_SHUM}" = "NO" ]; then - DO_SHUM="FALSE" -fi -# -#----------------------------------------------------------------------- -# -# Make sure that DO_SPPT is set to a valid value. -# -#----------------------------------------------------------------------- -# +DO_SHUM=$(boolify $DO_SHUM) + check_var_valid_value "DO_SPPT" "valid_vals_DO_SPPT" -# -# Set DO_SPPT to either "TRUE" or "FALSE" so we don't -# have to consider other valid values later on. -# -DO_SPPT=$(echo_uppercase $DO_SPPT) -if [ "${DO_SPPT}" = "TRUE" ] || \ - [ "${DO_SPPT}" = "YES" ]; then - DO_SPPT="TRUE" -elif [ "${DO_SPPT}" = "FALSE" ] || \ - [ "${DO_SPPT}" = "NO" ]; then - DO_SPPT="FALSE" -fi -# -#----------------------------------------------------------------------- -# -# Make sure that DO_SKEB is set to a valid value. -# -#----------------------------------------------------------------------- -# +DO_SPPT=$(boolify $DO_SPPT) + check_var_valid_value "DO_SKEB" "valid_vals_DO_SKEB" -# -# Set DO_SKEB to either "TRUE" or "FALSE" so we don't -# have to consider other valid values later on. -# -DO_SKEB=$(echo_uppercase $DO_SKEB) -if [ "${DO_SKEB}" = "TRUE" ] || \ - [ "${DO_SKEB}" = "YES" ]; then - DO_SKEB="TRUE" -elif [ "${DO_SKEB}" = "FALSE" ] || \ - [ "${DO_SKEB}" = "NO" ]; then - DO_SKEB="FALSE" -fi -# -#----------------------------------------------------------------------- -# -# Make sure that DO_SPP is set to a valid value. -# -#----------------------------------------------------------------------- -# +DO_SKEB=$(boolify $DO_SKEB) + check_var_valid_value "DO_SPP" "valid_vals_DO_SPP" -# -# Set DO_SPP to either "TRUE" or "FALSE" so we don't -# have to consider other valid values later on. -# -DO_SPP=$(echo_uppercase $DO_SPP) -if [ "${DO_SPP}" = "TRUE" ] || \ - [ "${DO_SPP}" = "YES" ]; then - DO_SPP="TRUE" -elif [ "${DO_SPP}" = "FALSE" ] || \ - [ "${DO_SPP}" = "NO" ]; then - DO_SPP="FALSE" -fi +DO_SPP=$(boolify $DO_SPP) # #----------------------------------------------------------------------- # @@ -491,6 +239,19 @@ fi # #----------------------------------------------------------------------- # +check_var_valid_value "SUB_HOURLY_POST" "valid_vals_SUB_HOURLY_POST" +SUB_HOURLY_POST=$(boolify $SUB_HOURLY_POST) +# +#----------------------------------------------------------------------- +# +# Make sure that DOT_OR_USCORE is set to a valid value. +# +#----------------------------------------------------------------------- +# +check_var_valid_value "DOT_OR_USCORE" "valid_vals_DOT_OR_USCORE" +# +#----------------------------------------------------------------------- +# # Make sure that USE_FVCOM is set to a valid value and assign directory # and file names. # @@ -499,49 +260,153 @@ fi #----------------------------------------------------------------------- # check_var_valid_value "USE_FVCOM" "valid_vals_USE_FVCOM" +USE_FVCOM=$(boolify $USE_FVCOM) check_var_valid_value "FVCOM_WCSTART" "valid_vals_FVCOM_WCSTART" +FVCOM_WCSTART=$(echo_lowercase $FVCOM_WCSTART) # -# Set USE_FVCOM to either "TRUE" or "FALSE" so we don't have to consider -# other valid values later on. +#----------------------------------------------------------------------- # -USE_FVCOM=$(echo_uppercase $USE_FVCOM) -if [ "$USE_FVCOM" = "TRUE" ] || \ - [ "$USE_FVCOM" = "YES" ]; then - USE_FVCOM="TRUE" -elif [ "$USE_FVCOM" = "FALSE" ] || \ - [ "$USE_FVCOM" = "NO" ]; then - USE_FVCOM="FALSE" -fi -FVCOM_WCSTART=$(echo_lowercase $FVCOM_WCSTART) +# Set various directories. +# +# HOMErrfs: +# Top directory of the clone of the FV3-LAM workflow git repository. +# +# USHDIR: +# Directory containing the shell scripts called by the workflow. +# +# SCRIPTSDIR: +# Directory containing the ex scripts called by the workflow. +# +# JOBSSDIR: +# Directory containing the jjobs scripts called by the workflow. +# +# SORCDIR: +# Directory containing various source codes. +# +# PARMDIR: +# Directory containing parameter files, template files, etc. +# +# EXECDIR: +# Directory containing various executable files. +# +# TEMPLATE_DIR: +# Directory in which templates of various FV3-LAM input files are locat- +# ed. +# +# UFS_WTHR_MDL_DIR: +# Directory in which the (NEMS-enabled) FV3-LAM application is located. +# This directory includes subdirectories for FV3, NEMS, and FMS. # #----------------------------------------------------------------------- # -# Make sure that SUB_HOURLY_POST and DT_SUBHOURLY_POST_MNTS are set to -# valid values. + +# +# The current script should be located in the ush subdirectory of the +# workflow directory. Thus, the workflow directory is the one above the +# directory of the current script. +# +SR_WX_APP_TOP_DIR=${scrfunc_dir%/*/*} + # #----------------------------------------------------------------------- # -check_var_valid_value "SUB_HOURLY_POST" "valid_vals_SUB_HOURLY_POST" +# Set the base directories in which codes obtained from external reposi- +# tories (using the manage_externals tool) are placed. Obtain the rela- +# tive paths to these directories by reading them in from the manage_ex- +# ternals configuration file. (Note that these are relative to the lo- +# cation of the configuration file.) Then form the full paths to these +# directories. Finally, make sure that each of these directories actu- +# ally exists. # -# Set SUB_HOURLY_POST to either "TRUE" or "FALSE" so we don't have to consider -# other valid values later on. +#----------------------------------------------------------------------- +# +mng_extrns_cfg_fn=$( $READLINK -f "${SR_WX_APP_TOP_DIR}/Externals.cfg" ) +property_name="local_path" +# +# Get the path to the workflow scripts # -SUB_HOURLY_POST=$(echo_uppercase $SUB_HOURLY_POST) -if [ "${SUB_HOURLY_POST}" = "TRUE" ] || \ - [ "${SUB_HOURLY_POST}" = "YES" ]; then - SUB_HOURLY_POST="TRUE" -elif [ "${SUB_HOURLY_POST}" = "FALSE" ] || \ - [ "${SUB_HOURLY_POST}" = "NO" ]; then - SUB_HOURLY_POST="FALSE" +external_name=regional_workflow +HOMErrfs=$( \ +get_manage_externals_config_property \ +"${mng_extrns_cfg_fn}" "${external_name}" "${property_name}" ) || \ +print_err_msg_exit "\ +Call to function get_manage_externals_config_property failed." +HOMErrfs="${SR_WX_APP_TOP_DIR}/${HOMErrfs}" +set +x +# +# Get the base directory of the FV3 forecast model code. +# +external_name="${FCST_MODEL}" +UFS_WTHR_MDL_DIR=$( \ +get_manage_externals_config_property \ +"${mng_extrns_cfg_fn}" "${external_name}" "${property_name}" ) || \ +print_err_msg_exit "\ +Call to function get_manage_externals_config_property failed." + +UFS_WTHR_MDL_DIR="${SR_WX_APP_TOP_DIR}/${UFS_WTHR_MDL_DIR}" +if [ ! -d "${UFS_WTHR_MDL_DIR}" ]; then + print_err_msg_exit "\ +The base directory in which the FV3 source code should be located +(UFS_WTHR_MDL_DIR) does not exist: + UFS_WTHR_MDL_DIR = \"${UFS_WTHR_MDL_DIR}\" +Please clone the external repository containing the code in this directory, +build the executable, and then rerun the workflow." +fi +# +# Get the base directory of the UFS_UTILS codes. +# +external_name="ufs_utils" +UFS_UTILS_DIR=$( \ +get_manage_externals_config_property \ +"${mng_extrns_cfg_fn}" "${external_name}" "${property_name}" ) || \ +print_err_msg_exit "\ +Call to function get_manage_externals_config_property failed." + +UFS_UTILS_DIR="${SR_WX_APP_TOP_DIR}/${UFS_UTILS_DIR}" +if [ ! -d "${UFS_UTILS_DIR}" ]; then + print_err_msg_exit "\ +The base directory in which the UFS utilities source codes should be lo- +cated (UFS_UTILS_DIR) does not exist: + UFS_UTILS_DIR = \"${UFS_UTILS_DIR}\" +Please clone the external repository containing the code in this direct- +ory, build the executables, and then rerun the workflow." fi # -#----------------------------------------------------------------------- +# Get the base directory of the UPP code. # -# Make sure that DOT_OR_USCORE is set to a valid value. +external_name="UPP" +UPP_DIR=$( \ +get_manage_externals_config_property \ +"${mng_extrns_cfg_fn}" "${external_name}" "${property_name}" ) || \ +print_err_msg_exit "\ +Call to function get_manage_externals_config_property failed." + +UPP_DIR="${SR_WX_APP_TOP_DIR}/${UPP_DIR}" +if [ ! -d "${UPP_DIR}" ]; then + print_err_msg_exit "\ +The base directory in which the UPP source code should be located +(UPP_DIR) does not exist: + UPP_DIR = \"${UPP_DIR}\" +Please clone the external repository containing the code in this directory, +build the executable, and then rerun the workflow." +fi + # -#----------------------------------------------------------------------- +# Define some other useful paths # -check_var_valid_value "DOT_OR_USCORE" "valid_vals_DOT_OR_USCORE" +USHDIR="$HOMErrfs/ush" +SCRIPTSDIR="$HOMErrfs/scripts" +JOBSDIR="$HOMErrfs/jobs" +SORCDIR="$HOMErrfs/sorc" +SRC_DIR="${SR_WX_APP_TOP_DIR}/src" +PARMDIR="$HOMErrfs/parm" +MODULES_DIR="$HOMErrfs/modulefiles" +EXECDIR="${SR_WX_APP_TOP_DIR}/bin" +TEMPLATE_DIR="$USHDIR/templates" +VX_CONFIG_DIR="$TEMPLATE_DIR/parm" +METPLUS_CONF="$TEMPLATE_DIR/parm/metplus" +MET_CONFIG="$TEMPLATE_DIR/parm/met" + # #----------------------------------------------------------------------- # @@ -555,149 +420,35 @@ check_var_valid_value "MACHINE" "valid_vals_MACHINE" # #----------------------------------------------------------------------- # -# Set the number of cores per node, the job scheduler, and the names of -# several queues. These queues are defined in the default and local -# workflow/experiment configuration script. -# -# Also, set the machine-dependent flag RELATIVE_OR_NULL that specifies -# the flag to pass to the link creation command (ln_vrfy) when attempting -# to create relative symlinks. On machines that don't support relative -# symlinks, it should be set to a null string. -# -#----------------------------------------------------------------------- -# -RELATIVE_LINK_FLAG="" -case $MACHINE in - - "WCOSS_CRAY") - WORKFLOW_MANAGER="rocoto" - NCORES_PER_NODE="${NCORES_PER_NODE:-24}" - SCHED="lsfcray" - QUEUE_DEFAULT=${QUEUE_DEFAULT:-"dev"} - QUEUE_HPSS=${QUEUE_HPSS:-"dev_transfer"} - QUEUE_FCST=${QUEUE_FCST:-"dev"} -# - RELATIVE_LINK_FLAG="" - ;; - - "WCOSS_DELL_P3") - WORKFLOW_MANAGER="rocoto" - NCORES_PER_NODE="${NCORES_PER_NODE:-24}" - SCHED="lsf" - QUEUE_DEFAULT=${QUEUE_DEFAULT:-"dev"} - QUEUE_HPSS=${QUEUE_HPSS:-"dev_transfer"} - QUEUE_FCST=${QUEUE_FCST:-"dev"} -# - RELATIVE_LINK_FLAG="--relative" - ;; - - "HERA") - WORKFLOW_MANAGER="rocoto" - NCORES_PER_NODE="${NCORES_PER_NODE:-40}" - SCHED=${SCHED:-"slurm"} - PARTITION_DEFAULT=${PARTITION_DEFAULT:-"hera"} - QUEUE_DEFAULT=${QUEUE_DEFAULT:-"batch"} - PARTITION_HPSS=${PARTITION_HPSS:-"service"} - QUEUE_HPSS=${QUEUE_HPSS:-"batch"} - PARTITION_FCST=${PARTITION_FCST:-"hera"} - QUEUE_FCST=${QUEUE_FCST:-"batch"} -# - RELATIVE_LINK_FLAG="--relative" - ;; - - "ORION") - WORKFLOW_MANAGER="rocoto" - NCORES_PER_NODE="${NCORES_PER_NODE:-40}" - SCHED=${SCHED:-"slurm"} - PARTITION_DEFAULT=${PARTITION_DEFAULT:-"orion"} - QUEUE_DEFAULT=${QUEUE_DEFAULT:-"batch"} - PARTITION_HPSS=${PARTITION_HPSS:-"service"} - QUEUE_HPSS=${QUEUE_HPSS:-"batch"} - PARTITION_FCST=${PARTITION_FCST:-"orion"} - QUEUE_FCST=${QUEUE_FCST:-"batch"} -# - RELATIVE_LINK_FLAG="--relative" - ;; - - "JET") - WORKFLOW_MANAGER="rocoto" - NCORES_PER_NODE="${NCORES_PER_NODE:-24}" - SCHED=${SCHED:-"slurm"} - PARTITION_DEFAULT=${PARTITION_DEFAULT:-"sjet,vjet,kjet,xjet"} - QUEUE_DEFAULT=${QUEUE_DEFAULT:-"batch"} - PARTITION_HPSS=${PARTITION_HPSS:-"service"} - QUEUE_HPSS=${QUEUE_HPSS:-"batch"} - PARTITION_FCST=${PARTITION_FCST:-"sjet,vjet,kjet,xjet"} - QUEUE_FCST=${QUEUE_FCST:-"batch"} -# - RELATIVE_LINK_FLAG="--relative" - ;; - - "ODIN") - WORKFLOW_MANAGER="rocoto" - NCORES_PER_NODE="${NCORES_PER_NODE:-24}" - SCHED=${SCHED:-"slurm"} - PARTITION_DEFAULT=${PARTITION_DEFAULT:-"workq"} - QUEUE_DEFAULT=${QUEUE_DEFAULT:-"workq"} - PARTITION_HPSS=${PARTITION_HPSS:-"workq"} - QUEUE_HPSS=${QUEUE_HPSS:-"workq"} - PARTITION_FCST=${PARTITION_FCST:-"workq"} - QUEUE_FCST=${QUEUE_FCST:-"workq"} -# - RELATIVE_LINK_FLAG="--relative" - ;; - - "CHEYENNE") - WORKFLOW_MANAGER="rocoto" - NCORES_PER_NODE="${NCORES_PER_NODE:-36}" - SCHED=${SCHED:-"pbspro"} - QUEUE_DEFAULT=${QUEUE_DEFAULT:-"regular"} - QUEUE_HPSS=${QUEUE_HPSS:-"regular"} - QUEUE_FCST=${QUEUE_FCST:-"regular"} -# - RELATIVE_LINK_FLAG="--relative" - ;; - - "STAMPEDE") - WORKFLOW_MANAGER="rocoto" - NCORES_PER_NODE="${NCORES_PER_NODE:-68}" - SCHED="slurm" - PARTITION_DEFAULT=${PARTITION_DEFAULT:-"normal"} - QUEUE_DEFAULT=${QUEUE_DEFAULT:-"normal"} - PARTITION_HPSS=${PARTITION_HPSS:-"normal"} - QUEUE_HPSS=${QUEUE_HPSS:-"normal"} - PARTITION_FCST=${PARTITION_FCST:-"normal"} - QUEUE_FCST=${QUEUE_FCST:-"normal"} -# - RELATIVE_LINK_FLAG="--relative" - ;; - - "MACOS") - WORKFLOW_MANAGER="none" - SCHED="none" - ;; - - "LINUX") - WORKFLOW_MANAGER=${WORKFLOW_MANAGER:-"none"} - SCHED=${SCHED:-"none"} - ;; - - "*") - NCORES_PER_NODE="2" # Need some arbitrary default value to avoid division by zero errors - - print_err_msg_exit "\ - You are running on an unknown platform! MACHINE=${MACHINE} is not a valid - choice." - ;; +# Source the machine config file containing architechture information, +# queue names, and supported input file paths. +# +#----------------------------------------------------------------------- +# +RELATIVE_LINK_FLAG="--relative" +MACHINE_FILE=${MACHINE_FILE:-${USHDIR}/machine/$(echo_lowercase $MACHINE).sh} +source ${MACHINE_FILE} -esac +if [ -z "${NCORES_PER_NODE:-}" ]; then + print_err_msg_exit "\ + NCORES_PER_NODE has not been specified in the file ${MACHINE_FILE} + Please ensure this value has been set for your desired platform. " +fi -if [ -z "$NCORES_PER_NODE" ]; then - print_err_msg_exit "\ - NCORES_PER_NODE is a required setting for your platform! Please - set it in config.sh. - MACHINE = ${MACHINE}" +if [ -z "$FIXgsm" -o -z "$FIXaer" -o -z "$FIXlut" -o -z "$TOPO_DIR" -o -z "$SFC_CLIMO_INPUT_DIR" ]; then + print_err_msg_exit "\ +One or more fix file directories have not been specified for this machine: + MACHINE = \"$MACHINE\" + FIXgsm = \"${FIXgsm:-\"\"} + FIXaer = \"${FIXaer:-\"\"} + FIXlut = \"${FIXlut:-\"\"} + TOPO_DIR = \"${TOPO_DIR:-\"\"} + SFC_CLIMO_INPUT_DIR = \"${SFC_CLIMO_INPUT_DIR:-\"\"} + FIXLAM_NCO_BASEDIR = \"${FIXLAM_NCO_BASEDIR:-\"\"} +You can specify the missing location(s) in ${machine_file}" fi + + # #----------------------------------------------------------------------- # @@ -817,14 +568,7 @@ check_var_valid_value "USE_MERRA_CLIMO" "valid_vals_USE_MERRA_CLIMO" # Set USE_MERRA_CLIMO to either "TRUE" or "FALSE" so we don't # have to consider other valid values later on. # -USE_MERRA_CLIMO=$(echo_uppercase $USE_MERRA_CLIMO) -if [ "${USE_MERRA_CLIMO}" = "TRUE" ] || \ - [ "${USE_MERRA_CLIMO}" = "YES" ]; then - USE_MERRA_CLIMO="TRUE" -elif [ "${USE_MERRA_CLIMO}" = "FALSE" ] || \ - [ "${USE_MERRA_CLIMO}" = "NO" ]; then - USE_MERRA_CLIMO="FALSE" -fi +USE_MERRA_CLIMO=$(boolify $USE_MERRA_CLIMO) # Force to "TRUE" in case of FV3_GFS_v15_thompson_mynn_lam3km: if [ "${CCPP_PHYS_SUITE}" = "FV3_GFS_v15_thompson_mynn_lam3km" ]; then USE_MERRA_CLIMO="TRUE" @@ -991,248 +735,7 @@ if [ $NUM_CYCLES -gt 90 ] ; then Too many cycles in ALL_CDATES to list, redefining in abbreviated form." ALL_CDATES="${DATE_FIRST_CYCL}${CYCL_HRS[0]}...${DATE_LAST_CYCL}${CYCL_HRS[-1]}" fi -# -#----------------------------------------------------------------------- -# -# Set various directories. -# -# HOMErrfs: -# Top directory of the clone of the FV3-LAM workflow git repository. -# -# USHDIR: -# Directory containing the shell scripts called by the workflow. -# -# SCRIPTSDIR: -# Directory containing the ex scripts called by the workflow. -# -# JOBSSDIR: -# Directory containing the jjobs scripts called by the workflow. -# -# SORCDIR: -# Directory containing various source codes. -# -# PARMDIR: -# Directory containing parameter files, template files, etc. -# -# EXECDIR: -# Directory containing various executable files. -# -# TEMPLATE_DIR: -# Directory in which templates of various FV3-LAM input files are located. -# -# UFS_WTHR_MDL_DIR: -# Directory in which the (NEMS-enabled) FV3-LAM application is located. -# This directory includes subdirectories for FV3, NEMS, and FMS. -# -#----------------------------------------------------------------------- -# - -# -# The current script should be located in the ush subdirectory of the -# workflow directory. Thus, the workflow directory is the one above the -# directory of the current script. Get the path to this latter directo- -# ry and save it in HOMErrfs. -# -SR_WX_APP_TOP_DIR=${scrfunc_dir%/*/*} -# GSK to do: Get HOMErrfs from Externals.cfg -HOMErrfs="${SR_WX_APP_TOP_DIR}/regional_workflow" - -USHDIR="$HOMErrfs/ush" -SCRIPTSDIR="$HOMErrfs/scripts" -JOBSDIR="$HOMErrfs/jobs" -SORCDIR="$HOMErrfs/sorc" -SRC_DIR="${SR_WX_APP_TOP_DIR}/src" -PARMDIR="$HOMErrfs/parm" -MODULES_DIR="$HOMErrfs/modulefiles" -EXECDIR="${SR_WX_APP_TOP_DIR}/bin" -TEMPLATE_DIR="$USHDIR/templates" -VX_CONFIG_DIR="$TEMPLATE_DIR/parm" -METPLUS_CONF="$TEMPLATE_DIR/parm/metplus" -MET_CONFIG="$TEMPLATE_DIR/parm/met" - -case "$MACHINE" in - - "WCOSS_CRAY") - FIXgsm=${FIXgsm:-"/gpfs/hps3/emc/global/noscrub/emc.glopara/git/fv3gfs/fix/fix_am"} - FIXaer=${FIXaer:-"/gpfs/hps3/emc/global/noscrub/emc.glopara/git/fv3gfs/fix/fix_aer"} - FIXlut=${FIXlut:-"/gpfs/hps3/emc/global/noscrub/emc.glopara/git/fv3gfs/fix/fix_lut"} - TOPO_DIR=${TOPO_DIR:-"/gpfs/hps3/emc/global/noscrub/emc.glopara/git/fv3gfs/fix/fix_orog"} - SFC_CLIMO_INPUT_DIR=${SFC_CLIMO_INPUT_DIR:-"/gpfs/hps3/emc/global/noscrub/emc.glopara/git/fv3gfs/fix/fix_sfc_climo"} - FIXLAM_NCO_BASEDIR=${FIXLAM_NCO_BASEDIR:-"/needs/to/be/specified"} - ;; - - "WCOSS_DELL_P3") - FIXgsm=${FIXgsm:-"/gpfs/dell2/emc/modeling/noscrub/emc.glopara/git/fv3gfs/fix/fix_am"} - FIXaer=${FIXaer:-"/gpfs/dell2/emc/modeling/noscrub/emc.glopara/git/fv3gfs/fix/fix_aer"} - FIXlut=${FIXlut:-"/gpfs/dell2/emc/modeling/noscrub/emc.glopara/git/fv3gfs/fix/fix_lut"} - TOPO_DIR=${TOPO_DIR:-"/gpfs/dell2/emc/modeling/noscrub/emc.glopara/git/fv3gfs/fix/fix_orog"} - SFC_CLIMO_INPUT_DIR=${SFC_CLIMO_INPUT_DIR:-"/gpfs/dell2/emc/modeling/noscrub/emc.glopara/git/fv3gfs/fix/fix_sfc_climo"} - FIXLAM_NCO_BASEDIR=${FIXLAM_NCO_BASEDIR:-"/needs/to/be/specified"} - ;; - - "HERA") - FIXgsm=${FIXgsm:-"/scratch1/NCEPDEV/global/glopara/fix/fix_am"} - FIXaer=${FIXaer:-"/scratch1/NCEPDEV/global/glopara/fix/fix_aer"} - FIXlut=${FIXlut:-"/scratch1/NCEPDEV/global/glopara/fix/fix_lut"} - TOPO_DIR=${TOPO_DIR:-"/scratch1/NCEPDEV/global/glopara/fix/fix_orog"} - SFC_CLIMO_INPUT_DIR=${SFC_CLIMO_INPUT_DIR:-"/scratch1/NCEPDEV/global/glopara/fix/fix_sfc_climo"} - FIXLAM_NCO_BASEDIR=${FIXLAM_NCO_BASEDIR:-"/scratch2/BMC/det/FV3LAM_pregen"} - ;; - - "ORION") - FIXgsm=${FIXgsm:-"/work/noaa/global/glopara/fix/fix_am"} - FIXaer=${FIXaer:-"/work/noaa/global/glopara/fix/fix_aer"} - FIXlut=${FIXlut:-"/work/noaa/global/glopara/fix/fix_lut"} - TOPO_DIR=${TOPO_DIR:-"/work/noaa/global/glopara/fix/fix_orog"} - SFC_CLIMO_INPUT_DIR=${SFC_CLIMO_INPUT_DIR:-"/work/noaa/global/glopara/fix/fix_sfc_climo"} - FIXLAM_NCO_BASEDIR=${FIXLAM_NCO_BASEDIR:-"/needs/to/be/specified"} - ;; - - "JET") - FIXgsm=${FIXgsm:-"/lfs4/HFIP/hfv3gfs/glopara/git/fv3gfs/fix/fix_am"} - FIXaer=${FIXaer:-"/lfs4/HFIP/hfv3gfs/glopara/git/fv3gfs/fix/fix_aer"} - FIXlut=${FIXlut:-"/lfs4/HFIP/hfv3gfs/glopara/git/fv3gfs/fix/fix_lut"} - TOPO_DIR=${TOPO_DIR:-"/lfs4/HFIP/hfv3gfs/glopara/git/fv3gfs/fix/fix_orog"} - SFC_CLIMO_INPUT_DIR=${SFC_CLIMO_INPUT_DIR:-"/lfs4/HFIP/hfv3gfs/glopara/git/fv3gfs/fix/fix_sfc_climo"} - FIXLAM_NCO_BASEDIR=${FIXLAM_NCO_BASEDIR:-"/needs/to/be/specified"} - ;; - - "ODIN") - FIXgsm=${FIXgsm:-"/scratch/ywang/fix/theia_fix/fix_am"} - FIXaer=${FIXaer:-"/scratch/ywang/fix/theia_fix/fix_aer"} - FIXlut=${FIXlut:-"/scratch/ywang/fix/theia_fix/fix_lut"} - TOPO_DIR=${TOPO_DIR:-"/scratch/ywang/fix/theia_fix/fix_orog"} - SFC_CLIMO_INPUT_DIR=${SFC_CLIMO_INPUT_DIR:-"/scratch/ywang/fix/climo_fields_netcdf"} - FIXLAM_NCO_BASEDIR=${FIXLAM_NCO_BASEDIR:-"/needs/to/be/specified"} - ;; - - "CHEYENNE") - FIXgsm=${FIXgsm:-"/glade/p/ral/jntp/UFS_CAM/fix/fix_am"} - FIXaer=${FIXaer:-"/glade/p/ral/jntp/UFS_CAM/fix/fix_aer"} - FIXlut=${FIXlut:-"/glade/p/ral/jntp/UFS_CAM/fix/fix_lut"} - TOPO_DIR=${TOPO_DIR:-"/glade/p/ral/jntp/UFS_CAM/fix/fix_orog"} - SFC_CLIMO_INPUT_DIR=${SFC_CLIMO_INPUT_DIR:-"/glade/p/ral/jntp/UFS_CAM/fix/climo_fields_netcdf"} - FIXLAM_NCO_BASEDIR=${FIXLAM_NCO_BASEDIR:-"/needs/to/be/specified"} - ;; - - "STAMPEDE") - FIXgsm=${FIXgsm:-"/work/00315/tg455890/stampede2/regional_fv3/fix_am"} - FIXaer=${FIXaer:-"/work/00315/tg455890/stampede2/regional_fv3/fix_aer"} - FIXlut=${FIXlut:-"/work/00315/tg455890/stampede2/regional_fv3/fix_lut"} - TOPO_DIR=${TOPO_DIR:-"/work/00315/tg455890/stampede2/regional_fv3/fix_orog"} - SFC_CLIMO_INPUT_DIR=${SFC_CLIMO_INPUT_DIR:-"/work/00315/tg455890/stampede2/regional_fv3/climo_fields_netcdf"} - FIXLAM_NCO_BASEDIR=${FIXLAM_NCO_BASEDIR:-"/needs/to/be/specified"} - ;; - - *) - if [ -z "$FIXgsm" -o -z "$FIXaer" -o -z "$FIXlut" -o -z "$TOPO_DIR" -o -z "$SFC_CLIMO_INPUT_DIR" ]; then - print_err_msg_exit "\ -One or more fix file directories have not been specified for this machine: - MACHINE = \"$MACHINE\" - FIXgsm = \"${FIXgsm:-\"\"} - FIXaer = \"${FIXaer:-\"\"} - FIXlut = \"${FIXlut:-\"\"} - TOPO_DIR = \"${TOPO_DIR:-\"\"} - SFC_CLIMO_INPUT_DIR = \"${SFC_CLIMO_INPUT_DIR:-\"\"} - FIXLAM_NCO_BASEDIR = \"${FIXLAM_NCO_BASEDIR:-\"\"} -You can specify the missing location(s) in ${EXPT_CONFIG_FN}." - fi - ;; - -esac -# -#----------------------------------------------------------------------- -# -# Set the base directories in which codes obtained from external reposi- -# tories (using the manage_externals tool) are placed. Obtain the rela- -# tive paths to these directories by reading them in from the manage_ex- -# ternals configuration file. (Note that these are relative to the lo- -# cation of the configuration file.) Then form the full paths to these -# directories. Finally, make sure that each of these directories actu- -# ally exists. -# -#----------------------------------------------------------------------- -# -mng_extrns_cfg_fn=$( $READLINK -f "${SR_WX_APP_TOP_DIR}/Externals.cfg" ) -property_name="local_path" -# -# Get the base directory of the FV3 forecast model code. -# -external_name="${FCST_MODEL}" -UFS_WTHR_MDL_DIR=$( \ -get_manage_externals_config_property \ -"${mng_extrns_cfg_fn}" "${external_name}" "${property_name}" ) || \ -print_err_msg_exit "\ -Call to function get_manage_externals_config_property failed." - -UFS_WTHR_MDL_DIR="${SR_WX_APP_TOP_DIR}/${UFS_WTHR_MDL_DIR}" -if [ ! -d "${UFS_WTHR_MDL_DIR}" ]; then - print_err_msg_exit "\ -The base directory in which the FV3 source code should be located -(UFS_WTHR_MDL_DIR) does not exist: - UFS_WTHR_MDL_DIR = \"${UFS_WTHR_MDL_DIR}\" -Please clone the external repository containing the code in this directory, -build the executable, and then rerun the workflow." -fi -# -# Get the base directory of the UFS_UTILS codes. -# -external_name="ufs_utils" -UFS_UTILS_DIR=$( \ -get_manage_externals_config_property \ -"${mng_extrns_cfg_fn}" "${external_name}" "${property_name}" ) || \ -print_err_msg_exit "\ -Call to function get_manage_externals_config_property failed." - -UFS_UTILS_DIR="${SR_WX_APP_TOP_DIR}/${UFS_UTILS_DIR}" -if [ ! -d "${UFS_UTILS_DIR}" ]; then - print_err_msg_exit "\ -The base directory in which the UFS utilities source codes should be lo- -cated (UFS_UTILS_DIR) does not exist: - UFS_UTILS_DIR = \"${UFS_UTILS_DIR}\" -Please clone the external repository containing the code in this direct- -ory, build the executables, and then rerun the workflow." -fi -# -# Get the base directory of the UPP code. -# -external_name="UPP" -UPP_DIR=$( \ -get_manage_externals_config_property \ -"${mng_extrns_cfg_fn}" "${external_name}" "${property_name}" ) || \ -print_err_msg_exit "\ -Call to function get_manage_externals_config_property failed." -UPP_DIR="${SR_WX_APP_TOP_DIR}/${UPP_DIR}" -if [ ! -d "${UPP_DIR}" ]; then - print_err_msg_exit "\ -The base directory in which the UPP source code should be located -(UPP_DIR) does not exist: - UPP_DIR = \"${UPP_DIR}\" -Please clone the external repository containing the code in this directory, -build the executable, and then rerun the workflow." -fi -# -#----------------------------------------------------------------------- -# -# Make sure that USE_CUSTOM_POST_CONFIG_FILE is set to a valid value. -# -#----------------------------------------------------------------------- -# -check_var_valid_value \ - "USE_CUSTOM_POST_CONFIG_FILE" "valid_vals_USE_CUSTOM_POST_CONFIG_FILE" -# -# Set USE_CUSTOM_POST_CONFIG_FILE to either "TRUE" or "FALSE" so we don't -# have to consider other valid values later on. -# -USE_CUSTOM_POST_CONFIG_FILE=$(echo_uppercase ${USE_CUSTOM_POST_CONFIG_FILE}) -if [ "$USE_CUSTOM_POST_CONFIG_FILE" = "TRUE" ] || \ - [ "$USE_CUSTOM_POST_CONFIG_FILE" = "YES" ]; then - USE_CUSTOM_POST_CONFIG_FILE="TRUE" -elif [ "$USE_CUSTOM_POST_CONFIG_FILE" = "FALSE" ] || \ - [ "$USE_CUSTOM_POST_CONFIG_FILE" = "NO" ]; then - USE_CUSTOM_POST_CONFIG_FILE="FALSE" -fi # #----------------------------------------------------------------------- # @@ -1739,24 +1242,11 @@ FIELD_TABLE_FP="${EXPTDIR}/${FIELD_TABLE_FN}" FV3_NML_FN="${FV3_NML_BASE_SUITE_FN%.*}" FV3_NML_FP="${EXPTDIR}/${FV3_NML_FN}" NEMS_CONFIG_FP="${EXPTDIR}/${NEMS_CONFIG_FN}" -# -#----------------------------------------------------------------------- -# -# Make sure that USE_USER_STAGED_EXTRN_FILES is set to a valid value. -# -#----------------------------------------------------------------------- -# + + check_var_valid_value "USE_USER_STAGED_EXTRN_FILES" "valid_vals_USE_USER_STAGED_EXTRN_FILES" -# -# Set USE_USER_STAGED_EXTRN_FILES to either "TRUE" or "FALSE" so we don't -# have to consider other valid values later on. -# -USE_USER_STAGED_EXTRN_FILES=$(echo_uppercase $USE_USER_STAGED_EXTRN_FILES) -if [ "${USE_USER_STAGED_EXTRN_FILES}" = "YES" ]; then - USE_USER_STAGED_EXTRN_FILES="TRUE" -elif [ "${USE_USER_STAGED_EXTRN_FILES}" = "NO" ]; then - USE_USER_STAGED_EXTRN_FILES="FALSE" -fi +USE_USER_STAGED_EXTRN_FILES=$(boolify $USE_USER_STAGED_EXTRN_FILES) + # #----------------------------------------------------------------------- # @@ -1794,18 +1284,7 @@ fi #----------------------------------------------------------------------- # check_var_valid_value "DO_ENSEMBLE" "valid_vals_DO_ENSEMBLE" -# -# Set DO_ENSEMBLE to either "TRUE" or "FALSE" so we don't have to consider -# other valid values later on. -# -DO_ENSEMBLE=$(echo_uppercase $DO_ENSEMBLE) -if [ "$DO_ENSEMBLE" = "TRUE" ] || \ - [ "$DO_ENSEMBLE" = "YES" ]; then - DO_ENSEMBLE="TRUE" -elif [ "$DO_ENSEMBLE" = "FALSE" ] || \ - [ "$DO_ENSEMBLE" = "NO" ]; then - DO_ENSEMBLE="FALSE" -fi +DO_ENSEMBLE=$(boolify $DO_ENSEMBLE) NDIGITS_ENSMEM_NAMES="0" ENSMEM_NAMES=("") @@ -2431,10 +1910,9 @@ check_var_valid_value "WRITE_DOPOST" "valid_vals_WRITE_DOPOST" # Set WRITE_DOPOST to either "TRUE" or "FALSE" so we don't have to consider # other valid values later on. # -WRITE_DOPOST=$(echo_uppercase $WRITE_DOPOST) -if [ "$WRITE_DOPOST" = "TRUE" ] || \ - [ "$WRITE_DOPOST" = "YES" ]; then - WRITE_DOPOST="TRUE" +WRITE_DOPOST=$(boolify $WRITE_DOPOST) + +if [ "$WRITE_DOPOST" = "TRUE" ] ; then # Turn off run_post RUN_TASK_RUN_POST="FALSE" @@ -2444,51 +1922,15 @@ if [ "$WRITE_DOPOST" = "TRUE" ] || \ print_err_msg_exit "\ SUB_HOURLY_POST is NOT available with Inline Post yet." fi - -elif [ "$WRITE_DOPOST" = "FALSE" ] || \ - [ "$WRITE_DOPOST" = "NO" ]; then - WRITE_DOPOST="FALSE" fi -# -#----------------------------------------------------------------------- -# -# Make sure that QUILTING is set to a valid value. -# -#----------------------------------------------------------------------- -# + + check_var_valid_value "QUILTING" "valid_vals_QUILTING" -# -# Set QUILTING to either "TRUE" or "FALSE" so we don't have to consider -# other valid values later on. -# -QUILTING=$(echo_uppercase $QUILTING) -if [ "$QUILTING" = "TRUE" ] || \ - [ "$QUILTING" = "YES" ]; then - QUILTING="TRUE" -elif [ "$QUILTING" = "FALSE" ] || \ - [ "$QUILTING" = "NO" ]; then - QUILTING="FALSE" -fi -# -#----------------------------------------------------------------------- -# -# Make sure that PRINT_ESMF is set to a valid value. -# -#----------------------------------------------------------------------- -# +QUILTING=$(boolify $QUILTING) + check_var_valid_value "PRINT_ESMF" "valid_vals_PRINT_ESMF" -# -# Set PRINT_ESMF to either "TRUE" or "FALSE" so we don't have to consider -# other valid values later on. -# -PRINT_ESMF=$(echo_uppercase $PRINT_ESMF) -if [ "${PRINT_ESMF}" = "TRUE" ] || \ - [ "${PRINT_ESMF}" = "YES" ]; then - PRINT_ESMF="TRUE" -elif [ "${PRINT_ESMF}" = "FALSE" ] || \ - [ "${PRINT_ESMF}" = "NO" ]; then - PRINT_ESMF="FALSE" -fi +PRINT_ESMF=$(boolify $PRINT_ESMF) + # #----------------------------------------------------------------------- # @@ -2612,6 +2054,7 @@ GLOBAL_VAR_DEFNS_FP="$EXPTDIR/${GLOBAL_VAR_DEFNS_FN}" # variable definitions file. # #----------------------------------------------------------------------- + # print_info_msg " Creating list of default experiment variable definitions..." @@ -2707,8 +2150,9 @@ var_name = \"${var_name}\"" # # If the variable contains only one element, then it is a scalar. (It # could be a 1-element array, but for simplicity, we treat that case as -# a scalar.) In this case, we enclose its value in double quotes and -# save the result in var_value. +# a scalar.) In this case, we enclose its value in single quotes and +# save the result in var_value. No variable expansion should be +# happening from variables saved in the var_defns file. # if [ "${num_elems}" -eq 1 ]; then @@ -3141,6 +2585,7 @@ FVCOM_FILE='${FVCOM_FILE}' # #----------------------------------------------------------------------- # +NCORES_PER_NODE='${NCORES_PER_NODE}' PE_MEMBER01='${PE_MEMBER01}' # #----------------------------------------------------------------------- diff --git a/ush/source_util_funcs.sh b/ush/source_util_funcs.sh index 60162aa40..fd03d9cad 100644 --- a/ush/source_util_funcs.sh +++ b/ush/source_util_funcs.sh @@ -95,6 +95,15 @@ function source_util_funcs() { # #----------------------------------------------------------------------- # +# Source the file containing the function that changes all boolean +# options to TRUE or FALSE +# +#----------------------------------------------------------------------- +# + . ${bashutils_dir}/boolify.sh +# +#----------------------------------------------------------------------- +# # Source the file containing the functions that will echo given strings # as uppercase or lowercase #