Skip to content

Commit

Permalink
Mirror config changes for ensemble flexibility to GEFS
Browse files Browse the repository at this point in the history
Copies the changes made to accomodate different coupling for ensemble
to the GEFS configs.

Refs #1692
  • Loading branch information
WalterKolczynski-NOAA committed Nov 6, 2023
1 parent f39438c commit a99ab33
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 64 deletions.
9 changes: 0 additions & 9 deletions parm/config/gefs/config.base.emc.dyn
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,8 @@ export DO_WAVE="NO"
export DO_OCN="NO"
export DO_ICE="NO"
export DO_AERO="NO"
export CCPP_SUITE="FV3_GFS_v17_p8"
export WAVE_CDUMP="" # When to include wave suite: gdas, gfs, or both
export DOBNDPNT_WAVE="NO"
export cplwav2atm=".false."
export FRAC_GRID=".true."

# Set operational resolution
Expand Down Expand Up @@ -183,17 +181,14 @@ export ICERES=${OCNRES}

case "${APP}" in
ATM)
export confignamevarfornems="atm"
;;
ATMA)
export DO_AERO="YES"
export confignamevarfornems="atm_aero"
;;
ATMW)
export DO_COUPLED="YES"
export DO_WAVE="YES"
export WAVE_CDUMP="both"
export confignamevarfornems="leapfrog_atm_wav"
;;
NG-GODAS)
export DO_ATM="NO"
Expand All @@ -204,19 +199,15 @@ case "${APP}" in
export DO_COUPLED="YES"
export DO_OCN="YES"
export DO_ICE="YES"
export CCPP_SUITE="FV3_GFS_v17_coupled_p8" # TODO: Does this include FV3_GFS_v17_p8? Can this be used instead of FV3_GFS_v17_p8 on L141
export confignamevarfornems="cpld"

if [[ "${APP}" =~ A$ ]]; then
export DO_AERO="YES"
export confignamevarfornems="${confignamevarfornems}_aero"
fi

if [[ "${APP}" =~ ^S2SW ]]; then
export DO_WAVE="YES"
export WAVE_CDUMP="both"
export cplwav2atm=".true."
export confignamevarfornems="${confignamevarfornems}_outerwave"
fi
;;
*)
Expand Down
52 changes: 0 additions & 52 deletions parm/config/gefs/config.fcst
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ string="--fv3 ${CASE}"
# shellcheck disable=SC2086
source "${EXPDIR}/config.ufs" ${string}

# Source component configs if necessary
for component in WAVE OCN ICE AERO; do
control="DO_${component}"
if [[ ${!control} == "YES" ]]; then
source "${EXPDIR}/config.${component,,}"
fi
done

# Get task specific resources
source "${EXPDIR}/config.resources" fcst
Expand All @@ -41,35 +34,6 @@ export esmf_profile=".false."
export esmf_logkind="ESMF_LOGKIND_MULTI_ON_ERROR" #Options: ESMF_LOGKIND_MULTI_ON_ERROR, ESMF_LOGKIND_MULTI, ESMF_LOGKIND_NONE


#######################################################################
# COUPLING COMPONENTS

# cpl defaults
export cpl=".false."
export cplflx=".false."
export cplice=".false."
export cplchm=".false."
export cplwav=".false."

# cpl changes based on APP

if [[ "${DO_COUPLED}" == "YES" ]]; then
export cpl=".true."
fi
if [[ "${DO_AERO}" == "YES" ]]; then
export cplchm=".true."
fi
if [[ "${DO_ICE}" == "YES" ]]; then
export cplice=".true."
export cplflx=".true."
fi
if [[ "${DO_OCN}" == "YES" ]]; then
export cplflx=".true."
fi
if [[ "${DO_WAVE}" == "YES" ]]; then
export cplwav=".true."
fi

#######################################################################

export FORECASTSH="${HOMEgfs}/scripts/exglobal_forecast.sh"
Expand Down Expand Up @@ -283,11 +247,6 @@ export DIAG_TABLE="${HOMEgfs}/parm/ufs/fv3/diag_table"
# Write gfs restart files to rerun fcst from any break point
export restart_interval=${restart_interval_gfs:-12}

# Choose coupling with wave
if [[ "${DO_WAVE}" = "YES" ]]; then
export cplwav=".true."
fi

# Turn off dry mass adjustment in GFS
export adjust_dry_mass=".false."

Expand All @@ -298,17 +257,6 @@ else
export io_layout="1,1"
fi

if [[ "${DO_AERO}" = "YES" ]]; then # temporary settings for aerosol coupling
export AERO_DIAG_TABLE="${AERO_DIAG_TABLE:-${HOMEgfs}/parm/ufs/fv3/diag_table.aero}"
export AERO_FIELD_TABLE="${AERO_FIELD_TABLE:-${HOMEgfs}/parm/ufs/fv3/field_table.aero}"
AERO_EMIS_FIRE="${AERO_EMIS_FIRE:-none}"
export AERO_EMIS_FIRE=${AERO_EMIS_FIRE,,}
export AERO_CONFIG_DIR="${AERO_CONFIG_DIR:-${HOMEgfs}/parm/ufs/chem}"
export AERO_INPUTS_DIR="${AERO_INPUTS_DIR:-}"
export fscav_aero="${aero_conv_scav_factors:-${fscav_aero}}"
export dnats_aero="${aero_diag_tracers:-0}"
fi

# Remember config.efcs will over-ride these values for ensemble forecasts
# if these variables are re-defined there.
# Otherwise, the ensemble forecast will inherit from config.fcst
Expand Down
63 changes: 61 additions & 2 deletions parm/config/gefs/config.ufs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

echo "BEGIN: config.ufs"

if [ $# -le 1 ]; then
if (( $# <- 1 )); then

echo "Must specify an input resolution argument to set variables!"
echo "argument can be any one of the following:"
Expand All @@ -28,7 +28,7 @@ skip_ww3=true
skip_mediator=true

# Loop through named arguments
while [[ $# -gt 0 ]]; do
while (( $# > 0 )); do
key="$1"
case "${key}" in
"--fv3")
Expand Down Expand Up @@ -60,6 +60,14 @@ if [[ "${skip_mom6}" == "false" ]] || [[ "${skip_cice6}" == "false" ]] || [[ "${
skip_mediator=false
fi

# Source component configs if necessary
for component in WAVE OCN ICE AERO; do
control="DO_${component}"
if [[ ${!control} == "YES" ]]; then
source "${EXPDIR}/config.${component,,}"
fi
done

case "${machine}" in
"WCOSS2")
npe_node_max=128
Expand Down Expand Up @@ -98,6 +106,10 @@ case "${machine}" in
;;
esac
;;
*)
echo "FATAL ERROR: Unrecognized machine ${machine}"
exit 14
;;
esac
export npe_node_max

Expand Down Expand Up @@ -237,11 +249,15 @@ export OUTPUT_FILETYPE_ATM OUTPUT_FILETYPE_SFC

# Mediator specific settings
if [[ "${skip_mediator}" == "false" ]]; then
export cpl=".true."
export nthreads_mediator=${nthreads_fv3} # Use same threads as FV3
export CCPP_SUITE="FV3_GFS_v17_coupled_p8" # TODO: Does this include FV3_GFS_v17_p8? Can this be used instead of FV3_GFS_v17_p8?
fi

# MOM6 specific settings
if [[ "${skip_mom6}" == "false" ]]; then
export cplflx=".true."
model_list="${model_list}.ocean"
nthreads_mom6=1
case "${mom6_res}" in
"500")
Expand Down Expand Up @@ -348,6 +364,8 @@ fi

# CICE6 specific settings
if [[ "${skip_cice6}" == "false" ]]; then
export cplice=".true."
model_list="${model_list}.ice"
# Ensure we sourced the MOM6 section
if [[ "${skip_mom6}" == "true" ]]; then
echo "FATAL ERROR: CICE6 cannot be configured without MOM6, ABORT!"
Expand Down Expand Up @@ -384,6 +402,9 @@ fi

# WW3 specific settings
if [[ "${skip_ww3}" == "false" ]]; then
export cplwav=".true."
export cplwav2atm=".true."
model_list="${model_list}.wave"
nthreads_ww3=2
case "${ww3_res}" in
"gnh_10m;aoc_9km;gsh_15m")
Expand Down Expand Up @@ -414,4 +435,42 @@ if [[ "${skip_ww3}" == "false" ]]; then
export ntasks_ww3 nthreads_ww3
fi

# GOCART specific settings
if [[ "${DO_AERO}" = "YES" ]]; then # temporary settings for aerosol coupling
export AERO_DIAG_TABLE="${AERO_DIAG_TABLE:-${HOMEgfs}/parm/ufs/fv3/diag_table.aero}"
export AERO_FIELD_TABLE="${AERO_FIELD_TABLE:-${HOMEgfs}/parm/ufs/fv3/field_table.aero}"
AERO_EMIS_FIRE="${AERO_EMIS_FIRE:-none}"
export AERO_EMIS_FIRE=${AERO_EMIS_FIRE,,}
export AERO_CONFIG_DIR="${AERO_CONFIG_DIR:-${HOMEgfs}/parm/ufs/chem}"
export AERO_INPUTS_DIR="${AERO_INPUTS_DIR:-}"
export fscav_aero="${aero_conv_scav_factors:-${fscav_aero}}"
export dnats_aero="${aero_diag_tracers:-0}"
fi

# Set the name of the UFS (previously nems) configure template to use
case "${model_list}" in
atm)
export ufs_configure_template="nems.configure.atm.IN"
;;
atm.aero)
export ufs_configure_template="nems.configure.atm_aero.IN"
;;
atm.wave)
export ufs_configure_template="nems.configure.leapfrog_atm_wav.IN"
;;
atm.ocean.ice)
export ufs_configure_template="nems.configure.cpld.IN"
;;
atm.ocean.ice.aero)
export ufs_configure_template="nems.configure.cpld_aero.IN"
;;
atm.ocean.ice.wave.aero)
export ufs_configure_template="nems.configure.cpld_aero_outerwave.IN"
;;
*)
echo "FATAL ERROR: Unable to determine appropriate UFS configure template for ${model_list}"
exit 16
;;
esac

echo "END: config.ufs"
2 changes: 1 addition & 1 deletion parm/config/gfs/config.ufs
Original file line number Diff line number Diff line change
Expand Up @@ -380,14 +380,14 @@ fi

# CICE6 specific settings
if [[ "${skip_cice6}" == "false" ]]; then
export cplice=".true."
model_list="${model_list}.ice"
# Ensure we sourced the MOM6 section
if [[ "${skip_mom6}" == "true" ]]; then
echo "FATAL ERROR: CICE6 cannot be configured without MOM6, ABORT!"
exit 1
fi

export cplice=".true."
nthreads_cice6=${nthreads_mom6} # CICE6 needs to run on same threads as MOM6
case "${cice6_res}" in
"500")
Expand Down

0 comments on commit a99ab33

Please sign in to comment.