From 1c0ac32468856bff499e1a6e12792908561da9ea Mon Sep 17 00:00:00 2001 From: Cory Martin Date: Fri, 20 Mar 2026 17:57:17 +0000 Subject: [PATCH 1/6] replace set_strict function call with source set_strict (and unset) --- dev/job_cards/rocoto/prep.sh | 4 ++-- dev/jobs/JGFS_ATMOS_CYCLONE_GENESIS | 4 ++-- dev/jobs/JGFS_ATMOS_VERIFICATION | 4 ++-- dev/jobs/JGLOBAL_ARCHIVE_TARS | 4 ++-- dev/jobs/JGLOBAL_ENKF_ARCHIVE_TARS | 4 ++-- dev/jobs/JGLOBAL_ENKF_SELECT_OBS | 2 +- dev/scripts/exgdas_atmos_verfrad.sh | 2 +- dev/scripts/exglobal_atmos_products.sh | 4 ++-- ush/jjob_shell_setup.sh | 12 ++++-------- ush/module-setup.sh | 8 +------- ush/run_mpmd.sh | 4 ++-- ush/set_strict.sh | 21 +++++++-------------- ush/syndat_getjtbul.sh | 4 ++-- ush/syndat_qctropcy.sh | 4 ++-- ush/unset_strict.sh | 15 ++++----------- 15 files changed, 36 insertions(+), 60 deletions(-) diff --git a/dev/job_cards/rocoto/prep.sh b/dev/job_cards/rocoto/prep.sh index aff226f0485..7626eba6158 100755 --- a/dev/job_cards/rocoto/prep.sh +++ b/dev/job_cards/rocoto/prep.sh @@ -170,10 +170,10 @@ fi # Create or Copy prepbufr, prepbufr.acft_profiles, nsstbufr files # Do not fail on external errors if [[ ${MAKE_PREPBUFR:-"YES"} == "YES" ]]; then - unset_strict + source "${USHglobal}/unset_strict.sh" "${HOMEobsproc}/jobs/JOBSPROC_GLOBAL_PREP" && true export err=$? - set_strict + source "${USHglobal}/set_strict.sh" if [[ ${err} -ne 0 ]]; then err_exit "JOBSPROC_GLOBAL_PREP job failed, ABORT!" fi diff --git a/dev/jobs/JGFS_ATMOS_CYCLONE_GENESIS b/dev/jobs/JGFS_ATMOS_CYCLONE_GENESIS index b9865c017e3..ca20d6a8613 100755 --- a/dev/jobs/JGFS_ATMOS_CYCLONE_GENESIS +++ b/dev/jobs/JGFS_ATMOS_CYCLONE_GENESIS @@ -43,10 +43,10 @@ export JYYYY=${PDY:0:4} ############################################## # Do not fail on errors or unassigned variables in external code -unset_strict +source "${USHglobal}/unset_strict.sh" "${SCRIPTens_tracker}/exgfs_tc_genesis.sh" && true export err=$? -set_strict +source "${USHglobal}/set_strict.sh" if [[ ${err} -ne 0 ]]; then err_exit fi diff --git a/dev/jobs/JGFS_ATMOS_VERIFICATION b/dev/jobs/JGFS_ATMOS_VERIFICATION index ac3f889b12a..c35b771c821 100755 --- a/dev/jobs/JGFS_ATMOS_VERIFICATION +++ b/dev/jobs/JGFS_ATMOS_VERIFICATION @@ -38,11 +38,11 @@ done if [[ "${RUN_GRID2GRID_STEP1}" == "YES" || "${RUN_GRID2OBS_STEP1}" == "YES" || "${RUN_PRECIP_STEP1}" == "YES" ]]; then # Override the -e in VERIF_GLOBALSH's shebang and un-export SHELLOPTS # TODO: clean up the verif-global script so it does not raise false-positive errors - unset_strict + source "${USHglobal}/unset_strict.sh" export -n SHELLOPTS bash -x "${VERIF_GLOBALSH}" err=$? - set_strict + source "${USHglobal}/set_strict.sh" if [[ ${err} -ne 0 ]]; then exit "${err}" fi diff --git a/dev/jobs/JGLOBAL_ARCHIVE_TARS b/dev/jobs/JGLOBAL_ARCHIVE_TARS index 86aed85595c..177c7ddd975 100755 --- a/dev/jobs/JGLOBAL_ARCHIVE_TARS +++ b/dev/jobs/JGLOBAL_ARCHIVE_TARS @@ -104,10 +104,10 @@ fi # Do not export shell opts to the bash scripts in the htar/hsi wrappers export -n SHELLOPTS -unset_strict +source "${USHglobal}/unset_strict.sh" ${GLOBALARCHIVESH:-${SCRglobal}/exglobal_archive_tars.py} export err=$? -set_strict +source "${USHglobal}/set_strict.sh" if [[ ${err} -ne 0 ]]; then err_exit "failed to archive the COM structure" fi diff --git a/dev/jobs/JGLOBAL_ENKF_ARCHIVE_TARS b/dev/jobs/JGLOBAL_ENKF_ARCHIVE_TARS index e74e8a3cfb3..7977a7b6b55 100755 --- a/dev/jobs/JGLOBAL_ENKF_ARCHIVE_TARS +++ b/dev/jobs/JGLOBAL_ENKF_ARCHIVE_TARS @@ -35,10 +35,10 @@ mkdir -p "${COMIN_CONF}" # Calls an external bash command; do not fail on unassigned/error export -n SHELLOPTS -unset_strict +source "${USHglobal}/unset_strict.sh" "${SCRglobal}/exglobal_enkf_earc_tars.py" export err=$? -set_strict +source "${USHglobal}/set_strict.sh" if [[ ${err} -ne 0 ]]; then err_exit "Failed to archive the ensemble COM structure" fi diff --git a/dev/jobs/JGLOBAL_ENKF_SELECT_OBS b/dev/jobs/JGLOBAL_ENKF_SELECT_OBS index e0c891707cd..52c2483ff52 100755 --- a/dev/jobs/JGLOBAL_ENKF_SELECT_OBS +++ b/dev/jobs/JGLOBAL_ENKF_SELECT_OBS @@ -64,7 +64,7 @@ fi LEVS=$(${NCLEN} "${ATMGES}" pfull) && true export err=$? -set_strict +source "${USHglobal}/set_strict.sh" export LEVS diff --git a/dev/scripts/exgdas_atmos_verfrad.sh b/dev/scripts/exgdas_atmos_verfrad.sh index 58684072a67..227bb9bc31b 100755 --- a/dev/scripts/exgdas_atmos_verfrad.sh +++ b/dev/scripts/exgdas_atmos_verfrad.sh @@ -18,7 +18,7 @@ ################################################################################ # Do not exit on errors so that restricted data can be protected -unset_strict +source "${USHglobal}/unset_strict.sh" if [[ ! -s "${radstat}" || ! -s "${biascr}" ]]; then export err=1 diff --git a/dev/scripts/exglobal_atmos_products.sh b/dev/scripts/exglobal_atmos_products.sh index d7cbb026fc7..63acc135943 100755 --- a/dev/scripts/exglobal_atmos_products.sh +++ b/dev/scripts/exglobal_atmos_products.sh @@ -90,10 +90,10 @@ for ((nset = 1; nset <= downset; nset++)); do # if final record of is u-component, add next record v-component # if final record is land, add next record icec # grep returns 1 if no match is found, so temporarily turn off exit on non-zero rc - unset_strict + source "${USHglobal}/unset_strict.sh" ${WGRIB2} -d "${last}" "${tmpfile}" | grep -E -i "ugrd|ustm|uflx|u-gwd|land|maxuw" rc=$? - set_strict + source "${USHglobal}/set_strict.sh" if [[ ${rc} == 0 ]]; then # Matched the grep last=$((last + 1)) fi diff --git a/ush/jjob_shell_setup.sh b/ush/jjob_shell_setup.sh index cb7f6d03fcd..8afef95d926 100644 --- a/ush/jjob_shell_setup.sh +++ b/ush/jjob_shell_setup.sh @@ -7,7 +7,7 @@ # # Handles: # - Sourcing utility functions (wait_for_file, dataroot_com_path, timer, -# err_exit, set_strict, postamble) +# err_exit, postamble) # - Setting shell options (nullglob) # - Each utility script exports its own functions via declare -xf # - Activating strict mode (set -eu) and tracing (set -x) @@ -38,10 +38,8 @@ source "${USHglobal}/err_exit.sh" shopt -s nullglob # Allow null globs instead of treating * as literal ############################################## -# Shell options, strict mode, and tracing +# Shell options and tracing ############################################## -source "${USHglobal}/set_strict.sh" -source "${USHglobal}/unset_strict.sh" source "${USHglobal}/set_trace.sh" export SHELLOPTS ############################################## @@ -50,8 +48,7 @@ export SHELLOPTS source "${USHglobal}/setup_data_dir.sh" setup_data_dir "${DATA}" -# Activate strict mode and tracing -set_strict +# Activate tracing set_trace ############################################## @@ -65,7 +62,6 @@ trap "postamble ${start_time}" EXIT # Temporal variables: PDY, PDYm#, PDYp# (via setpdy.sh) ############################################## # setpdy.sh may not be available in all environments; failures are non-fatal -unset_strict setpdy.sh || true source ./PDY || true -set_strict + diff --git a/ush/module-setup.sh b/ush/module-setup.sh index bb9b8a9c0e1..661be25b2d4 100755 --- a/ush/module-setup.sh +++ b/ush/module-setup.sh @@ -94,10 +94,4 @@ else echo WARNING: UNKNOWN PLATFORM 1>&2 fi -# If this function exists in the environment, run it; else do not -ftype=$(type -t set_strict || echo "") -if [[ "${ftype}" == "function" ]]; then - set_strict -else - set +u -fi +source "${USHglobal}/set_strict.sh" diff --git a/ush/run_mpmd.sh b/ush/run_mpmd.sh index 461942c96e0..9912a5aa7a0 100755 --- a/ush/run_mpmd.sh +++ b/ush/run_mpmd.sh @@ -196,10 +196,10 @@ for ((i = 0; i < nm; i += chunk_size)); do # Count the number of lines not including commented lines (i.e. shebangs) n_mpmd_tasks=$(grep -v -c "^ *#" < "${chunk_file}") if [[ "${_mpmd_launcher}" == "srun" ]]; then - unset_strict + source "${USHglobal}/unset_strict.sh" # shellcheck disable=SC2086 ${launcher:-} ${mpmd_opt:-} -n "${n_mpmd_tasks}" "${chunk_file}" - set_strict + source "${USHglobal}/set_strict.sh" elif [[ "${_mpmd_launcher}" == "mpiexec" ]]; then # shellcheck disable=SC2086 ${launcher:-} -np "${n_mpmd_tasks}" ${mpmd_opt:-} "${chunk_file}" diff --git a/ush/set_strict.sh b/ush/set_strict.sh index 4d7316872d7..553195967c9 100644 --- a/ush/set_strict.sh +++ b/ush/set_strict.sh @@ -1,19 +1,12 @@ #! /usr/bin/env bash - ####### -# Defines the set_strict function for use in J-jobs and ex-scripts. -# -# Source this file to load the function into the current shell: +# Source this file to set strict mode in a script. # source "${USHglobal}/set_strict.sh" ####### -set_strict() { - if [[ ${STRICT:-"YES"} == "YES" ]]; then - # Exit on error or undefined variable - set -eu - # Exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) - set -o pipefail - fi -} - -declare -xf set_strict +if [[ ${STRICT:-"YES"} == "YES" ]]; then + # Exit on error or undefined variable + set -eu + # Exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) + set -o pipefail +fi diff --git a/ush/syndat_getjtbul.sh b/ush/syndat_getjtbul.sh index 88d0868b15c..6b80856604a 100755 --- a/ush/syndat_getjtbul.sh +++ b/ush/syndat_getjtbul.sh @@ -102,9 +102,9 @@ fi pgm=$(basename "${EXECglobal}/syndat_getjtbul.x") export pgm if [[ -s prep_step ]]; then - unset_strict + source "${USHglobal}/unset_strict.sh" source prep_step - set_strict + source "${USHglobal}/set_strict.sh" else rm -f errfile #shellcheck disable=SC2046 diff --git a/ush/syndat_qctropcy.sh b/ush/syndat_qctropcy.sh index 2ec4562ff5b..fa67611d083 100755 --- a/ush/syndat_qctropcy.sh +++ b/ush/syndat_qctropcy.sh @@ -206,9 +206,9 @@ cpreq "${slmask}" slmask.126 pgm=$(basename "${EXECglobal}/syndat_qctropcy.x") export pgm if [[ -s prep_step ]]; then - unset_strict + source "${USHglobal}/unset_strict.sh" source prep_step - set_strict + source "${USHglobal}/set_strict.sh" else rm -f errfile # shellcheck disable=SC2046 diff --git a/ush/unset_strict.sh b/ush/unset_strict.sh index 1cc7718e3cc..48a1b571478 100644 --- a/ush/unset_strict.sh +++ b/ush/unset_strict.sh @@ -1,16 +1,9 @@ #! /usr/bin/env bash - ####### -# Defines the unset_strict function for use in J-jobs and ex-scripts. -# -# Source this file to load the function into the current shell: +# Source this file to unset strict mode in a script. # source "${USHglobal}/unset_strict.sh" ####### -unset_strict() { - # Turn off strict mode - set +eu - set +o pipefail -} - -declare -xf unset_strict +# Turn off strict mode +set +eu +set +o pipefail From 29f58e1d6977fa845593d5822cd5045800d3d2e4 Mon Sep 17 00:00:00 2001 From: Cory Martin Date: Fri, 20 Mar 2026 18:06:39 +0000 Subject: [PATCH 2/6] source set_strict at the top o' every j-job --- dev/jobs/JGDAS_AERO_ANALYSIS_GENERATE_BMATRIX | 3 +++ dev/jobs/JGDAS_ATMOS_CHGRES_FORENKF | 3 +++ dev/jobs/JGDAS_ATMOS_GEMPAK | 3 +++ dev/jobs/JGDAS_ATMOS_GEMPAK_META_NCDC | 3 +++ dev/jobs/JGDAS_ATMOS_VERFOZN | 3 +++ dev/jobs/JGDAS_ATMOS_VERFRAD | 3 +++ dev/jobs/JGDAS_ENKF_POST | 3 +++ dev/jobs/JGDAS_FIT2OBS | 3 +++ dev/jobs/JGEFS_WAVE_STAT | 3 +++ dev/jobs/JGEFS_WAVE_STAT_PNT | 3 +++ dev/jobs/JGFS_ATMOS_AWIPS_20KM_1P0DEG | 3 +++ dev/jobs/JGFS_ATMOS_CYCLONE_GENESIS | 3 +++ dev/jobs/JGFS_ATMOS_CYCLONE_TRACKER | 3 +++ dev/jobs/JGFS_ATMOS_FBWIND | 3 +++ dev/jobs/JGFS_ATMOS_FSU_GENESIS | 3 +++ dev/jobs/JGFS_ATMOS_GEMPAK | 3 +++ dev/jobs/JGFS_ATMOS_GEMPAK_META | 3 +++ dev/jobs/JGFS_ATMOS_GEMPAK_NCDC_UPAPGIF | 3 +++ dev/jobs/JGFS_ATMOS_GEMPAK_PGRB2_SPEC | 3 +++ dev/jobs/JGFS_ATMOS_PGRB2_SPEC_NPOESS | 3 +++ dev/jobs/JGFS_ATMOS_POSTSND | 3 +++ dev/jobs/JGFS_ATMOS_VERIFICATION | 3 +++ dev/jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE | 3 +++ dev/jobs/JGLOBAL_AERO_ANALYSIS_INITIALIZE | 3 +++ dev/jobs/JGLOBAL_AERO_ANALYSIS_VARIATIONAL | 3 +++ dev/jobs/JGLOBAL_ANALYSIS_STATS | 3 +++ dev/jobs/JGLOBAL_ARCHIVE_TARS | 3 +++ dev/jobs/JGLOBAL_ARCHIVE_VRFY | 3 +++ dev/jobs/JGLOBAL_ATMENS_ANALYSIS_FINALIZE | 3 +++ dev/jobs/JGLOBAL_ATMENS_ANALYSIS_FV3_INCREMENT | 3 +++ dev/jobs/JGLOBAL_ATMENS_ANALYSIS_INITIALIZE | 3 +++ dev/jobs/JGLOBAL_ATMENS_ANALYSIS_LETKF | 3 +++ dev/jobs/JGLOBAL_ATMENS_ANALYSIS_OBS | 3 +++ dev/jobs/JGLOBAL_ATMENS_ANALYSIS_SOL | 3 +++ dev/jobs/JGLOBAL_ATMOS_ANALYSIS | 3 +++ dev/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC | 3 +++ dev/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC_FV3JEDI | 3 +++ dev/jobs/JGLOBAL_ATMOS_ANALYSIS_DIAG | 3 +++ dev/jobs/JGLOBAL_ATMOS_CHGRES_GEN_CONTROL | 3 +++ dev/jobs/JGLOBAL_ATMOS_ENSSTAT | 3 +++ dev/jobs/JGLOBAL_ATMOS_POST_MANAGER | 3 +++ dev/jobs/JGLOBAL_ATMOS_PREP_SFC | 3 +++ dev/jobs/JGLOBAL_ATMOS_PRODUCTS | 3 +++ dev/jobs/JGLOBAL_ATMOS_SFCANL | 3 +++ dev/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC | 3 +++ dev/jobs/JGLOBAL_ATMOS_UPP | 3 +++ dev/jobs/JGLOBAL_ATMOS_VMINMON | 3 +++ dev/jobs/JGLOBAL_ATM_ANALYSIS_FINALIZE | 3 +++ dev/jobs/JGLOBAL_ATM_ANALYSIS_FV3_INCREMENT | 3 +++ dev/jobs/JGLOBAL_ATM_ANALYSIS_INITIALIZE | 3 +++ dev/jobs/JGLOBAL_ATM_ANALYSIS_VARIATIONAL | 3 +++ dev/jobs/JGLOBAL_ATM_PREP_ANL_BIAS | 3 +++ dev/jobs/JGLOBAL_CLEANUP | 3 +++ dev/jobs/JGLOBAL_ENKF_ARCHIVE_TARS | 3 +++ dev/jobs/JGLOBAL_ENKF_ARCHIVE_VRFY | 3 +++ dev/jobs/JGLOBAL_ENKF_DIAG | 3 +++ dev/jobs/JGLOBAL_ENKF_ECEN | 3 +++ dev/jobs/JGLOBAL_ENKF_ECEN_FV3JEDI | 3 +++ dev/jobs/JGLOBAL_ENKF_SELECT_OBS | 3 +++ dev/jobs/JGLOBAL_ENKF_SFC | 3 +++ dev/jobs/JGLOBAL_ENKF_UPDATE | 3 +++ dev/jobs/JGLOBAL_ENS_GLOBUS_ARCH | 3 +++ dev/jobs/JGLOBAL_EXTRACTVARS | 3 +++ dev/jobs/JGLOBAL_FETCH | 3 +++ dev/jobs/JGLOBAL_FORECAST | 3 +++ dev/jobs/JGLOBAL_GLOBUS_ARCH | 3 +++ dev/jobs/JGLOBAL_MARINE_ANALYSIS_CHECKPOINT | 3 +++ dev/jobs/JGLOBAL_MARINE_ANALYSIS_ECEN | 3 +++ dev/jobs/JGLOBAL_MARINE_ANALYSIS_FINALIZE | 3 +++ dev/jobs/JGLOBAL_MARINE_ANALYSIS_INITIALIZE | 3 +++ dev/jobs/JGLOBAL_MARINE_ANALYSIS_LETKF | 3 +++ dev/jobs/JGLOBAL_MARINE_ANALYSIS_VARIATIONAL | 3 +++ dev/jobs/JGLOBAL_MARINE_BMAT | 3 +++ dev/jobs/JGLOBAL_MARINE_BMAT_INITIALIZE | 3 +++ dev/jobs/JGLOBAL_OCEANICE_PRODUCTS | 3 +++ dev/jobs/JGLOBAL_OFFLINE_ATMOS_ANALYSIS | 3 +++ dev/jobs/JGLOBAL_PREP_EMISSIONS | 3 +++ dev/jobs/JGLOBAL_PREP_OCEAN_OBS | 3 +++ dev/jobs/JGLOBAL_SNOWENS_ANALYSIS | 3 +++ dev/jobs/JGLOBAL_SNOW_ANALYSIS | 3 +++ dev/jobs/JGLOBAL_STAGE_IC | 3 +++ dev/jobs/JGLOBAL_WAVE_GEMPAK | 3 +++ dev/jobs/JGLOBAL_WAVE_INIT | 3 +++ dev/jobs/JGLOBAL_WAVE_POST_BNDPNT | 3 +++ dev/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL | 3 +++ dev/jobs/JGLOBAL_WAVE_POST_PNT | 3 +++ dev/jobs/JGLOBAL_WAVE_POST_SBS | 3 +++ dev/jobs/JGLOBAL_WAVE_PRDGEN_BULLS | 3 +++ dev/jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED | 3 +++ dev/jobs/JGLOBAL_WAVE_PREP | 3 +++ 90 files changed, 270 insertions(+) diff --git a/dev/jobs/JGDAS_AERO_ANALYSIS_GENERATE_BMATRIX b/dev/jobs/JGDAS_AERO_ANALYSIS_GENERATE_BMATRIX index 10be86d9233..1495be3bcbb 100755 --- a/dev/jobs/JGDAS_AERO_ANALYSIS_GENERATE_BMATRIX +++ b/dev/jobs/JGDAS_AERO_ANALYSIS_GENERATE_BMATRIX @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGDAS_ATMOS_CHGRES_FORENKF b/dev/jobs/JGDAS_ATMOS_CHGRES_FORENKF index 78fdcc86d08..aca0092a406 100755 --- a/dev/jobs/JGDAS_ATMOS_CHGRES_FORENKF +++ b/dev/jobs/JGDAS_ATMOS_CHGRES_FORENKF @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGDAS_ATMOS_GEMPAK b/dev/jobs/JGDAS_ATMOS_GEMPAK index c2be5c7e843..be336132c3f 100755 --- a/dev/jobs/JGDAS_ATMOS_GEMPAK +++ b/dev/jobs/JGDAS_ATMOS_GEMPAK @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" export GRIB=${GRIB:-pgrb2f} export EXT="" diff --git a/dev/jobs/JGDAS_ATMOS_GEMPAK_META_NCDC b/dev/jobs/JGDAS_ATMOS_GEMPAK_META_NCDC index 33980e08aec..ec44aaf00f4 100755 --- a/dev/jobs/JGDAS_ATMOS_GEMPAK_META_NCDC +++ b/dev/jobs/JGDAS_ATMOS_GEMPAK_META_NCDC @@ -14,6 +14,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" # Now set up GEMPAK/NTRANS environment diff --git a/dev/jobs/JGDAS_ATMOS_VERFOZN b/dev/jobs/JGDAS_ATMOS_VERFOZN index dde005c0094..d763dcd0aff 100755 --- a/dev/jobs/JGDAS_ATMOS_VERFOZN +++ b/dev/jobs/JGDAS_ATMOS_VERFOZN @@ -13,6 +13,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################# # determine PDY and cyc for previous cycle diff --git a/dev/jobs/JGDAS_ATMOS_VERFRAD b/dev/jobs/JGDAS_ATMOS_VERFRAD index 9f0d8d2124c..b04d4e5ed29 100755 --- a/dev/jobs/JGDAS_ATMOS_VERFRAD +++ b/dev/jobs/JGDAS_ATMOS_VERFRAD @@ -13,6 +13,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################# # determine PDY and cyc for previous cycle diff --git a/dev/jobs/JGDAS_ENKF_POST b/dev/jobs/JGDAS_ENKF_POST index ad85dfc139e..5c0cb7e5f9e 100755 --- a/dev/jobs/JGDAS_ENKF_POST +++ b/dev/jobs/JGDAS_ENKF_POST @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGDAS_FIT2OBS b/dev/jobs/JGDAS_FIT2OBS index c0593ef5f00..9b44ceeebe3 100755 --- a/dev/jobs/JGDAS_FIT2OBS +++ b/dev/jobs/JGDAS_FIT2OBS @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGEFS_WAVE_STAT b/dev/jobs/JGEFS_WAVE_STAT index eeb3d8a9771..65692171eef 100755 --- a/dev/jobs/JGEFS_WAVE_STAT +++ b/dev/jobs/JGEFS_WAVE_STAT @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" source "${USHglobal}/wave_domain_grid.sh" # Set COM Paths diff --git a/dev/jobs/JGEFS_WAVE_STAT_PNT b/dev/jobs/JGEFS_WAVE_STAT_PNT index 9622a14612d..b43cfd12cdb 100755 --- a/dev/jobs/JGEFS_WAVE_STAT_PNT +++ b/dev/jobs/JGEFS_WAVE_STAT_PNT @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" # Set COM Paths diff --git a/dev/jobs/JGFS_ATMOS_AWIPS_20KM_1P0DEG b/dev/jobs/JGFS_ATMOS_AWIPS_20KM_1P0DEG index 4d51edd04c0..6646924e204 100755 --- a/dev/jobs/JGFS_ATMOS_AWIPS_20KM_1P0DEG +++ b/dev/jobs/JGFS_ATMOS_AWIPS_20KM_1P0DEG @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" export OMP_NUM_THREADS=${OMP_NUM_THREADS:-1} diff --git a/dev/jobs/JGFS_ATMOS_CYCLONE_GENESIS b/dev/jobs/JGFS_ATMOS_CYCLONE_GENESIS index ca20d6a8613..ad3a809bdb4 100755 --- a/dev/jobs/JGFS_ATMOS_CYCLONE_GENESIS +++ b/dev/jobs/JGFS_ATMOS_CYCLONE_GENESIS @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the exglobal script diff --git a/dev/jobs/JGFS_ATMOS_CYCLONE_TRACKER b/dev/jobs/JGFS_ATMOS_CYCLONE_TRACKER index 290fd36a55d..522c6b8844b 100755 --- a/dev/jobs/JGFS_ATMOS_CYCLONE_TRACKER +++ b/dev/jobs/JGFS_ATMOS_CYCLONE_TRACKER @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" export COMPONENT="atmos" diff --git a/dev/jobs/JGFS_ATMOS_FBWIND b/dev/jobs/JGFS_ATMOS_FBWIND index 56f6092280e..47b376921ef 100755 --- a/dev/jobs/JGFS_ATMOS_FBWIND +++ b/dev/jobs/JGFS_ATMOS_FBWIND @@ -15,6 +15,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" export COMPONENT="atmos" diff --git a/dev/jobs/JGFS_ATMOS_FSU_GENESIS b/dev/jobs/JGFS_ATMOS_FSU_GENESIS index db9073465be..e78b24b63f4 100755 --- a/dev/jobs/JGFS_ATMOS_FSU_GENESIS +++ b/dev/jobs/JGFS_ATMOS_FSU_GENESIS @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Define COM and Data directories diff --git a/dev/jobs/JGFS_ATMOS_GEMPAK b/dev/jobs/JGFS_ATMOS_GEMPAK index 2923db68b4e..5ceabbe49b6 100755 --- a/dev/jobs/JGFS_ATMOS_GEMPAK +++ b/dev/jobs/JGFS_ATMOS_GEMPAK @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################ # Set up model and cycle specific variables diff --git a/dev/jobs/JGFS_ATMOS_GEMPAK_META b/dev/jobs/JGFS_ATMOS_GEMPAK_META index 2d1d6cff8d1..d8d7f541c22 100755 --- a/dev/jobs/JGFS_ATMOS_GEMPAK_META +++ b/dev/jobs/JGFS_ATMOS_GEMPAK_META @@ -15,6 +15,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################### # Set MP variables diff --git a/dev/jobs/JGFS_ATMOS_GEMPAK_NCDC_UPAPGIF b/dev/jobs/JGFS_ATMOS_GEMPAK_NCDC_UPAPGIF index 1a4b7d6f48f..266804dd0fd 100755 --- a/dev/jobs/JGFS_ATMOS_GEMPAK_NCDC_UPAPGIF +++ b/dev/jobs/JGFS_ATMOS_GEMPAK_NCDC_UPAPGIF @@ -13,6 +13,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" export MP_PULSE=0 export MP_TIMEOUT=2000 diff --git a/dev/jobs/JGFS_ATMOS_GEMPAK_PGRB2_SPEC b/dev/jobs/JGFS_ATMOS_GEMPAK_PGRB2_SPEC index f9957cb94ae..ad946026155 100755 --- a/dev/jobs/JGFS_ATMOS_GEMPAK_PGRB2_SPEC +++ b/dev/jobs/JGFS_ATMOS_GEMPAK_PGRB2_SPEC @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" export COMPONENT="atmos" export EXT="" diff --git a/dev/jobs/JGFS_ATMOS_PGRB2_SPEC_NPOESS b/dev/jobs/JGFS_ATMOS_PGRB2_SPEC_NPOESS index 2bdc1652660..c3b51d30094 100755 --- a/dev/jobs/JGFS_ATMOS_PGRB2_SPEC_NPOESS +++ b/dev/jobs/JGFS_ATMOS_PGRB2_SPEC_NPOESS @@ -15,6 +15,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" export OMP_NUM_THREADS=${OMP_NUM_THREADS:-1} diff --git a/dev/jobs/JGFS_ATMOS_POSTSND b/dev/jobs/JGFS_ATMOS_POSTSND index ac99d8ceebf..08fd0610dcd 100755 --- a/dev/jobs/JGFS_ATMOS_POSTSND +++ b/dev/jobs/JGFS_ATMOS_POSTSND @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ######################################## # Runs GFS BUFR SOUNDINGS diff --git a/dev/jobs/JGFS_ATMOS_VERIFICATION b/dev/jobs/JGFS_ATMOS_VERIFICATION index c35b771c821..15986bffa9d 100755 --- a/dev/jobs/JGFS_ATMOS_VERIFICATION +++ b/dev/jobs/JGFS_ATMOS_VERIFICATION @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################################### ## Abstract: diff --git a/dev/jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE b/dev/jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE index e7fb98be119..8670534fdb6 100755 --- a/dev/jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE +++ b/dev/jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE @@ -12,6 +12,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_AERO_ANALYSIS_INITIALIZE b/dev/jobs/JGLOBAL_AERO_ANALYSIS_INITIALIZE index 9b91bcda1b0..7e4808e4315 100755 --- a/dev/jobs/JGLOBAL_AERO_ANALYSIS_INITIALIZE +++ b/dev/jobs/JGLOBAL_AERO_ANALYSIS_INITIALIZE @@ -11,6 +11,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_AERO_ANALYSIS_VARIATIONAL b/dev/jobs/JGLOBAL_AERO_ANALYSIS_VARIATIONAL index fda8300d665..9a34c709300 100755 --- a/dev/jobs/JGLOBAL_AERO_ANALYSIS_VARIATIONAL +++ b/dev/jobs/JGLOBAL_AERO_ANALYSIS_VARIATIONAL @@ -12,6 +12,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_ANALYSIS_STATS b/dev/jobs/JGLOBAL_ANALYSIS_STATS index bcfde48bb7c..f103aaf115e 100755 --- a/dev/jobs/JGLOBAL_ANALYSIS_STATS +++ b/dev/jobs/JGLOBAL_ANALYSIS_STATS @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_ARCHIVE_TARS b/dev/jobs/JGLOBAL_ARCHIVE_TARS index 177c7ddd975..032bdaa3fea 100755 --- a/dev/jobs/JGLOBAL_ARCHIVE_TARS +++ b/dev/jobs/JGLOBAL_ARCHIVE_TARS @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" if [[ "${DO_WAVE}" == "YES" ]]; then source "${EXPDIR}/config.wave" source "${USHglobal}/wave_domain_grid.sh" diff --git a/dev/jobs/JGLOBAL_ARCHIVE_VRFY b/dev/jobs/JGLOBAL_ARCHIVE_VRFY index c3dc8d93413..5ccf76dbffe 100755 --- a/dev/jobs/JGLOBAL_ARCHIVE_VRFY +++ b/dev/jobs/JGLOBAL_ARCHIVE_VRFY @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_ATMENS_ANALYSIS_FINALIZE b/dev/jobs/JGLOBAL_ATMENS_ANALYSIS_FINALIZE index 997e88ba7df..444039be353 100755 --- a/dev/jobs/JGLOBAL_ATMENS_ANALYSIS_FINALIZE +++ b/dev/jobs/JGLOBAL_ATMENS_ANALYSIS_FINALIZE @@ -11,6 +11,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_ATMENS_ANALYSIS_FV3_INCREMENT b/dev/jobs/JGLOBAL_ATMENS_ANALYSIS_FV3_INCREMENT index c81dac9f8b7..31e58354858 100755 --- a/dev/jobs/JGLOBAL_ATMENS_ANALYSIS_FV3_INCREMENT +++ b/dev/jobs/JGLOBAL_ATMENS_ANALYSIS_FV3_INCREMENT @@ -12,6 +12,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_ATMENS_ANALYSIS_INITIALIZE b/dev/jobs/JGLOBAL_ATMENS_ANALYSIS_INITIALIZE index d41bc8eef0e..fb23246ab8e 100755 --- a/dev/jobs/JGLOBAL_ATMENS_ANALYSIS_INITIALIZE +++ b/dev/jobs/JGLOBAL_ATMENS_ANALYSIS_INITIALIZE @@ -11,6 +11,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_ATMENS_ANALYSIS_LETKF b/dev/jobs/JGLOBAL_ATMENS_ANALYSIS_LETKF index 7e32598ee66..0c2b98ea585 100755 --- a/dev/jobs/JGLOBAL_ATMENS_ANALYSIS_LETKF +++ b/dev/jobs/JGLOBAL_ATMENS_ANALYSIS_LETKF @@ -11,6 +11,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_ATMENS_ANALYSIS_OBS b/dev/jobs/JGLOBAL_ATMENS_ANALYSIS_OBS index b36dcfff885..cbf8a42b3e4 100755 --- a/dev/jobs/JGLOBAL_ATMENS_ANALYSIS_OBS +++ b/dev/jobs/JGLOBAL_ATMENS_ANALYSIS_OBS @@ -11,6 +11,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_ATMENS_ANALYSIS_SOL b/dev/jobs/JGLOBAL_ATMENS_ANALYSIS_SOL index da4436d1010..375a81cb25f 100755 --- a/dev/jobs/JGLOBAL_ATMENS_ANALYSIS_SOL +++ b/dev/jobs/JGLOBAL_ATMENS_ANALYSIS_SOL @@ -12,6 +12,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_ATMOS_ANALYSIS b/dev/jobs/JGLOBAL_ATMOS_ANALYSIS index 00ab41c25d7..fa2a2305cff 100755 --- a/dev/jobs/JGLOBAL_ATMOS_ANALYSIS +++ b/dev/jobs/JGLOBAL_ATMOS_ANALYSIS @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC b/dev/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC index 583b607ec0b..05e69958b6b 100755 --- a/dev/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC +++ b/dev/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" # Setup Python path for pygfs PYTHONPATH="${HOMEglobal}/ush/python${PYTHONPATH:+:${PYTHONPATH}}" diff --git a/dev/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC_FV3JEDI b/dev/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC_FV3JEDI index 5ce9e6af31e..2572fe0e78f 100755 --- a/dev/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC_FV3JEDI +++ b/dev/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC_FV3JEDI @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_ATMOS_ANALYSIS_DIAG b/dev/jobs/JGLOBAL_ATMOS_ANALYSIS_DIAG index 2d24c5ed042..e993909c78c 100755 --- a/dev/jobs/JGLOBAL_ATMOS_ANALYSIS_DIAG +++ b/dev/jobs/JGLOBAL_ATMOS_ANALYSIS_DIAG @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_ATMOS_CHGRES_GEN_CONTROL b/dev/jobs/JGLOBAL_ATMOS_CHGRES_GEN_CONTROL index a3f746f8c6c..04325039626 100755 --- a/dev/jobs/JGLOBAL_ATMOS_CHGRES_GEN_CONTROL +++ b/dev/jobs/JGLOBAL_ATMOS_CHGRES_GEN_CONTROL @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" # Initial conditions are from previous GFS cycle, but valid at the end of the cycle GDATE=$(date --utc +%Y%m%d%H -d "${PDY} ${cyc} - ${assim_freq} hours") diff --git a/dev/jobs/JGLOBAL_ATMOS_ENSSTAT b/dev/jobs/JGLOBAL_ATMOS_ENSSTAT index 809a962c941..daa9773335f 100755 --- a/dev/jobs/JGLOBAL_ATMOS_ENSSTAT +++ b/dev/jobs/JGLOBAL_ATMOS_ENSSTAT @@ -14,6 +14,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Begin JOB SPECIFIC work diff --git a/dev/jobs/JGLOBAL_ATMOS_POST_MANAGER b/dev/jobs/JGLOBAL_ATMOS_POST_MANAGER index 0a437f85feb..33582bbf594 100755 --- a/dev/jobs/JGLOBAL_ATMOS_POST_MANAGER +++ b/dev/jobs/JGLOBAL_ATMOS_POST_MANAGER @@ -12,6 +12,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" #################################### # Specify NET and RUN Name and model diff --git a/dev/jobs/JGLOBAL_ATMOS_PREP_SFC b/dev/jobs/JGLOBAL_ATMOS_PREP_SFC index efb2906486a..f11d05717e8 100755 --- a/dev/jobs/JGLOBAL_ATMOS_PREP_SFC +++ b/dev/jobs/JGLOBAL_ATMOS_PREP_SFC @@ -11,6 +11,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set date and cycle diff --git a/dev/jobs/JGLOBAL_ATMOS_PRODUCTS b/dev/jobs/JGLOBAL_ATMOS_PRODUCTS index 668e8d78000..a500aeb538f 100755 --- a/dev/jobs/JGLOBAL_ATMOS_PRODUCTS +++ b/dev/jobs/JGLOBAL_ATMOS_PRODUCTS @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Begin JOB SPECIFIC work diff --git a/dev/jobs/JGLOBAL_ATMOS_SFCANL b/dev/jobs/JGLOBAL_ATMOS_SFCANL index 4859c8b806a..551e4d59577 100755 --- a/dev/jobs/JGLOBAL_ATMOS_SFCANL +++ b/dev/jobs/JGLOBAL_ATMOS_SFCANL @@ -9,6 +9,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Begin JOB SPECIFIC work diff --git a/dev/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC b/dev/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC index b5ec6efe66c..12100b22a9f 100755 --- a/dev/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC +++ b/dev/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Begin JOB SPECIFIC work diff --git a/dev/jobs/JGLOBAL_ATMOS_UPP b/dev/jobs/JGLOBAL_ATMOS_UPP index d79887bb6ca..d7755db6f54 100755 --- a/dev/jobs/JGLOBAL_ATMOS_UPP +++ b/dev/jobs/JGLOBAL_ATMOS_UPP @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the exglobal script diff --git a/dev/jobs/JGLOBAL_ATMOS_VMINMON b/dev/jobs/JGLOBAL_ATMOS_VMINMON index dd84e8755ce..c933f918c80 100755 --- a/dev/jobs/JGLOBAL_ATMOS_VMINMON +++ b/dev/jobs/JGLOBAL_ATMOS_VMINMON @@ -13,6 +13,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################# # Determine PDY and cyc for previous cycle diff --git a/dev/jobs/JGLOBAL_ATM_ANALYSIS_FINALIZE b/dev/jobs/JGLOBAL_ATM_ANALYSIS_FINALIZE index 4962931d694..c3e2d5ce089 100755 --- a/dev/jobs/JGLOBAL_ATM_ANALYSIS_FINALIZE +++ b/dev/jobs/JGLOBAL_ATM_ANALYSIS_FINALIZE @@ -12,6 +12,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_ATM_ANALYSIS_FV3_INCREMENT b/dev/jobs/JGLOBAL_ATM_ANALYSIS_FV3_INCREMENT index 659d9f0e503..21b88e1f812 100755 --- a/dev/jobs/JGLOBAL_ATM_ANALYSIS_FV3_INCREMENT +++ b/dev/jobs/JGLOBAL_ATM_ANALYSIS_FV3_INCREMENT @@ -12,6 +12,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_ATM_ANALYSIS_INITIALIZE b/dev/jobs/JGLOBAL_ATM_ANALYSIS_INITIALIZE index d82f2d9c566..af4d6badd07 100755 --- a/dev/jobs/JGLOBAL_ATM_ANALYSIS_INITIALIZE +++ b/dev/jobs/JGLOBAL_ATM_ANALYSIS_INITIALIZE @@ -11,6 +11,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_ATM_ANALYSIS_VARIATIONAL b/dev/jobs/JGLOBAL_ATM_ANALYSIS_VARIATIONAL index fbefb87bb6e..b35d5587c5c 100755 --- a/dev/jobs/JGLOBAL_ATM_ANALYSIS_VARIATIONAL +++ b/dev/jobs/JGLOBAL_ATM_ANALYSIS_VARIATIONAL @@ -12,6 +12,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_ATM_PREP_ANL_BIAS b/dev/jobs/JGLOBAL_ATM_PREP_ANL_BIAS index 9d53b0841e4..aa4c15c04fe 100755 --- a/dev/jobs/JGLOBAL_ATM_PREP_ANL_BIAS +++ b/dev/jobs/JGLOBAL_ATM_PREP_ANL_BIAS @@ -11,6 +11,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_CLEANUP b/dev/jobs/JGLOBAL_CLEANUP index 9ae25b4bee5..976ff97ac57 100755 --- a/dev/jobs/JGLOBAL_CLEANUP +++ b/dev/jobs/JGLOBAL_CLEANUP @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" "${SCRglobal}/exglobal_cleanup.sh" && true export err=$? diff --git a/dev/jobs/JGLOBAL_ENKF_ARCHIVE_TARS b/dev/jobs/JGLOBAL_ENKF_ARCHIVE_TARS index 7977a7b6b55..4cecdce39fb 100755 --- a/dev/jobs/JGLOBAL_ENKF_ARCHIVE_TARS +++ b/dev/jobs/JGLOBAL_ENKF_ARCHIVE_TARS @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_ENKF_ARCHIVE_VRFY b/dev/jobs/JGLOBAL_ENKF_ARCHIVE_VRFY index 4f94c651004..81c71413399 100755 --- a/dev/jobs/JGLOBAL_ENKF_ARCHIVE_VRFY +++ b/dev/jobs/JGLOBAL_ENKF_ARCHIVE_VRFY @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_ENKF_DIAG b/dev/jobs/JGLOBAL_ENKF_DIAG index d3f6c7ed77e..acbf00b1492 100755 --- a/dev/jobs/JGLOBAL_ENKF_DIAG +++ b/dev/jobs/JGLOBAL_ENKF_DIAG @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_ENKF_ECEN b/dev/jobs/JGLOBAL_ENKF_ECEN index 9f773105065..867c940d90f 100755 --- a/dev/jobs/JGLOBAL_ENKF_ECEN +++ b/dev/jobs/JGLOBAL_ENKF_ECEN @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_ENKF_ECEN_FV3JEDI b/dev/jobs/JGLOBAL_ENKF_ECEN_FV3JEDI index 78c6afe3b1e..9b148bde8f7 100755 --- a/dev/jobs/JGLOBAL_ENKF_ECEN_FV3JEDI +++ b/dev/jobs/JGLOBAL_ENKF_ECEN_FV3JEDI @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_ENKF_SELECT_OBS b/dev/jobs/JGLOBAL_ENKF_SELECT_OBS index 52c2483ff52..32fa8fec1a0 100755 --- a/dev/jobs/JGLOBAL_ENKF_SELECT_OBS +++ b/dev/jobs/JGLOBAL_ENKF_SELECT_OBS @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_ENKF_SFC b/dev/jobs/JGLOBAL_ENKF_SFC index 34a31d9d2c1..e4f3749f389 100755 --- a/dev/jobs/JGLOBAL_ENKF_SFC +++ b/dev/jobs/JGLOBAL_ENKF_SFC @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_ENKF_UPDATE b/dev/jobs/JGLOBAL_ENKF_UPDATE index 3cb02d4d318..38564406d8c 100755 --- a/dev/jobs/JGLOBAL_ENKF_UPDATE +++ b/dev/jobs/JGLOBAL_ENKF_UPDATE @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_ENS_GLOBUS_ARCH b/dev/jobs/JGLOBAL_ENS_GLOBUS_ARCH index 5492f0d1749..27a5dac0b48 100755 --- a/dev/jobs/JGLOBAL_ENS_GLOBUS_ARCH +++ b/dev/jobs/JGLOBAL_ENS_GLOBUS_ARCH @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_EXTRACTVARS b/dev/jobs/JGLOBAL_EXTRACTVARS index af25a498c60..d2c535f138e 100755 --- a/dev/jobs/JGLOBAL_EXTRACTVARS +++ b/dev/jobs/JGLOBAL_EXTRACTVARS @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" source "${USHglobal}/wave_domain_grid.sh" # Set COM Paths diff --git a/dev/jobs/JGLOBAL_FETCH b/dev/jobs/JGLOBAL_FETCH index 748d9171866..f86d54d1cef 100755 --- a/dev/jobs/JGLOBAL_FETCH +++ b/dev/jobs/JGLOBAL_FETCH @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" # Setup Python path for pygfs PYTHONPATH="${HOMEglobal}/ush/python${PYTHONPATH:+:${PYTHONPATH}}" diff --git a/dev/jobs/JGLOBAL_FORECAST b/dev/jobs/JGLOBAL_FORECAST index 03371f568da..1b07b4b5161 100755 --- a/dev/jobs/JGLOBAL_FORECAST +++ b/dev/jobs/JGLOBAL_FORECAST @@ -23,6 +23,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" # Setup Python path for pygfs PYTHONPATH="${HOMEglobal}/ush/python${PYTHONPATH:+:${PYTHONPATH}}" diff --git a/dev/jobs/JGLOBAL_GLOBUS_ARCH b/dev/jobs/JGLOBAL_GLOBUS_ARCH index 721c183503e..a70a0b1302f 100755 --- a/dev/jobs/JGLOBAL_GLOBUS_ARCH +++ b/dev/jobs/JGLOBAL_GLOBUS_ARCH @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_MARINE_ANALYSIS_CHECKPOINT b/dev/jobs/JGLOBAL_MARINE_ANALYSIS_CHECKPOINT index 9b24b6e18ae..185f778406a 100755 --- a/dev/jobs/JGLOBAL_MARINE_ANALYSIS_CHECKPOINT +++ b/dev/jobs/JGLOBAL_MARINE_ANALYSIS_CHECKPOINT @@ -13,6 +13,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_MARINE_ANALYSIS_ECEN b/dev/jobs/JGLOBAL_MARINE_ANALYSIS_ECEN index 5bde481bbc4..b0c379f1771 100755 --- a/dev/jobs/JGLOBAL_MARINE_ANALYSIS_ECEN +++ b/dev/jobs/JGLOBAL_MARINE_ANALYSIS_ECEN @@ -14,6 +14,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_MARINE_ANALYSIS_FINALIZE b/dev/jobs/JGLOBAL_MARINE_ANALYSIS_FINALIZE index 5030b260ac1..4519425025a 100755 --- a/dev/jobs/JGLOBAL_MARINE_ANALYSIS_FINALIZE +++ b/dev/jobs/JGLOBAL_MARINE_ANALYSIS_FINALIZE @@ -13,6 +13,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_MARINE_ANALYSIS_INITIALIZE b/dev/jobs/JGLOBAL_MARINE_ANALYSIS_INITIALIZE index 4f2b466ac07..13cb08372f8 100755 --- a/dev/jobs/JGLOBAL_MARINE_ANALYSIS_INITIALIZE +++ b/dev/jobs/JGLOBAL_MARINE_ANALYSIS_INITIALIZE @@ -12,6 +12,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_MARINE_ANALYSIS_LETKF b/dev/jobs/JGLOBAL_MARINE_ANALYSIS_LETKF index d23967ea4b5..171308b85fa 100755 --- a/dev/jobs/JGLOBAL_MARINE_ANALYSIS_LETKF +++ b/dev/jobs/JGLOBAL_MARINE_ANALYSIS_LETKF @@ -16,6 +16,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_MARINE_ANALYSIS_VARIATIONAL b/dev/jobs/JGLOBAL_MARINE_ANALYSIS_VARIATIONAL index a8955865921..349a7096c53 100755 --- a/dev/jobs/JGLOBAL_MARINE_ANALYSIS_VARIATIONAL +++ b/dev/jobs/JGLOBAL_MARINE_ANALYSIS_VARIATIONAL @@ -13,6 +13,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_MARINE_BMAT b/dev/jobs/JGLOBAL_MARINE_BMAT index 314b83d9cab..e499590e62f 100755 --- a/dev/jobs/JGLOBAL_MARINE_BMAT +++ b/dev/jobs/JGLOBAL_MARINE_BMAT @@ -20,6 +20,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_MARINE_BMAT_INITIALIZE b/dev/jobs/JGLOBAL_MARINE_BMAT_INITIALIZE index 8ccf6b2cde9..df272897b26 100755 --- a/dev/jobs/JGLOBAL_MARINE_BMAT_INITIALIZE +++ b/dev/jobs/JGLOBAL_MARINE_BMAT_INITIALIZE @@ -21,6 +21,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_OCEANICE_PRODUCTS b/dev/jobs/JGLOBAL_OCEANICE_PRODUCTS index 22b7513be56..a54aa565ceb 100755 --- a/dev/jobs/JGLOBAL_OCEANICE_PRODUCTS +++ b/dev/jobs/JGLOBAL_OCEANICE_PRODUCTS @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" # Setup Python path for pygfs PYTHONPATH="${HOMEglobal}/ush/python${PYTHONPATH:+:${PYTHONPATH}}" diff --git a/dev/jobs/JGLOBAL_OFFLINE_ATMOS_ANALYSIS b/dev/jobs/JGLOBAL_OFFLINE_ATMOS_ANALYSIS index 5f5bb77e1ba..b4be32d22c7 100755 --- a/dev/jobs/JGLOBAL_OFFLINE_ATMOS_ANALYSIS +++ b/dev/jobs/JGLOBAL_OFFLINE_ATMOS_ANALYSIS @@ -9,6 +9,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_PREP_EMISSIONS b/dev/jobs/JGLOBAL_PREP_EMISSIONS index ad8dbe822f7..b248821537d 100755 --- a/dev/jobs/JGLOBAL_PREP_EMISSIONS +++ b/dev/jobs/JGLOBAL_PREP_EMISSIONS @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_PREP_OCEAN_OBS b/dev/jobs/JGLOBAL_PREP_OCEAN_OBS index 0ecd4873131..d3c1125fea8 100755 --- a/dev/jobs/JGLOBAL_PREP_OCEAN_OBS +++ b/dev/jobs/JGLOBAL_PREP_OCEAN_OBS @@ -9,6 +9,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_SNOWENS_ANALYSIS b/dev/jobs/JGLOBAL_SNOWENS_ANALYSIS index 549258bc27b..eb0a788c83e 100755 --- a/dev/jobs/JGLOBAL_SNOWENS_ANALYSIS +++ b/dev/jobs/JGLOBAL_SNOWENS_ANALYSIS @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_SNOW_ANALYSIS b/dev/jobs/JGLOBAL_SNOW_ANALYSIS index 04f3d197664..10e0b171063 100755 --- a/dev/jobs/JGLOBAL_SNOW_ANALYSIS +++ b/dev/jobs/JGLOBAL_SNOW_ANALYSIS @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ############################################## # Set variables used in the script diff --git a/dev/jobs/JGLOBAL_STAGE_IC b/dev/jobs/JGLOBAL_STAGE_IC index e62933f0a24..1b85aecd26b 100755 --- a/dev/jobs/JGLOBAL_STAGE_IC +++ b/dev/jobs/JGLOBAL_STAGE_IC @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" # Setup Python path for pygfs PYTHONPATH="${HOMEglobal}/ush/python${PYTHONPATH:+:${PYTHONPATH}}" diff --git a/dev/jobs/JGLOBAL_WAVE_GEMPAK b/dev/jobs/JGLOBAL_WAVE_GEMPAK index 04913144a09..f897627a599 100755 --- a/dev/jobs/JGLOBAL_WAVE_GEMPAK +++ b/dev/jobs/JGLOBAL_WAVE_GEMPAK @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" source "${USHglobal}/wave_domain_grid.sh" ################################### diff --git a/dev/jobs/JGLOBAL_WAVE_INIT b/dev/jobs/JGLOBAL_WAVE_INIT index 246a362c99c..8698264b037 100755 --- a/dev/jobs/JGLOBAL_WAVE_INIT +++ b/dev/jobs/JGLOBAL_WAVE_INIT @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" export MP_PULSE=0 diff --git a/dev/jobs/JGLOBAL_WAVE_POST_BNDPNT b/dev/jobs/JGLOBAL_WAVE_POST_BNDPNT index e3c5df58a5f..4e3825b22b9 100755 --- a/dev/jobs/JGLOBAL_WAVE_POST_BNDPNT +++ b/dev/jobs/JGLOBAL_WAVE_POST_BNDPNT @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" export MP_PULSE=0 diff --git a/dev/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL b/dev/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL index 0eba9e5c68b..76c3d1bd798 100755 --- a/dev/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL +++ b/dev/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" export COMPONENT="wave" diff --git a/dev/jobs/JGLOBAL_WAVE_POST_PNT b/dev/jobs/JGLOBAL_WAVE_POST_PNT index 95d33fbb9e2..ce841239b65 100755 --- a/dev/jobs/JGLOBAL_WAVE_POST_PNT +++ b/dev/jobs/JGLOBAL_WAVE_POST_PNT @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" export MP_PULSE=0 diff --git a/dev/jobs/JGLOBAL_WAVE_POST_SBS b/dev/jobs/JGLOBAL_WAVE_POST_SBS index 4080d962ffb..7f67cd8084d 100755 --- a/dev/jobs/JGLOBAL_WAVE_POST_SBS +++ b/dev/jobs/JGLOBAL_WAVE_POST_SBS @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" source "${USHglobal}/wave_domain_grid.sh" # Set COM Paths diff --git a/dev/jobs/JGLOBAL_WAVE_PRDGEN_BULLS b/dev/jobs/JGLOBAL_WAVE_PRDGEN_BULLS index 854331ad0b8..aaedfff0566 100755 --- a/dev/jobs/JGLOBAL_WAVE_PRDGEN_BULLS +++ b/dev/jobs/JGLOBAL_WAVE_PRDGEN_BULLS @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" ################################### # Set COM Paths diff --git a/dev/jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED b/dev/jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED index 993506b6701..1ce1e0b1c53 100755 --- a/dev/jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED +++ b/dev/jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" source "${USHglobal}/wave_domain_grid.sh" ################################### diff --git a/dev/jobs/JGLOBAL_WAVE_PREP b/dev/jobs/JGLOBAL_WAVE_PREP index 9be4c1087ae..4f9ea245586 100755 --- a/dev/jobs/JGLOBAL_WAVE_PREP +++ b/dev/jobs/JGLOBAL_WAVE_PREP @@ -10,6 +10,9 @@ source "${HOMEglobal}/ush/jjob_standard_vars.sh" #{% endif %} source "${USHglobal}/jjob_shell_setup.sh" +# Set strict mode which will exit on error or undefined variable +# and exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) +source "${USHglobal}/set_strict.sh" # Set rtofs PDY # shellcheck disable=SC2153 From add1d997952e9fa56fe931b07ebf4053777f8d6f Mon Sep 17 00:00:00 2001 From: Cory Martin Date: Fri, 20 Mar 2026 18:12:16 +0000 Subject: [PATCH 3/6] shell norms --- ush/jjob_shell_setup.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/ush/jjob_shell_setup.sh b/ush/jjob_shell_setup.sh index 8afef95d926..e2d0b5782f7 100644 --- a/ush/jjob_shell_setup.sh +++ b/ush/jjob_shell_setup.sh @@ -64,4 +64,3 @@ trap "postamble ${start_time}" EXIT # setpdy.sh may not be available in all environments; failures are non-fatal setpdy.sh || true source ./PDY || true - From c4eacf583592fd2aacbb64631814c4c487aad9a6 Mon Sep 17 00:00:00 2001 From: Cory Martin Date: Fri, 20 Mar 2026 18:56:03 +0000 Subject: [PATCH 4/6] change module setup --- ush/module-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ush/module-setup.sh b/ush/module-setup.sh index 661be25b2d4..1405b240ae6 100755 --- a/ush/module-setup.sh +++ b/ush/module-setup.sh @@ -94,4 +94,4 @@ else echo WARNING: UNKNOWN PLATFORM 1>&2 fi -source "${USHglobal}/set_strict.sh" +set +u From a839dc263339682997945f3a3d85b4acf174c4a2 Mon Sep 17 00:00:00 2001 From: Cory Martin Date: Mon, 23 Mar 2026 13:06:44 +0000 Subject: [PATCH 5/6] update set_strict --- ush/set_strict.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ush/set_strict.sh b/ush/set_strict.sh index 553195967c9..513e5ad3aff 100644 --- a/ush/set_strict.sh +++ b/ush/set_strict.sh @@ -9,4 +9,7 @@ if [[ ${STRICT:-"YES"} == "YES" ]]; then set -eu # Exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) set -o pipefail +else + # Exit on undefined variable and exit on error in a pipeline + set -u -o pipefail fi From 9a0c614143824b1a761b88a08b390204480b848d Mon Sep 17 00:00:00 2001 From: Cory Martin Date: Mon, 23 Mar 2026 13:17:14 +0000 Subject: [PATCH 6/6] Revert "update set_strict" This reverts commit a839dc263339682997945f3a3d85b4acf174c4a2. --- ush/set_strict.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/ush/set_strict.sh b/ush/set_strict.sh index 513e5ad3aff..553195967c9 100644 --- a/ush/set_strict.sh +++ b/ush/set_strict.sh @@ -9,7 +9,4 @@ if [[ ${STRICT:-"YES"} == "YES" ]]; then set -eu # Exit on error in a pipeline (e.g. if a command in "cmd | cmd2" fails) set -o pipefail -else - # Exit on undefined variable and exit on error in a pipeline - set -u -o pipefail fi