Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate ocean, ice and wave task info into config.ufs #1334

Merged
merged 18 commits into from
Mar 3, 2023
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't matter, but I think it makes sense to define the "wave resolution" or "wave grids" in config.base

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JessicaMeixner-NOAA Should this be updated to a different value for waveGRD as default? Perhaps in another PR. I'ld be interested in your suggestion.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably... Right now all the defaults are "v16" which this is, but it's probably time to move towards v17 - except we don't know what this is yet, so leaving that until we do might be a better answer although I don't see us running this three grid option any time soon either, so also probably not a good choice to leave as is...


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;;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question for future: Do we want wave grids to depend on atm grid? Or for that to be more flexible when this gets updated (hopefully in the very near future...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in the future, ideally, we should be able to have any combination and it should not depend on the atmosphere resolution. Just like CASE is templated to @CASE@, I would think we would want a @OCNRES@ etc. that gets filled when one runs setup_expt.py. I think we can save that for a future PR.
As soon as we start doing cycling with an ensemble, this will have to be updated as C96 sets a ocean resolution different that C48.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds great. Unfortunately there are files that depend on CASE and OCN RES so you can't have "any" combination without the appropriate fix files, but ideally it wouldn't be pre-determined otherwise and I like the idea of the wave grid being an independent choice.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. When we provide that flexibility, we will also implement a "validity check" to ensure that the the user has the illusion of choice, but not really :-)

*) 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?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or run waves at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. DO_WAVE_ENKF will take care of that.


# 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 @@ -248,8 +240,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
182 changes: 0 additions & 182 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