@@ -191,7 +191,7 @@ GSISTAT=${GSISTAT:-${COMOUT_ATMOS_ANALYSIS}/${APREFIX}gsistat.txt}
191191
192192# Increment files
193193ATMINC=${ATMINC:- ${COMOUT_ATMOS_ANALYSIS} / ${APREFIX} increment.atm.i006.nc}
194- DTFANL =${DTFANL :- ${COMOUT_ATMOS_ANALYSIS} / ${APREFIX} increment.dtf.i006.nc}
194+ DTFINC =${DTFINC :- ${COMOUT_ATMOS_ANALYSIS} / ${APREFIX} increment.dtf.i006.nc}
195195
196196# Obs diag
197197RUN_SELECT=${RUN_SELECT:- " NO" }
@@ -413,6 +413,16 @@ else
413413 echo " not using correlated obs error"
414414fi
415415
416+ # If GENDIAG is selected, verify that pCOMOUT_ATMOS_ANALYSIS is set
417+ if [[ " ${GENDIAG} " == " YES" ]]; then
418+ if [[ -z " ${pCOMOUT_ATMOS_ANALYSIS} " ]]; then
419+ export err=1
420+ err_exit " pCOMOUT_ATMOS_ANALYSIS must be set when GENDIAG=YES"
421+ fi
422+ # Make the gsidiags directory to house the GSI diagnostic data
423+ GSIDIAGDIR=${GSIDIAGDIR:- " ${pCOMOUT_ATMOS_ANALYSIS} /gsidiags" }
424+ fi
425+
416426# #############################################################
417427# CRTM Spectral and Transmittance coefficients
418428mkdir -p crtm_coeffs
@@ -640,7 +650,7 @@ ${NLN} "${ABIASPC}" satbias_pc.out
640650${NLN} " ${ABIASAIR} " aircftbias_out
641651
642652if [[ " ${DONST} " == " YES" ]]; then
643- ${NLN} " ${DTFANL } " dtfanl
653+ ${NLN} " ${DTFINC } " dtfanl
644654fi
645655
646656# If requested, link (and if tarred, de-tar obsinput.tar) into obs_input.* files
@@ -895,19 +905,32 @@ if [[ "${SENDECF}" == "YES" && "${RUN}" != "enkf" ]]; then
895905 ecflow_client --event release_fcst
896906fi
897907
898- # Diagnostic files
899- # if requested, GSI diagnostic file directories for use later
908+ echo " ${rCDUMP} ${PDY}${cyc} atminc done at $( date ) " > " ${COMOUT_ATMOS_ANALYSIS} / ${APREFIX} increment.done.txt "
909+
900910if [[ " ${GENDIAG} " == " YES" ]]; then
901- tar -cvf gsidiags.tar dir.????
902- export err=$?
903- if [[ ${err} -ne 0 ]]; then
904- err_exit " Failed to tar GSI diagnostic directories!"
911+ # Move the gsidiags dir.* directories to pCOMOUT_ATMOS_ANALYSIS for diagnostic jobs
912+ # First, check that the directories exist (we need at least one, so stop after the first match)
913+ count_dirs=$( find . -maxdepth 1 -type d -name ' dir.????' -printf " ." -quit | wc -c)
914+ if [[ ${count_dirs:- 0} -gt 0 ]]; then
915+ mkdir -p " ${GSIDIAGDIR} "
916+ err=$?
917+
918+ if [[ ! -d " ${GSIDIAGDIR} " || ${err} -ne 0 ]]; then
919+ err_exit " Failed to create gsidiags directory at ${GSIDIAGDIR} "
920+ fi
921+
922+ for dir in dir.???? ; do
923+ mv " ${dir} " " ${GSIDIAGDIR} /"
924+ export err=$?
925+ if [[ ${err} -ne 0 ]]; then
926+ err_exit " Failed to move ${dir} to ${GSIDIAGDIR} /"
927+ fi
928+ done
929+ else
930+ echo " WARNING: No gsidiags dir.* directories found to move."
905931 fi
906- cpfs gsidiags.tar " ${COMOUT_ATMOS_ANALYSIS} /${APREFIX} gsidiags${DIAG_SUFFIX:- } .tar"
907932fi
908933
909- echo " ${rCDUMP} ${PDY}${cyc} atminc done at $( date) " > " ${COMOUT_ATMOS_ANALYSIS} /${APREFIX} increment.done.txt"
910-
911934# ###############################################################################
912935
913936exit " ${err} "
0 commit comments