Skip to content

New methods for ice-shelf velocity inner solve. More FMA edits.#1082

Merged
Hallberg-NOAA merged 7 commits into
NOAA-GFDL:dev/gfdlfrom
alex-huth:dev/gfdl_inner_solve_opts
Apr 29, 2026
Merged

New methods for ice-shelf velocity inner solve. More FMA edits.#1082
Hallberg-NOAA merged 7 commits into
NOAA-GFDL:dev/gfdlfrom
alex-huth:dev/gfdl_inner_solve_opts

Conversation

@alex-huth
Copy link
Copy Markdown

@alex-huth alex-huth commented Apr 7, 2026

Added new iterative methods (MINRES and CR) for the SSA inner solve, and optimized the existing (default) CG method.
MINRES/CR can be faster than CG, but they minimize different norms. MINRES should be preferred if the problem is ill-conditioned, and its convergence is guaranteed even if SPD is lost (unlikely, but possible with Newton iterations?).

The new CG is answer-changing, but only because the IDIAGU/IDIAGv reciprocals are now pre-computed to replace per-iteration divisions with multiplications. However, the ice-sheet group is not yet concerned with preserving previous answers for dynamics.

Furthermore, new parameter CG_HALO_SHRINK can disable the CG "halo-shrinking" scheme. This scheme set the number of pass_vector calls to 4 per every nihalo iterations, but with the new CG optimization, disabling the halo-shrinking results in a single pass_vector call per iteration. Results are bitwise identical, but setting CG_HALO_SHRINK=False is slightly faster for most combinations of grid size, halo size, and symmetric/non-symmetric.

Also made a few edits for consistent rotation with FMAs.

With this PR, the ice-shelf dynamics passes all rotation and PE layout reproducibility tests, with or without FMAs.

@alex-huth alex-huth added enhancement New feature or request answer-changing A change in results (actual or potential) Parameter change Input parameter changes (addition, removal, or description) labels Apr 7, 2026
Comment thread src/ice_shelf/MOM_ice_shelf_dynamics.F90
Comment thread src/ice_shelf/MOM_ice_shelf_dynamics.F90 Outdated
Comment thread src/ice_shelf/MOM_ice_shelf_dynamics.F90 Outdated
Comment thread src/ice_shelf/MOM_ice_shelf_dynamics.F90 Outdated
@alex-huth
Copy link
Copy Markdown
Author

@Hallberg-NOAA I updated units. This PR should be ready now

Copy link
Copy Markdown
Member

@Hallberg-NOAA Hallberg-NOAA left a comment

Choose a reason for hiding this comment

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

I have examined these changes and believe them to be correct.

This PR will be ready to merge into the dev/gfdl branch of MOM6 after it is rebased onto the latest version of dev/gfdl (resolving the minor conflicts in the process) and passed the pipeline testing.

@alex-huth alex-huth force-pushed the dev/gfdl_inner_solve_opts branch 2 times, most recently from 6e5e389 to c316097 Compare April 29, 2026 14:11
Added MINRES and CR methods to solve the shallow shelf approximation.
Further optimized CG. The new CG is answer changing, but only because
IDIAGU/IDIAGv reciprocals are now procomputed to replace per-iteration
divisions with multiplications. MINRES and CR can be faster than CG.
Also added CG_HALO_SHRINK parameter to disable the halo-shrinking
scheme for CG; combined with the other changes, this reduces the
number of pass_vector calls to once per iteration, rather than 4
pass_vector calls every nihalo iterations. Disabling the
halo-shrinking can be faster for certain combinations of grid
properties (halo size, symmetric/nonsymmetric, grid size).
Removed a line that caused an error when compiling in debug mode,
where a variable was being set to the value of another variable that
was not set yet. This line was not needed.
Added a wrapper subroutine that performs the shared setup for each of
the Krylov methods, calls the selected Krylov method, and assigns
BCs. Also: made sure the number of iters is returned from each method
in the unlikely case of an early exit; slight change to where CG
convergence is tested to avoid evaluating extra unneeded code.
@alex-huth alex-huth force-pushed the dev/gfdl_inner_solve_opts branch from c316097 to 90d3840 Compare April 29, 2026 14:23
@alex-huth
Copy link
Copy Markdown
Author

Ok, rebased and tests passed

@Hallberg-NOAA
Copy link
Copy Markdown
Member

This PR has passed pipeline testing at https://gitlab.gfdl.noaa.gov/ogrp/mom6ci/MOM6/-/pipelines/30731.

@Hallberg-NOAA Hallberg-NOAA merged commit 416ffd3 into NOAA-GFDL:dev/gfdl Apr 29, 2026
52 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) enhancement New feature or request Parameter change Input parameter changes (addition, removal, or description)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants