Skip to content

Update 2 Adds new ocean to ice coupling fields for frazil ice formation - #559

Open
njeffery wants to merge 28 commits into
E3SM-Project:seaice-couplingfrom
njeffery:njeffery/frazil-coupling
Open

njeffery wants to merge 28 commits into
E3SM-Project:seaice-couplingfrom
njeffery:njeffery/frazil-coupling

Conversation

@njeffery

@njeffery njeffery commented Sep 16, 2026 •

Copy link
Copy Markdown

Updated version of #535

Fixes double counting of ocean heat flux during frazil ice formation.
For the ocean to ice coupler fields, Fioo_q now only contains the melt potential while Fioo_frazilh contains the heat from frazil ice formation. frazilh and q are combined in ice_comp_mct to reproduce the sea ice freezingMeltingPotential

Fioo_q is removed from driver-mct as it is no longer a heat flux.
A new flag, config_use_accumulated_frazil_energy default false, is added to the ocean model. Default retains the latent heat definition of frazil energy.
config_use_accumulated_frazil_energy = true uses the accumulatedFrazilHeat variable from frazil formation.

Tested in XS_2x5 GMPAS runs in 2 configurations:

config_use_accumulated_frazil_energy = true ; config_frazil_coupling_type = 'omega-fluxes'
and
default: config_use_accumulated_frazil_energy = false ; config_frazil_coupling_type = 'external'

Both completed successfully.

Test 1 was compared with darin's codebase from the previous PR (darincomeau@ea24e0f). Restart files at the end of day 11 showed differences in only 4 fields: o2x_ox_Fioo_frazilh, budg_dataG, o2x_ox_Fioo_q, and freezingMeltingPotential.

Differences in o2x_ox_Fioo_frazilh and freezingMeltingPotential were round off level only.
Differences in o2x_ox_Fioo_q, were all negative, as expected.
Differences in budg_dataG, also expected, were significant in regions of frazil ice formation.

Part of the frazil implementation documentation (sections 1.3-1.5). Currently here: https://www.overleaf.com/project/68896a760125362ca62587d1

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

There are verified correctness issues in diagnostics/logging and potential out-of-bounds writes due to unguarded optional coupler indices.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This PR updates MPAS-Ocean ↔ MPAS-Seaice frazil coupling to avoid double-counting ocean heat flux by splitting melt potential (Fioo_q) from frazil-formation heat (Fioo_frazilh) and adding explicit frazil salt/heat coupling fields through the drivers and registries.

Changes:

  • Add/rename ocean→ice frazil coupling flux fields (mass/salt/heat) and route them into MPAS-Seaice Icepack thermodynamics.
  • Add config_use_accumulated_frazil_heat to optionally couple accumulated frazil energy rather than latent-heat-from-mass.
  • Update MCT diagnostics/budget accounting to incorporate the new frazil salt/heat fields.
File summaries
File Description
driver-moab/shr/seq_flds_mod.F90 Update frazil salt field metadata from “production” to “flux”.
driver-mct/shr/seq_flds_mod.F90 Add/rename frazil salt/heat flux metadata for MCT coupler field lists.
driver-mct/main/seq_diag_mct.F90 Extend diagnostic budgets to include frazil salt/heat fields and indices.
components/mpas-seaice/src/shared/mpas_seaice_initialize.F Allow config_frazil_coupling_type='omega-fluxes'.
components/mpas-seaice/src/shared/mpas_seaice_icepack.F Plumb frazil mass/salt/heat flux arrays into Icepack thermodynamics call.
components/mpas-seaice/src/Registry.xml Register new ocean-coupling vars (frazilMassFlux/SaltFlux/HeatFlux) and allow omega-fluxes option.
components/mpas-seaice/driver/mpassi_cpl_indices.F Clarify comments for frazil coupling indices.
components/mpas-seaice/driver/ice_comp_mct.F Combine melt potential and frazil heat into freezingMeltingPotential; conditionally use omega-fluxes fields.
components/mpas-seaice/cime_config/buildnml Add new frazil coupling vars to namelist-generated stream/var lists.
components/mpas-seaice/bld/namelist_files/namelist_definition_mpassi.xml Document omega-fluxes as a valid frazil coupling type.
components/mpas-ocean/src/shared/mpas_ocn_frazil_forcing.F Accumulate frazil latent energy (accumulatedFrazilIceEnergy) alongside mass/salt.
components/mpas-ocean/src/Registry.xml Add config_use_accumulated_frazil_heat and register accumulatedFrazilIceEnergy.
components/mpas-ocean/src/analysis_members/Registry_conservation_check.xml Minor description fix for conservation-check frazil heat flux variable.
components/mpas-ocean/src/analysis_members/mpas_ocn_conservation_check.F Switch conservation-check frazil heat computation to use accumulated frazil energy.
components/mpas-ocean/driver/ocn_comp_mct.F Export separate frazil heat flux vs melt potential and reset accumulated frazil energy each coupling interval.
components/mpas-ocean/bld/namelist_files/namelist_definition_mpaso.xml Document new config_use_accumulated_frazil_heat namelist entry.
components/mpas-ocean/bld/namelist_files/namelist_defaults_mpaso.xml Provide default .false. for config_use_accumulated_frazil_heat.
components/mpas-ocean/bld/build-namelist-section Add new namelist option to generated defaults list.
components/mpas-ocean/bld/build-namelist Add new namelist option to generated defaults list.
Review details
  • Files reviewed: 19/19 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread components/mpas-ocean/driver/ocn_comp_mct.F
Comment thread components/mpas-ocean/src/analysis_members/mpas_ocn_conservation_check.F Outdated
Comment thread driver-mct/main/seq_diag_mct.F90

@cbegeman cbegeman left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for the quick turnaround on this. Your G-case comparison looks promising! Most of the code changes were clear to me, I just have one question below about the frazil mass/salt adjust term.

Comment thread components/mpas-ocean/src/Registry.xml Outdated
Comment thread components/mpas-ocean/src/Registry.xml Outdated
freezingMeltingPotential, &
frazilMassFlux, &
frazilSaltFlux, &
frazilHeatFlux , &

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
frazilHeatFlux , &
frazilHeatFlux, &

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Corrected

i2x_i(index_i2x_Fioi_melth ,n) = oceanHeatFlux(i)
i2x_i(index_i2x_Fioi_swpen ,n) = oceanShortwaveFlux(i)
i2x_i(index_i2x_Fioi_meltw ,n) = oceanFreshWaterFlux(i)
i2x_i(index_i2x_Fioi_meltw ,n) = oceanFreshWaterFlux(i) + frazilMassAdjust(i)/ailohi

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can you help me understand this addition? Is Fioi_frazil one of the coupling fields that is never used by the ocean model? So, prior to this change, were we neglecting to include the frazil mass adjustment?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Using Fioi_frazil would be a cleaner way to separate the sources of fresh water fluxes. For now, it's not being used and that term is included in meltw.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Got it. Thanks!

i2x_i(index_i2x_Fioi_melth ,n) = oceanHeatFlux(i)
i2x_i(index_i2x_Fioi_swpen ,n) = oceanShortwaveFlux(i)
i2x_i(index_i2x_Fioi_meltw ,n) = oceanFreshWaterFlux(i)
i2x_i(index_i2x_Fioi_meltw ,n) = oceanFreshWaterFlux(i) + frazilMassAdjust(i)/ailohi

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Has meltw always failed to include the frazil mass adjustment? Or is there a change to where (through which variable) frazil mass adjustment is applied? Similar questions apply to the frazil salt adjustment below

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

No. Since defined, it's been included in meltw. That term was dropped at some point along this effort, I think when Fioi_frazil was added.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think I initially made the change to move frazilMassAdjust to Fioi_frazil when the field was first added, but it required more changes to ocn_comp_mct. The current configuration is what was done originally, as @njeffery said. The same is true for the salt flux from the frazil mass adjustment, which is added to Fioi_salt.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thank you for clarifying. Sounds good.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

MPAS-Ocean exports Fioo_frazils without guarding against a zero (missing) coupler-field index, which can cause out-of-bounds writes at runtime.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (1)

components/mpas-ocean/driver/ocn_comp_mct.F:3427

  • index_o2x_Fioo_frazils can be 0 (perrWith='quiet' lookup), but this keepFrazil=.false. path still writes o2x_o(index_o2x_Fioo_frazils, n) whenever index_o2x_Fioo_frazil /= 0. Guard the frazils assignment separately to avoid out-of-bounds indexing.
             if (index_o2x_Fioo_frazil /= 0) then
                o2x_o(index_o2x_Fioo_frazil, n) = 0.0_RKIND
                o2x_o(index_o2x_Fioo_frazils, n) = 0.0_RKIND
             endif
  • Files reviewed: 19/19 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment on lines +3416 to +3420
if (index_o2x_Fioo_frazil /= 0) then
o2x_o(index_o2x_Fioo_frazil, n) = accumulatedFrazilIceMass(i) / ocn_cpl_dt
o2x_o(index_o2x_Fioo_frazils, n) = accumulatedFrazilIceMass(i)/ 1000.0_RKIND * &
config_frazil_sea_ice_reference_salinity / ocn_cpl_dt
endif

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Will work with just the one check. Fioo_frazil and Fioo_frazils are used together. If one is defined, then the other needs to be. This is not true for Fioo_q and Fioo_frazilh.

Comment on lines +1086 to +1089
<nml_option name="config_use_accumulated_frazil_energy" type="logical" default_value=".false."
description="If true, send the total energy accumulated from frazil ice formation to the sea ice model, otherwise use the latent heat."
possible_values=".true. or .false."
/>

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Updated the PR description

@karapeterson

Copy link
Copy Markdown

Have looked at the changes here and they look good to me. Was trying to get the Moab diagnostics working, but have had some bugs. Am rebuilding and rerunning now and will attach a diff once I confirm things are working correctly.

@karapeterson

Copy link
Copy Markdown

moab_cpl_changes.patch

Attached is patch with Moab coupler changes consistent with the mct changes. This will probably be needed as it seems that Moab is becoming the default coupler. @njeffery let me know if you'd like to add this here or if I should create a different PR. The changes were tested in a G-case with this PR.

@njeffery

Copy link
Copy Markdown
Author

Thanks @karapeterson ! I'll implement those now.

@njeffery

Copy link
Copy Markdown
Author

@karapeterson : How do I turn on MOAB to test?

@rljacob

rljacob commented Sep 17, 2026

Copy link
Copy Markdown
Member

Use --driver moab in create_newcase. Or remove "Vmct" from the testname.

@rljacob

rljacob commented Sep 17, 2026

Copy link
Copy Markdown
Member

You'll also have to merge #523 in to your local clone.

@karapeterson

Copy link
Copy Markdown

Thanks @njeffery and @rljacob for the instructions. When I ran the test, I was using MPAS-ocean and had not included #523

Comment thread driver-mct/shr/seq_flds_mod.F90
erinethomas and others added 9 commits September 29, 2026 12:13
add index_x2i_Fioo_frazilh (frazil heat flux from ocean)
add index_x2i_Fioi_frazil  (frazil mass flux from sea ice)
add index_x2i_Fioi_frazils (frazil salt flux from sea ice)
add index_x2i_Fioi_frazilh (frazil heat flux from sea ice)

All added to mpassi_cpl_indices.F and seq_flds_mod.F90.
Fioi_frazil and Fioi_frazils added to ice_comp_mct.F
Updates Icepack submodule to frazil coupling branch
Adds ocean-ice coupling fields:
frazil salt flux (Fioo_frazils)
frazil enthalpy flux (Fioo_frazilh) defined consistent with freezingMeltPotential

To use, set config_frazil_coupling_type to ‘omega-fluxes’
Backwards compatible with mpas-ocean for config_frazil_coupling_type = ‘external’

Stealth
Sea ice initialize now allows for the config_frazil_coupling_type option:
"omega-fluxes"
njeffery and others added 17 commits September 29, 2026 12:13
Sea ice initialize NOW allows for config_frazil_coupling_type option:
“omega-fluxes”
Removes double counting of frazil energy in coupler budget.
Corrects possible but in temperature tendency of frazil melt.
nBFB
Adds optional formulation in frazil.
Revert to original formulation with comments.
1. Initialized frazilMassFlux to 0 for SOM
2. Corrected indexing of component-level salt budget sum
3. Type in comment
4. Corrected definition of Fioo_frazils in MOAB to be consistent with mct
Also removes redundant write in coupler diagnostics
Clean up confusing comments in ocean conservation member
Co-authored-by: Carolyn Begeman <cbegeman@lanl.gov>
Makes the following changes to be consistent with salt/energy flux name convention:
1. Fioi_frazil to Fioi_frazilm
2. Fioo_frazil to Fioo_frazilm
@darincomeau

Copy link
Copy Markdown
Member

Thanks @njeffery for the rebase - I just rebased the seaice-coupling branch onto develop so this PR looks right again.

Comment thread driver-mct/main/seq_diag_mct.F90 Outdated
@andrewdnolan

Copy link
Copy Markdown

Also, 'frazil' needs to be changed to 'frazilm' in Omega's drirver code. With this diff:

diff --git a/components/omega/src/drivers/coupled/omega_cpl_indices.F90 b/components/omega/src/drivers/coupled/omega_cpl_indices.F90
index 3c762a1e44..abe632731a 100644
--- a/components/omega/src/drivers/coupled/omega_cpl_indices.F90
+++ b/components/omega/src/drivers/coupled/omega_cpl_indices.F90
@@ -81,7 +81,7 @@ contains
       export_field_names(7) = "So_dhdy"
       export_field_names(8) = "Faoo_h2otemp"
       export_field_names(9) = "Fioo_q"
-      export_field_names(10) = "Fioo_frazil"
+      export_field_names(10) = "Fioo_frazilm"
 
       ! get mct_avect_index value for each export field name
       call get_indices_from_names( &

I can get SMS_Vmct_Ln9.TL319_EC30to60E2r2.GOMEGA-JRA1p5.chrysalis_intel to pass, without these changes we'll get runtime failures. (Thanks @darincomeau for bringing this to my attention).

Since that file hasn't been changes as part of this PR I can comment there directly and/or suggest changes.

Flagged in gnu compilation
Fioo_frazil to Fioo_frazilm in omega.
Needed for SMS_Vmct_Ln9.TL319_EC30to60E2r2.GOMEGA-JRA1p5.chrysalis_intel to pass.
@njeffery

njeffery commented Oct 5, 2026

Copy link
Copy Markdown
Author

@andrewdnolan and @darincomeau : I fixed the formatting issue in seq_diag_mct and pushed the frazil to frazilm change in omega.

This branch has not been deployed

No deployments
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.

9 participants