-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
+Add thickness_to_dz, calc_derived_thermo and avg_specific_vol #368
+Add thickness_to_dz, calc_derived_thermo and avg_specific_vol #368
Conversation
Codecov Report
@@ Coverage Diff @@
## dev/gfdl #368 +/- ##
==========================================
Coverage 38.28% 38.29%
==========================================
Files 269 269
Lines 76018 76180 +162
Branches 13982 14011 +29
==========================================
+ Hits 29107 29174 +67
- Misses 41682 41767 +85
- Partials 5229 5239 +10
... and 6 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Add routines to calculate and store the layer-averaged specific volume, along with code to do the unit testing of this new capability. The new public interfaces include avg_specific_vol, average_specific_vol, avg_spec_vol_Wright, avg_spec_vol_Wright_full, avg_spec_vol_Wright_red and avg_spec_vol_linear. There is also a new optional argument to test_EOS_consistency to control whether these new capabilties are tested for a particular equation of state. All answers are bitwise identical, and the new capabilities pass the unit testing for self consistency.
Added the new overloaded interface thickness_to_dz to convert the layer thicknesses in thickness units [H ~> m or kg m-2] into vertical distances in [Z ~> m], with variants that set full 3-d arrays or an i-/k- slice. Also added a field (SpV_avg) for the layer-averaged specific volume to the thermo_vars_ptr type and the new subroutine calc_derived_thermo to set it. This new subroutine is being called after halo updates to the temperatures and salinities. The new runtime parameter SEMI_BOUSSINESQ was added to determine whether tv%SpV_avg is allocated and used; it is stored in GV%semi_Boussinesq. Also added the new element GV%dZ_subroundoff to the verticalGrid_type as a counterpart to GV%H_subroundoff but in height units. All answers are bitwise identical, but there is a new runtime parameter in some MOM_parameter_doc files, new elements in a transparent type and a new public interface.
f4ed37d
to
dcf5f80
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All looks reasonable to the best of my ability. Some of the specific volume calculations deserve a second look, but I will tentatively approve this and start the testing.
Gaea regression: https://gitlab.gfdl.noaa.gov/ogrp/MOM6/-/pipelines/19444 ✔️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm particularly pleased to see high code-coverage of much of the new code due to the unit tests. The vert_frict new-answer code was skipped which suggests we should run units tests with answer_date=1900 and answer_date=2300.
This PR includes a pair of commits that add code to calculate the layer averaged specific volumes, either using analytical expressions or quadrature, and the new routines
thickness_to_dz
andcalc_derived_thermo
to make use of this to convert layer thicknesses to vertical distances in all cases. There is new unit testing of the layer averaged specific volumes included in this PR. Thethickness_to_dz
calls have been extensively tested (and appear to be correct) in much more extensive changes on a separate branch that will be in coming PRs, but they are not yet being exercised with this commit. The new public interfaces includeavg_specific_vol
,average_specific_vol
,avg_spec_vol_Wright
,avg_spec_vol_Wright_full
,avg_spec_vol_Wright_red
,avg_spec_vol_linear
,thickness_to_dz
andcalc_derived_thermo
, and there is a new array (tv%SpV_avg
) in the transparentthermo_vars_ptr
type.All answers are bitwise identical, but there are new publicly visible interfaces. The commits in this PR include: