From b58f5069b9060aedf3ab00cb12afba197ed9be40 Mon Sep 17 00:00:00 2001 From: David Huber Date: Thu, 10 Apr 2025 12:36:28 -0500 Subject: [PATCH 1/9] Squash-merge feature/err_gdas --- jobs/JGDAS_AERO_ANALYSIS_GENERATE_BMATRIX | 12 ++++++------ jobs/JGDAS_ENKF_ECEN_FV3JEDI | 16 +++++++++------- jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_ECEN | 13 +++++++------ jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE | 12 ++++++------ jobs/JGLOBAL_AERO_ANALYSIS_INITIALIZE | 8 +++----- jobs/JGLOBAL_AERO_ANALYSIS_VARIATIONAL | 8 +++----- jobs/JGLOBAL_ATMENS_ANALYSIS_FINALIZE | 14 ++++++++------ jobs/JGLOBAL_ATMENS_ANALYSIS_FV3_INCREMENT | 8 +++----- jobs/JGLOBAL_ATMENS_ANALYSIS_INITIALIZE | 8 +++----- jobs/JGLOBAL_ATMENS_ANALYSIS_LETKF | 8 +++----- jobs/JGLOBAL_ATMENS_ANALYSIS_OBS | 8 +++----- jobs/JGLOBAL_ATMENS_ANALYSIS_SOL | 8 +++----- jobs/JGLOBAL_ATMOS_ANALYSIS_CALC_FV3JEDI | 14 ++++++++------ jobs/JGLOBAL_ATM_ANALYSIS_FINALIZE | 14 ++++++++------ jobs/JGLOBAL_ATM_ANALYSIS_FV3_INCREMENT | 8 +++----- jobs/JGLOBAL_ATM_ANALYSIS_INITIALIZE | 8 +++----- jobs/JGLOBAL_ATM_ANALYSIS_VARIATIONAL | 8 +++----- jobs/JGLOBAL_ATM_PREP_IODA_OBS | 11 +++++------ jobs/JGLOBAL_MARINE_ANALYSIS_CHECKPOINT | 8 +++----- jobs/JGLOBAL_MARINE_ANALYSIS_FINALIZE | 13 +++++++------ jobs/JGLOBAL_MARINE_ANALYSIS_INITIALIZE | 8 +++----- jobs/JGLOBAL_MARINE_ANALYSIS_LETKF | 12 ++++++------ jobs/JGLOBAL_MARINE_ANALYSIS_VARIATIONAL | 8 +++----- jobs/JGLOBAL_MARINE_BMAT | 8 +++----- jobs/JGLOBAL_SNOWENS_ANALYSIS | 12 ++++++------ jobs/JGLOBAL_SNOW_ANALYSIS | 12 ++++++------ jobs/rocoto/esnowanl.sh | 4 +--- jobs/rocoto/prepatmiodaobs.sh | 4 +--- jobs/rocoto/prepoceanobs.sh | 3 +-- jobs/rocoto/snowanl.sh | 4 +--- ush/bash_utils.sh | 14 -------------- ush/load_ufsda_modules.sh | 10 ++++++++++ 32 files changed, 138 insertions(+), 168 deletions(-) diff --git a/jobs/JGDAS_AERO_ANALYSIS_GENERATE_BMATRIX b/jobs/JGDAS_AERO_ANALYSIS_GENERATE_BMATRIX index 036a75e44c3..9db420a41c3 100755 --- a/jobs/JGDAS_AERO_ANALYSIS_GENERATE_BMATRIX +++ b/jobs/JGDAS_AERO_ANALYSIS_GENERATE_BMATRIX @@ -21,11 +21,9 @@ mkdir -p "${COMOUT_CHEM_BMAT}" # Run relevant script EXSCRIPT=${GDASAEROBMATPY:-${SCRgfs}/exgdas_aero_analysis_generate_bmatrix.py} -${EXSCRIPT} -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi +${EXSCRIPT} && true +export err=$? +err_chk ############################################## # End JOB SPECIFIC work @@ -41,7 +39,9 @@ fi ########################################## # Remove the Temporary working directory ########################################## -cd "${DATAROOT}" || exit 1 +cd "${DATAROOT}" && true +export err=$? +err_chk if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGDAS_ENKF_ECEN_FV3JEDI b/jobs/JGDAS_ENKF_ECEN_FV3JEDI index c4e9473bb60..438ae6ef661 100755 --- a/jobs/JGDAS_ENKF_ECEN_FV3JEDI +++ b/jobs/JGDAS_ENKF_ECEN_FV3JEDI @@ -36,11 +36,9 @@ RUN=${GDUMP} YMD=${gPDY} HH=${gcyc} declare_from_tmpl -rx \ ############################################## EXSCRIPT=${GDASATMRUNPY:-${SCRgfs}/exgdas_enkf_ecen_fv3jedi.py} -${EXSCRIPT} -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi +${EXSCRIPT} && true +export err=$? +err_chk ############################################## # End JOB SPECIFIC work @@ -58,8 +56,12 @@ fi # Remove the Temporary working directory ############################################## -cd "${DATAROOT}" || ( echo "FATAL ERROR: ${DATAROOT} does not exist, ABORT!"; exit 1 ) -if [[ ${KEEPDATA} = "NO" ]]; then +cd "${DATAROOT}" && true +export err=$? +set +x +err_chk "FATAL ERROR: ${DATAROOT} does not exist, ABORT!" +set_trace +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 9e7a7bfc113..250fc330ea2 100755 --- a/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_ECEN +++ b/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_ECEN @@ -38,11 +38,9 @@ YMD=${PDY} HH=${cyc} declare_from_tmpl -rx \ # Run relevant script EXSCRIPT=${GDASOCNCENPY:-${HOMEgfs}/scripts/exgdas_global_marine_analysis_ecen.py} -${EXSCRIPT} -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi +${EXSCRIPT} && true +export err=$? +err_chk ############################################## # End JOB SPECIFIC work @@ -58,7 +56,10 @@ fi ########################################## # Remove the Temporary working directory ########################################## -cd "${DATAROOT}" || exit 1 +cd "${DATAROOT}" && true +export err=$? +err_chk + if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE b/jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE index f6060eedba1..5fe4e72016e 100755 --- a/jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE +++ b/jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE @@ -22,11 +22,9 @@ YMD=${PDY} HH=${cyc} declare_from_tmpl -rx \ # Run relevant script EXSCRIPT=${GDASAEROFINALPY:-${SCRgfs}/exglobal_aero_analysis_finalize.py} -${EXSCRIPT} -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi +${EXSCRIPT} && true +export err=$? +err_chk ############################################## # End JOB SPECIFIC work @@ -42,7 +40,9 @@ fi ########################################## # Remove the Temporary working directory ########################################## -cd "${DATAROOT}" || exit 1 +cd "${DATAROOT}" && true +export err=$? +err_chk if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_AERO_ANALYSIS_INITIALIZE b/jobs/JGLOBAL_AERO_ANALYSIS_INITIALIZE index e82f1cc5ca4..c86e0e37a78 100755 --- a/jobs/JGLOBAL_AERO_ANALYSIS_INITIALIZE +++ b/jobs/JGLOBAL_AERO_ANALYSIS_INITIALIZE @@ -30,11 +30,9 @@ RUN=${GDUMP} YMD=${gPDY} HH=${gcyc} declare_from_tmpl -rx \ # Run relevant script EXSCRIPT=${GDASAEROINITPY:-${SCRgfs}/exglobal_aero_analysis_initialize.py} -${EXSCRIPT} -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi +${EXSCRIPT} && true +export err=$? +err_chk ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_AERO_ANALYSIS_VARIATIONAL b/jobs/JGLOBAL_AERO_ANALYSIS_VARIATIONAL index 6b104618a06..671531928db 100755 --- a/jobs/JGLOBAL_AERO_ANALYSIS_VARIATIONAL +++ b/jobs/JGLOBAL_AERO_ANALYSIS_VARIATIONAL @@ -16,11 +16,9 @@ source "${HOMEgfs}/ush/jjob_header.sh" -e "aeroanlvar" -c "base aeroanl aeroanlv # Run relevant script EXSCRIPT=${GDASAEROVARSH:-${SCRgfs}/exglobal_aero_analysis_variational.py} -${EXSCRIPT} -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi +${EXSCRIPT} && true +export err=$? +err_chk ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_ATMENS_ANALYSIS_FINALIZE b/jobs/JGLOBAL_ATMENS_ANALYSIS_FINALIZE index 8d1e1645904..6cd90d7ad04 100755 --- a/jobs/JGLOBAL_ATMENS_ANALYSIS_FINALIZE +++ b/jobs/JGLOBAL_ATMENS_ANALYSIS_FINALIZE @@ -23,11 +23,9 @@ mkdir -m 755 -p "${COM_ATMOS_ANALYSIS_ENS}" # Run relevant script EXSCRIPT=${GDASATMENSFINALPY:-${SCRgfs}/exglobal_atmens_analysis_finalize.py} -${EXSCRIPT} -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi +${EXSCRIPT} && true +export err=$? +err_chk ############################################## # End JOB SPECIFIC work @@ -43,7 +41,11 @@ fi ########################################## # Remove the Temporary working directory ########################################## -cd "${DATAROOT}" || ( echo "FATAL ERROR: ${DATAROOT} does not exist, ABORT!"; exit 1 ) +cd "${DATAROOT}" && true +export err=$? +set +e +err_chk "FATAL ERROR: ${DATAROOT} does not exist, ABORT!" +set_trace if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_ATMENS_ANALYSIS_FV3_INCREMENT b/jobs/JGLOBAL_ATMENS_ANALYSIS_FV3_INCREMENT index 945fd0a0e05..53bbade51e9 100755 --- a/jobs/JGLOBAL_ATMENS_ANALYSIS_FV3_INCREMENT +++ b/jobs/JGLOBAL_ATMENS_ANALYSIS_FV3_INCREMENT @@ -16,11 +16,9 @@ source "${HOMEgfs}/ush/jjob_header.sh" -e "atmensanlfv3inc" -c "base atmensanl a # Run relevant script EXSCRIPT=${GDASATMENSRUNSH:-${SCRgfs}/exglobal_atmens_analysis_fv3_increment.py} -${EXSCRIPT} -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi +${EXSCRIPT} && true +export err=$? +err_chk ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_ATMENS_ANALYSIS_INITIALIZE b/jobs/JGLOBAL_ATMENS_ANALYSIS_INITIALIZE index 1439a8019fa..9bc39510a74 100755 --- a/jobs/JGLOBAL_ATMENS_ANALYSIS_INITIALIZE +++ b/jobs/JGLOBAL_ATMENS_ANALYSIS_INITIALIZE @@ -25,11 +25,9 @@ RUN=${GDUMP} YMD=${gPDY} HH=${gcyc} declare_from_tmpl -rx \ # Run relevant script EXSCRIPT=${GDASATMENSINITPY:-${SCRgfs}/exglobal_atmens_analysis_initialize.py} -${EXSCRIPT} -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi +${EXSCRIPT} && true +export err=$? +err_chk ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_ATMENS_ANALYSIS_LETKF b/jobs/JGLOBAL_ATMENS_ANALYSIS_LETKF index 5f783d89908..f07a5c54c29 100755 --- a/jobs/JGLOBAL_ATMENS_ANALYSIS_LETKF +++ b/jobs/JGLOBAL_ATMENS_ANALYSIS_LETKF @@ -16,11 +16,9 @@ source "${HOMEgfs}/ush/jjob_header.sh" -e "atmensanlletkf" -c "base atmensanl at # Run relevant script EXSCRIPT=${GDASATMENSRUNSH:-${SCRgfs}/exglobal_atmens_analysis_letkf.py} -${EXSCRIPT} -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi +${EXSCRIPT} && true +export err=$? +err_chk ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_ATMENS_ANALYSIS_OBS b/jobs/JGLOBAL_ATMENS_ANALYSIS_OBS index 9439f2e09ca..7f148112426 100755 --- a/jobs/JGLOBAL_ATMENS_ANALYSIS_OBS +++ b/jobs/JGLOBAL_ATMENS_ANALYSIS_OBS @@ -16,11 +16,9 @@ source "${HOMEgfs}/ush/jjob_header.sh" -e "atmensanlobs" -c "base atmensanl atme # Run relevant script EXSCRIPT=${GDASATMENSOBSSH:-${SCRgfs}/exglobal_atmens_analysis_obs.py} -${EXSCRIPT} -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi +${EXSCRIPT} && true +export err=$? +err_chk ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_ATMENS_ANALYSIS_SOL b/jobs/JGLOBAL_ATMENS_ANALYSIS_SOL index e413eac653f..609050d1163 100755 --- a/jobs/JGLOBAL_ATMENS_ANALYSIS_SOL +++ b/jobs/JGLOBAL_ATMENS_ANALYSIS_SOL @@ -16,11 +16,9 @@ source "${HOMEgfs}/ush/jjob_header.sh" -e "atmensanlsol" -c "base atmensanl atme # Run relevant script EXSCRIPT=${GDASATMENSSOLSH:-${SCRgfs}/exglobal_atmens_analysis_sol.py} -${EXSCRIPT} -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi +${EXSCRIPT} && true +export err=$? +err_chk ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC_FV3JEDI b/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC_FV3JEDI index 286d7c806e9..90db60c935f 100755 --- a/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC_FV3JEDI +++ b/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC_FV3JEDI @@ -33,11 +33,9 @@ RUN=${GDUMP} YMD=${gPDY} HH=${gcyc} declare_from_tmpl -rx \ ############################################## EXSCRIPT=${GDASATMRUNPY:-${SCRgfs}/exglobal_atmos_analysis_calc_fv3jedi.py} -${EXSCRIPT} -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi +${EXSCRIPT} && true +export err=$? +err_chk # Write analysis log file echo "${rCDUMP} ${PDY}${cyc} atmanl and sfcanl done at $(date)" > "${COMOUT_ATMOS_ANALYSIS}/${RUN}.t${cyc}z.loganl.txt" @@ -58,7 +56,11 @@ fi # Remove the Temporary working directory ############################################## -cd "${DATAROOT}" || ( echo "FATAL ERROR: ${DATAROOT} does not exist, ABORT!"; exit 1 ) +cd "${DATAROOT}" && true +export err=$? +set +x +err_chk "FATAL ERROR: ${DATAROOT} does not exist, ABORT!" +set_trace if [[ ${KEEPDATA} = "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_ATM_ANALYSIS_FINALIZE b/jobs/JGLOBAL_ATM_ANALYSIS_FINALIZE index 08105e38cd0..9e1e8cc80c8 100755 --- a/jobs/JGLOBAL_ATM_ANALYSIS_FINALIZE +++ b/jobs/JGLOBAL_ATM_ANALYSIS_FINALIZE @@ -33,11 +33,9 @@ mkdir -m 775 -p "${COM_ATMOS_ANALYSIS}" # Run relevant script EXSCRIPT=${GDASATMFINALPY:-${SCRgfs}/exglobal_atm_analysis_finalize.py} -${EXSCRIPT} -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi +${EXSCRIPT} && true +export err=$? +err_chk ############################################## # End JOB SPECIFIC work @@ -53,7 +51,11 @@ fi ########################################## # Remove the Temporary working directory ########################################## -cd "${DATAROOT}" || ( echo "FATAL ERROR: ${DATAROOT} does not exist, ABORT!"; exit 1 ) +cd "${DATAROOT}" && true +export err=$? +set +x +err_chk "FATAL ERROR: ${DATAROOT} does not exist, ABORT!" +set_trace if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_ATM_ANALYSIS_FV3_INCREMENT b/jobs/JGLOBAL_ATM_ANALYSIS_FV3_INCREMENT index 8c4c7823542..d962c826b41 100755 --- a/jobs/JGLOBAL_ATM_ANALYSIS_FV3_INCREMENT +++ b/jobs/JGLOBAL_ATM_ANALYSIS_FV3_INCREMENT @@ -18,11 +18,9 @@ source "${HOMEgfs}/ush/jjob_header.sh" -e "atmanlfv3inc" -c "base atmanl atmanlf # Run relevant script EXSCRIPT=${GDASATMRUNSH:-${SCRgfs}/exglobal_atm_analysis_fv3_increment.py} -${EXSCRIPT} -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi +${EXSCRIPT} && true +export err=$? +err_chk ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_ATM_ANALYSIS_INITIALIZE b/jobs/JGLOBAL_ATM_ANALYSIS_INITIALIZE index 917f83de650..682056a8142 100755 --- a/jobs/JGLOBAL_ATM_ANALYSIS_INITIALIZE +++ b/jobs/JGLOBAL_ATM_ANALYSIS_INITIALIZE @@ -36,11 +36,9 @@ mkdir -m 775 -p "${COM_ATMOS_ANALYSIS}" # Run relevant script EXSCRIPT=${GDASATMINITPY:-${SCRgfs}/exglobal_atm_analysis_initialize.py} -${EXSCRIPT} -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi +${EXSCRIPT} && true +export err=$? +err_chk ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_ATM_ANALYSIS_VARIATIONAL b/jobs/JGLOBAL_ATM_ANALYSIS_VARIATIONAL index 7f00ab9da78..7458f0aec15 100755 --- a/jobs/JGLOBAL_ATM_ANALYSIS_VARIATIONAL +++ b/jobs/JGLOBAL_ATM_ANALYSIS_VARIATIONAL @@ -18,11 +18,9 @@ source "${HOMEgfs}/ush/jjob_header.sh" -e "atmanlvar" -c "base atmanl atmanlvar" # Run relevant script EXSCRIPT=${GDASATMRUNSH:-${SCRgfs}/exglobal_atm_analysis_variational.py} -${EXSCRIPT} -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi +${EXSCRIPT} && true +export err=$? +err_chk ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_ATM_PREP_IODA_OBS b/jobs/JGLOBAL_ATM_PREP_IODA_OBS index 0572e978a2c..ed8e0fd204e 100755 --- a/jobs/JGLOBAL_ATM_PREP_IODA_OBS +++ b/jobs/JGLOBAL_ATM_PREP_IODA_OBS @@ -17,12 +17,11 @@ YMD=${PDY} HH=${cyc} declare_from_tmpl -rx COM_OBS ############################################################### # Run relevant script EXSCRIPT=${BUFR2IODASH:-${USHgfs}/run_bufr2ioda.py} -${EXSCRIPT} "${PDY}${cyc}" "${RUN}" "${DMPDIR}" "${PARMgfs}/gdas/ioda/bufr2ioda" "${COM_OBS}/" -err=$? -if [[ ${err} -ne 0 ]]; then - echo "FATAL ERROR: Error executing ${EXSCRIPT}" - exit "${err}" -fi +${EXSCRIPT} "${PDY}${cyc}" "${RUN}" "${DMPDIR}" "${PARMgfs}/gdas/ioda/bufr2ioda" "${COM_OBS}/" && true +export err=$? +set +x +err_chk "FATAL ERROR: Error executing ${EXSCRIPT}" +set_trace ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_MARINE_ANALYSIS_CHECKPOINT b/jobs/JGLOBAL_MARINE_ANALYSIS_CHECKPOINT index de35b07a3cc..0f67475525a 100755 --- a/jobs/JGLOBAL_MARINE_ANALYSIS_CHECKPOINT +++ b/jobs/JGLOBAL_MARINE_ANALYSIS_CHECKPOINT @@ -18,11 +18,9 @@ source "${HOMEgfs}/ush/jjob_header.sh" -e "marineanlchkpt" -c "base marineanl ma # Run relevant script EXSCRIPT=${GDASMARINEANALYSIS:-${SCRgfs}/exglobal_marine_analysis_checkpoint.py} -${EXSCRIPT} -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi +${EXSCRIPT} && true +export err=$? +err_chk ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_MARINE_ANALYSIS_FINALIZE b/jobs/JGLOBAL_MARINE_ANALYSIS_FINALIZE index 8598d97c9f2..ee0828c69e4 100755 --- a/jobs/JGLOBAL_MARINE_ANALYSIS_FINALIZE +++ b/jobs/JGLOBAL_MARINE_ANALYSIS_FINALIZE @@ -30,16 +30,17 @@ mkdir -p "${COMOUT_ICE_RESTART}" ############################################################### EXSCRIPT=${GDASMARINEANALYSIS:-${SCRgfs}/exglobal_marine_analysis_finalize.py} -${EXSCRIPT} -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi +${EXSCRIPT} && true +export err=$? +err_chk ########################################## # Remove the Temporary working directory ########################################## -cd "${DATAROOT}" || exit 1 +cd "${DATAROOT}" && true +export err=$? +err_chk + if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_MARINE_ANALYSIS_INITIALIZE b/jobs/JGLOBAL_MARINE_ANALYSIS_INITIALIZE index c474ed35492..6394f71b5f2 100755 --- a/jobs/JGLOBAL_MARINE_ANALYSIS_INITIALIZE +++ b/jobs/JGLOBAL_MARINE_ANALYSIS_INITIALIZE @@ -36,11 +36,9 @@ YMD=${PDY} HH=${cyc} declare_from_tmpl -rx \ # Run relevant script EXSCRIPT=${GDASMARINEANALYSIS:-${SCRgfs}/exglobal_marine_analysis_initialize.py} -${EXSCRIPT} -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi +${EXSCRIPT} && true +export err=$? +err_chk ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_MARINE_ANALYSIS_LETKF b/jobs/JGLOBAL_MARINE_ANALYSIS_LETKF index 2c7d9e9774a..f8ba69150b2 100755 --- a/jobs/JGLOBAL_MARINE_ANALYSIS_LETKF +++ b/jobs/JGLOBAL_MARINE_ANALYSIS_LETKF @@ -38,11 +38,9 @@ YMD=${PDY} HH=${cyc} declare_from_tmpl -rx \ # Run relevant script EXSCRIPT=${GDASOCNLETKFPY:-${HOMEgfs}/scripts/exglobal_marine_analysis_letkf.py} -${EXSCRIPT} -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi +${EXSCRIPT} && true +export err=$? +err_chk ############################################## # End JOB SPECIFIC work @@ -58,7 +56,9 @@ fi ########################################## # Remove the Temporary working directory ########################################## -cd "${DATAROOT}" || exit 1 +cd "${DATAROOT}" && true +export err=$? +err_chk if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_MARINE_ANALYSIS_VARIATIONAL b/jobs/JGLOBAL_MARINE_ANALYSIS_VARIATIONAL index 825310ab86b..035e3ce7b6e 100755 --- a/jobs/JGLOBAL_MARINE_ANALYSIS_VARIATIONAL +++ b/jobs/JGLOBAL_MARINE_ANALYSIS_VARIATIONAL @@ -20,11 +20,9 @@ source "${HOMEgfs}/ush/jjob_header.sh" -e "marineanlvar" -c "base marineanl mari # Run relevant script EXSCRIPT=${GDASMARINERUNSH:-${SCRgfs}/exglobal_marine_analysis_variational.py} -${EXSCRIPT} -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi +${EXSCRIPT} && true +export err=$? +err_chk ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_MARINE_BMAT b/jobs/JGLOBAL_MARINE_BMAT index 6ec3bfcfccb..85e0ff7046f 100755 --- a/jobs/JGLOBAL_MARINE_BMAT +++ b/jobs/JGLOBAL_MARINE_BMAT @@ -47,11 +47,9 @@ mkdir -p "${COMOUT_ICE_BMATRIX}" # Run relevant script EXSCRIPT=${GDASMARINEBMATRUNPY:-${SCRgfs}/exglobal_marinebmat.py} -${EXSCRIPT} -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi +${EXSCRIPT} && true +export err=$? +err_chk ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_SNOWENS_ANALYSIS b/jobs/JGLOBAL_SNOWENS_ANALYSIS index ee7c95750e1..2b9ec2b6446 100755 --- a/jobs/JGLOBAL_SNOWENS_ANALYSIS +++ b/jobs/JGLOBAL_SNOWENS_ANALYSIS @@ -45,11 +45,9 @@ mkdir -p "${COMOUT_SNOW_ANALYSIS}" "${COMOUT_CONF}" # Run relevant script EXSCRIPT=${SNOWANLPY:-${SCRgfs}/exglobal_snowens_analysis.py} -${EXSCRIPT} -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi +${EXSCRIPT} && true +export err=$? +err_chk ############################################## # End JOB SPECIFIC work @@ -65,7 +63,9 @@ fi ########################################## # Remove the Temporary working directory ########################################## -cd "${DATAROOT}" || exit 1 +cd "${DATAROOT}" && true +export err=$? +err_chk if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/JGLOBAL_SNOW_ANALYSIS b/jobs/JGLOBAL_SNOW_ANALYSIS index 07d4a3647bb..64d37e2b3e7 100755 --- a/jobs/JGLOBAL_SNOW_ANALYSIS +++ b/jobs/JGLOBAL_SNOW_ANALYSIS @@ -30,11 +30,9 @@ mkdir -m 775 -p "${COMOUT_SNOW_ANALYSIS}" "${COMOUT_CONF}" # Run relevant script EXSCRIPT=${SNOWANLPY:-${SCRgfs}/exglobal_snow_analysis.py} -${EXSCRIPT} -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi +${EXSCRIPT} && true +export err=$? +err_chk ############################################## # End JOB SPECIFIC work @@ -50,7 +48,9 @@ fi ########################################## # Remove the Temporary working directory ########################################## -cd "${DATAROOT}" || exit 1 +cd "${DATAROOT}" && true +export err=$? +err_chk if [[ "${KEEPDATA}" == "NO" ]]; then rm -rf "${DATA}" fi diff --git a/jobs/rocoto/esnowanl.sh b/jobs/rocoto/esnowanl.sh index c7c11e91105..c3969f85acd 100755 --- a/jobs/rocoto/esnowanl.sh +++ b/jobs/rocoto/esnowanl.sh @@ -1,7 +1,5 @@ #! /usr/bin/env bash -source "${HOMEgfs}/ush/preamble.sh" - ############################################################### # Source UFSDA workflow modules . "${HOMEgfs}/ush/load_ufsda_modules.sh" @@ -16,7 +14,7 @@ export jobid="${job}.$$" ############################################################### # setup python path for ioda utilities # shellcheck disable=SC2311 -pyiodaPATH="${HOMEgfs}/sorc/gdas.cd/build/lib/python$(detect_py_ver)/" +pyiodaPATH="${HOMEgfs}/sorc/gdas.cd/build/lib/python${PYTHON_VERSION}/" gdasappPATH="${HOMEgfs}/sorc/gdas.cd/sorc/iodaconv/src:${pyiodaPATH}" PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}:${gdasappPATH}" export PYTHONPATH diff --git a/jobs/rocoto/prepatmiodaobs.sh b/jobs/rocoto/prepatmiodaobs.sh index 9f0ee630ade..681a78f6153 100755 --- a/jobs/rocoto/prepatmiodaobs.sh +++ b/jobs/rocoto/prepatmiodaobs.sh @@ -1,7 +1,5 @@ #! /usr/bin/env bash -source "${HOMEgfs}/ush/preamble.sh" - ############################################################### # Source UFSDA workflow modules . "${HOMEgfs}/ush/load_ufsda_modules.sh" @@ -16,7 +14,7 @@ export jobid="${job}.$$" ############################################################### # setup python path for ioda utilities # shellcheck disable=SC2311 -pyiodaPATH="${HOMEgfs}/sorc/gdas.cd/build/lib/python$(detect_py_ver)/" +pyiodaPATH="${HOMEgfs}/sorc/gdas.cd/build/lib/python${PYTHON_VERSION}/" PYTHONPATH="${pyiodaPATH}:${PYTHONPATH}" export PYTHONPATH diff --git a/jobs/rocoto/prepoceanobs.sh b/jobs/rocoto/prepoceanobs.sh index c79881c1674..090a08fc8f3 100755 --- a/jobs/rocoto/prepoceanobs.sh +++ b/jobs/rocoto/prepoceanobs.sh @@ -1,7 +1,6 @@ #! /usr/bin/env bash export STRICT="NO" -source "${HOMEgfs}/ush/preamble.sh" ############################################################### # Source UFSDA workflow modules @@ -17,7 +16,7 @@ export jobid="${job}.$$" ############################################################### # setup python path for class defs and utils # shellcheck disable=SC2311 -pyiodaPATH="${HOMEgfs}/sorc/gdas.cd/build/lib/python$(detect_py_ver)/" +pyiodaPATH="${HOMEgfs}/sorc/gdas.cd/build/lib/python${PYTHON_VERSION}/" PYTHONPATH="${pyiodaPATH}:${PYTHONPATH}" export PYTHONPATH diff --git a/jobs/rocoto/snowanl.sh b/jobs/rocoto/snowanl.sh index a0c8395019e..be1e7a7eb94 100755 --- a/jobs/rocoto/snowanl.sh +++ b/jobs/rocoto/snowanl.sh @@ -1,7 +1,5 @@ #! /usr/bin/env bash -source "${HOMEgfs}/ush/preamble.sh" - ############################################################### # Source UFSDA workflow modules . "${HOMEgfs}/ush/load_ufsda_modules.sh" @@ -16,7 +14,7 @@ export jobid="${job}.$$" ############################################################### # setup python path for ioda utilities # shellcheck disable=SC2311 -pyiodaPATH="${HOMEgfs}/sorc/gdas.cd/build/lib/python$(detect_py_ver)/" +pyiodaPATH="${HOMEgfs}/sorc/gdas.cd/build/lib/python${PYTHON_VERSION}/" gdasappPATH="${HOMEgfs}/sorc/gdas.cd/sorc/iodaconv/src:${pyiodaPATH}" PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}:${gdasappPATH}" export PYTHONPATH diff --git a/ush/bash_utils.sh b/ush/bash_utils.sh index 9aec7f4ee1b..c9bf137d4a9 100755 --- a/ush/bash_utils.sh +++ b/ush/bash_utils.sh @@ -106,21 +106,7 @@ function wait_for_file() { return 1 } -function detect_py_ver() { - # - # Returns the major.minor version of the currently active python executable - # - regex="[0-9]+\.[0-9]+" - # shellcheck disable=SC2312 - if [[ $(python --version) =~ ${regex} ]]; then - echo "${BASH_REMATCH[0]}" - else - echo "FATAL ERROR: Could not detect the python version" - exit 1 - fi -} # shellcheck disable= declare -xf declare_from_tmpl declare -xf wait_for_file -declare -xf detect_py_ver diff --git a/ush/load_ufsda_modules.sh b/ush/load_ufsda_modules.sh index e66a1b16a4c..df44765f0bc 100755 --- a/ush/load_ufsda_modules.sh +++ b/ush/load_ufsda_modules.sh @@ -78,6 +78,16 @@ wxflowPATH="${HOMEgfs}/ush/python" PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${HOMEgfs}/ush:${wxflowPATH}" export PYTHONPATH +# Detect the Python major.minor version +_regex="[0-9]+\.[0-9]+" +# shellcheck disable=SC2312 +if [[ $(python --version) =~ ${_regex} ]]; then + export PYTHON_VERSION="${BASH_REMATCH[0]}" +else + echo "FATAL ERROR: Could not detect the python version" + exit 1 +fi + # Restore stack soft limit: ulimit -S -s "${ulimit_s}" unset ulimit_s From bd625d21319747bec7ebdfbea5fa0acd5565a731 Mon Sep 17 00:00:00 2001 From: David Huber Date: Thu, 10 Apr 2025 14:25:15 -0500 Subject: [PATCH 2/9] Call err_chk for fatal errors in post jobs (excluding waves) --- jobs/JGDAS_ATMOS_GEMPAK | 6 ++-- jobs/JGDAS_ATMOS_GEMPAK_META_NCDC | 14 +++++---- jobs/JGFS_ATMOS_AWIPS_20KM_1P0DEG | 2 +- jobs/JGFS_ATMOS_FBWIND | 2 +- jobs/JGFS_ATMOS_GEMPAK | 35 +++++++++++++-------- jobs/JGFS_ATMOS_GEMPAK_META | 2 +- jobs/JGFS_ATMOS_GEMPAK_PGRB2_SPEC | 2 +- jobs/JGFS_ATMOS_PGRB2_SPEC_NPOESS | 2 +- jobs/JGFS_ATMOS_POSTSND | 8 ++--- jobs/JGLOBAL_ATMOS_POST_MANAGER | 3 +- jobs/JGLOBAL_ATMOS_PRODUCTS | 8 ++--- jobs/JGLOBAL_ATMOS_UPP | 8 ++--- jobs/JGLOBAL_CLEANUP | 8 ++--- jobs/JGLOBAL_OCEANICE_PRODUCTS | 8 ++--- scripts/exgdas_atmos_gempak_gif_ncdc.sh | 18 ++++++----- scripts/exgdas_atmos_nawips.sh | 15 +++++---- scripts/exgfs_atmos_awips_20km_1p0deg.sh | 28 +++++++---------- scripts/exgfs_atmos_fbwind.sh | 2 +- scripts/exgfs_atmos_gempak_meta.sh | 5 ++- scripts/exgfs_atmos_goes_nawips.sh | 11 ++++--- scripts/exgfs_atmos_grib2_special_npoess.sh | 8 ++--- scripts/exgfs_atmos_nawips.sh | 11 ++++--- scripts/exgfs_atmos_postsnd.sh | 6 +++- scripts/exglobal_atmos_pmgr.sh | 2 +- scripts/exglobal_atmos_products.sh | 12 +++---- 25 files changed, 116 insertions(+), 110 deletions(-) diff --git a/jobs/JGDAS_ATMOS_GEMPAK b/jobs/JGDAS_ATMOS_GEMPAK index 796c537ad70..cad337f86d8 100755 --- a/jobs/JGDAS_ATMOS_GEMPAK +++ b/jobs/JGDAS_ATMOS_GEMPAK @@ -33,13 +33,15 @@ done # Execute the script for one degree grib ######################################################## -"${SCRgfs}/exgdas_atmos_nawips.sh" "1p00" "${FHR3}" "GDAS_GEMPAK" "${COMOUT_ATMOS_GEMPAK_1p00}" +"${SCRgfs}/exgdas_atmos_nawips.sh" "1p00" "${FHR3}" "GDAS_GEMPAK" "${COMOUT_ATMOS_GEMPAK_1p00}" && true + +export err=$?; err_chk ######################################################## # Execute the script for quater-degree grib ######################################################## -"${SCRgfs}/exgdas_atmos_nawips.sh" "0p25" "${FHR3}" "GDAS_GEMPAK" "${COMOUT_ATMOS_GEMPAK_0p25}" +"${SCRgfs}/exgdas_atmos_nawips.sh" "0p25" "${FHR3}" "GDAS_GEMPAK" "${COMOUT_ATMOS_GEMPAK_0p25}" && true export err=$?; err_chk diff --git a/jobs/JGDAS_ATMOS_GEMPAK_META_NCDC b/jobs/JGDAS_ATMOS_GEMPAK_META_NCDC index 89a4856fde4..7b5c17eb532 100755 --- a/jobs/JGDAS_ATMOS_GEMPAK_META_NCDC +++ b/jobs/JGDAS_ATMOS_GEMPAK_META_NCDC @@ -54,14 +54,17 @@ export pgmout=OUTPUT.$$ ######################################################## # Execute the script. -"${HOMEgfs}/gempak/ush/gdas_meta_na.sh" +"${HOMEgfs}/gempak/ush/gdas_meta_na.sh" && true export err=$?; err_chk -"${HOMEgfs}/gempak/ush/gdas_meta_loop.sh" + +"${HOMEgfs}/gempak/ush/gdas_meta_loop.sh" && true export err=$?; err_chk + if [[ "${cyc}" == '06' ]]; then - "${HOMEgfs}/gempak/ush/gdas_ecmwf_meta_ver.sh" + "${HOMEgfs}/gempak/ush/gdas_ecmwf_meta_ver.sh" && true export err=$?; err_chk - "${HOMEgfs}/gempak/ush/gdas_ukmet_meta_ver.sh" + + "${HOMEgfs}/gempak/ush/gdas_ukmet_meta_ver.sh" && true export err=$?; err_chk fi ######################################################## @@ -73,7 +76,7 @@ fi ######################################################## # Execute the script. if (( cyc%12 == 0 )); then - "${SCRgfs}/exgdas_atmos_gempak_gif_ncdc.sh" + "${SCRgfs}/exgdas_atmos_gempak_gif_ncdc.sh" && true fi export err=$?; err_chk ######################################################## @@ -91,4 +94,3 @@ fi if [[ "${KEEPDATA}" != "YES" ]] ; then rm -rf "${DATA}" fi - diff --git a/jobs/JGFS_ATMOS_AWIPS_20KM_1P0DEG b/jobs/JGFS_ATMOS_AWIPS_20KM_1P0DEG index 3d55b9c1f5b..ea77e398e5d 100755 --- a/jobs/JGFS_ATMOS_AWIPS_20KM_1P0DEG +++ b/jobs/JGFS_ATMOS_AWIPS_20KM_1P0DEG @@ -37,7 +37,7 @@ export pgmout=OUTPUT.$$ ######################################################## # Execute the script. -"${SCRgfs}/exgfs_atmos_awips_20km_1p0deg.sh" "${fcsthrs}" +"${SCRgfs}/exgfs_atmos_awips_20km_1p0deg.sh" "${fcsthrs}" && true export err=$?; err_chk ######################################################## diff --git a/jobs/JGFS_ATMOS_FBWIND b/jobs/JGFS_ATMOS_FBWIND index dfd91ad24a9..5255cb530cd 100755 --- a/jobs/JGFS_ATMOS_FBWIND +++ b/jobs/JGFS_ATMOS_FBWIND @@ -29,7 +29,7 @@ export DBNROOT=${DBNROOT:-${UTILROOT}/fakedbn} ######################################################## # Execute the script. -"${SCRgfs}/exgfs_atmos_fbwind.sh" +"${SCRgfs}/exgfs_atmos_fbwind.sh" && true export err=$?;err_chk ######################################################## diff --git a/jobs/JGFS_ATMOS_GEMPAK b/jobs/JGFS_ATMOS_GEMPAK index 7fbe433f357..66b797a0a34 100755 --- a/jobs/JGFS_ATMOS_GEMPAK +++ b/jobs/JGFS_ATMOS_GEMPAK @@ -45,7 +45,8 @@ fhmin=0 fhmax=240 if (( fhr >= fhmin && fhr <= fhmax )); then if ((fhr % 3 == 0)); then - "${SCRgfs}/exgfs_atmos_nawips.sh" "1p00" "${FHR3}" "GFS_GEMPAK" "${COMOUT_ATMOS_GEMPAK_1p00}" + "${SCRgfs}/exgfs_atmos_nawips.sh" "1p00" "${FHR3}" "GFS_GEMPAK" "${COMOUT_ATMOS_GEMPAK_1p00}" && true + export err=$?; err_chk fi fi @@ -53,7 +54,8 @@ fhmin=252 fhmax=384 if (( fhr >= fhmin && fhr <= fhmax )); then if ((fhr % 12 == 0)); then - "${SCRgfs}/exgfs_atmos_nawips.sh" "1p00" "${FHR3}" "GFS_GEMPAK" "${COMOUT_ATMOS_GEMPAK_1p00}" + "${SCRgfs}/exgfs_atmos_nawips.sh" "1p00" "${FHR3}" "GFS_GEMPAK" "${COMOUT_ATMOS_GEMPAK_1p00}" && true + export err=$?; err_chk fi fi @@ -64,7 +66,8 @@ fhmin=0 fhmax=240 if (( fhr >= fhmin && fhr <= fhmax )); then if ((fhr % 3 == 0)); then - "${SCRgfs}/exgfs_atmos_nawips.sh" "0p50" "${FHR3}" "GFS_GEMPAK" "${COMOUT_ATMOS_GEMPAK_0p50}" + "${SCRgfs}/exgfs_atmos_nawips.sh" "0p50" "${FHR3}" "GFS_GEMPAK" "${COMOUT_ATMOS_GEMPAK_0p50}" && true + export err=$?; err_chk fi fi @@ -72,7 +75,8 @@ fhmin=246 fhmax=276 if (( fhr >= fhmin && fhr <= fhmax )); then if ((fhr % 6 == 0)); then - "${SCRgfs}/exgfs_atmos_nawips.sh" "0p50" "${FHR3}" "GFS_GEMPAK" "${COMOUT_ATMOS_GEMPAK_0p50}" + "${SCRgfs}/exgfs_atmos_nawips.sh" "0p50" "${FHR3}" "GFS_GEMPAK" "${COMOUT_ATMOS_GEMPAK_0p50}" && true + export err=$?; err_chk fi fi @@ -80,7 +84,8 @@ fhmin=288 fhmax=384 if (( fhr >= fhmin && fhr <= fhmax )); then if ((fhr % 12 == 0)); then - "${SCRgfs}/exgfs_atmos_nawips.sh" "0p50" "${FHR3}" "GFS_GEMPAK" "${COMOUT_ATMOS_GEMPAK_0p50}" + "${SCRgfs}/exgfs_atmos_nawips.sh" "0p50" "${FHR3}" "GFS_GEMPAK" "${COMOUT_ATMOS_GEMPAK_0p50}" && true + export err=$?; err_chk fi fi @@ -91,7 +96,8 @@ fhmin=0 fhmax=120 if (( fhr >= fhmin && fhr <= fhmax )); then if ((fhr % 1 == 0)); then - "${SCRgfs}/exgfs_atmos_nawips.sh" "0p25" "${FHR3}" "GFS_GEMPAK" "${COMOUT_ATMOS_GEMPAK_0p25}" + "${SCRgfs}/exgfs_atmos_nawips.sh" "0p25" "${FHR3}" "GFS_GEMPAK" "${COMOUT_ATMOS_GEMPAK_0p25}" && true + export err=$?; err_chk fi fi @@ -99,7 +105,8 @@ fhmin=123 fhmax=240 if (( fhr >= fhmin && fhr <= fhmax )); then if ((fhr % 3 == 0)); then - "${SCRgfs}/exgfs_atmos_nawips.sh" "0p25" "${FHR3}" "GFS_GEMPAK" "${COMOUT_ATMOS_GEMPAK_0p25}" + "${SCRgfs}/exgfs_atmos_nawips.sh" "0p25" "${FHR3}" "GFS_GEMPAK" "${COMOUT_ATMOS_GEMPAK_0p25}" && true + export err=$?; err_chk fi fi @@ -107,7 +114,8 @@ fhmin=252 fhmax=384 if (( fhr >= fhmin && fhr <= fhmax )); then if ((fhr % 12 == 0)); then - "${SCRgfs}/exgfs_atmos_nawips.sh" "0p25" "${FHR3}" "GFS_GEMPAK" "${COMOUT_ATMOS_GEMPAK_0p25}" + "${SCRgfs}/exgfs_atmos_nawips.sh" "0p25" "${FHR3}" "GFS_GEMPAK" "${COMOUT_ATMOS_GEMPAK_0p25}" && true + export err=$?; err_chk fi fi @@ -118,16 +126,17 @@ fhmin=0 fhmax="${ocean_domain_max}" if (( fhr >= fhmin && fhr <= fhmax )); then if ((fhr % 3 == 0)); then - "${SCRgfs}/exgfs_atmos_nawips.sh" "35km_pac" "${FHR3}" "GFS_GEMPAK_WWB" "${COMOUT_ATMOS_GEMPAK_35km_pac}" + "${SCRgfs}/exgfs_atmos_nawips.sh" "35km_pac" "${FHR3}" "GFS_GEMPAK_WWB" "${COMOUT_ATMOS_GEMPAK_35km_pac}" && true + export err=$?; err_chk - "${SCRgfs}/exgfs_atmos_nawips.sh" "35km_atl" "${FHR3}" "GFS_GEMPAK_WWB" "${COMOUT_ATMOS_GEMPAK_35km_atl}" + "${SCRgfs}/exgfs_atmos_nawips.sh" "35km_atl" "${FHR3}" "GFS_GEMPAK_WWB" "${COMOUT_ATMOS_GEMPAK_35km_atl}" && true + export err=$?; err_chk - "${SCRgfs}/exgfs_atmos_nawips.sh" "40km" "${FHR3}" "GFS_GEMPAK_WWB" "${COMOUT_ATMOS_GEMPAK_40km}" + "${SCRgfs}/exgfs_atmos_nawips.sh" "40km" "${FHR3}" "GFS_GEMPAK_WWB" "${COMOUT_ATMOS_GEMPAK_40km}" && true + export err=$?; err_chk fi fi -export err=$?; err_chk - ############################################ # print exec I/O output ############################################ diff --git a/jobs/JGFS_ATMOS_GEMPAK_META b/jobs/JGFS_ATMOS_GEMPAK_META index 79696e6e902..5e51f069079 100755 --- a/jobs/JGFS_ATMOS_GEMPAK_META +++ b/jobs/JGFS_ATMOS_GEMPAK_META @@ -60,7 +60,7 @@ fi ######################################################## # Execute the script. -"${SCRgfs}/exgfs_atmos_gempak_meta.sh" +"${SCRgfs}/exgfs_atmos_gempak_meta.sh" && true export err=$?; err_chk ######################################################## diff --git a/jobs/JGFS_ATMOS_GEMPAK_PGRB2_SPEC b/jobs/JGFS_ATMOS_GEMPAK_PGRB2_SPEC index 557ce93f9ed..6aab8aadf10 100755 --- a/jobs/JGFS_ATMOS_GEMPAK_PGRB2_SPEC +++ b/jobs/JGFS_ATMOS_GEMPAK_PGRB2_SPEC @@ -47,7 +47,7 @@ export RUN2=gfs_goessim221 export GRIB=goessimpgrb2f export EXT=".grd221" -"${SCRgfs}/exgfs_atmos_goes_nawips.sh" "${FHR3}" +"${SCRgfs}/exgfs_atmos_goes_nawips.sh" "${FHR3}" && true export err=$?; err_chk diff --git a/jobs/JGFS_ATMOS_PGRB2_SPEC_NPOESS b/jobs/JGFS_ATMOS_PGRB2_SPEC_NPOESS index e0bcf0b5029..e29afea70f0 100755 --- a/jobs/JGFS_ATMOS_PGRB2_SPEC_NPOESS +++ b/jobs/JGFS_ATMOS_PGRB2_SPEC_NPOESS @@ -30,7 +30,7 @@ mkdir -m 775 -p "${COMOUT_ATMOS_GOES}" ############################################################# # Execute the script -"${SCRgfs}/exgfs_atmos_grib2_special_npoess.sh" +"${SCRgfs}/exgfs_atmos_grib2_special_npoess.sh" && true export err=$?;err_chk ############################################################# diff --git a/jobs/JGFS_ATMOS_POSTSND b/jobs/JGFS_ATMOS_POSTSND index 322ee1b692e..a288da841d6 100755 --- a/jobs/JGFS_ATMOS_POSTSND +++ b/jobs/JGFS_ATMOS_POSTSND @@ -39,12 +39,8 @@ fi ######################################################## # Execute the script. -${SCRgfs}/exgfs_atmos_postsnd.sh -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi - +${SCRgfs}/exgfs_atmos_postsnd.sh && true +export err=$?; err_chk ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_ATMOS_POST_MANAGER b/jobs/JGLOBAL_ATMOS_POST_MANAGER index f3d320ec93b..44ac5b9d9b5 100755 --- a/jobs/JGLOBAL_ATMOS_POST_MANAGER +++ b/jobs/JGLOBAL_ATMOS_POST_MANAGER @@ -20,6 +20,7 @@ YMD=${PDY} HH=${cyc} declare_from_tmpl -rx COMIN_ATMOS_HISTORY:COM_ATMOS_HISTORY ######################################################## # Execute the script. -${SCRgfs}/exglobal_atmos_pmgr.sh +${SCRgfs}/exglobal_atmos_pmgr.sh && true +export err=$?; err_chk ######################################################## diff --git a/jobs/JGLOBAL_ATMOS_PRODUCTS b/jobs/JGLOBAL_ATMOS_PRODUCTS index 5c48c18ac62..80218e5e551 100755 --- a/jobs/JGLOBAL_ATMOS_PRODUCTS +++ b/jobs/JGLOBAL_ATMOS_PRODUCTS @@ -24,11 +24,9 @@ export PREFIX="${RUN}.t${cyc}z." ############################################################### # Run exglobal script -"${SCRgfs}/exglobal_atmos_products.sh" -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi +"${SCRgfs}/exglobal_atmos_products.sh" && true +export err=$? +err_chk ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_ATMOS_UPP b/jobs/JGLOBAL_ATMOS_UPP index 9e8be1b47da..af7108c4e70 100755 --- a/jobs/JGLOBAL_ATMOS_UPP +++ b/jobs/JGLOBAL_ATMOS_UPP @@ -21,11 +21,9 @@ if [[ ! -d ${COMOUT_ATMOS_MASTER} ]]; then mkdir -p "${COMOUT_ATMOS_MASTER}"; fi ############################################################### # Run relevant exglobal script -"${SCRgfs}/exglobal_atmos_upp.py" -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi +"${SCRgfs}/exglobal_atmos_upp.py" && true +export err=$? +err_chk ############################################## # End JOB SPECIFIC work diff --git a/jobs/JGLOBAL_CLEANUP b/jobs/JGLOBAL_CLEANUP index 0320d8405ca..1a8bcb45f3d 100755 --- a/jobs/JGLOBAL_CLEANUP +++ b/jobs/JGLOBAL_CLEANUP @@ -2,11 +2,9 @@ source "${HOMEgfs}/ush/jjob_header.sh" -e "cleanup" -c "base cleanup" -"${SCRgfs}/exglobal_cleanup.sh" -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi +"${SCRgfs}/exglobal_cleanup.sh" && true +export err=$? +err_chk ########################################## # Remove the Temporary working directory diff --git a/jobs/JGLOBAL_OCEANICE_PRODUCTS b/jobs/JGLOBAL_OCEANICE_PRODUCTS index df90f419508..db140659529 100755 --- a/jobs/JGLOBAL_OCEANICE_PRODUCTS +++ b/jobs/JGLOBAL_OCEANICE_PRODUCTS @@ -14,11 +14,9 @@ YMD="${PDY}" HH="${cyc}" declare_from_tmpl -rx "COM_${COMPONENT^^}_NETCDF" ############################################################### # Run exglobal script -"${SCRgfs}/exglobal_oceanice_products.py" -err=$? -if [[ ${err} -ne 0 ]]; then - exit "${err}" -fi +"${SCRgfs}/exglobal_oceanice_products.py" && true +export err=$? +err_chk ############################################## # End JOB SPECIFIC work diff --git a/scripts/exgdas_atmos_gempak_gif_ncdc.sh b/scripts/exgdas_atmos_gempak_gif_ncdc.sh index 1c13464aee9..cab4eacb32a 100755 --- a/scripts/exgdas_atmos_gempak_gif_ncdc.sh +++ b/scripts/exgdas_atmos_gempak_gif_ncdc.sh @@ -19,18 +19,20 @@ if [[ ${MODEL} == GDAS ]]; then for fhr3 in ${fcsthrs}; do gempak_file="${COMIN_ATMOS_GEMPAK_1p00}/${RUN}_1p00_${PDY}${cyc}f${fhr3}" if ! wait_for_file "${gempak_file}" "${sleep_interval}" "${max_tries}" ; then - echo "FATAL ERROR: ${gempak_file} not found after ${max_tries} iterations" - exit 10 + export err=10 + err_chk "FATAL ERROR: ${gempak_file} not found after ${max_tries} iterations" fi - cp "${gempak_file}" "gem_grids${fhr3}.gem" - export err=$? - if (( err != 0 )) ; then - echo "FATAL: Could not copy ${gempak_file}" - exit "${err}" + if [[ ! -f "${gempak_file}" ]]; then + export err=1 + err_chk "FATAL: Could not copy ${gempak_file}" fi - "${HOMEgfs}/gempak/ush/gempak_${RUN}_f${fhr3}_gif.sh" + cp "${gempak_file}" "gem_grids${fhr3}.gem" + + "${HOMEgfs}/gempak/ush/gempak_${RUN}_f${fhr3}_gif.sh" && true + export err=$? + err_chk done fi diff --git a/scripts/exgdas_atmos_nawips.sh b/scripts/exgdas_atmos_nawips.sh index a2041964e2d..845891324f5 100755 --- a/scripts/exgdas_atmos_nawips.sh +++ b/scripts/exgdas_atmos_nawips.sh @@ -18,8 +18,11 @@ cd "${DATA_RUN}" || exit 1 source "${USHgfs}/product_functions.sh" for table in g2varswmo2.tbl g2vcrdwmo2.tbl g2varsncep1.tbl g2vcrdncep1.tbl; do - cp "${HOMEgfs}/gempak/fix/${table}" "${table}" || \ - ( echo "FATAL ERROR: ${table} is missing" && exit 2 ) + source_table="${HOMEgfs}/gempak/fix/${table}" + if [[ ! -f "${source_table}" ]]; then + err_exit "FATAL ERROR: ${table} is missing" + fi + cp "${source_table}" "${table}" done NAGRIB="${GEMEXE}/nagrib2" @@ -42,9 +45,8 @@ export GRIBIN="${!source_dirvar}/${model}.${cycle}.pgrb2.${grid}.f${fhr3}" GRIBIN_chk="${GRIBIN}.idx" if [[ ! -r "${GRIBIN_chk}" ]]; then - echo "FATAL ERROR: GRIB index file ${GRIBIN_chk} not found!" - export err=7 ; err_chk - exit "${err}" + export err=7 + err_chk "FATAL ERROR: GRIB index file ${GRIBIN_chk} not found!" fi cp "${GRIBIN}" "grib${fhr3}" @@ -70,7 +72,8 @@ l r EOF -export err=$?; err_chk +export err=$? +err_chk cpfs "${GEMGRD}" "${destination}/${GEMGRD}" if [[ ${SENDDBN} = "YES" ]] ; then diff --git a/scripts/exgfs_atmos_awips_20km_1p0deg.sh b/scripts/exgfs_atmos_awips_20km_1p0deg.sh index 690e9580074..e7ab46f5fbc 100755 --- a/scripts/exgfs_atmos_awips_20km_1p0deg.sh +++ b/scripts/exgfs_atmos_awips_20km_1p0deg.sh @@ -23,7 +23,7 @@ fcsthrs="$1" num=$# -if (( num != 1 )); then +if [[ ${num} -ne 1 ]]; then echo "" echo " FATAL ERROR: Incorrect number of arguments " echo "" @@ -47,7 +47,6 @@ idxfile="${COMIN_ATMOS_GRIB_0p25}/${RUN}.${cycle}.pgrb2b.0p25.f${fcsthrs}.idx" if ! wait_for_file "${idxfile}" "${sleep_interval}" "${max_tries}"; then msg="FATAL ERROR: No GFS pgrb2 file after waiting" err_exit "${msg}" - exit 5 fi ######################################## @@ -84,11 +83,10 @@ cp "${COMIN_ATMOS_GRIB_0p25}/gfs.t${cyc}z.pgrb2.0p25.f${fcsthrs}" "tmpfile2${fcs cp "${COMIN_ATMOS_GRIB_0p25}/gfs.t${cyc}z.pgrb2b.0p25.f${fcsthrs}" "tmpfile2b${fcsthrs}" cat "tmpfile2${fcsthrs}" "tmpfile2b${fcsthrs}" > "tmpfile${fcsthrs}" ${WGRIB2} "tmpfile${fcsthrs}" | grep -F -f "${PARMgfs}/product/gfs_awips_parmlist_g2" | \ - ${WGRIB2} -i -grib masterfile "tmpfile${fcsthrs}" + ${WGRIB2} -i -grib masterfile "tmpfile${fcsthrs}" && true export err=$? -if [[ $err -ne 0 ]]; then - echo " FATAL ERROR: masterfile does not exist." - exit $err +if [[ ${err} -ne 0 ]]; then + err_chk "FATAL ERROR: masterfile does not exist." fi ${WGRIB2} masterfile -match ":PWAT:entire atmosphere" -grib gfs_pwat.grb @@ -97,7 +95,7 @@ ${WGRIB2} masterfile | grep -v ":PWAT:entire atmosphere" | ${WGRIB2} -i -grib te # Process to change PWAT from level 200 to 10 (Entire Atmosphere) # in production defintion template (PDT) 4.0 ################################################################## -${WGRIB2} gfs_pwat.grb -set_byte 4 23 10 -grib gfs_pwat_levels_10.grb +${WGRIB2} gfs_pwat.grb -set_byte 4 23 10 -grib gfs_pwat_levels_10.grb && true export err=$?; err_chk cat temp_gfs gfs_pwat_levels_10.grb > tmp_masterfile @@ -138,8 +136,8 @@ for GRID in conus ak prico pac 003; do ${opt27} ${opt28} -new_grid ${grid003} "awps_file_f${fcsthrs}_${GRID}" ;; *) - echo "FATAL ERROR: Unknown output grid ${GRID}" - exit 2 + export err=2 + err_chk "FATAL ERROR: Unknown output grid ${GRID}" ;; esac trim_rh "awps_file_f${fcsthrs}_${GRID}" @@ -155,9 +153,9 @@ for GRID in conus ak prico pac 003; do numparm=247 numrec=$( ${WGRIB2} "awps_file_f${fcsthrs}_${GRID}" | wc -l ) - if (( numrec < numparm )); then + if [[ ${numrec} -lt ${numparm} ]]; then msg="FATAL ERROR: awps_file_f${fcsthrs}_${GRID} file is missing fields for AWIPS !" - err_exit "${msg}" || exit 10 + err_exit "${msg}" fi # Processing AWIPS GRIB2 grids with WMO headers @@ -173,10 +171,8 @@ for GRID in conus ak prico pac 003; do cp "${PARMgfs}/wmo/grib2_awpgfs${fcsthrs}.${GRID}" "parm_list" - ${TOCGRIB2} < "parm_list" >> "${pgmout}" 2> errfile + ${TOCGRIB2} < "parm_list" >> "${pgmout}" 2> errfile && true export err=$?; err_chk - # TODO: Should this be fatal? - echo "error from tocgrib2=${err}" ############################## # Post Files to ${COMOUT_ATMOS_WMO} @@ -202,8 +198,8 @@ for GRID in conus ak prico pac 003; do cp "${PARMgfs}/wmo/grib2_awpgfs_20km_${GRID}f${fcsthrs}" "parm_list" - ${TOCGRIB2} < "parm_list" >> "${pgmout}" 2> errfile - export err=$?; err_chk || exit "${err}" + ${TOCGRIB2} < "parm_list" >> "${pgmout}" 2> errfile && true + export err=$?; err_chk ############################## # Post Files to ${COMOUT_ATMOS_WMO} diff --git a/scripts/exgfs_atmos_fbwind.sh b/scripts/exgfs_atmos_fbwind.sh index 28943a40fae..b06ca096be9 100755 --- a/scripts/exgfs_atmos_fbwind.sh +++ b/scripts/exgfs_atmos_fbwind.sh @@ -63,7 +63,7 @@ export FORT51="tran.fbwnd_pacific" cp "${PARMgfs}/product/fbwnd_pacific.stnlist" fbwnd_pacific.stnlist -"${EXECgfs}/fbwndgfs.x" < fbwnd_pacific.stnlist >> "${pgmout}" 2> errfile +"${EXECgfs}/fbwndgfs.x" < fbwnd_pacific.stnlist >> "${pgmout}" 2> errfile && true export err=$?; err_chk "${USHgfs}/make_ntc_bull.pl" WMOBH NONE KWNO NONE tran.fbwnd_pacific "${outfile_name}" diff --git a/scripts/exgfs_atmos_gempak_meta.sh b/scripts/exgfs_atmos_gempak_meta.sh index f9b056076ef..74abe3327bc 100755 --- a/scripts/exgfs_atmos_gempak_meta.sh +++ b/scripts/exgfs_atmos_gempak_meta.sh @@ -32,8 +32,7 @@ while (( fhr <= fhend )); do gempak_file="${COMIN_ATMOS_GEMPAK_1p00}/${GEMGRD1}${fhr3}" if ! wait_for_file "${gempak_file}" "${sleep_interval}" "${max_tries}"; then - echo "FATAL ERROR: gempak grid file ${gempak_file} not available after maximum wait time." - exit 7 + err_exit "FATAL ERROR: gempak grid file ${gempak_file} not available after maximum wait time." fi export fhr @@ -76,7 +75,7 @@ while (( fhr <= fhend )); do cat poescript - "${HOMEgfs}/ush/run_mpmd.sh" poescript + "${HOMEgfs}/ush/run_mpmd.sh" poescript && true export err=$?; err_chk if (( fhr == 126 )) ; then diff --git a/scripts/exgfs_atmos_goes_nawips.sh b/scripts/exgfs_atmos_goes_nawips.sh index 46b06aa39b8..a89c7924223 100755 --- a/scripts/exgfs_atmos_goes_nawips.sh +++ b/scripts/exgfs_atmos_goes_nawips.sh @@ -11,8 +11,11 @@ fhr3=$1 source "${USHgfs}/product_functions.sh" for table in g2varswmo2.tbl g2vcrdwmo2.tbl g2varsncep1.tbl g2vcrdncep1.tbl; do - cp "${HOMEgfs}/gempak/fix/${table}" "${table}" || \ - ( echo "FATAL ERROR: ${table} is missing" && exit 2 ) + source_table="${HOMEgfs}/gempak/fix/${table}" + if [[ ! -f "${source_table}" ]]; then + err_exit "FATAL ERROR: ${table} is missing" + fi + cp "${source_table}" "${table}" done NAGRIB_TABLE="${HOMEgfs}/gempak/fix/nagrib.tbl" @@ -49,9 +52,7 @@ GRIBIN="${COMOUT_ATMOS_GOES}/${model}.${cycle}.${GRIB}${fhr3}${EXT}" GRIBIN_chk="${GRIBIN}" if [[ ! -r "${GRIBIN_chk}" ]]; then - echo "FATAL ERROR: GRIB index file ${GRIBIN_chk} not found!" - export err=7 ; err_chk - exit "${err}" + export err=7 ; err_chk "FATAL ERROR: GRIB index file ${GRIBIN_chk} not found!" fi cp "${GRIBIN}" "grib${fhr3}" diff --git a/scripts/exgfs_atmos_grib2_special_npoess.sh b/scripts/exgfs_atmos_grib2_special_npoess.sh index 255b4ae1de3..3756c314300 100755 --- a/scripts/exgfs_atmos_grib2_special_npoess.sh +++ b/scripts/exgfs_atmos_grib2_special_npoess.sh @@ -99,9 +99,8 @@ for (( fhr=SHOUR; fhr <= FHOUR; fhr = fhr + FHINC )); do export pgm="postcheck" grib_file="${COMIN_ATMOS_GRIB_0p50}/gfs.t${cyc}z.pgrb2b.0p50.f${fhr3}.idx" if ! wait_for_file "${grib_file}" "${SLEEP_INT}" "${SLEEP_LOOP_MAX}"; then - echo "FATAL ERROR: 0p50 grib file not available after max sleep time" export err=9 - err_chk || exit "${err}" + err_chk "FATAL ERROR: 0p50 grib file not available after max sleep time" fi ###################################################################### @@ -112,7 +111,7 @@ for (( fhr=SHOUR; fhr <= FHOUR; fhr = fhr + FHINC )); do cp "${COMIN_ATMOS_GRIB_0p50}/gfs.t${cyc}z.pgrb2b.0p50.f${fhr3}" tmpfile2b cat tmpfile2 tmpfile2b > tmpfile # shellcheck disable=SC2312 - ${WGRIB2} tmpfile | grep -F -f "${paramlist}" | ${WGRIB2} -i -grib pgb2file tmpfile + ${WGRIB2} tmpfile | grep -F -f "${paramlist}" | ${WGRIB2} -i -grib pgb2file tmpfile && true export err=$?; err_chk cp pgb2file "${COMOUT_ATMOS_GOES}/${RUN}.${cycle}.pgrb2f${fhr3}.npoess" @@ -151,9 +150,8 @@ for (( fhr=SHOUR; fhr <= FHOUR; fhr = fhr + FHINC )); do # grib_file="${COMIN_ATMOS_MASTER}/${RUN}.t${cyc}z.goesmasterf${fhr3}.grb2" grib_file="${COMIN_ATMOS_MASTER}/${RUN}.t${cyc}z.special.grb2f${fhr3}" if ! wait_for_file "${grib_file}" "${SLEEP_INT}" "${SLEEP_LOOP_MAX}"; then - echo "FATAL ERROR: GOES master grib file ${grib_file} not available after max sleep time" export err=9 - err_chk || exit "${err}" + err_chk "FATAL ERROR: GOES master grib file ${grib_file} not available after max sleep time" fi ############################### # Put restart files into /nwges diff --git a/scripts/exgfs_atmos_nawips.sh b/scripts/exgfs_atmos_nawips.sh index 4b7d38eb6cc..7baefb9844e 100755 --- a/scripts/exgfs_atmos_nawips.sh +++ b/scripts/exgfs_atmos_nawips.sh @@ -42,8 +42,11 @@ mkdir -p "lock.${fhr3}" cd "lock.${fhr3}" || exit 1 for table in g2varswmo2.tbl g2vcrdwmo2.tbl g2varsncep1.tbl g2vcrdncep1.tbl; do - cp "${HOMEgfs}/gempak/fix/${table}" "${table}" || \ - ( echo "FATAL ERROR: ${table} is missing" && exit 2 ) + source_table="${HOMEgfs}/gempak/fix/${table}" + if [[ ! -f "${source_table}" ]]; then + err_exit "FATAL ERROR: ${table} is missing" + fi + cp "${source_table}" "${table}" done GEMGRD="${RUN}_${grid}_${PDY}${cyc}f${fhr3}" @@ -71,9 +74,7 @@ export GRIBIN="${!source_var}/${model}.${cycle}.pgrb2.${grid_in}.f${fhr3}" GRIBIN_chk="${!source_var}/${model}.${cycle}.pgrb2.${grid_in}.f${fhr3}.idx" if ! wait_for_file "${GRIBIN_chk}" "${sleep_interval}" "${max_tries}"; then - echo "FATAL ERROR: after 1 hour of waiting for ${GRIBIN_chk} file at F${fhr3} to end." - export err=7 ; err_chk - exit "${err}" + export err=7 ; err_chk "FATAL ERROR: after 1 hour of waiting for ${GRIBIN_chk} file at F${fhr3} to end." fi case "${grid}" in diff --git a/scripts/exgfs_atmos_postsnd.sh b/scripts/exgfs_atmos_postsnd.sh index e31ca3a87ad..c13130b8cb1 100755 --- a/scripts/exgfs_atmos_postsnd.sh +++ b/scripts/exgfs_atmos_postsnd.sh @@ -117,7 +117,11 @@ for fhr in "${hour_list[@]}"; do done # Run with MPMD -"${USHgfs}/run_mpmd.sh" "${DATA}/poescript_bufr" +"${USHgfs}/run_mpmd.sh" "${DATA}/poescript_bufr" && true +export err=$? +set +x +err_chk "FATAL ERROR: One or more BUFR MPMD tasks failed!" +set_trace cd "${DATA}" || exit 2 diff --git a/scripts/exglobal_atmos_pmgr.sh b/scripts/exglobal_atmos_pmgr.sh index e21463e3f14..390ab1cb71f 100755 --- a/scripts/exglobal_atmos_pmgr.sh +++ b/scripts/exglobal_atmos_pmgr.sh @@ -60,7 +60,7 @@ while [ $icnt -lt 1000 ]; do sleep 10 icnt=$((icnt + 1)) - if [ $icnt -ge 1080 ]; then + if [[ ${icnt} -ge 1080 ]]; then msg="ABORTING after 3 hours of waiting for ${RUN} FCST hours $postjobs." err_exit $msg fi diff --git a/scripts/exglobal_atmos_products.sh b/scripts/exglobal_atmos_products.sh index 5f40757100b..5401c003731 100755 --- a/scripts/exglobal_atmos_products.sh +++ b/scripts/exglobal_atmos_products.sh @@ -45,12 +45,12 @@ MASTER_FILE="${COMIN_ATMOS_MASTER}/${PREFIX}master.grb2${fhr3}" # Get inventory from ${MASTER_FILE} that matches patterns from ${paramlista} # Extract this inventory from ${MASTER_FILE} into a smaller tmpfile or tmpfileb based on paramlista or paramlistb # shellcheck disable=SC2312 -${WGRIB2} "${MASTER_FILE}" | grep -F -f "${paramlista}" | ${WGRIB2} -i -grib "tmpfile_${fhr3}" "${MASTER_FILE}" +${WGRIB2} "${MASTER_FILE}" | grep -F -f "${paramlista}" | ${WGRIB2} -i -grib "tmpfile_${fhr3}" "${MASTER_FILE}" && true export err=$?; err_chk # Do the same as above for ${paramlistb} -if (( downset == 2 )); then +if [[ ${downset} -eq 2 ]]; then # shellcheck disable=SC2312 - ${WGRIB2} "${MASTER_FILE}" | grep -F -f "${paramlistb}" | ${WGRIB2} -i -grib "tmpfileb_${fhr3}" "${MASTER_FILE}" + ${WGRIB2} "${MASTER_FILE}" | grep -F -f "${paramlistb}" | ${WGRIB2} -i -grib "tmpfileb_${fhr3}" "${MASTER_FILE}" && true export err=$?; err_chk fi @@ -113,7 +113,7 @@ for (( nset=1 ; nset <= downset ; nset++ )); do fi # Break tmpfile into processor specific chunks in preparation for MPMD - ${WGRIB2} "${tmpfile}" -for "${first}":"${last}" -grib "${tmpfile}_${iproc}" + ${WGRIB2} "${tmpfile}" -for "${first}":"${last}" -grib "${tmpfile}_${iproc}" && true export err=$?; err_chk input_file="${tmpfile}_${iproc}" output_file_prefix="pgb2${grp}file_${fhr3}_${iproc}" @@ -130,7 +130,7 @@ for (( nset=1 ; nset <= downset ; nset++ )); do done # for (( iproc = 1 ; iproc <= nproc ; iproc++ )); do # Run with MPMD or serial - "${USHgfs}/run_mpmd.sh" "${DATA}/poescript" + "${USHgfs}/run_mpmd.sh" "${DATA}/poescript" && true export err=$?; err_chk # We are in a loop over downset, save output from mpmd into nset specific output @@ -176,7 +176,7 @@ if [[ "${FLXGF:-}" == "YES" ]]; then input_file="${FLUX_FILE}" output_file_prefix="sflux_${fhr3}" grid_string="1p00" - "${INTERP_ATMOS_SFLUXSH}" "${input_file}" "${output_file_prefix}" "${grid_string}" + "${INTERP_ATMOS_SFLUXSH}" "${input_file}" "${output_file_prefix}" "${grid_string}" && true export err=$?; err_chk # Move to COM and index the product sflux file From 2b4e805aa27385f495efcad5f0cd1b75f5701e07 Mon Sep 17 00:00:00 2001 From: David Huber Date: Thu, 10 Apr 2025 14:25:32 -0500 Subject: [PATCH 3/9] Add gaea to bug report template --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index b0dd17d59e5..f3914b58007 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -43,6 +43,8 @@ body: - All or N/A - WCOSS2 - Hera + - Gaea-C5 + - Gaea-C6 - Orion - Hercules - Jet From 8edcfb6a37616915ec0630ac3c778ff530dc96a0 Mon Sep 17 00:00:00 2001 From: David Huber Date: Fri, 11 Apr 2025 09:22:26 -0400 Subject: [PATCH 4/9] Do not add ush/ to PYTHONPATH (execute scripts directly instead) --- jobs/rocoto/arch_tars.sh | 5 ----- jobs/rocoto/arch_vrfy.sh | 5 ----- jobs/rocoto/earc_tars.sh | 5 ----- jobs/rocoto/earc_vrfy.sh | 5 ----- jobs/rocoto/globus_arch.sh | 5 ----- jobs/rocoto/globus_earc.sh | 5 ----- jobs/rocoto/marineanlletkf.sh | 5 ----- jobs/rocoto/prep_emissions.sh | 5 ----- 8 files changed, 40 deletions(-) diff --git a/jobs/rocoto/arch_tars.sh b/jobs/rocoto/arch_tars.sh index 52028759918..44e95da82a7 100755 --- a/jobs/rocoto/arch_tars.sh +++ b/jobs/rocoto/arch_tars.sh @@ -10,11 +10,6 @@ if [[ ${status} -ne 0 ]]; then exit "${status}" fi -############################################################### -# setup python path for workflow utilities and tasks -PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${HOMEgfs}/ush/python" -export PYTHONPATH - export job="arch_tars" export jobid="${job}.$$" diff --git a/jobs/rocoto/arch_vrfy.sh b/jobs/rocoto/arch_vrfy.sh index 235c8da774b..94c74f198a3 100755 --- a/jobs/rocoto/arch_vrfy.sh +++ b/jobs/rocoto/arch_vrfy.sh @@ -10,11 +10,6 @@ if [[ ${status} -ne 0 ]]; then exit "${status}" fi -############################################################### -# setup python path for workflow utilities and tasks -PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${HOMEgfs}/ush/python" -export PYTHONPATH - export job="arch_vrfy" export jobid="${job}.$$" diff --git a/jobs/rocoto/earc_tars.sh b/jobs/rocoto/earc_tars.sh index d09318fadbb..ed1cf1719a2 100755 --- a/jobs/rocoto/earc_tars.sh +++ b/jobs/rocoto/earc_tars.sh @@ -10,11 +10,6 @@ if [[ ${status} -ne 0 ]]; then exit "${status}" fi -############################################################### -# setup python path for workflow utilities and tasks -PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${HOMEgfs}/ush/python" -export PYTHONPATH - export job="earc_tars" export jobid="${job}.$$" diff --git a/jobs/rocoto/earc_vrfy.sh b/jobs/rocoto/earc_vrfy.sh index 440331e61dc..aa8ce035e4e 100755 --- a/jobs/rocoto/earc_vrfy.sh +++ b/jobs/rocoto/earc_vrfy.sh @@ -10,11 +10,6 @@ if [[ ${status} -ne 0 ]]; then exit "${status}" fi -############################################################### -# setup python path for workflow utilities and tasks -PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${HOMEgfs}/ush/python" -export PYTHONPATH - export job="earc_vrfy" export jobid="${job}.$$" diff --git a/jobs/rocoto/globus_arch.sh b/jobs/rocoto/globus_arch.sh index e82f05a4ea9..7bce96970ce 100755 --- a/jobs/rocoto/globus_arch.sh +++ b/jobs/rocoto/globus_arch.sh @@ -8,11 +8,6 @@ set -x status=$? [[ ${status} -ne 0 ]] && exit "${status}" -############################################################### -# setup python path for workflow utilities and tasks -PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${HOMEgfs}/ush/python" -export PYTHONPATH - export job="globus_arch" export jobid="${job}.$$" diff --git a/jobs/rocoto/globus_earc.sh b/jobs/rocoto/globus_earc.sh index 683587755f9..2af8ce8f34e 100755 --- a/jobs/rocoto/globus_earc.sh +++ b/jobs/rocoto/globus_earc.sh @@ -8,11 +8,6 @@ set -x status=$? if [[ ${status} -ne 0 ]]; then exit "${status}"; fi -############################################################### -# setup python path for workflow utilities and tasks -PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${HOMEgfs}/ush/python" -export PYTHONPATH - export job="globus_earc" export jobid="${job}.$$" diff --git a/jobs/rocoto/marineanlletkf.sh b/jobs/rocoto/marineanlletkf.sh index 2a9108e8e5d..973ab906cb7 100755 --- a/jobs/rocoto/marineanlletkf.sh +++ b/jobs/rocoto/marineanlletkf.sh @@ -13,11 +13,6 @@ fi export job="marineanlletkf" export jobid="${job}.$$" -############################################################### -# Setup Python path for GDASApp ush -PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${HOMEgfs}/ush/python" -export PYTHONPATH - ############################################################### # Execute the JJOB "${HOMEgfs}/jobs/JGLOBAL_MARINE_ANALYSIS_LETKF" diff --git a/jobs/rocoto/prep_emissions.sh b/jobs/rocoto/prep_emissions.sh index c24c5b72456..57e1c9d9c7c 100755 --- a/jobs/rocoto/prep_emissions.sh +++ b/jobs/rocoto/prep_emissions.sh @@ -11,11 +11,6 @@ status=$? export job="prep_emissions" export jobid="${job}.$$" -############################################################### -# setup python path for workflow utilities and tasks -PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${HOMEgfs}/ush/python" -export PYTHONPATH - ############################################################### # Execute the JJOB "${HOMEgfs}/jobs/JGLOBAL_PREP_EMISSIONS" From 12c8c700f9ace297417c11fca5dd6b6a5c97216b Mon Sep 17 00:00:00 2001 From: David Huber Date: Fri, 11 Apr 2025 09:23:26 -0400 Subject: [PATCH 5/9] Move ioda pythonpath to load_ufsda_modules.sh --- ush/load_ufsda_modules.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ush/load_ufsda_modules.sh b/ush/load_ufsda_modules.sh index df44765f0bc..ade66675aa8 100755 --- a/ush/load_ufsda_modules.sh +++ b/ush/load_ufsda_modules.sh @@ -88,6 +88,15 @@ else exit 1 fi +############################################################### +# setup python path for ioda utilities +# TODO: a better solution should be created for setting paths to package python scripts +# shellcheck disable=SC2311 +pyiodaPATH="${HOMEgfs}/sorc/gdas.cd/build/lib/python${PYTHON_VERSION}/" +gdasappPATH="${HOMEgfs}/sorc/gdas.cd/sorc/iodaconv/src:${pyiodaPATH}" +PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}:${gdasappPATH}" +export PYTHONPATH + # Restore stack soft limit: ulimit -S -s "${ulimit_s}" unset ulimit_s From 0e2d6f876e259850f69163af9756eb133efdd95b Mon Sep 17 00:00:00 2001 From: David Huber Date: Fri, 11 Apr 2025 11:11:28 -0400 Subject: [PATCH 6/9] Remove ioda PYTHONPATH from rocoto scripts (moved to load_ufsda_modules.sh) --- jobs/rocoto/esnowanl.sh | 8 -------- jobs/rocoto/prepatmiodaobs.sh | 7 ------- jobs/rocoto/prepoceanobs.sh | 7 ------- jobs/rocoto/snowanl.sh | 8 -------- 4 files changed, 30 deletions(-) diff --git a/jobs/rocoto/esnowanl.sh b/jobs/rocoto/esnowanl.sh index c3969f85acd..e1eb2116734 100755 --- a/jobs/rocoto/esnowanl.sh +++ b/jobs/rocoto/esnowanl.sh @@ -11,14 +11,6 @@ fi export job="esnowanl" export jobid="${job}.$$" -############################################################### -# setup python path for ioda utilities -# shellcheck disable=SC2311 -pyiodaPATH="${HOMEgfs}/sorc/gdas.cd/build/lib/python${PYTHON_VERSION}/" -gdasappPATH="${HOMEgfs}/sorc/gdas.cd/sorc/iodaconv/src:${pyiodaPATH}" -PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}:${gdasappPATH}" -export PYTHONPATH - ############################################################### # Execute the JJOB "${HOMEgfs}/jobs/JGLOBAL_SNOWENS_ANALYSIS" diff --git a/jobs/rocoto/prepatmiodaobs.sh b/jobs/rocoto/prepatmiodaobs.sh index 681a78f6153..2a619a3b25c 100755 --- a/jobs/rocoto/prepatmiodaobs.sh +++ b/jobs/rocoto/prepatmiodaobs.sh @@ -11,13 +11,6 @@ fi export job="prepatmobs" export jobid="${job}.$$" -############################################################### -# setup python path for ioda utilities -# shellcheck disable=SC2311 -pyiodaPATH="${HOMEgfs}/sorc/gdas.cd/build/lib/python${PYTHON_VERSION}/" -PYTHONPATH="${pyiodaPATH}:${PYTHONPATH}" -export PYTHONPATH - ############################################################### # Execute the JJOB "${HOMEgfs}/jobs/JGLOBAL_ATM_PREP_IODA_OBS" diff --git a/jobs/rocoto/prepoceanobs.sh b/jobs/rocoto/prepoceanobs.sh index 090a08fc8f3..c1973a137e4 100755 --- a/jobs/rocoto/prepoceanobs.sh +++ b/jobs/rocoto/prepoceanobs.sh @@ -13,13 +13,6 @@ fi export job="prepoceanobs" export jobid="${job}.$$" -############################################################### -# setup python path for class defs and utils -# shellcheck disable=SC2311 -pyiodaPATH="${HOMEgfs}/sorc/gdas.cd/build/lib/python${PYTHON_VERSION}/" -PYTHONPATH="${pyiodaPATH}:${PYTHONPATH}" -export PYTHONPATH - ############################################################### # Execute the JJOB "${HOMEgfs}"/jobs/JGLOBAL_PREP_OCEAN_OBS diff --git a/jobs/rocoto/snowanl.sh b/jobs/rocoto/snowanl.sh index be1e7a7eb94..8106eed6206 100755 --- a/jobs/rocoto/snowanl.sh +++ b/jobs/rocoto/snowanl.sh @@ -11,14 +11,6 @@ fi export job="snowanl" export jobid="${job}.$$" -############################################################### -# setup python path for ioda utilities -# shellcheck disable=SC2311 -pyiodaPATH="${HOMEgfs}/sorc/gdas.cd/build/lib/python${PYTHON_VERSION}/" -gdasappPATH="${HOMEgfs}/sorc/gdas.cd/sorc/iodaconv/src:${pyiodaPATH}" -PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}:${gdasappPATH}" -export PYTHONPATH - ############################################################### # Execute the JJOB "${HOMEgfs}/jobs/JGLOBAL_SNOW_ANALYSIS" From 67f6bde0916f9fe20e83503e46483ebde25474ee Mon Sep 17 00:00:00 2001 From: David Huber Date: Fri, 11 Apr 2025 18:13:38 +0000 Subject: [PATCH 7/9] Un-export SHELLOPTS before running fit2obs --- jobs/JGDAS_FIT2OBS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jobs/JGDAS_FIT2OBS b/jobs/JGDAS_FIT2OBS index 7b5395fb87a..fdcd6477ad0 100755 --- a/jobs/JGDAS_FIT2OBS +++ b/jobs/JGDAS_FIT2OBS @@ -65,6 +65,8 @@ if [[ ${CDATE} -gt ${SDATE} ]]; then # RUN FIT2OBS VERIFICATION ############################################## + # Un-export SHELLOPTS before going into the Fit2Obs package (let that package handle logging/errors) + export -n SHELLOPTS "${SCRIPTSfit2obs}/excfs_gdas_vrfyfits.sh" err=$? if [[ ${err} -ne 0 ]]; then From 116edcdd5b7ef57cfea9356d838fb13c7a6c41b5 Mon Sep 17 00:00:00 2001 From: David Huber Date: Fri, 11 Apr 2025 18:18:53 +0000 Subject: [PATCH 8/9] Add C5/6 to dump request template --- .github/ISSUE_TEMPLATE/dump_request.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/dump_request.yml b/.github/ISSUE_TEMPLATE/dump_request.yml index 147f5a1b3d5..68270ac1682 100644 --- a/.github/ISSUE_TEMPLATE/dump_request.yml +++ b/.github/ISSUE_TEMPLATE/dump_request.yml @@ -14,8 +14,9 @@ body: options: - WCOSS2 - Hera/Ursa + - Gaea C5 + - Gaea C6 - Orion/Hercules - - Jet multiple: true validations: required: true From cf43c327f0e46980852fcd20afa543f6e0590ab4 Mon Sep 17 00:00:00 2001 From: David Huber Date: Fri, 11 Apr 2025 18:30:00 +0000 Subject: [PATCH 9/9] Consistent Gaea Cluster naming --- .github/ISSUE_TEMPLATE/dump_request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/dump_request.yml b/.github/ISSUE_TEMPLATE/dump_request.yml index 68270ac1682..dbde486b08b 100644 --- a/.github/ISSUE_TEMPLATE/dump_request.yml +++ b/.github/ISSUE_TEMPLATE/dump_request.yml @@ -14,8 +14,8 @@ body: options: - WCOSS2 - Hera/Ursa - - Gaea C5 - - Gaea C6 + - Gaea-C5 + - Gaea-C6 - Orion/Hercules multiple: true validations: