Skip to content

Fixes Omega ssh calculation#335

Open
vanroekel wants to merge 3 commits intoE3SM-Project:developfrom
vanroekel:vanroekel/omega/fix-ssh-calc
Open

Fixes Omega ssh calculation#335
vanroekel wants to merge 3 commits intoE3SM-Project:developfrom
vanroekel:vanroekel/omega/fix-ssh-calc

Conversation

@vanroekel
Copy link
Collaborator

@vanroekel vanroekel commented Feb 5, 2026

The current SSH calculation is designed for stacked shallow water only and was causing issues (such as NaNs in the barotropic channel case) in current tests. The SSH calculation is moved to the VertCoord class and computed alongside ZMid and ZInterface

Checklist

  • Linting
  • Building
    • CMake build does not produce any new warnings from changes in this PR
  • Testing
    • Add a comment to the PR titled Testing with the following:
      • Which machines CTest unit tests
        have been run on and indicate that are all passing.
      • The Polaris omega_pr test suite
        has passed, using the Polaris e3sm_submodules/Omega baseline
      • Document machine(s), compiler(s), and the build path(s) used for -p for both the baseline (Polaris e3sm_submodules/Omega) and the PR build
      • Indicate "All tests passed" or document failing tests
      • Document testing used to verify the changes including any tests that are added/modified/impacted.

resolves #321
resolves #332

Moves SSH calculation to the VertCoord class and computes it as a single
layer instead of a multi level field.
@vanroekel vanroekel added the bug Something isn't working label Feb 5, 2026
LocZInterf(ICell, KLyr) = -LocBotDepth(ICell) + Accum;
LocZMid(ICell, KLyr) =
-LocBotDepth(ICell) + Accum - 0.5 * DZ;
if (KLyr == 0) {
Copy link

Choose a reason for hiding this comment

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

Shouldn't this be the following?

Suggested change
if (KLyr == 0) {
if (KLyr == KMin) {

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh yes, definitely. I'll fix that

@vanroekel
Copy link
Collaborator Author

Testing
Currently have tested the cases in the related issues.

Barotropic channel

With omega/develop layer thickness at the 10th step in the top layer are

array([nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
       nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
       nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
       nan])

with this PR

array([33.32555911, 33.32555911, 33.32555911, 33.32555911, 33.32555911,
       33.32555911, 33.32555911, 33.32555911, 33.32555911, 33.32555911,
       33.34110755, 33.34110755, 33.34110755, 33.34110755, 33.34110755,
       33.34110755, 33.34110755, 33.34110755, 33.34110755, 33.34110755,
       33.34110755, 33.34110755, 33.34110755, 33.34110755, 33.34110755,
       33.34110755, 33.34110755, 33.34110755, 33.34110755, 33.34110755,
       33.32555911, 33.32555911, 33.32555911, 33.32555911, 33.32555911,
       33.32555911, 33.32555911, 33.32555911, 33.32555911, 33.32555911])

In the single column test case, also confirmed that when using pseudoThickness in the input file from polaris the ZMid and ZInterface values look as expected and SshCell is 0 as expected.

Currently running the omega_pr suite on perlmutter. Will update when finished.

@vanroekel
Copy link
Collaborator Author

A note that this PR breaks the manufactured solution tests b/c it provides geometric thickness. This would need the Polaris addition of PseudoThickness and renaming in Omega, or alternatively we could add a bit of code to Omega to convert to pseudothickness if layerthickness is provided. Any thoughts on how to proceed?

@cbegeman
Copy link

cbegeman commented Feb 6, 2026

@vanroekel This draft PR converts geometric thickness to pseudo-thickness in the initial condition E3SM-Project/polaris#460. I have also planned to include in this PR a conversion from pseudo-thickness to geometric thickness in the reading of model output. Would this address the issue you're seeing?

@vanroekel
Copy link
Collaborator Author

@vanroekel This draft PR converts geometric thickness to pseudo-thickness in the initial condition E3SM-Project/polaris#460. I have also planned to include in this PR a conversion from pseudo-thickness to geometric thickness in the reading of model output. Would this address the issue you're seeing?

So in the processing of test results it would convert back? That would be excellent. I do think for the planar manufactured solutions we'd need to provide a temperature / salinity for the pseudo thickness, but if we did I think that + your PR would address things.

@cbegeman
Copy link

cbegeman commented Feb 7, 2026

So in the processing of test results it would convert back? That would be excellent. I do think for the planar manufactured solutions we'd need to provide a temperature / salinity for the pseudo thickness, but if we did I think that + your PR would address things.

Exactly. I'll check in with you about the development timing so that this PR doesn't get held up.

hyungyukang pushed a commit to hyungyukang/Omega that referenced this pull request Feb 18, 2026
This PR adds ProvThickness to LayerThicknessAux, which is
needed by the tracer equations. PR E3SM-Project#335 removes SSH from
LayerThicknessAux and removes computeVarsOnCells from
computeMomAux.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SSH incorrect Inactive layers introduce NaNs

3 participants

Comments