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

Allow increments to be added for ocean and ice cycling. #1308

Merged
merged 10 commits into from
Feb 15, 2023
2 changes: 1 addition & 1 deletion jobs/rocoto/ocnanalbmat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export jobid="${job}.$$"

###############################################################
# Execute the JJOB
#"${HOMEgfs}"/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_BMAT
"${HOMEgfs}"/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_BMAT
echo "BMAT gets run here"
status=$?
exit "${status}"
32 changes: 28 additions & 4 deletions parm/mom6/MOM_input_template_025
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ GILL_EQUATORIAL_LD = True ! [Boolean] default = False
! radius, otherwise, if false, use Pedlosky's definition. These definitions
! differ by a factor of 2 in front of the beta term in the denominator. Gill's
! is the more appropriate definition.
INTERNAL_WAVE_SPEED_BETTER_EST = False ! [Boolean] default = True
INTERNAL_WAVE_SPEED_BETTER_EST = False ! [Boolean] default = True
! If true, use a more robust estimate of the first mode wave speed as the
! starting point for iterations.

Expand Down Expand Up @@ -731,7 +731,7 @@ NSTAR = 0.06 ! [nondim] default = 0.2
! The portion of the buoyant potential energy imparted by surface fluxes that is
! available to drive entrainment at the base of mixed layer when that energy is
! positive.
EPBL_MLD_BISECTION = True ! [Boolean] default = False
EPBL_MLD_BISECTION = True ! [Boolean] default = False
! If true, use bisection with the iterative determination of the self-consistent
! mixed layer depth. Otherwise use the false position after a maximum and
! minimum bound have been evaluated and the returned value or bisection before
Expand Down Expand Up @@ -833,6 +833,30 @@ ENERGYSAVEDAYS = 1.00 ! [days] default = 1.0

! === module ocean_model_init ===

! === module MOM_oda_incupd ===
ODA_INCUPD = @[ODA_INCUPD] ! [Boolean] default = False
! If true, oda incremental updates will be applied
! everywhere in the domain.
ODA_INCUPD_FILE = "inc.nc" ! The name of the file with the T,S,h increments.
guillaumevernieres marked this conversation as resolved.
Show resolved Hide resolved

ODA_TEMPINC_VAR = "Temp" ! default = "ptemp_inc"
! The name of the potential temperature inc. variable in
! ODA_INCUPD_FILE.
ODA_SALTINC_VAR = "Salt" ! default = "sal_inc"
! The name of the salinity inc. variable in
! ODA_INCUPD_FILE.
ODA_THK_VAR = "h" ! default = "h"
! The name of the int. depth inc. variable in
! ODA_INCUPD_FILE.
ODA_INCUPD_UV = false !
!ODA_UINC_VAR = "u" ! default = "u_inc"
! The name of the zonal vel. inc. variable in
! ODA_INCUPD_UV_FILE.
!ODA_VINC_VAR = "v" ! default = "v_inc"
! The name of the meridional vel. inc. variable in
! ODA_INCUPD_UV_FILE.
ODA_INCUPD_NHOURS = @[ODA_INCUPD_NHOURS] ! default=3.0

! === module MOM_surface_forcing ===
OCEAN_SURFACE_STAGGER = "A" ! default = "C"
! A case-insensitive character string to indicate the
Expand Down Expand Up @@ -868,8 +892,8 @@ LIQUID_RUNOFF_FROM_DATA = @[MOM6_RIVER_RUNOFF] ! [Boolean] default = False
! the data_table using the component name 'OCN'.
! === module ocean_stochastics ===
DO_SPPT = @[DO_OCN_SPPT] ! [Boolean] default = False
! If true perturb the diabatic tendencies in MOM_diabadic_driver
PERT_EPBL = @[PERT_EPBL] ! [Boolean] default = False
! If true perturb the diabatic tendencies in MOM_diabadic_driver
Copy link
Contributor

Choose a reason for hiding this comment

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

MOM_diabatic_driver or is it diabadic?

PERT_EPBL = @[PERT_EPBL] ! [Boolean] default = False
! If true perturb the KE dissipation and destruction in MOM_energetic_PBL
! === module MOM_restart ===
RESTART_CHECKSUMS_REQUIRED = False
Expand Down
34 changes: 29 additions & 5 deletions parm/mom6/MOM_input_template_050
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ GILL_EQUATORIAL_LD = True ! [Boolean] default = False
! radius, otherwise, if false, use Pedlosky's definition. These definitions
! differ by a factor of 2 in front of the beta term in the denominator. Gill's
! is the more appropriate definition.
INTERNAL_WAVE_SPEED_BETTER_EST = False ! [Boolean] default = True
INTERNAL_WAVE_SPEED_BETTER_EST = False ! [Boolean] default = True
! If true, use a more robust estimate of the first mode wave speed as the
! starting point for iterations.

Expand Down Expand Up @@ -757,7 +757,7 @@ MSTAR2_COEF1 = 0.29 ! [nondim] default = 0.3
MSTAR2_COEF2 = 0.152 ! [nondim] default = 0.085
! Coefficient in computing mstar when only rotation limits the total mixing
! (used if EPBL_MSTAR_SCHEME = OM4)
EPBL_MLD_BISECTION = True ! [Boolean] default = False
EPBL_MLD_BISECTION = True ! [Boolean] default = False
! If true, use bisection with the iterative determination of the self-consistent
! mixed layer depth. Otherwise use the false position after a maximum and
! minimum bound have been evaluated and the returned value or bisection before
Expand Down Expand Up @@ -858,8 +858,32 @@ USE_NEUTRAL_DIFFUSION = True ! [Boolean] default = False
! If true, enables the neutral diffusion module.

! === module ocean_model_init ===

RESTART_CHECKSUMS_REQUIRED = False

! === module MOM_oda_incupd ===
ODA_INCUPD = @[ODA_INCUPD] ! [Boolean] default = False
! If true, oda incremental updates will be applied
! everywhere in the domain.
ODA_INCUPD_FILE = "inc.nc" ! The name of the file with the T,S,h increments.
guillaumevernieres marked this conversation as resolved.
Show resolved Hide resolved

ODA_TEMPINC_VAR = "Temp" ! default = "ptemp_inc"
! The name of the potential temperature inc. variable in
! ODA_INCUPD_FILE.
ODA_SALTINC_VAR = "Salt" ! default = "sal_inc"
! The name of the salinity inc. variable in
! ODA_INCUPD_FILE.
ODA_THK_VAR = "h" ! default = "h"
! The name of the int. depth inc. variable in
! ODA_INCUPD_FILE.
ODA_INCUPD_UV = false !
!ODA_UINC_VAR = "u" ! default = "u_inc"
! The name of the zonal vel. inc. variable in
! ODA_INCUPD_UV_FILE.
!ODA_VINC_VAR = "v" ! default = "v_inc"
! The name of the meridional vel. inc. variable in
! ODA_INCUPD_UV_FILE.
ODA_INCUPD_NHOURS = @[ODA_INCUPD_NHOURS] ! default=3.0

! === module MOM_lateral_boundary_diffusion ===
! This module implements lateral diffusion of tracers near boundaries

Expand Down Expand Up @@ -913,8 +937,8 @@ LIQUID_RUNOFF_FROM_DATA = @[MOM6_RIVER_RUNOFF] ! [Boolean] default = False
! the data_table using the component name 'OCN'.
! === module ocean_stochastics ===
DO_SPPT = @[DO_OCN_SPPT] ! [Boolean] default = False
! If true perturb the diabatic tendencies in MOM_diabadic_driver
PERT_EPBL = @[PERT_EPBL] ! [Boolean] default = False
! If true perturb the diabatic tendencies in MOM_diabadic_driver
Copy link
Contributor

Choose a reason for hiding this comment

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

again

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe somebody had a cold when writing that namelist @CoryMartin-NOAA

PERT_EPBL = @[PERT_EPBL] ! [Boolean] default = False
! If true perturb the KE dissipation and destruction in MOM_energetic_PBL
! === module MOM_restart ===

Expand Down
28 changes: 25 additions & 3 deletions parm/mom6/MOM_input_template_100
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ SAVE_INITIAL_CONDS = False ! [Boolean] default = False
! If true, write the initial conditions to a file given by IC_OUTPUT_FILE.

! === module MOM_oda_incupd ===
ODA_INCUPD = @[MOM_IAU] ! [Boolean] default = False
ODA_INCUPD = @[ODA_INCUPD] ! [Boolean] default = False
! If true, oda incremental updates will be applied
! everywhere in the domain.
ODA_INCUPD_FILE = "mom6_increment.nc" ! The name of the file with the T,S,h increments.
Expand All @@ -97,7 +97,7 @@ ODA_UINC_VAR = "u_inc" ! default = "u_inc"
ODA_VINC_VAR = "v_inc" ! default = "v_inc"
! The name of the meridional vel. inc. variable in
! ODA_INCUPD_UV_FILE.
ODA_INCUPD_NHOURS = @[MOM_IAU_HRS] ! default=3.0
ODA_INCUPD_NHOURS = @[ODA_INCUPD_NHOURS] ! default=3.0
! Number of hours for full update (0=direct insertion).

! === module MOM_domains ===
Expand Down Expand Up @@ -430,7 +430,7 @@ VISC_RES_FN_POWER = 2 ! [nondim] default = 100
! used, although even integers are more efficient to calculate. Setting this
! greater than 100 results in a step-function being used. This function affects
! lateral viscosity, Kh, and not KhTh.
INTERNAL_WAVE_SPEED_BETTER_EST = False ! [Boolean] default = True
INTERNAL_WAVE_SPEED_BETTER_EST = False ! [Boolean] default = True
! If true, use a more robust estimate of the first mode wave speed as the
! starting point for iterations.

Expand Down Expand Up @@ -829,6 +829,28 @@ ENERGYSAVEDAYS = 0.25 ! [days] default = 1.0
! other globally summed diagnostics.

! === module ocean_model_init ===
ODA_INCUPD = @[ODA_INCUPD] ! [Boolean] default = False
Copy link
Contributor

Choose a reason for hiding this comment

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

So usually the MOM_input_template_* is a copy of what is in ufs-weather-model. Do these updates need a corresponding test in ufs-weather-model?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for jumping in @JessicaMeixner-NOAA , I should have thought about adding you when I started modifying the mom namelist! Sorry.
Is there a MOM6 IAU test in the ufs-weather model?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think there is one here: https://github.com/ufs-community/ufs-weather-model/blob/develop/tests/tests/datm_cdeps_iau_gefs but it looks like the settings are different

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 seems close enough to me @JessicaMeixner-NOAA but up to you if you think it needs an update to the RT.
@aerorahul was trying to bring the naming nomenclature closer to what the atmosphere DA is doing, which does make sense.

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 like a great idea to me too. I think it's important that we are testing in ufs-weather-model what we're actually going to be running and having consistency makes updating the model in the future easier. I believe there was talk at one point to actually point to the MOM_template files in ufs-eather-model instead of having a second copy of these, but I'm not sure if that's still going to be a future development for g-w or not. Either way, I just wanted to flag this as something to be aware of, but I don't think it should hold up this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @JessicaMeixner-NOAA
We can let this PR pass and I can open a follow up PR removing these files from global-workflow and using the ones from ufs-weather-model.
Would you be able to provide a branch of the ufs-weather-model that allows for this flexibility?
The ufs-weather-model RT parm/ files may need an update.

Copy link
Contributor

Choose a reason for hiding this comment

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

We'd need the following:

  1. A PR to ufs-weather-model updating the template files to use these new settings
  2. A PR to global-workflow then updating the model version
  3. A PR having the global-workflow update to then use the ufs-weather-model parm files (I actually thought this was on the workflow teams radar to do?)

I can do all of the above, but it will be a while before I personally have time to do this. Again, there's no reason this PR should not proceed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes. 3. is on our radar.
We need atleast 1. for 3.
There is a lot more work in the ufs-weather-model than in the global-workflow to achieve this.
I can create issues in the global-workflow and ufs-weather-model and assign us respectively if that is ok?

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. Just know this isn't anywhere near the top of my priority list at the moment.

Copy link
Contributor

Choose a reason for hiding this comment

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

! If true, oda incremental updates will be applied
! everywhere in the domain.
ODA_INCUPD_FILE = "inc.nc" ! The name of the file with the T,S,h increments.
guillaumevernieres marked this conversation as resolved.
Show resolved Hide resolved

ODA_TEMPINC_VAR = "Temp" ! default = "ptemp_inc"
! The name of the potential temperature inc. variable in
! ODA_INCUPD_FILE.
ODA_SALTINC_VAR = "Salt" ! default = "sal_inc"
! The name of the salinity inc. variable in
! ODA_INCUPD_FILE.
ODA_THK_VAR = "h" ! default = "h"
! The name of the int. depth inc. variable in
! ODA_INCUPD_FILE.
ODA_INCUPD_UV = false !
!ODA_UINC_VAR = "u" ! default = "u_inc"
! The name of the zonal vel. inc. variable in
! ODA_INCUPD_UV_FILE.
!ODA_VINC_VAR = "v" ! default = "v_inc"
! The name of the meridional vel. inc. variable in
! ODA_INCUPD_UV_FILE.
ODA_INCUPD_NHOURS = @[ODA_INCUPD_NHOURS] ! default=3.0

! === module MOM_surface_forcing ===
OCEAN_SURFACE_STAGGER = "A" ! default = "C"
Expand Down
6 changes: 4 additions & 2 deletions parm/mom6/MOM_input_template_500
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,9 @@ MAXTRUNC = 1000 ! [truncations save_interval-1] default = 0
! to stop if there is any truncation of velocities.

! === module ocean_model_init ===
ODA_INCUPD = @[MOM_IAU] ! [Boolean] default = False

! === module MOM_oda_incupd ===
ODA_INCUPD = @[ODA_INCUPD] ! [Boolean] default = False
! If true, oda incremental updates will be applied
! everywhere in the domain.
ODA_INCUPD_FILE = "inc.nc" ! The name of the file with the T,S,h increments.
guillaumevernieres marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -513,7 +515,7 @@ ODA_INCUPD_UV = false !
!ODA_VINC_VAR = "v" ! default = "v_inc"
! The name of the meridional vel. inc. variable in
! ODA_INCUPD_UV_FILE.
ODA_INCUPD_NHOURS = @[MOM_IAU_HRS] ! default=3.0
ODA_INCUPD_NHOURS = @[ODA_INCUPD_NHOURS] ! default=3.0

! === module MOM_surface_forcing ===
OCEAN_SURFACE_STAGGER = "A" ! default = "C"
Expand Down
10 changes: 10 additions & 0 deletions ush/forecast_postdet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,16 @@ MOM6_postdet() {
;;
esac

# Link increment
if [[ "${DO_JEDIOCNVAR:-NO}" = "YES" ]]; then
if [[ ! -f "${ROTDIR}/${CDUMP}.${PDY}/${cyc}/ocean/${CDUMP}.t${cyc}z.ocninc.nc" ]]; then
echo "FATAL ERROR: Ocean increment not found, ABORT!"
exit 111
fi
$NLN "${ROTDIR}/${CDUMP}.${PDY}/${cyc}/ocean/${CDUMP}.t${cyc}z.ocninc.nc" "${DATA}/INPUT/inc.nc"
guillaumevernieres marked this conversation as resolved.
Show resolved Hide resolved
export ODA_INCUPD="true"
fi

# Copy MOM6 fixed files
$NCP -pf $FIXmom/$OCNRES/* $DATA/INPUT/

Expand Down
3 changes: 2 additions & 1 deletion ush/load_ufsda_modules.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#! /usr/bin/env bash

###############################################################
if [[ "${DEBUG_WORKFLOW:-NO}" == "NO" ]]; then
export DEBUG_WORKFLOW="${DEBUG_WORKFLOW:-NO}"
Copy link
Contributor

Choose a reason for hiding this comment

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

is this a lint thing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@CoryMartin-NOAA , nope, that was an issue before you added a default to the other places where DEBUG_WORKFLOW is used. I'll remove that line.

if [[ "${DEBUG_WORKFLOW}" == "NO" ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this was a mistake to merge this change in... did anyone test? @jiaruidong2017 seems to be having an issue here

echo "Loading modules quietly..."
set +x
fi
Expand Down
8 changes: 4 additions & 4 deletions ush/parsing_namelists_MOM6.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ MOM6_ALLOW_LANDMASK_CHANGES=${MOM6_ALLOW_LANDMASK_CHANGES:-'False'}
DO_OCN_SPPT=${DO_OCN_SPPT:-'False'}
PERT_EPBL=${PERT_EPBL:-'False'}

MOM_IAU=${MOM_IAU:-"false"}
MOM_IAU_HRS=${MOM_IAU_HRS:-'3.0'}
ODA_INCUPD=${ODA_INCUPD:-"false"}
ODA_INCUPD_NHOURS=${ODA_INCUPD_NHOURS:-'3.0'}

if [ $cplwav = ".true." ] ; then
MOM6_USE_WAVES='True'
Expand Down Expand Up @@ -134,8 +134,8 @@ sed -e "s/@\[DT_THERM_MOM6\]/$DT_THERM_MOM6/g" \
-e "s/@\[CHLCLIM\]/$CHLCLIM/g" \
-e "s/@\[DO_OCN_SPPT\]/$OCN_SPPT/g" \
-e "s/@\[PERT_EPBL\]/$PERT_EPBL/g" \
-e "s/@\[MOM_IAU_HRS\]/$MOM_IAU_HRS/g" \
-e "s/@\[MOM_IAU\]/$MOM_IAU/g" $DATA/INPUT/MOM_input_template_$OCNRES > $DATA/INPUT/MOM_input
-e "s/@\[ODA_INCUPD_NHOURS\]/$ODA_INCUPD_NHOURS/g" \
-e "s/@\[ODA_INCUPD\]/$ODA_INCUPD/g" $DATA/INPUT/MOM_input_template_$OCNRES > $DATA/INPUT/MOM_input
rm $DATA/INPUT/MOM_input_template_$OCNRES

#data table for runoff:
Expand Down
5 changes: 2 additions & 3 deletions workflow/rocoto/workflow_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,9 +649,8 @@ def _fcst_cycled(self):
dependencies = rocoto.create_dependency(dep=dep)

if self.app_config.do_jediocnvar:
dep_dict = {'type': 'task', 'name': f'{self.cdump}ocnanalrun'}
dep = rocoto.add_dependency(dep_dict)
dependencies = rocoto.create_dependency(dep=dep)
dep_dict = {'type': 'task', 'name': f'{self.cdump}ocnanalpost'}
dependencies.append(rocoto.add_dependency(dep_dict))

if self.app_config.do_gldas and self.cdump in ['gdas']:
dep_dict = {'type': 'task', 'name': f'{self.cdump}gldas'}
Expand Down
8 changes: 8 additions & 0 deletions workflow/setup_expt.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@ def link_files_from_src_to_dst(src_dir, dst_dir):
makedirs_if_missing(dst_dir)
link_files_from_src_to_dst(src_dir, dst_dir)

# First 1/2 cycle needs a MOM6 increment
Copy link
Contributor

Choose a reason for hiding this comment

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

why? is it not a cold start?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it's a warm start.

incdir = f'{inputs.cdump}.{idatestr[:8]}/{idatestr[8:]}'
incfile = f'{inputs.cdump}.t{idatestr[8:]}z.ocninc.nc'
src_file = os.path.join(inputs.icsdir, incdir, 'ocean', incfile)
dst_file = os.path.join(comrot, incdir, 'ocean', incfile)
makedirs_if_missing(os.path.join(comrot, incdir, 'ocean'))
os.symlink(src_file, dst_file)

# Link ice files
if do_ice:
detdir = f'{inputs.cdump}.{rdatestr[:8]}/{rdatestr[8:]}'
Expand Down