Skip to content

Commit

Permalink
Consolidate ocean, ice and wave task info into config.ufs (#1334)
Browse files Browse the repository at this point in the history
config.fv3 is now renamed as config.ufs and contains ocean, ice, and wave task information

* config.fv3 is used to record FV3 and write grid component task decomposition based on resolution.
* Ocean (MOM6) and Ice (CICE6) decomposition, tasks and timesteps are added to config.ufs.
* Updates are made to config.fcst and config.efcs to source config.ufs based on the configuration of the (coupled) model.
* Several configurations were made deep in parsing_namelists_MOM.sh, which have now been elevated to config.ocn
* Some improvements are made to limit the export of variables from functions in nems_configure.sh.
* This will help with the ESMF threading work as it breaks down the work into multiple steps.
  • Loading branch information
aerorahul authored Mar 3, 2023
1 parent 0c523d9 commit 47afc78
Show file tree
Hide file tree
Showing 15 changed files with 654 additions and 535 deletions.
3 changes: 3 additions & 0 deletions parm/config/config.base.emc.dyn
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ export OPS_RES="C768" # Do not change
export LEVS=128
export CASE="@CASECTL@"
export CASE_ENKF="@CASEENS@"
# TODO: This should not depend on $CASE or $CASE_ENKF
# These are the currently available grid-combinations
case "${CASE}" in
"C48") export OCNRES=500;;
"C96") export OCNRES=100;;
Expand All @@ -179,6 +181,7 @@ case "${CASE}" in
*) export OCNRES=025;;
esac
export ICERES=${OCNRES}
export waveGRD='gnh_10m aoc_9km gsh_15m'

case "${APP}" in
ATM)
Expand Down
2 changes: 1 addition & 1 deletion parm/config/config.defaults.s2sw
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ FHOUT_HF_GFS=-1
min_seaice="1.0e-6"
use_cice_alb=".true."

# config.fv3 # TODO: This is hard-wired for P8 and needs to be refactored. For now, use case C384
# config.ufs # TODO: This is hard-wired for P8 and needs to be refactored. For now, use case C384
case "${CASE}" in
"C384")
DELTIM=300
Expand Down
33 changes: 25 additions & 8 deletions parm/config/config.efcs
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,36 @@

echo "BEGIN: config.efcs"

# TODO: the _ENKF counterparts need to be defined in config.base
export DO_AERO=${DO_AERO_ENKF:-"NO"}
export DO_OCN=${DO_OCN_ENKF:-"NO"}
export DO_ICE=${DO_ICE_ENKF:-"NO"}
export DO_WAVE=${DO_WAVE_ENKF:-"NO"}

# TODO: Possibly need OCNRES_ENKF, ICERES_ENKF, WAVRES_ENKF too
if [[ ${DO_OCN} == "YES" ]]; then
case "$CASE_ENKF" in
"C48") export OCNRES=500;;
"C96") export OCNRES=100;;
"C192") export OCNRES=050;;
"C384") export OCNRES=025;;
"C768") export OCNRES=025;;
*) export OCNRES=025;;
esac
fi
[[ ${DO_ICE} == "YES" ]] && export ICERES=$OCNRES
[[ ${DO_WAVE} == "YES" ]] && export waveGRD=${waveGRD_ENKF:-$waveGRD} # TODO: will we run waves with a different resolution in the ensemble?

# Source model specific information that is resolution dependent
. $EXPDIR/config.fv3 $CASE_ENKF
string="--fv3 $CASE_ENKF"
[[ ${DO_OCN} == "YES" ]] && string="$string --mom6 $OCNRES"
[[ ${DO_ICE} == "YES" ]] && string="$string --cice6 $ICERES"
[[ ${DO_WAVE} == "YES" ]] && string="$string --ww3 ${waveGRD// /;}"
source $EXPDIR/config.ufs ${string}

# Get task specific resources
. $EXPDIR/config.resources efcs

export npe_fv3=$npe_efcs

if [ $QUILTING = ".true." ]; then
export npe_fv3=$(echo " $npe_fv3 + $WRITE_GROUP * $WRTTASK_PER_GROUP" | bc)
export npe_efcs=$npe_fv3
fi

# Use serial I/O for ensemble (lustre?)
export OUTPUT_FILETYPE_ATM="netcdf"
export OUTPUT_FILETYPE_SFC="netcdf"
Expand Down
24 changes: 7 additions & 17 deletions parm/config/config.fcst
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@

echo "BEGIN: config.fcst"

# set -eu

# Source model specific information that is resolution dependent
. $EXPDIR/config.fv3 $CASE

# Turn off waves if not used for this CDUMP
case $WAVE_CDUMP in
both | ${CDUMP/enkf} ) ;; # Don't change
*) DO_WAVE="NO" ;; # Turn waves off
esac

# Source model specific information that is resolution dependent
string="--fv3 $CASE"
[[ ${DO_OCN} == "YES" ]] && string="$string --mom6 $OCNRES"
[[ ${DO_ICE} == "YES" ]] && string="$string --cice6 $ICERES"
[[ ${DO_WAVE} == "YES" ]] && string="$string --ww3 ${waveGRD// /;}"
source $EXPDIR/config.ufs ${string}

# Source component configs if necessary
for component in WAVE OCN ICE AERO; do
control="DO_${component}"
Expand All @@ -39,13 +41,8 @@ export esmf_logkind="ESMF_LOGKIND_MULTI_ON_ERROR" #Options: ESMF_LOGKIND_MULTI_O

#######################################################################
# COUPLING COMPONENTS
export OCN_model="mom6"
export ICE_model="cice6"
export WAV_model="ww3"
export CHM_model="gocart"

# cpl defaults

export cpl=".false."
export cplflx=".false."
export cplice=".false."
Expand All @@ -71,11 +68,6 @@ if [[ "$DO_WAVE" = "YES" ]]; then
export cplwav=".true."
fi

#######################################################################
# COUPLING COMPONENTS
export use_coldstart=".false."


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

export FORECASTSH="$HOMEgfs/scripts/exglobal_forecast.sh"
Expand Down Expand Up @@ -253,8 +245,6 @@ export DO_SKEB=${DO_SKEB:-"NO"}
export DO_SHUM=${DO_SHUM:-"NO"}
export DO_LAND_PERT=${DO_LAND_PERT:-"NO"}
export DO_CA=${DO_CA:-"YES"}
export DO_OCN_SPPT=${DO_OCN_SPPT:-"NO"}
export DO_OCN_PERT_EPBL=${DO_OCN_PERT_EPBL:-"NO"}

#coupling settings
export cplmode="nems_frac"
Expand Down
185 changes: 0 additions & 185 deletions parm/config/config.fv3

This file was deleted.

18 changes: 3 additions & 15 deletions parm/config/config.ice
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
#! /usr/bin/env bash

case "${ICERES}" in
"025")
export NX_GLB="1440"
export NY_GLB="1080"
;;
"500")
export NX_GLB="72"
export NY_GLB="35"
export cice_processor_shape="slenderX1"
;;
*)
echo "FATAL ERROR: Unsupported ICERES = ${ICERES}, ABORT!"
exit 1
;;
esac
echo "BEGIN: config.ice"

echo "END: config.ice"
26 changes: 21 additions & 5 deletions parm/config/config.ocn
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
#! /usr/bin/env bash

# OCNRES is currently being set in config.base
case "$CASE" in
"C48") export OCNTIM=3600;;
*) export OCNTIM=1800;;
esac
echo "BEGIN: config.ocn"

# MOM_input template to use
export MOM_INPUT="MOM_input_template_${OCNRES}"

export DO_OCN_SPPT="NO" # In MOM_input, this variable is determines OCN_SPPT (OCN_SPPT = True|False)
export DO_OCN_PERT_EPBL="NO" # In MOM_input, this variable determines PERT_EPBL (PERT_EPBL = True|False)

# Templated variables in MOM_input_template
export MOM6_USE_LI2016="True" # set to False for restart reproducibility
export MOM6_THERMO_SPAN="False"
export MOM6_ALLOW_LANDMASK_CHANGES="False"

if [[ "${DO_JEDIOCNVAR}" == "YES" ]]; then
export ODA_INCUPD="True"
else
export ODA_INCUPD="False"
fi
export ODA_INCUPD_NHOURS="3.0" # In MOM_input, this is time interval for applying increment

echo "END: config.ocn"
Loading

0 comments on commit 47afc78

Please sign in to comment.