Fix ice-shelf SSA Newton scheme and convergence#1107
Merged
Conversation
Author
|
@Hallberg-NOAA I can split this into two PRs if you'd like, but the two commits are closely related |
Member
Hallberg-NOAA
left a comment
There was a problem hiding this comment.
I have examined the code, and without understanding in great detail exactly what is going on, it all looks reasonable to me. I have just a few minor stylistic or performance-related comments to consider before this is accepted.
4ecc348 to
91272a0
Compare
Hallberg-NOAA
approved these changes
May 27, 2026
Member
Hallberg-NOAA
left a comment
There was a problem hiding this comment.
I am now completely satisfied with this PR. Thank you for the addition of these valuable new capabilities.
Previously, the nonlinear part of basal friction was evaluated cell-wise, while the linear part was evaluated at quadrature points; the resulting inconsistency in the Jacobian prevented quadratic convergence when using Newton iterations, so moved all friction to be evaluated evaluated at quadrature points instead. Viscosity should also be evaluated at the 4 quad points rather than cell-centered, so changed the default for NUMBER_OF_ICE_VISCOSITY_QUADRATURE_POINTS from 1 to 4 (which is more accurate anyway). These changes allow us to achieve the expected quadratic convergence when using Newton. With these changes, several deprecated cell-averaged ice-shelf CS fields were removed: basal_traction, newton_umid, newton_vmid, newton_drag_coef. Subroutine calc_shelf_taub was converted to return area-averaged basal shear stress, now for diagnostic purposes only. Also removed incorrect 0.5 factor from newton_visc_factor
91d786e to
44b64fa
Compare
-Added NEWTON_CONJUGATE_GRADIENT_TOLERANCE to set a separate tolerance for Newton iterations compared to Picard. Helpful when using a higher convergence tolerance for initial inexact Newton tolerances, or a lower tolerance is used for "exact" Newton. -Can now set NEWTON_AFTER_TOLERANCE<=0 to only use Newton iterations to solve the SSA, bypassing Picard iterations entirely. This works well if the initial guess is close to the solution. Further developed the Inexact Newton Eisenstat-Walker (EW) scheme: -EW now evolves (correctly) based on the change in L2 norm of the stress residual -New parameters NEWTON_EW_GAMMA and NEWTON_EW_ALPHA to specify the EW gamma and alpha instead of hardcoding them -Added new EW safeguard based on PETSc, choice 3, along with parameters: -NEWTON_EW_SAFETY: choose between the 2 safeguards -NEWTON_EW_1_THRES: threshold used for when NEWTON_EW_SAFETY is 1 -NEWTON_EW_ETA_MAX: Max allowed EW eta (between 0 and 1) All of these new parameters will typically work well at their defaults, but are available for fine-tuning Added new SSA convergence criteria based on L2 norms (needed for EW): -NONLIN_SOLVE_ERR_MODE=4: err_mode for convergence based on nonlin residual | F | / | F_0 | -NONLIN_SOLVE_ERR_MODE=5: err_mode for convergence based on relative residual | F | / | tau | -SSA_ADD_REL_RESID = True: If NONLIN_SOLVE_ERR_MODE<=4, this will also ensure convergence of the relative residual (via err_mode=5). While generally useful for ensuring convergence of the solution (err_mode 2 or 3) and the residual simultaneously, in some cases, it is essential. For example, if using a solution-based convergence criterion with inexact Newton, initial Newton iterations may not change the solution much and could trigger the stopping criterion before the problem is actually converged; using SSA_ADD_REL_RESID avoids this issue. -ICE_RR_NONLINEAR_TOLERANCE: Tolerance for err_mode 5 if SSA_ADD_REL_RESID=True. Added several new MOM_mesg calls to track the adaptive inner solver tolerance and the nonlinear relative residual. Added VERBOSITY parameter to ice-shelf driver Ice-shelf efficiency improvements - Precomputed some commonly-used variables - Replace some pass_var()/pass_vector() pairs with do_group_pass() - Indentation Add missing ice_shelf CS%rhow_rhoi substitutions
44b64fa to
c8d148c
Compare
Member
|
This PR has passed pipeline testing at https://gitlab.gfdl.noaa.gov/ogrp/mom6ci/MOM6/-/pipelines/30977. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two big commits regarding the SSA solution:
The first moves all evaluation of ice-shelf basal friction components (nonlinear and linear) to quadrature points, and sets the viscosity to be evaluated at the 4 quadrature points (not cell-centers) by default. This allows Newton iterations to achieve the expected quadratic convergence, as everything is properly evaluated in the same space. This commit also corrects the ice-shelf Newton viscosity factor, which was half what it should be.
The second makes a number of fixes/improvements to the ice-shelf SSA inexact Newton/Eisenstat-Walker (EW) scheme, and adds some new convergence tolerances. A separate (initial) tolerance for Newton iterations is introduced, Newton can now run without Picard, some new parameters to control the EW scheme are added (with reasonable defaults), and two new convergence tolerances are added that are needed for the inexact Newton/EW scheme. A convergence tolerance based on the relative residual can also be combined with the other stopping criteria.
Verbosity is also added to the ice-shelf driver, which is useful because a few new MOM_mesg calls were added.