Skip to content

Commit

Permalink
Remove EnKF forecast groups (#2280)
Browse files Browse the repository at this point in the history
Removes the grouping of EnKF forecasts so each job only runs
one forecast. Member and MEMDIR are now set at the workflow
manager (rocoto) level. This change makes much of the system
simpler (especially dependencies) and allows the elimination of
the separate efcs scripts.

Metatask names of updated jobs have been updated to make
them a little less opaque by using the same name name as its
constituent tasks (e.g. the forecast metatask is named
`enkgdasfcst`, not `enkfgdasefcs`). Metatasks that weren't
updated retain the same names as before for now.

Resolves #2254
  • Loading branch information
WalterKolczynski-NOAA committed Feb 5, 2024
1 parent 9f3383f commit 1ccc989
Show file tree
Hide file tree
Showing 15 changed files with 160 additions and 447 deletions.
84 changes: 0 additions & 84 deletions jobs/JGDAS_ENKF_FCST

This file was deleted.

60 changes: 24 additions & 36 deletions jobs/JGLOBAL_FORECAST
Original file line number Diff line number Diff line change
@@ -1,40 +1,19 @@
#! /usr/bin/env bash

source "${HOMEgfs}/ush/preamble.sh"
source "${HOMEgfs}/ush/jjob_header.sh" -e "fcst" -c "base fcst"

##############################################
# Set variables used in the script
##############################################
export CDUMP=${RUN/enkf}
if (( ${ENSMEM:-0} > 0 )); then
source "${HOMEgfs}/ush/jjob_header.sh" -e "efcs" -c "base fcst efcs"
else
source "${HOMEgfs}/ush/jjob_header.sh" -e "fcst" -c "base fcst"
fi

##############################################
# Begin JOB SPECIFIC work
##############################################

# Restart conditions for GFS cycle come from GDAS
rCDUMP=${CDUMP}
[[ ${CDUMP} = "gfs" ]] && export rCDUMP="gdas"

# Forecast length for GFS forecast
case ${RUN} in
*gfs | *gefs)
# shellcheck disable=SC2153
export FHMAX=${FHMAX_GFS}
# shellcheck disable=SC2153
export FHOUT=${FHOUT_GFS}
export FHMAX_HF=${FHMAX_HF_GFS}
export FHOUT_HF=${FHOUT_HF_GFS}
;;
*gdas)
export FHMAX_HF=0
export FHOUT_HF=0
;;
*)
echo "FATAL ERROR: Unsupported RUN '${RUN}'"
exit 1
esac

rCDUMP=${RUN}
[[ ${RUN} == "gfs" ]] && export rCDUMP="gdas"

# Ignore possible spelling error (nothing is misspelled)
# shellcheck disable=SC2153
Expand Down Expand Up @@ -78,11 +57,21 @@ fi

###############################################################
# Run relevant exglobal script

###############################################################
${FORECASTSH:-${SCRgfs}/exglobal_forecast.sh}
status=$?
[[ ${status} -ne 0 ]] && exit ${status}

[[ ${status} -ne 0 ]] && exit "${status}"

# Send DBN alerts for EnKF
# TODO: Should these be in post manager instead?
if [[ "${RUN}" =~ "enkf" ]] && [[ "${SENDDBN}" = YES ]]; then
for (( fhr = FHOUT; fhr <= FHMAX; fhr + FHOUT )); do
if (( fhr % 3 == 0 )); then
fhr3=$(printf %03i "${fhr}")
"${DBNROOT}/bin/dbn_alert" MODEL GFS_ENKF "${job}" "${COM_ATMOS_HISTORY}/${RUN}.t${cyc}z.sfcf${fhr3}.nc"
fi
done
fi

##############################################
# End JOB SPECIFIC work
Expand All @@ -91,15 +80,14 @@ status=$?
##############################################
# Final processing
##############################################
if [ -e "${pgmout}" ] ; then
cat ${pgmout}
if [[ -e "${pgmout}" ]] ; then
cat "${pgmout}"
fi

##########################################
# Remove the Temporary working directory
##########################################
cd ${DATAROOT}
[[ ${KEEPDATA} = "NO" ]] && rm -rf ${DATA}

cd "${DATAROOT}" || true
[[ ${KEEPDATA} = "NO" ]] && rm -rf "${DATA}"

exit 0
25 changes: 0 additions & 25 deletions jobs/rocoto/efcs.sh

This file was deleted.

35 changes: 21 additions & 14 deletions parm/config/gefs/config.efcs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@

echo "BEGIN: config.efcs"

# Turn off components in ensemble via _ENKF, or use setting from deterministic
export DO_AERO=${DO_AERO_ENKF:-${DO_AERO:-"NO"}}
export DO_OCN=${DO_OCN_ENKF:-${DO_OCN:-"NO"}}
export DO_ICE=${DO_ICE_ENKF:-${DO_ICE:-"NO"}}
export DO_WAVE=${DO_WAVE_ENKF:-${DO_WAVE:-"NO"}}
# Turn off components in ensemble
# export DO_AERO="NO"
# export DO_OCN="NO"
# export DO_ICE="NO"
# export DO_WAVE="NO"

export CASE="${CASE_ENS}"

# Source model specific information that is resolution dependent
string="--fv3 ${CASE_ENS}"
string="--fv3 ${CASE}"
# Ocean/Ice/Waves ensemble configurations are identical to deterministic member
[[ "${DO_OCN}" == "YES" ]] && string="${string} --mom6 ${OCNRES}"
[[ "${DO_ICE}" == "YES" ]] && string="${string} --cice6 ${ICERES}"
Expand All @@ -24,17 +26,22 @@ source "${EXPDIR}/config.ufs" ${string}
# Get task specific resources
source "${EXPDIR}/config.resources" efcs

# nggps_diag_nml
export FHOUT=${FHOUT_ENKF:-3}
if [[ "${RUN}" == "enkfgfs" ]]; then
export FHOUT=${FHOUT_ENKF_GFS:-${FHOUT}}
fi

# model_configure
export FHMAX=${FHMAX_ENKF:-9}
if [[ "${RUN}" == "enkfgfs" ]]; then
export FHMAX=${FHMAX_ENKF_GFS:-${FHMAX}}
fi

# Use serial I/O for ensemble (lustre?)
export OUTPUT_FILETYPE_ATM="netcdf"
export OUTPUT_FILETYPE_SFC="netcdf"

# Number of enkf members per fcst job
export NMEM_EFCSGRP=1
export RERUN_EFCSGRP="NO"

# Turn off inline UPP for EnKF forecast
export WRITE_DOPOST=".true."

# Stochastic physics parameters (only for ensemble forecasts)
export DO_SKEB="YES"
export SKEB=0.3
Expand All @@ -54,6 +61,6 @@ export SPPT_LSCALE=500000.
export SPPT_LOGIT=".true."
export SPPT_SFCLIMIT=".true."

export restart_interval=${restart_interval_gfs}
export restart_interval="${restart_interval_gfs}"

echo "END: config.efcs"
6 changes: 6 additions & 0 deletions parm/config/gefs/config.fcst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ string="--fv3 ${CASE}"
# shellcheck disable=SC2086
source "${EXPDIR}/config.ufs" ${string}

# shellcheck disable=SC2153
export FHMAX=${FHMAX_GFS}
# shellcheck disable=SC2153
export FHOUT=${FHOUT_GFS}
export FHMAX_HF=${FHMAX_HF_GFS}
export FHOUT_HF=${FHOUT_HF_GFS}

# Get task specific resources
source "${EXPDIR}/config.resources" fcst
Expand Down
55 changes: 42 additions & 13 deletions parm/config/gfs/config.efcs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@

echo "BEGIN: config.efcs"

# Turn off components in ensemble via _ENKF, or use setting from deterministic
export DO_AERO=${DO_AERO_ENKF:-${DO_AERO:-"NO"}}
export DO_OCN=${DO_OCN_ENKF:-${DO_OCN:-"NO"}}
export DO_ICE=${DO_ICE_ENKF:-${DO_ICE:-"NO"}}
export DO_WAVE=${DO_WAVE_ENKF:-${DO_WAVE:-"NO"}}
# Turn off components in ensemble
# export DO_AERO="NO"
# export DO_OCN="NO"
# export DO_ICE="NO"
export DO_WAVE="NO"

export CASE="${CASE_ENS}"

# Source model specific information that is resolution dependent
string="--fv3 ${CASE_ENS}"
string="--fv3 ${CASE}"
# Ocean/Ice/Waves ensemble configurations are identical to deterministic member
[[ "${DO_OCN}" == "YES" ]] && string="${string} --mom6 ${OCNRES}"
[[ "${DO_ICE}" == "YES" ]] && string="${string} --cice6 ${ICERES}"
Expand All @@ -25,15 +27,23 @@ source "${EXPDIR}/config.ufs" ${string}
# Get task specific resources
. "${EXPDIR}/config.resources" efcs

# nggps_diag_nml
export FHOUT=${FHOUT_ENKF:-3}
if [[ ${RUN} == "enkfgfs" ]]; then
export FHOUT=${FHOUT_ENKF_GFS:-${FHOUT}}
fi

# model_configure
export FHMIN=${FHMIN_ENKF:-3}
export FHMAX=${FHMAX_ENKF:-9}
if [[ ${RUN} == "enkfgfs" ]]; then
export FHMAX=${FHMAX_ENKF_GFS:-${FHMAX}}
fi

# Use serial I/O for ensemble (lustre?)
export OUTPUT_FILETYPE_ATM="netcdf"
export OUTPUT_FILETYPE_SFC="netcdf"

# Number of enkf members per fcst job
export NMEM_EFCSGRP=2
export NMEM_EFCSGRP_GFS=1
export RERUN_EFCSGRP="NO"

# Turn off inline UPP for EnKF forecast
export WRITE_DOPOST=".false."

Expand All @@ -56,14 +66,33 @@ export SPPT_LSCALE=500000.
export SPPT_LOGIT=".true."
export SPPT_SFCLIMIT=".true."

if [[ "${QUILTING}" = ".true." ]] && [[ "${OUTPUT_GRID}" = "gaussian_grid" ]]; then
if [[ "${QUILTING}" == ".true." ]] && [[ "${OUTPUT_GRID}" == "gaussian_grid" ]]; then
export DIAG_TABLE="${HOMEgfs}/parm/ufs/fv3/diag_table_da"
else
export DIAG_TABLE="${HOMEgfs}/parm/ufs/fv3/diag_table_da_orig"
fi

# Model config option for Ensemble
# export TYPE=nh # choices: nh, hydro
# export MONO=non-mono # choices: mono, non-mono

# gfs_physics_nml
export FHSWR=3600.
export FHLWR=3600.
export IEMS=1
export ISOL=2
export ICO2=2
export dspheat=".true."
export shal_cnv=".true."
export FHZER=6

# Set PREFIX_ATMINC to r when recentering on
if [[ ${RECENTER_ENKF:-"YES"} == "YES" ]]; then
export PREFIX_ATMINC="r"
fi

# For IAU, write restarts at beginning of window also
if [[ "${DOIAU_ENKF:-}" = "YES" ]]; then
if [[ "${DOIAU_ENKF:-}" == "YES" ]]; then
export restart_interval="3"
else
export restart_interval="6"
Expand Down
18 changes: 18 additions & 0 deletions parm/config/gfs/config.fcst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,24 @@ string="--fv3 ${CASE}"
# shellcheck disable=SC2086
source "${EXPDIR}/config.ufs" ${string}

# Forecast length for GFS forecast
case ${RUN} in
*gfs)
# shellcheck disable=SC2153
export FHMAX=${FHMAX_GFS}
# shellcheck disable=SC2153
export FHOUT=${FHOUT_GFS}
export FHMAX_HF=${FHMAX_HF_GFS}
export FHOUT_HF=${FHOUT_HF_GFS}
;;
*gdas)
export FHMAX_HF=0
export FHOUT_HF=0
;;
*)
echo "FATAL ERROR: Unsupported RUN '${RUN}'"
exit 1
esac

# Get task specific resources
source "${EXPDIR}/config.resources" fcst
Expand Down
Loading

0 comments on commit 1ccc989

Please sign in to comment.