From 2c9142b527ef0ecbd0cba84ff74361dfd7c475fb Mon Sep 17 00:00:00 2001 From: David Huber Date: Thu, 20 Feb 2025 16:00:40 +0000 Subject: [PATCH 01/16] Wrap && logical operations into if blocks --- ci/scripts/driver.sh | 4 +- docs/doxygen/compile | 5 +- env/AWSPW.env | 8 +- env/AZUREPW.env | 24 +++- env/GAEAC5.env | 48 ++++++-- env/GAEAC6.env | 48 ++++++-- env/GOOGLEPW.env | 24 +++- env/HERA.env | 32 +++-- env/HERCULES.env | 44 +++++-- env/JET.env | 36 ++++-- env/ORION.env | 40 +++++-- env/S4.env | 32 +++-- env/WCOSS2.env | 44 +++++-- jobs/JGDAS_AERO_ANALYSIS_GENERATE_BMATRIX | 8 +- jobs/JGDAS_ATMOS_ANALYSIS_DIAG | 8 +- jobs/JGDAS_ATMOS_CHGRES_FORENKF | 8 +- jobs/JGDAS_ATMOS_VERFOZN | 4 +- jobs/JGDAS_ATMOS_VERFRAD | 4 +- jobs/JGDAS_ENKF_ARCHIVE_TARS | 8 +- jobs/JGDAS_ENKF_ARCHIVE_VRFY | 8 +- jobs/JGDAS_ENKF_DIAG | 12 +- jobs/JGDAS_ENKF_ECEN | 8 +- jobs/JGDAS_ENKF_POST | 8 +- jobs/JGDAS_ENKF_SELECT_OBS | 16 ++- jobs/JGDAS_ENKF_SFC | 8 +- jobs/JGDAS_ENKF_UPDATE | 8 +- jobs/JGDAS_FIT2OBS | 20 +++- jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_ECEN | 8 +- jobs/JGFS_ATMOS_CYCLONE_GENESIS | 4 +- jobs/JGFS_ATMOS_CYCLONE_TRACKER | 4 +- jobs/JGFS_ATMOS_FSU_GENESIS | 4 +- jobs/JGFS_ATMOS_POSTSND | 20 +++- jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE | 8 +- jobs/JGLOBAL_AERO_ANALYSIS_INITIALIZE | 4 +- jobs/JGLOBAL_AERO_ANALYSIS_VARIATIONAL | 4 +- jobs/JGLOBAL_ARCHIVE_TARS | 8 +- jobs/JGLOBAL_ARCHIVE_VRFY | 8 +- jobs/JGLOBAL_ATMENS_ANALYSIS_FINALIZE | 8 +- jobs/JGLOBAL_ATMENS_ANALYSIS_FV3_INCREMENT | 4 +- jobs/JGLOBAL_ATMENS_ANALYSIS_INITIALIZE | 4 +- jobs/JGLOBAL_ATMENS_ANALYSIS_LETKF | 4 +- jobs/JGLOBAL_ATMENS_ANALYSIS_OBS | 4 +- jobs/JGLOBAL_ATMENS_ANALYSIS_SOL | 4 +- jobs/JGLOBAL_ATMOS_ANALYSIS | 12 +- jobs/JGLOBAL_ATMOS_ANALYSIS_CALC | 12 +- jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP | 8 +- jobs/JGLOBAL_ATMOS_ENSSTAT | 4 +- jobs/JGLOBAL_ATMOS_PRODUCTS | 4 +- jobs/JGLOBAL_ATMOS_SFCANL | 4 +- jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC | 8 +- jobs/JGLOBAL_ATMOS_UPP | 4 +- jobs/JGLOBAL_ATMOS_VMINMON | 4 +- jobs/JGLOBAL_ATM_ANALYSIS_FINALIZE | 8 +- jobs/JGLOBAL_ATM_ANALYSIS_FV3_INCREMENT | 4 +- jobs/JGLOBAL_ATM_ANALYSIS_INITIALIZE | 4 +- jobs/JGLOBAL_ATM_ANALYSIS_VARIATIONAL | 4 +- jobs/JGLOBAL_ATM_PREP_IODA_OBS | 4 +- jobs/JGLOBAL_EXTRACTVARS | 4 +- jobs/JGLOBAL_FETCH | 4 +- jobs/JGLOBAL_MARINE_ANALYSIS_CHECKPOINT | 4 +- jobs/JGLOBAL_MARINE_ANALYSIS_FINALIZE | 8 +- jobs/JGLOBAL_MARINE_ANALYSIS_INITIALIZE | 4 +- jobs/JGLOBAL_MARINE_ANALYSIS_LETKF | 8 +- jobs/JGLOBAL_MARINE_ANALYSIS_VARIATIONAL | 4 +- jobs/JGLOBAL_MARINE_BMAT | 4 +- jobs/JGLOBAL_OCEANICE_PRODUCTS | 4 +- jobs/JGLOBAL_PREP_OBS_AERO | 8 +- jobs/JGLOBAL_PREP_OCEAN_OBS | 8 +- jobs/JGLOBAL_SNOWENS_ANALYSIS | 4 +- jobs/JGLOBAL_SNOW_ANALYSIS | 8 +- jobs/JGLOBAL_STAGE_IC | 4 +- jobs/JGLOBAL_WAVE_GEMPAK | 4 +- jobs/JGLOBAL_WAVE_INIT | 4 +- jobs/JGLOBAL_WAVE_POST_BNDPNT | 4 +- jobs/JGLOBAL_WAVE_POST_BNDPNTBLL | 4 +- jobs/JGLOBAL_WAVE_POST_PNT | 4 +- jobs/JGLOBAL_WAVE_POST_SBS | 4 +- jobs/JGLOBAL_WAVE_PRDGEN_BULLS | 4 +- jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED | 4 +- jobs/JGLOBAL_WAVE_PREP | 4 +- jobs/rocoto/aeroanlfinal.sh | 4 +- jobs/rocoto/aeroanlgenb.sh | 4 +- jobs/rocoto/aeroanlinit.sh | 4 +- jobs/rocoto/aeroanlvar.sh | 4 +- jobs/rocoto/aerosol_init.sh | 12 +- jobs/rocoto/anal.sh | 4 +- jobs/rocoto/analcalc.sh | 4 +- jobs/rocoto/analdiag.sh | 4 +- jobs/rocoto/arch_tars.sh | 4 +- jobs/rocoto/arch_vrfy.sh | 4 +- jobs/rocoto/atmanlfinal.sh | 4 +- jobs/rocoto/atmanlfv3inc.sh | 4 +- jobs/rocoto/atmanlinit.sh | 4 +- jobs/rocoto/atmanlvar.sh | 4 +- jobs/rocoto/atmensanlfinal.sh | 4 +- jobs/rocoto/atmensanlfv3inc.sh | 4 +- jobs/rocoto/atmensanlinit.sh | 4 +- jobs/rocoto/atmensanlletkf.sh | 4 +- jobs/rocoto/atmensanlobs.sh | 4 +- jobs/rocoto/atmensanlsol.sh | 4 +- jobs/rocoto/cleanup.sh | 4 +- jobs/rocoto/earc_tars.sh | 4 +- jobs/rocoto/earc_vrfy.sh | 4 +- jobs/rocoto/ecen.sh | 8 +- jobs/rocoto/echgres.sh | 4 +- jobs/rocoto/ediag.sh | 4 +- jobs/rocoto/eobs.sh | 4 +- jobs/rocoto/epos.sh | 8 +- jobs/rocoto/esfc.sh | 4 +- jobs/rocoto/esnowanl.sh | 4 +- jobs/rocoto/eupd.sh | 4 +- jobs/rocoto/extractvars.sh | 8 +- jobs/rocoto/fcst.sh | 4 +- jobs/rocoto/fetch.sh | 4 +- jobs/rocoto/fit2obs.sh | 8 +- jobs/rocoto/marineanlchkpt.sh | 4 +- jobs/rocoto/marineanlfinal.sh | 4 +- jobs/rocoto/marineanlinit.sh | 4 +- jobs/rocoto/marineanlletkf.sh | 4 +- jobs/rocoto/marineanlvar.sh | 4 +- jobs/rocoto/marinebmat.sh | 4 +- jobs/rocoto/ocnanalecen.sh | 4 +- jobs/rocoto/postsnd.sh | 4 +- jobs/rocoto/prep.sh | 28 +++-- jobs/rocoto/prepatmiodaobs.sh | 4 +- jobs/rocoto/prepobsaero.sh | 4 +- jobs/rocoto/prepoceanobs.sh | 4 +- jobs/rocoto/sfcanl.sh | 4 +- jobs/rocoto/snowanl.sh | 4 +- jobs/rocoto/stage_ic.sh | 4 +- jobs/rocoto/waveawipsbulls.sh | 4 +- jobs/rocoto/waveawipsgridded.sh | 4 +- jobs/rocoto/wavegempak.sh | 4 +- jobs/rocoto/waveinit.sh | 8 +- jobs/rocoto/wavepostbndpnt.sh | 8 +- jobs/rocoto/wavepostbndpntbll.sh | 8 +- jobs/rocoto/wavepostpnt.sh | 8 +- jobs/rocoto/wavepostsbs.sh | 4 +- jobs/rocoto/waveprep.sh | 8 +- parm/config/gefs/config.efcs | 16 ++- parm/config/gefs/config.fcst | 16 ++- parm/config/gefs/config.resources | 12 +- parm/config/gfs/config.base | 4 +- parm/config/gfs/config.efcs | 16 ++- parm/config/gfs/config.fcst | 16 ++- parm/config/gfs/config.resources | 24 +++- parm/config/sfs/config.resources | 12 +- scripts/exgdas_atmos_chgres_forenkf.sh | 4 +- scripts/exgdas_enkf_ecen.sh | 20 +++- scripts/exgdas_enkf_post.sh | 12 +- scripts/exgdas_enkf_select_obs.sh | 4 +- scripts/exgdas_enkf_sfc.sh | 20 +++- scripts/exgdas_enkf_update.sh | 16 ++- scripts/exglobal_atmos_analysis.sh | 56 ++++++--- scripts/exglobal_atmos_analysis_calc.sh | 20 +++- scripts/exglobal_atmos_sfcanl.sh | 8 +- scripts/exglobal_cleanup.sh | 8 +- scripts/exglobal_diag.sh | 28 +++-- scripts/exglobal_forecast.sh | 80 +++++++++---- sorc/build_ufs.sh | 8 +- sorc/build_ww3prepost.sh | 8 +- sorc/link_workflow.sh | 132 +++++++++++++++------ ush/detect_machine.sh | 4 +- ush/forecast_postdet.sh | 8 +- ush/forecast_predet.sh | 4 +- ush/getges.sh | 72 ++++++++--- ush/oceanice_nc2grib2.sh | 4 +- ush/parsing_namelists_GOCART.sh | 4 +- ush/tropcy_relocate.sh | 8 +- workflow/generate_workflows.sh | 56 ++++++--- 170 files changed, 1363 insertions(+), 454 deletions(-) diff --git a/ci/scripts/driver.sh b/ci/scripts/driver.sh index acf54381b8..4c3f837b2c 100755 --- a/ci/scripts/driver.sh +++ b/ci/scripts/driver.sh @@ -77,7 +77,9 @@ pr_list=$(${GH} pr list --repo "${REPO_URL}" --label "CI-${MACHINE_ID^}-Ready" - for pr in ${pr_list}; do pr_dir="${GFS_CI_ROOT}/PR/${pr}" - [[ ! -d ${pr_dir} ]] && mkdir -p "${pr_dir}" + if [[ ! -d ${pr_dir} ]]; then + mkdir -p "${pr_dir}" + fi db_list=$("${ROOT_DIR}/ci/scripts/utils/pr_list_database.py" --add_pr "${pr}" --dbfile "${pr_list_dbfile}") output_ci_single="${pr_dir}/output_single.log" ############################################################# diff --git a/docs/doxygen/compile b/docs/doxygen/compile index 1273edab98..883acf9698 100755 --- a/docs/doxygen/compile +++ b/docs/doxygen/compile @@ -16,7 +16,10 @@ else echo "trying system doxygen" doxygen=$(which doxygen) rc=$? - [[ $rc -ne 0 ]] && (echo "doxygen not found, ABORT!"; exit 1) + if [[ $rc -ne 0 ]]; then + echo "doxygen not found, ABORT!" + exit 1 + fi fi $doxygen diff --git a/env/AWSPW.env b/env/AWSPW.env index f365695f85..bff2f3bde8 100755 --- a/env/AWSPW.env +++ b/env/AWSPW.env @@ -25,8 +25,12 @@ if [[ -n "${ntasks:-}" && -n "${max_tasks_per_node:-}" && -n "${tasks_per_node:- max_threads_per_task=$((max_tasks_per_node / tasks_per_node)) NTHREADSmax=${threads_per_task:-${max_threads_per_task}} NTHREADS1=${threads_per_task:-1} - [[ ${NTHREADSmax} -gt ${max_threads_per_task} ]] && NTHREADSmax=${max_threads_per_task} - [[ ${NTHREADS1} -gt ${max_threads_per_task} ]] && NTHREADS1=${max_threads_per_task} + if [[ ${NTHREADSmax} -gt ${max_threads_per_task} ]]; then + NTHREADSmax=${max_threads_per_task} + fi + if [[ ${NTHREADS1} -gt ${max_threads_per_task} ]]; then + NTHREADS1=${max_threads_per_task} + fi APRUN_default="${launcher} -n ${ntasks}" else echo "ERROR config.resources must be sourced before sourcing AWSPW.env" diff --git a/env/AZUREPW.env b/env/AZUREPW.env index b2b4063ff3..8ab2b86b24 100755 --- a/env/AZUREPW.env +++ b/env/AZUREPW.env @@ -26,8 +26,12 @@ if [[ -n "${ntasks:-}" && -n "${max_tasks_per_node:-}" && -n "${tasks_per_node:- max_threads_per_task=$((max_tasks_per_node / tasks_per_node)) NTHREADSmax=${threads_per_task:-${max_threads_per_task}} NTHREADS1=${threads_per_task:-1} - [[ ${NTHREADSmax} -gt ${max_threads_per_task} ]] && NTHREADSmax=${max_threads_per_task} - [[ ${NTHREADS1} -gt ${max_threads_per_task} ]] && NTHREADS1=${max_threads_per_task} + if [[ ${NTHREADSmax} -gt ${max_threads_per_task} ]]; then + NTHREADSmax=${max_threads_per_task} + fi + if [[ ${NTHREADS1} -gt ${max_threads_per_task} ]]; then + NTHREADS1=${max_threads_per_task} + fi APRUN_default="${launcher} -n ${ntasks}" else echo "ERROR config.resources must be sourced before sourcing AZUREPW.env" @@ -61,7 +65,9 @@ elif [[ "${step}" = "post" ]]; then export APRUN_NP="${APRUN_default}" export NTHREADS_DWN=${threads_per_task_dwn:-1} - [[ ${NTHREADS_DWN} -gt ${max_threads_per_task} ]] && export NTHREADS_DWN=${max_threads_per_task} + if [[ ${NTHREADS_DWN} -gt ${max_threads_per_task} ]]; then + export NTHREADS_DWN=${max_threads_per_task} + fi export APRUN_DWN="${launcher} -n ${ntasks_dwn}" elif [[ "${step}" = "atmos_products" ]]; then @@ -79,11 +85,15 @@ elif [[ "${step}" = "ecen" ]]; then export APRUN_ECEN="${APRUN_default}" export NTHREADS_CHGRES=${threads_per_task_chgres:-12} - [[ ${NTHREADS_CHGRES} -gt ${max_tasks_per_node} ]] && export NTHREADS_CHGRES=${max_tasks_per_node} + if [[ ${NTHREADS_CHGRES} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CHGRES=${max_tasks_per_node} + fi export APRUN_CHGRES="time" export NTHREADS_CALCINC=${threads_per_task_calcinc:-1} - [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]] && export NTHREADS_CALCINC=${max_threads_per_task} + if [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]]; then + export NTHREADS_CALCINC=${max_threads_per_task} + fi export APRUN_CALCINC="${APRUN_default}" elif [[ "${step}" = "esfc" ]]; then @@ -92,7 +102,9 @@ elif [[ "${step}" = "esfc" ]]; then export APRUN_ESFC="${APRUN_default}" export NTHREADS_CYCLE=${threads_per_task_cycle:-14} - [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]] && export NTHREADS_CYCLE=${max_tasks_per_node} + if [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CYCLE=${max_tasks_per_node} + fi export APRUN_CYCLE="${APRUN_default}" elif [[ "${step}" = "epos" ]]; then diff --git a/env/GAEAC5.env b/env/GAEAC5.env index 8af8003dff..d4bd733bf7 100755 --- a/env/GAEAC5.env +++ b/env/GAEAC5.env @@ -24,8 +24,12 @@ if [[ -n "${ntasks:-}" && -n "${max_tasks_per_node:-}" && -n "${tasks_per_node:- max_threads_per_task=$((max_tasks_per_node / tasks_per_node)) NTHREADSmax=${threads_per_task:-${max_threads_per_task}} NTHREADS1=${threads_per_task:-1} - [[ ${NTHREADSmax} -gt ${max_threads_per_task} ]] && NTHREADSmax=${max_threads_per_task} - [[ ${NTHREADS1} -gt ${max_threads_per_task} ]] && NTHREADS1=${max_threads_per_task} + if [[ ${NTHREADSmax} -gt ${max_threads_per_task} ]]; then + NTHREADSmax=${max_threads_per_task} + fi + if [[ ${NTHREADS1} -gt ${max_threads_per_task} ]]; then + NTHREADS1=${max_threads_per_task} + fi # This may be useful when GaeaC5 is fully ported, so ignore SC warning # shellcheck disable=SC2034 APRUN_default="${launcher} -n ${ntasks}" @@ -49,7 +53,9 @@ case ${step} in "waveinit" | "waveprep" | "wavepostsbs" | "wavepostbndpnt" | "wavepostpnt" | "wavepostbndpntbll") export CFP_MP="YES" - [[ "${step}" = "waveprep" ]] && export MP_PULSE=0 + if [[ "${step}" = "waveprep" ]]; then + export MP_PULSE=0 + fi export wavempexec=${launcher} export wave_mpmd=${mpmd_opt} @@ -135,7 +141,9 @@ case ${step} in max_threads_per_task=$((max_tasks_per_node / tasks_per_node_ocnanalecen)) export NTHREADS_OCNANALECEN=${threads_per_task_ocnanalecen:-${max_threads_per_task}} - [[ ${NTHREADS_OCNANALECEN} -gt ${max_threads_per_task} ]] && export NTHREADS_OCNANALECEN=${max_threads_per_task} + if [[ ${NTHREADS_OCNANALECEN} -gt ${max_threads_per_task} ]]; then + export NTHREADS_OCNANALECEN=${max_threads_per_task} + fi export APRUN_OCNANALECEN="${launcher} -n ${ntasks_ocnanalecen} --cpus-per-task=${NTHREADS_OCNANALECEN}" ;; "marineanlchkpt") @@ -158,11 +166,15 @@ case ${step} in export APRUN_GSI="${APRUN_default} --cpus-per-task=${NTHREADS_GSI}" export NTHREADS_CALCINC=${threads_per_task_calcinc:-1} - [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]] && export NTHREADS_CALCINC=${max_threads_per_task} + if [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]]; then + export NTHREADS_CALCINC=${max_threads_per_task} + fi export APRUN_CALCINC="${launcher} \$ncmd --cpus-per-task=${NTHREADS_CALCINC}" export NTHREADS_CYCLE=${threads_per_task_cycle:-12} - [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]] && export NTHREADS_CYCLE=${max_tasks_per_node} + if [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CYCLE=${max_tasks_per_node} + fi ntasks_cycle=${ntiles:-6} export APRUN_CYCLE="${launcher} -n ${ntasks_cycle} --cpus-per-task=${NTHREADS_CYCLE}" @@ -173,7 +185,9 @@ case ${step} in "sfcanl") export NTHREADS_CYCLE=${threads_per_task:-14} - [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]] && export NTHREADS_CYCLE=${max_tasks_per_node} + if [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CYCLE=${max_tasks_per_node} + fi export APRUN_CYCLE="${APRUN_default} --cpus-per-task=${NTHREADS_CYCLE}" ;; "eobs") @@ -187,7 +201,9 @@ case ${step} in export NTHREADS_GSI=${NTHREADSmax} - [[ ${NTHREADS_GSI} -gt ${max_threads_per_task} ]] && export NTHREADS_GSI=${max_threads_per_task} + if [[ ${NTHREADS_GSI} -gt ${max_threads_per_task} ]]; then + export NTHREADS_GSI=${max_threads_per_task} + fi export APRUN_GSI="${APRUN_default} --cpus-per-task=${NTHREADS_GSI}" ;; "eupd") @@ -234,11 +250,15 @@ case ${step} in export APRUN_ECEN="${APRUN_default} --cpus-per-task=${NTHREADS_ECEN}" export NTHREADS_CHGRES=${threads_per_task_chgres:-12} - [[ ${NTHREADS_CHGRES} -gt ${max_tasks_per_node} ]] && export NTHREADS_CHGRES=${max_tasks_per_node} + if [[ ${NTHREADS_CHGRES} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CHGRES=${max_tasks_per_node} + fi export APRUN_CHGRES="time" export NTHREADS_CALCINC=${threads_per_task_calcinc:-1} - [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]] && export NTHREADS_CALCINC=${max_threads_per_task} + if [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]]; then + export NTHREADS_CALCINC=${max_threads_per_task} + fi export APRUN_CALCINC="${APRUN_default} --cpus-per-task=${NTHREADS_CALCINC}" ;; @@ -248,7 +268,9 @@ case ${step} in export APRUN_ESFC="${APRUN_default} --cpus-per-task=${NTHREADS_ESFC}" export NTHREADS_CYCLE=${threads_per_task_cycle:-14} - [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]] && export NTHREADS_CYCLE=${max_tasks_per_node} + if [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CYCLE=${max_tasks_per_node} + fi export APRUN_CYCLE="${APRUN_default} --cpus-per-task=${NTHREADS_CYCLE}" ;; @@ -266,7 +288,9 @@ case ${step} in export APRUN_POSTSND="${APRUN_default} --cpus-per-task=${NTHREADS_POSTSND}" export NTHREADS_POSTSNDCFP=${threads_per_task_postsndcfp:-1} - [[ ${NTHREADS_POSTSNDCFP} -gt ${max_threads_per_task} ]] && export NTHREADS_POSTSNDCFP=${max_threads_per_task} + if [[ ${NTHREADS_POSTSNDCFP} -gt ${max_threads_per_task} ]]; then + export NTHREADS_POSTSNDCFP=${max_threads_per_task} + fi export APRUN_POSTSNDCFP="${launcher} -n ${ntasks_postsndcfp} ${mpmd_opt}" ;; diff --git a/env/GAEAC6.env b/env/GAEAC6.env index 90150948e3..5e70b66e3e 100755 --- a/env/GAEAC6.env +++ b/env/GAEAC6.env @@ -24,8 +24,12 @@ if [[ -n "${ntasks:-}" && -n "${max_tasks_per_node:-}" && -n "${tasks_per_node:- max_threads_per_task=$((max_tasks_per_node / tasks_per_node)) NTHREADSmax=${threads_per_task:-${max_threads_per_task}} NTHREADS1=${threads_per_task:-1} - [[ ${NTHREADSmax} -gt ${max_threads_per_task} ]] && NTHREADSmax=${max_threads_per_task} - [[ ${NTHREADS1} -gt ${max_threads_per_task} ]] && NTHREADS1=${max_threads_per_task} + if [[ ${NTHREADSmax} -gt ${max_threads_per_task} ]]; then + NTHREADSmax=${max_threads_per_task} + fi + if [[ ${NTHREADS1} -gt ${max_threads_per_task} ]]; then + NTHREADS1=${max_threads_per_task} + fi # This may be useful when GaeaC6 is fully ported, so ignore SC warning # shellcheck disable=SC2034 APRUN_default="${launcher} -n ${ntasks}" @@ -49,7 +53,9 @@ case ${step} in "waveinit" | "waveprep" | "wavepostsbs" | "wavepostbndpnt" | "wavepostpnt" | "wavepostbndpntbll") export CFP_MP="YES" - [[ "${step}" = "waveprep" ]] && export MP_PULSE=0 + if [[ "${step}" = "waveprep" ]]; then + export MP_PULSE=0 + fi export wavempexec=${launcher} export wave_mpmd=${mpmd_opt} @@ -135,7 +141,9 @@ case ${step} in max_threads_per_task=$((max_tasks_per_node / tasks_per_node_ocnanalecen)) export NTHREADS_OCNANALECEN=${threads_per_task_ocnanalecen:-${max_threads_per_task}} - [[ ${NTHREADS_OCNANALECEN} -gt ${max_threads_per_task} ]] && export NTHREADS_OCNANALECEN=${max_threads_per_task} + if [[ ${NTHREADS_OCNANALECEN} -gt ${max_threads_per_task} ]]; then + export NTHREADS_OCNANALECEN=${max_threads_per_task} + fi export APRUN_OCNANALECEN="${launcher} -n ${ntasks_ocnanalecen} --cpus-per-task=${NTHREADS_OCNANALECEN}" ;; "marineanlchkpt") @@ -158,11 +166,15 @@ case ${step} in export APRUN_GSI="${APRUN_default} --cpus-per-task=${NTHREADS_GSI}" export NTHREADS_CALCINC=${threads_per_task_calcinc:-1} - [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]] && export NTHREADS_CALCINC=${max_threads_per_task} + if [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]]; then + export NTHREADS_CALCINC=${max_threads_per_task} + fi export APRUN_CALCINC="${launcher} \$ncmd --cpus-per-task=${NTHREADS_CALCINC}" export NTHREADS_CYCLE=${threads_per_task_cycle:-12} - [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]] && export NTHREADS_CYCLE=${max_tasks_per_node} + if [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CYCLE=${max_tasks_per_node} + fi ntasks_cycle=${ntiles:-6} export APRUN_CYCLE="${launcher} -n ${ntasks_cycle} --cpus-per-task=${NTHREADS_CYCLE}" @@ -173,7 +185,9 @@ case ${step} in "sfcanl") export NTHREADS_CYCLE=${threads_per_task:-14} - [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]] && export NTHREADS_CYCLE=${max_tasks_per_node} + if [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CYCLE=${max_tasks_per_node} + fi export APRUN_CYCLE="${APRUN_default} --cpus-per-task=${NTHREADS_CYCLE}" ;; "eobs") @@ -187,7 +201,9 @@ case ${step} in export NTHREADS_GSI=${NTHREADSmax} - [[ ${NTHREADS_GSI} -gt ${max_threads_per_task} ]] && export NTHREADS_GSI=${max_threads_per_task} + if [[ ${NTHREADS_GSI} -gt ${max_threads_per_task} ]]; then + export NTHREADS_GSI=${max_threads_per_task} + fi export APRUN_GSI="${APRUN_default} --cpus-per-task=${NTHREADS_GSI}" ;; "eupd") @@ -234,11 +250,15 @@ case ${step} in export APRUN_ECEN="${APRUN_default} --cpus-per-task=${NTHREADS_ECEN}" export NTHREADS_CHGRES=${threads_per_task_chgres:-12} - [[ ${NTHREADS_CHGRES} -gt ${max_tasks_per_node} ]] && export NTHREADS_CHGRES=${max_tasks_per_node} + if [[ ${NTHREADS_CHGRES} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CHGRES=${max_tasks_per_node} + fi export APRUN_CHGRES="time" export NTHREADS_CALCINC=${threads_per_task_calcinc:-1} - [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]] && export NTHREADS_CALCINC=${max_threads_per_task} + if [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]]; then + export NTHREADS_CALCINC=${max_threads_per_task} + fi export APRUN_CALCINC="${APRUN_default} --cpus-per-task=${NTHREADS_CALCINC}" ;; @@ -248,7 +268,9 @@ case ${step} in export APRUN_ESFC="${APRUN_default} --cpus-per-task=${NTHREADS_ESFC}" export NTHREADS_CYCLE=${threads_per_task_cycle:-14} - [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]] && export NTHREADS_CYCLE=${max_tasks_per_node} + if [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CYCLE=${max_tasks_per_node} + fi export APRUN_CYCLE="${APRUN_default} --cpus-per-task=${NTHREADS_CYCLE}" ;; @@ -266,7 +288,9 @@ case ${step} in export APRUN_POSTSND="${APRUN_default} --cpus-per-task=${NTHREADS_POSTSND}" export NTHREADS_POSTSNDCFP=${threads_per_task_postsndcfp:-1} - [[ ${NTHREADS_POSTSNDCFP} -gt ${max_threads_per_task} ]] && export NTHREADS_POSTSNDCFP=${max_threads_per_task} + if [[ ${NTHREADS_POSTSNDCFP} -gt ${max_threads_per_task} ]]; then + export NTHREADS_POSTSNDCFP=${max_threads_per_task} + fi export APRUN_POSTSNDCFP="${launcher} -n ${ntasks_postsndcfp} ${mpmd_opt}" ;; diff --git a/env/GOOGLEPW.env b/env/GOOGLEPW.env index d84008d648..db74600f56 100755 --- a/env/GOOGLEPW.env +++ b/env/GOOGLEPW.env @@ -25,8 +25,12 @@ if [[ -n "${ntasks:-}" && -n "${max_tasks_per_node:-}" && -n "${tasks_per_node:- max_threads_per_task=$((max_tasks_per_node / tasks_per_node)) NTHREADSmax=${threads_per_task:-${max_threads_per_task}} NTHREADS1=${threads_per_task:-1} - [[ ${NTHREADSmax} -gt ${max_threads_per_task} ]] && NTHREADSmax=${max_threads_per_task} - [[ ${NTHREADS1} -gt ${max_threads_per_task} ]] && NTHREADS1=${max_threads_per_task} + if [[ ${NTHREADSmax} -gt ${max_threads_per_task} ]]; then + NTHREADSmax=${max_threads_per_task} + fi + if [[ ${NTHREADS1} -gt ${max_threads_per_task} ]]; then + NTHREADS1=${max_threads_per_task} + fi APRUN_default="${launcher} -n ${ntasks}" else echo "ERROR config.resources must be sourced before sourcing GOOGLEPW.env" @@ -60,7 +64,9 @@ elif [[ "${step}" = "post" ]]; then export APRUN_NP="${APRUN_default}" export NTHREADS_DWN=${threads_per_task_dwn:-1} - [[ ${NTHREADS_DWN} -gt ${max_threads_per_task} ]] && export NTHREADS_DWN=${max_threads_per_task} + if [[ ${NTHREADS_DWN} -gt ${max_threads_per_task} ]]; then + export NTHREADS_DWN=${max_threads_per_task} + fi export APRUN_DWN="${launcher} -n ${ntasks_dwn}" elif [[ "${step}" = "atmos_products" ]]; then @@ -78,11 +84,15 @@ elif [[ "${step}" = "ecen" ]]; then export APRUN_ECEN="${APRUN_default}" export NTHREADS_CHGRES=${threads_per_task_chgres:-12} - [[ ${NTHREADS_CHGRES} -gt ${max_tasks_per_node} ]] && export NTHREADS_CHGRES=${max_tasks_per_node} + if [[ ${NTHREADS_CHGRES} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CHGRES=${max_tasks_per_node} + fi export APRUN_CHGRES="time" export NTHREADS_CALCINC=${threads_per_task_calcinc:-1} - [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]] && export NTHREADS_CALCINC=${max_threads_per_task} + if [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]]; then + export NTHREADS_CALCINC=${max_threads_per_task} + fi export APRUN_CALCINC="${APRUN_default}" elif [[ "${step}" = "esfc" ]]; then @@ -91,7 +101,9 @@ elif [[ "${step}" = "esfc" ]]; then export APRUN_ESFC="${APRUN_default}" export NTHREADS_CYCLE=${threads_per_task_cycle:-14} - [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]] && export NTHREADS_CYCLE=${max_tasks_per_node} + if [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CYCLE=${max_tasks_per_node} + fi export APRUN_CYCLE="${APRUN_default}" elif [[ "${step}" = "epos" ]]; then diff --git a/env/HERA.env b/env/HERA.env index 68f64617e1..ff1ff428ae 100755 --- a/env/HERA.env +++ b/env/HERA.env @@ -37,8 +37,12 @@ if [[ -n "${ntasks:-}" && -n "${max_tasks_per_node:-}" && -n "${tasks_per_node:- max_threads_per_task=$((max_tasks_per_node / tasks_per_node)) NTHREADSmax=${threads_per_task:-${max_threads_per_task}} NTHREADS1=${threads_per_task:-1} - [[ ${NTHREADSmax} -gt ${max_threads_per_task} ]] && NTHREADSmax=${max_threads_per_task} - [[ ${NTHREADS1} -gt ${max_threads_per_task} ]] && NTHREADS1=${max_threads_per_task} + if [[ ${NTHREADSmax} -gt ${max_threads_per_task} ]]; then + NTHREADSmax=${max_threads_per_task} + fi + if [[ ${NTHREADS1} -gt ${max_threads_per_task} ]]; then + NTHREADS1=${max_threads_per_task} + fi APRUN_default="${launcher} -n ${ntasks}" else echo "ERROR config.resources must be sourced before sourcing HERA.env" @@ -166,11 +170,15 @@ elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then export APRUN_GSI="${APRUN_default} --cpus-per-task=${NTHREADS_GSI}" export NTHREADS_CALCINC=${threads_per_task_calcinc:-1} - [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]] && export NTHREADS_CALCINC=${max_threads_per_task} + if [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]]; then + export NTHREADS_CALCINC=${max_threads_per_task} + fi export APRUN_CALCINC="${launcher} \$ncmd --cpus-per-task=${NTHREADS_CALCINC}" export NTHREADS_CYCLE=${threads_per_task_cycle:-12} - [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]] && export NTHREADS_CYCLE=${max_tasks_per_node} + if [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CYCLE=${max_tasks_per_node} + fi ntasks_cycle=${ntiles:-6} export APRUN_CYCLE="${launcher} -n ${ntasks_cycle} --cpus-per-task=${NTHREADS_CYCLE}" @@ -232,11 +240,15 @@ elif [[ "${step}" = "ecen" ]]; then export APRUN_ECEN="${APRUN_default} --cpus-per-task=${NTHREADS_ECEN}" export NTHREADS_CHGRES=${threads_per_task_chgres:-12} - [[ ${NTHREADS_CHGRES} -gt ${max_tasks_per_node} ]] && export NTHREADS_CHGRES=${max_tasks_per_node} + if [[ ${NTHREADS_CHGRES} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CHGRES=${max_tasks_per_node} + fi export APRUN_CHGRES="time" export NTHREADS_CALCINC=${threads_per_task_calcinc:-1} - [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]] && export NTHREADS_CALCINC=${max_threads_per_task} + if [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]]; then + export NTHREADS_CALCINC=${max_threads_per_task} + fi export APRUN_CALCINC="${APRUN_default} --cpus-per-task=${NTHREADS_CALCINC}" elif [[ "${step}" = "esfc" ]]; then @@ -245,7 +257,9 @@ elif [[ "${step}" = "esfc" ]]; then export APRUN_ESFC="${APRUN_default} --cpus-per-task=${NTHREADS_ESFC}" export NTHREADS_CYCLE=${threads_per_task_cycle:-14} - [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]] && export NTHREADS_CYCLE=${max_tasks_per_node} + if [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CYCLE=${max_tasks_per_node} + fi export APRUN_CYCLE="${APRUN_default} --cpus-per-task=${NTHREADS_CYCLE}" elif [[ "${step}" = "epos" ]]; then @@ -261,7 +275,9 @@ elif [[ "${step}" = "postsnd" ]]; then export APRUN_POSTSND="${APRUN_default} --cpus-per-task=${NTHREADS_POSTSND}" export NTHREADS_POSTSNDCFP=${threads_per_task_postsndcfp:-1} - [[ ${NTHREADS_POSTSNDCFP} -gt ${max_threads_per_task} ]] && export NTHREADS_POSTSNDCFP=${max_threads_per_task} + if [[ ${NTHREADS_POSTSNDCFP} -gt ${max_threads_per_task} ]]; then + export NTHREADS_POSTSNDCFP=${max_threads_per_task} + fi export APRUN_POSTSNDCFP="${launcher} -n ${ntasks_postsndcfp} ${mpmd_opt}" elif [[ "${step}" = "awips" ]]; then diff --git a/env/HERCULES.env b/env/HERCULES.env index b565881a73..9321b58e1b 100755 --- a/env/HERCULES.env +++ b/env/HERCULES.env @@ -34,8 +34,12 @@ if [[ -n "${ntasks:-}" && -n "${max_tasks_per_node:-}" && -n "${tasks_per_node:- max_threads_per_task=$((max_tasks_per_node / tasks_per_node)) NTHREADSmax=${threads_per_task:-${max_threads_per_task}} NTHREADS1=${threads_per_task:-1} - [[ ${NTHREADSmax} -gt ${max_threads_per_task} ]] && NTHREADSmax=${max_threads_per_task} - [[ ${NTHREADS1} -gt ${max_threads_per_task} ]] && NTHREADS1=${max_threads_per_task} + if [[ ${NTHREADSmax} -gt ${max_threads_per_task} ]]; then + NTHREADSmax=${max_threads_per_task} + fi + if [[ ${NTHREADS1} -gt ${max_threads_per_task} ]]; then + NTHREADS1=${max_threads_per_task} + fi APRUN_default="${launcher} -n ${ntasks}" else echo "ERROR config.resources must be sourced before sourcing HERCULES.env" @@ -57,7 +61,9 @@ case ${step} in "waveinit" | "waveprep" | "wavepostsbs" | "wavepostbndpnt" | "wavepostpnt" | "wavepostbndpntbll") export CFP_MP="YES" - [[ "${step}" = "waveprep" ]] && export MP_PULSE=0 + if [[ "${step}" = "waveprep" ]]; then + export MP_PULSE=0 + fi export wavempexec=${launcher} export wave_mpmd=${mpmd_opt} @@ -169,11 +175,15 @@ case ${step} in export APRUN_GSI="${APRUN_default} --cpus-per-task=${NTHREADS_GSI}" export NTHREADS_CALCINC=${threads_per_task_calcinc:-1} - [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]] && export NTHREADS_CALCINC=${max_threads_per_task} + if [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]]; then + export NTHREADS_CALCINC=${max_threads_per_task} + fi export APRUN_CALCINC="${launcher} \$ncmd --cpus-per-task=${NTHREADS_CALCINC}" export NTHREADS_CYCLE=${threads_per_task_cycle:-12} - [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]] && export NTHREADS_CYCLE=${max_tasks_per_node} + if [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CYCLE=${max_tasks_per_node} + fi ntasks_cycle=${ntiles:-6} export APRUN_CYCLE="${launcher} -n ${ntasks_cycle} --cpus-per-task=${NTHREADS_CYCLE}" @@ -184,7 +194,9 @@ case ${step} in "sfcanl") export NTHREADS_CYCLE=${threads_per_task:-14} - [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]] && export NTHREADS_CYCLE=${max_tasks_per_node} + if [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CYCLE=${max_tasks_per_node} + fi export APRUN_CYCLE="${APRUN_default} --cpus-per-task=${NTHREADS_CYCLE}" ;; "eobs") @@ -198,7 +210,9 @@ case ${step} in export NTHREADS_GSI=${NTHREADSmax} - [[ ${NTHREADS_GSI} -gt ${max_threads_per_task} ]] && export NTHREADS_GSI=${max_threads_per_task} + if [[ ${NTHREADS_GSI} -gt ${max_threads_per_task} ]]; then + export NTHREADS_GSI=${max_threads_per_task} + fi export APRUN_GSI="${APRUN_default} --cpus-per-task=${NTHREADS_GSI}" ;; "eupd") @@ -246,11 +260,15 @@ case ${step} in export APRUN_ECEN="${APRUN_default} --cpus-per-task=${NTHREADS_ECEN}" export NTHREADS_CHGRES=${threads_per_task_chgres:-12} - [[ ${NTHREADS_CHGRES} -gt ${max_tasks_per_node} ]] && export NTHREADS_CHGRES=${max_tasks_per_node} + if [[ ${NTHREADS_CHGRES} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CHGRES=${max_tasks_per_node} + fi export APRUN_CHGRES="time" export NTHREADS_CALCINC=${threads_per_task_calcinc:-1} - [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]] && export NTHREADS_CALCINC=${max_threads_per_task} + if [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]]; then + export NTHREADS_CALCINC=${max_threads_per_task} + fi export APRUN_CALCINC="${APRUN_default} --cpus-per-task=${NTHREADS_CALCINC}" ;; @@ -260,7 +278,9 @@ case ${step} in export APRUN_ESFC="${APRUN_default} --cpus-per-task=${NTHREADS_ESFC}" export NTHREADS_CYCLE=${threads_per_task_cycle:-14} - [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]] && export NTHREADS_CYCLE=${max_tasks_per_node} + if [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CYCLE=${max_tasks_per_node} + fi export APRUN_CYCLE="${APRUN_default} --cpus-per-task=${NTHREADS_CYCLE}" ;; @@ -278,7 +298,9 @@ case ${step} in export APRUN_POSTSND="${APRUN_default} --cpus-per-task=${NTHREADS_POSTSND}" export NTHREADS_POSTSNDCFP=${threads_per_task_postsndcfp:-1} - [[ ${NTHREADS_POSTSNDCFP} -gt ${max_threads_per_task} ]] && export NTHREADS_POSTSNDCFP=${max_threads_per_task} + if [[ ${NTHREADS_POSTSNDCFP} -gt ${max_threads_per_task} ]]; then + export NTHREADS_POSTSNDCFP=${max_threads_per_task} + fi export APRUN_POSTSNDCFP="${launcher} -n ${ntasks_postsndcfp} ${mpmd_opt}" ;; diff --git a/env/JET.env b/env/JET.env index 7bfd912062..68cf0f1ac9 100755 --- a/env/JET.env +++ b/env/JET.env @@ -25,8 +25,12 @@ if [[ -n "${ntasks:-}" && -n "${max_tasks_per_node:-}" && -n "${tasks_per_node:- max_threads_per_task=$((max_tasks_per_node / tasks_per_node)) NTHREADSmax=${threads_per_task:-${max_threads_per_task}} NTHREADS1=${threads_per_task:-1} - [[ ${NTHREADSmax} -gt ${max_threads_per_task} ]] && NTHREADSmax=${max_threads_per_task} - [[ ${NTHREADS1} -gt ${max_threads_per_task} ]] && NTHREADS1=${max_threads_per_task} + if [[ ${NTHREADSmax} -gt ${max_threads_per_task} ]]; then + NTHREADSmax=${max_threads_per_task} + fi + if [[ ${NTHREADS1} -gt ${max_threads_per_task} ]]; then + NTHREADS1=${max_threads_per_task} + fi APRUN_default="${launcher} -n ${ntasks}" else echo "ERROR config.resources must be sourced before sourcing JET.env" @@ -139,11 +143,15 @@ elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then export APRUN_GSI="${APRUN_default}" export NTHREADS_CALCINC=${threads_per_task_calcinc:-1} - [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]] && export NTHREADS_CALCINC=${max_threads_per_task} + if [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]]; then + export NTHREADS_CALCINC=${max_threads_per_task} + fi export APRUN_CALCINC="${launcher} \$ncmd" export NTHREADS_CYCLE=${threads_per_task_cycle:-12} - [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]] && export NTHREADS_CYCLE=${max_tasks_per_node} + if [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CYCLE=${max_tasks_per_node} + fi ntasks_cycle=${ntiles:-6} export APRUN_CYCLE="${launcher} -n ${ntasks_cycle}" @@ -153,7 +161,9 @@ elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then elif [[ "${step}" = "sfcanl" ]]; then export NTHREADS_CYCLE=${threads_per_task:-14} - [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]] && export NTHREADS_CYCLE=${max_tasks_per_node} + if [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CYCLE=${max_tasks_per_node} + fi export APRUN_CYCLE="${APRUN_default}" elif [[ "${step}" = "eobs" ]]; then @@ -205,11 +215,15 @@ elif [[ "${step}" = "ecen" ]]; then export APRUN_ECEN="${APRUN_default}" export NTHREADS_CHGRES=${threads_per_task_chgres:-12} - [[ ${NTHREADS_CHGRES} -gt ${max_tasks_per_node} ]] && export NTHREADS_CHGRES=${max_tasks_per_node} + if [[ ${NTHREADS_CHGRES} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CHGRES=${max_tasks_per_node} + fi export APRUN_CHGRES="time" export NTHREADS_CALCINC=${threads_per_task_calcinc:-1} - [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]] && export NTHREADS_CALCINC=${max_threads_per_task} + if [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]]; then + export NTHREADS_CALCINC=${max_threads_per_task} + fi export APRUN_CALCINC="${APRUN_default}" elif [[ "${step}" = "esfc" ]]; then @@ -218,7 +232,9 @@ elif [[ "${step}" = "esfc" ]]; then export APRUN_ESFC="${APRUN_default}" export NTHREADS_CYCLE=${threads_per_task_cycle:-14} - [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]] && export NTHREADS_CYCLE=${max_tasks_per_node} + if [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CYCLE=${max_tasks_per_node} + fi export APRUN_CYCLE="${APRUN_default}" elif [[ "${step}" = "epos" ]]; then @@ -234,7 +250,9 @@ elif [[ "${step}" = "postsnd" ]]; then export APRUN_POSTSND="${APRUN_default}" export NTHREADS_POSTSNDCFP=${threads_per_task_postsndcfp:-1} - [[ ${NTHREADS_POSTSNDCFP} -gt ${max_threads_per_task} ]] && export NTHREADS_POSTSNDCFP=${max_threads_per_task} + if [[ ${NTHREADS_POSTSNDCFP} -gt ${max_threads_per_task} ]]; then + export NTHREADS_POSTSNDCFP=${max_threads_per_task} + fi export APRUN_POSTSNDCFP="${launcher} -n ${ntasks_postsndcfp} ${mpmd_opt}" elif [[ "${step}" = "awips" ]]; then diff --git a/env/ORION.env b/env/ORION.env index 64f3f3d555..d427ba6da6 100755 --- a/env/ORION.env +++ b/env/ORION.env @@ -32,8 +32,12 @@ if [[ -n "${ntasks:-}" && -n "${max_tasks_per_node:-}" && -n "${tasks_per_node:- max_threads_per_task=$((max_tasks_per_node / tasks_per_node)) NTHREADSmax=${threads_per_task:-${max_threads_per_task}} NTHREADS1=${threads_per_task:-1} - [[ ${NTHREADSmax} -gt ${max_threads_per_task} ]] && NTHREADSmax=${max_threads_per_task} - [[ ${NTHREADS1} -gt ${max_threads_per_task} ]] && NTHREADS1=${max_threads_per_task} + if [[ ${NTHREADSmax} -gt ${max_threads_per_task} ]]; then + NTHREADSmax=${max_threads_per_task} + fi + if [[ ${NTHREADS1} -gt ${max_threads_per_task} ]]; then + NTHREADS1=${max_threads_per_task} + fi APRUN_default="${launcher} -n ${ntasks}" else echo "ERROR config.resources must be sourced before sourcing ORION.env" @@ -167,11 +171,15 @@ elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then export APRUN_GSI="${APRUN_default} --cpus-per-task=${NTHREADS_GSI}" export NTHREADS_CALCINC=${threads_per_task_calcinc:-1} - [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]] && export NTHREADS_CALCINC=${max_threads_per_task} + if [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]]; then + export NTHREADS_CALCINC=${max_threads_per_task} + fi export APRUN_CALCINC="${launcher} \$ncmd --cpus-per-task=${NTHREADS_CALCINC}" export NTHREADS_CYCLE=${threads_per_task_cycle:-12} - [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]] && export NTHREADS_CYCLE=${max_tasks_per_node} + if [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CYCLE=${max_tasks_per_node} + fi ntasks_cycle=${ntiles:-6} export APRUN_CYCLE="${launcher} -n ${ntasks_cycle} --cpus-per-task=${NTHREADS_CYCLE}" @@ -181,7 +189,9 @@ elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then elif [[ "${step}" = "sfcanl" ]]; then export NTHREADS_CYCLE=${threads_per_task:-14} - [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]] && export NTHREADS_CYCLE=${max_tasks_per_node} + if [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CYCLE=${max_tasks_per_node} + fi export APRUN_CYCLE="${APRUN_default} --cpus-per-task=${NTHREADS_CYCLE}" elif [[ "${step}" = "eobs" ]]; then @@ -194,7 +204,9 @@ elif [[ "${step}" = "eobs" ]]; then export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" export NTHREADS_GSI=${NTHREADSmax} - [[ ${NTHREADS_GSI} -gt ${max_threads_per_task} ]] && export NTHREADS_GSI=${max_threads_per_task} + if [[ ${NTHREADS_GSI} -gt ${max_threads_per_task} ]]; then + export NTHREADS_GSI=${max_threads_per_task} + fi export APRUN_GSI="${APRUN_default} --cpus-per-task=${NTHREADS_GSI}" elif [[ "${step}" = "eupd" ]]; then @@ -236,11 +248,15 @@ elif [[ "${step}" = "ecen" ]]; then export APRUN_ECEN="${APRUN_default} --cpus-per-task=${NTHREADS_ECEN}" export NTHREADS_CHGRES=${threads_per_task:-12} - [[ ${NTHREADS_CHGRES} -gt ${max_tasks_per_node} ]] && export NTHREADS_CHGRES=${max_tasks_per_node} + if [[ ${NTHREADS_CHGRES} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CHGRES=${max_tasks_per_node} + fi export APRUN_CHGRES="time" export NTHREADS_CALCINC=${threads_per_task_calcinc:-1} - [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]] && export NTHREADS_CALCINC=${max_threads_per_task} + if [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]]; then + export NTHREADS_CALCINC=${max_threads_per_task} + fi export APRUN_CALCINC="${APRUN_default} --cpus-per-task=${NTHREADS_CALCINC}" elif [[ "${step}" = "esfc" ]]; then @@ -249,7 +265,9 @@ elif [[ "${step}" = "esfc" ]]; then export APRUN_ESFC="${APRUN_default} --cpus-per-task=${NTHREADS_ESFC}" export NTHREADS_CYCLE=${threads_per_task_cycle:-14} - [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]] && export NTHREADS_CYCLE=${max_tasks_per_node} + if [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CYCLE=${max_tasks_per_node} + fi export APRUN_CYCLE="${APRUN_default} --cpus-per-task=${NTHREADS_CYCLE}" elif [[ "${step}" = "epos" ]]; then @@ -265,7 +283,9 @@ elif [[ "${step}" = "postsnd" ]]; then export APRUN_POSTSND="${APRUN_default} --cpus-per-task=${NTHREADS_POSTSND}" export NTHREADS_POSTSNDCFP=${threads_per_task_postsndcfp:-1} - [[ ${NTHREADS_POSTSNDCFP} -gt ${max_threads_per_task} ]] && export NTHREADS_POSTSNDCFP=${max_threads_per_task} + if [[ ${NTHREADS_POSTSNDCFP} -gt ${max_threads_per_task} ]]; then + export NTHREADS_POSTSNDCFP=${max_threads_per_task} + fi export APRUN_POSTSNDCFP="${launcher} -n ${ntasks_postsndcfp} ${mpmd_opt}" elif [[ "${step}" = "awips" ]]; then diff --git a/env/S4.env b/env/S4.env index 39d24e19ec..30a199abc3 100755 --- a/env/S4.env +++ b/env/S4.env @@ -25,8 +25,12 @@ if [[ -n "${ntasks:-}" && -n "${max_tasks_per_node:-}" && -n "${tasks_per_node:- max_threads_per_task=$((max_tasks_per_node / tasks_per_node)) NTHREADSmax=${threads_per_task:-${max_threads_per_task}} NTHREADS1=${threads_per_task:-1} - [[ ${NTHREADSmax} -gt ${max_threads_per_task} ]] && NTHREADSmax=${max_threads_per_task} - [[ ${NTHREADS1} -gt ${max_threads_per_task} ]] && NTHREADS1=${max_threads_per_task} + if [[ ${NTHREADSmax} -gt ${max_threads_per_task} ]]; then + NTHREADSmax=${max_threads_per_task} + fi + if [[ ${NTHREADS1} -gt ${max_threads_per_task} ]]; then + NTHREADS1=${max_threads_per_task} + fi APRUN_default="${launcher} -n ${ntasks}" else echo "ERROR config.resources must be sourced before sourcing S4.env" @@ -135,11 +139,15 @@ elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then export APRUN_GSI="${APRUN_default}" export NTHREADS_CALCINC=${threads_per_task_calcinc:-1} - [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]] && export NTHREADS_CALCINC=${max_threads_per_task} + if [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]]; then + export NTHREADS_CALCINC=${max_threads_per_task} + fi export APRUN_CALCINC="${launcher} \$ncmd" export NTHREADS_CYCLE=${threads_per_task_cycle:-12} - [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]] && export NTHREADS_CYCLE=${max_tasks_per_node} + if [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CYCLE=${max_tasks_per_node} + fi ntasks_cycle=${ntiles:-6} export APRUN_CYCLE="${launcher} -n ${ntasks_cycle}" @@ -150,7 +158,9 @@ elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then elif [[ "${step}" = "sfcanl" ]]; then export NTHREADS_CYCLE=${threads_per_task:-14} - [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]] && export NTHREADS_CYCLE=${max_tasks_per_node} + if [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CYCLE=${max_tasks_per_node} + fi export APRUN_CYCLE="${APRUN_default}" elif [[ "${step}" = "eobs" ]]; then @@ -203,11 +213,15 @@ elif [[ "${step}" = "ecen" ]]; then export APRUN_ECEN="${APRUN_default}" export NTHREADS_CHGRES=${threads_per_task_chgres:-12} - [[ ${NTHREADS_CHGRES} -gt ${max_tasks_per_node} ]] && export NTHREADS_CHGRES=${max_tasks_per_node} + if [[ ${NTHREADS_CHGRES} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CHGRES=${max_tasks_per_node} + fi export APRUN_CHGRES="time" export NTHREADS_CALCINC=${threads_per_task_calcinc:-1} - [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]] && export NTHREADS_CALCINC=${max_threads_per_task} + if [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]]; then + export NTHREADS_CALCINC=${max_threads_per_task} + fi export APRUN_CALCINC="${APRUN_default}" elif [[ "${step}" = "esfc" ]]; then @@ -216,7 +230,9 @@ elif [[ "${step}" = "esfc" ]]; then export APRUN_ESFC="${APRUN_default}" export NTHREADS_CYCLE=${threads_per_task_cycle:-14} - [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]] && export NTHREADS_CYCLE=${max_tasks_per_node} + if [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CYCLE=${max_tasks_per_node} + fi export APRUN_CYCLE="${APRUN_default}" elif [[ "${step}" = "epos" ]]; then diff --git a/env/WCOSS2.env b/env/WCOSS2.env index fe6acf88fb..6545542308 100755 --- a/env/WCOSS2.env +++ b/env/WCOSS2.env @@ -19,8 +19,12 @@ if [[ -n "${ntasks:-}" && -n "${max_tasks_per_node:-}" && -n "${tasks_per_node:- max_threads_per_task=$((max_tasks_per_node / tasks_per_node)) NTHREADSmax=${threads_per_task:-${max_threads_per_task}} NTHREADS1=${threads_per_task:-1} - [[ ${NTHREADSmax} -gt ${max_threads_per_task} ]] && NTHREADSmax=${max_threads_per_task} - [[ ${NTHREADS1} -gt ${max_threads_per_task} ]] && NTHREADS1=${max_threads_per_task} + if [[ ${NTHREADSmax} -gt ${max_threads_per_task} ]]; then + NTHREADSmax=${max_threads_per_task} + fi + if [[ ${NTHREADS1} -gt ${max_threads_per_task} ]]; then + NTHREADS1=${max_threads_per_task} + fi APRUN_default="${launcher} -n ${ntasks}" else echo "ERROR config.resources must be sourced before sourcing WCOSS2.env" @@ -149,11 +153,15 @@ elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then export APRUN_GSI="${APRUN_default} -ppn ${tasks_per_node} --cpu-bind depth --depth ${NTHREADS_GSI}" export NTHREADS_CALCINC=${threads_per_task_calcinc:-1} - [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]] && export NTHREADS_CALCINC=${max_threads_per_task} + if [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]]; then + export NTHREADS_CALCINC=${max_threads_per_task} + fi export APRUN_CALCINC="${launcher} \$ncmd" export NTHREADS_CYCLE=${threads_per_task_cycle:-14} - [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]] && export NTHREADS_CYCLE=${max_tasks_per_node} + if [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CYCLE=${max_tasks_per_node} + fi ntasks_cycle=${ntiles:-6} export APRUN_CYCLE="${launcher} -n ${ntasks_cycle} -ppn ${tasks_per_node_cycle} --cpu-bind depth --depth ${NTHREADS_CYCLE}" @@ -162,7 +170,9 @@ elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then export APRUN_GAUSFCANL="${launcher} -n ${ntasks_gausfcanl}" export NTHREADS_CHGRES=${threads_per_task_echgres:-14} - [[ ${NTHREADS_CHGRES} -gt ${max_tasks_per_node} ]] && export NTHREADS_CHGRES=${max_tasks_per_node} + if [[ ${NTHREADS_CHGRES} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CHGRES=${max_tasks_per_node} + fi export APRUN_CHGRES="" export CFP_MP=${CFP_MP:-"NO"} @@ -172,7 +182,9 @@ elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then elif [[ "${step}" = "sfcanl" ]]; then export NTHREADS_CYCLE=${threads_per_task:-14} - [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]] && export NTHREADS_CYCLE=${max_tasks_per_node} + if [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CYCLE=${max_tasks_per_node} + fi export APRUN_CYCLE="${APRUN_default}" elif [[ "${step}" = "eobs" ]]; then @@ -240,15 +252,21 @@ elif [[ "${step}" = "ecen" ]]; then export APRUN_ECEN="${APRUN_default} -ppn ${tasks_per_node} --cpu-bind depth --depth ${NTHREADS_ECEN}" export NTHREADS_CHGRES=${threads_per_task_chgres:-14} - [[ ${NTHREADS_CHGRES} -gt ${max_tasks_per_node} ]] && export NTHREADS_CHGRES=${max_tasks_per_node} + if [[ ${NTHREADS_CHGRES} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CHGRES=${max_tasks_per_node} + fi export APRUN_CHGRES="time" export NTHREADS_CALCINC=${threads_per_task_calcinc:-1} - [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]] && export NTHREADS_CALCINC=${max_threads_per_task} + if [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]]; then + export NTHREADS_CALCINC=${max_threads_per_task} + fi export APRUN_CALCINC="${APRUN_default}" export NTHREADS_CYCLE=${threads_per_task_cycle:-14} - [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]] && export NTHREADS_CYCLE=${max_tasks_per_node} + if [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CYCLE=${max_tasks_per_node} + fi export APRUN_CYCLE="${APRUN_default} -ppn ${tasks_per_node_cycle} --cpu-bind depth --depth ${NTHREADS_CYCLE}" elif [[ "${step}" = "esfc" ]]; then @@ -257,7 +275,9 @@ elif [[ "${step}" = "esfc" ]]; then export APRUN_ESFC="${APRUN_default} -ppn ${tasks_per_node} --cpu-bind depth --depth ${NTHREADS_ESFC}" export NTHREADS_CYCLE=${threads_per_task_cycle:-14} - [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]] && export NTHREADS_CYCLE=${max_tasks_per_node} + if [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]]; then + export NTHREADS_CYCLE=${max_tasks_per_node} + fi export APRUN_CYCLE="${APRUN_default} -ppn ${tasks_per_node_cycle} --cpu-bind depth --depth ${NTHREADS_CYCLE}" elif [[ "${step}" = "epos" ]]; then @@ -272,7 +292,9 @@ elif [[ "${step}" = "postsnd" ]]; then export NTHREADS_POSTSND=${NTHREADS1} export NTHREADS_POSTSNDCFP=${threads_per_task_postsndcfp:-1} - [[ ${NTHREADS_POSTSNDCFP} -gt ${max_threads_per_task} ]] && export NTHREADS_POSTSNDCFP=${max_threads_per_task} + if [[ ${NTHREADS_POSTSNDCFP} -gt ${max_threads_per_task} ]]; then + export NTHREADS_POSTSNDCFP=${max_threads_per_task} + fi export APRUN_POSTSNDCFP="${launcher} -np ${ntasks_postsndcfp} ${mpmd_opt}" export mpmd_opt="-ppn ${tasks_per_node} ${mpmd_opt}" diff --git a/jobs/JGDAS_AERO_ANALYSIS_GENERATE_BMATRIX b/jobs/JGDAS_AERO_ANALYSIS_GENERATE_BMATRIX index 81c89e9155..8e5b44f24c 100755 --- a/jobs/JGDAS_AERO_ANALYSIS_GENERATE_BMATRIX +++ b/jobs/JGDAS_AERO_ANALYSIS_GENERATE_BMATRIX @@ -24,7 +24,9 @@ mkdir -p "${COMOUT_CHEM_BMAT}" EXSCRIPT=${GDASAEROBMATPY:-${SCRgfs}/exgdas_aero_analysis_generate_bmatrix.py} ${EXSCRIPT} status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################## # End JOB SPECIFIC work @@ -41,6 +43,8 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || exit 1 -[[ "${KEEPDATA}" = "NO" ]] && rm -rf "${DATA}" +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" +fi exit 0 diff --git a/jobs/JGDAS_ATMOS_ANALYSIS_DIAG b/jobs/JGDAS_ATMOS_ANALYSIS_DIAG index c47bd4a47b..5f57390409 100755 --- a/jobs/JGDAS_ATMOS_ANALYSIS_DIAG +++ b/jobs/JGDAS_ATMOS_ANALYSIS_DIAG @@ -35,7 +35,9 @@ mkdir -m 775 -p "${COMOUT_ATMOS_ANALYSIS}" # Run relevant script ${ANALDIAGSH:-${SCRgfs}/exglobal_diag.sh} status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi ############################################## @@ -53,7 +55,9 @@ fi # Remove the Temporary working directory ########################################## cd ${DATAROOT} -[[ ${KEEPDATA} = "NO" ]] && rm -rf ${DATA} +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf ${DATA} +fi exit 0 diff --git a/jobs/JGDAS_ATMOS_CHGRES_FORENKF b/jobs/JGDAS_ATMOS_CHGRES_FORENKF index 5747675fe2..94bfa91509 100755 --- a/jobs/JGDAS_ATMOS_CHGRES_FORENKF +++ b/jobs/JGDAS_ATMOS_CHGRES_FORENKF @@ -24,7 +24,9 @@ MEMDIR="mem001" YMD=${PDY} HH=${cyc} declare_from_tmpl -rx COM_ATMOS_HISTORY_MEM # Run relevant script ${CHGRESFCSTSH:-${SCRgfs}/exgdas_atmos_chgres_forenkf.sh} status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi ############################################## @@ -42,7 +44,9 @@ fi # Remove the Temporary working directory ########################################## cd ${DATAROOT} -[[ ${KEEPDATA} = "NO" ]] && rm -rf ${DATA} +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf ${DATA} +fi exit 0 diff --git a/jobs/JGDAS_ATMOS_VERFOZN b/jobs/JGDAS_ATMOS_VERFOZN index 446112eaa0..510bd9f752 100755 --- a/jobs/JGDAS_ATMOS_VERFOZN +++ b/jobs/JGDAS_ATMOS_VERFOZN @@ -38,6 +38,8 @@ fi ################################ # Remove the Working Directory ################################ -[[ "${KEEPDATA}" = "NO" ]] && rm -rf "${DATA}" +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" +fi exit 0 diff --git a/jobs/JGDAS_ATMOS_VERFRAD b/jobs/JGDAS_ATMOS_VERFRAD index b777b1ebe2..2520250490 100755 --- a/jobs/JGDAS_ATMOS_VERFRAD +++ b/jobs/JGDAS_ATMOS_VERFRAD @@ -41,6 +41,8 @@ fi ################################ # Remove the Working Directory ################################ -[[ "${KEEPDATA}" = "NO" ]] && rm -rf "${DATA}" +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" +fi exit 0 diff --git a/jobs/JGDAS_ENKF_ARCHIVE_TARS b/jobs/JGDAS_ENKF_ARCHIVE_TARS index 04fe8e3141..d390e87422 100755 --- a/jobs/JGDAS_ENKF_ARCHIVE_TARS +++ b/jobs/JGDAS_ENKF_ARCHIVE_TARS @@ -19,7 +19,9 @@ MEMDIR="ensstat" YMD=${PDY} HH=${cyc} declare_from_tmpl -rx \ "${SCRgfs}/exgdas_enkf_earc_tars.py" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################################### @@ -39,6 +41,8 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || (echo "${DATAROOT} does not exist. ABORT!"; exit 1) -[[ ${KEEPDATA} = "NO" ]] && rm -rf "${DATA}" +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf "${DATA}" +fi exit 0 diff --git a/jobs/JGDAS_ENKF_ARCHIVE_VRFY b/jobs/JGDAS_ENKF_ARCHIVE_VRFY index 0094401987..15b251a0a3 100755 --- a/jobs/JGDAS_ENKF_ARCHIVE_VRFY +++ b/jobs/JGDAS_ENKF_ARCHIVE_VRFY @@ -19,7 +19,9 @@ MEMDIR="ensstat" YMD=${PDY} HH=${cyc} declare_from_tmpl -rx \ "${SCRgfs}/exgdas_enkf_earc_vrfy.py" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################################### @@ -38,6 +40,8 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || (echo "${DATAROOT} does not exist. ABORT!"; exit 1) -[[ ${KEEPDATA} = "NO" ]] && rm -rf "${DATA}" +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf "${DATA}" +fi exit 0 diff --git a/jobs/JGDAS_ENKF_DIAG b/jobs/JGDAS_ENKF_DIAG index 3daa8bfb73..43b2f69c61 100755 --- a/jobs/JGDAS_ENKF_DIAG +++ b/jobs/JGDAS_ENKF_DIAG @@ -91,7 +91,9 @@ export SETUP_INVOBS="passive_bc=.false.,${SETUP_INVOBS}" # Ensure clean stat tarballs for ensemble mean for fstat in ${CNVSTAT} ${OZNSTAT} ${RADSTAT}; do - [[ -f ${fstat} ]] && rm -f ${fstat} + if [[ -f ${fstat} ]]; then + rm -f ${fstat} + fi done @@ -100,7 +102,9 @@ done ${ANALDIAGSH:-${SCRgfs}/exglobal_diag.sh} status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi ############################################## @@ -118,7 +122,9 @@ fi # Remove the Temporary working directory ########################################## cd ${DATAROOT} -[[ ${KEEPDATA} = "NO" ]] && rm -rf ${DATA} +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf ${DATA} +fi exit 0 diff --git a/jobs/JGDAS_ENKF_ECEN b/jobs/JGDAS_ENKF_ECEN index 71efd6ede9..46add490bf 100755 --- a/jobs/JGDAS_ENKF_ECEN +++ b/jobs/JGDAS_ENKF_ECEN @@ -43,7 +43,9 @@ MEMDIR="ensstat" RUN=${GDUMP} YMD=${gPDY} HH=${gcyc} declare_from_tmpl -rx \ ${ENKFRECENSH:-${SCRgfs}/exgdas_enkf_ecen.sh} status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi ############################################## @@ -61,7 +63,9 @@ fi # Remove the Temporary working directory ########################################## cd ${DATAROOT} -[[ ${KEEPDATA} = "NO" ]] && rm -rf ${DATA} +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf ${DATA} +fi exit 0 diff --git a/jobs/JGDAS_ENKF_POST b/jobs/JGDAS_ENKF_POST index 3a3b5b0c71..d9fe5edc6f 100755 --- a/jobs/JGDAS_ENKF_POST +++ b/jobs/JGDAS_ENKF_POST @@ -24,7 +24,9 @@ export LEVS=$((LEVS-1)) ${ENKFPOSTSH:-${SCRgfs}/exgdas_enkf_post.sh} status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi ############################################## @@ -42,7 +44,9 @@ fi # Remove the Temporary working directory ########################################## cd ${DATAROOT} -[[ ${KEEPDATA} = "NO" ]] && rm -rf ${DATA} +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf ${DATA} +fi exit 0 diff --git a/jobs/JGDAS_ENKF_SELECT_OBS b/jobs/JGDAS_ENKF_SELECT_OBS index 2b876c0b3a..15c6b54500 100755 --- a/jobs/JGDAS_ENKF_SELECT_OBS +++ b/jobs/JGDAS_ENKF_SELECT_OBS @@ -61,7 +61,9 @@ fi LEVS=$(${NCDUMP} -h "${ATMGES_ENSMEAN}" | grep -i "pfull" | head -1 | awk -F" = " '{print $2}' | awk -F" " '{print $1}') # get LEVS # shellcheck disable= status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi export LEVS # Link observational data @@ -111,7 +113,9 @@ export SETUP_INVOBS="passive_bc=.false.,${SETUP_INVOBS}" # Ensure clean stat tarballs for ensemble mean for fstat in ${CNVSTAT} ${OZNSTAT} ${RADSTAT}; do - [[ -f ${fstat} ]] && rm -f ${fstat} + if [[ -f ${fstat} ]]; then + rm -f ${fstat} + fi done @@ -120,7 +124,9 @@ done ${INVOBSSH:-${SCRgfs}/exgdas_enkf_select_obs.sh} status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi ############################################## @@ -146,7 +152,9 @@ fi # Remove the Temporary working directory ########################################## cd ${DATAROOT} -[[ ${KEEPDATA} = "NO" ]] && rm -rf ${DATA} +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf ${DATA} +fi exit 0 diff --git a/jobs/JGDAS_ENKF_SFC b/jobs/JGDAS_ENKF_SFC index 1ed10f20c0..f030b23ad6 100755 --- a/jobs/JGDAS_ENKF_SFC +++ b/jobs/JGDAS_ENKF_SFC @@ -44,7 +44,9 @@ RUN=${GDUMP} YMD=${gPDY} HH=${gcyc} declare_from_tmpl -rx \ ${ENKFRESFCSH:-${SCRgfs}/exgdas_enkf_sfc.sh} status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi ############################################## @@ -62,7 +64,9 @@ fi # Remove the Temporary working directory ########################################## cd ${DATAROOT} -[[ ${KEEPDATA} = "NO" ]] && rm -rf ${DATA} +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf ${DATA} +fi exit 0 diff --git a/jobs/JGDAS_ENKF_UPDATE b/jobs/JGDAS_ENKF_UPDATE index 213b49081a..05e1f60736 100755 --- a/jobs/JGDAS_ENKF_UPDATE +++ b/jobs/JGDAS_ENKF_UPDATE @@ -36,7 +36,9 @@ MEMDIR="ensstat" RUN="enkfgdas" YMD=${gPDY} HH=${gcyc} declare_from_tmpl -rx \ ${ENKFUPDSH:-${SCRgfs}/exgdas_enkf_update.sh} status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi ############################################## @@ -62,7 +64,9 @@ fi # Remove the Temporary working directory ########################################## cd ${DATAROOT} -[[ ${KEEPDATA} = "NO" ]] && rm -rf ${DATA} +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf ${DATA} +fi exit 0 diff --git a/jobs/JGDAS_FIT2OBS b/jobs/JGDAS_FIT2OBS index 7e000c95cf..87633f70dc 100755 --- a/jobs/JGDAS_FIT2OBS +++ b/jobs/JGDAS_FIT2OBS @@ -33,11 +33,17 @@ export CNVS=${COM_INA}/${RUN}.t${vcyc}z.cnvstat export OUTPUT_FILETYPE=${OUTPUT_FILETYPE:-netcdf} export FIT_DIR=${ARCDIR}/fits -[[ ! -d "${FIT_DIR}" ]] && mkdir -p "${FIT_DIR}" +if [[ ! -d "${FIT_DIR}" ]]; then + mkdir -p "${FIT_DIR}" +fi export HORZ_DIR=${ARCDIR}/horiz -[[ ! -d "${HORZ_DIR}" ]] && mkdir -p "${HORZ_DIR}" +if [[ ! -d "${HORZ_DIR}" ]]; then + mkdir -p "${HORZ_DIR}" +fi export COMLOX=${DATA}/fitx -[[ ! -d "${COMLOX}" ]] && mkdir -p "${COMLOX}" +if [[ ! -d "${COMLOX}" ]]; then + mkdir -p "${COMLOX}" +fi echo "echo err_chk">"${DATA}/err_chk"; chmod 755 "${DATA}/err_chk" echo "echo postmsg">"${DATA}/postmsg"; chmod 755 "${DATA}/postmsg" @@ -62,7 +68,9 @@ if [[ ${CDATE} -gt ${SDATE} ]]; then "${SCRIPTSfit2obs}/excfs_gdas_vrfyfits.sh" status=$? - [[ ${status} -ne 0 ]] && exit "${status}" + if [[ ${status} -ne 0 ]]; then + exit "${status}" + fi ############################################## # End JOB SPECIFIC work @@ -85,6 +93,8 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || (echo "FATAL ERROR: ${DATAROOT} does not exist. ABORT!"; exit 1) -[[ ${KEEPDATA} = "NO" ]] && rm -rf "${DATA}" +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf "${DATA}" +fi exit 0 diff --git a/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_ECEN b/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_ECEN index f579c51dab..976d17c1b0 100755 --- a/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_ECEN +++ b/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_ECEN @@ -35,7 +35,9 @@ export GDUMP_ENS="enkf${GDUMP}" EXSCRIPT=${GDASOCNCENPY:-${HOMEgfs}/scripts/exgdas_global_marine_analysis_ecen.py} ${EXSCRIPT} status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################## # End JOB SPECIFIC work @@ -52,6 +54,8 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || exit 1 -[[ "${KEEPDATA}" = "NO" ]] && rm -rf "${DATA}" +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" +fi exit 0 diff --git a/jobs/JGFS_ATMOS_CYCLONE_GENESIS b/jobs/JGFS_ATMOS_CYCLONE_GENESIS index a80bcc1153..bf20b953a8 100755 --- a/jobs/JGFS_ATMOS_CYCLONE_GENESIS +++ b/jobs/JGFS_ATMOS_CYCLONE_GENESIS @@ -63,7 +63,9 @@ fi # Remove the Temporary working directory ########################################## cd ${DATAROOT} -[[ ${KEEPDATA} = "NO" ]] && rm -rf ${DATA} +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf ${DATA} +fi exit 0 diff --git a/jobs/JGFS_ATMOS_CYCLONE_TRACKER b/jobs/JGFS_ATMOS_CYCLONE_TRACKER index 24fe33f8ca..750e099a00 100755 --- a/jobs/JGFS_ATMOS_CYCLONE_TRACKER +++ b/jobs/JGFS_ATMOS_CYCLONE_TRACKER @@ -96,7 +96,9 @@ fi # Remove the Temporary working directory ########################################## cd ${DATAROOT} -[[ ${KEEPDATA} = "NO" ]] && rm -rf ${DATA} +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf ${DATA} +fi exit 0 diff --git a/jobs/JGFS_ATMOS_FSU_GENESIS b/jobs/JGFS_ATMOS_FSU_GENESIS index 1b92816b61..7f244c19f7 100755 --- a/jobs/JGFS_ATMOS_FSU_GENESIS +++ b/jobs/JGFS_ATMOS_FSU_GENESIS @@ -70,7 +70,9 @@ fi # Remove the Temporary working directory ########################################## cd ${DATAROOT} -[[ ${KEEPDATA} = "NO" ]] && rm -rf ${DATA} +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf ${DATA} +fi exit 0 diff --git a/jobs/JGFS_ATMOS_POSTSND b/jobs/JGFS_ATMOS_POSTSND index 13adb11d7d..11ba684a05 100755 --- a/jobs/JGFS_ATMOS_POSTSND +++ b/jobs/JGFS_ATMOS_POSTSND @@ -24,16 +24,24 @@ export DBNROOT=${DBNROOT:-${UTILROOT}/fakedbn} YMD=${PDY} HH=${cyc} declare_from_tmpl -rx COM_ATMOS_HISTORY COM_ATMOS_BUFR \ COM_ATMOS_WMO COM_ATMOS_GEMPAK -[[ ! -d ${COM_ATMOS_BUFR} ]] && mkdir -p "${COM_ATMOS_BUFR}" -[[ ! -d ${COM_ATMOS_GEMPAK} ]] && mkdir -p "${COM_ATMOS_GEMPAK}" -[[ ! -d ${COM_ATMOS_WMO} ]] && mkdir -p "${COM_ATMOS_WMO}" +if [[ ! -d ${COM_ATMOS_BUFR} ]]; then + mkdir -p "${COM_ATMOS_BUFR}" +fi +if [[ ! -d ${COM_ATMOS_GEMPAK} ]]; then + mkdir -p "${COM_ATMOS_GEMPAK}" +fi +if [[ ! -d ${COM_ATMOS_WMO} ]]; then + mkdir -p "${COM_ATMOS_WMO}" +fi ######################################################## # Execute the script. ${SCRgfs}/exgfs_atmos_postsnd.sh status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi ############################################## @@ -51,7 +59,9 @@ fi # Remove the Temporary working directory ########################################## cd ${DATAROOT} -[[ ${KEEPDATA} = "NO" ]] && rm -rf ${DATA} +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf ${DATA} +fi exit 0 diff --git a/jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE b/jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE index 9c68d1fed6..1f9818c712 100755 --- a/jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE +++ b/jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE @@ -24,7 +24,9 @@ YMD=${PDY} HH=${cyc} declare_from_tmpl -rx \ EXSCRIPT=${GDASAEROFINALPY:-${SCRgfs}/exglobal_aero_analysis_finalize.py} ${EXSCRIPT} status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################## # End JOB SPECIFIC work @@ -41,6 +43,8 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || exit 1 -[[ ${KEEPDATA} = "NO" ]] && rm -rf "${DATA}" +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf "${DATA}" +fi exit 0 diff --git a/jobs/JGLOBAL_AERO_ANALYSIS_INITIALIZE b/jobs/JGLOBAL_AERO_ANALYSIS_INITIALIZE index 921b1458b2..a54cccdf66 100755 --- a/jobs/JGLOBAL_AERO_ANALYSIS_INITIALIZE +++ b/jobs/JGLOBAL_AERO_ANALYSIS_INITIALIZE @@ -33,7 +33,9 @@ RUN=${GDUMP} YMD=${gPDY} HH=${gcyc} declare_from_tmpl -rx \ EXSCRIPT=${GDASAEROINITPY:-${SCRgfs}/exglobal_aero_analysis_initialize.py} ${EXSCRIPT} status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_AERO_ANALYSIS_VARIATIONAL b/jobs/JGLOBAL_AERO_ANALYSIS_VARIATIONAL index 290d7225dd..8acc88ac14 100755 --- a/jobs/JGLOBAL_AERO_ANALYSIS_VARIATIONAL +++ b/jobs/JGLOBAL_AERO_ANALYSIS_VARIATIONAL @@ -19,7 +19,9 @@ source "${HOMEgfs}/ush/jjob_header.sh" -e "aeroanlvar" -c "base aeroanl aeroanlv EXSCRIPT=${GDASAEROVARSH:-${SCRgfs}/exglobal_aero_analysis_variational.py} ${EXSCRIPT} status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_ARCHIVE_TARS b/jobs/JGLOBAL_ARCHIVE_TARS index e89370bd37..3cfe90f3c1 100755 --- a/jobs/JGLOBAL_ARCHIVE_TARS +++ b/jobs/JGLOBAL_ARCHIVE_TARS @@ -73,7 +73,9 @@ fi ${GLOBALARCHIVESH:-${SCRgfs}/exglobal_archive_tars.py} status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################## # End JOB SPECIFIC work @@ -90,6 +92,8 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || (echo "${DATAROOT} does not exist. ABORT!"; exit 1) -[[ ${KEEPDATA} = "NO" ]] && rm -rf "${DATA}" +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf "${DATA}" +fi exit 0 diff --git a/jobs/JGLOBAL_ARCHIVE_VRFY b/jobs/JGLOBAL_ARCHIVE_VRFY index 01dd876ee1..e04796f661 100755 --- a/jobs/JGLOBAL_ARCHIVE_VRFY +++ b/jobs/JGLOBAL_ARCHIVE_VRFY @@ -28,7 +28,9 @@ done ${GLOBALARCHIVESH:-${SCRgfs}/exglobal_archive_vrfy.py} status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################## # End JOB SPECIFIC work @@ -45,6 +47,8 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || (echo "${DATAROOT} does not exist. ABORT!"; exit 1) -[[ ${KEEPDATA} = "NO" ]] && rm -rf "${DATA}" +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf "${DATA}" +fi exit 0 diff --git a/jobs/JGLOBAL_ATMENS_ANALYSIS_FINALIZE b/jobs/JGLOBAL_ATMENS_ANALYSIS_FINALIZE index 549e087694..244b4fb278 100755 --- a/jobs/JGLOBAL_ATMENS_ANALYSIS_FINALIZE +++ b/jobs/JGLOBAL_ATMENS_ANALYSIS_FINALIZE @@ -26,7 +26,9 @@ mkdir -m 755 -p "${COM_ATMOS_ANALYSIS_ENS}" EXSCRIPT=${GDASATMENSFINALPY:-${SCRgfs}/exglobal_atmens_analysis_finalize.py} ${EXSCRIPT} status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################## # End JOB SPECIFIC work @@ -43,6 +45,8 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || ( echo "FATAL ERROR: ${DATAROOT} does not exist, ABORT!"; exit 1 ) -[[ ${KEEPDATA} = "NO" ]] && rm -rf "${DATA}" +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf "${DATA}" +fi exit 0 diff --git a/jobs/JGLOBAL_ATMENS_ANALYSIS_FV3_INCREMENT b/jobs/JGLOBAL_ATMENS_ANALYSIS_FV3_INCREMENT index 7179ae0624..07d0278627 100755 --- a/jobs/JGLOBAL_ATMENS_ANALYSIS_FV3_INCREMENT +++ b/jobs/JGLOBAL_ATMENS_ANALYSIS_FV3_INCREMENT @@ -19,7 +19,9 @@ source "${HOMEgfs}/ush/jjob_header.sh" -e "atmensanlfv3inc" -c "base atmensanl a EXSCRIPT=${GDASATMENSRUNSH:-${SCRgfs}/exglobal_atmens_analysis_fv3_increment.py} ${EXSCRIPT} status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_ATMENS_ANALYSIS_INITIALIZE b/jobs/JGLOBAL_ATMENS_ANALYSIS_INITIALIZE index 38093ddc35..2d773b1078 100755 --- a/jobs/JGLOBAL_ATMENS_ANALYSIS_INITIALIZE +++ b/jobs/JGLOBAL_ATMENS_ANALYSIS_INITIALIZE @@ -28,7 +28,9 @@ RUN=${GDUMP} YMD=${gPDY} HH=${gcyc} declare_from_tmpl -rx \ EXSCRIPT=${GDASATMENSINITPY:-${SCRgfs}/exglobal_atmens_analysis_initialize.py} ${EXSCRIPT} status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_ATMENS_ANALYSIS_LETKF b/jobs/JGLOBAL_ATMENS_ANALYSIS_LETKF index 060b7abd06..df90003dae 100755 --- a/jobs/JGLOBAL_ATMENS_ANALYSIS_LETKF +++ b/jobs/JGLOBAL_ATMENS_ANALYSIS_LETKF @@ -19,7 +19,9 @@ source "${HOMEgfs}/ush/jjob_header.sh" -e "atmensanlletkf" -c "base atmensanl at EXSCRIPT=${GDASATMENSRUNSH:-${SCRgfs}/exglobal_atmens_analysis_letkf.py} ${EXSCRIPT} status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_ATMENS_ANALYSIS_OBS b/jobs/JGLOBAL_ATMENS_ANALYSIS_OBS index 9d858a8a37..9ce4137c1b 100755 --- a/jobs/JGLOBAL_ATMENS_ANALYSIS_OBS +++ b/jobs/JGLOBAL_ATMENS_ANALYSIS_OBS @@ -19,7 +19,9 @@ source "${HOMEgfs}/ush/jjob_header.sh" -e "atmensanlobs" -c "base atmensanl atme EXSCRIPT=${GDASATMENSOBSSH:-${SCRgfs}/exglobal_atmens_analysis_obs.py} ${EXSCRIPT} status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_ATMENS_ANALYSIS_SOL b/jobs/JGLOBAL_ATMENS_ANALYSIS_SOL index 415791cdd0..fa103df062 100755 --- a/jobs/JGLOBAL_ATMENS_ANALYSIS_SOL +++ b/jobs/JGLOBAL_ATMENS_ANALYSIS_SOL @@ -19,7 +19,9 @@ source "${HOMEgfs}/ush/jjob_header.sh" -e "atmensanlsol" -c "base atmensanl atme EXSCRIPT=${GDASATMENSSOLSH:-${SCRgfs}/exglobal_atmens_analysis_sol.py} ${EXSCRIPT} status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_ATMOS_ANALYSIS b/jobs/JGLOBAL_ATMOS_ANALYSIS index b13f026ba2..780e58cd66 100755 --- a/jobs/JGLOBAL_ATMOS_ANALYSIS +++ b/jobs/JGLOBAL_ATMOS_ANALYSIS @@ -53,7 +53,9 @@ fi # Get LEVS export LEVS=$(${NCLEN} ${ATMGES} pfull) status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi if [ ${DOHYBVAR} = "YES" ]; then @@ -90,7 +92,9 @@ fi ${ANALYSISSH:-${SCRgfs}/exglobal_atmos_analysis.sh} status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi ############################################## @@ -118,7 +122,9 @@ fi # Remove the Temporary working directory ########################################## cd ${DATAROOT} -[[ ${KEEPDATA} = "NO" ]] && rm -rf ${DATA} +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf ${DATA} +fi exit 0 diff --git a/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC b/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC index 063a006658..f61523b607 100755 --- a/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC +++ b/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC @@ -49,7 +49,9 @@ fi # Get LEVS export LEVS=$(${NCLEN} ${ATMGES} pfull) status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi # Generate Gaussian surface analysis # TODO: Should this be removed now that sfcanl is its own job? @@ -61,7 +63,9 @@ export DOGAUSFCANL=${DOGAUSFCANL:-"YES"} ${ANALCALCSH:-${SCRgfs}/exglobal_atmos_analysis_calc.sh} status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi ############################################## @@ -79,7 +83,9 @@ fi # Remove the Temporary working directory ########################################## cd ${DATAROOT} -[[ ${KEEPDATA} = "NO" ]] && rm -rf ${DATA} +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf ${DATA} +fi exit 0 diff --git a/jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP b/jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP index 3312ef27f5..45e8d7479d 100755 --- a/jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP +++ b/jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP @@ -36,7 +36,9 @@ export BLENDED_ICE_FILE_m6hrs=${BLENDED_ICE_FILE_m6hrs:-${COMIN_m6hrs}/${RUN}.${ ${EMCSFCPREPSH:-${SCRgfs}/exemcsfc_global_sfc_prep.sh} status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi ############################################## # End JOB SPECIFIC work @@ -53,7 +55,9 @@ fi # Remove the Temporary working directory ########################################## cd ${DATAROOT} -[[ ${KEEPDATA} = "NO" ]] && rm -rf ${DATA} +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf ${DATA} +fi exit 0 diff --git a/jobs/JGLOBAL_ATMOS_ENSSTAT b/jobs/JGLOBAL_ATMOS_ENSSTAT index e09410d581..1fc406cfe4 100755 --- a/jobs/JGLOBAL_ATMOS_ENSSTAT +++ b/jobs/JGLOBAL_ATMOS_ENSSTAT @@ -42,7 +42,9 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || exit 1 -[[ "${KEEPDATA:-NO}" = "NO" ]] && rm -rf "${DATA}" +if [[ "${KEEPDATA:-NO}" = "NO" ]]; then + rm -rf "${DATA}" +fi exit 0 diff --git a/jobs/JGLOBAL_ATMOS_PRODUCTS b/jobs/JGLOBAL_ATMOS_PRODUCTS index 8c062a8fed..efe82e2ce4 100755 --- a/jobs/JGLOBAL_ATMOS_PRODUCTS +++ b/jobs/JGLOBAL_ATMOS_PRODUCTS @@ -41,7 +41,9 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || exit 1 -[[ "${KEEPDATA:-NO}" = "NO" ]] && rm -rf "${DATA}" +if [[ "${KEEPDATA:-NO}" = "NO" ]]; then + rm -rf "${DATA}" +fi exit 0 diff --git a/jobs/JGLOBAL_ATMOS_SFCANL b/jobs/JGLOBAL_ATMOS_SFCANL index 2822b1e94b..2340718339 100755 --- a/jobs/JGLOBAL_ATMOS_SFCANL +++ b/jobs/JGLOBAL_ATMOS_SFCANL @@ -50,7 +50,9 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" -[[ "${KEEPDATA}" == "NO" ]] && rm -rf "${DATA}" +if [[ "${KEEPDATA}" == "NO" ]]; then + rm -rf "${DATA}" +fi exit 0 diff --git a/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC b/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC index 906c195164..1b2b8140de 100755 --- a/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC +++ b/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC @@ -43,7 +43,9 @@ export BKGFREQ=1 # for hourly relocation ${TROPCYQCRELOSH:-${SCRgfs}/exglobal_atmos_tropcy_qc_reloc.sh} status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi ############################################## @@ -57,7 +59,9 @@ fi # Remove the Temporary working directory ########################################## cd ${DATAROOT} -[[ ${KEEPDATA} = "NO" ]] && rm -rf ${DATA} +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf ${DATA} +fi exit 0 diff --git a/jobs/JGLOBAL_ATMOS_UPP b/jobs/JGLOBAL_ATMOS_UPP index 0e70e97025..f838534732 100755 --- a/jobs/JGLOBAL_ATMOS_UPP +++ b/jobs/JGLOBAL_ATMOS_UPP @@ -41,7 +41,9 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || exit 1 -[[ "${KEEPDATA:-NO}" = "NO" ]] && rm -rf "${DATA}" +if [[ "${KEEPDATA:-NO}" = "NO" ]]; then + rm -rf "${DATA}" +fi exit 0 diff --git a/jobs/JGLOBAL_ATMOS_VMINMON b/jobs/JGLOBAL_ATMOS_VMINMON index 26cdc73c95..a999aa4e03 100755 --- a/jobs/JGLOBAL_ATMOS_VMINMON +++ b/jobs/JGLOBAL_ATMOS_VMINMON @@ -41,6 +41,8 @@ fi ################################ # Remove the Working Directory ################################ -[[ "${KEEPDATA}" = "NO" ]] && rm -rf "${DATA}" +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" +fi exit 0 diff --git a/jobs/JGLOBAL_ATM_ANALYSIS_FINALIZE b/jobs/JGLOBAL_ATM_ANALYSIS_FINALIZE index 2acb931aa3..3979aa9a5a 100755 --- a/jobs/JGLOBAL_ATM_ANALYSIS_FINALIZE +++ b/jobs/JGLOBAL_ATM_ANALYSIS_FINALIZE @@ -36,7 +36,9 @@ mkdir -m 775 -p "${COM_ATMOS_ANALYSIS}" EXSCRIPT=${GDASATMFINALPY:-${SCRgfs}/exglobal_atm_analysis_finalize.py} ${EXSCRIPT} status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################## # End JOB SPECIFIC work @@ -53,6 +55,8 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || ( echo "FATAL ERROR: ${DATAROOT} does not exist, ABORT!"; exit 1 ) -[[ ${KEEPDATA} = "NO" ]] && rm -rf "${DATA}" +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf "${DATA}" +fi exit 0 diff --git a/jobs/JGLOBAL_ATM_ANALYSIS_FV3_INCREMENT b/jobs/JGLOBAL_ATM_ANALYSIS_FV3_INCREMENT index 9a9a476065..52f037d5a7 100755 --- a/jobs/JGLOBAL_ATM_ANALYSIS_FV3_INCREMENT +++ b/jobs/JGLOBAL_ATM_ANALYSIS_FV3_INCREMENT @@ -21,7 +21,9 @@ source "${HOMEgfs}/ush/jjob_header.sh" -e "atmanlfv3inc" -c "base atmanl atmanlf EXSCRIPT=${GDASATMRUNSH:-${SCRgfs}/exglobal_atm_analysis_fv3_increment.py} ${EXSCRIPT} status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_ATM_ANALYSIS_INITIALIZE b/jobs/JGLOBAL_ATM_ANALYSIS_INITIALIZE index 5b26483922..fabc1c866c 100755 --- a/jobs/JGLOBAL_ATM_ANALYSIS_INITIALIZE +++ b/jobs/JGLOBAL_ATM_ANALYSIS_INITIALIZE @@ -39,7 +39,9 @@ mkdir -m 775 -p "${COM_ATMOS_ANALYSIS}" EXSCRIPT=${GDASATMINITPY:-${SCRgfs}/exglobal_atm_analysis_initialize.py} ${EXSCRIPT} status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_ATM_ANALYSIS_VARIATIONAL b/jobs/JGLOBAL_ATM_ANALYSIS_VARIATIONAL index 552eccf911..b041bab65a 100755 --- a/jobs/JGLOBAL_ATM_ANALYSIS_VARIATIONAL +++ b/jobs/JGLOBAL_ATM_ANALYSIS_VARIATIONAL @@ -21,7 +21,9 @@ source "${HOMEgfs}/ush/jjob_header.sh" -e "atmanlvar" -c "base atmanl atmanlvar" EXSCRIPT=${GDASATMRUNSH:-${SCRgfs}/exglobal_atm_analysis_variational.py} ${EXSCRIPT} status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_ATM_PREP_IODA_OBS b/jobs/JGLOBAL_ATM_PREP_IODA_OBS index 78414522fc..1e731dead7 100755 --- a/jobs/JGLOBAL_ATM_PREP_IODA_OBS +++ b/jobs/JGLOBAL_ATM_PREP_IODA_OBS @@ -20,7 +20,9 @@ YMD=${PDY} HH=${cyc} declare_from_tmpl -rx COM_OBS EXSCRIPT=${BUFR2IODASH:-${USHgfs}/run_bufr2ioda.py} ${EXSCRIPT} "${PDY}${cyc}" "${RUN}" "${DMPDIR}" "${PARMgfs}/gdas/ioda/bufr2ioda" "${COM_OBS}/" status=$? -[[ ${status} -ne 0 ]] && (echo "FATAL ERROR: Error executing ${EXSCRIPT}, ABORT!"; exit "${status}") +if [[ ${status} -ne 0 ]]; then + (echo "FATAL ERROR: Error executing ${EXSCRIPT}, ABORT!"; exit "${status}") +fi ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_EXTRACTVARS b/jobs/JGLOBAL_EXTRACTVARS index 1c1a763a03..9b0b114eaa 100755 --- a/jobs/JGLOBAL_EXTRACTVARS +++ b/jobs/JGLOBAL_EXTRACTVARS @@ -47,6 +47,8 @@ status=$? # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || true -[[ "${KEEPDATA}" = "NO" ]] && rm -rf "${DATA}" +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" +fi exit 0 diff --git a/jobs/JGLOBAL_FETCH b/jobs/JGLOBAL_FETCH index e10049169a..9f4281056f 100755 --- a/jobs/JGLOBAL_FETCH +++ b/jobs/JGLOBAL_FETCH @@ -18,6 +18,8 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || (echo "${DATAROOT} does not exist. ABORT!"; exit 1) -[[ ${KEEPDATA} = "NO" ]] && rm -rf "${DATA}" +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf "${DATA}" +fi exit 0 diff --git a/jobs/JGLOBAL_MARINE_ANALYSIS_CHECKPOINT b/jobs/JGLOBAL_MARINE_ANALYSIS_CHECKPOINT index 7537937f82..616a131c5e 100755 --- a/jobs/JGLOBAL_MARINE_ANALYSIS_CHECKPOINT +++ b/jobs/JGLOBAL_MARINE_ANALYSIS_CHECKPOINT @@ -21,7 +21,9 @@ source "${HOMEgfs}/ush/jjob_header.sh" -e "marineanlchkpt" -c "base marineanl ma EXSCRIPT=${GDASMARINEANALYSIS:-${SCRgfs}/exglobal_marine_analysis_checkpoint.py} ${EXSCRIPT} status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_MARINE_ANALYSIS_FINALIZE b/jobs/JGLOBAL_MARINE_ANALYSIS_FINALIZE index cdc6dfecc8..7cc9b052f4 100755 --- a/jobs/JGLOBAL_MARINE_ANALYSIS_FINALIZE +++ b/jobs/JGLOBAL_MARINE_ANALYSIS_FINALIZE @@ -33,12 +33,16 @@ mkdir -p "${COMOUT_ICE_RESTART}" EXSCRIPT=${GDASMARINEANALYSIS:-${SCRgfs}/exglobal_marine_analysis_finalize.py} ${EXSCRIPT} status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ########################################## # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || exit 1 -[[ "${KEEPDATA}" = "NO" ]] && rm -rf "${DATA}" +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" +fi exit 0 diff --git a/jobs/JGLOBAL_MARINE_ANALYSIS_INITIALIZE b/jobs/JGLOBAL_MARINE_ANALYSIS_INITIALIZE index 14f5490a70..d435688d7a 100755 --- a/jobs/JGLOBAL_MARINE_ANALYSIS_INITIALIZE +++ b/jobs/JGLOBAL_MARINE_ANALYSIS_INITIALIZE @@ -39,7 +39,9 @@ YMD=${PDY} HH=${cyc} declare_from_tmpl -rx \ EXSCRIPT=${GDASMARINEANALYSIS:-${SCRgfs}/exglobal_marine_analysis_initialize.py} ${EXSCRIPT} status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_MARINE_ANALYSIS_LETKF b/jobs/JGLOBAL_MARINE_ANALYSIS_LETKF index 2a88f89eab..ec81ff435f 100755 --- a/jobs/JGLOBAL_MARINE_ANALYSIS_LETKF +++ b/jobs/JGLOBAL_MARINE_ANALYSIS_LETKF @@ -41,7 +41,9 @@ YMD=${PDY} HH=${cyc} declare_from_tmpl -rx \ EXSCRIPT=${GDASOCNLETKFPY:-${HOMEgfs}/scripts/exglobal_marine_analysis_letkf.py} ${EXSCRIPT} status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################## # End JOB SPECIFIC work @@ -58,6 +60,8 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || exit 1 -[[ "${KEEPDATA}" = "NO" ]] && rm -rf "${DATA}" +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" +fi exit 0 diff --git a/jobs/JGLOBAL_MARINE_ANALYSIS_VARIATIONAL b/jobs/JGLOBAL_MARINE_ANALYSIS_VARIATIONAL index 1bc476bffc..aa16365d78 100755 --- a/jobs/JGLOBAL_MARINE_ANALYSIS_VARIATIONAL +++ b/jobs/JGLOBAL_MARINE_ANALYSIS_VARIATIONAL @@ -23,7 +23,9 @@ source "${HOMEgfs}/ush/jjob_header.sh" -e "marineanlvar" -c "base marineanl mari EXSCRIPT=${GDASMARINERUNSH:-${SCRgfs}/exglobal_marine_analysis_variational.py} ${EXSCRIPT} status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_MARINE_BMAT b/jobs/JGLOBAL_MARINE_BMAT index 3189df0463..92b373f6e2 100755 --- a/jobs/JGLOBAL_MARINE_BMAT +++ b/jobs/JGLOBAL_MARINE_BMAT @@ -50,7 +50,9 @@ mkdir -p "${COMOUT_ICE_BMATRIX}" EXSCRIPT=${GDASMARINEBMATRUNPY:-${SCRgfs}/exglobal_marinebmat.py} ${EXSCRIPT} status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_OCEANICE_PRODUCTS b/jobs/JGLOBAL_OCEANICE_PRODUCTS index 4303e26c47..f262337a51 100755 --- a/jobs/JGLOBAL_OCEANICE_PRODUCTS +++ b/jobs/JGLOBAL_OCEANICE_PRODUCTS @@ -34,7 +34,9 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || exit 1 -[[ "${KEEPDATA:-NO}" == "NO" ]] && rm -rf "${DATA}" +if [[ "${KEEPDATA:-NO}" == "NO" ]]; then + rm -rf "${DATA}" +fi exit 0 diff --git a/jobs/JGLOBAL_PREP_OBS_AERO b/jobs/JGLOBAL_PREP_OBS_AERO index 7fe701898f..ecb52fd227 100755 --- a/jobs/JGLOBAL_PREP_OBS_AERO +++ b/jobs/JGLOBAL_PREP_OBS_AERO @@ -20,7 +20,9 @@ YMD=${PDY} HH=${cyc} declare_from_tmpl -rx COMOUT_OBS:COM_OBS_TMPL EXSCRIPT=${GDASPREPAEROOBSPY:-${SCRgfs}/exglobal_prep_obs_aero.py} ${EXSCRIPT} status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################## @@ -38,6 +40,8 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || exit -[[ "${KEEPDATA}" = "NO" ]] && rm -rf "${DATA}" +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" +fi exit 0 diff --git a/jobs/JGLOBAL_PREP_OCEAN_OBS b/jobs/JGLOBAL_PREP_OCEAN_OBS index 339d90567e..f689551a42 100755 --- a/jobs/JGLOBAL_PREP_OCEAN_OBS +++ b/jobs/JGLOBAL_PREP_OCEAN_OBS @@ -20,7 +20,9 @@ YMD=${PDY} HH=${cyc} declare_from_tmpl -rx COMOUT_OBS:COM_OBS_TMPL EXSCRIPT=${GDASPREPOCNOBSPY:-${SCRgfs}/exglobal_prep_ocean_obs.py} ${EXSCRIPT} status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################## @@ -38,6 +40,8 @@ fi # Handle the temporary working directory ########################################## cd "${DATAROOT}" || (echo "FATAL ERROR: ${DATAROOT} does not exist. ABORT!"; exit 1) -[[ ${KEEPDATA} = "NO" ]] && rm -rf "${DATA}" +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf "${DATA}" +fi exit 0 diff --git a/jobs/JGLOBAL_SNOWENS_ANALYSIS b/jobs/JGLOBAL_SNOWENS_ANALYSIS index 9e532052a8..f98b91b1d9 100755 --- a/jobs/JGLOBAL_SNOWENS_ANALYSIS +++ b/jobs/JGLOBAL_SNOWENS_ANALYSIS @@ -65,6 +65,8 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || exit 1 -[[ "${KEEPDATA}" = "NO" ]] && rm -rf "${DATA}" +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" +fi exit 0 diff --git a/jobs/JGLOBAL_SNOW_ANALYSIS b/jobs/JGLOBAL_SNOW_ANALYSIS index 1642042b89..f8539e4bc6 100755 --- a/jobs/JGLOBAL_SNOW_ANALYSIS +++ b/jobs/JGLOBAL_SNOW_ANALYSIS @@ -33,7 +33,9 @@ mkdir -m 775 -p "${COMOUT_SNOW_ANALYSIS}" "${COMOUT_CONF}" EXSCRIPT=${SNOWANLPY:-${SCRgfs}/exglobal_snow_analysis.py} ${EXSCRIPT} status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################## # End JOB SPECIFIC work @@ -50,6 +52,8 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || exit 1 -[[ ${KEEPDATA} = "NO" ]] && rm -rf "${DATA}" +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf "${DATA}" +fi exit 0 diff --git a/jobs/JGLOBAL_STAGE_IC b/jobs/JGLOBAL_STAGE_IC index b8126f8efe..4c25d7f95d 100755 --- a/jobs/JGLOBAL_STAGE_IC +++ b/jobs/JGLOBAL_STAGE_IC @@ -18,6 +18,8 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || (echo "${DATAROOT} does not exist. ABORT!"; exit 1) -[[ ${KEEPDATA} = "NO" ]] && rm -rf "${DATA}" +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf "${DATA}" +fi exit 0 diff --git a/jobs/JGLOBAL_WAVE_GEMPAK b/jobs/JGLOBAL_WAVE_GEMPAK index 1c01b0cf64..849ada900f 100755 --- a/jobs/JGLOBAL_WAVE_GEMPAK +++ b/jobs/JGLOBAL_WAVE_GEMPAK @@ -33,7 +33,9 @@ if [[ ! -d ${COMOUT_WAVE_GEMPAK} ]]; then mkdir -p "${COMOUT_WAVE_GEMPAK}"; fi # Execute the script. ${SCRgfs}/exgfs_wave_nawips.sh status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi ################################### # Remove temp directories diff --git a/jobs/JGLOBAL_WAVE_INIT b/jobs/JGLOBAL_WAVE_INIT index 3a0a8b43a8..f49840c98c 100755 --- a/jobs/JGLOBAL_WAVE_INIT +++ b/jobs/JGLOBAL_WAVE_INIT @@ -26,7 +26,9 @@ ${SCRgfs}/exgfs_wave_init.sh # Remove the Temporary working directory ########################################## cd ${DATAROOT} -[[ ${KEEPDATA} = "NO" ]] && rm -rf ${DATA} +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf ${DATA} +fi exit 0 diff --git a/jobs/JGLOBAL_WAVE_POST_BNDPNT b/jobs/JGLOBAL_WAVE_POST_BNDPNT index 808ba7d9f3..313f1a4490 100755 --- a/jobs/JGLOBAL_WAVE_POST_BNDPNT +++ b/jobs/JGLOBAL_WAVE_POST_BNDPNT @@ -42,7 +42,9 @@ fi # Remove the Temporary working directory ########################################## cd ${DATAROOT} -[[ ${KEEPDATA} = "NO" ]] && rm -rf ${DATA} +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf ${DATA} +fi exit 0 diff --git a/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL b/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL index c85b1cb5f3..ef09a50348 100755 --- a/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL +++ b/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL @@ -46,7 +46,9 @@ fi # Remove the Temporary working directory ########################################## cd ${DATAROOT} -[[ ${KEEPDATA} = "NO" ]] && rm -rf ${DATA} +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf ${DATA} +fi exit 0 diff --git a/jobs/JGLOBAL_WAVE_POST_PNT b/jobs/JGLOBAL_WAVE_POST_PNT index 6be2d88906..a85915f237 100755 --- a/jobs/JGLOBAL_WAVE_POST_PNT +++ b/jobs/JGLOBAL_WAVE_POST_PNT @@ -43,7 +43,9 @@ fi # Remove the Temporary working directory ########################################## cd ${DATAROOT} -[[ ${KEEPDATA} = "NO" ]] && rm -rf ${DATA} +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf ${DATA} +fi exit 0 diff --git a/jobs/JGLOBAL_WAVE_POST_SBS b/jobs/JGLOBAL_WAVE_POST_SBS index acd654d6fa..56afdc8854 100755 --- a/jobs/JGLOBAL_WAVE_POST_SBS +++ b/jobs/JGLOBAL_WAVE_POST_SBS @@ -52,7 +52,9 @@ fi # Remove the Temporary working directory ########################################## cd ${DATAROOT} -[[ ${KEEPDATA} = "NO" ]] && rm -rf ${DATA} +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf ${DATA} +fi exit 0 diff --git a/jobs/JGLOBAL_WAVE_PRDGEN_BULLS b/jobs/JGLOBAL_WAVE_PRDGEN_BULLS index ebecf716af..b57dfe524f 100755 --- a/jobs/JGLOBAL_WAVE_PRDGEN_BULLS +++ b/jobs/JGLOBAL_WAVE_PRDGEN_BULLS @@ -24,7 +24,9 @@ if [[ ! -d ${COMOUT_WAVE_WMO} ]]; then mkdir -p "${COMOUT_WAVE_WMO}"; fi ${SCRgfs}/exgfs_wave_prdgen_bulls.sh status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi ################################### # Remove temp directories diff --git a/jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED b/jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED index f84c5abc01..acf49f9301 100755 --- a/jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED +++ b/jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED @@ -35,7 +35,9 @@ fi ################################### ${SCRgfs}/exgfs_wave_prdgen_gridded.sh status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi ################################### # Remove temp directories diff --git a/jobs/JGLOBAL_WAVE_PREP b/jobs/JGLOBAL_WAVE_PREP index 5d4e76dc8a..b391901c42 100755 --- a/jobs/JGLOBAL_WAVE_PREP +++ b/jobs/JGLOBAL_WAVE_PREP @@ -29,7 +29,9 @@ ${SCRgfs}/exgfs_wave_prep.sh # Remove the Temporary working directory ########################################## cd ${DATAROOT} -[[ ${KEEPDATA} = "NO" ]] && rm -rf ${DATA} +if [[ ${KEEPDATA} = "NO" ]]; then + rm -rf ${DATA} +fi exit 0 diff --git a/jobs/rocoto/aeroanlfinal.sh b/jobs/rocoto/aeroanlfinal.sh index 39dea71810..352bd0ce91 100755 --- a/jobs/rocoto/aeroanlfinal.sh +++ b/jobs/rocoto/aeroanlfinal.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source UFSDA workflow modules . "${HOMEgfs}/ush/load_ufsda_modules.sh" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi export job="aeroanlfinal" export jobid="${job}.$$" diff --git a/jobs/rocoto/aeroanlgenb.sh b/jobs/rocoto/aeroanlgenb.sh index d0bc5dda9b..d780577e68 100755 --- a/jobs/rocoto/aeroanlgenb.sh +++ b/jobs/rocoto/aeroanlgenb.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source UFSDA workflow modules . "${HOMEgfs}/ush/load_ufsda_modules.sh" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi export job="aeroanlgenb" export jobid="${job}.$$" diff --git a/jobs/rocoto/aeroanlinit.sh b/jobs/rocoto/aeroanlinit.sh index 7a1cf885c1..4f534b6dc8 100755 --- a/jobs/rocoto/aeroanlinit.sh +++ b/jobs/rocoto/aeroanlinit.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source UFSDA workflow modules . "${HOMEgfs}/ush/load_ufsda_modules.sh" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi export job="aeroanlinit" export jobid="${job}.$$" diff --git a/jobs/rocoto/aeroanlvar.sh b/jobs/rocoto/aeroanlvar.sh index 7aa7d831f9..8a02abf0f7 100755 --- a/jobs/rocoto/aeroanlvar.sh +++ b/jobs/rocoto/aeroanlvar.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source UFSDA workflow modules . "${HOMEgfs}/ush/load_ufsda_modules.sh" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi export job="aeroanlvar" export jobid="${job}.$$" diff --git a/jobs/rocoto/aerosol_init.sh b/jobs/rocoto/aerosol_init.sh index 34ccc0fe26..0b292e3310 100755 --- a/jobs/rocoto/aerosol_init.sh +++ b/jobs/rocoto/aerosol_init.sh @@ -6,7 +6,9 @@ source "$HOMEgfs/ush/preamble.sh" # Source FV3GFS workflow modules source $HOMEgfs/ush/load_fv3gfs_modules.sh status=$? -[[ $status -ne 0 ]] && exit $status +if [[ $status -ne 0 ]]; then + exit $status +fi ############################################################### # Source relevant configs @@ -14,14 +16,18 @@ configs="base aerosol_init" for config in $configs; do source $EXPDIR/config.${config} status=$? - [[ $status -ne 0 ]] && exit $status + if [[ $status -ne 0 ]]; then + exit $status + fi done ############################################################### # Source machine runtime environment source $BASE_ENV/${machine}.env aerosol_init status=$? -[[ $status -ne 0 ]] && exit $status +if [[ $status -ne 0 ]]; then + exit $status +fi $HOMEgfs/scripts/exgfs_aero_init_aerosol.py diff --git a/jobs/rocoto/anal.sh b/jobs/rocoto/anal.sh index 00f03e3832..a8f7c524cd 100755 --- a/jobs/rocoto/anal.sh +++ b/jobs/rocoto/anal.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source FV3GFS workflow modules . ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi export job="anal" export jobid="${job}.$$" diff --git a/jobs/rocoto/analcalc.sh b/jobs/rocoto/analcalc.sh index 2e669b0163..0865d2c951 100755 --- a/jobs/rocoto/analcalc.sh +++ b/jobs/rocoto/analcalc.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source FV3GFS workflow modules . ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi export job="analcalc" export jobid="${job}.$$" diff --git a/jobs/rocoto/analdiag.sh b/jobs/rocoto/analdiag.sh index cd6e1113f0..248dbe646f 100755 --- a/jobs/rocoto/analdiag.sh +++ b/jobs/rocoto/analdiag.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source FV3GFS workflow modules . ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi export job="analdiag" export jobid="${job}.$$" diff --git a/jobs/rocoto/arch_tars.sh b/jobs/rocoto/arch_tars.sh index d9c58a9b38..2d2d75202f 100755 --- a/jobs/rocoto/arch_tars.sh +++ b/jobs/rocoto/arch_tars.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source FV3GFS workflow modules . "${HOMEgfs}"/ush/load_fv3gfs_modules.sh status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################################### # setup python path for workflow utilities and tasks diff --git a/jobs/rocoto/arch_vrfy.sh b/jobs/rocoto/arch_vrfy.sh index fee66c01b6..1e7bf34316 100755 --- a/jobs/rocoto/arch_vrfy.sh +++ b/jobs/rocoto/arch_vrfy.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source FV3GFS workflow modules . "${HOMEgfs}"/ush/load_fv3gfs_modules.sh status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################################### # setup python path for workflow utilities and tasks diff --git a/jobs/rocoto/atmanlfinal.sh b/jobs/rocoto/atmanlfinal.sh index a12894ed1e..c33ee264eb 100755 --- a/jobs/rocoto/atmanlfinal.sh +++ b/jobs/rocoto/atmanlfinal.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source UFSDA workflow modules . "${HOMEgfs}/ush/load_ufsda_modules.sh" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi export job="atmanlfinal" export jobid="${job}.$$" diff --git a/jobs/rocoto/atmanlfv3inc.sh b/jobs/rocoto/atmanlfv3inc.sh index 5261c15f09..fee2d573a1 100755 --- a/jobs/rocoto/atmanlfv3inc.sh +++ b/jobs/rocoto/atmanlfv3inc.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source UFSDA workflow modules . "${HOMEgfs}/ush/load_ufsda_modules.sh" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi export job="atmanlfv3inc" export jobid="${job}.$$" diff --git a/jobs/rocoto/atmanlinit.sh b/jobs/rocoto/atmanlinit.sh index 5329200590..3292c65b3a 100755 --- a/jobs/rocoto/atmanlinit.sh +++ b/jobs/rocoto/atmanlinit.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source UFSDA workflow modules . "${HOMEgfs}/ush/load_ufsda_modules.sh" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi export job="atmanlinit" export jobid="${job}.$$" diff --git a/jobs/rocoto/atmanlvar.sh b/jobs/rocoto/atmanlvar.sh index 7df7f59dd1..43153120a5 100755 --- a/jobs/rocoto/atmanlvar.sh +++ b/jobs/rocoto/atmanlvar.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source UFSDA workflow modules . "${HOMEgfs}/ush/load_ufsda_modules.sh" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi export job="atmanlvar" export jobid="${job}.$$" diff --git a/jobs/rocoto/atmensanlfinal.sh b/jobs/rocoto/atmensanlfinal.sh index fc29bdd9af..1ef5044f58 100755 --- a/jobs/rocoto/atmensanlfinal.sh +++ b/jobs/rocoto/atmensanlfinal.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source UFSDA workflow modules . "${HOMEgfs}/ush/load_ufsda_modules.sh" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi export job="atmensanlfinal" export jobid="${job}.$$" diff --git a/jobs/rocoto/atmensanlfv3inc.sh b/jobs/rocoto/atmensanlfv3inc.sh index 7f57e8d618..a9f84eff0b 100755 --- a/jobs/rocoto/atmensanlfv3inc.sh +++ b/jobs/rocoto/atmensanlfv3inc.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source UFSDA workflow modules . "${HOMEgfs}/ush/load_ufsda_modules.sh" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi export job="atmensanlfv3inc" export jobid="${job}.$$" diff --git a/jobs/rocoto/atmensanlinit.sh b/jobs/rocoto/atmensanlinit.sh index 1cd8129df6..79e88614d8 100755 --- a/jobs/rocoto/atmensanlinit.sh +++ b/jobs/rocoto/atmensanlinit.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source UFSDA workflow modules . "${HOMEgfs}/ush/load_ufsda_modules.sh" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi export job="atmensanlinit" export jobid="${job}.$$" diff --git a/jobs/rocoto/atmensanlletkf.sh b/jobs/rocoto/atmensanlletkf.sh index 0ca86bfb43..aff7b0dbdf 100755 --- a/jobs/rocoto/atmensanlletkf.sh +++ b/jobs/rocoto/atmensanlletkf.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source UFSDA workflow modules . "${HOMEgfs}/ush/load_ufsda_modules.sh" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi export job="atmensanlletkf" export jobid="${job}.$$" diff --git a/jobs/rocoto/atmensanlobs.sh b/jobs/rocoto/atmensanlobs.sh index d02d013bcd..2d7601aebd 100755 --- a/jobs/rocoto/atmensanlobs.sh +++ b/jobs/rocoto/atmensanlobs.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source UFSDA workflow modules . "${HOMEgfs}/ush/load_ufsda_modules.sh" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi export job="atmensanlobs" export jobid="${job}.$$" diff --git a/jobs/rocoto/atmensanlsol.sh b/jobs/rocoto/atmensanlsol.sh index e1fe59d986..36d1f860c7 100755 --- a/jobs/rocoto/atmensanlsol.sh +++ b/jobs/rocoto/atmensanlsol.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source UFSDA workflow modules . "${HOMEgfs}/ush/load_ufsda_modules.sh" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi export job="atmensanlsol" export jobid="${job}.$$" diff --git a/jobs/rocoto/cleanup.sh b/jobs/rocoto/cleanup.sh index 96303fde57..010222ff55 100755 --- a/jobs/rocoto/cleanup.sh +++ b/jobs/rocoto/cleanup.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source FV3GFS workflow modules . "${HOMEgfs}"/ush/load_fv3gfs_modules.sh status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi export job="cleanup" export jobid="${job}.$$" diff --git a/jobs/rocoto/earc_tars.sh b/jobs/rocoto/earc_tars.sh index a796d90232..02a40da557 100755 --- a/jobs/rocoto/earc_tars.sh +++ b/jobs/rocoto/earc_tars.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source FV3GFS workflow modules . "${HOMEgfs}/ush/load_fv3gfs_modules.sh" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################################### # setup python path for workflow utilities and tasks diff --git a/jobs/rocoto/earc_vrfy.sh b/jobs/rocoto/earc_vrfy.sh index 2b8c0db05b..ad8c6e147c 100755 --- a/jobs/rocoto/earc_vrfy.sh +++ b/jobs/rocoto/earc_vrfy.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source FV3GFS workflow modules . "${HOMEgfs}/ush/load_fv3gfs_modules.sh" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi ############################################################### # setup python path for workflow utilities and tasks diff --git a/jobs/rocoto/ecen.sh b/jobs/rocoto/ecen.sh index 744956b1ff..25562e10ee 100755 --- a/jobs/rocoto/ecen.sh +++ b/jobs/rocoto/ecen.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source FV3GFS workflow modules . ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi ############################################################### # Loop over groups to Execute the JJOB @@ -21,7 +23,9 @@ for fhr in ${fhrlst}; do ${HOMEgfs}/jobs/JGDAS_ENKF_ECEN status=$? - [[ ${status} -ne 0 ]] && exit ${status} + if [[ ${status} -ne 0 ]]; then + exit ${status} + fi done diff --git a/jobs/rocoto/echgres.sh b/jobs/rocoto/echgres.sh index 5779a91f06..b339b7d0e1 100755 --- a/jobs/rocoto/echgres.sh +++ b/jobs/rocoto/echgres.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source FV3GFS workflow modules . ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi export job="echgres" export jobid="${job}.$$" diff --git a/jobs/rocoto/ediag.sh b/jobs/rocoto/ediag.sh index 8462edf296..0c5a13de5f 100755 --- a/jobs/rocoto/ediag.sh +++ b/jobs/rocoto/ediag.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source FV3GFS workflow modules . ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi export job="ediag" export jobid="${job}.$$" diff --git a/jobs/rocoto/eobs.sh b/jobs/rocoto/eobs.sh index 1139c3e623..dfe7c9260b 100755 --- a/jobs/rocoto/eobs.sh +++ b/jobs/rocoto/eobs.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source FV3GFS workflow modules . ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi export job="eobs" export jobid="${job}.$$" diff --git a/jobs/rocoto/epos.sh b/jobs/rocoto/epos.sh index d1f890a930..ee979af1c8 100755 --- a/jobs/rocoto/epos.sh +++ b/jobs/rocoto/epos.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source FV3GFS workflow modules . ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi export job="epos" export jobid="${job}.$$" @@ -22,7 +24,9 @@ for fhr in ${fhrlst}; do export FHOUT_EPOS=${fhr} ${HOMEgfs}/jobs/JGDAS_ENKF_POST status=$? - [[ ${status} -ne 0 ]] && exit ${status} + if [[ ${status} -ne 0 ]]; then + exit ${status} + fi done diff --git a/jobs/rocoto/esfc.sh b/jobs/rocoto/esfc.sh index 85f44151c9..88dda818fa 100755 --- a/jobs/rocoto/esfc.sh +++ b/jobs/rocoto/esfc.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source FV3GFS workflow modules . ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi export job="esfc" export jobid="${job}.$$" diff --git a/jobs/rocoto/esnowanl.sh b/jobs/rocoto/esnowanl.sh index a6a87f8492..c7c11e9110 100755 --- a/jobs/rocoto/esnowanl.sh +++ b/jobs/rocoto/esnowanl.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source UFSDA workflow modules . "${HOMEgfs}/ush/load_ufsda_modules.sh" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi export job="esnowanl" export jobid="${job}.$$" diff --git a/jobs/rocoto/eupd.sh b/jobs/rocoto/eupd.sh index 9134ca5f14..9abe4aa678 100755 --- a/jobs/rocoto/eupd.sh +++ b/jobs/rocoto/eupd.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source FV3GFS workflow modules . ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi export job="eupd" export jobid="${job}.$$" diff --git a/jobs/rocoto/extractvars.sh b/jobs/rocoto/extractvars.sh index a872431358..9dfb7fab5a 100755 --- a/jobs/rocoto/extractvars.sh +++ b/jobs/rocoto/extractvars.sh @@ -7,7 +7,9 @@ echo echo "=============== START TO SOURCE FV3GFS WORKFLOW MODULES ===============" . "${HOMEgfs}/ush/load_fv3gfs_modules.sh" status=$? -[[ "${status}" -ne 0 ]] && exit "${status}" +if [[ "${status}" -ne 0 ]]; then + exit "${status}" +fi export job="extractvars" export jobid="${job}.$$" @@ -18,6 +20,8 @@ echo "=============== START TO RUN EXTRACTVARS ===============" # Execute the JJOB "${HOMEgfs}/jobs/JGLOBAL_EXTRACTVARS" status=$? -[[ "${status}" -ne 0 ]] && exit "${status}" +if [[ "${status}" -ne 0 ]]; then + exit "${status}" +fi exit 0 diff --git a/jobs/rocoto/fcst.sh b/jobs/rocoto/fcst.sh index 9138b4eb43..f99d2bd63f 100755 --- a/jobs/rocoto/fcst.sh +++ b/jobs/rocoto/fcst.sh @@ -12,7 +12,9 @@ else . ${HOMEgfs}/ush/load_fv3gfs_modules.sh fi status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi export job="fcst" export jobid="${job}.$$" diff --git a/jobs/rocoto/fetch.sh b/jobs/rocoto/fetch.sh index ee34f6bd92..2a66ebaa72 100755 --- a/jobs/rocoto/fetch.sh +++ b/jobs/rocoto/fetch.sh @@ -5,7 +5,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source FV3GFS workflow modules . "${HOMEgfs}/ush/load_fv3gfs_modules.sh" status=$? -[[ "${status}" -ne 0 ]] && exit "${status}" +if [[ "${status}" -ne 0 ]]; then + exit "${status}" +fi export job="fetch" export jobid="${job}.$$" diff --git a/jobs/rocoto/fit2obs.sh b/jobs/rocoto/fit2obs.sh index d991234fbe..999783da05 100755 --- a/jobs/rocoto/fit2obs.sh +++ b/jobs/rocoto/fit2obs.sh @@ -7,7 +7,9 @@ echo echo "=============== START TO SOURCE FV3GFS WORKFLOW MODULES ===============" . "${HOMEgfs}/ush/load_fv3gfs_modules.sh" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi export job="fit2obs" export jobid="${job}.$$" @@ -18,6 +20,8 @@ echo "=============== START TO RUN FIT2OBS ===============" # Execute the JJOB "${HOMEgfs}/jobs/JGDAS_FIT2OBS" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi exit 0 diff --git a/jobs/rocoto/marineanlchkpt.sh b/jobs/rocoto/marineanlchkpt.sh index 69e10a7fa8..e08a0812a3 100755 --- a/jobs/rocoto/marineanlchkpt.sh +++ b/jobs/rocoto/marineanlchkpt.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source UFSDA workflow modules . "${HOMEgfs}/ush/load_ufsda_modules.sh" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi export job="marineanlchkpt" export jobid="${job}.$$" diff --git a/jobs/rocoto/marineanlfinal.sh b/jobs/rocoto/marineanlfinal.sh index 8f0c8fa3a3..380085427c 100755 --- a/jobs/rocoto/marineanlfinal.sh +++ b/jobs/rocoto/marineanlfinal.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source UFSDA workflow modules . "${HOMEgfs}/ush/load_ufsda_modules.sh" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi export job="marineanlfinal" export jobid="${job}.$$" diff --git a/jobs/rocoto/marineanlinit.sh b/jobs/rocoto/marineanlinit.sh index 953fc0dcfd..17b68b5e77 100755 --- a/jobs/rocoto/marineanlinit.sh +++ b/jobs/rocoto/marineanlinit.sh @@ -7,7 +7,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source UFSDA workflow modules . "${HOMEgfs}/ush/load_ufsda_modules.sh" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi export job="ocnanalprep" export jobid="${job}.$$" diff --git a/jobs/rocoto/marineanlletkf.sh b/jobs/rocoto/marineanlletkf.sh index d4333461f3..849fb45400 100755 --- a/jobs/rocoto/marineanlletkf.sh +++ b/jobs/rocoto/marineanlletkf.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source UFSDA workflow modules . "${HOMEgfs}/ush/load_ufsda_modules.sh" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi export job="marineanlletkf" export jobid="${job}.$$" diff --git a/jobs/rocoto/marineanlvar.sh b/jobs/rocoto/marineanlvar.sh index 35a21a2bcb..4c95ad858d 100755 --- a/jobs/rocoto/marineanlvar.sh +++ b/jobs/rocoto/marineanlvar.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source UFSDA workflow modules . "${HOMEgfs}/ush/load_ufsda_modules.sh" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi export job="marineanlvar" export jobid="${job}.$$" diff --git a/jobs/rocoto/marinebmat.sh b/jobs/rocoto/marinebmat.sh index 9b72e5e12c..e76859479a 100755 --- a/jobs/rocoto/marinebmat.sh +++ b/jobs/rocoto/marinebmat.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source UFSDA workflow modules . "${HOMEgfs}/ush/load_ufsda_modules.sh" status=$? -[[ "${status}" -ne 0 ]] && exit "${status}" +if [[ "${status}" -ne 0 ]]; then + exit "${status}" +fi export job="marinebmat" export jobid="${job}.$$" diff --git a/jobs/rocoto/ocnanalecen.sh b/jobs/rocoto/ocnanalecen.sh index c5fdbbbf32..068cc77cb9 100755 --- a/jobs/rocoto/ocnanalecen.sh +++ b/jobs/rocoto/ocnanalecen.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source UFSDA workflow modules . "${HOMEgfs}/ush/load_ufsda_modules.sh" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi export job="ocnanalecen" export jobid="${job}.$$" diff --git a/jobs/rocoto/postsnd.sh b/jobs/rocoto/postsnd.sh index bc274361db..066c5118ca 100755 --- a/jobs/rocoto/postsnd.sh +++ b/jobs/rocoto/postsnd.sh @@ -7,7 +7,9 @@ source "${HOMEgfs}/ush/preamble.sh" . ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi export job="postsnd" export jobid="${job}.$$" diff --git a/jobs/rocoto/prep.sh b/jobs/rocoto/prep.sh index bbde68377d..4c58a139d5 100755 --- a/jobs/rocoto/prep.sh +++ b/jobs/rocoto/prep.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source FV3GFS workflow modules . ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi ############################################################### export job="prep" @@ -42,17 +44,25 @@ if [[ ! -d "${COM_OBS}" ]]; then mkdir -p "${COM_OBS}"; fi if [[ ${ROTDIR_DUMP} = "YES" ]]; then "${HOMEgfs}/ush/getdump.sh" "${PDY}${cyc}" "${RUN_local}" "${COM_OBSDMP}" "${COM_OBS}" status=$? - [[ ${status} -ne 0 ]] && exit ${status} + if [[ ${status} -ne 0 ]]; then + exit ${status} + fi # Ensure previous cycle gdas dumps are available (used by cycle & downstream) if [[ ! -s "${COM_OBS_PREV}/${GDUMP}.t${gcyc}z.updated.status.tm00.bufr_d" ]]; then "${HOMEgfs}/ush/getdump.sh" "${GDATE}" "${GDUMP}" "${COM_OBSDMP_PREV}" "${COM_OBS_PREV}" status=$? - [[ ${status} -ne 0 ]] && exit ${status} + if [[ ${status} -ne 0 ]]; then + exit ${status} + fi fi # exception handling to ensure no dead link - [[ $(find ${COM_OBS} -xtype l | wc -l) -ge 1 ]] && exit 9 - [[ $(find ${COM_OBS_PREV} -xtype l | wc -l) -ge 1 ]] && exit 9 + if [[ $(find ${COM_OBS} -xtype l | wc -l) -ge 1 ]]; then + exit 9 + fi + if [[ $(find ${COM_OBS_PREV} -xtype l | wc -l) -ge 1 ]]; then + exit 9 + fi fi @@ -78,7 +88,9 @@ if [[ ${PROCESS_TROPCY} = "YES" ]]; then "${HOMEgfs}/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC" status=$? - [[ ${status} -ne 0 ]] && exit ${status} + if [[ ${status} -ne 0 ]]; then + exit ${status} + fi else if [[ ${ROTDIR_DUMP} = "NO" ]]; then cp "${COM_OBSDMP}/${RUN_local}.t${cyc}z.syndata.tcvitals.tm00" "${COM_OBS}/"; fi @@ -113,7 +125,9 @@ if [[ ${MAKE_PREPBUFR} = "YES" ]]; then "${HOMEobsproc}/jobs/JOBSPROC_GLOBAL_PREP" status=$? - [[ ${status} -ne 0 ]] && exit ${status} + if [[ ${status} -ne 0 ]]; then + exit ${status} + fi # If creating NSSTBUFR was disabled, copy from DMPDIR if appropriate. if [[ ${MAKE_NSSTBUFR:-"NO"} = "NO" ]]; then diff --git a/jobs/rocoto/prepatmiodaobs.sh b/jobs/rocoto/prepatmiodaobs.sh index 26629a514f..9f0ee630ad 100755 --- a/jobs/rocoto/prepatmiodaobs.sh +++ b/jobs/rocoto/prepatmiodaobs.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source UFSDA workflow modules . "${HOMEgfs}/ush/load_ufsda_modules.sh" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi export job="prepatmobs" export jobid="${job}.$$" diff --git a/jobs/rocoto/prepobsaero.sh b/jobs/rocoto/prepobsaero.sh index 5d65ff8a02..e130660506 100755 --- a/jobs/rocoto/prepobsaero.sh +++ b/jobs/rocoto/prepobsaero.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source UFSDA workflow modules . "${HOMEgfs}/ush/load_ufsda_modules.sh" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi export job="prepobsaero" export jobid="${job}.$$" diff --git a/jobs/rocoto/prepoceanobs.sh b/jobs/rocoto/prepoceanobs.sh index 20aca4f15a..c79881c167 100755 --- a/jobs/rocoto/prepoceanobs.sh +++ b/jobs/rocoto/prepoceanobs.sh @@ -7,7 +7,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source UFSDA workflow modules . "${HOMEgfs}/ush/load_ufsda_modules.sh" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi export job="prepoceanobs" export jobid="${job}.$$" diff --git a/jobs/rocoto/sfcanl.sh b/jobs/rocoto/sfcanl.sh index 44f93ee0c3..fa0dc5090c 100755 --- a/jobs/rocoto/sfcanl.sh +++ b/jobs/rocoto/sfcanl.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source FV3GFS workflow modules . ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi export job="sfcanl" export jobid="${job}.$$" diff --git a/jobs/rocoto/snowanl.sh b/jobs/rocoto/snowanl.sh index cf1ddd688b..a0c8395019 100755 --- a/jobs/rocoto/snowanl.sh +++ b/jobs/rocoto/snowanl.sh @@ -6,7 +6,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source UFSDA workflow modules . "${HOMEgfs}/ush/load_ufsda_modules.sh" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi export job="snowanl" export jobid="${job}.$$" diff --git a/jobs/rocoto/stage_ic.sh b/jobs/rocoto/stage_ic.sh index 5e7b3395d2..d5e7cd9b53 100755 --- a/jobs/rocoto/stage_ic.sh +++ b/jobs/rocoto/stage_ic.sh @@ -5,7 +5,9 @@ source "${HOMEgfs}/ush/preamble.sh" # Source FV3GFS workflow modules . "${HOMEgfs}/ush/load_fv3gfs_modules.sh" status=$? -[[ "${status}" -ne 0 ]] && exit "${status}" +if [[ "${status}" -ne 0 ]]; then + exit "${status}" +fi export job="stage_ic" export jobid="${job}.$$" diff --git a/jobs/rocoto/waveawipsbulls.sh b/jobs/rocoto/waveawipsbulls.sh index 4b6d6e1e82..84e974e3a7 100755 --- a/jobs/rocoto/waveawipsbulls.sh +++ b/jobs/rocoto/waveawipsbulls.sh @@ -6,7 +6,9 @@ source "$HOMEgfs/ush/preamble.sh" # Source FV3GFS workflow modules source ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi export job="waveawipsbulls" export jobid="${job}.$$" diff --git a/jobs/rocoto/waveawipsgridded.sh b/jobs/rocoto/waveawipsgridded.sh index c10f2f39fd..70e4dbeb07 100755 --- a/jobs/rocoto/waveawipsgridded.sh +++ b/jobs/rocoto/waveawipsgridded.sh @@ -6,7 +6,9 @@ source "$HOMEgfs/ush/preamble.sh" # Source FV3GFS workflow modules source ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi export job="waveawipsgridded" export jobid="${job}.$$" diff --git a/jobs/rocoto/wavegempak.sh b/jobs/rocoto/wavegempak.sh index 58fbcdcc5b..b0ebb4f2eb 100755 --- a/jobs/rocoto/wavegempak.sh +++ b/jobs/rocoto/wavegempak.sh @@ -5,7 +5,9 @@ source "$HOMEgfs/ush/preamble.sh" ############################################################### source $HOMEgfs/ush/load_fv3gfs_modules.sh status=$? -[[ $status -ne 0 ]] && exit $status +if [[ $status -ne 0 ]]; then + exit $status +fi export job="post" export jobid="${job}.$$" diff --git a/jobs/rocoto/waveinit.sh b/jobs/rocoto/waveinit.sh index b38367d09a..31e2fcd685 100755 --- a/jobs/rocoto/waveinit.sh +++ b/jobs/rocoto/waveinit.sh @@ -8,7 +8,9 @@ echo "=============== START TO SOURCE FV3GFS WORKFLOW MODULES ===============" #. ${HOMEgfs}/ush/load_fv3gfs_modules.sh . ${HOMEgfs}/ush/load_ufswm_modules.sh status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi export job="waveinit" export jobid="${job}.$$" @@ -19,6 +21,8 @@ echo "=============== START TO RUN WAVE INIT ===============" # Execute the JJOB ${HOMEgfs}/jobs/JGLOBAL_WAVE_INIT status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi exit 0 diff --git a/jobs/rocoto/wavepostbndpnt.sh b/jobs/rocoto/wavepostbndpnt.sh index 1a4f940150..68324d4a40 100755 --- a/jobs/rocoto/wavepostbndpnt.sh +++ b/jobs/rocoto/wavepostbndpnt.sh @@ -8,7 +8,9 @@ echo "=============== START TO SOURCE FV3GFS WORKFLOW MODULES ===============" #. ${HOMEgfs}/ush/load_fv3gfs_modules.sh . ${HOMEgfs}/ush/load_ufswm_modules.sh status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi export job="wavepostbndpnt" export jobid="${job}.$$" @@ -19,6 +21,8 @@ echo "=============== START TO RUN WAVE_POST_BNDPNT ===============" # Execute the JJOB ${HOMEgfs}/jobs/JGLOBAL_WAVE_POST_BNDPNT status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi exit 0 diff --git a/jobs/rocoto/wavepostbndpntbll.sh b/jobs/rocoto/wavepostbndpntbll.sh index 2d128facb7..069a86a23e 100755 --- a/jobs/rocoto/wavepostbndpntbll.sh +++ b/jobs/rocoto/wavepostbndpntbll.sh @@ -8,7 +8,9 @@ echo "=============== START TO SOURCE FV3GFS WORKFLOW MODULES ===============" #. ${HOMEgfs}/ush/load_fv3gfs_modules.sh . ${HOMEgfs}/ush/load_ufswm_modules.sh status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi export job="wavepostbndpntbll" export jobid="${job}.$$" @@ -19,6 +21,8 @@ echo "=============== START TO RUN WAVE_POST_BNDPNT ===============" # Execute the JJOB ${HOMEgfs}/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi exit 0 diff --git a/jobs/rocoto/wavepostpnt.sh b/jobs/rocoto/wavepostpnt.sh index 60017394f5..063805f107 100755 --- a/jobs/rocoto/wavepostpnt.sh +++ b/jobs/rocoto/wavepostpnt.sh @@ -8,7 +8,9 @@ echo "=============== START TO SOURCE FV3GFS WORKFLOW MODULES ===============" #. ${HOMEgfs}/ush/load_fv3gfs_modules.sh . ${HOMEgfs}/ush/load_ufswm_modules.sh status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi export job="wavepostpnt" export jobid="${job}.$$" @@ -19,6 +21,8 @@ echo "=============== START TO RUN WAVE_POST_PNT ===============" # Execute the JJOB ${HOMEgfs}/jobs/JGLOBAL_WAVE_POST_PNT status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi exit 0 diff --git a/jobs/rocoto/wavepostsbs.sh b/jobs/rocoto/wavepostsbs.sh index ff81c2a9d3..9856f01850 100755 --- a/jobs/rocoto/wavepostsbs.sh +++ b/jobs/rocoto/wavepostsbs.sh @@ -7,7 +7,9 @@ source "${HOMEgfs}/ush/preamble.sh" #. ${HOMEgfs}/ush/load_fv3gfs_modules.sh source "${HOMEgfs}/ush/load_ufswm_modules.sh" status=$? -[[ ${status} -ne 0 ]] && exit "${status}" +if [[ ${status} -ne 0 ]]; then + exit "${status}" +fi export job="wavepostsbs" diff --git a/jobs/rocoto/waveprep.sh b/jobs/rocoto/waveprep.sh index fa934167b7..c985f02ccd 100755 --- a/jobs/rocoto/waveprep.sh +++ b/jobs/rocoto/waveprep.sh @@ -8,7 +8,9 @@ echo "=============== START TO SOURCE FV3GFS WORKFLOW MODULES ===============" #. ${HOMEgfs}/ush/load_fv3gfs_modules.sh . ${HOMEgfs}/ush/load_ufswm_modules.sh status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi export job="waveprep" export jobid="${job}.$$" @@ -19,6 +21,8 @@ echo "=============== START TO RUN WAVE PREP ===============" # Execute the JJOB ${HOMEgfs}/jobs/JGLOBAL_WAVE_PREP status=$? -[[ ${status} -ne 0 ]] && exit ${status} +if [[ ${status} -ne 0 ]]; then + exit ${status} +fi exit 0 diff --git a/parm/config/gefs/config.efcs b/parm/config/gefs/config.efcs index 9ebf21ce1e..86d4a50a22 100644 --- a/parm/config/gefs/config.efcs +++ b/parm/config/gefs/config.efcs @@ -16,10 +16,18 @@ export CASE="${CASE_ENS}" # Source model specific information that is resolution dependent string="--fv3 ${CASE}" # Ocean/Ice/Waves ensemble configurations are identical to deterministic member -[[ "${DO_OCN}" == "YES" ]] && string="${string} --mom6 ${OCNRES}" -[[ "${DO_ICE}" == "YES" ]] && string="${string} --cice6 ${ICERES}" -[[ "${DO_WAVE}" == "YES" ]] && string="${string} --ww3 ${waveGRD// /;}" -[[ "${DO_AERO_FCST}" == "YES" ]] && string="${string} --gocart" +if [[ "${DO_OCN}" == "YES" ]]; then + string="${string} --mom6 ${OCNRES}" +fi +if [[ "${DO_ICE}" == "YES" ]]; then + string="${string} --cice6 ${ICERES}" +fi +if [[ "${DO_WAVE}" == "YES" ]]; then + string="${string} --ww3 ${waveGRD// /;}" +fi +if [[ "${DO_AERO_FCST}" == "YES" ]]; then + string="${string} --gocart" +fi # shellcheck disable=SC2086 source "${EXPDIR}/config.ufs" ${string} diff --git a/parm/config/gefs/config.fcst b/parm/config/gefs/config.fcst index c470aacb14..fd5494eecb 100644 --- a/parm/config/gefs/config.fcst +++ b/parm/config/gefs/config.fcst @@ -10,10 +10,18 @@ export COPY_FINAL_RESTARTS="NO" # Toggle to copy restarts from the end of GFS/GE # Source model specific information that is resolution dependent string="--fv3 ${CASE}" -[[ "${DO_OCN}" == "YES" ]] && string="${string} --mom6 ${OCNRES}" -[[ "${DO_ICE}" == "YES" ]] && string="${string} --cice6 ${ICERES}" -[[ "${DO_WAVE}" == "YES" ]] && string="${string} --ww3 ${waveGRD// /;}" -[[ "${DO_AERO_FCST}" == "YES" ]] && string="${string} --gocart" +if [[ "${DO_OCN}" == "YES" ]]; then + string="${string} --mom6 ${OCNRES}" +fi +if [[ "${DO_ICE}" == "YES" ]]; then + string="${string} --cice6 ${ICERES}" +fi +if [[ "${DO_WAVE}" == "YES" ]]; then + string="${string} --ww3 ${waveGRD// /;}" +fi +if [[ "${DO_AERO_FCST}" == "YES" ]]; then + string="${string} --gocart" +fi # We are counting on $string being multiple arguments # shellcheck disable=SC2086 source "${EXPDIR}/config.ufs" ${string} diff --git a/parm/config/gefs/config.resources b/parm/config/gefs/config.resources index b6b919145e..572d8dfc23 100644 --- a/parm/config/gefs/config.resources +++ b/parm/config/gefs/config.resources @@ -105,9 +105,15 @@ case ${step} in export UFS_THREADS=${nthreads_ufs:-1} nthreads_fv3=1 nthreads_mediator=1 - [[ "${DO_WAVE}" == "YES" ]] && nthreads_ww3=1 - [[ "${DO_OCN}" == "YES" ]] && nthreads_mom6=1 - [[ "${DO_ICE}" == "YES" ]] && nthreads_cice6=1 + if [[ "${DO_WAVE}" == "YES" ]]; then + nthreads_ww3=1 + fi + if [[ "${DO_OCN}" == "YES" ]]; then + nthreads_mom6=1 + fi + if [[ "${DO_ICE}" == "YES" ]]; then + nthreads_cice6=1 + fi fi # FV3 diff --git a/parm/config/gfs/config.base b/parm/config/gfs/config.base index 586029f785..607041dea6 100644 --- a/parm/config/gfs/config.base +++ b/parm/config/gfs/config.base @@ -472,7 +472,9 @@ export DO_FIT2OBS="YES" # Run fit to observations package #--online archive of netcdf files for fit2obs verification export FHMAX_FITS=132 -[[ "${FHMAX_FITS}" -gt "${FHMAX_GFS}" ]] && export FHMAX_FITS=${FHMAX_GFS} +if [[ "${FHMAX_FITS}" -gt "${FHMAX_GFS}" ]]; then + export FHMAX_FITS=${FHMAX_GFS} +fi # User may choose to reset these at experiment setup time export DO_FETCH_HPSS="NO" # Copy from HPSS (on HPSS-accessible machines) onto COM diff --git a/parm/config/gfs/config.efcs b/parm/config/gfs/config.efcs index d27fd13cfa..7378403de9 100644 --- a/parm/config/gfs/config.efcs +++ b/parm/config/gfs/config.efcs @@ -10,10 +10,18 @@ export CASE="${CASE_ENS}" # Source model specific information that is resolution dependent string="--fv3 ${CASE}" # Ocean/Ice/Waves ensemble configurations are identical to deterministic member -[[ "${DO_OCN}" == "YES" ]] && string="${string} --mom6 ${OCNRES}" -[[ "${DO_ICE}" == "YES" ]] && string="${string} --cice6 ${ICERES}" -[[ "${DO_WAVE}" == "YES" ]] && string="${string} --ww3 ${waveGRD// /;}" -[[ "${DO_AERO_FCST}" == "YES" ]] && string="${string} --gocart" +if [[ "${DO_OCN}" == "YES" ]]; then + string="${string} --mom6 ${OCNRES}" +fi +if [[ "${DO_ICE}" == "YES" ]]; then + string="${string} --cice6 ${ICERES}" +fi +if [[ "${DO_WAVE}" == "YES" ]]; then + string="${string} --ww3 ${waveGRD// /;}" +fi +if [[ "${DO_AERO_FCST}" == "YES" ]]; then + string="${string} --gocart" +fi # We are counting on $string being multiple arguments # shellcheck disable=SC2086 source "${EXPDIR}/config.ufs" ${string} diff --git a/parm/config/gfs/config.fcst b/parm/config/gfs/config.fcst index 992f9eb329..557f00b198 100644 --- a/parm/config/gfs/config.fcst +++ b/parm/config/gfs/config.fcst @@ -10,10 +10,18 @@ export COPY_FINAL_RESTARTS="NO" # Toggle to copy restarts from the end of GFS/GE # Source model specific information that is resolution dependent string="--fv3 ${CASE}" -[[ "${DO_OCN}" == "YES" ]] && string="${string} --mom6 ${OCNRES}" -[[ "${DO_ICE}" == "YES" ]] && string="${string} --cice6 ${ICERES}" -[[ "${DO_WAVE}" == "YES" ]] && string="${string} --ww3 ${waveGRD// /;}" -[[ "${DO_AERO_FCST}" == "YES" ]] && string="${string} --gocart" +if [[ "${DO_OCN}" == "YES" ]]; then + string="${string} --mom6 ${OCNRES}" +fi +if [[ "${DO_ICE}" == "YES" ]]; then + string="${string} --cice6 ${ICERES}" +fi +if [[ "${DO_WAVE}" == "YES" ]]; then + string="${string} --ww3 ${waveGRD// /;}" +fi +if [[ "${DO_AERO_FCST}" == "YES" ]]; then + string="${string} --gocart" +fi # We are counting on $string being multiple arguments # shellcheck disable=SC2086 source "${EXPDIR}/config.ufs" ${string} diff --git a/parm/config/gfs/config.resources b/parm/config/gfs/config.resources index 4cc77d7339..424f5d45dd 100644 --- a/parm/config/gfs/config.resources +++ b/parm/config/gfs/config.resources @@ -772,9 +772,15 @@ case ${step} in export UFS_THREADS=${nthreads_ufs:-1} nthreads_fv3=1 nthreads_mediator=1 - [[ "${DO_WAVE}" == "YES" ]] && nthreads_ww3=1 - [[ "${DO_OCN}" == "YES" ]] && nthreads_mom6=1 - [[ "${DO_ICE}" == "YES" ]] && nthreads_cice6=1 + if [[ "${DO_WAVE}" == "YES" ]]; then + nthreads_ww3=1 + fi + if [[ "${DO_OCN}" == "YES" ]]; then + nthreads_mom6=1 + fi + if [[ "${DO_ICE}" == "YES" ]]; then + nthreads_cice6=1 + fi fi if (( ntiles > 6 )); then @@ -947,7 +953,9 @@ case ${step} in ;; esac tasks_per_node=${ntasks} - [[ ${CASE} == "C1152" ]] && tasks_per_node=40 + if [[ ${CASE} == "C1152" ]]; then + tasks_per_node=40 + fi threads_per_task=1 @@ -1021,7 +1029,9 @@ case ${step} in threads_per_task=1 tasks_per_node=1 memory="20G" - [[ ${CASE} == "C768" || ${CASE} == "C1152" ]] && memory="80GB" + if [[ ${CASE} == "C768" || ${CASE} == "C1152" ]]; then + memory="80GB" + fi ;; "metp") @@ -1247,7 +1257,9 @@ case ${step} in "epos") walltime="00:15:00" - [[ ${CASE} == "C768" || ${CASE} == "C1152" ]] && walltime="00:25:00" + if [[ ${CASE} == "C768" || ${CASE} == "C1152" ]]; then + walltime="00:25:00" + fi ntasks=80 threads_per_task=1 tasks_per_node=$(( max_tasks_per_node / threads_per_task )) diff --git a/parm/config/sfs/config.resources b/parm/config/sfs/config.resources index b6b919145e..572d8dfc23 100644 --- a/parm/config/sfs/config.resources +++ b/parm/config/sfs/config.resources @@ -105,9 +105,15 @@ case ${step} in export UFS_THREADS=${nthreads_ufs:-1} nthreads_fv3=1 nthreads_mediator=1 - [[ "${DO_WAVE}" == "YES" ]] && nthreads_ww3=1 - [[ "${DO_OCN}" == "YES" ]] && nthreads_mom6=1 - [[ "${DO_ICE}" == "YES" ]] && nthreads_cice6=1 + if [[ "${DO_WAVE}" == "YES" ]]; then + nthreads_ww3=1 + fi + if [[ "${DO_OCN}" == "YES" ]]; then + nthreads_mom6=1 + fi + if [[ "${DO_ICE}" == "YES" ]]; then + nthreads_cice6=1 + fi fi # FV3 diff --git a/scripts/exgdas_atmos_chgres_forenkf.sh b/scripts/exgdas_atmos_chgres_forenkf.sh index 1833ed7b1f..dd28605176 100755 --- a/scripts/exgdas_atmos_chgres_forenkf.sh +++ b/scripts/exgdas_atmos_chgres_forenkf.sh @@ -127,7 +127,9 @@ if [ $DO_CALC_ANALYSIS == "YES" ]; then SIGLEVEL=${SIGLEVEL:-${FIXgfs}/am/global_hyblev.l${LEVS_ENKF}.txt} if [ $USE_CFP = "YES" ]; then - [[ -f $DATA/mp_chgres.sh ]] && rm $DATA/mp_chgres.sh + if [[ -f $DATA/mp_chgres.sh ]]; then + rm $DATA/mp_chgres.sh + fi fi nfhrs=$(echo $IAUFHRS_ENKF | sed 's/,/ /g') diff --git a/scripts/exgdas_enkf_ecen.sh b/scripts/exgdas_enkf_ecen.sh index f84df82875..8ec418b130 100755 --- a/scripts/exgdas_enkf_ecen.sh +++ b/scripts/exgdas_enkf_ecen.sh @@ -102,7 +102,9 @@ fi cd $DATA || exit 99 ENKF_SUFFIX="s" -[[ $SMOOTH_ENKF = "NO" ]] && ENKF_SUFFIX="" +if [[ $SMOOTH_ENKF = "NO" ]]; then + ENKF_SUFFIX="" +fi ################################################################################ # Link ensemble member guess, analysis and increment files @@ -254,7 +256,9 @@ if [ $RECENTER_ENKF = "YES" ]; then export OMP_NUM_THREADS=$NTHREADS_CHGRES - [[ -f $chgresnml ]] && rm -f $chgresnml + if [[ -f $chgresnml ]]; then + rm -f $chgresnml + fi cat > $chgresnml << EOF &${nmltitle}_setup i_output=$LONB_ENKF @@ -300,7 +304,9 @@ EOF # make the small namelist file for incvars_to_zero - [[ -f recenter.nml ]] && rm recenter.nml + if [[ -f recenter.nml ]]; then + rm recenter.nml + fi cat > recenter.nml << EOF &recenter incvars_to_zero = $INCREMENTS_TO_ZERO @@ -333,7 +339,9 @@ if [ $DO_CALC_INCREMENT = "YES" ]; then . prep_step $NCP $CALCINCEXEC $DATA - [[ -f calc_increment.nml ]] && rm calc_increment.nml + if [[ -f calc_increment.nml ]]; then + rm calc_increment.nml + fi cat > calc_increment.nml << EOF &setup datapath = './' @@ -360,7 +368,9 @@ done # loop over analysis times in window ################################################################################ # Postprocessing cd $pwd -[[ $mkdata = "YES" ]] && rm -rf $DATA +if [[ $mkdata = "YES" ]]; then + rm -rf $DATA +fi exit ${err} diff --git a/scripts/exgdas_enkf_post.sh b/scripts/exgdas_enkf_post.sh index 06ce2e16fb..46d8a2d49b 100755 --- a/scripts/exgdas_enkf_post.sh +++ b/scripts/exgdas_enkf_post.sh @@ -53,7 +53,9 @@ ENKF_SPREAD=${ENKF_SPREAD:-"NO"} ################################################################################ # Preprocessing ENKF_SUFFIX="s" -[[ $SMOOTH_ENKF = "NO" ]] && ENKF_SUFFIX="" +if [[ $SMOOTH_ENKF = "NO" ]]; then + ENKF_SUFFIX="" +fi ################################################################################ # Copy executables to working directory @@ -93,13 +95,17 @@ for fhr in $(seq $FHMIN $FHOUT $FHMAX); do ${NLN} "${COMIN_ATMOS_HISTORY}/${PREFIX}atmf${fhrchar}${ENKF_SUFFIX}.nc" "atmf${fhrchar}${ENKF_SUFFIX}_${memchar}" done fi - [[ $ENKF_SPREAD = "YES" ]] && ${NLN} "${COMOUT_ATMOS_HISTORY_STAT}/${PREFIX}atmf${fhrchar}.ensspread.nc" "atmf${fhrchar}.ensspread" + if [[ $ENKF_SPREAD = "YES" ]]; then + ${NLN} "${COMOUT_ATMOS_HISTORY_STAT}/${PREFIX}atmf${fhrchar}.ensspread.nc" "atmf${fhrchar}.ensspread" + fi done ################################################################################ # Generate ensemble mean surface and atmospheric files -[[ $SMOOTH_ENKF = "YES" ]] && $NCP $HYBENSMOOTH ./hybens_smoothinfo +if [[ $SMOOTH_ENKF = "YES" ]]; then + $NCP $HYBENSMOOTH ./hybens_smoothinfo +fi rc=0 for fhr in $(seq $FHMIN $FHOUT $FHMAX); do diff --git a/scripts/exgdas_enkf_select_obs.sh b/scripts/exgdas_enkf_select_obs.sh index d0018d1099..3c2da7d247 100755 --- a/scripts/exgdas_enkf_select_obs.sh +++ b/scripts/exgdas_enkf_select_obs.sh @@ -104,7 +104,9 @@ export err=$?; err_chk ################################################################################ # Postprocessing cd $pwd -[[ $mkdata = "YES" ]] && rm -rf $DATA +if [[ $mkdata = "YES" ]]; then + rm -rf $DATA +fi exit $err diff --git a/scripts/exgdas_enkf_sfc.sh b/scripts/exgdas_enkf_sfc.sh index 1944325317..0337c55cc9 100755 --- a/scripts/exgdas_enkf_sfc.sh +++ b/scripts/exgdas_enkf_sfc.sh @@ -87,9 +87,13 @@ LONB_CASE=$((res*4)) export FNTSFA=${FNTSFA:-' '} export FNACNA=${FNACNA:-${COM_OBS}/${OPREFIX}seaice.5min.blend.grb} export FNSNOA=${FNSNOA:-${COM_OBS}/${OPREFIX}snogrb_t${JCAP_CASE}.${LONB_CASE}.${LATB_CASE}} -[[ ! -f $FNSNOA ]] && export FNSNOA="${COM_OBS}/${OPREFIX}snogrb_t1534.3072.1536" +if [[ ! -f $FNSNOA ]]; then + export FNSNOA="${COM_OBS}/${OPREFIX}snogrb_t1534.3072.1536" +fi FNSNOG=${FNSNOG:-${COM_OBS_PREV}/${GPREFIX}snogrb_t${JCAP_CASE}.${LONB_CASE}.${LATB_CASE}} -[[ ! -f $FNSNOG ]] && FNSNOG="${COM_OBS_PREV}/${GPREFIX}snogrb_t1534.3072.1536" +if [[ ! -f $FNSNOG ]]; then + FNSNOG="${COM_OBS_PREV}/${GPREFIX}snogrb_t1534.3072.1536" +fi # Set CYCLVARS by checking grib date of current snogrb vs that of prev cycle if [ ${RUN_GETGES:-"NO"} = "YES" ]; then @@ -156,7 +160,9 @@ if [ $DOIAU = "YES" ]; then sfcdata_dir="${COMIN_ATMOS_RESTART_MEM_PREV}" fi - [[ ${TILE_NUM} -eq 1 ]] && mkdir -p "${COM_ATMOS_RESTART_MEM}" + if [[ ${TILE_NUM} -eq 1 ]]; then + mkdir -p "${COM_ATMOS_RESTART_MEM}" + fi ${NCP} "${sfcdata_dir}/${bPDY}.${bcyc}0000.sfc_data.tile${n}.nc" \ "${DATA}/fnbgsi.${cmem}" ${NCP} "${DATA}/fnbgsi.${cmem}" "${DATA}/fnbgso.${cmem}" @@ -189,7 +195,9 @@ if [ $DOIAU = "YES" ]; then MEMDIR=${memchar} YMD=${PDY} HH=${cyc} declare_from_tmpl \ COM_ATMOS_ANALYSIS_MEM:COM_ATMOS_ANALYSIS_TMPL - [[ ${TILE_NUM} -eq 1 ]] && mkdir -p "${COM_ATMOS_RESTART_MEM}" + if [[ ${TILE_NUM} -eq 1 ]]; then + mkdir -p "${COM_ATMOS_RESTART_MEM}" + fi cpfs "${DATA}/fnbgso.${cmem}" "${COM_ATMOS_RESTART_MEM}/${bPDY}.${bcyc}0000.sfcanl_data.tile${n}.nc" @@ -256,7 +264,9 @@ if [ $DOSFCANL_ENKF = "YES" ]; then MEMDIR=${memchar} YMD=${PDY} HH=${cyc} declare_from_tmpl \ COM_ATMOS_RESTART_MEM:COM_ATMOS_RESTART_TMPL - [[ ! -d "${COM_ATMOS_RESTART_MEM}" ]] && mkdir -p "${COM_ATMOS_RESTART_MEM}" + if [[ ! -d "${COM_ATMOS_RESTART_MEM}" ]]; then + mkdir -p "${COM_ATMOS_RESTART_MEM}" + fi cpfs "${DATA}/fnbgso.${cmem}" "${COM_ATMOS_RESTART_MEM}/${PDY}.${cyc}0000.sfcanl_data.tile${n}.nc" diff --git a/scripts/exgdas_enkf_update.sh b/scripts/exgdas_enkf_update.sh index 752cb07a6b..757ba14cd9 100755 --- a/scripts/exgdas_enkf_update.sh +++ b/scripts/exgdas_enkf_update.sh @@ -119,7 +119,9 @@ HYBENSINFO=${HYBENSINFO:-${FIXgfs}/gsi/global_hybens_info.l${LEVS_ENKF}.txt} ANAVINFO=${ANAVINFO:-${FIXgfs}/gsi/global_anavinfo.l${LEVS_ENKF}.txt} VLOCALEIG=${VLOCALEIG:-${FIXgfs}/gsi/vlocal_eig_l${LEVS_ENKF}.dat} ENKF_SUFFIX="s" -[[ $SMOOTH_ENKF = "NO" ]] && ENKF_SUFFIX="" +if [[ $SMOOTH_ENKF = "NO" ]]; then + ENKF_SUFFIX="" +fi ################################################################################ # Preprocessing @@ -147,8 +149,12 @@ ${NLN} "${COM_ATMOS_ANALYSIS_STAT}/${GBIASe}" "satbias_in" ################################################################################ if [ $USE_CFP = "YES" ]; then - [[ -f $DATA/untar.sh ]] && rm $DATA/untar.sh - [[ -f $DATA/mp_untar.sh ]] && rm $DATA/mp_untar.sh + if [[ -f $DATA/untar.sh ]]; then + rm $DATA/untar.sh + fi + if [[ -f $DATA/mp_untar.sh ]]; then + rm $DATA/mp_untar.sh + fi cat > $DATA/untar.sh << EOFuntar #!/bin/sh memchar=\$1 @@ -417,7 +423,9 @@ cat stdout stderr > "${COM_ATMOS_ANALYSIS_STAT}/${ENKFSTAT}" ################################################################################ # Postprocessing cd "$pwd" -[[ $mkdata = "YES" ]] && rm -rf "${DATA}" +if [[ $mkdata = "YES" ]]; then + rm -rf "${DATA}" +fi exit ${err} diff --git a/scripts/exglobal_atmos_analysis.sh b/scripts/exglobal_atmos_analysis.sh index bd11b81c39..f0fd5f4377 100755 --- a/scripts/exglobal_atmos_analysis.sh +++ b/scripts/exglobal_atmos_analysis.sh @@ -500,7 +500,9 @@ ${NLN} ${ABIBF} abibufr ${NLN} ${HDOB} hdobbufr ${NLN} ${SSTVIIRS} sstviirs -[[ ${DONST} = "YES" ]] && ${NLN} ${NSSTBF} nsstbufr +if [[ ${DONST} = "YES" ]]; then + ${NLN} ${NSSTBF} nsstbufr +fi ############################################################## # Required bias guess files @@ -519,15 +521,31 @@ ${NLN} ${SFCG03} sfcf03 ${NLN} ${SFCGES} sfcf06 ${NLN} ${SFCG09} sfcf09 -[[ -f ${ATMG04} ]] && ${NLN} ${ATMG04} sigf04 -[[ -f ${ATMG05} ]] && ${NLN} ${ATMG05} sigf05 -[[ -f ${ATMG07} ]] && ${NLN} ${ATMG07} sigf07 -[[ -f ${ATMG08} ]] && ${NLN} ${ATMG08} sigf08 +if [[ -f ${ATMG04} ]]; then + ${NLN} ${ATMG04} sigf04 +fi +if [[ -f ${ATMG05} ]]; then + ${NLN} ${ATMG05} sigf05 +fi +if [[ -f ${ATMG07} ]]; then + ${NLN} ${ATMG07} sigf07 +fi +if [[ -f ${ATMG08} ]]; then + ${NLN} ${ATMG08} sigf08 +fi -[[ -f ${SFCG04} ]] && ${NLN} ${SFCG04} sfcf04 -[[ -f ${SFCG05} ]] && ${NLN} ${SFCG05} sfcf05 -[[ -f ${SFCG07} ]] && ${NLN} ${SFCG07} sfcf07 -[[ -f ${SFCG08} ]] && ${NLN} ${SFCG08} sfcf08 +if [[ -f ${SFCG04} ]]; then + ${NLN} ${SFCG04} sfcf04 +fi +if [[ -f ${SFCG05} ]]; then + ${NLN} ${SFCG05} sfcf05 +fi +if [[ -f ${SFCG07} ]]; then + ${NLN} ${SFCG07} sfcf07 +fi +if [[ -f ${SFCG08} ]]; then + ${NLN} ${SFCG08} sfcf08 +fi if [ ${DOHYBVAR} = "YES" ]; then @@ -535,7 +553,9 @@ if [ ${DOHYBVAR} = "YES" ]; then mkdir -p ensemble_data ENKF_SUFFIX="s" - [[ ${SMOOTH_ENKF} = "NO" ]] && ENKF_SUFFIX="" + if [[ ${SMOOTH_ENKF} = "NO" ]]; then + ENKF_SUFFIX="" + fi fhrs="06" if [ ${l4densvar} = ".true." ]; then @@ -640,8 +660,12 @@ fi # If requested, copy and de-tar guess radstat file if [ ${USE_RADSTAT} = "YES" ]; then if [ ${USE_CFP} = "YES" ]; then - [[ -f ${DATA}/unzip.sh ]] && rm ${DATA}/unzip.sh - [[ -f ${DATA}/mp_unzip.sh ]] && rm ${DATA}/mp_unzip.sh + if [[ -f ${DATA}/unzip.sh ]]; then + rm ${DATA}/unzip.sh + fi + if [[ -f ${DATA}/mp_unzip.sh ]]; then + rm ${DATA}/mp_unzip.sh + fi cat > ${DATA}/unzip.sh << EOFunzip #!/bin/sh diag_file=\$1 @@ -960,7 +984,9 @@ cat fort.2* > ${GSISTAT} # If requested, create obsinput tarball from obs_input.* files if [ ${RUN_SELECT} = "YES" ]; then echo $(date) START tar obs_input >&2 - [[ -s obsinput.tar ]] && rm obsinput.tar + if [[ -s obsinput.tar ]]; then + rm obsinput.tar + fi ${NLN} ${SELECT_OBS} obsinput.tar ${CHGRP_CMD} obs_input.* tar -cvf obsinput.tar obs_input.* @@ -981,7 +1007,9 @@ fi ################################################################################ # Postprocessing cd ${pwd} -[[ ${mkdata} = "YES" ]] && rm -rf ${DATA} +if [[ ${mkdata} = "YES" ]]; then + rm -rf ${DATA} +fi ############################################################## # Add this statement to release the forecast job once the diff --git a/scripts/exglobal_atmos_analysis_calc.sh b/scripts/exglobal_atmos_analysis_calc.sh index 74455ee2cb..e5c391ea46 100755 --- a/scripts/exglobal_atmos_analysis_calc.sh +++ b/scripts/exglobal_atmos_analysis_calc.sh @@ -155,10 +155,18 @@ if [ $DO_CALC_ANALYSIS == "YES" ]; then $NLN $ATMGES sigf06 $NLN $ATMG09 sigf09 - [[ -f $ATMG04 ]] && $NLN $ATMG04 sigf04 - [[ -f $ATMG05 ]] && $NLN $ATMG05 sigf05 - [[ -f $ATMG07 ]] && $NLN $ATMG07 sigf07 - [[ -f $ATMG08 ]] && $NLN $ATMG08 sigf08 + if [[ -f $ATMG04 ]]; then + $NLN $ATMG04 sigf04 + fi + if [[ -f $ATMG05 ]]; then + $NLN $ATMG05 sigf05 + fi + if [[ -f $ATMG07 ]]; then + $NLN $ATMG07 sigf07 + fi + if [[ -f $ATMG08 ]]; then + $NLN $ATMG08 sigf08 + fi # Link hourly backgrounds (if present) if [ -f $ATMG04 -a -f $ATMG05 -a -f $ATMG07 -a -f $ATMG08 ]; then @@ -186,7 +194,9 @@ echo "${rCDUMP} ${PDY}${cyc} atmanl and sfcanl done at $(date)" > "${COMOUT_ATMO ################################################################################ # Postprocessing cd $pwd -[[ $mkdata = "YES" ]] && rm -rf $DATA +if [[ $mkdata = "YES" ]]; then + rm -rf $DATA +fi exit $err diff --git a/scripts/exglobal_atmos_sfcanl.sh b/scripts/exglobal_atmos_sfcanl.sh index cbc43b0979..9580626e9e 100755 --- a/scripts/exglobal_atmos_sfcanl.sh +++ b/scripts/exglobal_atmos_sfcanl.sh @@ -62,9 +62,13 @@ LONB_CASE=$((res*4)) export FNTSFA=${FNTSFA:-${COMIN_OBS}/${OPREFIX}rtgssthr.grb} export FNACNA=${FNACNA:-${COMIN_OBS}/${OPREFIX}seaice.5min.blend.grb} export FNSNOA=${FNSNOA:-${COMIN_OBS}/${OPREFIX}snogrb_t${JCAP_CASE}.${LONB_CASE}.${LATB_CASE}} -[[ ! -f ${FNSNOA} ]] && export FNSNOA="${COMIN_OBS}/${OPREFIX}snogrb_t1534.3072.1536" +if [[ ! -f ${FNSNOA} ]]; then + export FNSNOA="${COMIN_OBS}/${OPREFIX}snogrb_t1534.3072.1536" +fi FNSNOG=${FNSNOG:-${COMIN_OBS_PREV}/${GPREFIX}snogrb_t${JCAP_CASE}.${LONB_CASE}.${LATB_CASE}} -[[ ! -f ${FNSNOG} ]] && FNSNOG="${COMIN_OBS_PREV}/${GPREFIX}snogrb_t1534.3072.1536" +if [[ ! -f ${FNSNOG} ]]; then + FNSNOG="${COMIN_OBS_PREV}/${GPREFIX}snogrb_t1534.3072.1536" +fi # Set CYCLVARS by checking grib date of current snogrb vs that of prev cycle if [[ ${RUN_GETGES} = "YES" ]]; then diff --git a/scripts/exglobal_cleanup.sh b/scripts/exglobal_cleanup.sh index 73637a0d55..c53d44e34e 100755 --- a/scripts/exglobal_cleanup.sh +++ b/scripts/exglobal_cleanup.sh @@ -85,14 +85,18 @@ if [[ "${RUN}" == "gfs" ]]; then fhmax=$((FHMAX_FITS + 36)) RDATE=$(date --utc +%Y%m%d%H -d "${PDY} ${cyc} -${fhmax} hours") verify_dir="${ROTDIR}/vrfyarch/${RUN}.${RDATE:0:8}" - [[ -d ${verify_dir} ]] && rm -rf "${verify_dir}" + if [[ -d ${verify_dir} ]]; then + rm -rf "${verify_dir}" + fi touch_date=$(date --utc +%Y%m%d%H -d "${PDY} ${cyc} -${FHMAX_FITS} hours") while (( touch_date < "${PDY}${cyc}" )); do touch_PDY="${touch_date:0:8}" touch_cyc="${touch_date:8:2}" touch_dir="${ROTDIR}/vrfyarch/${RUN}.${touch_PDY}/${touch_cyc}" - [[ -d ${touch_dir} ]] && touch "${touch_dir}"/* + if [[ -d ${touch_dir} ]]; then + touch "${touch_dir}"/* + fi touch_date=$(date --utc +%Y%m%d%H -d "${touch_PDY} ${touch_cyc} +6 hours") done fi diff --git a/scripts/exglobal_diag.sh b/scripts/exglobal_diag.sh index 46a6e9863c..f46210d5fc 100755 --- a/scripts/exglobal_diag.sh +++ b/scripts/exglobal_diag.sh @@ -55,10 +55,18 @@ CNVSTAT=${CNVSTAT:-${COMOUT_ATMOS_ANALYSIS}/${APREFIX}cnvstat} OZNSTAT=${OZNSTAT:-${COMOUT_ATMOS_ANALYSIS}/${APREFIX}oznstat} # Remove stat file if file already exists -[[ -s $RADSTAT ]] && rm -f $RADSTAT -[[ -s $PCPSTAT ]] && rm -f $PCPSTAT -[[ -s $CNVSTAT ]] && rm -f $CNVSTAT -[[ -s $OZNSTAT ]] && rm -f $OZNSTAT +if [[ -s $RADSTAT ]]; then + rm -f $RADSTAT +fi +if [[ -s $PCPSTAT ]]; then + rm -f $PCPSTAT +fi +if [[ -s $CNVSTAT ]]; then + rm -f $CNVSTAT +fi +if [[ -s $OZNSTAT ]]; then + rm -f $OZNSTAT +fi # Obs diag GENDIAG=${GENDIAG:-"YES"} @@ -124,8 +132,12 @@ if [ $GENDIAG = "YES" ] ; then fi if [ $USE_CFP = "YES" ]; then - [[ -f $DATA/diag.sh ]] && rm $DATA/diag.sh - [[ -f $DATA/mp_diag.sh ]] && rm $DATA/mp_diag.sh + if [[ -f $DATA/diag.sh ]]; then + rm $DATA/diag.sh + fi + if [[ -f $DATA/mp_diag.sh ]]; then + rm $DATA/mp_diag.sh + fi cat > $DATA/diag.sh << EOFdiag #!/bin/sh lrun_subdirs=\$1 @@ -273,7 +285,9 @@ if [[ "$REMOVE_DIAG_DIR" = "YES" && "$err" = "0" ]]; then fi cd $pwd -[[ "${mkdata:-YES}" = "YES" ]] && rm -rf $DATA +if [[ "${mkdata:-YES}" = "YES" ]]; then + rm -rf $DATA +fi exit $err diff --git a/scripts/exglobal_forecast.sh b/scripts/exglobal_forecast.sh index 4ce9d7894d..16bc57a50e 100755 --- a/scripts/exglobal_forecast.sh +++ b/scripts/exglobal_forecast.sh @@ -106,11 +106,21 @@ common_predet echo "MAIN: Loading variables before determination of run type" FV3_predet -[[ ${cplflx} = .true. ]] && CMEPS_predet -[[ ${cplflx} = .true. ]] && MOM6_predet -[[ ${cplwav} = .true. ]] && WW3_predet -[[ ${cplice} = .true. ]] && CICE_predet -[[ ${cplchm} = .true. ]] && GOCART_predet +if [[ ${cplflx} = .true. ]]; then + CMEPS_predet +fi +if [[ ${cplflx} = .true. ]]; then + MOM6_predet +fi +if [[ ${cplwav} = .true. ]]; then + WW3_predet +fi +if [[ ${cplice} = .true. ]]; then + CICE_predet +fi +if [[ ${cplchm} = .true. ]]; then + GOCART_predet +fi echo "MAIN: Variables before determination of run type loaded" echo "MAIN: Determining run type" @@ -119,19 +129,37 @@ echo "MAIN: run type determined" echo "MAIN: Post-determination set up of run type" FV3_postdet -[[ ${cplflx} = .true. ]] && CMEPS_postdet -[[ ${cplflx} = .true. ]] && MOM6_postdet -[[ ${cplwav} = .true. ]] && WW3_postdet -[[ ${cplice} = .true. ]] && CICE_postdet -[[ ${cplchm} = .true. ]] && GOCART_postdet +if [[ ${cplflx} = .true. ]]; then + CMEPS_postdet +fi +if [[ ${cplflx} = .true. ]]; then + MOM6_postdet +fi +if [[ ${cplwav} = .true. ]]; then + WW3_postdet +fi +if [[ ${cplice} = .true. ]]; then + CICE_postdet +fi +if [[ ${cplchm} = .true. ]]; then + GOCART_postdet +fi echo "MAIN: Post-determination set up of run type finished" echo "MAIN: Writing namelists and model configuration" FV3_nml -[[ ${cplflx} = .true. ]] && MOM6_nml -[[ ${cplwav} = .true. ]] && WW3_nml -[[ ${cplice} = .true. ]] && CICE_nml -[[ ${cplchm} = .true. ]] && GOCART_rc +if [[ ${cplflx} = .true. ]]; then + MOM6_nml +fi +if [[ ${cplwav} = .true. ]]; then + WW3_nml +fi +if [[ ${cplice} = .true. ]]; then + CICE_nml +fi +if [[ ${cplchm} = .true. ]]; then + GOCART_rc +fi UFS_configure echo "MAIN: Name lists and model configuration written" @@ -156,12 +184,24 @@ export err=${ERR} ${ERRSCRIPT} || exit "${err}" FV3_out -[[ ${cplflx} = .true. ]] && MOM6_out -[[ ${cplflx} = .true. ]] && CMEPS_out -[[ ${cplwav} = .true. ]] && WW3_out -[[ ${cplice} = .true. ]] && CICE_out -[[ ${cplchm} = .true. ]] && GOCART_out -[[ ${esmf_profile:-} = .true. ]] && CPL_out +if [[ ${cplflx} = .true. ]]; then + MOM6_out +fi +if [[ ${cplflx} = .true. ]]; then + CMEPS_out +fi +if [[ ${cplwav} = .true. ]]; then + WW3_out +fi +if [[ ${cplice} = .true. ]]; then + CICE_out +fi +if [[ ${cplchm} = .true. ]]; then + GOCART_out +fi +if [[ ${esmf_profile:-} = .true. ]]; then + CPL_out +fi echo "MAIN: Output copied to ROTDIR" #------------------------------------------------------------------ diff --git a/sorc/build_ufs.sh b/sorc/build_ufs.sh index 3b0b3ed638..a8bc945826 100755 --- a/sorc/build_ufs.sh +++ b/sorc/build_ufs.sh @@ -35,8 +35,12 @@ source "./tests/detect_machine.sh" source "./tests/module-setup.sh" MAKE_OPT="-DAPP=${APP} -D32BIT=ON -DCCPP_SUITES=${CCPP_SUITES}" -[[ ${PDLIB:-"OFF"} = "ON" ]] && MAKE_OPT+=" -DPDLIB=ON" -[[ ${HYDRO:-"OFF"} = "ON" ]] && MAKE_OPT+=" -DHYDRO=ON" +if [[ ${PDLIB:-"OFF"} = "ON" ]]; then + MAKE_OPT+=" -DPDLIB=ON" +fi +if [[ ${HYDRO:-"OFF"} = "ON" ]]; then + MAKE_OPT+=" -DHYDRO=ON" +fi if [[ ${BUILD_TYPE:-"Release"} = "DEBUG" ]] ; then MAKE_OPT+=" -DDEBUG=ON" elif [[ "${FASTER:-OFF}" == ON ]] ; then diff --git a/sorc/build_ww3prepost.sh b/sorc/build_ww3prepost.sh index 5668404db3..9f9ba114fa 100755 --- a/sorc/build_ww3prepost.sh +++ b/sorc/build_ww3prepost.sh @@ -51,7 +51,9 @@ fi export SWITCHFILE="${WW3_DIR}/${ww3switch}" #create build directory: -[[ -d "${path_build}" ]] && rm -rf "${path_build}" +if [[ -d "${path_build}" ]]; then + rm -rf "${path_build}" +fi mkdir -p "${path_build}" || exit 1 cd "${path_build}" || exit 1 echo "Forcing a SHRD build" @@ -79,7 +81,9 @@ cat "${buildswitch}" #define cmake build options MAKE_OPT="-DCMAKE_INSTALL_PREFIX=${path_install}" -[[ ${BUILD_TYPE:-"Release"} = "Debug" ]] && MAKE_OPT+=" -DCMAKE_BUILD_TYPE=Debug" +if [[ ${BUILD_TYPE:-"Release"} = "Debug" ]]; then + MAKE_OPT+=" -DCMAKE_BUILD_TYPE=Debug" +fi #Build executables: # shellcheck disable=SC2086 diff --git a/sorc/link_workflow.sh b/sorc/link_workflow.sh index a57f5660cc..0113c0df3c 100755 --- a/sorc/link_workflow.sh +++ b/sorc/link_workflow.sh @@ -92,7 +92,9 @@ source "${HOMEgfs}/versions/fix.ver" packages=("jcb") for package in "${packages[@]}"; do cd "${HOMEgfs}/ush/python" || exit 1 - [[ -s "${package}" ]] && rm -f "${package}" + if [[ -s "${package}" ]]; then + rm -f "${package}" + fi ${LINK} "${HOMEgfs}/sorc/gdas.cd/sorc/${package}/src/${package}" . done @@ -116,7 +118,9 @@ for dir in aer \ verif \ wave; do if [[ -d "${dir}" ]]; then - [[ "${RUN_ENVIR}" == "nco" ]] && chmod -R 755 "${dir}" + if [[ "${RUN_ENVIR}" == "nco" ]]; then + chmod -R 755 "${dir}" + fi rm -rf "${dir}" fi fix_ver="${dir}_ver" @@ -128,7 +132,9 @@ if [[ "${LINK_NEST:-OFF}" == "ON" ]]; then ugwd; do nestdir=${dir}_nest if [[ -d "${nestdir}" ]]; then - [[ "${RUN_ENVIR}" == "nco" ]] && chmod -R 755 "${nestdir}" + if [[ "${RUN_ENVIR}" == "nco" ]]; then + chmod -R 755 "${nestdir}" + fi rm -rf "${nestdir}" fi fix_ver="${dir}_nest_ver" @@ -185,13 +191,17 @@ declare -a ufs_templates=("model_configure.IN" "input_global_nest.nml.IN" "ww3_shel.nml.IN" "post_itag_gfs") for file in "${ufs_templates[@]}"; do - [[ -s "${file}" ]] && rm -f "${file}" + if [[ -s "${file}" ]]; then + rm -f "${file}" + fi ${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_model.fd/tests/parm/${file}" . done # Link the script from ufs-weather-model that parses the templates cd "${HOMEgfs}/ush" || exit 1 -[[ -s "atparse.bash" ]] && rm -f "atparse.bash" +if [[ -s "atparse.bash" ]]; then + rm -f "atparse.bash" +fi ${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_model.fd/tests/atparse.bash" . #------------------------------ @@ -199,7 +209,9 @@ ${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_model.fd/tests/atparse.bash" . #------------------------------ if [[ -d "${HOMEgfs}/sorc/gdas.cd" ]]; then cd "${HOMEgfs}/fix" || exit 1 - [[ ! -d gdas ]] && mkdir -p gdas + if [[ ! -d gdas ]]; then + mkdir -p gdas + fi cd gdas || exit 1 for gdas_sub in fv3jedi gsibec obs soca aero snow; do if [[ -d "${gdas_sub}" ]]; then @@ -217,7 +229,9 @@ if [[ -d "${HOMEgfs}/sorc/gdas.cd" ]]; then cd "${HOMEgfs}/parm/gdas" || exit 1 declare -a gdasapp_comps=("aero" "atm" "io" "ioda" "snow" "soca" "jcb-gdas" "jcb-algorithms") for comp in "${gdasapp_comps[@]}"; do - [[ -d "${comp}" ]] && rm -rf "${comp}" + if [[ -d "${comp}" ]]; then + rm -rf "${comp}" + fi ${LINK_OR_COPY} "${HOMEgfs}/sorc/gdas.cd/parm/${comp}" . done fi @@ -249,7 +263,9 @@ fi if [[ -d "${HOMEgfs}/sorc/gsi_monitor.fd" ]]; then cd "${HOMEgfs}/parm" || exit 1 - [[ -d monitor ]] && rm -rf monitor + if [[ -d monitor ]]; then + rm -rf monitor + fi mkdir -p monitor cd monitor || exit 1 ${LINK_OR_COPY} "${HOMEgfs}/sorc/gsi_monitor.fd/src/Minimization_Monitor/nwprod/gdas/fix/gdas_minmon_cost.txt" . @@ -279,7 +295,9 @@ for utilexe in fbwndgfs.x gaussian_sfcanl.x gfs_bufr.x supvit.x syndat_getjtbul. syndat_maksynrc.x syndat_qctropcy.x tocsbufr.x overgridid.x rdbfmsua.x \ mkgfsawps.x enkf_chgres_recenter_nc.x tave.x vint.x ocnicepost.x webtitle.x \ ensadd.x ensppf.x ensstat.x wave_stat.x; do - [[ -s "${utilexe}" ]] && rm -f "${utilexe}" + if [[ -s "${utilexe}" ]]; then + rm -f "${utilexe}" + fi ${LINK_OR_COPY} "${HOMEgfs}/sorc/gfs_utils.fd/install/bin/${utilexe}" . done @@ -315,18 +333,24 @@ for sys in "${!wave_systems[@]}"; do fi done -[[ -s "upp.x" ]] && rm -f upp.x +if [[ -s "upp.x" ]]; then + rm -f upp.x +fi ${LINK_OR_COPY} "${HOMEgfs}/sorc/upp.fd/exec/upp.x" . for ufs_utilsexe in emcsfc_ice_blend emcsfc_snow2mdl global_cycle fregrid; do - [[ -s "${ufs_utilsexe}" ]] && rm -f "${ufs_utilsexe}" + if [[ -s "${ufs_utilsexe}" ]]; then + rm -f "${ufs_utilsexe}" + fi ${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_utils.fd/exec/${ufs_utilsexe}" . done # GSI if [[ -d "${HOMEgfs}/sorc/gsi_enkf.fd/install" ]]; then for gsiexe in enkf.x gsi.x; do - [[ -s "${gsiexe}" ]] && rm -f "${gsiexe}" + if [[ -s "${gsiexe}" ]]; then + rm -f "${gsiexe}" + fi ${LINK_OR_COPY} "${HOMEgfs}/sorc/gsi_enkf.fd/install/bin/${gsiexe}" . done fi @@ -336,7 +360,9 @@ if [[ -d "${HOMEgfs}/sorc/gsi_utils.fd/install" ]]; then for exe in calc_analysis.x calc_increment_ens_ncio.x calc_increment_ens.x \ getsfcensmeanp.x getsigensmeanp_smooth.x getsigensstatp.x \ interp_inc.x recentersigp.x; do - [[ -s "${exe}" ]] && rm -f "${exe}" + if [[ -s "${exe}" ]]; then + rm -f "${exe}" + fi ${LINK_OR_COPY} "${HOMEgfs}/sorc/gsi_utils.fd/install/bin/${exe}" . done fi @@ -345,7 +371,9 @@ fi if [[ -d "${HOMEgfs}/sorc/gsi_monitor.fd/install" ]]; then for exe in oznmon_horiz.x oznmon_time.x radmon_angle.x \ radmon_bcoef.x radmon_bcor.x radmon_time.x; do - [[ -s "${exe}" ]] && rm -f "${exe}" + if [[ -s "${exe}" ]]; then + rm -f "${exe}" + fi ${LINK_OR_COPY} "${HOMEgfs}/sorc/gsi_monitor.fd/install/bin/${exe}" . done fi @@ -371,7 +399,9 @@ if [[ -d "${HOMEgfs}/sorc/gdas.cd/build" ]]; then "calcfIMS.exe" "apply_incr.exe") for gdasexe in "${JEDI_EXE[@]}"; do - [[ -s "${gdasexe}" ]] && rm -f "${gdasexe}" + if [[ -s "${gdasexe}" ]]; then + rm -f "${gdasexe}" + fi ${LINK_OR_COPY} "${HOMEgfs}/sorc/gdas.cd/build/bin/${gdasexe}" . done fi @@ -381,66 +411,102 @@ fi #------------------------------ cd "${HOMEgfs}/sorc" || exit 8 if [[ -d ufs_model.fd ]]; then - [[ -d upp.fd ]] && rm -rf upp.fd + if [[ -d upp.fd ]]; then + rm -rf upp.fd + fi ${LINK} ufs_model.fd/FV3/upp upp.fd fi if [[ -d gsi_enkf.fd ]]; then - [[ -d gsi.fd ]] && rm -rf gsi.fd + if [[ -d gsi.fd ]]; then + rm -rf gsi.fd + fi ${LINK} gsi_enkf.fd/src/gsi gsi.fd - [[ -d enkf.fd ]] && rm -rf enkf.fd + if [[ -d enkf.fd ]]; then + rm -rf enkf.fd + fi ${LINK} gsi_enkf.fd/src/enkf enkf.fd fi if [[ -d gsi_utils.fd ]]; then - [[ -d calc_analysis.fd ]] && rm -rf calc_analysis.fd + if [[ -d calc_analysis.fd ]]; then + rm -rf calc_analysis.fd + fi ${LINK} gsi_utils.fd/src/netcdf_io/calc_analysis.fd . - [[ -d calc_increment_ens.fd ]] && rm -rf calc_increment_ens.fd + if [[ -d calc_increment_ens.fd ]]; then + rm -rf calc_increment_ens.fd + fi ${LINK} gsi_utils.fd/src/EnKF/gfs/src/calc_increment_ens.fd . - [[ -d calc_increment_ens_ncio.fd ]] && rm -rf calc_increment_ens_ncio.fd + if [[ -d calc_increment_ens_ncio.fd ]]; then + rm -rf calc_increment_ens_ncio.fd + fi ${LINK} gsi_utils.fd/src/EnKF/gfs/src/calc_increment_ens_ncio.fd . - [[ -d getsfcensmeanp.fd ]] && rm -rf getsfcensmeanp.fd + if [[ -d getsfcensmeanp.fd ]]; then + rm -rf getsfcensmeanp.fd + fi ${LINK} gsi_utils.fd/src/EnKF/gfs/src/getsfcensmeanp.fd . - [[ -d getsigensmeanp_smooth.fd ]] && rm -rf getsigensmeanp_smooth.fd + if [[ -d getsigensmeanp_smooth.fd ]]; then + rm -rf getsigensmeanp_smooth.fd + fi ${LINK} gsi_utils.fd/src/EnKF/gfs/src/getsigensmeanp_smooth.fd . - [[ -d getsigensstatp.fd ]] && rm -rf getsigensstatp.fd + if [[ -d getsigensstatp.fd ]]; then + rm -rf getsigensstatp.fd + fi ${LINK} gsi_utils.fd/src/EnKF/gfs/src/getsigensstatp.fd . - [[ -d recentersigp.fd ]] && rm -rf recentersigp.fd + if [[ -d recentersigp.fd ]]; then + rm -rf recentersigp.fd + fi ${LINK} gsi_utils.fd/src/EnKF/gfs/src/recentersigp.fd . - [[ -d interp_inc.fd ]] && rm -rf interp_inc.fd + if [[ -d interp_inc.fd ]]; then + rm -rf interp_inc.fd + fi ${LINK} gsi_utils.fd/src/netcdf_io/interp_inc.fd . fi if [[ -d gsi_monitor.fd ]]; then - [[ -d oznmon_horiz.fd ]] && rm -rf oznmon_horiz.fd + if [[ -d oznmon_horiz.fd ]]; then + rm -rf oznmon_horiz.fd + fi ${LINK} gsi_monitor.fd/src/Ozone_Monitor/nwprod/oznmon_shared/sorc/oznmon_horiz.fd . - [[ -d oznmon_time.fd ]] && rm -rf oznmon_time.fd + if [[ -d oznmon_time.fd ]]; then + rm -rf oznmon_time.fd + fi ${LINK} gsi_monitor.fd/src/Ozone_Monitor/nwprod/oznmon_shared/sorc/oznmon_time.fd . - [[ -d radmon_angle.fd ]] && rm -rf radmon_angle.fd + if [[ -d radmon_angle.fd ]]; then + rm -rf radmon_angle.fd + fi ${LINK} gsi_monitor.fd/src/Radiance_Monitor/nwprod/radmon_shared/sorc/verf_radang.fd radmon_angle.fd - [[ -d radmon_bcoef.fd ]] && rm -rf radmon_bcoef.fd + if [[ -d radmon_bcoef.fd ]]; then + rm -rf radmon_bcoef.fd + fi ${LINK} gsi_monitor.fd/src/Radiance_Monitor/nwprod/radmon_shared/sorc/verf_radbcoef.fd radmon_bcoef.fd - [[ -d radmon_bcor.fd ]] && rm -rf radmon_bcor.fd + if [[ -d radmon_bcor.fd ]]; then + rm -rf radmon_bcor.fd + fi ${LINK} gsi_monitor.fd/src/Radiance_Monitor/nwprod/radmon_shared/sorc/verf_radbcor.fd radmon_bcor.fd - [[ -d radmon_time.fd ]] && rm -rf radmon_time.fd + if [[ -d radmon_time.fd ]]; then + rm -rf radmon_time.fd + fi ${LINK} gsi_monitor.fd/src/Radiance_Monitor/nwprod/radmon_shared/sorc/verf_radtime.fd radmon_time.fd fi for prog in global_cycle.fd emcsfc_ice_blend.fd emcsfc_snow2mdl.fd; do - [[ -d "${prog}" ]] && rm -rf "${prog}" + if [[ -d "${prog}" ]]; then + rm -rf "${prog}" + fi ${LINK} "ufs_utils.fd/sorc/${prog}" "${prog}" done diff --git a/ush/detect_machine.sh b/ush/detect_machine.sh index 9301c8492f..24352aa47d 100755 --- a/ush/detect_machine.sh +++ b/ush/detect_machine.sh @@ -9,7 +9,9 @@ # Thank you for your contribution # If the MACHINE_ID variable is set, skip this script. -[[ -n ${MACHINE_ID:-} ]] && return +if [[ -n ${MACHINE_ID:-} ]]; then + return +fi # First detect w/ hostname case $(hostname -f) in diff --git a/ush/forecast_postdet.sh b/ush/forecast_postdet.sh index 70120b9a5f..a619d02cf2 100755 --- a/ush/forecast_postdet.sh +++ b/ush/forecast_postdet.sh @@ -226,7 +226,9 @@ EOF mountain=".true." # restarts contain non-hydrostatic state - [[ "${TYPE}" == "nh" ]] && make_nh=".false." + if [[ "${TYPE}" == "nh" ]]; then + make_nh=".false." + fi # do not pre-condition the solution na_init=0 @@ -770,7 +772,9 @@ GOCART_rc() { if [[ -n "${AERO_INPUTS_DIR}" ]]; then ${NLN} "${AERO_INPUTS_DIR}" "${DATA}/ExtData" status=$? - [[ ${status} -ne 0 ]] && exit "${status}" + if [[ ${status} -ne 0 ]]; then + exit "${status}" + fi fi source "${USHgfs}/parsing_namelists_GOCART.sh" diff --git a/ush/forecast_predet.sh b/ush/forecast_predet.sh index 062b94de7c..ba0e3b84a7 100755 --- a/ush/forecast_predet.sh +++ b/ush/forecast_predet.sh @@ -453,7 +453,9 @@ FV3_predet(){ FNSMCC=${FNSMCC:-"${FIXgfs}/am/global_soilmgldas.statsgo.t${JCAP}.${LONB}.${LATB}.grb"} # If the appropriate resolution fix file is not present, use the highest resolution available (T1534) - [[ ! -f "${FNSMCC}" ]] && FNSMCC="${FIXgfs}/am/global_soilmgldas.statsgo.t1534.3072.1536.grb" + if [[ ! -f "${FNSMCC}" ]]; then + FNSMCC="${FIXgfs}/am/global_soilmgldas.statsgo.t1534.3072.1536.grb" + fi # Grid and orography data if [[ "${cplflx}" == ".false." ]] ; then diff --git a/ush/getges.sh b/ush/getges.sh index d960354bf4..792833e347 100755 --- a/ush/getges.sh +++ b/ush/getges.sh @@ -169,14 +169,24 @@ if [[ "$netwk" = "namopl" || "$resol" = "namopl" ]];then typef=restrt resol=namopl fi -[[ $resol = 57464 || $resol = 38264 || $resol = 19064 || $resol = 25464 || $resol = 17042 || $resol = 12628 ]]&&resol=high -[[ $resol = 6228 ]]&&resol=low +if [[ $resol = 57464 || $resol = 38264 || $resol = 19064 || $resol = 25464 || $resol = 17042 || $resol = 12628 ]]; then + resol=high +fi +if [[ $resol = 6228 ]]; then + resol=low +fi resolsuf="" -[[ $resol == *deg ]]&&resolsuf=.$resol +if [[ $resol == *deg ]]; then + resolsuf=.$resol +fi fhbeg=$(${NHOUR:?} $valid) -[[ $fhbeg -le 0 ]]&&fhbeg=03 +if [[ $fhbeg -le 0 ]]; then + fhbeg=03 +fi ((fhbeg=(10#$fhbeg-1)/3*3+3)) -[[ $fhbeg -lt 10 ]]&&fhbeg=0$fhbeg +if [[ $fhbeg -lt 10 ]]; then + fhbeg=0$fhbeg +fi if [[ $typef = enggrb ]];then typef=icegrb echo '************************************************************' >&2 @@ -1321,23 +1331,41 @@ fh=$fhbeg if [ -z "$PDY" ];then echo "getges.sh WARNING: \$PDY variable not set" >&2; fi while [[ $fh -le $fhend ]];do ((fhm6=10#$fh-6)) - [[ $fhm6 -lt 10 && $fhm6 -ge 0 ]]&&fhm6=0$fhm6 + if [[ $fhm6 -lt 10 && $fhm6 -ge 0 ]]; then + fhm6=0$fhm6 + fi ((fhm5=10#$fh-5)) - [[ $fhm5 -lt 10 && $fhm5 -ge 0 ]]&&fhm5=0$fhm5 + if [[ $fhm5 -lt 10 && $fhm5 -ge 0 ]]; then + fhm5=0$fhm5 + fi ((fhm4=10#$fh-4)) - [[ $fhm4 -lt 10 && $fhm4 -ge 0 ]]&&fhm4=0$fhm4 + if [[ $fhm4 -lt 10 && $fhm4 -ge 0 ]]; then + fhm4=0$fhm4 + fi ((fhm3=10#$fh-3)) - [[ $fhm3 -lt 10 && $fhm3 -ge 0 ]]&&fhm3=0$fhm3 + if [[ $fhm3 -lt 10 && $fhm3 -ge 0 ]]; then + fhm3=0$fhm3 + fi ((fhm2=10#$fh-2)) - [[ $fhm2 -lt 10 && $fhm2 -ge 0 ]]&&fhm2=0$fhm2 + if [[ $fhm2 -lt 10 && $fhm2 -ge 0 ]]; then + fhm2=0$fhm2 + fi ((fhm1=10#$fh-1)) - [[ $fhm1 -lt 10 && $fhm1 -ge 0 ]]&&fhm1=0$fhm1 + if [[ $fhm1 -lt 10 && $fhm1 -ge 0 ]]; then + fhm1=0$fhm1 + fi ((fhp1=10#$fh+1)) - [[ $fhp1 -lt 10 ]]&&fhp1=0$fhp1 + if [[ $fhp1 -lt 10 ]]; then + fhp1=0$fhp1 + fi ((fhp2=10#$fh+2)) - [[ $fhp2 -lt 10 ]]&&fhp2=0$fhp2 + if [[ $fhp2 -lt 10 ]]; then + fhp2=0$fhp2 + fi ((fhp3=10#$fh+3)) - [[ $fhp3 -lt 10 ]]&&fhp3=0$fhp3 + if [[ $fhp3 -lt 10 ]]; then + fhp3=0$fhp3 + fi gh=$fh;[[ $gh -lt 100 ]]&&gh=0$gh ghm6=$fhm6;[[ $ghm6 -lt 100 ]]&&ghm6=0$ghm6 ghm5=$fhm5;[[ $ghm5 -lt 100 ]]&&ghm5=0$ghm5 @@ -1353,17 +1381,25 @@ while [[ $fh -le $fhend ]];do day=$(echo $id | xargs | cut -c8) cyc=$(echo $id | xargs | rev | cut -c1-2 | rev) eval list=\$getlist$fh - [[ -z "$list" ]]&&list=${geslist} + if [[ -z "$list" ]]; then + list=${geslist} + fi for ges_var in $list;do # Replace variables in guess with their values eval ges_val=$ges_var # Replace the current PDY with the valid date ges=${ges_val/$PDY\//$day/} - [[ $quiet = NO ]]&&echo Checking: $ges >&2 - [[ -r $ges ]]&&break 2 + if [[ $quiet = NO ]]; then + echo Checking: $ges >&2 + fi + if [[ -r $ges ]]; then + break 2 + fi done fh=$((10#$fh+10#$fhinc)) - [[ $fh -lt 10 ]]&&fh=0$fh + if [[ $fh -lt 10 ]]; then + fh=0$fh + fi done if [[ $fh -gt $fhend ]];then echo getges.sh: unable to find $netwk.$envir.$typef.$resol.$valid >&2 diff --git a/ush/oceanice_nc2grib2.sh b/ush/oceanice_nc2grib2.sh index 5781e06b36..e701edd5db 100755 --- a/ush/oceanice_nc2grib2.sh +++ b/ush/oceanice_nc2grib2.sh @@ -182,7 +182,9 @@ function _ocean3D_nc2grib2 { zl=0 for depth in "${depths[@]}"; do - [[ -f "tmp.gb2" ]] && rm -f "tmp.gb2" + if [[ -f "tmp.gb2" ]]; then + rm -f "tmp.gb2" + fi ${WGRIB2} "${template}" \ -import_netcdf "${infile}" "temp" "0:1:${zl}:1:${latlon_dims}" \ diff --git a/ush/parsing_namelists_GOCART.sh b/ush/parsing_namelists_GOCART.sh index e39f0808ab..2a08a90b0b 100644 --- a/ush/parsing_namelists_GOCART.sh +++ b/ush/parsing_namelists_GOCART.sh @@ -33,7 +33,9 @@ GOCART_namelists() { base_in="$(basename "${template_in}")" atparse < "${template_in}" >> "${DATA}/${base_in}" status=$? - [[ ${status} -ne 0 ]] && exit "${status}" + if [[ ${status} -ne 0 ]]; then + exit "${status}" + fi done # attempt to generate ExtData configuration file if not provided diff --git a/ush/tropcy_relocate.sh b/ush/tropcy_relocate.sh index 11c0afb990..457c24b68d 100755 --- a/ush/tropcy_relocate.sh +++ b/ush/tropcy_relocate.sh @@ -350,11 +350,15 @@ for fhr in $( seq -6 $BKGFREQ 3 ) ; do fi sges=sg${tpref}prep - [[ $fhr -lt -3 ]]&&sges=NULL + if [[ $fhr -lt -3 ]]; then + sges=NULL + fi echo $sges # stype=sigg${tpref} stype=natg${tpref} - [[ $RUN = cdas1 ]] && stype=sigg${tpref} ## for cfs + if [[ $RUN = cdas1 ]]; then + stype=sigg${tpref} ## for cfs + fi pges=pg${tpref}prep ptype=${pgpref}${tpref} diff --git a/workflow/generate_workflows.sh b/workflow/generate_workflows.sh index 1f5f878c59..a46723fe11 100755 --- a/workflow/generate_workflows.sh +++ b/workflow/generate_workflows.sh @@ -190,7 +190,9 @@ if [[ "${_debug}" == "true" ]]; then fi # Create the RUNTESTS directory -[[ "${_verbose}" == "true" ]] && printf "Creating RUNTESTS in %s\n\n" "${_runtests}" +if [[ "${_verbose}" == "true" ]]; then + printf "Creating RUNTESTS in %s\n\n" "${_runtests}" +fi if [[ ! -d "${_runtests}" ]]; then set +e if ! mkdir -p "${_runtests}" "${_verbose_flag}"; then @@ -252,11 +254,15 @@ fi if [[ "${_specified_home}" == "false" ]]; then script_relpath="$(dirname "${BASH_SOURCE[0]}")" HOMEgfs="$(cd "${script_relpath}/.." && pwd)" - [[ "${_verbose}" == "true" ]] && printf "Setting HOMEgfs to %s\n\n" "${HOMEgfs}" + if [[ "${_verbose}" == "true" ]]; then + printf "Setting HOMEgfs to %s\n\n" "${HOMEgfs}" + fi fi # Set the _yaml_dir to HOMEgfs/ci/cases/pr if not explicitly set -[[ "${_specified_yaml_dir}" == false ]] && _yaml_dir="${HOMEgfs}/ci/cases/pr" +if [[ "${_specified_yaml_dir}" == false ]]; then + _yaml_dir="${HOMEgfs}/ci/cases/pr" +fi function select_all_yamls() { @@ -289,7 +295,9 @@ function select_all_yamls() # Strip .yaml from the filename to get the case name _yaml="${_yaml//.yaml/}" _nameref_yaml_list+=("${_yaml}") - [[ "${_verbose}" == true ]] && echo "Found test ${_yaml//.yaml/}" + if [[ "${_verbose}" == true ]]; then + echo "Found test ${_yaml//.yaml/}" + fi (( _yaml_count+=1 )) done @@ -341,16 +349,24 @@ fi # Loading modules sometimes raises unassigned errors, so disable checks set +u -[[ "${_verbose}" == "true" ]] && printf "Loading modules\n\n" -[[ "${_debug}" == "true" ]] && set +x +if [[ "${_verbose}" == "true" ]]; then + printf "Loading modules\n\n" +fi +if [[ "${_debug}" == "true" ]]; then + set +x +fi if ! source "${HOMEgfs}/workflow/gw_setup.sh" >& stdout; then cat stdout echo "Failed to source ${HOMEgfs}/workflow/gw_setup.sh!" exit 7 fi -[[ "${_verbose}" == "true" ]] && cat stdout +if [[ "${_verbose}" == "true" ]]; then + cat stdout +fi rm -f stdout -[[ "${_debug}" == "true" ]] && set -x +if [[ "${_debug}" == "true" ]]; then + set -x +fi set -u machine=${MACHINE_ID} platform_config="${HOMEgfs}/ci/platforms/config.${machine}" @@ -403,7 +419,9 @@ if [[ "${_build}" == "true" ]]; then fi # Link the workflow silently unless there's an error -[[ "${_verbose}" == true ]] && printf "Linking the workflow\n\n" +if [[ "${_verbose}" == true ]]; then + printf "Linking the workflow\n\n" +fi if ! "${HOMEgfs}/sorc/link_workflow.sh" >& stdout; then cat stdout echo "link_workflow.sh failed!" @@ -417,7 +435,9 @@ fi rm -f stdout # Configure the environment for running create_experiment.py -[[ "${_verbose}" == true ]] && printf "Setting up the environment to run create_experiment.py\n\n" +if [[ "${_verbose}" == true ]]; then + printf "Setting up the environment to run create_experiment.py\n\n" +fi for i in "${!_yaml_list[@]}"; do _yaml_file="${_yaml_dir}/${_yaml_list[${i}]}.yaml" # Verify that the YAMLs are where we are pointed @@ -465,9 +485,13 @@ fi rm -f "tests.cron" "${_verbose_flag}" echo "Running create_experiment.py for ${#_yaml_list[@]} cases" -[[ "${_verbose}" == true ]] && printf "Selected cases: %s\n\n" "${_yaml_list[*]}" +if [[ "${_verbose}" == true ]]; then + printf "Selected cases: %s\n\n" "${_yaml_list[*]}" +fi for _case in "${_yaml_list[@]}"; do - [[ "${_verbose}" == false ]] && echo "${_case}" + if [[ "${_verbose}" == false ]]; then + echo "${_case}" + fi _pslot="${_case}${_tag}" _create_exp_cmd="./create_experiment.py -y ../ci/cases/pr/${_case}.yaml --overwrite" if [[ "${_verbose}" == true ]]; then @@ -511,7 +535,9 @@ if [[ "${_update_cron}" == "true" ]]; then if [[ "${_set_email}" == "true" ]]; then # Replace the existing email in the crontab - [[ "${_verbose}" == "true" ]] && printf "Updating crontab email to %s\n\n" "${_email}" + if [[ "${_verbose}" == "true" ]]; then + printf "Updating crontab email to %s\n\n" "${_email}" + fi sed -i "/^MAILTO/d" existing.cron echo "MAILTO=\"${_email}\"" >> final.cron fi @@ -537,7 +563,9 @@ else fi # Cleanup -[[ "${_debug}" == "false" ]] && rm -f final.cron existing.cron tests.cron "${_verbose_flag}" +if [[ "${_debug}" == "false" ]]; then + rm -f final.cron existing.cron tests.cron "${_verbose_flag}" +fi echo "Success!!" if [[ "${_set_email}" == true ]]; then From 7683ee2316d5967eee7061129c86d516632288c5 Mon Sep 17 00:00:00 2001 From: David Huber Date: Thu, 20 Feb 2025 16:06:30 +0000 Subject: [PATCH 02/16] Move all || operators into if blocks --- ci/scripts/utils/launch_java_agent.sh | 5 ++++- ctests/scripts/stage.sh.in | 4 +++- ctests/scripts/validate.sh.in | 4 +++- ush/atmos_extractvars.sh | 8 ++++++-- ush/gaussian_sfcanl.sh | 4 +++- ush/ocnice_extractvars.sh | 4 +++- ush/wave_extractvars.sh | 4 +++- 7 files changed, 25 insertions(+), 8 deletions(-) diff --git a/ci/scripts/utils/launch_java_agent.sh b/ci/scripts/utils/launch_java_agent.sh index ad79a75cbd..64da63471c 100755 --- a/ci/scripts/utils/launch_java_agent.sh +++ b/ci/scripts/utils/launch_java_agent.sh @@ -103,7 +103,10 @@ echo "JAVA VERSION: " ${JAVA} -version GH=$(command -v gh || echo "${HOME}/bin/gh") -[[ -f "${GH}" ]] || ( echo "ERROR: GitHub CLI (gh) not found. (exiting with error)"; exit 1 ) +if [[! -f "${GH}" ]]; then + echo "ERROR: GitHub CLI (gh) not found. (exiting with error)" + exit 1 +fi ${GH} --version export GH diff --git a/ctests/scripts/stage.sh.in b/ctests/scripts/stage.sh.in index ca1297b302..e4a58943a0 100755 --- a/ctests/scripts/stage.sh.in +++ b/ctests/scripts/stage.sh.in @@ -14,7 +14,9 @@ HOMEgfs="@PROJECT_SOURCE_DIR@" set +x source "${HOMEgfs}/workflow/gw_setup.sh" rc=$? -[[ "${rc}" -ne 0 ]] && exit "${status}" +if [[ "${rc}" -ne 0 ]]; then + exit "${status}" +fi set -x PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${HOMEgfs}/sorc/wxflow/src" export PYTHONPATH diff --git a/ctests/scripts/validate.sh.in b/ctests/scripts/validate.sh.in index c387098ecd..4afd71e480 100755 --- a/ctests/scripts/validate.sh.in +++ b/ctests/scripts/validate.sh.in @@ -13,7 +13,9 @@ HOMEgfs="@PROJECT_SOURCE_DIR@" set +x source "${HOMEgfs}/workflow/gw_setup.sh" rc=$? -[[ "${rc}" -ne 0 ]] && exit "${status}" +if [[ "${rc}" -ne 0 ]]; then + exit "${status}" +fi set -x PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${HOMEgfs}/sorc/wxflow/src" export PYTHONPATH diff --git a/ush/atmos_extractvars.sh b/ush/atmos_extractvars.sh index 5fea8497c6..0d0e2491ed 100755 --- a/ush/atmos_extractvars.sh +++ b/ush/atmos_extractvars.sh @@ -15,7 +15,9 @@ fcnt=1 # 1 is 1st quarter, 2 is 2nd quarter and 3 is 3rd quarter of the day dcnt=1 # lead day subdata=${1} -[[ -d "${subdata}" ]] || mkdir -p "${subdata}" +if [[! -d "${subdata}" ]]; then + mkdir -p "${subdata}" +fi for outtype in "f2d" "f3d"; do @@ -29,7 +31,9 @@ for outtype in "f2d" "f3d"; do fi outdirpre="${subdata}/${outtype}" - [[ -d "${outdirpre}" ]] || mkdir -p "${outdirpre}" + if [[! -d "${outdirpre}" ]]; then + mkdir -p "${outdirpre}" + fi if [[ "${REPLAY_ICS:-NO}" == "YES" ]]; then if [[ "${outtype}" == "f2d" ]]; then diff --git a/ush/gaussian_sfcanl.sh b/ush/gaussian_sfcanl.sh index 8b8f066cfe..a766f2e949 100755 --- a/ush/gaussian_sfcanl.sh +++ b/ush/gaussian_sfcanl.sh @@ -133,7 +133,9 @@ export REDERR=${REDERR:-'2>'} ${INISCRIPT:-} pwd=$(pwd) cd "${DATA}" || exit 99 -[[ -d "${COMOUT_ATMOS_ANALYSIS}" ]] || mkdir -p "${COMOUT_ATMOS_ANALYSIS}" +if [[! -d "${COMOUT_ATMOS_ANALYSIS}" ]]; then + mkdir -p "${COMOUT_ATMOS_ANALYSIS}" +fi ################################################################################ # Make surface analysis diff --git a/ush/ocnice_extractvars.sh b/ush/ocnice_extractvars.sh index 78c4cbd91e..c9fbdc9a62 100755 --- a/ush/ocnice_extractvars.sh +++ b/ush/ocnice_extractvars.sh @@ -19,7 +19,9 @@ datacompress=${4} fhout_ocnice=${5} comout_rfcst_prod_ocnice=${6} -[[ -d "${subdata}" ]] || mkdir -p "${subdata}" +if [[! -d "${subdata}" ]]; then + mkdir -p "${subdata}" +fi for (( nh = FHMIN_GFS + fhout_ocnice; nh <= FHMAX_GFS; nh = nh + fhout_ocnice )); do fnh=$(printf "%3.3d" "${nh}") diff --git a/ush/wave_extractvars.sh b/ush/wave_extractvars.sh index cad65f777d..16b41265dd 100755 --- a/ush/wave_extractvars.sh +++ b/ush/wave_extractvars.sh @@ -18,7 +18,9 @@ com_dir=${!com_varname} subdata=${1} -[[ -d "${subdata}" ]] || mkdir -p "${subdata}" +if [[! -d "${subdata}" ]]; then + mkdir -p "${subdata}" +fi for (( nh = FHOUT_WAV_EXTRACT; nh <= FHMAX_WAV; nh = nh + FHOUT_WAV_EXTRACT )); do fnh=$(printf "%3.3d" "${nh}") From 2f7233eb8ba8127639af702279683af8e7e9fb86 Mon Sep 17 00:00:00 2001 From: David Huber Date: Thu, 20 Feb 2025 16:22:36 +0000 Subject: [PATCH 03/16] Fix spacing --- ci/scripts/utils/launch_java_agent.sh | 2 +- ush/atmos_extractvars.sh | 4 ++-- ush/gaussian_sfcanl.sh | 2 +- ush/ocnice_extractvars.sh | 2 +- ush/wave_extractvars.sh | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ci/scripts/utils/launch_java_agent.sh b/ci/scripts/utils/launch_java_agent.sh index 64da63471c..97e11f347e 100755 --- a/ci/scripts/utils/launch_java_agent.sh +++ b/ci/scripts/utils/launch_java_agent.sh @@ -103,7 +103,7 @@ echo "JAVA VERSION: " ${JAVA} -version GH=$(command -v gh || echo "${HOME}/bin/gh") -if [[! -f "${GH}" ]]; then +if [[ ! -f "${GH}" ]]; then echo "ERROR: GitHub CLI (gh) not found. (exiting with error)" exit 1 fi diff --git a/ush/atmos_extractvars.sh b/ush/atmos_extractvars.sh index 0d0e2491ed..37cd48e789 100755 --- a/ush/atmos_extractvars.sh +++ b/ush/atmos_extractvars.sh @@ -15,7 +15,7 @@ fcnt=1 # 1 is 1st quarter, 2 is 2nd quarter and 3 is 3rd quarter of the day dcnt=1 # lead day subdata=${1} -if [[! -d "${subdata}" ]]; then +if [[ ! -d "${subdata}" ]]; then mkdir -p "${subdata}" fi @@ -31,7 +31,7 @@ for outtype in "f2d" "f3d"; do fi outdirpre="${subdata}/${outtype}" - if [[! -d "${outdirpre}" ]]; then + if [[ ! -d "${outdirpre}" ]]; then mkdir -p "${outdirpre}" fi diff --git a/ush/gaussian_sfcanl.sh b/ush/gaussian_sfcanl.sh index a766f2e949..5c60cf2bc9 100755 --- a/ush/gaussian_sfcanl.sh +++ b/ush/gaussian_sfcanl.sh @@ -133,7 +133,7 @@ export REDERR=${REDERR:-'2>'} ${INISCRIPT:-} pwd=$(pwd) cd "${DATA}" || exit 99 -if [[! -d "${COMOUT_ATMOS_ANALYSIS}" ]]; then +if [[ ! -d "${COMOUT_ATMOS_ANALYSIS}" ]]; then mkdir -p "${COMOUT_ATMOS_ANALYSIS}" fi diff --git a/ush/ocnice_extractvars.sh b/ush/ocnice_extractvars.sh index c9fbdc9a62..e6126c792c 100755 --- a/ush/ocnice_extractvars.sh +++ b/ush/ocnice_extractvars.sh @@ -19,7 +19,7 @@ datacompress=${4} fhout_ocnice=${5} comout_rfcst_prod_ocnice=${6} -if [[! -d "${subdata}" ]]; then +if [[ ! -d "${subdata}" ]]; then mkdir -p "${subdata}" fi diff --git a/ush/wave_extractvars.sh b/ush/wave_extractvars.sh index 16b41265dd..e7aa44c336 100755 --- a/ush/wave_extractvars.sh +++ b/ush/wave_extractvars.sh @@ -18,7 +18,7 @@ com_dir=${!com_varname} subdata=${1} -if [[! -d "${subdata}" ]]; then +if [[ ! -d "${subdata}" ]]; then mkdir -p "${subdata}" fi From 86ba57e66adce5da750782c87644ae1ce8d78510 Mon Sep 17 00:00:00 2001 From: David Huber Date: Thu, 20 Feb 2025 16:36:17 +0000 Subject: [PATCH 04/16] Simplify build scripts --- sorc/build_compute.sh | 2 +- workflow/build_compute.py | 2 +- workflow/build_opts.yaml | 26 +++++++++++++------------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/sorc/build_compute.sh b/sorc/build_compute.sh index 0a56c1ba13..722c0f336d 100755 --- a/sorc/build_compute.sh +++ b/sorc/build_compute.sh @@ -87,7 +87,7 @@ finished=false ${runcmd} echo "Running builds on compute nodes" while [[ "${finished}" == "false" ]]; do - sleep 3m + sleep 1m ${runcmd} state="$("${HOMEgfs}/ci/scripts/utils/rocotostat.py" -w "${build_xml}" -d "${build_db}")" if [[ "${verbose_opt}" == "true" ]]; then diff --git a/workflow/build_compute.py b/workflow/build_compute.py index 7787e9ad40..93d2c33d43 100755 --- a/workflow/build_compute.py +++ b/workflow/build_compute.py @@ -63,7 +63,7 @@ def get_task_spec(task_name: str, task_spec: Dict, host_spec: Dict) -> Dict: task_dict.task_name = task_name task_dict.cycledef = "build" task_dict.maxtries = 1 - task_dict.command = f"cd {HOMEgfs}/sorc/; {task_spec.command}" + task_dict.command = f"cd {HOMEgfs}/sorc/; {task_spec.command} -j {task_spec.cores}" task_dict.job_name = task_name task_dict.log = f"{HOMEgfs}/sorc/logs/{task_name}.log" diff --git a/workflow/build_opts.yaml b/workflow/build_opts.yaml index c17432d4a2..c83135e94e 100644 --- a/workflow/build_opts.yaml +++ b/workflow/build_opts.yaml @@ -22,61 +22,61 @@ systems: - "gefs_ww3_prepost" build: gfs_model: - command: "./build_ufs.sh -e gfs_model.x -j 12" + command: "./build_ufs.sh -e gfs_model.x" cores: 12 walltime: "00:30:00" gfs_ww3prepost: - command: "./build_ww3prepost.sh -j 4" + command: "./build_ww3prepost.sh" cores: 4 walltime: "00:10:00" gefs_model: - command: "./build_ufs.sh -w -e gefs_model.x -j 12" + command: "./build_ufs.sh -w -e gefs_model.x" cores: 12 walltime: "00:30:00" gefs_ww3_prepost: - command: "./build_ww3prepost.sh -w -j 4" + command: "./build_ww3prepost.sh -w" cores: 4 walltime: "00:10:00" sfs_model: - command: "./build_ufs.sh -y -e sfs_model.x -j 12" + command: "./build_ufs.sh -y -e sfs_model.x" cores: 12 walltime: "00:30:00" upp: - command: "./build_upp.sh -j 8" + command: "./build_upp.sh" cores: 8 walltime: "00:10:00" gsi_enkf: - command: "./build_gsi_enkf.sh -j 8" + command: "./build_gsi_enkf.sh" cores: 8 walltime: "00:15:00" gsi_monitor: - command: "./build_gsi_monitor.sh -j 4" + command: "./build_gsi_monitor.sh" cores: 4 walltime: "00:10:00" gsi_utils: - command: "./build_gsi_utils.sh -j 6" + command: "./build_gsi_utils.sh" cores: 6 walltime: "00:10:00" ufs_utils: - command: "./build_ufs_utils.sh -j 8" + command: "./build_ufs_utils.sh" cores: 8 walltime: "00:10:00" gfs_utils: - command: "./build_gfs_utils.sh -j 6" + command: "./build_gfs_utils.sh" cores: 6 walltime: "00:10:00" gdas: - command: "./build_gdas.sh -j 24" - cores: 24 + command: "./build_gdas.sh" + cores: 40 walltime: "01:30:00" From d29ec6f1689f86d9fc0364d6d4864e02fe21128a Mon Sep 17 00:00:00 2001 From: David Huber Date: Thu, 20 Feb 2025 16:56:29 +0000 Subject: [PATCH 05/16] Allow relative paths when running generate_workflows.sh --- workflow/generate_workflows.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/workflow/generate_workflows.sh b/workflow/generate_workflows.sh index a46723fe11..c7dda45ab7 100755 --- a/workflow/generate_workflows.sh +++ b/workflow/generate_workflows.sh @@ -190,6 +190,8 @@ if [[ "${_debug}" == "true" ]]; then fi # Create the RUNTESTS directory +# Start by getting the full path +_runtests="$(realpath "${_runtests}")" if [[ "${_verbose}" == "true" ]]; then printf "Creating RUNTESTS in %s\n\n" "${_runtests}" fi From f46f45b4a61c3944183fc917fc6e3faa09154117 Mon Sep 17 00:00:00 2001 From: David Huber <69919478+DavidHuber-NOAA@users.noreply.github.com> Date: Thu, 20 Feb 2025 18:10:06 +0000 Subject: [PATCH 06/16] Apply suggestions from code review Co-authored-by: Walter Kolczynski - NOAA --- ci/scripts/utils/launch_java_agent.sh | 2 +- ctests/scripts/stage.sh.in | 2 +- ctests/scripts/validate.sh.in | 2 +- docs/doxygen/compile | 2 +- env/GAEAC6.env | 2 +- env/HERCULES.env | 2 +- jobs/JGDAS_AERO_ANALYSIS_GENERATE_BMATRIX | 2 +- jobs/JGDAS_ENKF_DIAG | 2 +- jobs/JGDAS_ENKF_SELECT_OBS | 4 ++-- jobs/JGFS_ATMOS_POSTSND | 6 +++--- jobs/JGLOBAL_ATM_PREP_IODA_OBS | 3 ++- 11 files changed, 15 insertions(+), 14 deletions(-) diff --git a/ci/scripts/utils/launch_java_agent.sh b/ci/scripts/utils/launch_java_agent.sh index 97e11f347e..93f33f6025 100755 --- a/ci/scripts/utils/launch_java_agent.sh +++ b/ci/scripts/utils/launch_java_agent.sh @@ -104,7 +104,7 @@ ${JAVA} -version GH=$(command -v gh || echo "${HOME}/bin/gh") if [[ ! -f "${GH}" ]]; then - echo "ERROR: GitHub CLI (gh) not found. (exiting with error)" + echo "FATAL ERROR: GitHub CLI (gh) not found. (exiting with error)" exit 1 fi ${GH} --version diff --git a/ctests/scripts/stage.sh.in b/ctests/scripts/stage.sh.in index e4a58943a0..acff167231 100755 --- a/ctests/scripts/stage.sh.in +++ b/ctests/scripts/stage.sh.in @@ -15,7 +15,7 @@ set +x source "${HOMEgfs}/workflow/gw_setup.sh" rc=$? if [[ "${rc}" -ne 0 ]]; then - exit "${status}" + exit "${rc}" fi set -x PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${HOMEgfs}/sorc/wxflow/src" diff --git a/ctests/scripts/validate.sh.in b/ctests/scripts/validate.sh.in index 4afd71e480..f21f97bd65 100755 --- a/ctests/scripts/validate.sh.in +++ b/ctests/scripts/validate.sh.in @@ -14,7 +14,7 @@ set +x source "${HOMEgfs}/workflow/gw_setup.sh" rc=$? if [[ "${rc}" -ne 0 ]]; then - exit "${status}" + exit "${rc}" fi set -x PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${HOMEgfs}/sorc/wxflow/src" diff --git a/docs/doxygen/compile b/docs/doxygen/compile index 883acf9698..cc43994ccb 100755 --- a/docs/doxygen/compile +++ b/docs/doxygen/compile @@ -16,7 +16,7 @@ else echo "trying system doxygen" doxygen=$(which doxygen) rc=$? - if [[ $rc -ne 0 ]]; then + if [[ "${rc}" -ne 0 ]]; then echo "doxygen not found, ABORT!" exit 1 fi diff --git a/env/GAEAC6.env b/env/GAEAC6.env index 5e70b66e3e..0ffd680498 100755 --- a/env/GAEAC6.env +++ b/env/GAEAC6.env @@ -53,7 +53,7 @@ case ${step} in "waveinit" | "waveprep" | "wavepostsbs" | "wavepostbndpnt" | "wavepostpnt" | "wavepostbndpntbll") export CFP_MP="YES" - if [[ "${step}" = "waveprep" ]]; then + if [[ "${step}" == "waveprep" ]]; then export MP_PULSE=0 fi export wavempexec=${launcher} diff --git a/env/HERCULES.env b/env/HERCULES.env index 9321b58e1b..f054df2ab8 100755 --- a/env/HERCULES.env +++ b/env/HERCULES.env @@ -61,7 +61,7 @@ case ${step} in "waveinit" | "waveprep" | "wavepostsbs" | "wavepostbndpnt" | "wavepostpnt" | "wavepostbndpntbll") export CFP_MP="YES" - if [[ "${step}" = "waveprep" ]]; then + if [[ "${step}" == "waveprep" ]]; then export MP_PULSE=0 fi export wavempexec=${launcher} diff --git a/jobs/JGDAS_AERO_ANALYSIS_GENERATE_BMATRIX b/jobs/JGDAS_AERO_ANALYSIS_GENERATE_BMATRIX index 8e5b44f24c..69e607f0fb 100755 --- a/jobs/JGDAS_AERO_ANALYSIS_GENERATE_BMATRIX +++ b/jobs/JGDAS_AERO_ANALYSIS_GENERATE_BMATRIX @@ -43,7 +43,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || exit 1 -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGDAS_ENKF_DIAG b/jobs/JGDAS_ENKF_DIAG index 43b2f69c61..be6891fbf6 100755 --- a/jobs/JGDAS_ENKF_DIAG +++ b/jobs/JGDAS_ENKF_DIAG @@ -91,7 +91,7 @@ export SETUP_INVOBS="passive_bc=.false.,${SETUP_INVOBS}" # Ensure clean stat tarballs for ensemble mean for fstat in ${CNVSTAT} ${OZNSTAT} ${RADSTAT}; do - if [[ -f ${fstat} ]]; then + if [[ -f "${fstat}" ]]; then rm -f ${fstat} fi done diff --git a/jobs/JGDAS_ENKF_SELECT_OBS b/jobs/JGDAS_ENKF_SELECT_OBS index 15c6b54500..bfd036d323 100755 --- a/jobs/JGDAS_ENKF_SELECT_OBS +++ b/jobs/JGDAS_ENKF_SELECT_OBS @@ -113,8 +113,8 @@ export SETUP_INVOBS="passive_bc=.false.,${SETUP_INVOBS}" # Ensure clean stat tarballs for ensemble mean for fstat in ${CNVSTAT} ${OZNSTAT} ${RADSTAT}; do - if [[ -f ${fstat} ]]; then - rm -f ${fstat} + if [[ -f "${fstat}" ]]; then + rm -f "${fstat}" fi done diff --git a/jobs/JGFS_ATMOS_POSTSND b/jobs/JGFS_ATMOS_POSTSND index 11ba684a05..9737d2d2be 100755 --- a/jobs/JGFS_ATMOS_POSTSND +++ b/jobs/JGFS_ATMOS_POSTSND @@ -24,13 +24,13 @@ export DBNROOT=${DBNROOT:-${UTILROOT}/fakedbn} YMD=${PDY} HH=${cyc} declare_from_tmpl -rx COM_ATMOS_HISTORY COM_ATMOS_BUFR \ COM_ATMOS_WMO COM_ATMOS_GEMPAK -if [[ ! -d ${COM_ATMOS_BUFR} ]]; then +if [[ ! -d "${COM_ATMOS_BUFR}" ]]; then mkdir -p "${COM_ATMOS_BUFR}" fi -if [[ ! -d ${COM_ATMOS_GEMPAK} ]]; then +if [[ ! -d "${COM_ATMOS_GEMPAK}" ]]; then mkdir -p "${COM_ATMOS_GEMPAK}" fi -if [[ ! -d ${COM_ATMOS_WMO} ]]; then +if [[ ! -d "${COM_ATMOS_WMO}" ]]; then mkdir -p "${COM_ATMOS_WMO}" fi diff --git a/jobs/JGLOBAL_ATM_PREP_IODA_OBS b/jobs/JGLOBAL_ATM_PREP_IODA_OBS index 1e731dead7..09636a2fb5 100755 --- a/jobs/JGLOBAL_ATM_PREP_IODA_OBS +++ b/jobs/JGLOBAL_ATM_PREP_IODA_OBS @@ -21,7 +21,8 @@ EXSCRIPT=${BUFR2IODASH:-${USHgfs}/run_bufr2ioda.py} ${EXSCRIPT} "${PDY}${cyc}" "${RUN}" "${DMPDIR}" "${PARMgfs}/gdas/ioda/bufr2ioda" "${COM_OBS}/" status=$? if [[ ${status} -ne 0 ]]; then - (echo "FATAL ERROR: Error executing ${EXSCRIPT}, ABORT!"; exit "${status}") + echo "FATAL ERROR: Error executing ${EXSCRIPT}" + exit "${status}" fi ############################################## From 548d305c627b815385c3e6e998f347f5ffd26992 Mon Sep 17 00:00:00 2001 From: David Huber Date: Thu, 20 Feb 2025 18:19:24 +0000 Subject: [PATCH 07/16] Double-quote DATA variables --- jobs/JGDAS_ATMOS_ANALYSIS_DIAG | 10 +++++----- jobs/JGDAS_ATMOS_CHGRES_FORENKF | 6 +++--- jobs/JGDAS_ENKF_ARCHIVE_TARS | 2 +- jobs/JGDAS_ENKF_ARCHIVE_VRFY | 2 +- jobs/JGDAS_ENKF_DIAG | 6 +++--- jobs/JGDAS_ENKF_ECEN | 6 +++--- jobs/JGDAS_ENKF_POST | 6 +++--- jobs/JGDAS_ENKF_SELECT_OBS | 6 +++--- jobs/JGDAS_ENKF_SFC | 6 +++--- jobs/JGDAS_ENKF_UPDATE | 6 +++--- jobs/JGDAS_FIT2OBS | 2 +- jobs/JGFS_ATMOS_CYCLONE_GENESIS | 6 +++--- jobs/JGFS_ATMOS_CYCLONE_TRACKER | 8 ++++---- jobs/JGFS_ATMOS_FSU_GENESIS | 6 +++--- jobs/JGFS_ATMOS_POSTSND | 6 +++--- jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE | 2 +- jobs/JGLOBAL_ARCHIVE_TARS | 2 +- jobs/JGLOBAL_ARCHIVE_VRFY | 2 +- jobs/JGLOBAL_ATMENS_ANALYSIS_FINALIZE | 2 +- jobs/JGLOBAL_ATMOS_ANALYSIS | 6 +++--- jobs/JGLOBAL_ATMOS_ANALYSIS_CALC | 6 +++--- jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP | 6 +++--- jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC | 6 +++--- jobs/JGLOBAL_ATM_ANALYSIS_FINALIZE | 2 +- jobs/JGLOBAL_FETCH | 2 +- jobs/JGLOBAL_PREP_OCEAN_OBS | 2 +- jobs/JGLOBAL_SNOW_ANALYSIS | 2 +- jobs/JGLOBAL_STAGE_IC | 2 +- jobs/JGLOBAL_WAVE_GEMPAK | 4 ++-- jobs/JGLOBAL_WAVE_INIT | 6 +++--- jobs/JGLOBAL_WAVE_POST_BNDPNT | 6 +++--- jobs/JGLOBAL_WAVE_POST_BNDPNTBLL | 6 +++--- jobs/JGLOBAL_WAVE_POST_PNT | 6 +++--- jobs/JGLOBAL_WAVE_POST_SBS | 6 +++--- jobs/JGLOBAL_WAVE_PRDGEN_BULLS | 4 ++-- jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED | 4 ++-- jobs/JGLOBAL_WAVE_PREP | 6 +++--- 37 files changed, 87 insertions(+), 87 deletions(-) diff --git a/jobs/JGDAS_ATMOS_ANALYSIS_DIAG b/jobs/JGDAS_ATMOS_ANALYSIS_DIAG index 5f57390409..306b914c5c 100755 --- a/jobs/JGDAS_ATMOS_ANALYSIS_DIAG +++ b/jobs/JGDAS_ATMOS_ANALYSIS_DIAG @@ -36,7 +36,7 @@ mkdir -m 775 -p "${COMOUT_ATMOS_ANALYSIS}" ${ANALDIAGSH:-${SCRgfs}/exglobal_diag.sh} status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi @@ -48,15 +48,15 @@ fi # Final processing ############################################## if [[ -e "${pgmout}" ]] ; then - cat ${pgmout} + cat "${pgmout}" fi ########################################## # Remove the Temporary working directory ########################################## -cd ${DATAROOT} -if [[ ${KEEPDATA} = "NO" ]]; then - rm -rf ${DATA} +cd "${DATAROOT}" || true +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" fi diff --git a/jobs/JGDAS_ATMOS_CHGRES_FORENKF b/jobs/JGDAS_ATMOS_CHGRES_FORENKF index 94bfa91509..ee2bc775aa 100755 --- a/jobs/JGDAS_ATMOS_CHGRES_FORENKF +++ b/jobs/JGDAS_ATMOS_CHGRES_FORENKF @@ -43,9 +43,9 @@ fi ########################################## # Remove the Temporary working directory ########################################## -cd ${DATAROOT} -if [[ ${KEEPDATA} = "NO" ]]; then - rm -rf ${DATA} +cd "${DATAROOT}" || true +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" fi diff --git a/jobs/JGDAS_ENKF_ARCHIVE_TARS b/jobs/JGDAS_ENKF_ARCHIVE_TARS index d390e87422..02e59f8bf7 100755 --- a/jobs/JGDAS_ENKF_ARCHIVE_TARS +++ b/jobs/JGDAS_ENKF_ARCHIVE_TARS @@ -41,7 +41,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || (echo "${DATAROOT} does not exist. ABORT!"; exit 1) -if [[ ${KEEPDATA} = "NO" ]]; then +if [[ "${KEEPDATA}" = "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGDAS_ENKF_ARCHIVE_VRFY b/jobs/JGDAS_ENKF_ARCHIVE_VRFY index 15b251a0a3..4bfff30539 100755 --- a/jobs/JGDAS_ENKF_ARCHIVE_VRFY +++ b/jobs/JGDAS_ENKF_ARCHIVE_VRFY @@ -40,7 +40,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || (echo "${DATAROOT} does not exist. ABORT!"; exit 1) -if [[ ${KEEPDATA} = "NO" ]]; then +if [[ "${KEEPDATA}" = "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGDAS_ENKF_DIAG b/jobs/JGDAS_ENKF_DIAG index be6891fbf6..534743ce2e 100755 --- a/jobs/JGDAS_ENKF_DIAG +++ b/jobs/JGDAS_ENKF_DIAG @@ -121,9 +121,9 @@ fi ########################################## # Remove the Temporary working directory ########################################## -cd ${DATAROOT} -if [[ ${KEEPDATA} = "NO" ]]; then - rm -rf ${DATA} +cd "${DATAROOT}" || true +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" fi diff --git a/jobs/JGDAS_ENKF_ECEN b/jobs/JGDAS_ENKF_ECEN index 46add490bf..b254199507 100755 --- a/jobs/JGDAS_ENKF_ECEN +++ b/jobs/JGDAS_ENKF_ECEN @@ -62,9 +62,9 @@ fi ########################################## # Remove the Temporary working directory ########################################## -cd ${DATAROOT} -if [[ ${KEEPDATA} = "NO" ]]; then - rm -rf ${DATA} +cd "${DATAROOT}" || true +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" fi diff --git a/jobs/JGDAS_ENKF_POST b/jobs/JGDAS_ENKF_POST index d9fe5edc6f..2a7500733c 100755 --- a/jobs/JGDAS_ENKF_POST +++ b/jobs/JGDAS_ENKF_POST @@ -43,9 +43,9 @@ fi ########################################## # Remove the Temporary working directory ########################################## -cd ${DATAROOT} -if [[ ${KEEPDATA} = "NO" ]]; then - rm -rf ${DATA} +cd "${DATAROOT}" || true +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" fi diff --git a/jobs/JGDAS_ENKF_SELECT_OBS b/jobs/JGDAS_ENKF_SELECT_OBS index bfd036d323..acb0b85ff4 100755 --- a/jobs/JGDAS_ENKF_SELECT_OBS +++ b/jobs/JGDAS_ENKF_SELECT_OBS @@ -151,9 +151,9 @@ fi ########################################## # Remove the Temporary working directory ########################################## -cd ${DATAROOT} -if [[ ${KEEPDATA} = "NO" ]]; then - rm -rf ${DATA} +cd "${DATAROOT}" || true +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" fi diff --git a/jobs/JGDAS_ENKF_SFC b/jobs/JGDAS_ENKF_SFC index f030b23ad6..3754a377ce 100755 --- a/jobs/JGDAS_ENKF_SFC +++ b/jobs/JGDAS_ENKF_SFC @@ -63,9 +63,9 @@ fi ########################################## # Remove the Temporary working directory ########################################## -cd ${DATAROOT} -if [[ ${KEEPDATA} = "NO" ]]; then - rm -rf ${DATA} +cd "${DATAROOT}" || true +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" fi diff --git a/jobs/JGDAS_ENKF_UPDATE b/jobs/JGDAS_ENKF_UPDATE index 05e1f60736..4edf089820 100755 --- a/jobs/JGDAS_ENKF_UPDATE +++ b/jobs/JGDAS_ENKF_UPDATE @@ -63,9 +63,9 @@ fi ########################################## # Remove the Temporary working directory ########################################## -cd ${DATAROOT} -if [[ ${KEEPDATA} = "NO" ]]; then - rm -rf ${DATA} +cd "${DATAROOT}" || true +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" fi diff --git a/jobs/JGDAS_FIT2OBS b/jobs/JGDAS_FIT2OBS index 87633f70dc..f6fc656c21 100755 --- a/jobs/JGDAS_FIT2OBS +++ b/jobs/JGDAS_FIT2OBS @@ -93,7 +93,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || (echo "FATAL ERROR: ${DATAROOT} does not exist. ABORT!"; exit 1) -if [[ ${KEEPDATA} = "NO" ]]; then +if [[ "${KEEPDATA}" = "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGFS_ATMOS_CYCLONE_GENESIS b/jobs/JGFS_ATMOS_CYCLONE_GENESIS index bf20b953a8..a5dd1002e0 100755 --- a/jobs/JGFS_ATMOS_CYCLONE_GENESIS +++ b/jobs/JGFS_ATMOS_CYCLONE_GENESIS @@ -62,9 +62,9 @@ fi ########################################## # Remove the Temporary working directory ########################################## -cd ${DATAROOT} -if [[ ${KEEPDATA} = "NO" ]]; then - rm -rf ${DATA} +cd "${DATAROOT}" || true +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" fi diff --git a/jobs/JGFS_ATMOS_CYCLONE_TRACKER b/jobs/JGFS_ATMOS_CYCLONE_TRACKER index 750e099a00..84d306c3ef 100755 --- a/jobs/JGFS_ATMOS_CYCLONE_TRACKER +++ b/jobs/JGFS_ATMOS_CYCLONE_TRACKER @@ -73,7 +73,7 @@ export err=$?; err_chk #------------------------------------------------ machine=${machine:-$(echo ${SITE})} -${USHens_tracker}/extrkr_gfs.sh ${loopnum} ${cmodel} ${CDATE} ${pert} ${DATA} +${USHens_tracker}/extrkr_gfs.sh ${loopnum} ${cmodel} ${CDATE} ${pert} "${DATA}" export err=$?; err_chk @@ -95,9 +95,9 @@ fi ########################################## # Remove the Temporary working directory ########################################## -cd ${DATAROOT} -if [[ ${KEEPDATA} = "NO" ]]; then - rm -rf ${DATA} +cd "${DATAROOT}" || true +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" fi diff --git a/jobs/JGFS_ATMOS_FSU_GENESIS b/jobs/JGFS_ATMOS_FSU_GENESIS index 7f244c19f7..f32817a282 100755 --- a/jobs/JGFS_ATMOS_FSU_GENESIS +++ b/jobs/JGFS_ATMOS_FSU_GENESIS @@ -69,9 +69,9 @@ fi ########################################## # Remove the Temporary working directory ########################################## -cd ${DATAROOT} -if [[ ${KEEPDATA} = "NO" ]]; then - rm -rf ${DATA} +cd "${DATAROOT}" || true +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" fi diff --git a/jobs/JGFS_ATMOS_POSTSND b/jobs/JGFS_ATMOS_POSTSND index 9737d2d2be..8dbf009f70 100755 --- a/jobs/JGFS_ATMOS_POSTSND +++ b/jobs/JGFS_ATMOS_POSTSND @@ -58,9 +58,9 @@ fi ########################################## # Remove the Temporary working directory ########################################## -cd ${DATAROOT} -if [[ ${KEEPDATA} = "NO" ]]; then - rm -rf ${DATA} +cd "${DATAROOT}" || true +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE b/jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE index 1f9818c712..f6be1710bc 100755 --- a/jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE +++ b/jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE @@ -43,7 +43,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || exit 1 -if [[ ${KEEPDATA} = "NO" ]]; then +if [[ "${KEEPDATA}" = "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_ARCHIVE_TARS b/jobs/JGLOBAL_ARCHIVE_TARS index 3cfe90f3c1..462fdd8fe3 100755 --- a/jobs/JGLOBAL_ARCHIVE_TARS +++ b/jobs/JGLOBAL_ARCHIVE_TARS @@ -92,7 +92,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || (echo "${DATAROOT} does not exist. ABORT!"; exit 1) -if [[ ${KEEPDATA} = "NO" ]]; then +if [[ "${KEEPDATA}" = "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_ARCHIVE_VRFY b/jobs/JGLOBAL_ARCHIVE_VRFY index e04796f661..2c5e2c4166 100755 --- a/jobs/JGLOBAL_ARCHIVE_VRFY +++ b/jobs/JGLOBAL_ARCHIVE_VRFY @@ -47,7 +47,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || (echo "${DATAROOT} does not exist. ABORT!"; exit 1) -if [[ ${KEEPDATA} = "NO" ]]; then +if [[ "${KEEPDATA}" = "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_ATMENS_ANALYSIS_FINALIZE b/jobs/JGLOBAL_ATMENS_ANALYSIS_FINALIZE index 244b4fb278..61ff399a4f 100755 --- a/jobs/JGLOBAL_ATMENS_ANALYSIS_FINALIZE +++ b/jobs/JGLOBAL_ATMENS_ANALYSIS_FINALIZE @@ -45,7 +45,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || ( echo "FATAL ERROR: ${DATAROOT} does not exist, ABORT!"; exit 1 ) -if [[ ${KEEPDATA} = "NO" ]]; then +if [[ "${KEEPDATA}" = "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_ATMOS_ANALYSIS b/jobs/JGLOBAL_ATMOS_ANALYSIS index 780e58cd66..cfb39c2d15 100755 --- a/jobs/JGLOBAL_ATMOS_ANALYSIS +++ b/jobs/JGLOBAL_ATMOS_ANALYSIS @@ -121,9 +121,9 @@ fi ########################################## # Remove the Temporary working directory ########################################## -cd ${DATAROOT} -if [[ ${KEEPDATA} = "NO" ]]; then - rm -rf ${DATA} +cd "${DATAROOT}" || true +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC b/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC index f61523b607..6d1d108fed 100755 --- a/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC +++ b/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC @@ -82,9 +82,9 @@ fi ########################################## # Remove the Temporary working directory ########################################## -cd ${DATAROOT} -if [[ ${KEEPDATA} = "NO" ]]; then - rm -rf ${DATA} +cd "${DATAROOT}" || true +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP b/jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP index 45e8d7479d..44bf3430ff 100755 --- a/jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP +++ b/jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP @@ -54,9 +54,9 @@ fi ########################################## # Remove the Temporary working directory ########################################## -cd ${DATAROOT} -if [[ ${KEEPDATA} = "NO" ]]; then - rm -rf ${DATA} +cd "${DATAROOT}" || true +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC b/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC index 1b2b8140de..837f4c4ee6 100755 --- a/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC +++ b/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC @@ -58,9 +58,9 @@ fi ########################################## # Remove the Temporary working directory ########################################## -cd ${DATAROOT} -if [[ ${KEEPDATA} = "NO" ]]; then - rm -rf ${DATA} +cd "${DATAROOT}" || true +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_ATM_ANALYSIS_FINALIZE b/jobs/JGLOBAL_ATM_ANALYSIS_FINALIZE index 3979aa9a5a..d195aaffd2 100755 --- a/jobs/JGLOBAL_ATM_ANALYSIS_FINALIZE +++ b/jobs/JGLOBAL_ATM_ANALYSIS_FINALIZE @@ -55,7 +55,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || ( echo "FATAL ERROR: ${DATAROOT} does not exist, ABORT!"; exit 1 ) -if [[ ${KEEPDATA} = "NO" ]]; then +if [[ "${KEEPDATA}" = "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_FETCH b/jobs/JGLOBAL_FETCH index 9f4281056f..d26ffad4e9 100755 --- a/jobs/JGLOBAL_FETCH +++ b/jobs/JGLOBAL_FETCH @@ -18,7 +18,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || (echo "${DATAROOT} does not exist. ABORT!"; exit 1) -if [[ ${KEEPDATA} = "NO" ]]; then +if [[ "${KEEPDATA}" = "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_PREP_OCEAN_OBS b/jobs/JGLOBAL_PREP_OCEAN_OBS index f689551a42..2c45e10d4b 100755 --- a/jobs/JGLOBAL_PREP_OCEAN_OBS +++ b/jobs/JGLOBAL_PREP_OCEAN_OBS @@ -40,7 +40,7 @@ fi # Handle the temporary working directory ########################################## cd "${DATAROOT}" || (echo "FATAL ERROR: ${DATAROOT} does not exist. ABORT!"; exit 1) -if [[ ${KEEPDATA} = "NO" ]]; then +if [[ "${KEEPDATA}" = "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_SNOW_ANALYSIS b/jobs/JGLOBAL_SNOW_ANALYSIS index f8539e4bc6..e5ac5cda7e 100755 --- a/jobs/JGLOBAL_SNOW_ANALYSIS +++ b/jobs/JGLOBAL_SNOW_ANALYSIS @@ -52,7 +52,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || exit 1 -if [[ ${KEEPDATA} = "NO" ]]; then +if [[ "${KEEPDATA}" = "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_STAGE_IC b/jobs/JGLOBAL_STAGE_IC index 4c25d7f95d..100b5c6962 100755 --- a/jobs/JGLOBAL_STAGE_IC +++ b/jobs/JGLOBAL_STAGE_IC @@ -18,7 +18,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || (echo "${DATAROOT} does not exist. ABORT!"; exit 1) -if [[ ${KEEPDATA} = "NO" ]]; then +if [[ "${KEEPDATA}" = "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_WAVE_GEMPAK b/jobs/JGLOBAL_WAVE_GEMPAK index 849ada900f..8f85b890a8 100755 --- a/jobs/JGLOBAL_WAVE_GEMPAK +++ b/jobs/JGLOBAL_WAVE_GEMPAK @@ -39,9 +39,9 @@ fi ################################### # Remove temp directories -cd ${DATAROOT} +cd "${DATAROOT}" || true if [ "${KEEPDATA}" != "YES" ]; then - rm -rf ${DATA} + rm -rf "${DATA}" fi exit 0 diff --git a/jobs/JGLOBAL_WAVE_INIT b/jobs/JGLOBAL_WAVE_INIT index f49840c98c..b0dcbb95fb 100755 --- a/jobs/JGLOBAL_WAVE_INIT +++ b/jobs/JGLOBAL_WAVE_INIT @@ -25,9 +25,9 @@ ${SCRgfs}/exgfs_wave_init.sh ########################################## # Remove the Temporary working directory ########################################## -cd ${DATAROOT} -if [[ ${KEEPDATA} = "NO" ]]; then - rm -rf ${DATA} +cd "${DATAROOT}" || true +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_WAVE_POST_BNDPNT b/jobs/JGLOBAL_WAVE_POST_BNDPNT index 313f1a4490..17f81a5226 100755 --- a/jobs/JGLOBAL_WAVE_POST_BNDPNT +++ b/jobs/JGLOBAL_WAVE_POST_BNDPNT @@ -41,9 +41,9 @@ fi ########################################## # Remove the Temporary working directory ########################################## -cd ${DATAROOT} -if [[ ${KEEPDATA} = "NO" ]]; then - rm -rf ${DATA} +cd "${DATAROOT}" || true +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL b/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL index ef09a50348..d7c24cb9e3 100755 --- a/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL +++ b/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL @@ -45,9 +45,9 @@ fi ########################################## # Remove the Temporary working directory ########################################## -cd ${DATAROOT} -if [[ ${KEEPDATA} = "NO" ]]; then - rm -rf ${DATA} +cd "${DATAROOT}" || true +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_WAVE_POST_PNT b/jobs/JGLOBAL_WAVE_POST_PNT index a85915f237..5b9c9843c2 100755 --- a/jobs/JGLOBAL_WAVE_POST_PNT +++ b/jobs/JGLOBAL_WAVE_POST_PNT @@ -42,9 +42,9 @@ fi ########################################## # Remove the Temporary working directory ########################################## -cd ${DATAROOT} -if [[ ${KEEPDATA} = "NO" ]]; then - rm -rf ${DATA} +cd "${DATAROOT}" || true +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_WAVE_POST_SBS b/jobs/JGLOBAL_WAVE_POST_SBS index 56afdc8854..419eb3690f 100755 --- a/jobs/JGLOBAL_WAVE_POST_SBS +++ b/jobs/JGLOBAL_WAVE_POST_SBS @@ -51,9 +51,9 @@ fi ########################################## # Remove the Temporary working directory ########################################## -cd ${DATAROOT} -if [[ ${KEEPDATA} = "NO" ]]; then - rm -rf ${DATA} +cd "${DATAROOT}" || true +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_WAVE_PRDGEN_BULLS b/jobs/JGLOBAL_WAVE_PRDGEN_BULLS index b57dfe524f..32ce5bf234 100755 --- a/jobs/JGLOBAL_WAVE_PRDGEN_BULLS +++ b/jobs/JGLOBAL_WAVE_PRDGEN_BULLS @@ -30,9 +30,9 @@ fi ################################### # Remove temp directories -cd ${DATAROOT} +cd "${DATAROOT}" || true if [ "${KEEPDATA}" != "YES" ]; then - rm -rf ${DATA} + rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED b/jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED index acf49f9301..3ad09f4bf7 100755 --- a/jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED +++ b/jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED @@ -42,9 +42,9 @@ fi ################################### # Remove temp directories ################################### -cd ${DATAROOT} +cd "${DATAROOT}" || true if [ "${KEEPDATA}" != "YES" ]; then - rm -rf ${DATA} + rm -rf "${DATA}" fi exit 0 diff --git a/jobs/JGLOBAL_WAVE_PREP b/jobs/JGLOBAL_WAVE_PREP index b391901c42..c9fdde9727 100755 --- a/jobs/JGLOBAL_WAVE_PREP +++ b/jobs/JGLOBAL_WAVE_PREP @@ -28,9 +28,9 @@ ${SCRgfs}/exgfs_wave_prep.sh ########################################## # Remove the Temporary working directory ########################################## -cd ${DATAROOT} -if [[ ${KEEPDATA} = "NO" ]]; then - rm -rf ${DATA} +cd "${DATAROOT}" || true +if [[ "${KEEPDATA}" = "NO" ]]; then + rm -rf "${DATA}" fi From 10bedbc9174a90ffafa828c970efdcec85d4e1f5 Mon Sep 17 00:00:00 2001 From: David Huber Date: Thu, 20 Feb 2025 18:21:06 +0000 Subject: [PATCH 08/16] More double quotes --- ci/scripts/driver.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/scripts/driver.sh b/ci/scripts/driver.sh index 4c3f837b2c..2698fb41ab 100755 --- a/ci/scripts/driver.sh +++ b/ci/scripts/driver.sh @@ -77,7 +77,7 @@ pr_list=$(${GH} pr list --repo "${REPO_URL}" --label "CI-${MACHINE_ID^}-Ready" - for pr in ${pr_list}; do pr_dir="${GFS_CI_ROOT}/PR/${pr}" - if [[ ! -d ${pr_dir} ]]; then + if [[ ! -d "${pr_dir}" ]]; then mkdir -p "${pr_dir}" fi db_list=$("${ROOT_DIR}/ci/scripts/utils/pr_list_database.py" --add_pr "${pr}" --dbfile "${pr_list_dbfile}") From 2d7deaa6f2f3c949f148a34f1a182e7d121ff157 Mon Sep 17 00:00:00 2001 From: David Huber Date: Thu, 20 Feb 2025 18:23:55 +0000 Subject: [PATCH 09/16] Use double equals --- jobs/JGDAS_ATMOS_ANALYSIS_DIAG | 2 +- jobs/JGDAS_ATMOS_CHGRES_FORENKF | 2 +- jobs/JGDAS_ATMOS_VERFOZN | 2 +- jobs/JGDAS_ATMOS_VERFRAD | 2 +- jobs/JGDAS_ENKF_ARCHIVE_TARS | 2 +- jobs/JGDAS_ENKF_ARCHIVE_VRFY | 2 +- jobs/JGDAS_ENKF_DIAG | 2 +- jobs/JGDAS_ENKF_ECEN | 2 +- jobs/JGDAS_ENKF_POST | 2 +- jobs/JGDAS_ENKF_SELECT_OBS | 2 +- jobs/JGDAS_ENKF_SFC | 2 +- jobs/JGDAS_ENKF_UPDATE | 2 +- jobs/JGDAS_FIT2OBS | 2 +- jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_ECEN | 2 +- jobs/JGFS_ATMOS_CYCLONE_GENESIS | 2 +- jobs/JGFS_ATMOS_CYCLONE_TRACKER | 2 +- jobs/JGFS_ATMOS_FSU_GENESIS | 2 +- jobs/JGFS_ATMOS_POSTSND | 2 +- jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE | 2 +- jobs/JGLOBAL_ARCHIVE_TARS | 2 +- jobs/JGLOBAL_ARCHIVE_VRFY | 2 +- jobs/JGLOBAL_ATMENS_ANALYSIS_FINALIZE | 2 +- jobs/JGLOBAL_ATMOS_ANALYSIS | 2 +- jobs/JGLOBAL_ATMOS_ANALYSIS_CALC | 2 +- jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP | 2 +- jobs/JGLOBAL_ATMOS_ENSSTAT | 2 +- jobs/JGLOBAL_ATMOS_PRODUCTS | 2 +- jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC | 2 +- jobs/JGLOBAL_ATMOS_UPP | 2 +- jobs/JGLOBAL_ATMOS_VMINMON | 2 +- jobs/JGLOBAL_ATM_ANALYSIS_FINALIZE | 2 +- jobs/JGLOBAL_EXTRACTVARS | 2 +- jobs/JGLOBAL_FETCH | 2 +- jobs/JGLOBAL_MARINE_ANALYSIS_FINALIZE | 2 +- jobs/JGLOBAL_MARINE_ANALYSIS_LETKF | 2 +- jobs/JGLOBAL_PREP_OBS_AERO | 2 +- jobs/JGLOBAL_PREP_OCEAN_OBS | 2 +- jobs/JGLOBAL_SNOWENS_ANALYSIS | 2 +- jobs/JGLOBAL_SNOW_ANALYSIS | 2 +- jobs/JGLOBAL_STAGE_IC | 2 +- jobs/JGLOBAL_WAVE_INIT | 2 +- jobs/JGLOBAL_WAVE_POST_BNDPNT | 2 +- jobs/JGLOBAL_WAVE_POST_BNDPNTBLL | 2 +- jobs/JGLOBAL_WAVE_POST_PNT | 2 +- jobs/JGLOBAL_WAVE_POST_SBS | 2 +- jobs/JGLOBAL_WAVE_PREP | 2 +- 46 files changed, 46 insertions(+), 46 deletions(-) diff --git a/jobs/JGDAS_ATMOS_ANALYSIS_DIAG b/jobs/JGDAS_ATMOS_ANALYSIS_DIAG index 306b914c5c..bb92af0983 100755 --- a/jobs/JGDAS_ATMOS_ANALYSIS_DIAG +++ b/jobs/JGDAS_ATMOS_ANALYSIS_DIAG @@ -55,7 +55,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || true -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGDAS_ATMOS_CHGRES_FORENKF b/jobs/JGDAS_ATMOS_CHGRES_FORENKF index ee2bc775aa..3eebf23184 100755 --- a/jobs/JGDAS_ATMOS_CHGRES_FORENKF +++ b/jobs/JGDAS_ATMOS_CHGRES_FORENKF @@ -44,7 +44,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || true -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGDAS_ATMOS_VERFOZN b/jobs/JGDAS_ATMOS_VERFOZN index 510bd9f752..906b15e664 100755 --- a/jobs/JGDAS_ATMOS_VERFOZN +++ b/jobs/JGDAS_ATMOS_VERFOZN @@ -38,7 +38,7 @@ fi ################################ # Remove the Working Directory ################################ -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGDAS_ATMOS_VERFRAD b/jobs/JGDAS_ATMOS_VERFRAD index 2520250490..69784df9fa 100755 --- a/jobs/JGDAS_ATMOS_VERFRAD +++ b/jobs/JGDAS_ATMOS_VERFRAD @@ -41,7 +41,7 @@ fi ################################ # Remove the Working Directory ################################ -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGDAS_ENKF_ARCHIVE_TARS b/jobs/JGDAS_ENKF_ARCHIVE_TARS index 02e59f8bf7..804df1eafa 100755 --- a/jobs/JGDAS_ENKF_ARCHIVE_TARS +++ b/jobs/JGDAS_ENKF_ARCHIVE_TARS @@ -41,7 +41,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || (echo "${DATAROOT} does not exist. ABORT!"; exit 1) -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGDAS_ENKF_ARCHIVE_VRFY b/jobs/JGDAS_ENKF_ARCHIVE_VRFY index 4bfff30539..600075a870 100755 --- a/jobs/JGDAS_ENKF_ARCHIVE_VRFY +++ b/jobs/JGDAS_ENKF_ARCHIVE_VRFY @@ -40,7 +40,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || (echo "${DATAROOT} does not exist. ABORT!"; exit 1) -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGDAS_ENKF_DIAG b/jobs/JGDAS_ENKF_DIAG index 534743ce2e..e746702f8c 100755 --- a/jobs/JGDAS_ENKF_DIAG +++ b/jobs/JGDAS_ENKF_DIAG @@ -122,7 +122,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || true -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGDAS_ENKF_ECEN b/jobs/JGDAS_ENKF_ECEN index b254199507..e8a6fd07b0 100755 --- a/jobs/JGDAS_ENKF_ECEN +++ b/jobs/JGDAS_ENKF_ECEN @@ -63,7 +63,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || true -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGDAS_ENKF_POST b/jobs/JGDAS_ENKF_POST index 2a7500733c..481751b740 100755 --- a/jobs/JGDAS_ENKF_POST +++ b/jobs/JGDAS_ENKF_POST @@ -44,7 +44,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || true -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGDAS_ENKF_SELECT_OBS b/jobs/JGDAS_ENKF_SELECT_OBS index acb0b85ff4..2378746d72 100755 --- a/jobs/JGDAS_ENKF_SELECT_OBS +++ b/jobs/JGDAS_ENKF_SELECT_OBS @@ -152,7 +152,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || true -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGDAS_ENKF_SFC b/jobs/JGDAS_ENKF_SFC index 3754a377ce..13b7f36225 100755 --- a/jobs/JGDAS_ENKF_SFC +++ b/jobs/JGDAS_ENKF_SFC @@ -64,7 +64,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || true -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGDAS_ENKF_UPDATE b/jobs/JGDAS_ENKF_UPDATE index 4edf089820..8174cbe256 100755 --- a/jobs/JGDAS_ENKF_UPDATE +++ b/jobs/JGDAS_ENKF_UPDATE @@ -64,7 +64,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || true -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGDAS_FIT2OBS b/jobs/JGDAS_FIT2OBS index f6fc656c21..5b12b7ba88 100755 --- a/jobs/JGDAS_FIT2OBS +++ b/jobs/JGDAS_FIT2OBS @@ -93,7 +93,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || (echo "FATAL ERROR: ${DATAROOT} does not exist. ABORT!"; exit 1) -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_ECEN b/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_ECEN index 976d17c1b0..3a5ea3a79f 100755 --- a/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_ECEN +++ b/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_ECEN @@ -54,7 +54,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || exit 1 -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGFS_ATMOS_CYCLONE_GENESIS b/jobs/JGFS_ATMOS_CYCLONE_GENESIS index a5dd1002e0..690c174cf7 100755 --- a/jobs/JGFS_ATMOS_CYCLONE_GENESIS +++ b/jobs/JGFS_ATMOS_CYCLONE_GENESIS @@ -63,7 +63,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || true -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGFS_ATMOS_CYCLONE_TRACKER b/jobs/JGFS_ATMOS_CYCLONE_TRACKER index 84d306c3ef..09925d2309 100755 --- a/jobs/JGFS_ATMOS_CYCLONE_TRACKER +++ b/jobs/JGFS_ATMOS_CYCLONE_TRACKER @@ -96,7 +96,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || true -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGFS_ATMOS_FSU_GENESIS b/jobs/JGFS_ATMOS_FSU_GENESIS index f32817a282..4b8d67d4c1 100755 --- a/jobs/JGFS_ATMOS_FSU_GENESIS +++ b/jobs/JGFS_ATMOS_FSU_GENESIS @@ -70,7 +70,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || true -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGFS_ATMOS_POSTSND b/jobs/JGFS_ATMOS_POSTSND index 8dbf009f70..2a630b87c1 100755 --- a/jobs/JGFS_ATMOS_POSTSND +++ b/jobs/JGFS_ATMOS_POSTSND @@ -59,7 +59,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || true -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE b/jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE index f6be1710bc..b553c70e7e 100755 --- a/jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE +++ b/jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE @@ -43,7 +43,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || exit 1 -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_ARCHIVE_TARS b/jobs/JGLOBAL_ARCHIVE_TARS index 462fdd8fe3..69794a3123 100755 --- a/jobs/JGLOBAL_ARCHIVE_TARS +++ b/jobs/JGLOBAL_ARCHIVE_TARS @@ -92,7 +92,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || (echo "${DATAROOT} does not exist. ABORT!"; exit 1) -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_ARCHIVE_VRFY b/jobs/JGLOBAL_ARCHIVE_VRFY index 2c5e2c4166..67f55a36bb 100755 --- a/jobs/JGLOBAL_ARCHIVE_VRFY +++ b/jobs/JGLOBAL_ARCHIVE_VRFY @@ -47,7 +47,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || (echo "${DATAROOT} does not exist. ABORT!"; exit 1) -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_ATMENS_ANALYSIS_FINALIZE b/jobs/JGLOBAL_ATMENS_ANALYSIS_FINALIZE index 61ff399a4f..bca4d022de 100755 --- a/jobs/JGLOBAL_ATMENS_ANALYSIS_FINALIZE +++ b/jobs/JGLOBAL_ATMENS_ANALYSIS_FINALIZE @@ -45,7 +45,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || ( echo "FATAL ERROR: ${DATAROOT} does not exist, ABORT!"; exit 1 ) -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_ATMOS_ANALYSIS b/jobs/JGLOBAL_ATMOS_ANALYSIS index cfb39c2d15..5ace5953aa 100755 --- a/jobs/JGLOBAL_ATMOS_ANALYSIS +++ b/jobs/JGLOBAL_ATMOS_ANALYSIS @@ -122,7 +122,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || true -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC b/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC index 6d1d108fed..2e26827360 100755 --- a/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC +++ b/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC @@ -83,7 +83,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || true -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP b/jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP index 44bf3430ff..d9c2ccf5de 100755 --- a/jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP +++ b/jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP @@ -55,7 +55,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || true -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_ATMOS_ENSSTAT b/jobs/JGLOBAL_ATMOS_ENSSTAT index 1fc406cfe4..7bad01b369 100755 --- a/jobs/JGLOBAL_ATMOS_ENSSTAT +++ b/jobs/JGLOBAL_ATMOS_ENSSTAT @@ -42,7 +42,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || exit 1 -if [[ "${KEEPDATA:-NO}" = "NO" ]]; then +if [[ "${KEEPDATA:-NO}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_ATMOS_PRODUCTS b/jobs/JGLOBAL_ATMOS_PRODUCTS index efe82e2ce4..345ae21334 100755 --- a/jobs/JGLOBAL_ATMOS_PRODUCTS +++ b/jobs/JGLOBAL_ATMOS_PRODUCTS @@ -41,7 +41,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || exit 1 -if [[ "${KEEPDATA:-NO}" = "NO" ]]; then +if [[ "${KEEPDATA:-NO}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC b/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC index 837f4c4ee6..9a29228a38 100755 --- a/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC +++ b/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC @@ -59,7 +59,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || true -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_ATMOS_UPP b/jobs/JGLOBAL_ATMOS_UPP index f838534732..c7727aeeb2 100755 --- a/jobs/JGLOBAL_ATMOS_UPP +++ b/jobs/JGLOBAL_ATMOS_UPP @@ -41,7 +41,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || exit 1 -if [[ "${KEEPDATA:-NO}" = "NO" ]]; then +if [[ "${KEEPDATA:-NO}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_ATMOS_VMINMON b/jobs/JGLOBAL_ATMOS_VMINMON index a999aa4e03..e63797dc58 100755 --- a/jobs/JGLOBAL_ATMOS_VMINMON +++ b/jobs/JGLOBAL_ATMOS_VMINMON @@ -41,7 +41,7 @@ fi ################################ # Remove the Working Directory ################################ -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_ATM_ANALYSIS_FINALIZE b/jobs/JGLOBAL_ATM_ANALYSIS_FINALIZE index d195aaffd2..76f029562f 100755 --- a/jobs/JGLOBAL_ATM_ANALYSIS_FINALIZE +++ b/jobs/JGLOBAL_ATM_ANALYSIS_FINALIZE @@ -55,7 +55,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || ( echo "FATAL ERROR: ${DATAROOT} does not exist, ABORT!"; exit 1 ) -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_EXTRACTVARS b/jobs/JGLOBAL_EXTRACTVARS index 9b0b114eaa..c28942820f 100755 --- a/jobs/JGLOBAL_EXTRACTVARS +++ b/jobs/JGLOBAL_EXTRACTVARS @@ -47,7 +47,7 @@ status=$? # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || true -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_FETCH b/jobs/JGLOBAL_FETCH index d26ffad4e9..b6905756af 100755 --- a/jobs/JGLOBAL_FETCH +++ b/jobs/JGLOBAL_FETCH @@ -18,7 +18,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || (echo "${DATAROOT} does not exist. ABORT!"; exit 1) -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_MARINE_ANALYSIS_FINALIZE b/jobs/JGLOBAL_MARINE_ANALYSIS_FINALIZE index 7cc9b052f4..61fdec49d3 100755 --- a/jobs/JGLOBAL_MARINE_ANALYSIS_FINALIZE +++ b/jobs/JGLOBAL_MARINE_ANALYSIS_FINALIZE @@ -41,7 +41,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || exit 1 -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_MARINE_ANALYSIS_LETKF b/jobs/JGLOBAL_MARINE_ANALYSIS_LETKF index ec81ff435f..2b9ac62d59 100755 --- a/jobs/JGLOBAL_MARINE_ANALYSIS_LETKF +++ b/jobs/JGLOBAL_MARINE_ANALYSIS_LETKF @@ -60,7 +60,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || exit 1 -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_PREP_OBS_AERO b/jobs/JGLOBAL_PREP_OBS_AERO index ecb52fd227..1bf14a4139 100755 --- a/jobs/JGLOBAL_PREP_OBS_AERO +++ b/jobs/JGLOBAL_PREP_OBS_AERO @@ -40,7 +40,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || exit -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_PREP_OCEAN_OBS b/jobs/JGLOBAL_PREP_OCEAN_OBS index 2c45e10d4b..c9796576c1 100755 --- a/jobs/JGLOBAL_PREP_OCEAN_OBS +++ b/jobs/JGLOBAL_PREP_OCEAN_OBS @@ -40,7 +40,7 @@ fi # Handle the temporary working directory ########################################## cd "${DATAROOT}" || (echo "FATAL ERROR: ${DATAROOT} does not exist. ABORT!"; exit 1) -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_SNOWENS_ANALYSIS b/jobs/JGLOBAL_SNOWENS_ANALYSIS index f98b91b1d9..ff27bdf794 100755 --- a/jobs/JGLOBAL_SNOWENS_ANALYSIS +++ b/jobs/JGLOBAL_SNOWENS_ANALYSIS @@ -65,7 +65,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || exit 1 -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_SNOW_ANALYSIS b/jobs/JGLOBAL_SNOW_ANALYSIS index e5ac5cda7e..e820e36a65 100755 --- a/jobs/JGLOBAL_SNOW_ANALYSIS +++ b/jobs/JGLOBAL_SNOW_ANALYSIS @@ -52,7 +52,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || exit 1 -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_STAGE_IC b/jobs/JGLOBAL_STAGE_IC index 100b5c6962..63f441fa55 100755 --- a/jobs/JGLOBAL_STAGE_IC +++ b/jobs/JGLOBAL_STAGE_IC @@ -18,7 +18,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || (echo "${DATAROOT} does not exist. ABORT!"; exit 1) -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_WAVE_INIT b/jobs/JGLOBAL_WAVE_INIT index b0dcbb95fb..6fffbb09eb 100755 --- a/jobs/JGLOBAL_WAVE_INIT +++ b/jobs/JGLOBAL_WAVE_INIT @@ -26,7 +26,7 @@ ${SCRgfs}/exgfs_wave_init.sh # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || true -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_WAVE_POST_BNDPNT b/jobs/JGLOBAL_WAVE_POST_BNDPNT index 17f81a5226..69c738c4ae 100755 --- a/jobs/JGLOBAL_WAVE_POST_BNDPNT +++ b/jobs/JGLOBAL_WAVE_POST_BNDPNT @@ -42,7 +42,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || true -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL b/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL index d7c24cb9e3..4d99b38bdd 100755 --- a/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL +++ b/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL @@ -46,7 +46,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || true -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_WAVE_POST_PNT b/jobs/JGLOBAL_WAVE_POST_PNT index 5b9c9843c2..6871cba152 100755 --- a/jobs/JGLOBAL_WAVE_POST_PNT +++ b/jobs/JGLOBAL_WAVE_POST_PNT @@ -43,7 +43,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || true -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_WAVE_POST_SBS b/jobs/JGLOBAL_WAVE_POST_SBS index 419eb3690f..0f3a819878 100755 --- a/jobs/JGLOBAL_WAVE_POST_SBS +++ b/jobs/JGLOBAL_WAVE_POST_SBS @@ -52,7 +52,7 @@ fi # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || true -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_WAVE_PREP b/jobs/JGLOBAL_WAVE_PREP index c9fdde9727..ba5761365d 100755 --- a/jobs/JGLOBAL_WAVE_PREP +++ b/jobs/JGLOBAL_WAVE_PREP @@ -29,7 +29,7 @@ ${SCRgfs}/exgfs_wave_prep.sh # Remove the Temporary working directory ########################################## cd "${DATAROOT}" || true -if [[ "${KEEPDATA}" = "NO" ]]; then +if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi From c8449a8feb43a1789454c84ad1865b79ebcf5001 Mon Sep 17 00:00:00 2001 From: David Huber Date: Thu, 20 Feb 2025 18:25:11 +0000 Subject: [PATCH 10/16] Double-quote exit variables --- jobs/JGDAS_ATMOS_CHGRES_FORENKF | 2 +- jobs/JGDAS_ENKF_DIAG | 2 +- jobs/JGDAS_ENKF_ECEN | 2 +- jobs/JGDAS_ENKF_POST | 2 +- jobs/JGDAS_ENKF_SELECT_OBS | 2 +- jobs/JGDAS_ENKF_SFC | 2 +- jobs/JGDAS_ENKF_UPDATE | 2 +- jobs/JGFS_ATMOS_POSTSND | 2 +- jobs/JGLOBAL_ATMOS_ANALYSIS | 4 ++-- jobs/JGLOBAL_ATMOS_ANALYSIS_CALC | 4 ++-- jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP | 2 +- jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC | 2 +- jobs/JGLOBAL_WAVE_GEMPAK | 2 +- jobs/JGLOBAL_WAVE_PRDGEN_BULLS | 2 +- jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED | 2 +- 15 files changed, 17 insertions(+), 17 deletions(-) diff --git a/jobs/JGDAS_ATMOS_CHGRES_FORENKF b/jobs/JGDAS_ATMOS_CHGRES_FORENKF index 3eebf23184..7309b03cdf 100755 --- a/jobs/JGDAS_ATMOS_CHGRES_FORENKF +++ b/jobs/JGDAS_ATMOS_CHGRES_FORENKF @@ -25,7 +25,7 @@ MEMDIR="mem001" YMD=${PDY} HH=${cyc} declare_from_tmpl -rx COM_ATMOS_HISTORY_MEM ${CHGRESFCSTSH:-${SCRgfs}/exgdas_atmos_chgres_forenkf.sh} status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi diff --git a/jobs/JGDAS_ENKF_DIAG b/jobs/JGDAS_ENKF_DIAG index e746702f8c..ee50432530 100755 --- a/jobs/JGDAS_ENKF_DIAG +++ b/jobs/JGDAS_ENKF_DIAG @@ -103,7 +103,7 @@ done ${ANALDIAGSH:-${SCRgfs}/exglobal_diag.sh} status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi diff --git a/jobs/JGDAS_ENKF_ECEN b/jobs/JGDAS_ENKF_ECEN index e8a6fd07b0..a6a5e6877f 100755 --- a/jobs/JGDAS_ENKF_ECEN +++ b/jobs/JGDAS_ENKF_ECEN @@ -44,7 +44,7 @@ MEMDIR="ensstat" RUN=${GDUMP} YMD=${gPDY} HH=${gcyc} declare_from_tmpl -rx \ ${ENKFRECENSH:-${SCRgfs}/exgdas_enkf_ecen.sh} status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi diff --git a/jobs/JGDAS_ENKF_POST b/jobs/JGDAS_ENKF_POST index 481751b740..7dc5873d1d 100755 --- a/jobs/JGDAS_ENKF_POST +++ b/jobs/JGDAS_ENKF_POST @@ -25,7 +25,7 @@ export LEVS=$((LEVS-1)) ${ENKFPOSTSH:-${SCRgfs}/exgdas_enkf_post.sh} status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi diff --git a/jobs/JGDAS_ENKF_SELECT_OBS b/jobs/JGDAS_ENKF_SELECT_OBS index 2378746d72..ffb4cb2f50 100755 --- a/jobs/JGDAS_ENKF_SELECT_OBS +++ b/jobs/JGDAS_ENKF_SELECT_OBS @@ -125,7 +125,7 @@ done ${INVOBSSH:-${SCRgfs}/exgdas_enkf_select_obs.sh} status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi diff --git a/jobs/JGDAS_ENKF_SFC b/jobs/JGDAS_ENKF_SFC index 13b7f36225..3f30950349 100755 --- a/jobs/JGDAS_ENKF_SFC +++ b/jobs/JGDAS_ENKF_SFC @@ -45,7 +45,7 @@ RUN=${GDUMP} YMD=${gPDY} HH=${gcyc} declare_from_tmpl -rx \ ${ENKFRESFCSH:-${SCRgfs}/exgdas_enkf_sfc.sh} status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi diff --git a/jobs/JGDAS_ENKF_UPDATE b/jobs/JGDAS_ENKF_UPDATE index 8174cbe256..49390d4306 100755 --- a/jobs/JGDAS_ENKF_UPDATE +++ b/jobs/JGDAS_ENKF_UPDATE @@ -37,7 +37,7 @@ MEMDIR="ensstat" RUN="enkfgdas" YMD=${gPDY} HH=${gcyc} declare_from_tmpl -rx \ ${ENKFUPDSH:-${SCRgfs}/exgdas_enkf_update.sh} status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi diff --git a/jobs/JGFS_ATMOS_POSTSND b/jobs/JGFS_ATMOS_POSTSND index 2a630b87c1..f69047ccd3 100755 --- a/jobs/JGFS_ATMOS_POSTSND +++ b/jobs/JGFS_ATMOS_POSTSND @@ -40,7 +40,7 @@ fi ${SCRgfs}/exgfs_atmos_postsnd.sh status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi diff --git a/jobs/JGLOBAL_ATMOS_ANALYSIS b/jobs/JGLOBAL_ATMOS_ANALYSIS index 5ace5953aa..9ed56da7d6 100755 --- a/jobs/JGLOBAL_ATMOS_ANALYSIS +++ b/jobs/JGLOBAL_ATMOS_ANALYSIS @@ -54,7 +54,7 @@ fi export LEVS=$(${NCLEN} ${ATMGES} pfull) status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi @@ -93,7 +93,7 @@ fi ${ANALYSISSH:-${SCRgfs}/exglobal_atmos_analysis.sh} status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi diff --git a/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC b/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC index 2e26827360..892b7a750f 100755 --- a/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC +++ b/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC @@ -50,7 +50,7 @@ fi export LEVS=$(${NCLEN} ${ATMGES} pfull) status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi @@ -64,7 +64,7 @@ export DOGAUSFCANL=${DOGAUSFCANL:-"YES"} ${ANALCALCSH:-${SCRgfs}/exglobal_atmos_analysis_calc.sh} status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi diff --git a/jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP b/jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP index d9c2ccf5de..c129131d89 100755 --- a/jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP +++ b/jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP @@ -37,7 +37,7 @@ export BLENDED_ICE_FILE_m6hrs=${BLENDED_ICE_FILE_m6hrs:-${COMIN_m6hrs}/${RUN}.${ ${EMCSFCPREPSH:-${SCRgfs}/exemcsfc_global_sfc_prep.sh} status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi ############################################## diff --git a/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC b/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC index 9a29228a38..d93b47fff3 100755 --- a/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC +++ b/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC @@ -44,7 +44,7 @@ export BKGFREQ=1 # for hourly relocation ${TROPCYQCRELOSH:-${SCRgfs}/exglobal_atmos_tropcy_qc_reloc.sh} status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi diff --git a/jobs/JGLOBAL_WAVE_GEMPAK b/jobs/JGLOBAL_WAVE_GEMPAK index 8f85b890a8..75c67c5192 100755 --- a/jobs/JGLOBAL_WAVE_GEMPAK +++ b/jobs/JGLOBAL_WAVE_GEMPAK @@ -34,7 +34,7 @@ if [[ ! -d ${COMOUT_WAVE_GEMPAK} ]]; then mkdir -p "${COMOUT_WAVE_GEMPAK}"; fi ${SCRgfs}/exgfs_wave_nawips.sh status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi ################################### diff --git a/jobs/JGLOBAL_WAVE_PRDGEN_BULLS b/jobs/JGLOBAL_WAVE_PRDGEN_BULLS index 32ce5bf234..1587ebf850 100755 --- a/jobs/JGLOBAL_WAVE_PRDGEN_BULLS +++ b/jobs/JGLOBAL_WAVE_PRDGEN_BULLS @@ -25,7 +25,7 @@ if [[ ! -d ${COMOUT_WAVE_WMO} ]]; then mkdir -p "${COMOUT_WAVE_WMO}"; fi ${SCRgfs}/exgfs_wave_prdgen_bulls.sh status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi ################################### diff --git a/jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED b/jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED index 3ad09f4bf7..933610fb42 100755 --- a/jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED +++ b/jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED @@ -36,7 +36,7 @@ fi ${SCRgfs}/exgfs_wave_prdgen_gridded.sh status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi ################################### From 0591486f4b1176f7a859b10aae64fd3db55700a3 Mon Sep 17 00:00:00 2001 From: David Huber Date: Thu, 20 Feb 2025 18:26:44 +0000 Subject: [PATCH 11/16] More exit double quotes --- jobs/JGLOBAL_WAVE_POST_BNDPNT | 2 +- jobs/JGLOBAL_WAVE_POST_BNDPNTBLL | 2 +- jobs/JGLOBAL_WAVE_POST_SBS | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jobs/JGLOBAL_WAVE_POST_BNDPNT b/jobs/JGLOBAL_WAVE_POST_BNDPNT index 69c738c4ae..fcddd92f69 100755 --- a/jobs/JGLOBAL_WAVE_POST_BNDPNT +++ b/jobs/JGLOBAL_WAVE_POST_BNDPNT @@ -35,7 +35,7 @@ ${SCRgfs}/exgfs_wave_post_pnt.sh err=$? if [ ${err} -ne 0 ]; then echo "FATAL ERROR: ex-script of GWES_POST failed!" - exit ${err} + exit "${err}" fi ########################################## diff --git a/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL b/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL index 4d99b38bdd..05ad4708b5 100755 --- a/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL +++ b/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL @@ -39,7 +39,7 @@ ${SCRgfs}/exgfs_wave_post_pnt.sh err=$? if [ ${err} -ne 0 ]; then echo "FATAL ERROR: ex-script of GFS_WAVE_POST_PNT failed!" - exit ${err} + exit "${err}" fi ########################################## diff --git a/jobs/JGLOBAL_WAVE_POST_SBS b/jobs/JGLOBAL_WAVE_POST_SBS index 0f3a819878..fc4b1d0c54 100755 --- a/jobs/JGLOBAL_WAVE_POST_SBS +++ b/jobs/JGLOBAL_WAVE_POST_SBS @@ -45,7 +45,7 @@ ${SCRgfs}/exgfs_wave_post_gridded_sbs.sh err=$? if [ ${err} -ne 0 ]; then echo "FATAL ERROR: ex-script of GWES_POST failed!" - exit ${err} + exit "${err}" fi ########################################## From 61bf9b1f820af688be2ad0fcac536533f35bcca5 Mon Sep 17 00:00:00 2001 From: David Huber Date: Thu, 20 Feb 2025 18:32:27 +0000 Subject: [PATCH 12/16] Double-quote exit variables and double equal logical operators --- jobs/rocoto/anal.sh | 2 +- jobs/rocoto/analcalc.sh | 4 ++-- jobs/rocoto/analdiag.sh | 4 ++-- jobs/rocoto/ecen.sh | 4 ++-- jobs/rocoto/echgres.sh | 4 ++-- jobs/rocoto/ediag.sh | 4 ++-- jobs/rocoto/eobs.sh | 2 +- jobs/rocoto/epos.sh | 4 ++-- jobs/rocoto/esfc.sh | 4 ++-- jobs/rocoto/eupd.sh | 2 +- jobs/rocoto/fcst.sh | 4 ++-- jobs/rocoto/postsnd.sh | 4 ++-- jobs/rocoto/prep.sh | 10 +++++----- jobs/rocoto/sfcanl.sh | 4 ++-- jobs/rocoto/upp.sh | 2 +- jobs/rocoto/waveawipsbulls.sh | 2 +- jobs/rocoto/waveawipsgridded.sh | 4 ++-- jobs/rocoto/waveinit.sh | 4 ++-- jobs/rocoto/wavepostbndpnt.sh | 4 ++-- jobs/rocoto/wavepostbndpntbll.sh | 4 ++-- jobs/rocoto/wavepostpnt.sh | 4 ++-- jobs/rocoto/waveprep.sh | 4 ++-- 22 files changed, 42 insertions(+), 42 deletions(-) diff --git a/jobs/rocoto/anal.sh b/jobs/rocoto/anal.sh index a8f7c524cd..b241cd5c1b 100755 --- a/jobs/rocoto/anal.sh +++ b/jobs/rocoto/anal.sh @@ -7,7 +7,7 @@ source "${HOMEgfs}/ush/preamble.sh" . ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi export job="anal" diff --git a/jobs/rocoto/analcalc.sh b/jobs/rocoto/analcalc.sh index 0865d2c951..7a0c852c63 100755 --- a/jobs/rocoto/analcalc.sh +++ b/jobs/rocoto/analcalc.sh @@ -7,7 +7,7 @@ source "${HOMEgfs}/ush/preamble.sh" . ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi export job="analcalc" @@ -19,4 +19,4 @@ ${HOMEgfs}/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC status=$? -exit ${status} +exit "${status}" diff --git a/jobs/rocoto/analdiag.sh b/jobs/rocoto/analdiag.sh index 248dbe646f..d866c8dde9 100755 --- a/jobs/rocoto/analdiag.sh +++ b/jobs/rocoto/analdiag.sh @@ -7,7 +7,7 @@ source "${HOMEgfs}/ush/preamble.sh" . ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi export job="analdiag" @@ -19,4 +19,4 @@ ${HOMEgfs}/jobs/JGDAS_ATMOS_ANALYSIS_DIAG status=$? -exit ${status} +exit "${status}" diff --git a/jobs/rocoto/ecen.sh b/jobs/rocoto/ecen.sh index 25562e10ee..475b3e81a0 100755 --- a/jobs/rocoto/ecen.sh +++ b/jobs/rocoto/ecen.sh @@ -7,7 +7,7 @@ source "${HOMEgfs}/ush/preamble.sh" . ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi ############################################################### @@ -24,7 +24,7 @@ for fhr in ${fhrlst}; do ${HOMEgfs}/jobs/JGDAS_ENKF_ECEN status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi done diff --git a/jobs/rocoto/echgres.sh b/jobs/rocoto/echgres.sh index b339b7d0e1..3368c4aa3b 100755 --- a/jobs/rocoto/echgres.sh +++ b/jobs/rocoto/echgres.sh @@ -7,7 +7,7 @@ source "${HOMEgfs}/ush/preamble.sh" . ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi export job="echgres" @@ -19,4 +19,4 @@ ${HOMEgfs}/jobs/JGDAS_ATMOS_CHGRES_FORENKF status=$? -exit ${status} +exit "${status}" diff --git a/jobs/rocoto/ediag.sh b/jobs/rocoto/ediag.sh index 0c5a13de5f..e78f44d67a 100755 --- a/jobs/rocoto/ediag.sh +++ b/jobs/rocoto/ediag.sh @@ -7,7 +7,7 @@ source "${HOMEgfs}/ush/preamble.sh" . ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi export job="ediag" @@ -19,4 +19,4 @@ ${HOMEgfs}/jobs/JGDAS_ENKF_DIAG status=$? -exit ${status} +exit "${status}" diff --git a/jobs/rocoto/eobs.sh b/jobs/rocoto/eobs.sh index dfe7c9260b..3b124d49a4 100755 --- a/jobs/rocoto/eobs.sh +++ b/jobs/rocoto/eobs.sh @@ -7,7 +7,7 @@ source "${HOMEgfs}/ush/preamble.sh" . ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi export job="eobs" diff --git a/jobs/rocoto/epos.sh b/jobs/rocoto/epos.sh index ee979af1c8..f298df1a13 100755 --- a/jobs/rocoto/epos.sh +++ b/jobs/rocoto/epos.sh @@ -7,7 +7,7 @@ source "${HOMEgfs}/ush/preamble.sh" . ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi export job="epos" @@ -25,7 +25,7 @@ for fhr in ${fhrlst}; do ${HOMEgfs}/jobs/JGDAS_ENKF_POST status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi done diff --git a/jobs/rocoto/esfc.sh b/jobs/rocoto/esfc.sh index 88dda818fa..99e13d6e43 100755 --- a/jobs/rocoto/esfc.sh +++ b/jobs/rocoto/esfc.sh @@ -7,7 +7,7 @@ source "${HOMEgfs}/ush/preamble.sh" . ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi export job="esfc" @@ -19,4 +19,4 @@ ${HOMEgfs}/jobs/JGDAS_ENKF_SFC status=$? -exit ${status} +exit "${status}" diff --git a/jobs/rocoto/eupd.sh b/jobs/rocoto/eupd.sh index 9abe4aa678..8752474b78 100755 --- a/jobs/rocoto/eupd.sh +++ b/jobs/rocoto/eupd.sh @@ -7,7 +7,7 @@ source "${HOMEgfs}/ush/preamble.sh" . ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi export job="eupd" diff --git a/jobs/rocoto/fcst.sh b/jobs/rocoto/fcst.sh index f99d2bd63f..4d3e340655 100755 --- a/jobs/rocoto/fcst.sh +++ b/jobs/rocoto/fcst.sh @@ -13,7 +13,7 @@ else fi status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi export job="fcst" @@ -23,4 +23,4 @@ export jobid="${job}.$$" "${HOMEgfs}/jobs/JGLOBAL_FORECAST" status=$? -exit ${status} +exit "${status}" diff --git a/jobs/rocoto/postsnd.sh b/jobs/rocoto/postsnd.sh index 066c5118ca..8e7ba1547e 100755 --- a/jobs/rocoto/postsnd.sh +++ b/jobs/rocoto/postsnd.sh @@ -8,7 +8,7 @@ source "${HOMEgfs}/ush/preamble.sh" . ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi export job="postsnd" @@ -20,5 +20,5 @@ ${HOMEgfs}/jobs/JGFS_ATMOS_POSTSND status=$? -exit ${status} +exit "${status}" diff --git a/jobs/rocoto/prep.sh b/jobs/rocoto/prep.sh index 4c58a139d5..d26059d0ad 100755 --- a/jobs/rocoto/prep.sh +++ b/jobs/rocoto/prep.sh @@ -7,7 +7,7 @@ source "${HOMEgfs}/ush/preamble.sh" . ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi ############################################################### @@ -45,7 +45,7 @@ if [[ ${ROTDIR_DUMP} = "YES" ]]; then "${HOMEgfs}/ush/getdump.sh" "${PDY}${cyc}" "${RUN_local}" "${COM_OBSDMP}" "${COM_OBS}" status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi # Ensure previous cycle gdas dumps are available (used by cycle & downstream) @@ -53,7 +53,7 @@ if [[ ${ROTDIR_DUMP} = "YES" ]]; then "${HOMEgfs}/ush/getdump.sh" "${GDATE}" "${GDUMP}" "${COM_OBSDMP_PREV}" "${COM_OBS_PREV}" status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi fi # exception handling to ensure no dead link @@ -89,7 +89,7 @@ if [[ ${PROCESS_TROPCY} = "YES" ]]; then "${HOMEgfs}/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC" status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi else @@ -126,7 +126,7 @@ if [[ ${MAKE_PREPBUFR} = "YES" ]]; then "${HOMEobsproc}/jobs/JOBSPROC_GLOBAL_PREP" status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi # If creating NSSTBUFR was disabled, copy from DMPDIR if appropriate. diff --git a/jobs/rocoto/sfcanl.sh b/jobs/rocoto/sfcanl.sh index fa0dc5090c..f70b8b4ac7 100755 --- a/jobs/rocoto/sfcanl.sh +++ b/jobs/rocoto/sfcanl.sh @@ -7,7 +7,7 @@ source "${HOMEgfs}/ush/preamble.sh" . ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi export job="sfcanl" @@ -19,4 +19,4 @@ ${HOMEgfs}/jobs/JGLOBAL_ATMOS_SFCANL status=$? -exit ${status} +exit "${status}" diff --git a/jobs/rocoto/upp.sh b/jobs/rocoto/upp.sh index a4133608d1..1f14df0197 100755 --- a/jobs/rocoto/upp.sh +++ b/jobs/rocoto/upp.sh @@ -14,7 +14,7 @@ source "${HOMEgfs}/ush/preamble.sh" #if (( status != 0 )); then exit "${status}"; fi # Temporarily load modules from UPP on WCOSS2 source "${HOMEgfs}/ush/detect_machine.sh" -if [[ "${MACHINE_ID}" = "wcoss2" ]]; then +if [[ "${MACHINE_ID}" == "wcoss2" ]]; then set +x source "${HOMEgfs}/ush/module-setup.sh" module use "${HOMEgfs}/sorc/ufs_model.fd/FV3/upp/modulefiles" diff --git a/jobs/rocoto/waveawipsbulls.sh b/jobs/rocoto/waveawipsbulls.sh index 84e974e3a7..6d33e665b5 100755 --- a/jobs/rocoto/waveawipsbulls.sh +++ b/jobs/rocoto/waveawipsbulls.sh @@ -7,7 +7,7 @@ source "$HOMEgfs/ush/preamble.sh" source ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi export job="waveawipsbulls" diff --git a/jobs/rocoto/waveawipsgridded.sh b/jobs/rocoto/waveawipsgridded.sh index 70e4dbeb07..472d917c60 100755 --- a/jobs/rocoto/waveawipsgridded.sh +++ b/jobs/rocoto/waveawipsgridded.sh @@ -7,7 +7,7 @@ source "$HOMEgfs/ush/preamble.sh" source ${HOMEgfs}/ush/load_fv3gfs_modules.sh status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi export job="waveawipsgridded" @@ -19,4 +19,4 @@ ${HOMEgfs}/jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED status=$? -exit ${status} +exit "${status}" diff --git a/jobs/rocoto/waveinit.sh b/jobs/rocoto/waveinit.sh index 31e2fcd685..0684c0fd34 100755 --- a/jobs/rocoto/waveinit.sh +++ b/jobs/rocoto/waveinit.sh @@ -9,7 +9,7 @@ echo "=============== START TO SOURCE FV3GFS WORKFLOW MODULES ===============" . ${HOMEgfs}/ush/load_ufswm_modules.sh status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi export job="waveinit" @@ -22,7 +22,7 @@ echo "=============== START TO RUN WAVE INIT ===============" ${HOMEgfs}/jobs/JGLOBAL_WAVE_INIT status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi exit 0 diff --git a/jobs/rocoto/wavepostbndpnt.sh b/jobs/rocoto/wavepostbndpnt.sh index 68324d4a40..fd85b5eecc 100755 --- a/jobs/rocoto/wavepostbndpnt.sh +++ b/jobs/rocoto/wavepostbndpnt.sh @@ -9,7 +9,7 @@ echo "=============== START TO SOURCE FV3GFS WORKFLOW MODULES ===============" . ${HOMEgfs}/ush/load_ufswm_modules.sh status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi export job="wavepostbndpnt" @@ -22,7 +22,7 @@ echo "=============== START TO RUN WAVE_POST_BNDPNT ===============" ${HOMEgfs}/jobs/JGLOBAL_WAVE_POST_BNDPNT status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi exit 0 diff --git a/jobs/rocoto/wavepostbndpntbll.sh b/jobs/rocoto/wavepostbndpntbll.sh index 069a86a23e..fa2f2a0fce 100755 --- a/jobs/rocoto/wavepostbndpntbll.sh +++ b/jobs/rocoto/wavepostbndpntbll.sh @@ -9,7 +9,7 @@ echo "=============== START TO SOURCE FV3GFS WORKFLOW MODULES ===============" . ${HOMEgfs}/ush/load_ufswm_modules.sh status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi export job="wavepostbndpntbll" @@ -22,7 +22,7 @@ echo "=============== START TO RUN WAVE_POST_BNDPNT ===============" ${HOMEgfs}/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi exit 0 diff --git a/jobs/rocoto/wavepostpnt.sh b/jobs/rocoto/wavepostpnt.sh index 063805f107..c330cebcaa 100755 --- a/jobs/rocoto/wavepostpnt.sh +++ b/jobs/rocoto/wavepostpnt.sh @@ -9,7 +9,7 @@ echo "=============== START TO SOURCE FV3GFS WORKFLOW MODULES ===============" . ${HOMEgfs}/ush/load_ufswm_modules.sh status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi export job="wavepostpnt" @@ -22,7 +22,7 @@ echo "=============== START TO RUN WAVE_POST_PNT ===============" ${HOMEgfs}/jobs/JGLOBAL_WAVE_POST_PNT status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi exit 0 diff --git a/jobs/rocoto/waveprep.sh b/jobs/rocoto/waveprep.sh index c985f02ccd..82b888ef8a 100755 --- a/jobs/rocoto/waveprep.sh +++ b/jobs/rocoto/waveprep.sh @@ -9,7 +9,7 @@ echo "=============== START TO SOURCE FV3GFS WORKFLOW MODULES ===============" . ${HOMEgfs}/ush/load_ufswm_modules.sh status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi export job="waveprep" @@ -22,7 +22,7 @@ echo "=============== START TO RUN WAVE PREP ===============" ${HOMEgfs}/jobs/JGLOBAL_WAVE_PREP status=$? if [[ ${status} -ne 0 ]]; then - exit ${status} + exit "${status}" fi exit 0 From 77f94f301a490141765edc55fa8e05effa11b5e0 Mon Sep 17 00:00:00 2001 From: David Huber Date: Thu, 20 Feb 2025 18:39:05 +0000 Subject: [PATCH 13/16] Double-quote CASE --- parm/config/gfs/config.resources | 26 +++++++++++------------ parm/config/gfs/config.resources.HERA | 2 +- parm/config/gfs/config.resources.HERCULES | 2 +- parm/config/gfs/config.resources.JET | 2 +- parm/config/gfs/config.resources.S4 | 2 +- parm/config/gfs/config.resources.WCOSS2 | 4 ++-- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/parm/config/gfs/config.resources b/parm/config/gfs/config.resources index 424f5d45dd..e60284aa79 100644 --- a/parm/config/gfs/config.resources +++ b/parm/config/gfs/config.resources @@ -329,7 +329,7 @@ case ${step} in "snowanl") # below lines are for creating JEDI YAML - case ${CASE} in + case "${CASE}" in "C1152" | "C768") layout_x=6 layout_y=6 @@ -358,7 +358,7 @@ case ${step} in "esnowanl") # below lines are for creating JEDI YAML - case ${CASE} in + case "${CASE}" in "C1152" | "C768") layout_x=6 layout_y=6 @@ -395,7 +395,7 @@ case ${step} in "aeroanlinit") # below lines are for creating JEDI YAML - case ${CASE} in + case "${CASE}" in "C1152" | "C768") layout_x=8 layout_y=8 @@ -428,7 +428,7 @@ case ${step} in ;; "aeroanlvar") - case ${CASE} in + case "${CASE}" in "C1152" | "C768") layout_x=8 layout_y=8 @@ -462,7 +462,7 @@ case ${step} in ;; "aeroanlgenb") - case ${CASE} in + case "${CASE}" in "C1152" | "C768") layout_x=8 layout_y=8 @@ -676,7 +676,7 @@ case ${step} in "anal") walltime_gdas="01:20:00" walltime_gfs="01:00:00" - case ${CASE} in + case "${CASE}" in "C1152" | "C768") ntasks_gdas=780 ntasks_gfs=825 @@ -953,7 +953,7 @@ case ${step} in ;; esac tasks_per_node=${ntasks} - if [[ ${CASE} == "C1152" ]]; then + if [[ "${CASE}" == "C1152" ]]; then tasks_per_node=40 fi @@ -1029,7 +1029,7 @@ case ${step} in threads_per_task=1 tasks_per_node=1 memory="20G" - if [[ ${CASE} == "C768" || ${CASE} == "C1152" ]]; then + if [[ "${CASE}" == "C768" || "${CASE}" == "C1152" ]]; then memory="80GB" fi ;; @@ -1178,7 +1178,7 @@ case ${step} in walltime="00:30:00" fi - case ${CASE} in + case "${CASE}" in "C1152" | "C768") ntasks=200;; "C384") ntasks=100;; "C192" | "C96" | "C48") ntasks=40;; @@ -1211,7 +1211,7 @@ case ${step} in "eupd") walltime="00:30:00" - case ${CASE} in + case "${CASE}" in "C1152" | "C768") ntasks=480 threads_per_task=6 @@ -1237,7 +1237,7 @@ case ${step} in walltime="00:10:00" ntasks=80 threads_per_task=4 - if [[ ${CASE} == "C384" || ${CASE} == "C192" || ${CASE} == "C96" || ${CASE} == "C48" ]]; then + if [[ "${CASE}" == "C384" || "${CASE}" == "C192" || "${CASE}" == "C96" || "${CASE}" == "C48" ]]; then threads_per_task=2 fi tasks_per_node=$(( max_tasks_per_node / threads_per_task )) @@ -1257,7 +1257,7 @@ case ${step} in "epos") walltime="00:15:00" - if [[ ${CASE} == "C768" || ${CASE} == "C1152" ]]; then + if [[ "${CASE}" == "C768" || "${CASE}" == "C1152" ]]; then walltime="00:25:00" fi ntasks=80 @@ -1270,7 +1270,7 @@ case ${step} in walltime="02:00:00" export ntasks=141 export ntasks_postsndcfp=9 - case ${CASE} in + case "${CASE}" in "C768") tasks_per_node=21 threads_per_task=6 diff --git a/parm/config/gfs/config.resources.HERA b/parm/config/gfs/config.resources.HERA index 0a190251b0..914af68ed7 100644 --- a/parm/config/gfs/config.resources.HERA +++ b/parm/config/gfs/config.resources.HERA @@ -31,7 +31,7 @@ case ${step} in ;; "eupd") - case ${CASE} in + case "${CASE}" in "C1152" | "C768") export ntasks=80 export threads_per_task=20 diff --git a/parm/config/gfs/config.resources.HERCULES b/parm/config/gfs/config.resources.HERCULES index 65ea508e01..49a98e85fa 100644 --- a/parm/config/gfs/config.resources.HERCULES +++ b/parm/config/gfs/config.resources.HERCULES @@ -7,7 +7,7 @@ case ${step} in # The number of tasks and cores used must be the same for eobs # See https://github.com/NOAA-EMC/global-workflow/issues/2092 for details # For Hercules, this is only an issue at C384; use 20 tasks/node - if [[ ${CASE} = "C384" ]]; then + if [[ "${CASE}" = "C384" ]]; then export tasks_per_node=20 fi ;; diff --git a/parm/config/gfs/config.resources.JET b/parm/config/gfs/config.resources.JET index 93f64c2c5b..536da8a4f2 100644 --- a/parm/config/gfs/config.resources.JET +++ b/parm/config/gfs/config.resources.JET @@ -26,7 +26,7 @@ case ${step} in ;; "eupd") - case ${CASE} in + case "${CASE}" in "C384") export ntasks=80 ;; diff --git a/parm/config/gfs/config.resources.S4 b/parm/config/gfs/config.resources.S4 index fa64068e81..2ba96343d0 100644 --- a/parm/config/gfs/config.resources.S4 +++ b/parm/config/gfs/config.resources.S4 @@ -10,7 +10,7 @@ case ${step} in ;; "anal") - case ${CASE} in + case "${CASE}" in "C384") #Some of the intermediate data can be lost if the number of tasks #per node does not match the number of reserved cores/node. diff --git a/parm/config/gfs/config.resources.WCOSS2 b/parm/config/gfs/config.resources.WCOSS2 index be55214cac..36cb846e93 100644 --- a/parm/config/gfs/config.resources.WCOSS2 +++ b/parm/config/gfs/config.resources.WCOSS2 @@ -42,7 +42,7 @@ case ${step} in ;; "eupd") - case ${CASE} in + case "${CASE}" in "C1152" | "C768" | "C384") export ntasks=315 export threads_per_task=14 @@ -54,7 +54,7 @@ case ${step} in ;; "eobs") - case ${CASE} in + case "${CASE}" in "C1152" | "C768" | "C384") export tasks_per_node=50 ;; From 440ad1920be2a47eadc130c2e4229d44aa51c2c3 Mon Sep 17 00:00:00 2001 From: David Huber Date: Thu, 20 Feb 2025 19:52:42 +0000 Subject: [PATCH 14/16] More double equals, double quotes, and double brackets --- scripts/exgdas_atmos_chgres_forenkf.sh | 8 +-- scripts/exgdas_enkf_ecen.sh | 14 ++--- scripts/exgdas_enkf_post.sh | 8 +-- scripts/exgdas_enkf_select_obs.sh | 4 +- scripts/exgdas_enkf_sfc.sh | 4 +- scripts/exgdas_enkf_update.sh | 14 ++--- scripts/exglobal_atmos_analysis.sh | 56 ++++++++--------- scripts/exglobal_atmos_analysis_calc.sh | 20 +++---- scripts/exglobal_atmos_sfcanl.sh | 4 +- scripts/exglobal_cleanup.sh | 4 +- scripts/exglobal_diag.sh | 30 +++++----- scripts/exglobal_forecast.sh | 40 ++++++------- sorc/build_ww3prepost.sh | 2 +- ush/detect_machine.sh | 2 +- ush/getges.sh | 80 ++++++++++++------------- ush/tropcy_relocate.sh | 6 +- 16 files changed, 148 insertions(+), 148 deletions(-) diff --git a/scripts/exgdas_atmos_chgres_forenkf.sh b/scripts/exgdas_atmos_chgres_forenkf.sh index dd28605176..23b4fc109e 100755 --- a/scripts/exgdas_atmos_chgres_forenkf.sh +++ b/scripts/exgdas_atmos_chgres_forenkf.sh @@ -126,13 +126,13 @@ if [ $DO_CALC_ANALYSIS == "YES" ]; then export OMP_NUM_THREADS=$NTHREADS_CHGRES SIGLEVEL=${SIGLEVEL:-${FIXgfs}/am/global_hyblev.l${LEVS_ENKF}.txt} - if [ $USE_CFP = "YES" ]; then - if [[ -f $DATA/mp_chgres.sh ]]; then - rm $DATA/mp_chgres.sh + if [[ "${USE_CFP}" == "YES" ]]; then + if [[ -f "${DATA}/mp_chgres.sh" ]]; then + rm "${DATA}/mp_chgres.sh" fi fi - nfhrs=$(echo $IAUFHRS_ENKF | sed 's/,/ /g') + nfhrs=$(echo "${IAUFHRS_ENKF}" | sed 's/,/ /g') for FHR in $nfhrs; do echo "Regridding deterministic forecast for forecast hour $FHR" rm -f chgres_nc_gauss0$FHR.nml diff --git a/scripts/exgdas_enkf_ecen.sh b/scripts/exgdas_enkf_ecen.sh index 8ec418b130..e65b7bfd08 100755 --- a/scripts/exgdas_enkf_ecen.sh +++ b/scripts/exgdas_enkf_ecen.sh @@ -102,7 +102,7 @@ fi cd $DATA || exit 99 ENKF_SUFFIX="s" -if [[ $SMOOTH_ENKF = "NO" ]]; then +if [[ "${SMOOTH_ENKF}" == "NO" ]]; then ENKF_SUFFIX="" fi @@ -256,10 +256,10 @@ if [ $RECENTER_ENKF = "YES" ]; then export OMP_NUM_THREADS=$NTHREADS_CHGRES - if [[ -f $chgresnml ]]; then - rm -f $chgresnml + if [[ -f "${chgresnml}" ]]; then + rm -f "${chgresnml}" fi - cat > $chgresnml << EOF + cat > "${chgresnml}" << EOF &${nmltitle}_setup i_output=$LONB_ENKF j_output=$LATB_ENKF @@ -368,9 +368,9 @@ done # loop over analysis times in window ################################################################################ # Postprocessing cd $pwd -if [[ $mkdata = "YES" ]]; then - rm -rf $DATA +if [[ "${mkdata}" == "YES" ]]; then + rm -rf "${DATA}" fi -exit ${err} +exit "${err}" diff --git a/scripts/exgdas_enkf_post.sh b/scripts/exgdas_enkf_post.sh index 46d8a2d49b..a6efd35e44 100755 --- a/scripts/exgdas_enkf_post.sh +++ b/scripts/exgdas_enkf_post.sh @@ -53,7 +53,7 @@ ENKF_SPREAD=${ENKF_SPREAD:-"NO"} ################################################################################ # Preprocessing ENKF_SUFFIX="s" -if [[ $SMOOTH_ENKF = "NO" ]]; then +if [[ "${SMOOTH_ENKF}" == "NO" ]]; then ENKF_SUFFIX="" fi @@ -95,7 +95,7 @@ for fhr in $(seq $FHMIN $FHOUT $FHMAX); do ${NLN} "${COMIN_ATMOS_HISTORY}/${PREFIX}atmf${fhrchar}${ENKF_SUFFIX}.nc" "atmf${fhrchar}${ENKF_SUFFIX}_${memchar}" done fi - if [[ $ENKF_SPREAD = "YES" ]]; then + if [[ "${ENKF_SPREAD}" == "YES" ]]; then ${NLN} "${COMOUT_ATMOS_HISTORY_STAT}/${PREFIX}atmf${fhrchar}.ensspread.nc" "atmf${fhrchar}.ensspread" fi done @@ -103,8 +103,8 @@ done ################################################################################ # Generate ensemble mean surface and atmospheric files -if [[ $SMOOTH_ENKF = "YES" ]]; then - $NCP $HYBENSMOOTH ./hybens_smoothinfo +if [[ "${SMOOTH_ENKF}" == "YES" ]]; then + $NCP "${HYBENSMOOTH}" ./hybens_smoothinfo fi rc=0 diff --git a/scripts/exgdas_enkf_select_obs.sh b/scripts/exgdas_enkf_select_obs.sh index 3c2da7d247..210e531bd8 100755 --- a/scripts/exgdas_enkf_select_obs.sh +++ b/scripts/exgdas_enkf_select_obs.sh @@ -104,8 +104,8 @@ export err=$?; err_chk ################################################################################ # Postprocessing cd $pwd -if [[ $mkdata = "YES" ]]; then - rm -rf $DATA +if [[ "${mkdata}" == "YES" ]]; then + rm -rf "${DATA}" fi diff --git a/scripts/exgdas_enkf_sfc.sh b/scripts/exgdas_enkf_sfc.sh index 0337c55cc9..68a7d3d29a 100755 --- a/scripts/exgdas_enkf_sfc.sh +++ b/scripts/exgdas_enkf_sfc.sh @@ -87,11 +87,11 @@ LONB_CASE=$((res*4)) export FNTSFA=${FNTSFA:-' '} export FNACNA=${FNACNA:-${COM_OBS}/${OPREFIX}seaice.5min.blend.grb} export FNSNOA=${FNSNOA:-${COM_OBS}/${OPREFIX}snogrb_t${JCAP_CASE}.${LONB_CASE}.${LATB_CASE}} -if [[ ! -f $FNSNOA ]]; then +if [[ ! -f "${FNSNOA}" ]]; then export FNSNOA="${COM_OBS}/${OPREFIX}snogrb_t1534.3072.1536" fi FNSNOG=${FNSNOG:-${COM_OBS_PREV}/${GPREFIX}snogrb_t${JCAP_CASE}.${LONB_CASE}.${LATB_CASE}} -if [[ ! -f $FNSNOG ]]; then +if [[ ! -f "${FNSNOG}" ]]; then FNSNOG="${COM_OBS_PREV}/${GPREFIX}snogrb_t1534.3072.1536" fi diff --git a/scripts/exgdas_enkf_update.sh b/scripts/exgdas_enkf_update.sh index 757ba14cd9..a3d19468b6 100755 --- a/scripts/exgdas_enkf_update.sh +++ b/scripts/exgdas_enkf_update.sh @@ -119,7 +119,7 @@ HYBENSINFO=${HYBENSINFO:-${FIXgfs}/gsi/global_hybens_info.l${LEVS_ENKF}.txt} ANAVINFO=${ANAVINFO:-${FIXgfs}/gsi/global_anavinfo.l${LEVS_ENKF}.txt} VLOCALEIG=${VLOCALEIG:-${FIXgfs}/gsi/vlocal_eig_l${LEVS_ENKF}.dat} ENKF_SUFFIX="s" -if [[ $SMOOTH_ENKF = "NO" ]]; then +if [[ "${SMOOTH_ENKF}" == "NO" ]]; then ENKF_SUFFIX="" fi @@ -149,13 +149,13 @@ ${NLN} "${COM_ATMOS_ANALYSIS_STAT}/${GBIASe}" "satbias_in" ################################################################################ if [ $USE_CFP = "YES" ]; then - if [[ -f $DATA/untar.sh ]]; then - rm $DATA/untar.sh + if [[ -f "${DATA}/untar.sh" ]]; then + rm "${DATA}/untar.sh" fi - if [[ -f $DATA/mp_untar.sh ]]; then - rm $DATA/mp_untar.sh + if [[ -f "${DATA}/mp_untar.sh" ]]; then + rm "${DATA}/mp_untar.sh" fi - cat > $DATA/untar.sh << EOFuntar + cat > "${DATA}/untar.sh" << EOFuntar #!/bin/sh memchar=\$1 COM_ATMOS_ANALYSIS=\$2 @@ -423,7 +423,7 @@ cat stdout stderr > "${COM_ATMOS_ANALYSIS_STAT}/${ENKFSTAT}" ################################################################################ # Postprocessing cd "$pwd" -if [[ $mkdata = "YES" ]]; then +if [[ "${mkdata}" == "YES" ]]; then rm -rf "${DATA}" fi diff --git a/scripts/exglobal_atmos_analysis.sh b/scripts/exglobal_atmos_analysis.sh index f0fd5f4377..e9116d5753 100755 --- a/scripts/exglobal_atmos_analysis.sh +++ b/scripts/exglobal_atmos_analysis.sh @@ -500,8 +500,8 @@ ${NLN} ${ABIBF} abibufr ${NLN} ${HDOB} hdobbufr ${NLN} ${SSTVIIRS} sstviirs -if [[ ${DONST} = "YES" ]]; then - ${NLN} ${NSSTBF} nsstbufr +if [[ "${DONST}" == "YES" ]]; then + ${NLN} "${NSSTBF}" nsstbufr fi ############################################################## @@ -521,39 +521,39 @@ ${NLN} ${SFCG03} sfcf03 ${NLN} ${SFCGES} sfcf06 ${NLN} ${SFCG09} sfcf09 -if [[ -f ${ATMG04} ]]; then - ${NLN} ${ATMG04} sigf04 +if [[ -f "${ATMG04}" ]]; then + ${NLN} "${ATMG04}" sigf04 fi -if [[ -f ${ATMG05} ]]; then - ${NLN} ${ATMG05} sigf05 +if [[ -f "${ATMG05}" ]]; then + ${NLN} "${ATMG05}" sigf05 fi -if [[ -f ${ATMG07} ]]; then - ${NLN} ${ATMG07} sigf07 +if [[ -f "${ATMG07}" ]]; then + ${NLN} "${ATMG07}" sigf07 fi -if [[ -f ${ATMG08} ]]; then - ${NLN} ${ATMG08} sigf08 +if [[ -f "${ATMG08}" ]]; then + ${NLN} "${ATMG08}" sigf08 fi -if [[ -f ${SFCG04} ]]; then - ${NLN} ${SFCG04} sfcf04 +if [[ -f "${SFCG04}" ]]; then + ${NLN} "${SFCG04}" sfcf04 fi -if [[ -f ${SFCG05} ]]; then - ${NLN} ${SFCG05} sfcf05 +if [[ -f "${SFCG05}" ]]; then + ${NLN} "${SFCG05}" sfcf05 fi -if [[ -f ${SFCG07} ]]; then - ${NLN} ${SFCG07} sfcf07 +if [[ -f "${SFCG07}" ]]; then + ${NLN} "${SFCG07}" sfcf07 fi -if [[ -f ${SFCG08} ]]; then - ${NLN} ${SFCG08} sfcf08 +if [[ -f "${SFCG08}" ]]; then + ${NLN} "${SFCG08}" sfcf08 fi -if [ ${DOHYBVAR} = "YES" ]; then +if [ "${DOHYBVAR}" == "YES" ]; then # Link ensemble members mkdir -p ensemble_data ENKF_SUFFIX="s" - if [[ ${SMOOTH_ENKF} = "NO" ]]; then + if [[ "${SMOOTH_ENKF}" == "NO" ]]; then ENKF_SUFFIX="" fi @@ -658,15 +658,15 @@ fi ############################################################## # If requested, copy and de-tar guess radstat file -if [ ${USE_RADSTAT} = "YES" ]; then - if [ ${USE_CFP} = "YES" ]; then - if [[ -f ${DATA}/unzip.sh ]]; then - rm ${DATA}/unzip.sh +if [[ "${USE_RADSTAT}" == "YES" ]]; then + if [[ "${USE_CFP}" == "YES" ]]; then + if [[ -f "${DATA}/unzip.sh" ]]; then + rm "${DATA}/unzip.sh" fi - if [[ -f ${DATA}/mp_unzip.sh ]]; then - rm ${DATA}/mp_unzip.sh + if [[ -f "${DATA}/mp_unzip.sh" ]]; then + rm "${DATA}/mp_unzip.sh" fi - cat > ${DATA}/unzip.sh << EOFunzip + cat > "${DATA}/unzip.sh" << EOFunzip #!/bin/sh diag_file=\$1 diag_suffix=\$2 @@ -1007,7 +1007,7 @@ fi ################################################################################ # Postprocessing cd ${pwd} -if [[ ${mkdata} = "YES" ]]; then +if [[ "${mkdata}" == "YES" ]]; then rm -rf ${DATA} fi diff --git a/scripts/exglobal_atmos_analysis_calc.sh b/scripts/exglobal_atmos_analysis_calc.sh index e5c391ea46..cd18c70471 100755 --- a/scripts/exglobal_atmos_analysis_calc.sh +++ b/scripts/exglobal_atmos_analysis_calc.sh @@ -155,17 +155,17 @@ if [ $DO_CALC_ANALYSIS == "YES" ]; then $NLN $ATMGES sigf06 $NLN $ATMG09 sigf09 - if [[ -f $ATMG04 ]]; then - $NLN $ATMG04 sigf04 + if [[ -f "${ATMG04}" ]]; then + $NLN "${ATMG04}" sigf04 fi - if [[ -f $ATMG05 ]]; then - $NLN $ATMG05 sigf05 + if [[ -f "${ATMG05}" ]]; then + $NLN "${ATMG05}" sigf05 fi - if [[ -f $ATMG07 ]]; then - $NLN $ATMG07 sigf07 + if [[ -f "${ATMG07}" ]]; then + $NLN "${ATMG07}" sigf07 fi - if [[ -f $ATMG08 ]]; then - $NLN $ATMG08 sigf08 + if [[ -f "${ATMG08}" ]]; then + $NLN "${ATMG08}" sigf08 fi # Link hourly backgrounds (if present) @@ -194,8 +194,8 @@ echo "${rCDUMP} ${PDY}${cyc} atmanl and sfcanl done at $(date)" > "${COMOUT_ATMO ################################################################################ # Postprocessing cd $pwd -if [[ $mkdata = "YES" ]]; then - rm -rf $DATA +if [[ "${mkdata}" == "YES" ]]; then + rm -rf "${DATA}" fi diff --git a/scripts/exglobal_atmos_sfcanl.sh b/scripts/exglobal_atmos_sfcanl.sh index 9580626e9e..02ccd8cad9 100755 --- a/scripts/exglobal_atmos_sfcanl.sh +++ b/scripts/exglobal_atmos_sfcanl.sh @@ -62,11 +62,11 @@ LONB_CASE=$((res*4)) export FNTSFA=${FNTSFA:-${COMIN_OBS}/${OPREFIX}rtgssthr.grb} export FNACNA=${FNACNA:-${COMIN_OBS}/${OPREFIX}seaice.5min.blend.grb} export FNSNOA=${FNSNOA:-${COMIN_OBS}/${OPREFIX}snogrb_t${JCAP_CASE}.${LONB_CASE}.${LATB_CASE}} -if [[ ! -f ${FNSNOA} ]]; then +if [[ ! -f "${FNSNOA}" ]]; then export FNSNOA="${COMIN_OBS}/${OPREFIX}snogrb_t1534.3072.1536" fi FNSNOG=${FNSNOG:-${COMIN_OBS_PREV}/${GPREFIX}snogrb_t${JCAP_CASE}.${LONB_CASE}.${LATB_CASE}} -if [[ ! -f ${FNSNOG} ]]; then +if [[ ! -f "${FNSNOG}" ]]; then FNSNOG="${COMIN_OBS_PREV}/${GPREFIX}snogrb_t1534.3072.1536" fi diff --git a/scripts/exglobal_cleanup.sh b/scripts/exglobal_cleanup.sh index c53d44e34e..c242954e0b 100755 --- a/scripts/exglobal_cleanup.sh +++ b/scripts/exglobal_cleanup.sh @@ -85,7 +85,7 @@ if [[ "${RUN}" == "gfs" ]]; then fhmax=$((FHMAX_FITS + 36)) RDATE=$(date --utc +%Y%m%d%H -d "${PDY} ${cyc} -${fhmax} hours") verify_dir="${ROTDIR}/vrfyarch/${RUN}.${RDATE:0:8}" - if [[ -d ${verify_dir} ]]; then + if [[ -d "${verify_dir}" ]]; then rm -rf "${verify_dir}" fi @@ -94,7 +94,7 @@ if [[ "${RUN}" == "gfs" ]]; then touch_PDY="${touch_date:0:8}" touch_cyc="${touch_date:8:2}" touch_dir="${ROTDIR}/vrfyarch/${RUN}.${touch_PDY}/${touch_cyc}" - if [[ -d ${touch_dir} ]]; then + if [[ -d "${touch_dir}" ]]; then touch "${touch_dir}"/* fi touch_date=$(date --utc +%Y%m%d%H -d "${touch_PDY} ${touch_cyc} +6 hours") diff --git a/scripts/exglobal_diag.sh b/scripts/exglobal_diag.sh index f46210d5fc..e3df9f9fa0 100755 --- a/scripts/exglobal_diag.sh +++ b/scripts/exglobal_diag.sh @@ -55,17 +55,17 @@ CNVSTAT=${CNVSTAT:-${COMOUT_ATMOS_ANALYSIS}/${APREFIX}cnvstat} OZNSTAT=${OZNSTAT:-${COMOUT_ATMOS_ANALYSIS}/${APREFIX}oznstat} # Remove stat file if file already exists -if [[ -s $RADSTAT ]]; then - rm -f $RADSTAT +if [[ -s "${RADSTAT}" ]]; then + rm -f "${RADSTAT}" fi -if [[ -s $PCPSTAT ]]; then - rm -f $PCPSTAT +if [[ -s "${PCPSTAT}" ]]; then + rm -f "${PCPSTAT}" fi -if [[ -s $CNVSTAT ]]; then - rm -f $CNVSTAT +if [[ -s "${CNVSTAT}" ]]; then + rm -f "${CNVSTAT}" fi -if [[ -s $OZNSTAT ]]; then - rm -f $OZNSTAT +if [[ -s "${OZNSTAT}" ]]; then + rm -f "${OZNSTAT}" fi # Obs diag @@ -132,13 +132,13 @@ if [ $GENDIAG = "YES" ] ; then fi if [ $USE_CFP = "YES" ]; then - if [[ -f $DATA/diag.sh ]]; then - rm $DATA/diag.sh + if [[ -f "${DATA}/diag.sh" ]]; then + rm "${DATA}/diag.sh" fi - if [[ -f $DATA/mp_diag.sh ]]; then - rm $DATA/mp_diag.sh + if [[ -f "${DATA}/mp_diag.sh" ]]; then + rm "${DATA}/mp_diag.sh" fi - cat > $DATA/diag.sh << EOFdiag + cat > "${DATA}/diag.sh" << EOFdiag #!/bin/sh lrun_subdirs=\$1 binary_diag=\$2 @@ -285,8 +285,8 @@ if [[ "$REMOVE_DIAG_DIR" = "YES" && "$err" = "0" ]]; then fi cd $pwd -if [[ "${mkdata:-YES}" = "YES" ]]; then - rm -rf $DATA +if [[ "${mkdata:-YES}" == "YES" ]]; then + rm -rf "${DATA}" fi diff --git a/scripts/exglobal_forecast.sh b/scripts/exglobal_forecast.sh index 16bc57a50e..1c21410dbc 100755 --- a/scripts/exglobal_forecast.sh +++ b/scripts/exglobal_forecast.sh @@ -106,19 +106,19 @@ common_predet echo "MAIN: Loading variables before determination of run type" FV3_predet -if [[ ${cplflx} = .true. ]]; then +if [[ "${cplflx}" == ".true." ]]; then CMEPS_predet fi -if [[ ${cplflx} = .true. ]]; then +if [[ "${cplflx}" == ".true." ]]; then MOM6_predet fi -if [[ ${cplwav} = .true. ]]; then +if [[ "${cplwav}" == ".true." ]]; then WW3_predet fi -if [[ ${cplice} = .true. ]]; then +if [[ "${cplice}" == ".true." ]]; then CICE_predet fi -if [[ ${cplchm} = .true. ]]; then +if [[ "${cplchm}" == ".true." ]]; then GOCART_predet fi echo "MAIN: Variables before determination of run type loaded" @@ -129,35 +129,35 @@ echo "MAIN: run type determined" echo "MAIN: Post-determination set up of run type" FV3_postdet -if [[ ${cplflx} = .true. ]]; then +if [[ "${cplflx}" == ".true." ]]; then CMEPS_postdet fi -if [[ ${cplflx} = .true. ]]; then +if [[ "${cplflx}" == ".true." ]]; then MOM6_postdet fi -if [[ ${cplwav} = .true. ]]; then +if [[ "${cplwav}" == ".true." ]]; then WW3_postdet fi -if [[ ${cplice} = .true. ]]; then +if [[ "${cplice}" == ".true." ]]; then CICE_postdet fi -if [[ ${cplchm} = .true. ]]; then +if [[ "${cplchm}" == ".true." ]]; then GOCART_postdet fi echo "MAIN: Post-determination set up of run type finished" echo "MAIN: Writing namelists and model configuration" FV3_nml -if [[ ${cplflx} = .true. ]]; then +if [[ "${cplflx}" == ".true." ]]; then MOM6_nml fi -if [[ ${cplwav} = .true. ]]; then +if [[ "${cplwav}" == ".true." ]]; then WW3_nml fi -if [[ ${cplice} = .true. ]]; then +if [[ "${cplice}" == ".true." ]]; then CICE_nml fi -if [[ ${cplchm} = .true. ]]; then +if [[ "${cplchm}" == ".true." ]]; then GOCART_rc fi UFS_configure @@ -184,22 +184,22 @@ export err=${ERR} ${ERRSCRIPT} || exit "${err}" FV3_out -if [[ ${cplflx} = .true. ]]; then +if [[ "${cplflx}" == ".true." ]]; then MOM6_out fi -if [[ ${cplflx} = .true. ]]; then +if [[ "${cplflx}" == ".true." ]]; then CMEPS_out fi -if [[ ${cplwav} = .true. ]]; then +if [[ "${cplwav}" == ".true." ]]; then WW3_out fi -if [[ ${cplice} = .true. ]]; then +if [[ "${cplice}" == ".true." ]]; then CICE_out fi -if [[ ${cplchm} = .true. ]]; then +if [[ "${cplchm}" == ".true." ]]; then GOCART_out fi -if [[ ${esmf_profile:-} = .true. ]]; then +if [[ "${esmf_profile:-}" == ".true." ]]; then CPL_out fi echo "MAIN: Output copied to ROTDIR" diff --git a/sorc/build_ww3prepost.sh b/sorc/build_ww3prepost.sh index 9f9ba114fa..dac8e14a97 100755 --- a/sorc/build_ww3prepost.sh +++ b/sorc/build_ww3prepost.sh @@ -81,7 +81,7 @@ cat "${buildswitch}" #define cmake build options MAKE_OPT="-DCMAKE_INSTALL_PREFIX=${path_install}" -if [[ ${BUILD_TYPE:-"Release"} = "Debug" ]]; then +if [[ "${BUILD_TYPE:-"Release"}" == "Debug" ]]; then MAKE_OPT+=" -DCMAKE_BUILD_TYPE=Debug" fi diff --git a/ush/detect_machine.sh b/ush/detect_machine.sh index 24352aa47d..f7393355f7 100755 --- a/ush/detect_machine.sh +++ b/ush/detect_machine.sh @@ -9,7 +9,7 @@ # Thank you for your contribution # If the MACHINE_ID variable is set, skip this script. -if [[ -n ${MACHINE_ID:-} ]]; then +if [[ -n "${MACHINE_ID:-}" ]]; then return fi diff --git a/ush/getges.sh b/ush/getges.sh index 792833e347..d4a0bb1f49 100755 --- a/ush/getges.sh +++ b/ush/getges.sh @@ -169,23 +169,23 @@ if [[ "$netwk" = "namopl" || "$resol" = "namopl" ]];then typef=restrt resol=namopl fi -if [[ $resol = 57464 || $resol = 38264 || $resol = 19064 || $resol = 25464 || $resol = 17042 || $resol = 12628 ]]; then +if [[ "${resol}" == "57464" || "${resol}" == "38264" || "${resol}" == "19064" || "${resol}" == "25464" || "${resol}" == "17042" || "${resol}" == "12628" ]]; then resol=high fi -if [[ $resol = 6228 ]]; then +if [[ "${resol}" == "6228" ]]; then resol=low fi resolsuf="" -if [[ $resol == *deg ]]; then +if [[ ${resol} == *deg ]]; then resolsuf=.$resol fi fhbeg=$(${NHOUR:?} $valid) -if [[ $fhbeg -le 0 ]]; then +if [[ ${fhbeg} -le 0 ]]; then fhbeg=03 fi -((fhbeg=(10#$fhbeg-1)/3*3+3)) +((fhbeg=(10#${fhbeg}-1)/3*3+3)) if [[ $fhbeg -lt 10 ]]; then - fhbeg=0$fhbeg + fhbeg="0${fhbeg}" fi if [[ $typef = enggrb ]];then typef=icegrb @@ -1330,41 +1330,41 @@ fi fh=$fhbeg if [ -z "$PDY" ];then echo "getges.sh WARNING: \$PDY variable not set" >&2; fi while [[ $fh -le $fhend ]];do - ((fhm6=10#$fh-6)) - if [[ $fhm6 -lt 10 && $fhm6 -ge 0 ]]; then - fhm6=0$fhm6 + ((fhm6=10#${fh}-6)) + if [[ ${fhm6} -lt 10 && ${fhm6} -ge 0 ]]; then + fhm6=0${fhm6} fi - ((fhm5=10#$fh-5)) - if [[ $fhm5 -lt 10 && $fhm5 -ge 0 ]]; then - fhm5=0$fhm5 + ((fhm5=10#${fh}-5)) + if [[ ${fhm5} -lt 10 && ${fhm5} -ge 0 ]]; then + fhm5=0${fhm5} fi - ((fhm4=10#$fh-4)) - if [[ $fhm4 -lt 10 && $fhm4 -ge 0 ]]; then - fhm4=0$fhm4 + ((fhm4=10#${fh}-4)) + if [[ ${fhm4} -lt 10 && ${fhm4} -ge 0 ]]; then + fhm4=0${fhm4} fi - ((fhm3=10#$fh-3)) - if [[ $fhm3 -lt 10 && $fhm3 -ge 0 ]]; then - fhm3=0$fhm3 + ((fhm3=10#${fh}-3)) + if [[ ${fhm3} -lt 10 && ${fhm3} -ge 0 ]]; then + fhm3=0${fhm3} fi - ((fhm2=10#$fh-2)) - if [[ $fhm2 -lt 10 && $fhm2 -ge 0 ]]; then - fhm2=0$fhm2 + ((fhm2=10#${fh}-2)) + if [[ ${fhm2} -lt 10 && ${fhm2} -ge 0 ]]; then + fhm2=0${fhm2} fi - ((fhm1=10#$fh-1)) - if [[ $fhm1 -lt 10 && $fhm1 -ge 0 ]]; then - fhm1=0$fhm1 + ((fhm1=10#${fh}-1)) + if [[ ${fhm1} -lt 10 && ${fhm1} -ge 0 ]]; then + fhm1=0${fhm1} fi - ((fhp1=10#$fh+1)) - if [[ $fhp1 -lt 10 ]]; then - fhp1=0$fhp1 + ((fhp1=10#${fh}+1)) + if [[ ${fhp1} -lt 10 ]]; then + fhp1=0${fhp1} fi - ((fhp2=10#$fh+2)) - if [[ $fhp2 -lt 10 ]]; then - fhp2=0$fhp2 + ((fhp2=10#${fh}+2)) + if [[ ${fhp2} -lt 10 ]]; then + fhp2=0${fhp2} fi - ((fhp3=10#$fh+3)) - if [[ $fhp3 -lt 10 ]]; then - fhp3=0$fhp3 + ((fhp3=10#${fh}+3)) + if [[ ${fhp3} -lt 10 ]]; then + fhp3=0${fhp3} fi gh=$fh;[[ $gh -lt 100 ]]&&gh=0$gh ghm6=$fhm6;[[ $ghm6 -lt 100 ]]&&ghm6=0$ghm6 @@ -1381,7 +1381,7 @@ while [[ $fh -le $fhend ]];do day=$(echo $id | xargs | cut -c8) cyc=$(echo $id | xargs | rev | cut -c1-2 | rev) eval list=\$getlist$fh - if [[ -z "$list" ]]; then + if [[ -z "${list}" ]]; then list=${geslist} fi for ges_var in $list;do @@ -1389,16 +1389,16 @@ while [[ $fh -le $fhend ]];do eval ges_val=$ges_var # Replace the current PDY with the valid date ges=${ges_val/$PDY\//$day/} - if [[ $quiet = NO ]]; then - echo Checking: $ges >&2 + if [[ "${quiet}" == "NO" ]]; then + echo Checking: "${ges}" >&2 fi - if [[ -r $ges ]]; then + if [[ -r "${ges}" ]]; then break 2 fi done - fh=$((10#$fh+10#$fhinc)) - if [[ $fh -lt 10 ]]; then - fh=0$fh + fh=$((10#${fh}+10#${fhinc})) + if [[ ${fh} -lt 10 ]]; then + fh=0${fh} fi done if [[ $fh -gt $fhend ]];then diff --git a/ush/tropcy_relocate.sh b/ush/tropcy_relocate.sh index 457c24b68d..8c64a72454 100755 --- a/ush/tropcy_relocate.sh +++ b/ush/tropcy_relocate.sh @@ -350,14 +350,14 @@ for fhr in $( seq -6 $BKGFREQ 3 ) ; do fi sges=sg${tpref}prep - if [[ $fhr -lt -3 ]]; then + if [[ ${fhr} -lt -3 ]]; then sges=NULL fi echo $sges # stype=sigg${tpref} stype=natg${tpref} - if [[ $RUN = cdas1 ]]; then - stype=sigg${tpref} ## for cfs + if [[ "${RUN}" = cdas1 ]]; then + stype="sigg${tpref}" ## for cfs fi pges=pg${tpref}prep ptype=${pgpref}${tpref} From bf386ab37a9c825b766f5c8380eabe0d0238df29 Mon Sep 17 00:00:00 2001 From: David Huber Date: Mon, 24 Feb 2025 15:21:04 +0000 Subject: [PATCH 15/16] Add double quotes and curly braces --- jobs/JGFS_ATMOS_CYCLONE_TRACKER | 4 ++-- jobs/rocoto/aerosol_init.sh | 18 +++++++++--------- jobs/rocoto/wavegempak.sh | 6 +++--- jobs/rocoto/waveinit.sh | 5 +---- jobs/rocoto/wavepostbndpnt.sh | 5 +---- scripts/exgdas_enkf_ecen.sh | 2 +- 6 files changed, 17 insertions(+), 23 deletions(-) diff --git a/jobs/JGFS_ATMOS_CYCLONE_TRACKER b/jobs/JGFS_ATMOS_CYCLONE_TRACKER index 09925d2309..509e48bf5f 100755 --- a/jobs/JGFS_ATMOS_CYCLONE_TRACKER +++ b/jobs/JGFS_ATMOS_CYCLONE_TRACKER @@ -73,7 +73,7 @@ export err=$?; err_chk #------------------------------------------------ machine=${machine:-$(echo ${SITE})} -${USHens_tracker}/extrkr_gfs.sh ${loopnum} ${cmodel} ${CDATE} ${pert} "${DATA}" +${USHens_tracker}/extrkr_gfs.sh "${loopnum}" "${cmodel}" "${CDATE}" "${pert}" "${DATA}" export err=$?; err_chk @@ -89,7 +89,7 @@ export err=$?; err_chk # Final processing ############################################## if [ -e "${pgmout}" ] ; then - cat ${pgmout} + cat "${pgmout}" fi ########################################## diff --git a/jobs/rocoto/aerosol_init.sh b/jobs/rocoto/aerosol_init.sh index 0b292e3310..0a2c7685d6 100755 --- a/jobs/rocoto/aerosol_init.sh +++ b/jobs/rocoto/aerosol_init.sh @@ -6,8 +6,8 @@ source "$HOMEgfs/ush/preamble.sh" # Source FV3GFS workflow modules source $HOMEgfs/ush/load_fv3gfs_modules.sh status=$? -if [[ $status -ne 0 ]]; then - exit $status +if [[ ${status} -ne 0 ]]; then + exit "${status}" fi ############################################################### @@ -16,8 +16,8 @@ configs="base aerosol_init" for config in $configs; do source $EXPDIR/config.${config} status=$? - if [[ $status -ne 0 ]]; then - exit $status + if [[ ${status} -ne 0 ]]; then + exit "${status}" fi done @@ -25,16 +25,16 @@ done # Source machine runtime environment source $BASE_ENV/${machine}.env aerosol_init status=$? -if [[ $status -ne 0 ]]; then - exit $status +if [[ ${status} -ne 0 ]]; then + exit "${status}" fi $HOMEgfs/scripts/exgfs_aero_init_aerosol.py status=$? -if [[ $status -ne 0 ]]; then - echo "FATAL ERROR: exgfs_chem_init_aerosol.py failed with error code $status" - exit $status +if [[ ${status} -ne 0 ]]; then + echo "FATAL ERROR: exgfs_chem_init_aerosol.py failed with error code ${status}" + exit "${status}" fi ############################################################## diff --git a/jobs/rocoto/wavegempak.sh b/jobs/rocoto/wavegempak.sh index b0ebb4f2eb..c4eca3c2bb 100755 --- a/jobs/rocoto/wavegempak.sh +++ b/jobs/rocoto/wavegempak.sh @@ -5,8 +5,8 @@ source "$HOMEgfs/ush/preamble.sh" ############################################################### source $HOMEgfs/ush/load_fv3gfs_modules.sh status=$? -if [[ $status -ne 0 ]]; then - exit $status +if [[ ${status} -ne 0 ]]; then + exit "${status}" fi export job="post" @@ -17,4 +17,4 @@ export jobid="${job}.$$" $HOMEgfs/jobs/JGLOBAL_WAVE_GEMPAK status=$? -exit $status +exit "${status}" diff --git a/jobs/rocoto/waveinit.sh b/jobs/rocoto/waveinit.sh index 0684c0fd34..f11f59d854 100755 --- a/jobs/rocoto/waveinit.sh +++ b/jobs/rocoto/waveinit.sh @@ -21,8 +21,5 @@ echo "=============== START TO RUN WAVE INIT ===============" # Execute the JJOB ${HOMEgfs}/jobs/JGLOBAL_WAVE_INIT status=$? -if [[ ${status} -ne 0 ]]; then - exit "${status}" -fi -exit 0 +exit "${status}" diff --git a/jobs/rocoto/wavepostbndpnt.sh b/jobs/rocoto/wavepostbndpnt.sh index fd85b5eecc..19187209ce 100755 --- a/jobs/rocoto/wavepostbndpnt.sh +++ b/jobs/rocoto/wavepostbndpnt.sh @@ -21,8 +21,5 @@ echo "=============== START TO RUN WAVE_POST_BNDPNT ===============" # Execute the JJOB ${HOMEgfs}/jobs/JGLOBAL_WAVE_POST_BNDPNT status=$? -if [[ ${status} -ne 0 ]]; then - exit "${status}" -fi -exit 0 +exit "${status}" diff --git a/scripts/exgdas_enkf_ecen.sh b/scripts/exgdas_enkf_ecen.sh index e65b7bfd08..2b1828d5bd 100755 --- a/scripts/exgdas_enkf_ecen.sh +++ b/scripts/exgdas_enkf_ecen.sh @@ -373,4 +373,4 @@ if [[ "${mkdata}" == "YES" ]]; then fi -exit "${err}" +exit 0 From 122bf76a0edecc1f312b3fc2a33d0f5c67f4c681 Mon Sep 17 00:00:00 2001 From: David Huber Date: Fri, 28 Feb 2025 19:38:17 +0000 Subject: [PATCH 16/16] Import COM variables as well (COM templates are needed). --- scripts/exgdas_enkf_earc_tars.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/scripts/exgdas_enkf_earc_tars.py b/scripts/exgdas_enkf_earc_tars.py index 3195fb41e5..59f45da84f 100755 --- a/scripts/exgdas_enkf_earc_tars.py +++ b/scripts/exgdas_enkf_earc_tars.py @@ -38,21 +38,17 @@ def main(): # Also import all COMIN* directory and template variables for key in archive.task_config.keys(): - if key.startswith("COMIN"): + if key.startswith("COM"): archive_dict[key] = archive.task_config[key] - cwd = os.getcwd() + with chdir(config.ROTDIR): - os.chdir(config.ROTDIR) + # Determine which archives to create + atardir_sets = archive.configure_tars(archive_dict) - # Determine which archives to create - atardir_sets = archive.configure_tars(archive_dict) - - # Create the backup tarballs and store in ATARDIR - for atardir_set in atardir_sets: - archive.execute_backup_dataset(atardir_set) - - os.chdir(cwd) + # Create the backup tarballs and store in ATARDIR + for atardir_set in atardir_sets: + archive.execute_backup_dataset(atardir_set) if __name__ == '__main__':