Skip to content

Commit

Permalink
Bug fixes in machine files (#692)
Browse files Browse the repository at this point in the history
## DESCRIPTION OF CHANGES: 
Cleaning up bugs in the machine files.  The first bug prompted this PR, and the rest were found subsequently.  The bugs (and their fixes) are as follows:

1) A space is missing after the `print_info_msg` and `print_err_msg_exit` function calls in the `file_location` functions.  Inserting a space gets passed this bug, but subsequent issues were found as described below.

**For machine files that call the `print_info_msg` function in `file_location` (`cheyenne.sh`, `hera.sh`, `jet.sh`, and `orion.sh`):**
Fixing this bug leads to other failures because when the "*" stanza is encountered in the `file_location` function, 
the `EXTRN_MDL_SYSBASEDIR_ICS|LBCS` variable gets set to the message that `file_location` returns.  Since that message contains spaces, it leads to other failures in downstream scripts (the ex-scripts).  Simply removing the printing out of the message (thus causing `EXTRN_MDL_SYSBASEDIR_ICS|LBCS` to be set to a null string) fixes the failures, so this was the fix implemented.  If desired, a message for an empty value for `EXTRN_MDL_SYSBASEDIR_ICS|LBCS` can be placed in another script (where those variables are used).

**For machine files that use `print_err_msg_exit` in `file_location` (`stampede.sh` and `wcoss_dell_p3.sh`):**
These should not exit if the file location is not available since the experiment can still complete successfully.  So just removing the `print_err_msg_exit` call should work (and make the behavior of these machine files consistent with the set above).

2) In all the machine files, the variable `FV3GFS_FILE_FMT_ICS` should be changed to `FV3GFS_FILE_FMT_LBCS` in the definition of `EXTRN_MDL_SYSBASEDIR_LBCS`.  This was fixed in all the files.

3) In `stampede.sh`, a variable named `SYSBASEDIR_ICS` is defined.  This is a typo.  Modify to `EXTRN_MDL_SYSBASEDIR_ICS`.

## TESTS CONDUCTED: 
Ran the WE2E test `grid_RRFS_CONUS_25km_ics_HRRR_lbcs_RAP_suite_GSD_SAR` on:
* Hera -- successful
* Jet -- successful except for UPP tasks
* Cheyenne -- successful except for UPP tasks

The UPP task failures are new and being experienced by other PRs as well (e.g. #689).  The original issue with machine files seems resolved.

## CONTRIBUTORS (optional): 
@JeffBeck-NOAA encountered and reported the original error.
  • Loading branch information
gsketefian authored Mar 8, 2022
1 parent 78f8512 commit 2d3fcf4
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 77 deletions.
15 changes: 6 additions & 9 deletions ush/machine/cheyenne.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,12 @@ function file_location() {
external_model=${1}
external_file_fmt=${2}

location=""
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:-}
Expand All @@ -30,7 +26,7 @@ EXTRN_MDL_SYSBASEDIR_ICS=${EXTRN_MDL_SYSBASEDIR_ICS:-$(file_location \
${FV3GFS_FILE_FMT_ICS})}
EXTRN_MDL_SYSBASEDIR_LBCS=${EXTRN_MDL_SYSBASEDIR_LBCS:-$(file_location \
${EXTRN_MDL_NAME_LBCS} \
${FV3GFS_FILE_FMT_ICS})}
${FV3GFS_FILE_FMT_LBCS})}

# System scripts to source to initialize various commands within workflow
# scripts (e.g. "module").
Expand All @@ -57,6 +53,7 @@ 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 commands for executables
RUN_CMD_SERIAL="time"
RUN_CMD_UTILS='mpirun -np $nprocs'
RUN_CMD_FCST='mpirun -np ${PE_MEMBER01}'
Expand All @@ -71,6 +68,6 @@ 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
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"
20 changes: 9 additions & 11 deletions ush/machine/hera.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,24 @@ function file_location() {
external_model=${1}
external_file_fmt=${2}

location=""
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})}
${FV3GFS_FILE_FMT_LBCS})}

# System scripts to source to initialize various commands within workflow
# scripts (e.g. "module").
Expand Down Expand Up @@ -59,6 +56,7 @@ 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 commands for executables
RUN_CMD_SERIAL="time"
RUN_CMD_UTILS="srun"
RUN_CMD_FCST="srun"
Expand All @@ -73,8 +71,8 @@ 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
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"
17 changes: 8 additions & 9 deletions ush/machine/jet.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ function file_location() {
external_model=${1}
external_file_fmt=${2}

location=""
case ${external_model} in

"FV3GFS")
case $external_file_fmt in
"nemsio")
Expand All @@ -29,22 +31,18 @@ function file_location() {
"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})}
${FV3GFS_FILE_FMT_LBCS})}

# System scripts to source to initialize various commands within workflow
# scripts (e.g. "module").
Expand Down Expand Up @@ -74,12 +72,13 @@ 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 commands for executables
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
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"
10 changes: 4 additions & 6 deletions ush/machine/odin.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ function file_location() {
external_model=${1}
external_file_fmt=${2}

location=""
case ${external_model} in

"GSMGFS")
Expand All @@ -17,11 +18,7 @@ function file_location() {
"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:-}

Expand All @@ -32,7 +29,7 @@ EXTRN_MDL_SYSBASEDIR_ICS=${EXTRN_MDL_SYSBASEDIR_ICS:-$(file_location \
${FV3GFS_FILE_FMT_ICS})}
EXTRN_MDL_SYSBASEDIR_LBCS=${EXTRN_MDL_SYSBASEDIR_LBCS:-$(file_location \
${EXTRN_MDL_NAME_LBCS} \
${FV3GFS_FILE_FMT_ICS})}
${FV3GFS_FILE_FMT_LBCS})}

# System scripts to source to initialize various commands within workflow
# scripts (e.g. "module").
Expand Down Expand Up @@ -62,6 +59,7 @@ 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 commands for executables
RUN_CMD_SERIAL="srun -n 1"
RUN_CMD_UTILS='srun -n $nprocs'
RUN_CMD_FCST='srun -n ${PE_MEMBER01}'
Expand Down
15 changes: 4 additions & 11 deletions ush/machine/orion.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,17 @@ function file_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
location=""
echo ${location:-}

}

EXTRN_MDL_SYSBASEDIR_ICS=${EXTRN_MDL_SYSBASEDIR_ICS:-$(file_location \
${EXTRN_MDL_NAME_ICS} \
${FV3GFS_FILE_FMT_ICS})}
${FV3GFS_FILE_FMT_ICS})}
EXTRN_MDL_SYSBASEDIR_LBCS=${EXTRN_MDL_SYSBASEDIR_LBCS:-$(file_location \
${EXTRN_MDL_NAME_LBCS} \
${FV3GFS_FILE_FMT_ICS})}
${FV3GFS_FILE_FMT_LBCS})}

# System scripts to source to initialize various commands within workflow
# scripts (e.g. "module").
Expand Down Expand Up @@ -58,6 +50,7 @@ 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 commands for executables
RUN_CMD_SERIAL="time"
RUN_CMD_UTILS="srun"
RUN_CMD_FCST='srun -n ${PE_MEMBER01}'
Expand Down
16 changes: 4 additions & 12 deletions ush/machine/singularity.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,17 @@ function file_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. Please set a user-defined file location."
;;

esac
location=""
echo ${location:-}

}


EXTRN_MDL_SYSBASEDIR_ICS=${EXTRN_MDL_SYSBASEDIR_ICS:-$(file_location \
${EXTRN_MDL_NAME_ICS} \
${FV3GFS_FILE_FMT_ICS})}
${FV3GFS_FILE_FMT_ICS})}
EXTRN_MDL_SYSBASEDIR_LBCS=${EXTRN_MDL_SYSBASEDIR_LBCS:-$(file_location \
${EXTRN_MDL_NAME_LBCS} \
${FV3GFS_FILE_FMT_ICS})}
${FV3GFS_FILE_FMT_LBCS})}

# System scripts to source to initialize various commands within workflow
# scripts (e.g. "module").
Expand Down Expand Up @@ -58,6 +49,7 @@ TOPO_DIR=${TOPO_DIR:-"/contrib/global/glopara/fix/fix_orog"}
SFC_CLIMO_INPUT_DIR=${SFC_CLIMO_INPUT_DIR:-"/contrib/global/glopara/fix/fix_sfc_climo"}
FIXLAM_NCO_BASEDIR=${FIXLAM_NCO_BASEDIR:-"/needs/to/be/specified"}

# Run commands for executables
RUN_CMD_SERIAL="time"
RUN_CMD_UTILS='mpirun -np $nprocs --oversubscribe'
RUN_CMD_FCST='mpirun -n ${PE_MEMBER01} --oversubscribe'
Expand Down
13 changes: 5 additions & 8 deletions ush/machine/stampede.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,26 @@ function file_location() {
external_model=${1}
external_file_fmt=${2}

location=""
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_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})}
${FV3GFS_FILE_FMT_LBCS})}

# System scripts to source to initialize various commands within workflow
# scripts (e.g. "module").
Expand Down Expand Up @@ -62,6 +58,7 @@ 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 commands for executables
RUN_CMD_SERIAL="time"
RUN_CMD_UTILS='ibrun -np $nprocs'
RUN_CMD_FCST='ibrun -np $nprocs'
Expand Down
17 changes: 6 additions & 11 deletions ush/machine/wcoss_dell_p3.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ function file_location() {
external_model=${1}
external_file_fmt=${2}

location=""
case ${external_model} in

"FV3GFS")
Expand All @@ -23,11 +24,6 @@ function file_location() {
"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:-}
Expand All @@ -39,7 +35,7 @@ EXTRN_MDL_SYSBASEDIR_ICS=${EXTRN_MDL_SYSBASEDIR_ICS:-$(file_location \
${FV3GFS_FILE_FMT_ICS})}
EXTRN_MDL_SYSBASEDIR_LBCS=${EXTRN_MDL_SYSBASEDIR_LBCS:-$(file_location \
${EXTRN_MDL_NAME_LBCS} \
${FV3GFS_FILE_FMT_ICS})}
${FV3GFS_FILE_FMT_LBCS})}

# System scripts to source to initialize various commands within workflow
# scripts (e.g. "module").
Expand All @@ -66,7 +62,7 @@ TOPO_DIR=${TOPO_DIR:-"/gpfs/dell2/emc/modeling/noscrub/emc.glopara/git/fv3gfs/fi
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"}

# Commands to run
# Run commands for executables
RUN_CMD_SERIAL="mpirun"
RUN_CMD_UTILS="mpirun"
RUN_CMD_FCST='mpirun -l -np ${PE_MEMBER01}'
Expand All @@ -80,8 +76,7 @@ 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
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"

0 comments on commit 2d3fcf4

Please sign in to comment.