+Simplify rescaling by US%L_to_Z#806
Merged
Hallberg-NOAA merged 3 commits intoNOAA-GFDL:dev/gfdlfrom Jan 27, 2025
Merged
Conversation
raphaeldussin
approved these changes
Jan 27, 2025
Added the new gravitational acceleration element GV%g_Earth_Z_T2 to the verticalGrid_type as a copy of GV%g_Earth that uses dimensional rescaling of [Z T-2 ~> m s-2] instead of [L2 Z-1 T-2 ~> m s-2]. GV%g_Earth_Z_T2 is more convenient for single-column energy calculations, but the two will only differ by an integer power of two when dimensional rescaling is applied. In addition, the apparently unused element GV%mks_g_Earth was commented out, and it will be eliminated in several months if there are no concerns raised by MOM6 users whose code is not on any of the primary development branches of MOM6. Explicitly rescaled versions of GV%g_Earth were replaced by GV%g_Earth_Z_T2 in 38 places in 14 files, leading to the elimination of 38 US%L_to_Z**2 dimensional rescaling factors. Another US%L_to_Z**2 rescaling factor was eliminated from the code in ePBL_column by folding it into MKE_to_TKE_effic. All answers are bitwise identical, but there are changes to the contents of a transparent type.
Revised the internal rescaling of turbulent kinetic energies in MOM_bulk_mixed_layer to work in units of [H Z2 T-2] instead of [H L2 T-2], for greater consistency with the rescaling of TKE elsewhere. These changes included using GV%g_Earth_Z_T2 instead of GV%g_Earth in 16 places that contribute to potential energy calculations. In 5 lines, the unit scaling factors were eliminated, while in 2 others the rescaling factors were revised. In addition, the rescaling factors to go from the units of mean kinetic energy to those of turbulent kinetic energy were folded into the internal representation of the bulk Richardson numbers. The units in comments describing 58 variables and the conversion arguments for 10 diagnostics were updated accordingly. All answers and output are bitwise identical.
Rescaled the internal representation of the FGNV_STRAT_FLOOR variable and thickness_diffuse%N2_floor to include appropriate factors of US%Z_to_L to reflect the scaling of aspect ratios. This leads to the elimination of one rescaling factor in thickness_diffuse_full() and its replacement by another in a scale factor for a get_param call. All answers are bitwise identical.
fd4d3ba to
9b8be33
Compare
Member
Author
|
This PR has passed pipeline testing at https://gitlab.gfdl.noaa.gov/ogrp/mom6ci/MOM6/-/pipelines/26204. |
This was referenced Apr 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR consists of three commits that eliminate 46 instances where there was a need to multiply by
US%L_to_Zduring run-time. There are 9 instances where there are compensating additions of factors ofUS%L_to_Ztoscaleorconversionarguments that are used during model initialization.The first commit introduces a newly rescaled version of the gravitational acceleration,
GV%g_Earth_Z_T2, to theverticalGrid_typeas a copy ofGV%g_Earththat uses dimensional rescaling of[Z T-2 ~> m s-2]instead of[L2 Z-1 T-2 ~> m s-2].GV%g_Earth_Z_T2is more convenient for single-column energy calculations (for which horizontal scales should be irrelevant), but the two variables will only differ by an integer power of two when dimensional rescaling is applied. This new version of the gravitational acceleration is used in 15 files.Another
US%L_to_Z**2rescaling factor was eliminated from the code inePBL_column()by folding it intoMKE_to_TKE_effic.The second commit revises the internal rescaling of turbulent kinetic energies in
MOM_bulk_mixed_layerto work in units of[H Z2 T-2]instead of[H L2 T-2], for greater consistency with the rescaling of TKE elsewhere. These changes included usingGV%g_Earth_Z_T2instead ofGV%g_Earthin 16 places that contribute to potential energy calculations. In 5 lines, the unit scaling factors were eliminated, while in 2 others the rescaling factors were revised. In addition, the rescaling factors to go from the units of mean kinetic energy to those of turbulent kinetic energy were folded into the internal representation of the bulk Richardson numbers. The units in comments describing 58 variables and the conversion arguments for 10 diagnostics were updated accordingly.The third commit rescales the internal representation of the
FGNV_STRAT_FLOORvariable andthickness_diffuse%N2_floorinMOM_mixedlayer_restratto include appropriate factors ofUS%Z_to_Lto reflect the scaling of aspect ratios. This leads to the elimination of one rescaling factor inthickness_diffuse_full()and its replacement by another in a scale factor for aget_param()call.All answers and output are bitwise identical, but there is a new element in a transparent type. The specific commits in this PR include: