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 full_convection #435

Merged

Conversation

Hallberg-NOAA
Copy link
Member

This commit revises full_convection to avoid any dependency on the Boussinesq reference density when in non-Boussinesq mode. Specifically, it changes the units of the Kddt_smooth argument to full_convection and its counterpart in smoothed_dRdT_dRdS to use units of [H Z ~> m2 or kg s-1], which becomes a mass based diffusivity when in non-Boussinesq mode. This change also uses vertical distances for internal calculations in smoothed_dRdT_dRdS, and includes a call to thickness_to_dz in the full_convection routine.

This commit also revises the unit conversion of the (absurdly large) mixing length in unstable points in full_convection and of the (tiny) added smoothing distance used in the denominators of some expressions in smoothed_dRdT_dRdS to avoid division by zero with massless layers so that they are both based on the density used in rescaling input parameters (RHO_KV_CONVERT), and do not depend directly on the Boussinesq reference density (RHO_0). These parameters would have been set via get_param calls, but there is no control structure for full_convection parameters.

All Boussinesq answers are bitwise identical, but non-Boussinesq answers are altered by the use of the layer specific volumes, rather than the Boussinesq reference density, to convert layer thicknesses into vertical distances. This commit includes a change to the units of an argument (Kddt_smooth) to a publicly visible interface (full_convection).

  This commit revises full_convection to avoid any dependency on the Boussinesq
reference density when in non-Boussinesq mode.  Specifically, it changes the
units of the Kddt_smooth argument to full_convection and its counterpart in
smoothed_dRdT_dRdS to use units of [H Z ~> m2 or kg s-1], which becomes a mass
based diffusivity when in non-Boussinesq mode.  This change also uses vertical
distances for internal calculations in smoothed_dRdT_dRdS, and includes a call
to thickness_to_dz in the full_convection routine.

  This commit also revises the unit conversion of the (absurdly large) mixing
length in unstable points in full_convection and of the (tiny) added smoothing
distance used in the denominators of some expressions in smoothed_dRdT_dRdS to
avoid division by zero with massless layers so that they are both based on the
density used in rescaling input parameters (RHO_KV_CONVERT), and do not depend
directly on the Boussinesq reference density (RHO_0).  These parameters would
have been set via get_param calls, but there is no control structure for
full_convection parameters.

  All Boussinesq answers are bitwise identical, but non-Boussinesq answers are
altered by the use of the layer specific volumes, rather than the Boussinesq
reference density, to convert layer thicknesses into vertical distances.  This
commit includes a change to the units of an argument (Kddt_smooth) to a publicly
visible interface (full_convection).
@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 #435 (3afb94f) into dev/gfdl (07713af) will increase coverage by 9.13%.
The diff coverage is n/a.

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

@@             Coverage Diff              @@
##           dev/gfdl     #435      +/-   ##
============================================
+ Coverage     38.05%   47.19%   +9.13%     
============================================
  Files           269       41     -228     
  Lines         77062     4583   -72479     
  Branches      14225      806   -13419     
============================================
- Hits          29329     2163   -27166     
+ Misses        42415     2239   -40176     
+ Partials       5318      181    -5137     

see 255 files with indirect coverage changes

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

Copy link

@MJHarrison-GFDL MJHarrison-GFDL left a comment

Choose a reason for hiding this comment

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

The overloaded subroutine "thickness_to_dz" uses 3d (h) thickness to produce a 3d or 2d
(dz) result. This is a bit confusing because (h) could be passed as a 2d slice instead in the latter case.

@Hallberg-NOAA
Copy link
Member Author

Passing a 2-d slice of h to the version that returns a 2-d slice of dz might be more logically consistent, but it would involve an extra copy and serve no functional purpose. Moreover, if someone were to get this wrong in the code, it would not compile, so there is no way that this logical inconsistency could lead to an unnoticed bug!

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/20230 ✔️

@marshallward marshallward merged commit 597bbf1 into NOAA-GFDL:dev/gfdl Aug 10, 2023
@Hallberg-NOAA Hallberg-NOAA deleted the nonBous_full_convection branch September 27, 2023 16:19
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