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

Add sea-surface height #755

Merged
merged 24 commits into from
Dec 13, 2024
Merged

Add sea-surface height #755

merged 24 commits into from
Dec 13, 2024

Conversation

einola
Copy link
Member

@einola einola commented Dec 6, 2024

Add sea-surface height

Fixes #538

Task List

  • Defined the tests that specify a complete and functioning change (It may help to create a design specification & test specification)
  • Implemented the source code change that satisfies the tests
  • Documented the feature by providing worked example
  • Updated the README or other documentation
  • Completed the pre-Request checklist below

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

  • The requirements of this pull request are fully captured in an issue or design specification and are linked and summarised in the description of this PR
  • No new warnings are generated
  • The documentation has been updated (or an issue has been created to track the corresponding change)
  • Methods and Tests are commented such that they can be understood without having to obtain additional context
  • This PR/Issue is labelled as a bug/feature/enhancement/breaking change
  • File dates have been updated to reflect modification date
  • This change conforms to the conventions described in the README

winzerle and others added 18 commits August 21, 2024 14:43
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.
core/src/include/constants.hpp Outdated Show resolved Hide resolved
@einola einola requested a review from timspainNERSC December 6, 2024 09:04
core/src/include/constants.hpp Outdated Show resolved Hide resolved
This is a follow-up on the previous commit (should have used git commit-amend).
Copy link
Collaborator

@timspainNERSC timspainNERSC left a 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?

dynamics/src/CGDynamicsKernel.cpp Outdated Show resolved Hide resolved
core/src/modules/include/ProtectedArrayNames.ipp Outdated Show resolved Hide resolved
@@ -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
Copy link
Collaborator

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice catch!

Copy link
Member Author

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/TOPAZOcean.cpp Outdated Show resolved Hide resolved
physics/src/modules/OceanBoundaryModule/UniformOcean.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.
@einola einola requested a review from timspainNERSC December 6, 2024 12:30
@einola
Copy link
Member Author

einola commented Dec 6, 2024

Icelandicisms is a new word for misspellings :D And it's difficult to spell, which is definitely a plus!

Copy link
Collaborator

@timspainNERSC timspainNERSC left a 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

@einola einola merged commit 7010c7f into develop Dec 13, 2024
5 checks passed
@einola einola deleted the issue538_seasurfaceheight_pure branch December 13, 2024 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gradient of sea-surface height
3 participants