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 kappa_shear #436

Merged
merged 2 commits into from
Aug 22, 2023

Conversation

Hallberg-NOAA
Copy link
Member

Remove dependency on the Boussinesq reference density in MOM_kappa_shear when in fully non-Boussinesq mode. This is done by using calls to calculate_density and calculate_specific_vol_derivs to calculate the thermal expansion and haline contraction coefficients, and by using thickness_to_dz to convert layer thicknesses to vertical distances.

A large part of the changes to the kappa_shear code involved refactoring it to differentiate between thicknesses and geometric heights by working internally with dynamic viscosities and diffusivities in non-Boussinesq mode, and to keep thicknesses in thickness units rather than converting them to distances in height units. The internal variable dz was renamed to h_lay in Calculate_kappa_shear and Calc_kappa_shear_vertex for greater clarity.

The scaling factor for dz_massless is now set to (US%Z_to_m*GV%m_to_H) in Calculate_kappa_shear to reduce the dependency on the Boussinesq reference density; this does not impact answers if RHO_0 = RHO_KV_CONVERT.

The internal changes related to this are extensive. This commit includes changing the units of 63 internal variables, and the addition or renaming of 17 internal variables. There are 2 new arguments to find_kappa_tke (one is necessary to differentiate thicknesses from vertical distances and while the other is used to preserve Boussinesq-mode answers), and 1 new argument to kappa_shear_column plus the renaming of another. The units of 13 internal subroutine arguments and 3 elements of the Kappa_shear_CS type change. A total of 6 thickness unit conversion factors were eliminated with these changes.

The answers will change in non-Boussinesq mode when the Jackson et al. shear mixing parameterization is in use, but they are bitwise identical in all Boussinesq test cases. There are no changes to external interfaces.

  Remove dependency on the Boussinesq reference density in MOM_kappa_shear when
in fully non-Boussinesq mode.  This is done by using calls to calculate_density
and calculate_specific_vol_derivs to calculate the thermal expansion and haline
contraction coefficients, and by using thickness_to_dz to convert layer
thicknesses to vertical distances.

  A large part of the changes to the kappa_shear code involved refactoring it to
differentiate between thicknesses and geometric heights by working internally
with dynamic viscosities and diffusivities in non-Boussinesq mode, and to keep
thicknesses in thickness units rather than converting them to distances in
height units.  The internal variable dz was renamed to h_lay in
Calculate_kappa_shear and Calc_kappa_shear_vertex for greater clarity.

  The scaling factor for dz_massless is now set to (US%Z_to_m*GV%m_to_H) in
Calculate_kappa_shear to reduce the dependency on the Boussinesq reference
density; this does not impact answers if RHO_0 = RHO_KV_CONVERT.

  The internal changes related to this are extensive.  This commit includes
changing the units of 63 internal variables, and the addition or renaming of 17
internal variables.  There are 2 new arguments to find_kappa_tke (one is
necessary to differentiate thicknesses from vertical distances and while the
other is used to preserve Boussinesq-mode answers), and 1 new argument to
kappa_shear_column plus the renaming of another.  The units of 13 internal
subroutine arguments and 3 elements of the Kappa_shear_CS type change. A total
of 6 thickness unit conversion factors were eliminated with these changes.

  The answers will change in non-Boussinesq mode when the Jackson et al. shear
mixing parameterization is in use, but they are bitwise identical in all
Boussinesq test cases.  There are no changes to external interfaces.
@Hallberg-NOAA Hallberg-NOAA added enhancement New feature or request answer-changing A change in results (actual or potential) labels Aug 5, 2023
@codecov
Copy link

codecov bot commented Aug 5, 2023

Codecov Report

Merging #436 (1002022) into dev/gfdl (7e51f1d) will increase coverage by 0.00%.
The diff coverage is 61.49%.

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

@@            Coverage Diff            @@
##           dev/gfdl     #436   +/-   ##
=========================================
  Coverage     38.02%   38.03%           
=========================================
  Files           269      269           
  Lines         77508    77554   +46     
  Branches      14315    14319    +4     
=========================================
+ Hits          29475    29495   +20     
- Misses        42683    42707   +24     
- Partials       5350     5352    +2     
Files Changed Coverage Δ
src/parameterizations/vertical/MOM_kappa_shear.F90 72.35% <61.49%> (-1.76%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@marshallward marshallward self-assigned this Aug 18, 2023
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.

I did not inspect every expression, but the dz to thickness changes look correct to me.

@marshallward marshallward merged commit d60c2e0 into NOAA-GFDL:dev/gfdl Aug 22, 2023
@Hallberg-NOAA Hallberg-NOAA deleted the nonBous_kappa_shear branch September 27, 2023 16:19
@Hallberg-NOAA Hallberg-NOAA restored the nonBous_kappa_shear branch September 27, 2023 16:19
@Hallberg-NOAA Hallberg-NOAA deleted the nonBous_kappa_shear branch September 27, 2023 16:26
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.

2 participants