Skip to content

Adds reading of omega HorzMesh from mesh iostream #382

Open
philipwjones wants to merge 4 commits intoE3SM-Project:developfrom
philipwjones:omega/add-mesh-stream
Open

Adds reading of omega HorzMesh from mesh iostream #382
philipwjones wants to merge 4 commits intoE3SM-Project:developfrom
philipwjones:omega/add-mesh-stream

Conversation

@philipwjones
Copy link
Copy Markdown

@philipwjones philipwjones commented Apr 7, 2026

Uses an input IOStream to read the input horizontal mesh variables. Mesh metadata have been added to the mesh class and are also read from this file. The same filename is used by Decomp. If the Decomp optional argument for a mesh file is supplied (eg in some unit test drivers), that value overrides the mesh stream filename. All physical mesh fields are defined for IO and are added to a field group HorzMeshIn. Some cleanup of the HorzMesh test driver is included to reduce test output and conform to omega code conventions. User and developer docs have been updated with these changes.

Checklist

  • Documentation:
  • 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.
      • Performance related PRs: Please include a relevant PACE experiment link documenting performance before and after.

Fixes #311
Fixes #395

  Uses an input IOStream to read the input horizontal mesh
  variables. The same filename is used by Decomp.  If the Decomp
  optional argument for a mesh file is supplied, that value overrides
  the mesh stream filename. All physical mesh fields are defined for IO
  and are added to a field group HorzMeshIn. Some cleanup of the
  HorzMesh test driver is included to reduce test output and
  conform to omega code conventions. User and developer docs have
  been updated with these changes.
  updated HorzMesh interfaces
@philipwjones philipwjones requested review from sbrus89 and xylar April 7, 2026 21:01
@philipwjones philipwjones self-assigned this Apr 7, 2026
@philipwjones philipwjones added enhancement New feature or request Omega labels Apr 7, 2026
@philipwjones
Copy link
Copy Markdown
Author

Passes ctests on Perlmutter (CPU)

@xylar
Copy link
Copy Markdown

xylar commented Apr 9, 2026

Thanks @philipwjones! I'll take a look ASAP.

@xylar
Copy link
Copy Markdown

xylar commented Apr 12, 2026

I'm working on the Polaris side of supporting these changes in E3SM-Project/polaris#527. That's going to need some fixes in Polaris for the horizontal pressure gradient before it can be tested.

@xylar
Copy link
Copy Markdown

xylar commented Apr 18, 2026

@philipwjones, this is excellent work! I've been able to make use of it in Polaris in E3SM-Project/polaris#544. It allows a major refactor where we split out the mesh and initial conditions into entirely separate files.

I did run into an issue that I'll comment on below.

@xylar
Copy link
Copy Markdown

xylar commented Apr 18, 2026

@philipwjones and @brian-oneill, in the merry-go-round test, which may be the only current omega_pr test that has multiple vertical layers, I'm seeing:

[info] Omega using calendar type: No Leap
[info] Successfully read stream HorzMeshIn from file mesh.nc
[info] VertCoord: vertical dimension not found in mesh file, using NVertLayers = 1
[critical] [IOStream.cpp:682] Inconsistent length for dimension NVertLayers in stream InitialVertCoord
[critical] [Error.cpp:43] Omega aborting

This is on Frontier at:

/lustre/orion/cli115/scratch/xylar/polaris_0.7/frontier/test_20260418/omega-pr-split-mesh2/ocean/planar/merry_go_round/default/forward/5m_90s_limiter

in case it's helpful.

Looking at the code, it seems that VertCoord is mistakenly still trying to get its vertical dimension (and maybe all of its fields?) from the mesh file:

https://github.com/philipwjones/E3SM/blob/omega/add-mesh-stream/components/omega/src/ocn/VertCoord.cpp#L90-L119

not from the separate InitialVertCoord stream:
https://github.com/philipwjones/E3SM/blob/omega/add-mesh-stream/components/omega/configs/Default.yml#L95-L104

I don't know if this is something we want to address in this branch or leave for a follow-up PR. But I won't be able to fully test E3SM-Project/polaris#544 until it gets addressed.

@brian-oneill
Copy link
Copy Markdown

@xylar It's a minor change, but probably makes more sense to do it separately. I can code it up and create the PR today.

@xylar
Copy link
Copy Markdown

xylar commented Apr 20, 2026

@brian-oneill, does is make sense to fold that into a broader fix for #391?

   reads global mesh metadata like OnSphere, IsPeriodic and a few others
   from the input mesh data file
  - also removed some debug statements in IOStream
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Omega

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OnSphere is currently not being read from the initial condition. Do not hard-code OmegaMesh.nc in Decomp

3 participants