Skip to content

Commit

Permalink
Updates MOM_kappa_shear averaging and diagnostics. (#846)
Browse files Browse the repository at this point in the history
* Updates MOM_kappa_shear averaging and diagnostics.

- Update to horizontal averaging procedure in MOM_kappa_shear for VERTEX_SHEAR = True.
- Adds geometric and thickness weighted averages for moving diffusivity from vertices to tracer points.
- Adds new diagnostics of N2, S2, Kd, and TKE both with and without VERTEX_SHEAR, useful for debugging.

* Shorten two lines in MOM_kappa_shear to comply w/ MOM6 standard

* More updates for Kappa_Shear horizontal averaging

- Fix OMP directives for new diagnostics
- Remove quasi-2d fields that broke OMP threading
- Reworking horizontal averaging algorithm.

* Initialize new variables to zero in kappa_shear

* Only initialize some arrays in kappa shear if they are used

* Add VERTEX_SHEAR_GEOMETRIC_MEAN_KDMIN runtime option to Kappa Shear

* *+Revise horizontal avg in Calc_kappa_shear_vertex

  Revised the Calc_kappa_shear_vertex code where it averages the diffusivities
at the vertices back to the tracer points when there is either a geometric mean
being used or thickness weighting.  With these changes, the code should now pass
dimensional consistency testing, work properly with openMP threading enabled,
and give sensible values of the diffusivity for massless layers.  Also corrected
the indenting of several recently added lines to follow the MOM6 2-space
indenting convention.  This commit can change answers slightly in some cases
where VERTEX_SHEAR = True, especially if VERTEX_SHEAR_GEOMETRIC_MEAN = True or
VERTEX_SHEAR_THICKNESS_MEAN = True.  The recently added runtime parameter
VERTEX_SHEAR_KD_MEAN_ANSWER_DATE (which has not yet been added to the dev/gfdl
branch of the code) was no longer needed and has been eliminated.

* Shorten variable name VS_GeometricMean_Kd_min to VS_GeoMean_Kdmin to help with line length issues.

---------

Co-authored-by: brandon.reichl <Brandon.Reichl@noaa.gov>
Co-authored-by: Robert Hallberg <Robert.Hallberg@noaa.gov>
  • Loading branch information
3 people authored Mar 6, 2025
1 parent 53bcb50 commit 4f0c1c6
Showing 1 changed file with 277 additions and 40 deletions.
Loading

0 comments on commit 4f0c1c6

Please sign in to comment.