Skip to content

Commit

Permalink
Add GEFS Ocean Perturbation Options (#2385)
Browse files Browse the repository at this point in the history
This PR adds the MOM6 ocean perturbation options when running GEFS. This
is needed for GEFS reforecasts and GEFS operational forecasts.

This PR continues to address the below issues
#1720
#1921

Fixes #2403
  • Loading branch information
NeilBarton-NOAA committed Mar 19, 2024
1 parent fa855ba commit afe874e
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 35 deletions.
4 changes: 2 additions & 2 deletions parm/config/gefs/config.base
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export NCP="/bin/cp -p"
export NMV="/bin/mv"
export NLN="/bin/ln -sf"
export VERBOSE="YES"
export KEEPDATA="NO"
export KEEPDATA="@KEEPDATA@"
export DEBUG_POSTSCRIPT="NO" # PBS only; sets debug=true
export CHGRP_RSTPROD="@CHGRP_RSTPROD@"
export CHGRP_CMD="@CHGRP_CMD@"
Expand Down Expand Up @@ -262,7 +262,7 @@ export MEMDIR="mem${ENSMEM}"

# initialize ocean ensemble members with perturbations
# if true, only occurs for members greater than zero
export OCN_ENS_PERTURB_FILES=false
export USE_OCN_PERTURB_FILES=@STAGE_OCN_PERTURB_FILES@

export DOIAU="NO" # While we are not doing IAU, we may want to warm start w/ IAU in the future
# Check if cycle is cold starting
Expand Down
20 changes: 20 additions & 0 deletions parm/config/gefs/config.efcs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,27 @@ export SPPT_TAU=21600.
export SPPT_LSCALE=500000.
export SPPT_LOGIT=".true."
export SPPT_SFCLIMIT=".true."
# OCN options
export DO_OCN_SPPT="YES"
export OCNSPPT="0.8,0.4,0.2,0.08,0.04"
export OCNSPPT_TAU="2.16E4,2.592E5,2.592E6,7.776E6,3.1536E7"
export OCNSPPT_LSCALE="500.E3,1000.E3,2000.E3,2000.E3,2000.E3"
export DO_OCN_PERT_EPBL="YES"
export EPBL="0.8,0.4,0.2,0.08,0.04"
export EPBL_TAU="2.16E4,2.592E5,2.592E6,7.776E6,3.1536E7"
export EPBL_LSCALE="500.E3,1000.E3,2000.E3,2000.E3,2000.E3"

if [[ "${USE_OCN_PERTURB_FILES:-false}" == "true" ]]; then
export ODA_INCUPD="True"
export ODA_TEMPINC_VAR='t_pert'
export ODA_SALTINC_VAR='s_pert'
export ODA_THK_VAR='h_anl'
export ODA_UINC_VAR='u_pert'
export ODA_VINC_VAR='v_pert'
export ODA_INCUPD_NHOURS=0.0
else
export ODA_INCUPD="False"
fi
export restart_interval="${restart_interval_gfs}"

echo "END: config.efcs"
5 changes: 5 additions & 0 deletions parm/config/gefs/yaml/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ base:
DO_JEDIOCNVAR: "NO"
DO_JEDISNOWDA: "NO"
DO_MERGENSST: "NO"
KEEPDATA: "NO"
FHMAX_GFS: 120

stage_ic:
USE_OCN_PERTURB_FILES: "false"

2 changes: 1 addition & 1 deletion scripts/exglobal_stage_ic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ for MEMDIR in "${MEMDIR_ARRAY[@]}"; do

# Ocean Perturbation Files
# Extra zero on MEMDIR ensure we have a number even if the string is empty
if (( 0${MEMDIR:3} > 0 )) && [[ "${OCN_ENS_PERTURB_FILES:-false}" == "true" ]]; then
if (( 0${MEMDIR:3} > 0 )) && [[ "${USE_OCN_PERTURB_FILES:-false}" == "true" ]]; then
src="${BASE_CPLIC}/${CPL_OCNIC:-}/${PDY}${cyc}/${MEMDIR}/ocean/${PDY}.${cyc}0000.mom6_increment.nc"
tgt="${COM_OCEAN_RESTART_PREV}/${PDY}.${cyc}0000.mom6_increment.nc"
${NCP} "${src}" "${tgt}"
Expand Down
30 changes: 21 additions & 9 deletions ush/forecast_postdet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,15 @@ EOF

${NLN} "${FIXgfs}/am/global_co2historicaldata_glob.txt" "${DATA}/co2historicaldata_glob.txt"
${NLN} "${FIXgfs}/am/co2monthlycyc.txt" "${DATA}/co2monthlycyc.txt"
if [[ ${ICO2} -gt 0 ]]; then
for file in $(ls "${FIXgfs}/am/fix_co2_proj/global_co2historicaldata"*) ; do
# Set historical CO2 values based on whether this is a reforecast run or not
# Ref. issue 2403
local co2dir
co2dir="fix_co2_proj"
if [[ ${reforecast:-"NO"} == "YES" ]]; then
co2dir="co2dat_4a"
fi
if (( ICO2 > 0 )); then
for file in $(ls "${FIXgfs}/am/${co2dir}/global_co2historicaldata"*) ; do
${NLN} "${file}" "${DATA}/$(basename "${file//global_}")"
done
fi
Expand Down Expand Up @@ -695,6 +702,13 @@ MOM6_postdet() {
${NLN} "${COM_OCEAN_ANALYSIS}/${RUN}.t${cyc}z.ocninc.nc" "${DATA}/INPUT/mom6_increment.nc"
fi

# GEFS perturbations
# TODO if [[ $RUN} == "gefs" ]] block maybe be needed
# to ensure it does not interfere with the GFS
if (( MEMBER > 0 )) && [[ "${ODA_INCUPD:-False}" == "True" ]]; then
${NLN} "${COM_OCEAN_RESTART_PREV}/${sPDY}.${scyc}0000.mom6_increment.nc" "${DATA}/INPUT/mom6_increment.nc"
fi

# Copy MOM6 fixed files
${NCP} "${FIXgfs}/mom6/${OCNRES}/"* "${DATA}/INPUT/" # TODO: These need to be explicit

Expand All @@ -709,13 +723,11 @@ MOM6_postdet() {

# If using stochatic parameterizations, create a seed that does not exceed the
# largest signed integer
if [[ "${DO_OCN_SPPT}" = "YES" ]] || [[ "${DO_OCN_PERT_EPBL}" = "YES" ]]; then
if [[ ${SET_STP_SEED:-"YES"} = "YES" ]]; then
ISEED_OCNSPPT=$(( (current_cycle*1000 + MEMBER*10 + 6) % 2147483647 ))
ISEED_EPBL=$(( (current_cycle*1000 + MEMBER*10 + 7) % 2147483647 ))
else
ISEED=${ISEED:-0}
fi
if [[ ${DO_OCN_SPPT} = "YES" ]]; then
ISEED_OCNSPPT=$((current_cycle*10000 + ${MEMBER#0}*100 + 8)),$((current_cycle*10000 + ${MEMBER#0}*100 + 9)),$((current_cycle*10000 + ${MEMBER#0}*100 + 10)),$((current_cycle*10000 + ${MEMBER#0}*100 + 11)),$((current_cycle*10000 + ${MEMBER#0}*100 + 12))
fi
if [[ ${DO_OCN_PERT_EPBL} = "YES" ]]; then
ISEED_EPBL=$((current_cycle*10000 + ${MEMBER#0}*100 + 13)),$((current_cycle*10000 + ${MEMBER#0}*100 + 14)),$((current_cycle*10000 + ${MEMBER#0}*100 + 15)),$((current_cycle*10000 + ${MEMBER#0}*100 + 16)),$((current_cycle*10000 + ${MEMBER#0}*100 + 17))
fi

# Link output files
Expand Down
18 changes: 18 additions & 0 deletions ush/parsing_namelists_FV3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,24 @@ EOF
use_zmtnblck = ${use_zmtnblck:-".true."}
EOF
fi

if [[ "${DO_OCN_SPPT:-NO}" == "YES" ]]; then
cat >> input.nml <<EOF
OCNSPPT=${OCNSPPT}
OCNSPPT_LSCALE=${OCNSPPT_LSCALE}
OCNSPPT_TAU=${OCNSPPT_TAU}
ISEED_OCNSPPT=${ISEED_OCNSPPT:-${ISEED}}
EOF
fi

if [[ "${DO_OCN_PERT_EPBL:-NO}" == "YES" ]]; then
cat >> input.nml <<EOF
EPBL=${EPBL}
EPBL_LSCALE=${EPBL_LSCALE}
EPBL_TAU=${EPBL_TAU}
ISEED_EPBL=${ISEED_EPBL:-${ISEED}}
EOF
fi

cat >> input.nml << EOF
${nam_stochy_nml:-}
Expand Down
28 changes: 5 additions & 23 deletions ush/parsing_namelists_MOM6.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,6 @@ EOF
# new_lscale=.true.
#EOF

if [[ "${DO_OCN_SPPT}" == "YES" ]]; then
cat >> input.nml <<EOF
OCNSPPT=${OCNSPPT:-1.0}
OCNSPPT_LSCALE=${OCNSPPT_LSCALE:-500e3}
OCNSPPT_TAU=${OCNSPPT_TAU:-21600}
ISEED_OCNSPPT=${ISEED_OCNSPPT:-${ISEED}}
EOF
fi

if [[ "${DO_OCN_PERT_EPBL}" == "YES" ]]; then
cat >> input.nml <<EOF
EPBL=${EPBL:-1.0}
EPBL_LSCALE=${EPBL_LSCALE:-500e3}
EPBL_TAU=${EPBL_TAU:-21600}
ISEED_EPBL=${ISEED_EPBL:-${ISEED}}
EOF
fi

#cat >> input.nml <<EOF
#/
#
Expand Down Expand Up @@ -85,12 +67,12 @@ else
local MOM6_USE_WAVES="False"
fi
# == MOM_oda_incupd section ==
local ODA_TEMPINC_VAR="Temp"
local ODA_SALTINC_VAR="Salt"
local ODA_THK_VAR="h"
local ODA_TEMPINC_VAR=${ODA_TEMPINC_VAR:-"Temp"}
local ODA_SALTINC_VAR=${ODA_SALTINC_VAR:-"Salt"}
local ODA_THK_VAR=${ODA_THK_VAR:-"h"}
local ODA_INCUPD_UV="True"
local ODA_UINC_VAR="u"
local ODA_VINC_VAR="v"
local ODA_UINC_VAR=${ODA_UINC_VAR:-"u"}
local ODA_VINC_VAR=${ODA_VINC_VAR:-"v"}
# ODA_INCUPD
# ODA_INCUPD_NHOURS
# == MOM_surface_forcing section ==
Expand Down

0 comments on commit afe874e

Please sign in to comment.