Skip to content

Commit 506b9ec

Browse files
committed
Revise based on review comments
1 parent bb73dff commit 506b9ec

File tree

2 files changed

+75
-47
lines changed

2 files changed

+75
-47
lines changed

components/omega/doc/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
SPHINXOPTS ?=
77
SPHINXBUILD ?= sphinx-build
88
SOURCEDIR = .
9-
BUILDDIR = _build
9+
BUILDDIR = /global/cfs/cdirs/e3sm/www/sbrus/pgrad
1010

1111
# Put it first so that "make" without argument is like "make help".
1212
help:

components/omega/doc/design/PGrad.md

Lines changed: 74 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33

44

55
## 1 Overview
6-
The pressure gradient will be responsible for computing the horizontal gradients of both the pressure and geopotential terms for the non-Boussinesq primative equations implemented in Omega.
7-
In the non-Boussinesq model, the vertical coordinate will be pressure as opposed to height.
6+
The pressure gradient will be responsible for computing the horizontal gradients of both the pressure and geopotential terms for the non-Boussinesq primitive equations implemented in Omega.
7+
In the non-Boussinesq model, the conserved quantity is mass rather than volume.
8+
In Omega the prognostic variable $\tilde{h}$ is a pseudo thickness, rather than geometric thickness in m as in a Boussinesq model.
9+
Some non-Boussinesq models are written in pressure coordinates (e.g. [de Szoeke and Samelson 2002](https://journals.ametsoc.org/view/journals/phoc/32/7/1520-0485_2002_032_2194_tdbtba_2.0.co_2.xml).
10+
However, Omega is written in general vertical coordinates and can reference either pressure $p$ or distance $z$ in the vertical.
811
In a pure pressure coordinate the pressure gradient term disappears (since the pressure does not vary along lines of constant pressure), just as how the geopotential term disappears in a pure z coordinate model.
912
However, similar to MPAS-Ocean's support for tilted height coordinates, Omega will allow for tilted pressure coordinates.
1013
This means that Omega will need to compute both the pressure and geopotential gradients.
@@ -18,66 +21,99 @@ This will allow for the use of a $p^\star$ coordinate, which functions similarly
1821

1922
### 2.2 Requirement: Initial support for a simple centered pressure gradient
2023

21-
For initial global cases without ice shelf cavities, the pressure and geopotential gradients will be computed with a simple centered difference approximation. In later versions of Omega, one ore more high-order pressure gradients will be implemented and will replace the centered approach in production runs.
24+
For initial global cases without ice shelf cavities, the pressure and geopotential gradients will be computed with a simple centered difference approximation. In later versions of Omega, one or more high-order pressure gradients will be implemented and will replace the centered approach in production runs.
2225
However, the centered pressure gradient will remain an option for use in idealized testing.
2326

2427
### 2.3 Requirement: Flexibility to support a high-order pressure gradient
2528
The centered pressure gradient will be insufficient for future versions of Omega that include ice shelf cavities and high resolution shelf breaks.
2629
The pressure gradient framework should be flexible enough to support a high-order pressure gradient in the future.
30+
The high order pressure gradient will be similar to [Adcroft et al. 2008](https://doi.org/10.1016/j.ocemod.2008.02.001).
2731

2832
### 2.4 Requirement: Flexibility to support tidal forcing and sea level change
2933
In later versions of Omega, the pressure gradient will need to be able to include tidal forcing in the geopotential term.
3034
These tidal forcings include both the tidal potential and the self attraction and loading terms.
31-
Additionally, other changes to the geoid
35+
Additionally, other long-term changes to the geoid can be included in the geopotential.
3236

33-
### 2.5 Requirement: Pressure gradient for barotropic mode
37+
### 2.5 Disired: Pressure gradient for barotropic mode
3438

3539
For split barotropic-baroclinic timestepping, the pressure gradient should provide the bottom pressure gradient tendency in the barotropic mode.
40+
This will be added in a future version when split time stepping is implemented.
3641

3742
### Desired:
3843

3944
## 3 Algorithmic Formulation
40-
The non-Boussinesq momentum equation is
41-
$$ \frac{D \mathbf{u}_h}{D t } + f\boldsymbol{k}\times \mathbf{u}_h + \left(v\nabla_A p + \nabla_A \phi \right) = \boldsymbol{\mathcal{F}}. $$
45+
### 3.1 Centered Pressure Gradient
46+
In the layered non-Boussinesq [momentum equation](OmegaV1GoverningEqns.md#discrete-momentum) solved in Omega, the pressure gradient tendency term for edge $e$ and level $k$, $T^p_{e,k}$, includes the gradient of the pressure and the gradient of the geopotential,
4247

43-
where $\mathbf{u}_h$ is the horizontal velocity, $f$ is the Coriolis parameter, $v = \frac{1}{\rho}$ is the specific volume, $\rho = \rho(T,S,p)$ is the density, $p$ is the hydrostatic pressure, $\phi$ is the geopotential, and $\boldsymbol{\mathcal{F}}$ are the dissipative terms.
44-
The operator $\nabla_A$ is the gradient along a constant surface, $A$, and the total derivative is
48+
$$
49+
T^p_{e,k} = -\left[ \alpha_{i,k} \right]_e \nabla p_{i,k} - \nabla \Phi_{i,k},
50+
$$
4551

46-
$$ \frac{D \mathbf{u}_h}{D t } = \left( \frac{\partial}{\partial t} \right)_A + \mathbf{u}_h\cdot \nabla_A + \omega\frac{\partial}{\partial A}, $$
52+
where the second term is necessary to account for tilted layers that occur when using a general vertical coordinate.
53+
In this equation, $\alpha_{i,k}$ is the specific volume for cell $i$ at the mid-point of level $k$, $p_{i,k}$ is the pressure, and $\Phi_{i,k}$ is the geopotential.
54+
The discrete gradient operator at an edge is:
4755

48-
where $\omega$ is the cross coordinate flow.
49-
In the layered non-Boussinesq equations, the prognostic variable is the pressure thickness $h_k$, so that the geometric thickness (in meters) is a diagnostic variable defined as:
56+
$$
57+
\nabla {(\cdot)} = \frac{1}{d_e} \sum_{i\in CE(e)} -n_{e,i} (\cdot)_i
58+
$$
5059

51-
$$ \Delta z_k = v_k h_k. $$
60+
where $d_e$ is the distance between cell centers, $CE(e)$ are the cells on edge $e$, and $n_{e,i}$ is the sign of the edge normal with respect to cell $i$.
61+
The horizontal averaging operator is:
5262

53-
The pressure at vertical cell interfaces is the found by summing the pressure thicknesses:
63+
$$
64+
[\cdot]_e = \frac{1}{2}\sum_{i\in CE(e)} (\cdot)_i
65+
$$
5466

55-
$$ p_{K+1/2} = p_{surf} + g\sum_{k=1}^K h_k. $$
67+
Therefore, the centered pressure gradient will be calculated as:
5668

57-
The geopotential at vertical cell integrates is found by summing the pressure thicknesses multiplied by the specific volume:
69+
$$
70+
T^p_{e,k} = \frac{1}{d_e} \left( [\alpha_{i,k}]_e \sum_{i \in CE(e)} n_{e,i} p_{k,i} + \sum_{i\in CE(e)} n_{e,i} \Phi_{k,i}\right),
71+
$$
5872

59-
$$ \phi_{K+1/2} = g\left(z_b + \sum_{k=K}^{N} v_k h_k\right), $$
73+
$$
74+
= \frac{1}{d_e} \left( \sum_{i \in CE(e)} n_{e,i} \left( [\alpha_{i,k}]_ep_{k,i} + \Phi_{k,i} \right) \right),
75+
$$
6076

61-
where $z_b$ is the (positive-up) bottom depth.
77+
### 3.2 Barotropic Pressure Gradient
6278

63-
The discrete gradient operator at an edge is:
79+
When split baroclinic-barotropic time stepping is implemented in the future, the barotropic pressure gradient will be calculated by the pressure gradient class.
80+
The barotropic pressure gradient is found by depth integrating the pressure gradient.
81+
The pressure is
6482

65-
$$ \nabla {(\cdot)} = \frac{1}{d_e} \sum_{i\in CE(e)} -n_{e,i} (\cdot)_i $$
83+
$$
84+
p(z) = p_b - g \int^z_{-h} \rho dz^\prime,
85+
$$
6686

67-
where $d_e$ is the distance between cell centers, $CE(e)$ are the cells on edge $e$, and $n_{e,i}$ is the sign of the edge normal with respect to cell $i$.
68-
Therefore the centered pressure gradient will be calculated as:
87+
where $p_b$ is the bottom pressure.
88+
The bottom pressure is the sum of the atmospheric surface pressure, $p_s$, and the pressure contribution of the water column:
89+
90+
$$
91+
p(z) &= p_s + g\int_{-h}^\eta \rho dz - g \int^z_{-h} \rho dz^\prime, \\
92+
&= p_s + g\rho_0\widetilde{H} - g \int^z_{-h} \rho dz^\prime,
93+
$$
6994

70-
$$ T^p_k = \frac{1}{d_e} \left( \widehat{v}_{k,e} \sum_{i \in CE(e)} n_{e,i} \overline{p}_{k,i} + \sum_{i\in CE(e)} n_{e,i} \overline{\phi}_{k,i}\right), $$
95+
where the total water column pseudo height is expressed by
7196

72-
$$ = \frac{1}{d_e} \left( \sum_{i \in CE(e)} n_{e,i} \left( \widehat{v}_{k,e}\overline{p}_{k,i} + \overline{\phi}_{k,i} \right) \right), $$
97+
$$
98+
\widetilde{H} = \int_{-h}^\eta \frac{\rho}{\rho_0} dz.
99+
$$
73100

74-
with the vertical averaging operator defined as:
101+
$\widetilde{H}$ is the prognositc variable in the barotropic continuity equation.
102+
The vertical integral of the pressure gradient is
75103

76-
$$ \overline{(\cdot)} = \frac{1}{2} \left((\cdot)_{k+1/2} + (\cdot)_{k-1/2} \right)$$
104+
$$
105+
\frac{1}{\rho_0\widetilde{H}}\int^\eta_{-h} \nabla p dz &= \frac{1}{\rho_0\widetilde{H}}\int^\eta_{-h} \nabla \left( p_s + g\rho_0 \widetilde{H} - g \int^z_{-h} \rho dz^\prime \right) dz, \\
106+
&= \frac{H}{\rho_0\widetilde{H}}\nabla p_s + \frac{gH}{\widetilde{H}}\nabla \widetilde{H} - \frac{g}{\rho_0\widetilde{H}} \int_{-h}^\eta \left( \nabla \int_{-h}^z \rho dz^\prime\right) dz,
107+
$$
77108

78-
and the horizontal averaging operator:
109+
where the height of the water column is represented by $H$.
110+
The $1/\rho_0\widetilde{H}$ factor comes vertically integrating the material derivative and expressing the resulting barotropic momentum equation in non-conservative form.
79111

80-
$$\widehat{(\cdot)} = \frac{1}{2} \left( (\cdot)_{i=1} + (\cdot)_{i=2}\right)$$
112+
Therefore, the barotorpic pressure gradient term is discretized as:
113+
114+
$$
115+
\overline{T}_e^p = g\left[ \frac{H_i}{\widetilde{H}_i} \right]_e\sum_{i \in CE(e)} n_{e,i}\widetilde{H}_e
116+
$$
81117

82118
## 4 Design
83119

@@ -88,8 +124,9 @@ The `PressureGradient` class will be used to perform the horizontal gradients of
88124
class PressureGrad{
89125
public:
90126
private:
127+
std::unique_ptr<PressureGrad> OmegaPressureGrad;
91128
PressureGradCentered CenteredPGrad;
92-
PressureGradHighOrder HighOrderPGrad;
129+
PressureGradHighOrder HighOrderPGrad; // To be implemented later
93130
PressureGradType PressureGradChoice;
94131
I4 NVertLevels;
95132
I4 NChuncks;
@@ -116,9 +153,9 @@ The functions to compute the centered and high order pressure gradient terms wil
116153
```c++
117154
class PressureGrad{
118155
public:
119-
static PressureGrad *create();
156+
static PressureGrad *init();
157+
static PressureGrad *get();
120158
void computePressureGrad();
121-
void computePressureGradBtr();
122159
private:
123160
124161
}
@@ -130,31 +167,25 @@ The constructor will be responsible for storing any static mesh information as p
130167
PressureGrad::PressureGrad(const HorzMesh *Mesh, int NVertLevels, Config *Options);
131168
```
132169
133-
The create method will take the same arguments as the constructor plus a name.
134-
It calls the constructor to create a new pressure gradient instance, and put it in the static map of all pressure gradients.
135-
It will return a pointer to the newly created object.
136-
```c++
137-
PressureGrad *PressureGrad::create(const std::string &Name, const HorzMesh *Mesh, int NVertLevels, Config *Options);
138-
```
139-
140170
#### 4.2.2 Initialization
141171
142-
The init method will create the default pressure gradient and return an error code:
172+
The init method will create the pressure gradient and return an error code:
143173
```c++
144174
int PressureGrad::init();
145175
```
176+
It calls the constructor to create a new pressure gradient instance, producing a static managed (unique) pointer to the single instance.
146177

147178
#### 4.2.3 Retrieval
148179

149-
There will be methods for getting the default and non-default pressure gradient instances:
180+
There will be a method for getting a pointer to the pressure gradient instance:
150181
```c++
151-
PressureGrad *PressureGrad::getDefault();
152-
PressureGrad *PressureGrad::get(const std::string &Name);
182+
PressureGrad *PressureGrad::get();
153183
```
154184

155185
#### 4.2.4 Computation
156186

157187
The public `computePressureGrad` method will rely on private methods for each specific pressure gradient option (centered and high order).
188+
Note that the functors called by `computePressureGrad` are responsible for computing the sum of the pressure gradient and geopotential gradient accumulated in the `Tend` output array.
158189
```c++
159190
void PressureGrad::computePressureGrad(const Array2DReal &Tend,
160191
const Array2DReal &Pressure,
@@ -179,11 +210,8 @@ OMEGA_SCOPE(LocHighOrderPGrad, HighOrderPGrad)
179210
#### 4.2.5 Destruction and removal
180211
181212
No operations are needed in the destructor.
182-
The erase method will remove a named pressure gradient instance, whereas the clear method will remove all of
183-
them.
184-
Both will call the destructor in the process.
213+
The clear method will remove the pressure gradient instance, calling the destructor in the process.
185214
```c++
186-
void PressureGrad::erase(const std::string &Name);
187215
void PressureGrad::clear();
188216
```
189217

0 commit comments

Comments
 (0)