fix call to tri-diagonal solver in MOM_wave_structure.#154
Conversation
Codecov Report
@@ Coverage Diff @@
## dev/gfdl #154 +/- ##
=========================================
Coverage 34.02% 34.02%
=========================================
Files 259 259
Lines 70204 70204
Branches 13010 13013 +3
=========================================
Hits 23884 23884
Misses 41822 41822
Partials 4498 4498
Continue to review full report at Codecov.
|
Hallberg-NOAA
left a comment
There was a problem hiding this comment.
I agree that this change corrects an error in the arguments to the (altered) tridiagonal solver that was introduced with
mom-ocean@7062289 .
The altered code is technically correct as written. However, the MOM6 style guide at https://github.com/NOAA-GFDL/MOM6/wiki/Code-style-guide#array-syntax does not encourage the use array-syntax math in subroutine arguments. Given that b_diag is not used anywhere else, apart from in this subroutine call, perhaps it would make sense to define a new variable that is this argument, and to replace the expressions setting b_diag (or perhaps leave the expressions for b_diag in comments for clarity).
|
Gaea regression: https://gitlab.gfdl.noaa.gov/ogrp/MOM6/-/pipelines/16102 ✔️ It was decided that the issues around array syntax are no worse than the existing form, and can be addressed in a later PR. |
The call to the
solve_diag_dominant_tridiaghad arguments mixed-up:lower diagonal:
c_diag = Alin the function prototypemidlle diagonal:
b_diag = AdNOT in the function prototypeupper diagonal:
a_diag = Auin the function prototypethe function call for Ac of the middle diagonal, defined as
so that the correct argument for Ac is
b_diag - a_diag - c_diag = b_diag - (a_diag + c_diag)