Skip to content

PR to keep track of changes in ice-shelf-dev#14

Draft
dougiesquire wants to merge 36 commits intoupstream-mainfrom
ice-shelf-dev
Draft

PR to keep track of changes in ice-shelf-dev#14
dougiesquire wants to merge 36 commits intoupstream-mainfrom
ice-shelf-dev

Conversation

@dougiesquire
Copy link
Collaborator

Do not merge

This PR is simply to make it easier to keep track of changes made to the ice-shelf-dev branch and to provide a reference for the future (we'll need to make many of these same changes in a future release).

dougiesquire and others added 30 commits June 30, 2025 12:50
In mom-ocean#1664, src/tracer/MOM_generic_tracer.F90 was moved to config_src/external/GFDL_ocean_BGC/MOM_generic_tracer.F90. This was done to simplify COBALT v3 development. However, having MOM_generic_tracer.F90 in the generic_tracers codebase doesnt work when compiling generic_tracers as a library, so we maintain MOM_generic_tracer.F90 in the MOM6 codebase.
The NUOPC cap appears to have been written from the MCT cap, which does not include changes needed to successfully register restarts for FMS coupler type. See NCAR/MOM6@73304eb
These changes provide an initial implementation to allow use of coupled generic tracers with NUOPC-coupled MOM6. This is a bit of a hack as coupling in generic tracers effectively assumes the use of FMScoupler. Broadly, the changes to the NUOPC cap in this commit do the following:

- Initialisation phase: Initialise the FMS coupler type data structures used by generic tracers for handling surface fluxes. Register with NUOPC the additional import fields required by the generic tracer package being used. Export of additional fields is not currently handled.
- Advance phase: Populate the relevant FMS coupler type data structure with fields received from the atmosphere. Calculate the surface fluxes using a modified version of the routine used by FMScoupler.

Restart read/write for the FMS coupler types is also handled. Fields in the FMS coupler types can be overridden using the data_table
…te_from_coupler routine

This allows virtual flux corrections in generic tracer packages
* Add cmake build based on https://github.com/COSIMA/access-om3

There are two variations, the default is to build the mom6 standalone executable, the alternative is to build a library for access3 models (with https://github.com/ACCESS-NRI/access3-share as a dependency).

Co-authored-by: Dougie Squire <dougie.squire@anu.edu.au>
Co-authored-by: minghangli-uni <minghang.li1@anu.edu.au>
Co-authored-by: Micael Oliveira <micael.oliveira@anu.edu.au>
There was a typo with the calculation of mean velocities in the uppermost depth_ml fluid.
It was written J=js-1,ie instead of J=js-1,je and therefore crashed with an indexing error
when used. This section of the code only gets used when (CS%Hmix_UV>0.) i.e. when
runtime parameter HMIX_UV_SFC_PROP > 0. The runtime parameter default is zero.
I have not added a runtime parameter fixing the bug optionally because without the bugfix
it would crash if using this parameter. However, it should not change answers in simulations
that use the default HMIX_UV_SFC_PROP.
…, and add argument in brackets also where called in config_src/drivers/nuopc_cap/mom_cap.F90
…/drivers/nuopc_cap/mom_cap_methods.F90"

This reverts commit 1ddced2.
…le, for adding ice shelf mask into nuopc coupler omask. Also make contents of ocean_static public.
…ove fluxes, forces optional arguments from initialize_ice_shelf; these are initialised in the next step and including them incorrectly makes the shelf_sfc_mass_flux field be initialised when it should only be used in dynamic ice shelf cases (and results in crash when it can't find the file if you're running from a restart.) Also hardcodes the name of the ice shelf restart Shelf.res.nc in initialize_ice_shelf.
…nition because ISS%hmask not initialised properly from restart.

Need to clean up comment here and also make contents of ice_shelf_CS private again
…es are provided (#23)

Prior to this commit, restarting from decomposed restart files is only supported when reading automatically named files (filename='r'). This commit extends support to cases when restart filenames are explicitly provided.

Co-authored-by: Dougie Squire <42455466+dougiesquire@users.noreply.github.com>
…er ice shelves

If True, frazil scheme is not applied where frac_shelf_h > 0. If False, frazil calculated everywhere as usual if FRAZIL = True. Defaults to False so shouldn't change answers.
This parameter scales the friction velocity computed due to prescribed tides
either through UTIDE = constant value or through TIDEAMP = True and associated
TIDEAMP_FILE. Jourdain et al. 2019 suggest a value of 0.66 to estimate tidal ice shelf
boundary layer velocity from total barotropic tide amplitude. Default is set to 1 so
should not change answers
This commit modifies the nuopc cap and ice shelf code to add an option to
override the prognostically calculated ice shelf basal melt with an input
file, defined in data_table, using the data override functionality. To
use this, set DATA_OVERRIDE_MELT = True. If False, should not change answers.
Hallberg-NOAA and others added 6 commits December 17, 2025 10:28
Fix the 3-equation iteration for the buoyancy flux between the ocean and an
overlying ice-shelf when ICE_SHELF_BUOYANCY_FLUX_ITT_BUGFIX is true and
SHELF_3EQ_GAMMA it false.  This code now uses proper bounding of the
self-consistent solution, avoiding further amplifying the fluxes in the cases
when the differences between the diffusivities of heat and salt to make the
buoyancy flux destabilizing for finite turbulent mixing.  Both the
false-position iterations and the (appropriately chosen) Newton's method
iterations have been extensively examined and determined to be working correctly
via print statements that have subsequently been removed for efficiency.

  Previously, the code to determine the 3-equation solution for the buoyancy
flux between the ocean and an ice shelf had been skipping iteration altogether
or doing un-bounded Newton's method iterations with a sign error in part of the
derivative, including taking the square root of negative numbers, leading to the
issue described at NOAA-GFDL#945.  That issue has
now been corrected and can be closed once this commit has been merged into
the dev/gfdl branch of MOM6.

  This commit also changes the names of the runtime parameters to correct the
ice shelf flux iteration bugs from ICE_SHELF_BUOYANCY_FLUX_ITT_BUG and
ICE_SHELF_SALT_FLUX_ITT_BUG to ICE_SHELF_BUOYANCY_FLUX_ITT_BUGFIX and
ICE_SHELF_SALT_FLUX_ITT_BUGFIX to avoid confusion with other ..._BUG parameters
where `true` is to turn the bugs on, whereas here `true` fixes them.  The old
names are retained via `old_name` arguments to the `get_param()` calls, so no
existing configurations will be disrupted by these changes.

  Additionally, an expression to determine a scaling factor to limit ice-shelf
bottom slopes in `calc_shelf_driving_stress()` was refactored to avoid the
possibility of division by zero.

  This commit will change (and correct) answers for cases with
ICE_SHELF_BUOYANCY_FLUX_ITT_BUGFIX set to true, but as these would often fail
with a NaN from taking the square root of a negative value, it is very unlikely
that any such configurations are actively being used, and there seems little
point in retaining the previous answers.  No answers are changed in cases that
do not use an active ice shelf.

Co-authored-by: Alistair Adcroft <adcroft@users.noreply.github.com>
* Added frazil to ice shelf

The frazil mass flux to the ice-shelf base is calculated by
multiplying frazil energy [J m-2] by the inverse of the timestep times
the latent heat of fusion [kg J-1 s-1].

This frazil mass flux is incorporated as a negative water flux from
the ice shelf. This negative water flux then acts to add the frazil
mass to the ice shelf base
(MOM_ice_shelf.F90/change_thickness_using_melt) and remove it from
the ocean surface as evaporation (MOM_ice_shelf.F90/add_shelf_flux).

Note frazil is reset to zero at the start of each therm timestep in
MOM.F90/step_MOM.

Some additional changes were also made to how the ice-shelf flux
factor is implemented, so that is only scales ice-shelf melt without
affecting the frazil mass flux.

* Fixed a commented line where fluxes%water_flux should be ISS%water_flux
* Fix for ice-shelf friction velocity bugs

Fixed an incorrect area used to calculate cell-centered ocean surface velocity under the ice_shelf, which can impact the calculation of ice-shelf friction velocity. Added missing flags to some allocate_surface_state calls so that sfc_state%taux_shelf and sfc_state%tauy_shelf are allocated. This is required for the surface-stress-based (rather than surface-velocity-based) calculation of ice-shelf friction velocity. Also added taux_shelf and tauy_shelf as diagnostics for the surface stress under the ice shelf.

* Removed unneeded taux_shelf and tauy_shelf diagnostics

* Added ustar_from_vel_bugfix flag, which if true, fixes the ustar from ocean velocity bug
* Fix for ice-shelf friction velocity bugs

Fixed an incorrect area used to calculate cell-centered ocean surface velocity under the ice_shelf, which can impact the calculation of ice-shelf friction velocity. Added missing flags to some allocate_surface_state calls so that sfc_state%taux_shelf and sfc_state%tauy_shelf are allocated. This is required for the surface-stress-based (rather than surface-velocity-based) calculation of ice-shelf friction velocity. Also added taux_shelf and tauy_shelf as diagnostics for the surface stress under the ice shelf.

* Removed unneeded taux_shelf and tauy_shelf diagnostics

* Added ustar_from_vel_bugfix flag, which if true, fixes the ustar from ocean velocity bug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants