-
Notifications
You must be signed in to change notification settings - Fork 13
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 sea-surface height #755
Conversation
This variable has to be set from outside. CGDynamicsKernel::prepareIteration will compute the gradient of SeasurfaceHeight and stores it as CG-Vectors uGradSeasurfaceHeight and vGradSeasurfaceHeight ins CGDynamicsKernel. VPCGDynamicsKernel is using it in main update loop. Before merging we should activate a ice-only testcase.
Adds ssh to IDynamics and IOceanBoundary classes and all the derived classes. Also modifies TOPAZOcn_test.cpp and topaz_test_data.py to test ssh, as well as changing era5_topaz4_maker.py to include and interpolate ssh.
And that is "ssh" (instead of "SSH").
... to appease clang-format and the PR template
... which I missed on the last commit.
As pointed out by Tim when reviewing the PR.
…eheight_pure I also had to address some minor conflicts. The root of those was that we'd defined the gravity constant, g, in two places.
Move deg2rad to constants.hpp and use this for the radians function. Define also rad2deg and use in the degrees function ... but I still need to rewrite rad2deg as a proper hex float.
Strangely, time step two of the TOPAZ file was always NaNs. I don't understand why the model still worked.
Derived from the TOPAZ4 data, like the rest.
I converted 180/pi to a hex float here: https://observablehq.com/@jrus/hexfloat
This is a follow-up on the previous commit (should have used git commit-amend).
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.
Formatting, Icelandicisms and naming. Also, the correct component in the Coriolis term?
@@ -124,7 +127,9 @@ template <int DGadvection> class VPCGDynamicsKernel : public CGDynamicsKernel<DG | |||
+ cgA(i) | |||
* (FAtm * absatm * uAtmos(i) + // atm forcing | |||
FOcean * absocn * SC * uOcean(i)) // ocean forcing | |||
+ params.rhoIce * cgH(i) * params.fc * vOcnRel // cor + surface | |||
- params.rhoIce * cgH(i) * params.fc * u(i) // Coriolis |
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.
Is u(i)
correct here? I would expect the Coriolis term to take the other component of the 2D velocity.
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.
Nice catch!
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 is fixed now. Can you re-review @timspainNERSC ?
physics/src/modules/OceanBoundaryModule/FluxConfiguredOcean.cpp
Outdated
Show resolved
Hide resolved
This commit addresses the minor changes Tim asked for in his review. This includes re-naming variables and correcting spelling mistakes.
As per Tim's comment on PR #755. Also some mino cleaning of the mEVP momentum solver code.
Icelandicisms is a new word for misspellings :D And it's difficult to spell, which is definitely a plus! |
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.
I think that all looks good, now
Add sea-surface height
Fixes #538
Task List
Change Description
This PR adds the contribution of the sea-surface-height gradient to both the mEVP and BBM codes (through VPCGDynamicsKernel and BrittleDynamicsKernel). SSH is read in from IOceanBoundary and passed to the dynamical core. It can also be output through ConfigOutput as "ssh".
This PR is a repeat of PR #662 with some fixes to make sure the integration test runs.
Test Description
No unit test was implemented for this feature, and no quantitative test exists. Qualitative testing shows that setting a fixed sea-surface-height gradient gives drift speed close to back-of-the-envelope estimates (13 cm/s modelled, 20 cm/s from back-of-the-envelope).
Documentation Impact
None
Other Details
None
Pre-Request Checklist