Skip to content

+*Fix 3-equation ice-ocean flux iteration#972

Merged
adcroft merged 2 commits into
NOAA-GFDL:dev/gfdlfrom
Hallberg-NOAA:ice_shelf_flux_bugfix
Oct 1, 2025
Merged

+*Fix 3-equation ice-ocean flux iteration#972
adcroft merged 2 commits into
NOAA-GFDL:dev/gfdlfrom
Hallberg-NOAA:ice_shelf_flux_bugfix

Conversation

@Hallberg-NOAA
Copy link
Copy Markdown
Member

Fix the 3-equation iteration for the buoyancy flux between the ocean and an overlying ice-shelf when ICE_SHELF_BUOYANCY_FLUX_ITT_BUGFIX = true and SHELF_3EQ_GAMMA = 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 #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 withICE_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.

@Hallberg-NOAA Hallberg-NOAA added bug Something isn't working answer-changing A change in results (actual or potential) Parameter change Input parameter changes (addition, removal, or description) labels Sep 19, 2025
  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.
@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 20, 2025

Codecov Report

❌ Patch coverage is 0% with 75 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.37%. Comparing base (83a1048) to head (34b220d).
⚠️ Report is 13 commits behind head on dev/gfdl.

Files with missing lines Patch % Lines
src/ice_shelf/MOM_ice_shelf.F90 0.00% 74 Missing ⚠️
src/ice_shelf/MOM_ice_shelf_dynamics.F90 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           dev/gfdl     #972      +/-   ##
============================================
- Coverage     37.41%   37.37%   -0.04%     
============================================
  Files           304      306       +2     
  Lines         93061    93793     +732     
  Branches      17860    17985     +125     
============================================
+ Hits          34816    35053     +237     
- Misses        51678    52140     +462     
- Partials       6567     6600      +33     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@adcroft
Copy link
Copy Markdown
Member

adcroft commented Oct 1, 2025

Copy link
Copy Markdown
Member

@adcroft adcroft left a comment

Choose a reason for hiding this comment

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

@adcroft adcroft merged commit 4622d6a into NOAA-GFDL:dev/gfdl Oct 1, 2025
84 of 91 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

answer-changing A change in results (actual or potential) bug Something isn't working Parameter change Input parameter changes (addition, removal, or description)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants