-
Notifications
You must be signed in to change notification settings - Fork 64
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
*Non-Boussinesq revision of diabatic_driver #430
*Non-Boussinesq revision of diabatic_driver #430
Conversation
This commit completes the non-Boussinesq revision of the diabatic_driver code. The revised code uses thickness_to_dz and works with internal variables in vertical distances in the denominator of diffusive flux calculations in diabatic_ALE_legacy, diabatic_ALE and layered_diabatic. The code now uses find_ustar to extract the friction velocities passed to KPP_compute. The (tiny) boundary layer tracer diffusivity is also rescaled to [H2 T-1]. With this set of changes, all implicit references to Boussinesq reference density are eliminated from the calculations in diabatic_driver when in non-Boussinesq mode. A total of 14 thickness rescaling factors were cancelled out, and there are 15 new or renamed variables in the diabatic routines. 4 new checksum calls are also added to diabatic_ALE_legacy to assist in debugging. Because GV%Z_to_H is an exact power of 2 in Boussinesq mode, all answers are bitwise identical in that mode, but in non-Boussinesq mode the use of the layer averaged specific volume to convert thicknesses to vertical distances leads to changing answers.
Codecov Report
@@ Coverage Diff @@
## dev/gfdl #430 +/- ##
=========================================
Coverage 38.05% 38.06%
=========================================
Files 269 269
Lines 77024 77047 +23
Branches 14221 14223 +2
=========================================
+ Hits 29314 29329 +15
- Misses 42394 42400 +6
- Partials 5316 5318 +2
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@@ -145,8 +146,8 @@ module MOM_diabatic_driver | |||
!! diffusivity of Kd_min_tr (see below) were operating. | |||
real :: Kd_BBL_tr !< A bottom boundary layer tracer diffusivity that | |||
!! will allow for explicitly specified bottom fluxes | |||
!! [H Z T-1 ~> m2 s-1 or kg m-1 s-1]. The entrainment at the bottom is at | |||
!! least sqrt(Kd_BBL_tr*dt) over the same distance. | |||
!! [H2 T-1 ~> m2 s-1 or kg2 m-4 s-2]. The entrainment at the |
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.
NB units should be kg m-1 s-1 ?
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.
In this case, Kd_BBL_tr has weird units because it is being used (by multiplying by the timestep and taking a the square root) to set a minimal smoothing thickness for tracers at the bottom. Kd_BBL_tr is effectively a diffusivity times a density in non-Boussinesq mode. In this case we are effectively using a prescribed density - the same one (RHO_KV_CONVERT) as is being used to convert diffusivities from [m2 s-1] to [kg m-1 s-1] in non-Boussinesq mode.
Were we being more precise, this density that is being multiplied by a near-bottom diffusivity would probably be a density averaged over a near-bottom thickness, and perhaps that averaging thickness itself would be determined by sqrt(Kd_BBL * rho_avg)
, but this then becomes an implicit, iteratively solved equation that hardly seems like it would worth the extra complexity and cost.
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.
obo @MJHarrison-GFDL
Gaea regression: https://gitlab.gfdl.noaa.gov/ogrp/MOM6/-/pipelines/20223 ✔️ |
This commit completes the non-Boussinesq revision of the diabatic_driver code. The revised code uses thickness_to_dz and works with internal variables in vertical distances in the denominator of diffusive flux calculations in diabatic_ALE_legacy, diabatic_ALE and layered_diabatic. The code now uses find_ustar to extract the friction velocities passed to KPP_compute. The (tiny) boundary layer tracer diffusivity is also rescaled to [H2 T-1]. With this set of changes, all implicit references to Boussinesq reference density are eliminated from the calculations in diabatic_driver when in non-Boussinesq mode.
A total of 14 thickness rescaling factors were cancelled out, and there are 15 new or renamed variables in the diabatic routines. 4 new checksum calls are also added to diabatic_ALE_legacy to assist in debugging.
Because GV%Z_to_H is an exact power of 2 in Boussinesq mode, all answers are bitwise identical in that mode, but in non-Boussinesq mode the use of the layer averaged specific volume to convert thicknesses to vertical distances leads to changing answers.