Skip to content

Commit

Permalink
Enhance error handlings for missing input files (#2557)
Browse files Browse the repository at this point in the history
Enhance error handling for missing input files in the WDQMS job script
With the missing stnstat file, the WDQMS processing job did not fail but
went through all FATAL ERROR and ran completely.

Refs #2389
  • Loading branch information
emilyhcliu committed May 6, 2024
1 parent 584976e commit 56dbafb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scripts/exgdas_atmos_analysis_wdqms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ cd "${DATA}" || ( echo "FATAL ERROR: Unable to cd into '${DATA}', ABORT!"; exit
# Copy cnvstat file from COMIN to DATA, untar and gunzip input files for wdqms.py
# These should always be available
cp "${COMIN}/${CNVSTAT}" .
rc=$?
(( rc != 0 )) && ( echo "FATAL ERROR: Unable to copy '${CNVSTAT}' from '${COMIN}', ABORT!"; exit 2 )
export err=$?
(( err != 0 )) && ( msg="Unable to copy '${CNVSTAT}' from '${COMIN}'"; err_exit "${msg}" )
for diagfile in "${INPUT_LIST[@]}"; do
tar -xvf "${CNVSTAT}" "${diagfile}.gz"
rc=$?
(( rc != 0 )) && ( echo "FATAL ERROR: Unable to extract '${diagfile}.gz' from '${CNVSTAT}', ABORT!"; exit 3 )
export err=$?
(( err != 0 )) && ( msg="Unable to extract '${diagfile}.gz' from '${CNVSTAT}'"; err_exit "${msg}" )
gunzip "${diagfile}.gz"
rc=$?
(( rc != 0 )) && ( echo "FATAL ERROR: Unable to gunzip '${diagfile}.gz', ABORT!"; exit 3 )
export err=$?
(( err != 0 )) && ( msg="Unable to gunzip '${diagfile}.gz'"; err_exit "${msg}" )
done

#-------------------------------------------------------------------------------
Expand Down

0 comments on commit 56dbafb

Please sign in to comment.