Merged
Conversation
The MEKE GM computation of `src` and `src_GM`, a diagnostic array, were placed in a single loop. The similar RHS of each expression made it unfavorable to use FMAs on the `src` update. Older production runs depending on this FMA were seeing answer changes. This patch restores the FMA loop update of `src` by separating `src` and `src_GM` into separate loops.
This patch makes several adjustments to MOM_MEKE.F90 and MOM_hor_visc.F90 to ensure that the Laplacian and biharmonic friction coefficients are computed separately, and only if their respective terms are enabled. This resolves some subtle bugs where the default biharmonic value of -1 was applied to the Laplacian case, even when the biharmonic MEKE friction was disabled.
The if-test inside of the FrictWork loops are likely to impede performance. Even if the total work is reduced, they are likely to interrupt pipelines. When EY24_EBT_BS is disabled, they will clearly reduce performance. This patch moves those tests outside of the if-block and applies them separately. (Calculation would be slightly improved if the meaning of the flag were reversed, but I don't want to make additional changes.)
The damping MEKE loop also included updates to multiple diagnostics, even if they were not registered. This would presumably have a negative impact on performance. This patch moves each diagnostic into a separate loop. It also conditionally precomputes the damping and damp_rate parameters, which are now stored as 2d arrays rather than in-loop scalars. As before, the MEKE calculation is left unchanged in order to preserve bit reproducibility.
The redefining of int_tide_CS control struct in set_diffusivity_init caused errors in debug-mode for Intel compilers. The issue appears to be an internal function that expects a pointer rather than the type. This patch reverts this back to a pointer. We can revisit this if there is a need to reduce reliance on pointers.
This patch updates the expression for FrictWork_bh (biharmonic frictional work) when the FrictWork_bug flag is enabled. The new form is symmetric to rotations when FMA instructions are enabled.
GFDL to main (2024-11-27)
Member
Author
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev/gfdl #801 +/- ##
============================================
+ Coverage 37.05% 39.17% +2.12%
============================================
Files 271 298 +27
Lines 81290 96153 +14863
Branches 15166 19122 +3956
============================================
+ Hits 30124 37671 +7547
- Misses 45526 52028 +6502
- Partials 5640 6454 +814
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Member
Author
|
Regressions are due to the apparent-removal of MEKE diagnostics, which are now conditionally registered. These can be ignored. |
This was referenced Apr 23, 2025
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.
Merge commit of mom-ocean#1647 from the main branch.
Includes updates which restore reproducibility from MEKE, as well as potential performance improvements.
This is a bookkeeping PR and should not be merged through GitHub.