Repository navigation
Conversation
|
This work is motivated by the need for reconstructed velocity components for analysis work in Polaris before the Sept. 15th deadline. |
|
Needs to have the velocity reconstruction coefficients added to planar meshes for CTests, following the fix from E3SM-Project/polaris#721. |
PlanarPeriodic48x48.omega_vars.260518.nc has no vector-reconstruction fields, so Omega's planar CTests cannot exercise the reconstruction. The two spherical CTest meshes gained them in the 260807 update, but the planar one was left behind because the weights it would have gotten were wrong. Point at PlanarPeriodic48x48.omega_vars.260825.nc, which is the same mesh with NEdgesReconOnCell, ReconStencilCell and ReconWeightsCell appended, computed after the two planar fixes earlier on this branch. No pre-existing variable changed. Omega will pick up the same datestamp in E3SM-Project/Omega#525.
Early CTestingCTest unit tests:
|
Add an overload that reconstructs one layer of a multi-layer field. The reconstruction is independent in each layer, so this is the existing single-layer form with a vertical index added. Factor the Cartesian to local geographic rotation into a shared helper so the spherical and planar paths stay identical between the two overloads. Extend the operator unit test to exercise the multi-layer form. Each layer holds the exact field scaled by a layer-dependent factor so that a reconstruction which mixed layers would show up as an error. The error measures are normalized by the exact field, so the same expected errors apply as for the single-layer case. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The reconstruction stencil and weights are precomputed as a mesh preprocessing step rather than by Omega, so whether they are available is a property of the mesh file, not of whether the mesh is spherical. Detect their presence by attempting the read of NEdgesReconOnCell and treating a failure as "not present", and carry the answer as Decomp::HasVectorRecon and HorzMesh::HasVectorRecon. This lets planar meshes carry reconstruction data while leaving planar meshes that predate it readable, and makes VectorReconOnCell abort with a message naming the three arrays it needs rather than refusing every planar mesh. The planar branch already present in the operator becomes reachable as a result. Decomp no longer parses the OnSphere attribute, which existed only to gate these reads; HorzMesh still determines it from the full mesh stream as before. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Add a VelocityReconAuxVars auxiliary variable class holding the zonal and meridional velocity components reconstructed at cell centers from the edge-normal velocity, and register both as fields in the AuxiliaryState field group so they can be requested by any IO stream. On a planar mesh the reconstructed vector already lies in the plane of the mesh, so the two components are the Cartesian x and y components. The reconstruction is written out here rather than calling VectorReconOnCell so that layers outside MinLayerCell/MaxLayerCell keep the fill value that Field::attachData wrote, which the operator, as a reference implementation, knows nothing about. Add AuxiliaryState::computeVelocityRecon to drive it. These are diagnostics that no tendency reads, so the computation is deliberately kept out of computeAll, which runs once per time stepper stage, and is over owned cells only. It aborts if the mesh supplied no reconstruction data. Nothing calls it yet. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Add IOStream::isFieldRequested, which reports whether a Field is in the contents of any defined stream, so a diagnostic that nothing will read or write can be skipped. Since validate replaces a group name in a stream's contents by its member Fields, this is only meaningful after the streams are validated; an unvalidated stream conservatively answers yes so an optional computation is done rather than skipped. Use it to gate AuxiliaryState::computeVelocityRecon, resolving the answer on the first call and caching it, since the streams are validated only after all Fields are defined and so well after the auxiliary state is constructed. Call it once per time step from both ocnRun loops, on the state the step just produced (time level 0), which is the state that updateTimeLevels has attached to the NormalVelocity field and so the one that any stream writing this step will write. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The surface velocity and SSH gradient exported to the coupler are reconstructed at cell centers from edge-normal quantities, so a coupled run needs a mesh that supplies the reconstruction stencil and weights. Now that HorzMesh only reads these when the mesh file has them, check HasVectorRecon at initialization so a coupled run on a mesh without them fails there rather than at the first export. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Add VelocityZonalCell and VelocityMeridionalCell to the auxiliary variable list in the user guide, with a section on the three ways they differ from the other auxiliary variables: they are diagnostic and so computed once per step, they are only computed when a stream asks for them, and they need a mesh file that supplies the reconstruction stencil and weights. Document computeVelocityRecon in the auxiliary state developer guide, and IOStream::isFieldRequested in the IOStreams developer guide. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
PlanarPeriodic48x48.omega_vars.260825.nc is the first planar mesh to carry the vector reconstruction stencil and weights, so the CTests that use a planar mesh need it rather than the earlier datestamps. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Drop the early return that made testVectorRecon a no-op for planar meshes, now that the planar test mesh carries the reconstruction stencil and weights. On a plane the reconstructed components are the Cartesian x and y ones rather than zonal and meridional, which the magnitude comparison the test makes is indifferent to. The expected error norms for the planar setup were derived offline from the mesh file, using a calculation that reproduces the spherical expected values already in this file to within 5e-14 relative. They have since been confirmed by a CTest run on chrysalis with intel. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
b9da99c to
cf86cf3
Compare
TestingOn chrysalis with intel and openmpi:
Posted by Claude Code on @xylar's behalf. The testing, analysis and wording above are AI-authored; please check them accordingly. |
The reconstruction stencil of a cell reaches beyond its own edges, so near bathymetry it includes edges that are not active in a layer where the cell is. Their normal velocity is zero or, below both neighboring cells, the fill value, which leaked into the reconstructed components. On the QU240 realistic_global mesh this gave values near 1e35 in 7% of the active cell layers. Treat edges outside [MinLayerEdgeBot, MaxLayerEdgeTop] as having zero normal velocity, as MPAS-Ocean's zeroed normalVelocity does there. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Add a VelocityReconAuxVars check to AuxiliaryVarsTest in which every fourth column (by global cell ID, so halos agree) is half as deep. The velocity is masked as the model masks it, with the fill value below both cells of an edge and zero below one, and the result is compared in each cell's active layers against VectorReconOnCell applied to the same velocity with every inactive edge set to zero. Without the previous commit this fails on both meshes, with differences near 1e36 from the fill value. It runs last since it changes the vertical layer ranges the other checks assume are full depth. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
TestingOn pm-gpu with gnugpu and mpich:
Both fields are bit-for-bit between the two rank counts in each decomp task, and cosine_bell is within 7.0e-4 of the analytic solid-body velocity. QU240 leaves 16% of cell-layers inactive, with columns from 2 to 60 layers, so the stencil's inactive-edge skip is exercised there. Posted by Claude Code on @xylar's behalf. The testing, analysis and wording above are AI-authored; please check them accordingly. |
Add VelocityZonalCell and VelocityMeridionalCell, the velocity components reconstructed at cell centers from the edge-normal velocity, as auxiliary fields that any IO stream can request.
Neither field is in any stream by default. They are computed once per time step, and only when a stream contains one of them. Stencil edges below the bathymetry count as zero velocity, as in MPAS-Ocean. On planar meshes the fields hold the Cartesian x and y components instead. This puts the
VectorReconOnCelloperator from #480 to use.Other changes:
VectorReconOnCellcan reconstruct one layer of a multi-layer field.SfcCoupling::initaborts if the mesh lacks the reconstruction data, which the coupler export needs.Checklist
Documentation:
Linting
Building
Testing
aurora, oneapi-ifx, mpich
chrysalis, oneapi-ifx, openmpi
frontier, craygnu, mpich
frontier, craygnu-mphipcc, mpich
pm-cpu, gnu, mpich
pm-gpu, gnugpu, mpich
Provide relevant details in a comment to the PR titled
Testingwith the following:have been run on and indicate that are all passing.
has passed, using the Polaris
e3sm_submodules/Omegabaseline-pfor both the baseline (Polarise3sm_submodules/Omega) and the PR buildPerformance related PRs: Please include a relevant PACE experiment link documenting performance before and after.
New tests:
Stealth Features
Posted by Claude Code on @xylar's behalf. The testing, analysis and wording above are AI-authored; please check them accordingly.