Skip to content
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

Merged

Conversation

Hallberg-NOAA
Copy link
Member

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.

  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.
@Hallberg-NOAA Hallberg-NOAA added enhancement New feature or request answer-changing A change in results (actual or potential) labels Aug 2, 2023
@codecov
Copy link

codecov bot commented Aug 2, 2023

Codecov Report

Merging #430 (b6c4b24) into dev/gfdl (46c5262) will increase coverage by 0.00%.
The diff coverage is 44.68%.

❗ Current head b6c4b24 differs from pull request most recent head b72bdc2. Consider uploading reports for the commit b72bdc2 to get more accurate results

@@            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     
Files Changed Coverage Δ
...parameterizations/vertical/MOM_diabatic_driver.F90 46.81% <44.68%> (+0.21%) ⬆️

... 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

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 ?

Copy link
Member Author

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.

Copy link
Member

@marshallward marshallward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marshallward
Copy link
Member

Gaea regression: https://gitlab.gfdl.noaa.gov/ogrp/MOM6/-/pipelines/20223 ✔️

@marshallward marshallward merged commit ba70663 into NOAA-GFDL:dev/gfdl Aug 10, 2023
@Hallberg-NOAA Hallberg-NOAA deleted the nonBous_diabatic_driver branch September 27, 2023 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answer-changing A change in results (actual or potential) enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants