Skip to content

Commit

Permalink
Updates to JGDAS_FIT2OBS for functioning
Browse files Browse the repository at this point in the history
- Add second CDATE setting (CDATE=${xdate}) for lookback date.
The fit2obs package uses CDATE and needs it set from above based
on the xdate variable (lookback date).
- Update COM_PRP to evaluate it up front.
- Add PRPI, sig1, sfc1, and CNVS input file variables for dependency
checking later in script.
- Add err_chk and postmsg setup (as done in runfits in fit2obs package).
- Add check of xdate against SDATE (-gt) for sufficient spinup of test.
- Add check of input file existence and exit with FATAL ERROR is any
are missing.
- Remove temporary "module load netcdf/4.7.0" now that build is updated.
- Indent section of script that's now within xdate/SDATE and input file
check. Only run fit2obs package script if dependencies are met.

Refs NOAA-EMC#1405
  • Loading branch information
KateFriedman-NOAA committed Mar 29, 2023
1 parent 0899ea1 commit 96e8dad
Showing 1 changed file with 37 additions and 15 deletions.
52 changes: 37 additions & 15 deletions jobs/JGDAS_FIT2OBS
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ export CDATE=${CDATE:-${PDY}${cyc}}
export CDUMP=${CDUMP:-${RUN:-"gdas"}}

export xdate=$(${NDATE} -${VBACKUP_FITS} ${CDATE})
export CDATE=${xdate} # Reset CDATE to xdate for lookback
export vday=$(echo ${xdate} | cut -c1-8)
export vcyc=$(echo ${xdate} | cut -c9-10)

export COM_INA=${ROTDIR}/gdas.${vday}/${vcyc}/atmos
export COM_INF='$ROTDIR/vrfyarch/gfs.$fdy/$fzz'
export COM_PRP='$ROTDIR/gdas.$pdy/$cyc/obs'
export COM_PRP=${ROTDIR}/gdas.${vday}/${vcyc}/obs

export PRPI=${COM_PRP}/${CDUMP}.t${vcyc}z.prepbufr
export sig1=${COM_INA}/${CDUMP}.t${vcyc}z.atmanl.nc
export sfc1=${COM_INA}/${CDUMP}.t${vcyc}z.atmanl.nc
export CNVS=${COM_INA}/${CDUMP}.t${vcyc}z.cnvstat

export OUTPUT_FILETYPE=${OUTPUT_FILETYPE:-netcdf}

Expand All @@ -28,28 +34,44 @@ export HORZ_DIR=${ARCDIR}/horiz
export COMLOX=${DATA}/fitx
[[ ! -d "${COMLOX}" ]] && mkdir -p "${COMLOX}"

###############################################################
# RUN FIT2OBS VERIFICATION
###############################################################
echo "echo err_chk">${DATA}/err_chk; chmod 755 ${DATA}/err_chk
echo "echo postmsg">${DATA}/postmsg; chmod 755 ${DATA}/postmsg

##############################################
# Check spinup and available inputs
##############################################

if [[ ${xdate} -gt ${SDATE} ]]; then
for file in ${PRPI} ${sig1} ${sfc1} ${CNVS}; do
if [ ! -f ${file} ]; then
echo "FATAL ERROR: FILE MISSING: ${file}"
exit 1
fi
done

if [[ ${xdate} -ge ${SDATE} ]]; then # Run FIT2OBS
##############################################
# RUN FIT2OBS VERIFICATION
##############################################

module load netcdf/4.7.0
"${fitdir}/batrun/excfs_gdas_vrfyfits.sh.ecf"
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"

fi
##############################################
# End JOB SPECIFIC work
##############################################

##############################################
# End JOB SPECIFIC work
##############################################
##############################################
# Final processing
##############################################
if [[ -e "${pgmout}" ]] ; then
cat "${pgmout}"
fi

else

echo "Too early for FIT2OBS to run. Exiting."

##############################################
# Final processing
##############################################
if [[ -e "${pgmout}" ]] ; then
cat "${pgmout}"
fi

##########################################
Expand Down

0 comments on commit 96e8dad

Please sign in to comment.