Skip to content

Commit 24b2b8f

Browse files
authored
Merge pull request #275 from brian-oneill/omega/add-vert-coord
Add vertical coordinate module
2 parents 8abb41a + 8eb753f commit 24b2b8f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+2832
-817
lines changed

components/omega/configs/Default.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ Omega:
66
StartTime: 0001-01-01_00:00:00
77
StopTime: 0001-01-01_02:00:00
88
RunDuration: none
9-
Dimension:
10-
NVertLevels: 60
119
Decomp:
1210
HaloWidth: 3
1311
DecompMethod: MetisKWay
@@ -24,6 +22,8 @@ Omega:
2422
FluxTracerType: Center
2523
WindStress:
2624
InterpType: Isotropic
25+
VertCoord:
26+
MovementWeightType: Uniform
2727
Tendencies:
2828
ThicknessFluxTendencyEnable: true
2929
PVTendencyEnable: true
@@ -55,6 +55,16 @@ Omega:
5555
DRhoDS: 0.8
5656
RhoT0S0: 1000.0
5757
IOStreams:
58+
InitialVertCoord:
59+
UsePointerFile: false
60+
Filename: OmegaMesh.nc
61+
Mode: read
62+
Precision: double
63+
Freq: 1
64+
FreqUnits: OnStartup
65+
UseStartEnd: false
66+
Contents:
67+
- InitVertCoord
5868
# InitialState should only be used when starting from scratch.
5969
# For restart runs, the frequency units should be changed from
6070
# "OnStartup" to "never" so that the initial state file is not read.

components/omega/doc/design/AuxiliaryState.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ The constructor will be responsible for:
7070
* registering fields and metadata with the I/O infrastructure
7171
7272
```c++
73-
AuxiliaryState(const std::string &Name, const HorzMesh *Mesh, int NVertLevels);
73+
AuxiliaryState(const std::string &Name, const HorzMesh *Mesh, int NVertLayers);
7474
```
7575

7676
The create method will take the same arguments as the constructor, use it to
7777
create a new auxiliary state, and put it in the static map of all auxiliary
7878
states. It will return a pointer to the newly created state.
7979
```c++
80-
AuxiliaryState* AuxiliaryState::create(const std::string &Name, const HorzMesh *Mesh, int NVertLevels);
80+
AuxiliaryState* AuxiliaryState::create(const std::string &Name, const HorzMesh *Mesh, int NVertLayers);
8181
```
8282
8383
#### 4.2.2 Initialization

components/omega/doc/design/AuxiliaryVariables.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ can often be bundled together into groups of variables that are logically
1010
related, or can be efficiently computed together. Each auxiliary variable group
1111
is implemented as a class containing array(s) storing the variable(s) and member
1212
functions that compute them. The member functions compute the variable (or
13-
variable group) over a chunk of vertical levels for a particular mesh location.
13+
variable group) over a chunk of vertical layers for a particular mesh location.
1414
There may be more than one compute function, since some groups may contain
1515
variables defined on different mesh elements. This approach allows flexible
1616
groupings of computational work within larger cell/edge/vertex loops. This type
@@ -31,7 +31,7 @@ implement a given variable (group) computation on a specific mesh location
3131

3232
### 2.3 Requirement: Vectorization on CPU architectures
3333
Auxiliary variables computations have inner loops over a chunk of vertical
34-
levels. The chunk size will be set to the vector length on CPU machines and 1
34+
layers. The chunk size will be set to the vector length on CPU machines and 1
3535
for GPUs. This will allow for the possibility of vectorization on CPUs.
3636

3737
### 2.4 Requirement: Configuration options
@@ -101,11 +101,11 @@ The constructor will be responsible for:
101101
* registering fields and metadata with the I/O infrastructure.
102102
103103
```c++
104-
LayerThicknessAuxVars(const HorzMesh *mesh, int NVertLevels, const Config *Options)
104+
LayerThicknessAuxVars(const HorzMesh *mesh, int NVertLayers, const Config *Options)
105105
: FluxLayerThickEdge("FluxLayerThickEdge", mesh->NEdgesSize,
106-
NVertLevels),
106+
NVertLayers),
107107
MeanLayerThickEdge("MeanLayerThickEdge", mesh->NEdgesSize,
108-
NVertLevels),
108+
NVertLayers),
109109
CellsOnEdge(mesh->CellsOnEdge) {
110110
111111
std::string FluxThickTypeStr;
@@ -128,11 +128,11 @@ The constructor will be responsible for:
128128

129129
#### 4.2.2 Compute methods
130130
Compute methods implement the auxiliary variables computations for a chunk of
131-
vertical levels at a given horizontal mesh location. The mesh location is
131+
vertical layers at a given horizontal mesh location. The mesh location is
132132
indicated in the method name. There may be more than one compute method to
133133
compute different groups of variables over different mesh locations. Any
134134
configurable computation options are handled inside the compute method. The
135-
inner loop over a chunk of vertical levels enables CPU vectorization.
135+
inner loop over a chunk of vertical layers enables CPU vectorization.
136136

137137
```c++
138138
KOKKOS_FUNCTION void

components/omega/doc/design/EOS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class Eos{
6363
private:
6464
EOSType eosChoice;
6565
I4 NCellsAll;
66-
I4 NChunks = NVertLevels / VecLength;
66+
I4 NChunks = NVertLayers / VecLength;
6767
void computeSpecVolTEOS10Poly75t();
6868
void computeSpecVolLinear();
6969
void truncateTempSal();
@@ -106,14 +106,14 @@ The constructor will be responsible for:
106106
* allocating arrays
107107

108108
```c++
109-
Eos::Eos(const HorzMesh *Mesh, int NVertLevels, Config *Options);
109+
Eos::Eos(const HorzMesh *Mesh, int NVertLayers, Config *Options);
110110
```
111111
112112
The create method will take the same arguments as the constructor plus a name. It calls the constructor to
113113
create a new eos instance, and put it in the static map of all eos.
114114
It will return a pointer to the newly created object.
115115
```c++
116-
Eos *Eos::create(const std::string &Name, const HorzMesh *Mesh, int NVertLevels, Config *Options);
116+
Eos *Eos::create(const std::string &Name, const HorzMesh *Mesh, int NVertLayers, Config *Options);
117117
```
118118

119119
#### 4.2.2 Initialization

components/omega/doc/design/OmegaV1GoverningEqns.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
(omega-design-governing-eqns-omega1)=
12
# Omega V1: Governing Equations
23

34
<!--

components/omega/doc/design/Reductions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,11 @@ relevant MachEnv (eg defaultEnv.comm) and indxRange is a
128128
`std::vector` of length 2x the number of array dimensions.
129129
The entries of this vector will be the min, max index of
130130
each array dimension. So, for example an array dimensioned
131-
`(nCellsAll+1, nVertLevels+1)` might need to be summed over
132-
the `indxRange{0, nCellsOwned-1, 0, nVertLevels-1}`. Note
131+
`(nCellsAll+1, nVertLayers+1)` might need to be summed over
132+
the `indxRange{0, nCellsOwned-1, 0, nVertLayers-1}`. Note
133133
that the indxRange supports a constant scalar values only so
134134
does not support a variable index range like
135-
minLevelCell/maxLevelCell. That is best managed either
135+
minLayerCell/maxLayerCell. That is best managed either
136136
by masking with the sum-product interface below or
137137
ensuring the array has been set to zero in non-active
138138
entries.

components/omega/doc/design/Tendencies.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ The constructor will be responsible for:
6666
* allocating tendency arrays
6767

6868
```c++
69-
Tendencies(const std::string &Name, const HorzMesh *Mesh, int NVertLevels, Config *Options);
69+
Tendencies(const std::string &Name, const HorzMesh *Mesh, int NVertLayers, Config *Options);
7070
```
7171
7272
The create method will take the same arguments as the constructor, use it to
7373
create a new tendencies instance, and put it in the static map of all tendencies.
7474
It will return a pointer to the newly created object.
7575
```c++
76-
Tendencies* Tendencies::create(const std::string &Name, const HorzMesh *Mesh, int NVertLevels, Config *Options);
76+
Tendencies* Tendencies::create(const std::string &Name, const HorzMesh *Mesh, int NVertLayers, Config *Options);
7777
```
7878

7979
#### 4.2.2 Initialization

components/omega/doc/design/Tendency.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
## 1 Overview
55

6-
The tendency terms in OMEGA are implemented as functors, which define an operation over a number of vertical levels for particular a cell, edge, or vertex.
6+
The tendency terms in OMEGA are implemented as functors, which define an operation over a number of vertical layers for particular a cell, edge, or vertex.
77
Tendency functors take information which remains constant during the forward simulation (such as `HorzMesh` and `Config`) as constructor arguments.
88
The `operator()` method is overloaded with the relevant discrete /parameterization.
99
This approach allows for a modularization of the tendency terms that enables flexible groupings of work within larger cell/edge/vertex loops.
@@ -19,7 +19,7 @@ Each functor will implement a given tendency operation on a specific mesh locati
1919
Tendency functors take in constant data as constructor arguments, which simplifies the arguments used to call the operator method.
2020

2121
### 2.3 Requirement: Tendencies must allow for vectorization on CPU architectures.
22-
Tendency operations have inner loops over a chunk of vertical levels.
22+
Tendency operations have inner loops over a chunk of vertical layers.
2323
The chunk size will be set to the vector length on CPU machines and 1 for GPUs.
2424
This will allow for the possibility of vectorization on CPUs.
2525

@@ -76,8 +76,8 @@ ThicknessFluxDivergenceOnCell::ThicknessFluxDivergenceOnCell(HorzMesh const *Mes
7676
```
7777

7878
#### 4.2.2 operator
79-
The operator method implements the tendency computation for a chunk of vertical levels at a given horizontal mesh location.
80-
The inner loop over a chunk of vertical levels enables CPU vectorization.
79+
The operator method implements the tendency computation for a chunk of vertical layers at a given horizontal mesh location.
80+
The inner loop over a chunk of vertical layers enables CPU vectorization.
8181

8282
```c++
8383
KOKKOS_FUNCTION void ThicknessFluxDivergenceOnCell::operator()(Array2DReal &Tend

components/omega/doc/design/VertCoord.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ In future versions of Omega, the $p^\star$ coordinate will be extended to a more
5656
The vertical coordinate module should retain flexibility to support VLR in future versions of Omega.
5757

5858
## 3 Algorithmic Formulation
59-
In the layered non-Boussinesq equations solved in Omega (see [V0 governing equation document](OmegaV1GoverningEqns) for details), the prognostic variable for cell $i$ and layer $k$ is the pseudo thickness, $\tilde{h}_{i,k}$, so that the geometric thickness (in meters) is a diagnostic variable defined as:
59+
In the layered non-Boussinesq equations solved in Omega (see [V0 governing equation document](omega-design-governing-eqns-omega1) for details), the prognostic variable for cell $i$ and layer $k$ is the pseudo thickness, $\tilde{h}_{i,k}$, so that the geometric thickness (in meters) is a diagnostic variable defined as:
6060

6161
$$ \Delta z_{i,k} = \rho_0 \alpha_{i,k} \tilde{h}_{i,k}. $$
6262

components/omega/doc/design/VerticalMixingCoeff.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ It is assumed that viscosity and diffusivity will be stored at cell centers. Add
137137

138138
```c++
139139
parallelFor(
140-
{NCellsAll, NVertLevels}, KOKKOS_LAMBDA(int ICell, int K) {
140+
{NCellsAll, NVertLayers}, KOKKOS_LAMBDA(int ICell, int K) {
141141

142142
// Add background contribution to viscosity and diffusivity
143143
VertViscosity(ICell, K) = BackgroundViscosity;

0 commit comments

Comments
 (0)