Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/omega/doc/devGuide/AuxiliaryVariables.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ The following auxiliary variable groups are currently implemented:
| ----- | ------------------- | ------- |
| KineticAuxVars | KineticEnergyCell ||
|| VelocityDiv ||
| LayerThicknessAuxVars | FluxLayerThickEdge | Center or Upwind|
| PseudoThicknessAuxVars | FluxLayerThickEdge | Center or Upwind|
|| MeanLayerThickEdge ||
Comment on lines -92 to 93
Copy link
Author

Choose a reason for hiding this comment

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

Do we also need to rename FluxLayerThickEdge and MeanLayerThickEdge?

| VorticityAuxVars | RelVortVertex ||
|| NormRelVortVertex ||
Expand Down
6 changes: 3 additions & 3 deletions components/omega/doc/devGuide/OceanState.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ OceanState::create(const std::string &Name, ///< [in] Name for mesh
const int NTimeLevels_ ///< [in] Number of time levels
);
```
allocates the `NormalVelocity` and `LayerThickness` arrays for a given number of time levels.
allocates the `NormalVelocity` and `PseudoThickness` arrays for a given number of time levels.
The current time level is then registered with the IO infrastructure.

After initialization, the default state object can be retrieved via:
Expand Down Expand Up @@ -60,14 +60,14 @@ to the current time level.
The arrays associated with a given time level can be accessed with the functions:
```c++
Array2DReal LayerThick;
Err = State->getLayerThickness(LayerThick, TimeLevel);
Err = State->getPseudoThickness(LayerThick, TimeLevel);
Array2DReal NormVel;
Err = State->getNormalVelocity(NormVel, TimeLevel);
```
for the device arrays and
```c++
HostArray2DReal LayerThickH;
Err = State->getLayerThicknessH(LayerThickH, TimeLevel);
Err = State->getPseudoThicknessH(LayerThickH, TimeLevel);
HostArray2DReal NormVelH;
Err = State->getNormalVelocityH(NormVelH, TimeLevel);
```
Expand Down
15 changes: 6 additions & 9 deletions components/omega/doc/devGuide/QuickStart.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,14 @@ Some tests require a valid Omega mesh file. Different tests require different
meshes. At the moment, mesh files need to be copied or linked to specifically
named files under the `test` directory. Appropriate mesh files can be
downloaded from:
- [Ocean Mesh](https://web.lcrc.anl.gov/public/e3sm/inputdata/ocn/mpas-o/oQU240/ocean.QU.240km.151209.nc)
- [Global Mesh](https://web.lcrc.anl.gov/public/e3sm/polaris/ocean/polaris_cache/global_convergence/icos/cosine_bell/Icos480/init/initial_state.230220.nc)
- [Planar Mesh](https://gist.github.com/mwarusz/f8caf260398dbe140d2102ec46a41268/raw/e3c29afbadc835797604369114321d93fd69886d/PlanarPeriodic48x48.nc)
- [Ocean Mesh](https://web.lcrc.anl.gov/public/e3sm/polaris/ocean/omega_ctest/ocean.QU.240km.omega_vars.251219.nc)
- [Global Mesh](https://web.lcrc.anl.gov/public/e3sm/polaris/ocean/omega_ctest/cosine_bell_icos480.omega_vars.250219.nc)
- [Planar Mesh](https://web.lcrc.anl.gov/public/e3sm/polaris/ocean/omega_ctest/PlanarPeriodic48x48.omega_vars.251219.nc)
```sh
wget -O ocean_test_mesh.nc https://web.lcrc.anl.gov/public/e3sm/inputdata/ocn/mpas-o/oQU240/ocean.QU.240km.151209.nc
wget -O global_test_mesh.nc https://web.lcrc.anl.gov/public/e3sm/polaris/ocean/polaris_cache/global_convergence/icos/cosine_bell/Icos480/init/initial_state.230220.nc
wget -O planar_test_mesh.nc https://gist.github.com/mwarusz/f8caf260398dbe140d2102ec46a41268/raw/e3c29afbadc835797604369114321d93fd69886d/PlanarPeriodic48x48.nc
cd test
ln -sf ../ocean_test_mesh.nc OmegaMesh.nc
ln -sf ../global_test_mesh.nc OmegaSphereMesh.nc
ln -sf ../planar_test_mesh.nc OmegaPlanarMesh.nc
wget -O OmegaMesh.nc https://web.lcrc.anl.gov/public/e3sm/polaris/ocean/omega_ctest/ocean.QU.240km.omega_vars.251219.nc
wget -O OmegaSphereMesh.nc https://web.lcrc.anl.gov/public/e3sm/polaris/ocean/omega_ctest/cosine_bell_icos480.omega_vars.250219.nc
wget -O OmegaPlanarMesh.nc https://web.lcrc.anl.gov/public/e3sm/polaris/ocean/omega_ctest/PlanarPeriodic48x48.omega_vars.251219.nc
cd ..
```

Expand Down
4 changes: 2 additions & 2 deletions components/omega/doc/devGuide/Testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ Omega:
Filename: init.nc
Contents:
- NormalVelocity
- LayerThickness
- PseudoThickness
RestartRead: {}
History:
Filename: output.nc
Expand All @@ -333,7 +333,7 @@ Omega:
FileFreqUnits: years
Contents:
- NormalVelocity
- LayerThickness
- PseudoThickness
- SshCell
```
For more details on updating either the map or the YAML files for individual
Expand Down
6 changes: 3 additions & 3 deletions components/omega/doc/devGuide/VertCoord.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ A list of member variables along with their types and dimension sizes is below:
| ZInterface | Real | NCellsSize, NVertLayersP1|
| ZMid | Real | NCellsSize, NVertLayers |
| GeopotentialMid | Real | NCellsSize, NVertLayers |
| LayerThicknessPStar | Real | NCellsSize, NVertLayers|
| PseudoThicknessPStar | Real | NCellsSize, NVertLayers|
Copy link
Author

@xylar xylar Dec 19, 2025

Choose a reason for hiding this comment

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

Here and in the user's guide, there's a reference to LayerThicknessPStar, now PseudoThicknessPStar, but I didn't see this in the code itself.

| MinLayerCell | Integer | NCellsSize |
| MaxLayerCell | Integer | NCellsSize |
| MinLayerEdgeTop | Integer| NEdgesSize |
Expand All @@ -67,7 +67,7 @@ A list of member variables along with their types and dimension sizes is below:
| MinLayerVertexBot | Integer | NVerticesSize |
| MaxLayerVertexBot | Integer | NVerticesSize |
| VertCoordMovementWeights | Real | NCellsSize, NVertLayers |
| RefLayerThickness | Real | NCellsSize, NVertLayers |
| RefPseudoThickness | Real | NCellsSize, NVertLayers |
| BottomDepth | Real | NCellsSize |

### Removal
Expand Down Expand Up @@ -113,7 +113,7 @@ Kokkos::parallel_reduce(
Kokkos::TeamThreadRange(Member, KMin, KMax + 1),
[=](const int K, Real &LocalWh) {
LocalWh += VertCoordMovementWeights(ICell, K) *
RefLayerThickness(ICell, K);
RefPseudoThickness(ICell, K);
},
SumWh);
```
Expand Down
2 changes: 1 addition & 1 deletion components/omega/doc/userGuide/Config.md
Copy link
Author

Choose a reason for hiding this comment

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

This whole document needs some updating but I don't want to distract from the purpose of this PR to do it.

Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ omega:
OutputInterval: 0001_00:00:00
Contents:
- tracers
- layerThickness
- PseudoThickness
- ssh
- kineticEnergyCell
- relativeVorticityCell
Expand Down
2 changes: 1 addition & 1 deletion components/omega/doc/userGuide/OceanState.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Ocean State

The `OceanState` class provides a container for the non-tracer prognostic variables in Omega, namely `normalVelocity` and `layerThickness`.
The `OceanState` class provides a container for the non-tracer prognostic variables in Omega, namely `normalVelocity` and `PseudoThickness`.
Copy link
Author

Choose a reason for hiding this comment

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

Suggested change
The `OceanState` class provides a container for the non-tracer prognostic variables in Omega, namely `normalVelocity` and `PseudoThickness`.
The `OceanState` class provides a container for the non-tracer prognostic variables in Omega, namely `NormalVelocity` and `PseudoThickness`.

Upon creation of a `OceanState` instance, these variables are allocated and registered with the IO infrastructure.
The class contains a method to update the time levels for the state variables between timesteps.
This involves a halo update, time level index update, and updating the `IOFields` data references.
4 changes: 2 additions & 2 deletions components/omega/doc/userGuide/VertCoord.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Multiple instances of the vertical coordinate class can be created and accessed
| ZInterface | z height of layer interfaces | m |
| ZMid | z height of layer midpoint | m |
| GeopotentialMid | geopotential at layer mid points | m$^2$/s$^2$|
| LayerThicknessPStar | desired layer thickness based on total perturbation from the reference thickness | - |
| PseudoThicknessPStar | desired layer thickness based on total perturbation from the reference thickness | - |
Copy link
Author

Choose a reason for hiding this comment

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

Here and in the developer's guide, there's a reference to LayerThicknessPStar, now PseudoThicknessPStar, but I didn't see this in the code itself.

| MinLayerCell | first active layer for cell | - |
| MaxLayerCell | last active layer for cell | - |
| MinLayerEdgeTop | min of the first active layers for cells on edge | - |
Expand All @@ -44,7 +44,7 @@ Multiple instances of the vertical coordinate class can be created and accessed
| MinLayerVertexBot | max of the first active layer for cells on vertex | - |
| MaxLayerVertexBot | max of the last active layer for cells on vertex | - |
| VertCoordMovementWeights | weights to specify how total column thickness changes are distributed across layers | - |
| RefLayerThickness | reference layer thickness used to distribute total column thickness changes | m |
| RefPseudoThickness | reference layer thickness used to distribute total column thickness changes | m |
| BottomDepth | positive down distance from the reference geoid to the bottom | m |

### Configuration options
Expand Down
28 changes: 15 additions & 13 deletions components/omega/src/ocn/AuxiliaryState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ AuxiliaryState::AuxiliaryState(const std::string &Name, const HorzMesh *Mesh,
int NVertLayers, int NTracers)
: Mesh(Mesh), VCoord(VCoord), MeshHalo(MeshHalo), Name(stripDefault(Name)),
KineticAux(stripDefault(Name), Mesh, NVertLayers),
LayerThicknessAux(stripDefault(Name), Mesh, NVertLayers),
PseudoThicknessAux(stripDefault(Name), Mesh, NVertLayers),
VorticityAux(stripDefault(Name), Mesh, NVertLayers),
VelocityDel2Aux(stripDefault(Name), Mesh, VCoord, NVertLayers),
WindForcingAux(stripDefault(Name), Mesh),
Expand All @@ -37,7 +37,7 @@ AuxiliaryState::AuxiliaryState(const std::string &Name, const HorzMesh *Mesh,
auto AuxGroup = FieldGroup::create(GroupName);

KineticAux.registerFields(GroupName, AuxMeshName);
LayerThicknessAux.registerFields(GroupName, AuxMeshName);
PseudoThicknessAux.registerFields(GroupName, AuxMeshName);
VorticityAux.registerFields(GroupName, AuxMeshName);
VelocityDel2Aux.registerFields(GroupName, AuxMeshName);
WindForcingAux.registerFields(GroupName, AuxMeshName);
Expand All @@ -48,7 +48,7 @@ AuxiliaryState::AuxiliaryState(const std::string &Name, const HorzMesh *Mesh,
// state field group.
AuxiliaryState::~AuxiliaryState() {
KineticAux.unregisterFields();
LayerThicknessAux.unregisterFields();
PseudoThicknessAux.unregisterFields();
VorticityAux.unregisterFields();
VelocityDel2Aux.unregisterFields();
WindForcingAux.unregisterFields();
Expand All @@ -62,14 +62,14 @@ void AuxiliaryState::computeMomAux(const OceanState *State, int ThickTimeLevel,
int VelTimeLevel) const {
Array2DReal LayerThickCell;
Array2DReal NormalVelEdge;
State->getLayerThickness(LayerThickCell, ThickTimeLevel);
State->getPseudoThickness(LayerThickCell, ThickTimeLevel);
State->getNormalVelocity(NormalVelEdge, VelTimeLevel);

const int NVertLayers = LayerThickCell.extent_int(1);
const int NChunks = NVertLayers / VecLength;

OMEGA_SCOPE(LocKineticAux, KineticAux);
OMEGA_SCOPE(LocLayerThicknessAux, LayerThicknessAux);
OMEGA_SCOPE(LocPseudoThicknessAux, PseudoThicknessAux);
OMEGA_SCOPE(LocVorticityAux, VorticityAux);
OMEGA_SCOPE(LocVelocityDel2Aux, VelocityDel2Aux);
OMEGA_SCOPE(LocWindForcingAux, WindForcingAux);
Expand Down Expand Up @@ -108,8 +108,8 @@ void AuxiliaryState::computeMomAux(const OceanState *State, int ThickTimeLevel,
"edgeAuxState2", {Mesh->NEdgesAll, NChunks},
KOKKOS_LAMBDA(int IEdge, int KChunk) {
LocVorticityAux.computeVarsOnEdge(IEdge, KChunk);
LocLayerThicknessAux.computeVarsOnEdge(IEdge, KChunk, LayerThickCell,
NormalVelEdge);
LocPseudoThicknessAux.computeVarsOnEdge(IEdge, KChunk, LayerThickCell,
NormalVelEdge);
LocVelocityDel2Aux.computeVarsOnEdge(IEdge, KChunk, VelocityDivCell,
RelVortVertex);
});
Expand All @@ -135,8 +135,8 @@ void AuxiliaryState::computeMomAux(const OceanState *State, int ThickTimeLevel,
parallelFor(
"cellAuxState3", {Mesh->NCellsAll, NChunks},
KOKKOS_LAMBDA(int ICell, int KChunk) {
LocLayerThicknessAux.computeVarsOnCells(ICell, KChunk,
LayerThickCell);
LocPseudoThicknessAux.computeVarsOnCells(ICell, KChunk,
LayerThickCell);
});
Pacer::stop("AuxState:cellAuxState3", 2);

Expand All @@ -149,7 +149,7 @@ void AuxiliaryState::computeAll(const OceanState *State,
int ThickTimeLevel, int VelTimeLevel) const {
Array2DReal LayerThickCell;
Array2DReal NormalVelEdge;
State->getLayerThickness(LayerThickCell, ThickTimeLevel);
State->getPseudoThickness(LayerThickCell, ThickTimeLevel);
State->getNormalVelocity(NormalVelEdge, VelTimeLevel);

const int NVertLayers = LayerThickCell.extent_int(1);
Expand All @@ -171,7 +171,7 @@ void AuxiliaryState::computeAll(const OceanState *State,
});
Pacer::stop("AuxState:edgeAuxState4", 2);

const auto &MeanLayerThickEdge = LayerThicknessAux.MeanLayerThickEdge;
const auto &MeanLayerThickEdge = PseudoThicknessAux.MeanLayerThickEdge;

Pacer::start("AuxState:cellAuxState4", 2);
parallelFor(
Expand Down Expand Up @@ -273,9 +273,11 @@ void AuxiliaryState::readConfigOptions(Config *OmegaConfig) {
Err, "AuxiliaryState: FluxThicknessType not found in AdvectConfig");

if (FluxThickTypeStr == "Center") {
this->LayerThicknessAux.FluxThickEdgeChoice = FluxThickEdgeOption::Center;
this->PseudoThicknessAux.FluxThickEdgeChoice =
FluxThickEdgeOption::Center;
} else if (FluxThickTypeStr == "Upwind") {
this->LayerThicknessAux.FluxThickEdgeChoice = FluxThickEdgeOption::Upwind;
this->PseudoThicknessAux.FluxThickEdgeChoice =
FluxThickEdgeOption::Upwind;
} else {
ABORT_ERROR("AuxiliaryState: Unknown FluxThicknessType requested");
}
Expand Down
4 changes: 2 additions & 2 deletions components/omega/src/ocn/AuxiliaryState.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "Tracers.h"
#include "VertCoord.h"
#include "auxiliaryVars/KineticAuxVars.h"
#include "auxiliaryVars/LayerThicknessAuxVars.h"
#include "auxiliaryVars/PseudoThicknessAuxVars.h"
#include "auxiliaryVars/TracerAuxVars.h"
#include "auxiliaryVars/VelocityDel2AuxVars.h"
#include "auxiliaryVars/VorticityAuxVars.h"
Expand All @@ -35,7 +35,7 @@ class AuxiliaryState {

// Auxiliary variables
KineticAuxVars KineticAux;
LayerThicknessAuxVars LayerThicknessAux;
PseudoThicknessAuxVars PseudoThicknessAux;
TracerAuxVars TracerAux;
VorticityAuxVars VorticityAux;
VelocityDel2AuxVars VelocityDel2Aux;
Expand Down
Loading
Loading