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 set_diffusivity #453

Merged

Conversation

Hallberg-NOAA
Copy link
Member

This commit revises the internal routines called by set_diffusivity to work in fully non-Boussinesq mode, eliminating all dependencies on the Boussinesq reference density when in non-Boussinesq mode. The publicly visible interfaces to this module and the external routines it calls have already been revised, so only this file needs to be updated. The specific changes include:

  • Refactored add_LOTW_BBL_diffusivity, add_MLrad_diffusivity, and set_BBL_TKE to work in units of layer vertical extent rather than layer thickness to give results in non-Boussinesq mode that avoid dependence on the Boussinesq reference density.

  • Work with internal variables in vertical distances in the denominator of diffusive flux calculations in find_TKE_to_Kd, while other expressions in this routine are recast in terms of thicknesses to avoid conversions.

  • Use tv%SpV_avg instead of 1/RHO_0 in find_TKE_to_Kd when in fully non-Boussinesq mode.

  • Use layer target density differences in place of g_prime in set_density_ratios in mathematically equivalent expressions when non-Boussinesq.

  • Use thickness_to_dz in 3 places to convert layer thicknesses into vertical distances.

  • The thickness argument to add_MLrad_diffusivity (in [H ~> m or kg m-2]) has been replaced with a vertical extent argument (in [Z ~> m]).

  • Use fluxes%tau_mag in place of fluxes%ustar in add_MLrad_diffusivity when in non-Boussinesq or semi-Boussinesq mode. There is a new thermo_var_ptrs type argument to the internal routine add_MLrad_diffusivity to permit this changes.

  • Use the in situ near-bottom density when adding certain contributions to non-Boussinesq diffusivities. This change includes the addition of a new bottom density (rho_bot) argument to add_int_tide_diffusivity, add_LOTW_BBL_diffusivity and add_drag_diffusivity.

  • Use GV%dZ_subroundoff in 4 spots in place of GV%H_to_Z*GV%H_subroundoff.

  • A long-standing comment questioning whether there is double-counting of tidal mixing has been addressed (there is not) and the comment has been revised accordingly.

These changes involved changing the units of 21 internal variables and 1 element in the set_diffusivity_CS type. There are 11 new internal variables, while 9 internal variables were eliminated. A total of 44 thickness rescaling factors were eliminated, and there are 2 places where GV%Rho_0 was being used explicitly that were changed into equivalent rescaling factors.

All answers are bitwise identical in Boussinesq mode, but some solutions will change in non-Boussinesq mode with this commit.

  This commit revises the internal routines called by set_diffusivity to work in
fully non-Boussinesq mode, eliminating all dependencies on the Boussinesq
reference density when in non-Boussinesq mode.  The publicly visible interfaces
to this module and the external routines it calls have already been revised, so
only this file needs to be updated.  The specific changes include:

 - Refactored add_LOTW_BBL_diffusivity, add_MLrad_diffusivity, and set_BBL_TKE
   to work in units of layer vertical extent rather than layer thickness to give
   results in non-Boussinesq mode that avoid dependence on the Boussinesq
   reference density.

 - Work with internal variables in vertical distances in the denominator of
   diffusive flux calculations in find_TKE_to_Kd, while other expressions in
   this routine are recast in terms of thicknesses to avoid conversions.

 - Use tv%SpV_avg instead of 1/RHO_0 in find_TKE_to_Kd when in fully
   non-Boussinesq mode.

 - Use layer target density differences in place of g_prime in
   set_density_ratios in mathematically equivalent expressions when
   non-Boussinesq.

 - Use thickness_to_dz in 3 places to convert layer thicknesses into vertical
   distances.

 - The thickness argument to add_MLrad_diffusivity (in [H ~> m or kg m-2]) has
   been replaced with a vertical extent argument (in [Z ~> m]).

 - Use fluxes%tau_mag in place of fluxes%ustar in add_MLrad_diffusivity when in
   non-Boussinesq or semi-Boussinesq mode.  There is a new thermo_var_ptrs type
   argument to the internal routine add_MLrad_diffusivity to permit this
   changes.

 - Use the in situ near-bottom density when adding certain contributions to
   non-Boussinesq diffusivities.  This change includes the addition of a new
   bottom density (rho_bot) argument to add_int_tide_diffusivity,
   add_LOTW_BBL_diffusivity and add_drag_diffusivity.

 - Use GV%dZ_subroundoff in 4 spots in place of GV%H_to_Z*GV%H_subroundoff.

 - A long-standing comment questioning whether there is double-counting of tidal
   mixing has been addressed (there is not) and the comment has been revised
   accordingly.

  These changes involved changing the units of 21 internal variables and 1
element in the set_diffusivity_CS type.  There are 11 new internal variables,
while 9 internal variables were eliminated.  A total of 44 thickness rescaling
factors were eliminated, and there are 2 places where GV%Rho_0 was being used
explicitly that were changed into equivalent rescaling factors.

  All answers are bitwise identical in Boussinesq mode, but some solutions will
change in non-Boussinesq mode with this commit.
@Hallberg-NOAA Hallberg-NOAA added enhancement New feature or request answer-changing A change in results (actual or potential) labels Aug 12, 2023
@codecov
Copy link

codecov bot commented Aug 12, 2023

Codecov Report

Merging #453 (b8ceee6) into dev/gfdl (546728a) will decrease coverage by 0.01%.
The diff coverage is 44.64%.

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

@@             Coverage Diff              @@
##           dev/gfdl     #453      +/-   ##
============================================
- Coverage     38.06%   38.05%   -0.01%     
============================================
  Files           269      269              
  Lines         77364    77389      +25     
  Branches      14286    14292       +6     
============================================
+ Hits          29451    29453       +2     
- Misses        42572    42591      +19     
- Partials       5341     5345       +4     
Files Changed Coverage Δ
...parameterizations/vertical/MOM_set_diffusivity.F90 52.43% <44.64%> (-1.11%) ⬇️

... and 1 file with indirect coverage changes

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

@marshallward
Copy link
Member

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

@marshallward marshallward merged commit 9b86edb into NOAA-GFDL:dev/gfdl Aug 18, 2023
10 checks passed
@Hallberg-NOAA Hallberg-NOAA deleted the nonBous_set_diffusivity branch September 27, 2023 16:08
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