-
Notifications
You must be signed in to change notification settings - Fork 65
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
Add MASS_WEIGHT_IN_PGF_VANISHED_ONLY to modify mass weighting in PGF #810
Add MASS_WEIGHT_IN_PGF_VANISHED_ONLY to modify mass weighting in PGF #810
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this new contribution. I appreciate where this is going, but I believe that there are dimensionally inconsistent expressions that need to be revisited, as identified in specific comments at the relevant lines. To evaluate the dimensional consistency of these expressions, you should verify that different values of H_RESCALE_POWER
and Z_RESCALE_POWER
give identical results.
There is also some inconsistent indenting in a few places.
Once these problems are corrected, I will be happy to accept this PR.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev/gfdl #810 +/- ##
============================================
- Coverage 38.15% 38.13% -0.02%
============================================
Files 296 296
Lines 87249 87400 +151
Branches 16284 16339 +55
============================================
+ Hits 33287 33331 +44
- Misses 47975 48067 +92
- Partials 5987 6002 +15 ☔ View full report in Codecov by Sentry. |
Thanks Bob! I think I have added your suggested changes. I tested the code on the sigma seamount, showing that
Please let me know if there are any further changes or verification I should be doing! Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR has now addressed all of the concerns that I had with the original version, and I am pleased to accept it. Thank you for this contribution.
This commit introduces the runtime variable `MASS_WEIGHT_IN_PGF_VANISHED_ONLY` which has default False. If true, then the `MASS_WEIGHT_IN_PRESSURE_GRADIENT` and `MASS_WEIGHT_IN_PRESSURE_GRADIENT_TOP` effect of weighting T/S integrals in slanted grid cell FV PGF calculation is turned off if both sides of the grid cell are nonvanished, where nonvanished means thickness greater than `RESET_INTXPA_H_NONVANISHED` which defaults to 1e-6 m. Since the benefit of `MASS_WEIGHT_IN_PRESSURE_GRADIENT` happens in vanished layers (creating a fake PGF away from vanished layer, which is arrested by upwinded viscosity) the benefit is still there, but now we can use `MASS_WEIGHT_IN_PRESSURE_GRADIENT` for coordinates that also have slanted layers in the open ocean that are not vanished, e.g. sigma coordinates or SIGMA_SHELF_ZSTAR coordinates in the ice shelf where we DO trust T and S values. Additionally, this is required near a grounding line in a 3D z-coord ice shelf as some strange looking slanted non-vanished cells can emerge, and MWIPG being on would create fake PGFs in non-vanished cells (and therefore generating spurious currents). Reccommend `MASS_WEIGHT_IN_PGF_VANISHED_ONLY` to be set to True, as well as `MASS_WEIGHT_IN_PRESSURE_GRADIENT` and `MASS_WEIGHT_IN_PRESSURE_GRADIENT_TOP` if you have vanishing layers with min thickness < 0.1m. Also modifies MassWt_u and MassWt_v diagnostics to reflect usage of MASS_WEIGHT_IN_PRESSURE_GRADIENT. This commit should not change answers since it defaults to False. However, my implementation is not very efficient and should probably be optimised.
…SHED_ONLY to modify mass weighting
…eplacing Boussinesq rho in nonBoussinesq code, and removing white space to follow 2-space indenting.
63fedcd
to
6630441
Compare
This PR has passed pipeline testing at https://gitlab.gfdl.noaa.gov/ogrp/mom6ci/MOM6/-/pipelines/26364 with the expected warnings about a new parameter in many MOM_parameter_doc files. |
This PR introduces the runtime variable
MASS_WEIGHT_IN_PGF_VANISHED_ONLY
which has default False. If true, then the
MASS_WEIGHT_IN_PRESSURE_GRADIENT
and
MASS_WEIGHT_IN_PRESSURE_GRADIENT_TOP
effect of weighting T/S integralsin slanted grid cell FV PGF calculation is turned off if both sides of the
grid cell are nonvanished, where nonvanished means thickness greater than
RESET_INTXPA_H_NONVANISHED
which defaults to 1e-6 m. Since the benefit ofMASS_WEIGHT_IN_PRESSURE_GRADIENT
happens in vanished layers (creating afake PGF away from vanished layer, which is arrested by upwinded viscosity)
the benefit is still there, but now we can use
MASS_WEIGHT_IN_PRESSURE_GRADIENT
for coordinates that also have slanted layers in the open ocean that are
not vanished, e.g. sigma coordinates or SIGMA_SHELF_ZSTAR coordinates in the
ice shelf where we DO trust T and S values. Additionally, this is required
near a grounding line in a 3D z-coord ice shelf as some strange looking
slanted non-vanished cells can emerge, and MWIPG being on would create fake PGFs
in non-vanished cells (and therefore generating spurious currents).
Recommend
MASS_WEIGHT_IN_PGF_VANISHED_ONLY
to be set to True, as well asMASS_WEIGHT_IN_PRESSURE_GRADIENT
andMASS_WEIGHT_IN_PRESSURE_GRADIENT_TOP
if you have vanishing layers with min thickness < 0.1m.
Also modifies MassWt_u and MassWt_v diagnostics to reflect usage
of MASS_WEIGHT_IN_PRESSURE_GRADIENT.
This commit should not change default answers since it defaults to False. However,
my implementation is not very efficient because it involves a lot of comparing
thicknesses and should probably be optimised.
I would appreciate suggestions to optimise this code!!