Skip to content

Commit

Permalink
Consolidate VMINMON and cleanup monitor scripts (NOAA-EMC#2088)
Browse files Browse the repository at this point in the history
This PR combines the GDAS and GFS versions of the VMINMON JJOB
and ex-driver scripts into single GLOBAL/global versions. Additionally:

* some further cleanup of the GSI-Monitor scripts is done; variable
settings in ex-driver scripts are moved up to the JJOB level
* the fix symlinks are consolidated into a new `fix/mon` subfolder (formerly
`fix/gdas`) and copies of the gfs monitor fix files under `fix/products` are
removed

Resolves NOAA-EMC#1925
  • Loading branch information
KateFriedman-NOAA authored Dec 4, 2023
1 parent a286a11 commit 04d97e9
Show file tree
Hide file tree
Showing 24 changed files with 490 additions and 911 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ fix/chem
fix/cice
fix/cpl
fix/datm
fix/gdas
fix/gldas
fix/gsi
fix/lut
Expand All @@ -47,7 +46,7 @@ fix/wafs
#--------------------------
parm/config/config.base
parm/gldas
parm/mon
parm/monitor
parm/post/AEROSOL_LUTS.dat
parm/post/nam_micro_lookup.dat
parm/post/optics_luts_DUST.dat
Expand Down
4 changes: 0 additions & 4 deletions fix/product/gfs_minmon_cost.txt

This file was deleted.

6 changes: 0 additions & 6 deletions fix/product/gfs_minmon_gnorm.txt

This file was deleted.

54 changes: 9 additions & 45 deletions jobs/JGDAS_ATMOS_VERFOZN
Original file line number Diff line number Diff line change
Expand Up @@ -6,69 +6,33 @@
source "${HOMEgfs}/ush/preamble.sh"
source "${HOMEgfs}/ush/jjob_header.sh" -e "verfozn" -c "base verfozn"

export OZNMON_SUFFIX=${OZNMON_SUFFIX:-${NET}}

#---------------------------------------------
# Specify Execution Areas
#
export HOMEgfs_ozn=${HOMEgfs:-${NWROOT}/gfs.${gfs_ver}}
export HOMEgdas_ozn=${HOMEgfs_ozn:-${NWROOT}/gfs.${gfs_ver}}
export PARMgdas_ozn=${PARMgfs_ozn:-${HOMEgfs_ozn}/parm/mon}
export SCRgdas_ozn=${SCRgfs_ozn:-${HOMEgfs_ozn}/scripts}
export FIXgdas_ozn=${FIXgfs_ozn:-${HOMEgfs_ozn}/fix/gdas}

export HOMEoznmon=${HOMEoznmon:-${HOMEgfs_ozn}}
export EXECoznmon=${EXECoznmon:-${HOMEoznmon}/exec}
export FIXoznmon=${FIXoznmon:-${HOMEoznmon}/fix}
export USHoznmon=${USHoznmon:-${HOMEoznmon}/ush}


#-----------------------------------
# source the parm file
#
. ${PARMgdas_ozn}/gdas_oznmon.parm


#############################################
# determine PDY and cyc for previous cycle
#############################################

pdate=$(${NDATE} -6 ${PDY}${cyc})
echo "pdate = ${pdate}"

export P_PDY=${pdate:0:8}
export p_cyc=${pdate:8:2}
# shellcheck disable=SC2153
GDATE=$(date --utc +%Y%m%d%H -d "${PDY} ${cyc} - ${assim_freq} hours")
export gPDY=${GDATE:0:8}
export gcyc=${GDATE:8:2}

#---------------------------------------------
# OZN_TANKDIR - WHERE OUTPUT DATA WILL RESIDE
#
YMD=${PDY} HH=${cyc} generate_com -rx COM_ATMOS_ANALYSIS
YMD=${PDY} HH=${cyc} generate_com -rx COM_ATMOS_OZNMON

export oznstat="${COM_ATMOS_ANALYSIS}/gdas.t${cyc}z.oznstat"
export TANKverf_ozn=${TANKverf_ozn:-${COM_ATMOS_OZNMON}}

if [[ ! -d ${TANKverf_ozn} ]]; then mkdir -p -m 775 ${TANKverf_ozn} ; fi

#---------------------------------------
# set up validation file
#
if [[ ${VALIDATE_DATA} -eq 1 ]]; then
export ozn_val_file=${ozn_val_file:-${FIXgdas_ozn}/gdas_oznmon_base.tar}
fi

#---------------------------------------
# Set necessary environment variables
#
export OZN_AREA=${OZN_AREA:-glb}
export oznstat=${oznstat:-${COM_ATMOS_ANALYSIS}/gdas.t${cyc}z.oznstat}


#-------------------------------------------------------
# Execute the script.
#
${OZNMONSH:-${SCRgdas_ozn}/exgdas_atmos_verfozn.sh} ${PDY} ${cyc}
"${SCRgfs}/exgdas_atmos_verfozn.sh"
err=$?
[[ ${err} -ne 0 ]] && exit ${err}
if (( err != 0 )); then
exit "${err}"
fi


################################
Expand Down
65 changes: 10 additions & 55 deletions jobs/JGDAS_ATMOS_VERFRAD
Original file line number Diff line number Diff line change
Expand Up @@ -6,81 +6,36 @@
source "${HOMEgfs}/ush/preamble.sh"
source "${HOMEgfs}/ush/jjob_header.sh" -e "verfrad" -c "base verfrad"

export COMPONENT="atmos"

export RADMON_SUFFIX=${RADMON_SUFFIX:-${RUN}}
export CYCLE_INTERVAL=${CYCLE_INTERVAL:-6}

##############################################
# Specify Execution Areas
##############################################
export HOMEgfs=${HOMEgfs:-${NWROOT}/gfs.${gfs_ver}}
export SCRgfs=${SCRgfs:-${HOMEgfs}/scripts}

export FIXgdas=${FIXgdas:-${HOMEgfs}/fix/gdas}
export PARMmon=${PARMmon:-${HOMEgfs}/parm/mon}

export HOMEradmon=${HOMEradmon:-${HOMEgfs}}
export EXECradmon=${EXECradmon:-${HOMEradmon}/exec}
export FIXradmon=${FIXradmon:-${FIXgfs}}
export USHradmon=${USHradmon:-${HOMEradmon}/ush}


###################################
# source the parm file
###################################
parm_file=${parm_file:-${PARMmon}/da_mon.parm}
. ${parm_file}


#############################################
# determine PDY and cyc for previous cycle
#############################################

pdate=$(${NDATE} -6 ${PDY}${cyc})
echo "pdate = ${pdate}"

export P_PDY=${pdate:0:8}
export p_cyc=${pdate:8:2}
# shellcheck disable=SC2153
GDATE=$(date --utc +%Y%m%d%H -d "${PDY} ${cyc} - ${assim_freq} hours")
export gPDY=${GDATE:0:8}
export gcyc=${GDATE:8:2}

#############################################
# COMOUT - WHERE GSI OUTPUT RESIDES
# TANKverf - WHERE OUTPUT DATA WILL RESIDE
#############################################
YMD=${PDY} HH=${cyc} generate_com -rx COM_ATMOS_ANALYSIS
YMD=${PDY} HH=${cyc} generate_com -rx COM_ATMOS_RADMON
YMD=${P_PDY} HH=${p_cyc} generate_com -rx COM_ATMOS_RADMON_PREV:COM_ATMOS_RADMON_TMPL
YMD=${gPDY} HH=${gcyc} generate_com -rx COM_ATMOS_RADMON_PREV:COM_ATMOS_RADMON_TMPL

export biascr="${COM_ATMOS_ANALYSIS}/gdas.t${cyc}z.abias"
export radstat="${COM_ATMOS_ANALYSIS}/gdas.t${cyc}z.radstat"
export TANKverf_rad=${TANKverf_rad:-${COM_ATMOS_RADMON}}
export TANKverf_radM1=${TANKverf_radM1:-${COM_ATMOS_RADMON_PREV}}

if [[ ! -d ${TANKverf_rad} ]]; then mkdir -p -m 775 ${TANKverf_rad} ; fi
if [[ ! -d ${TANKverf_radM1} ]]; then mkdir -p -m 775 ${TANKverf_radM1} ; fi

########################################
# Set necessary environment variables
########################################
export RAD_AREA=${RAD_AREA:-glb}

export biascr=${biascr:-${COM_ATMOS_ANALYSIS}/gdas.t${cyc}z.abias}
export radstat=${radstat:-${COM_ATMOS_ANALYSIS}/gdas.t${cyc}z.radstat}

echo " "
echo "JOB HAS STARTED"
echo " "


########################################################
# Execute the script.
${RADMONSH:-${SCRgfs}/exgdas_atmos_verfrad.sh} ${PDY} ${cyc}
"${SCRgfs}/exgdas_atmos_verfrad.sh"
err=$?

if [[ ${err} -ne 0 ]] ; then
exit ${err}
else
echo " "
echo "JOB HAS COMPLETED NORMALLY"
echo " "
if (( err != 0 )); then
exit "${err}"
fi

################################
Expand Down
73 changes: 0 additions & 73 deletions jobs/JGDAS_ATMOS_VMINMON

This file was deleted.

71 changes: 0 additions & 71 deletions jobs/JGFS_ATMOS_VMINMON

This file was deleted.

44 changes: 44 additions & 0 deletions jobs/JGLOBAL_ATMOS_VMINMON
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#! /usr/bin/env bash

###########################################################
# Global Minimization Monitor (MinMon) job
###########################################################
source "${HOMEgfs}/ush/preamble.sh"
source "${HOMEgfs}/ush/jjob_header.sh" -e "vminmon" -c "base vminmon"

#############################################
# Determine PDY and cyc for previous cycle
#############################################
# shellcheck disable=SC2153
GDATE=$(date --utc +%Y%m%d%H -d "${PDY} ${cyc} - ${assim_freq} hours")
export gPDY=${GDATE:0:8}
export gcyc=${GDATE:8:2}

#############################################
# TANKverf - WHERE OUTPUT DATA WILL RESIDE
#############################################
YMD=${PDY} HH=${cyc} generate_com -rx COM_ATMOS_ANALYSIS
YMD=${PDY} HH=${cyc} generate_com -rx COM_ATMOS_MINMON
YMD=${gPDY} HH=${gcyc} generate_com -rx COM_ATMOS_MINMON_PREV:COM_ATMOS_MINMON_TMPL

export gsistat="${COM_ATMOS_ANALYSIS}/${RUN}.t${cyc}z.gsistat"
export M_TANKverf=${M_TANKverf:-${COM_ATMOS_MINMON}}
export M_TANKverfM1=${M_TANKverfM1:-${COM_ATMOS_MINMON_PREV}}

if [[ ! -d ${M_TANKverf} ]]; then mkdir -p -m 775 "${M_TANKverf}" ; fi
if [[ ! -d ${M_TANKverfM1} ]]; then mkdir -p -m 775 "${M_TANKverfM1}" ; fi

########################################################
# Execute the script.
"${SCRgfs}/exglobal_atmos_vminmon.sh"
err=$?
if (( err != 0 )); then
exit "${err}"
fi

################################
# Remove the Working Directory
################################
[[ "${KEEPDATA}" = "NO" ]] && rm -rf "${DATA}"

exit 0
2 changes: 1 addition & 1 deletion jobs/rocoto/vminmon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export jobid="${job}.$$"
echo
echo "=============== START TO RUN MINMON ==============="

"${HOMEgfs}/jobs/J${RUN^^}_ATMOS_VMINMON"
"${HOMEgfs}/jobs/JGLOBAL_ATMOS_VMINMON"
status=$?

exit "${status}"
Loading

0 comments on commit 04d97e9

Please sign in to comment.