NCAR / MOM6

NCAR/CESM fork of the Modular Ocean Model v.6 (MOM6)
Other
3 stars 20 forks source link

Add Leith+E #251

Closed iangrooms closed 1 year ago

iangrooms commented 1 year ago

This commit adds the 2D Leith+E closure, which uses a modified 2D Leith biharmonic viscosity paired with a harmonic backscatter. ('Modified' here is not used in the same sense as 'modified 2D Leith'; it just means that the biharmonic coefficient is modified to account for enstrophy backscatter.) Variables are often named 'leithy' to refer to Leith+E.

The parameterization is controlled by three main entries in user_nl_mom:

  1. USE_LEITHY = True
  2. LEITH_CK = 1.0
  3. LEITH_BI_CONST = 8.0

To use Leith+E you should have LAPLACIAN=True and BIHARMONIC=True. (You should also be explicit and set LEITH_AH=False, along with any other viscous closures. Leith+E does use the background value of the biharmonic coefficient as a minimum, but ignores the background harmonic value.) LEITH_CK is the fraction of energy dissipated by the biharmonic term that gets backscattered by the harmonic term (it's a target; the backscatter rate is not exact.) Recommended values between 0 and 1. LEITH_BI_CONST is Upsilon^6 where Upsilon is the ratio between the grid scale and the dissipation scale for enstrophy. Values should be greater than or equal to 1; 8 is a good place to start.

The code is sensitive to the background value of Ah; specifically, if Ah is too large, the code is unstable. This is because the backscatter coefficient is proportional to Ah, and if Ah is large then you get large backscatter. If your code is unstable, consider reducing, e.g., AH_VEL_SCALE.

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 12.82% and project coverage change: -0.06 :warning:

Comparison is base (aa58724) 37.07% compared to head (1c8df77) 37.02%.

:exclamation: Current head 1c8df77 differs from pull request most recent head bd13ba6. Consider uploading reports for the commit bd13ba6 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev/ncar #251 +/- ## ============================================ - Coverage 37.07% 37.02% -0.06% ============================================ Files 264 264 Lines 74421 74564 +143 Branches 13780 13813 +33 ============================================ + Hits 27592 27604 +12 - Misses 41739 41855 +116 - Partials 5090 5105 +15 ``` | [Impacted Files](https://app.codecov.io/gh/NCAR/MOM6/pull/251?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NCAR) | Coverage Δ | | |---|---|---| | [src/parameterizations/lateral/MOM\_hor\_visc.F90](https://app.codecov.io/gh/NCAR/MOM6/pull/251?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NCAR#diff-c3JjL3BhcmFtZXRlcml6YXRpb25zL2xhdGVyYWwvTU9NX2hvcl92aXNjLkY5MA==) | `45.62% <12.82%> (-4.70%)` | :arrow_down: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/NCAR/MOM6/pull/251/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NCAR)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

gustavo-marques commented 1 year ago

Just one more minor very minor suggestion. We should follow Fortran2003 conventions, so please use <, <=, >, >=, ==, and /= instead of .LT., .LE., .GT., .GE., .EQ., and .NE., respectively.

gustavo-marques commented 1 year ago

@iangrooms, thanks for addressing all the issues. Our tests are passing (mom_pr). I also ran a few manual tests with this scheme enabled to make sure the model reproduces across restarts and with different PE layouts. Everything checks.