2 |
% $Name$ |
% $Name$ |
3 |
|
|
4 |
The convention used in this section is as follows: |
The convention used in this section is as follows: |
5 |
Time is "discretize" using a time step $\Delta t$ |
Time is ``discretized'' using a time step $\Delta t$ |
6 |
and $\Phi^n$ refers to the variable $\Phi$ |
and $\Phi^n$ refers to the variable $\Phi$ |
7 |
at time $t = n \Delta t$ . We used the notation $\Phi^{(n)}$ |
at time $t = n \Delta t$ . We use the notation $\Phi^{(n)}$ |
8 |
when time interpolation is required to estimate the value of $\phi$ |
when time interpolation is required to estimate the value of $\phi$ |
9 |
at the time $n \Delta t$. |
at the time $n \Delta t$. |
10 |
|
|
11 |
\section{Time Integration} |
\section{Time integration} |
12 |
|
|
13 |
The discretization in time of the model equations (cf section I ) |
The discretization in time of the model equations (cf section I ) |
14 |
does not depend of the discretization in space of each |
does not depend of the discretization in space of each |
15 |
term, so that this section can be read independently. |
term and so this section can be read independently. |
|
Also for this purpose, we will refers to the continuous |
|
|
space-derivative form of model equations, and focus on |
|
|
the time discretization. |
|
16 |
|
|
17 |
The continuous form of the model equations is: |
The continuous form of the model equations is: |
18 |
|
|
19 |
\begin{eqnarray} |
\begin{eqnarray} |
20 |
\partial_t \theta & = & G_\theta |
\partial_t \theta & = & G_\theta |
21 |
|
\label{eq-tCsC-theta} |
22 |
\\ |
\\ |
23 |
\partial_t S & = & G_s |
\partial_t S & = & G_s |
24 |
|
\label{eq-tCsC-salt} |
25 |
\\ |
\\ |
26 |
b' & = & b'(\theta,S,r) |
b' & = & b'(\theta,S,r) |
27 |
\\ |
\\ |
28 |
\partial_r \phi'_{hyd} & = & -b' |
\partial_r \phi'_{hyd} & = & -b' |
29 |
\label{eq-r-split-hyd} |
\label{eq-tCsC-hyd} |
30 |
\\ |
\\ |
31 |
\partial_t \vec{\bf v} |
\partial_t \vec{\bf v} |
32 |
+ {\bf \nabla}_r B_o \eta |
+ {\bf \nabla}_h b_s \eta |
33 |
+ \epsilon_{nh} {\bf \nabla}_r \phi'_{nh} |
+ \epsilon_{nh} {\bf \nabla}_h \phi'_{nh} |
34 |
& = & \vec{\bf G}_{\vec{\bf v}} |
& = & \vec{\bf G}_{\vec{\bf v}} |
35 |
- {\bf \nabla}_r \phi'_{hyd} |
- {\bf \nabla}_h \phi'_{hyd} |
36 |
\label{eq-r-split-hmom} |
\label{eq-tCsC-Hmom} |
37 |
\\ |
\\ |
38 |
\epsilon_{nh} \frac {\partial{\dot{r}}}{\partial{t}} |
\epsilon_{nh} \frac {\partial{\dot{r}}}{\partial{t}} |
39 |
+ \epsilon_{nh} \partial_r \phi'_{nh} |
+ \epsilon_{nh} \partial_r \phi'_{nh} |
40 |
& = & \epsilon_{nh} G_{\dot{r}} |
& = & \epsilon_{nh} G_{\dot{r}} |
41 |
\label{eq-r-split-rdot} |
\label{eq-tCsC-Vmom} |
42 |
\\ |
\\ |
43 |
{\bf \nabla}_r \cdot \vec{\bf v} + \partial_r \dot{r} |
{\bf \nabla}_h \cdot \vec{\bf v} + \partial_r \dot{r} |
44 |
& = & 0 |
& = & 0 |
45 |
\label{eq-r-cont} |
\label{eq-tCsC-cont} |
46 |
\end{eqnarray} |
\end{eqnarray} |
47 |
where |
where |
48 |
\begin{eqnarray*} |
\begin{eqnarray*} |
49 |
G_\theta & = & |
G_\theta & = & |
50 |
- \vec{\bf v} \cdot {\bf \nabla}_r \theta + {\cal Q}_\theta |
- \vec{\bf v} \cdot {\bf \nabla} \theta + {\cal Q}_\theta |
51 |
\\ |
\\ |
52 |
G_S & = & |
G_S & = & |
53 |
- \vec{\bf v} \cdot {\bf \nabla}_r S + {\cal Q}_S |
- \vec{\bf v} \cdot {\bf \nabla} S + {\cal Q}_S |
54 |
\\ |
\\ |
55 |
\vec{\bf G}_{\vec{\bf v}} |
\vec{\bf G}_{\vec{\bf v}} |
56 |
& = & |
& = & |
57 |
- \vec{\bf v} \cdot {\bf \nabla}_r \vec{\bf v} |
- \vec{\bf v} \cdot {\bf \nabla} \vec{\bf v} |
58 |
- f \hat{\bf k} \wedge \vec{\bf v} |
- f \hat{\bf k} \wedge \vec{\bf v} |
59 |
+ \vec{\cal F}_{\vec{\bf v}} |
+ \vec{\cal F}_{\vec{\bf v}} |
60 |
\\ |
\\ |
61 |
G_{\dot{r}} |
G_{\dot{r}} |
62 |
& = & |
& = & |
63 |
- \vec{\bf v} \cdot {\bf \nabla}_r \dot{r} |
- \vec{\bf v} \cdot {\bf \nabla} \dot{r} |
64 |
+ {\cal F}_{\dot{r}} |
+ {\cal F}_{\dot{r}} |
65 |
\end{eqnarray*} |
\end{eqnarray*} |
66 |
The exact form of all the "{\it G}"s terms is described in the next |
The exact form of all the ``{\it G}''s terms is described in the next |
67 |
section (). Here its sufficient to mention that they contains |
section \ref{sect:discrete}. Here its sufficient to mention that they contains |
68 |
all the RHS terms except the pressure / geo- potential terms. |
all the RHS terms except the pressure/geo-potential terms. |
69 |
|
|
70 |
The switch $\epsilon_{nh}$ allows to activate the non hydrostatic |
The switch $\epsilon_{nh}$ allows one to activate the non-hydrostatic |
71 |
mode ($\epsilon_{nh}=1$) for the ocean model. Otherwise, |
mode ($\epsilon_{nh}=1$) for the ocean model. Otherwise, in the |
72 |
in the hydrostatic limit $\epsilon_{nh} = 0$ and the 3rd equation vanishes. |
hydrostatic limit $\epsilon_{nh} = 0$ and equation \ref{eq-tCsC-Vmom} |
73 |
|
is not used. |
74 |
The equation for $\eta$ is obtained by integrating the |
|
75 |
continuity equation over the entire depth of the fluid, |
As discussed in section \ref{sect:1.3.6.2}, the equation for $\eta$ is |
76 |
from $R_{min}(x,y)$ up to $R_o(x,y)$ |
obtained by integrating the continuity equation over the entire depth |
77 |
(Linear free surface): |
of the fluid, from $R_{fixed}(x,y)$ up to $R_o(x,y)$. The linear free |
78 |
|
surface evolves according to: |
79 |
\begin{eqnarray} |
\begin{eqnarray} |
80 |
\epsilon_{fs} \partial_t \eta = |
\epsilon_{fs} \partial_t \eta = |
81 |
\left. \dot{r} \right|_{r=r_{surf}} + \epsilon_{fw} (P-E) = |
\left. \dot{r} \right|_{r=r_{surf}} + \epsilon_{fw} (P-E) = |
82 |
- {\bf \nabla}_r \cdot \int_{R_{min}}^{R_o} \vec{\bf v} dr |
- {\bf \nabla} \cdot \int_{R_{fixed}}^{R_o} \vec{\bf v} dr |
83 |
+ \epsilon_{fw} (P-E) |
+ \epsilon_{fw} (P-E) |
84 |
\label{eq-cont-2D} |
\label{eq-tCsC-eta} |
85 |
\end{eqnarray} |
\end{eqnarray} |
86 |
|
|
87 |
Where $\epsilon_{fs}$,$\epsilon_{fw}$ are two flags to |
Here, $\epsilon_{fs}$ is a flag to switch between the free-surface, |
88 |
distinguish between a free-surface equation ($\epsilon_{fs}=1$) |
$\epsilon_{fs}=1$, and a rigid-lid, $\epsilon_{fs}=0$. The flag |
89 |
or the rigid-lid approximation ($\epsilon_{fs}=0$); |
$\epsilon_{fw}$ determines whether an exchange of fresh water is |
90 |
and to distinguish when exchange of Fresh-Water is included |
included at the ocean surface (natural BC) ($\epsilon_{fw} = 1$) or |
91 |
at the ocean surface (natural BC) ($\epsilon_{fw} = 1$) |
not ($\epsilon_{fw} = 0$). |
|
or not ($\epsilon_{fw} = 0$). |
|
92 |
|
|
93 |
The hydrostatic potential is found by |
The hydrostatic potential is found by integrating (equation |
94 |
integrating \ref{eq-r-split-hyd} with the boundary condition that |
\ref{eq-tCsC-hyd}) with the boundary condition that |
95 |
$\phi'_{hyd}(r=R_o) = 0$: |
$\phi'_{hyd}(r=R_o) = 0$: |
96 |
\begin{eqnarray*} |
\begin{eqnarray*} |
97 |
& & |
& & |
103 |
\phi'_{hyd}(x,y,r') = \int_{r'}^{R_o} b' dr |
\phi'_{hyd}(x,y,r') = \int_{r'}^{R_o} b' dr |
104 |
\end{eqnarray*} |
\end{eqnarray*} |
105 |
|
|
106 |
\subsection{standard synchronous time stepping} |
\subsection{General method} |
107 |
|
|
108 |
|
An overview of the general method is now presented with explicit |
109 |
|
references to the Fortran code. We often refer to the discretized |
110 |
|
equations of the model that are detailed in the following sections. |
111 |
|
|
112 |
|
The general algorithm consist of a ``predictor step'' that computes |
113 |
|
the forward tendencies ("G" terms") comprising of explicit-in-time |
114 |
|
terms and the ``first guess'' values (star notation): $\theta^*, S^*, |
115 |
|
\vec{\bf v}^*$ (and $\dot{r}^*$ in non-hydrostatic mode). This is done |
116 |
|
in the two routines {\it THERMODYNAMICS} and {\it DYNAMICS}. |
117 |
|
|
118 |
|
Terms that are integrated implicitly in time are handled at the end of |
119 |
|
the {\it THERMODYNAMICS} and {\it DYNAMICS} routines. Then the |
120 |
|
surface pressure and non hydrostatic pressure are solved for in ({\it |
121 |
|
SOLVE\_FOR\_PRESSURE}). |
122 |
|
|
123 |
|
Finally, in the ``corrector step'', (routine {\it |
124 |
|
THE\_CORRECTION\_STEP}) the new values of $u,v,w,\theta,S$ are |
125 |
|
determined (see details in \ref{sect:II.1.3}). |
126 |
|
|
127 |
|
At this point, the regular time stepping process is complete. However, |
128 |
|
after the correction step there are optional adjustments such as |
129 |
|
convective adjustment or filters (zonal FFT filter, shapiro filter) |
130 |
|
that can be applied on both momentum and tracer fields, just prior to |
131 |
|
incrementing the time level to $n+1$. |
132 |
|
|
133 |
|
Since the pressure solver precision is of the order of the ``target |
134 |
|
residual'' and can be lower than the the computer truncation error, |
135 |
|
and also because some filters might alter the divergence part of the |
136 |
|
flow field, a final evaluation of the surface r anomaly $\eta^{n+1}$ |
137 |
|
is performed in {\it CALC\_EXACT\_ETA}. This ensures exact volume |
138 |
|
conservation. Note that there is no need for an equivalent |
139 |
|
non-hydrostatic ``exact conservation'' step, since by default $w$ is |
140 |
|
already computed after the filters are applied. |
141 |
|
|
142 |
|
Optional forcing terms (usually part of a physics ``package''), that |
143 |
|
account for a specific source or sink process (e.g. condensation as a |
144 |
|
sink of water vapor Q) are generally incorporated in the main |
145 |
|
algorithm as follows: at the the beginning of the time step, the |
146 |
|
additional tendencies are computed as a function of the present state |
147 |
|
(time step $n$) and external forcing; then within the main part of |
148 |
|
model, only those new tendencies are added to the model variables. |
149 |
|
|
150 |
|
[more details needed]\\ |
151 |
|
|
152 |
|
The atmospheric physics follows this general scheme. |
153 |
|
|
154 |
|
[more about C\_grid, A\_grid conversion \& drag term]\\ |
155 |
|
|
156 |
|
|
157 |
|
|
158 |
|
\subsection{Standard synchronous time stepping} |
159 |
|
|
160 |
In the standard formulation, the surface pressure is |
In the standard formulation, the surface pressure is evaluated at time |
161 |
evaluated at time step n+1 (implicit method). |
step n+1 (an implicit method). Equations \ref{eq-tCsC-theta} to |
162 |
The above set of equations is then discretized in time |
\ref{eq-tCsC-cont} are then discretized in time as follows: |
|
as follows: |
|
163 |
\begin{eqnarray} |
\begin{eqnarray} |
164 |
\left[ 1 - \partial_r \kappa_v^\theta \partial_r \right] |
\left[ 1 - \partial_r \kappa_v^\theta \partial_r \right] |
165 |
\theta^{n+1} & = & \theta^* |
\theta^{n+1} & = & \theta^* |
166 |
|
\label{eq-tDsC-theta} |
167 |
\\ |
\\ |
168 |
\left[ 1 - \partial_r \kappa_v^S \partial_r \right] |
\left[ 1 - \partial_r \kappa_v^S \partial_r \right] |
169 |
S^{n+1} & = & S^* |
S^{n+1} & = & S^* |
170 |
|
\label{eq-tDsC-salt} |
171 |
\\ |
\\ |
172 |
%{b'}^{n} & = & b'(\theta^{n},S^{n},r) |
%{b'}^{n} & = & b'(\theta^{n},S^{n},r) |
173 |
%\partial_r {\phi'_{hyd}}^{n} & = & {-b'}^{n} |
%\partial_r {\phi'_{hyd}}^{n} & = & {-b'}^{n} |
174 |
%\\ |
%\\ |
175 |
{\phi'_{hyd}}^{n} & = & \int_{r'}^{R_o} b'(\theta^{n},S^{n},r) dr |
{\phi'_{hyd}}^{n} & = & \int_{r'}^{R_o} b'(\theta^{n},S^{n},r) dr |
176 |
\label{eq-rtd-hyd} |
\label{eq-tDsC-hyd} |
177 |
\\ |
\\ |
178 |
\vec{\bf v} ^{n+1} |
\vec{\bf v} ^{n+1} |
179 |
+ \Delta t {\bf \nabla}_r B_o {\eta}^{n+1} |
+ \Delta t {\bf \nabla}_h b_s {\eta}^{n+1} |
180 |
+ \epsilon_{nh} \Delta t {\bf \nabla}_r {\phi'_{nh}}^{n+1} |
+ \epsilon_{nh} \Delta t {\bf \nabla} {\phi'_{nh}}^{n+1} |
181 |
- \partial_r A_v \partial_r \vec{\bf v}^{n+1} |
- \partial_r A_v \partial_r \vec{\bf v}^{n+1} |
182 |
& = & |
& = & |
183 |
\vec{\bf v}^* |
\vec{\bf v}^* |
184 |
\label{eq-rtd-hmom} |
\label{eq-tDsC-Hmom} |
185 |
\\ |
\\ |
186 |
\epsilon_{fs} {\eta}^{n+1} + \Delta t |
\epsilon_{fs} {\eta}^{n+1} + \Delta t |
187 |
{\bf \nabla}_r \cdot \int_{R_{min}}^{R_o} \vec{\bf v}^{n+1} dr |
{\bf \nabla}_h \cdot \int_{R_{fixed}}^{R_o} \vec{\bf v}^{n+1} dr |
188 |
& = & |
& = & |
189 |
\epsilon_{fs} {\eta}^{n} + \epsilon_{fw} \Delta_t (P-E)^{n} |
\epsilon_{fs} {\eta}^{n} + \epsilon_{fw} \Delta_t (P-E)^{n} |
190 |
\nonumber |
\nonumber |
191 |
\\ |
\\ |
192 |
% = \epsilon_{fs} {\eta}^{n} & + & \epsilon_{fw} \Delta_t (P-E)^{n} |
% = \epsilon_{fs} {\eta}^{n} & + & \epsilon_{fw} \Delta_t (P-E)^{n} |
193 |
\label{eq-rtd-eta} |
\label{eq-tDsC-eta} |
194 |
\\ |
\\ |
195 |
\epsilon_{nh} \left( \dot{r} ^{n+1} |
\epsilon_{nh} \left( \dot{r} ^{n+1} |
196 |
+ \Delta t \partial_r {\phi'_{nh}} ^{n+1} |
+ \Delta t \partial_r {\phi'_{nh}} ^{n+1} |
197 |
\right) |
\right) |
198 |
& = & \epsilon_{nh} \dot{r}^* |
& = & \epsilon_{nh} \dot{r}^* |
199 |
\label{eq-rtd-rdot} |
\label{eq-tDsC-Vmom} |
200 |
\\ |
\\ |
201 |
{\bf \nabla}_r \cdot \vec{\bf v}^{n+1} + \partial_r \dot{r}^{n+1} |
{\bf \nabla}_h \cdot \vec{\bf v}^{n+1} + \partial_r \dot{r}^{n+1} |
202 |
& = & 0 |
& = & 0 |
203 |
\label{eq-rtd-cont} |
\label{eq-tDsC-cont} |
204 |
\end{eqnarray} |
\end{eqnarray} |
205 |
where |
where |
206 |
\begin{eqnarray} |
\begin{eqnarray} |
212 |
\\ |
\\ |
213 |
\vec{\bf v}^* & = & |
\vec{\bf v}^* & = & |
214 |
\vec{\bf v}^{n} + \Delta t \vec{\bf G}_{\vec{\bf v}} ^{(n+1/2)} |
\vec{\bf v}^{n} + \Delta t \vec{\bf G}_{\vec{\bf v}} ^{(n+1/2)} |
215 |
+ \Delta t {\bf \nabla}_r {\phi'_{hyd}}^{(n+1/2)} |
+ \Delta t {\bf \nabla}_h {\phi'_{hyd}}^{(n+1/2)} |
216 |
\\ |
\\ |
217 |
\dot{r}^* & = & |
\dot{r}^* & = & |
218 |
\dot{r} ^{n} + \Delta t G_{\dot{r}} ^{(n+1/2)} |
\dot{r} ^{n} + \Delta t G_{\dot{r}} ^{(n+1/2)} |
219 |
\end{eqnarray} |
\end{eqnarray} |
220 |
|
|
221 |
Note that implicit vertical terms (viscosity and diffusivity) are |
Note that implicit vertical viscosity and diffusivity terms are not |
222 |
not considered as part of the "{\it G}" terms, but are |
considered as part of the ``{\it G}'' terms, but are written |
223 |
written separately here. |
separately here. |
224 |
|
|
225 |
To ensure a second order time discretization for both |
The default time-stepping method is the Adams-Bashforth quasi-second |
226 |
momentum and tracer, |
order scheme in which the ``G'' terms are extrapolated forward in time |
227 |
The "G" terms are "extrapolated" forward in time |
from time-levels $n-1$ and $n$ to time-level $n+1/2$ and provides a |
228 |
(Adams Bashforth time stepping) |
simple but stable algorithm: |
229 |
from the values computed at time step $n$ and $n-1$ |
\begin{equation} |
230 |
to the time $n+1/2$: |
G^{(n+1/2)} = G^n + (1/2+\epsilon_{AB}) (G^n - G^{n-1}) |
231 |
$$G^{(n+1/2)} = G^n + (1/2+\epsilon_{AB}) (G^n - G^{n-1})$$ |
\end{equation} |
232 |
A small number for the parameter $\epsilon_{AB}$ is generally used |
where $\epsilon_{AB}$ is a small number used to stabilize the time |
233 |
to stabilize this time stepping. |
stepping. |
|
|
|
|
In the standard non-stagger formulation, |
|
|
the Adams-Bashforth time stepping is also applied to the |
|
|
hydrostatic (pressure / geo-) potential term $\nabla_h \Phi'_{hyd}$. |
|
|
Note that presently, this term is in fact incorporated to the |
|
|
$\vec{\bf G}_{\vec{\bf v}}$ arrays ({\it gU,gV}). |
|
|
|
|
|
\subsection{general method} |
|
|
|
|
|
The general algorithm consist in a "predictor step" that computes |
|
|
the forward tendencies ("G" terms") and all |
|
|
the "first guess" values star notation): |
|
|
$\vec{\bf v}^*, \theta^*, S^*$ (and $\dot{r}^*$ |
|
|
in non-hydrostatic mode). This is done in the routine {\it DYNAMICS}. |
|
|
|
|
|
Then the implicit terms that appear here on the left hand side (LHS), |
|
|
are solved as follows: |
|
|
Since implicit vertical diffusion and viscosity terms |
|
|
are independent from the barotropic flow adjustment, |
|
|
they are computed first, solving a 3 diagonal Nr x Nr linear system, |
|
|
and incorporated at the end of the {\it DYNAMICS} routines. |
|
|
Then the surface pressure and non hydrostatic pressure |
|
|
are evaluated ({\it SOLVE\_FOR\_PRESSURE}); |
|
|
|
|
|
Finally, within a "corrector step', |
|
|
(routine {\it THE\_CORRECTION\_STEP}) |
|
|
the new values of $u,v,w,\theta,S$ |
|
|
are derived according to the above equations |
|
|
(see details in II.1.3). |
|
|
|
|
|
At this point, the regular time step is over, but |
|
|
the correction step contains also other optional |
|
|
adjustments such as convective adjustment algorithm, or filters |
|
|
(zonal FFT filter, shapiro filter) |
|
|
that applied on both momentum and tracer fields. |
|
|
just before setting the $n+1$ new time step value. |
|
|
|
|
|
Since the pressure solver precision is of the order of |
|
|
the "target residual" that could be lower than the |
|
|
the computer truncation error, and also because some filters |
|
|
might alter the divergence part of the flow field, |
|
|
a final evaluation of the surface r anomaly $\eta^{n+1}$ |
|
|
is performed, according to \ref{eq-rtd-eta} ({\it CALC\_EXACT\_ETA}). |
|
|
This ensures a perfect volume conservation. |
|
|
Note that there is no need for an equivalent Non-hydrostatic |
|
|
"exact conservation" step, since W is already computed after |
|
|
the filters applied. |
|
|
|
|
|
optionnal forcing terms (package):\\ |
|
|
Regarding optional forcing terms (usually part of a "package"), |
|
|
that a account for a specific source or sink term (e.g.: condensation |
|
|
as a sink of water vapor Q), they are generally incorporated |
|
|
in the main algorithm as follows; |
|
|
At the the beginning of the time step, |
|
|
the additionnal tendencies are computed |
|
|
as function of the present state (time step $n$) and external forcing ; |
|
|
Then within the main part of model, |
|
|
only those new tendencies are added to the model variables. |
|
|
|
|
|
[mode details needed] |
|
|
The atmospheric physics follows this general scheme. |
|
|
|
|
|
\subsection{stagger baroclinic time stepping} |
|
234 |
|
|
235 |
An alternative is to evaluate $\phi'_{hyd}$ with the |
In the standard non-staggered formulation, the Adams-Bashforth time |
236 |
new tracer fields, and step forward the momentum after. |
stepping is also applied to the hydrostatic pressure/geo-potential |
237 |
This option is known as stagger baroclinic time stepping, |
gradient, $\nabla_h \Phi'_{hyd}$. Note that presently, this term is in |
238 |
since tracer and momentum are step forward in time one after the other. |
fact incorporated to the $\vec{\bf G}_{\vec{\bf v}}$ arrays ({\bf |
239 |
It can be activated turning on a running flag parameter |
gU,gV}). |
240 |
{\it staggerTimeStep} in file "{\it data}"). |
\marginpar{JMC: Clarify this term?} |
241 |
|
|
242 |
The main advantage of this time stepping compared to a synchronous one, |
|
243 |
is a better stability, specially regarding internal gravity waves, |
\subsection{Stagger baroclinic time stepping} |
244 |
and a very natural implementation of a 2nd order in time |
|
245 |
hydrostatic pressure / geo- potential term. |
An alternative to synchronous time-stepping is to stagger the momentum |
246 |
In the other hand, a synchronous time step might be better |
and tracer fields in time. This allows the evaluation and gradient of |
247 |
for convection problems; Its also make simpler time dependent forcing |
$\phi'_{hyd}$ to be centered in time with out needing to use the |
248 |
and diagnostic implementation ; and allows a more efficient threading. |
Adams-Bashforth extrapoltion. This option is known as staggered |
249 |
|
baroclinic time stepping because tracer and momentum are stepped |
250 |
Although the stagger time step does not affect deeply the |
forward-in-time one after the other. It can be activated by turning |
251 |
structure of the code --- a switch allows to evaluate the |
on a run-time parameter {\bf staggerTimeStep} in namelist ``{\it |
252 |
hydrostatic pressure / geo- potential from new $\theta,S$ |
PARM01}''. |
253 |
instead of the Adams-Bashforth estimation --- |
|
254 |
this affect the way the time discretization is presented : |
The main advantage of staggered time-stepping compared to synchronous, |
255 |
|
is improved stability to internal gravity wave motions and a very |
256 |
|
natural implementation of a 2nd order in time hydrostatic |
257 |
|
pressure/geo-potential gradient term. However, synchronous |
258 |
|
time-stepping might be better for convection problems, time dependent |
259 |
|
forcing and diagnosing the model are also easier and it allows a more |
260 |
|
efficient parallel decomposition. |
261 |
|
|
262 |
\begin{eqnarray*} |
The staggered baroclinic time-stepping scheme is equations |
263 |
\left[ 1 - \partial_r \kappa_v^\theta \partial_r \right] |
\ref{eq-tDsC-theta} to \ref{eq-tDsC-cont} except that \ref{eq-tDsC-hyd} is replaced with: |
264 |
\theta^{n+1/2} & = & \theta^* |
\begin{equation} |
265 |
\\ |
{\phi'_{hyd}}^{n+1/2} = \int_{r'}^{R_o} b'(\theta^{n+1/2},S^{n+1/2},r) |
266 |
\left[ 1 - \partial_r \kappa_v^S \partial_r \right] |
dr |
267 |
S^{n+1/2} & = & S^* |
\end{equation} |
268 |
\end{eqnarray*} |
and the time-level for tracers has been shifted back by half: |
|
with |
|
269 |
\begin{eqnarray*} |
\begin{eqnarray*} |
270 |
\theta^* & = & |
\theta^* & = & |
271 |
\theta ^{(n-1/2)} + \Delta t G_{\theta} ^{(n)} |
\theta ^{(n-1/2)} + \Delta t G_{\theta} ^{(n)} |
272 |
\\ |
\\ |
273 |
S^* & = & |
S^* & = & |
274 |
S ^{(n-1/2)} + \Delta t G_{S} ^{(n)} |
S ^{(n-1/2)} + \Delta t G_{S} ^{(n)} |
|
\end{eqnarray*} |
|
|
And |
|
|
\begin{eqnarray*} |
|
|
%{b'}^{n+1/2} & = & b'(\theta^{n+1/2},S^{n+1/2},r) |
|
|
%\\ |
|
|
%\partial_r {\phi'_{hyd}}^{n+1/2} & = & {-b'}^{n+1/2} |
|
|
{\phi'_{hyd}}^{n+1/2} & = & \int_{r'}^{R_o} b'(\theta^{n+1/2},S^{n+1/2},r) dr |
|
|
%\label{eq-rtd-hyd} |
|
275 |
\\ |
\\ |
276 |
\vec{\bf v} ^{n+1} |
\left[ 1 - \partial_r \kappa_v^\theta \partial_r \right] |
277 |
+ \Delta t {\bf \nabla}_r B_o {\eta}^{n+1} |
\theta^{n+1/2} & = & \theta^* |
|
+ \epsilon_{nh} \Delta t {\bf \nabla}_r {\phi'_{nh}}^{n+1} |
|
|
- \partial_r A_v \partial_r \vec{\bf v}^{n+1} |
|
|
& = & |
|
|
\vec{\bf v}^* |
|
|
%\label{eq-rtd-hmom} |
|
|
\\ |
|
|
\epsilon_{fs} {\eta}^{n+1} + \Delta t |
|
|
{\bf \nabla}_r \cdot \int_{R_{min}}^{R_o} \vec{\bf v}^{n+1} dr |
|
|
& = & |
|
|
\epsilon_{fs} {\eta}^{n} + \epsilon_{fw} \Delta_t (P-E)^{n} |
|
|
\\ |
|
|
\epsilon_{nh} \left( \dot{r} ^{n+1} |
|
|
+ \Delta t \partial_r {\phi'_{nh}} ^{n+1} |
|
|
\right) |
|
|
& = & \epsilon_{nh} \dot{r}^* |
|
|
%\label{eq-rtd-rdot} |
|
|
\\ |
|
|
{\bf \nabla}_r \cdot \vec{\bf v}^{n+1} + \partial_r \dot{r}^{n+1} |
|
|
& = & 0 |
|
|
%\label{eq-rtd-cont} |
|
|
\end{eqnarray*} |
|
|
with |
|
|
\begin{eqnarray*} |
|
|
\vec{\bf v}^* & = & |
|
|
\vec{\bf v} ^{n} + \Delta t \vec{\bf G}_{\vec{\bf v}} ^{(n+1/2)} |
|
|
+ \Delta t {\bf \nabla}_r {\phi'_{hyd}}^{n+1/2} |
|
278 |
\\ |
\\ |
279 |
\dot{r}^* & = & |
\left[ 1 - \partial_r \kappa_v^S \partial_r \right] |
280 |
\dot{r} ^{n} + \Delta t G_{\dot{r}} ^{(n+1/2)} |
S^{n+1/2} & = & S^* |
281 |
\end{eqnarray*} |
\end{eqnarray*} |
282 |
|
|
|
%--------------------------------------------------------------------- |
|
283 |
|
|
284 |
\subsection{surface pressure} |
\subsection{Surface pressure} |
285 |
|
|
286 |
Substituting \ref{eq-rtd-hmom} into \ref{eq-rtd-cont}, assuming |
Substituting \ref{eq-tDsC-Hmom} into \ref{eq-tDsC-cont}, assuming |
287 |
$\epsilon_{nh} = 0$ yields a Helmholtz equation for ${\eta}^{n+1}$: |
$\epsilon_{nh} = 0$ yields a Helmholtz equation for ${\eta}^{n+1}$: |
288 |
\begin{eqnarray} |
\begin{eqnarray} |
289 |
\epsilon_{fs} {\eta}^{n+1} - |
\epsilon_{fs} {\eta}^{n+1} - |
290 |
{\bf \nabla}_r \cdot \Delta t^2 (R_o-R_{min}) |
{\bf \nabla}_h \cdot \Delta t^2 (R_o-R_{fixed}) |
291 |
{\bf \nabla}_r B_o {\eta}^{n+1} |
{\bf \nabla}_h b_s {\eta}^{n+1} |
292 |
= {\eta}^* |
= {\eta}^* |
293 |
\label{solve_2d} |
\label{eq-solve2D} |
294 |
\end{eqnarray} |
\end{eqnarray} |
295 |
where |
where |
296 |
\begin{eqnarray} |
\begin{eqnarray} |
297 |
{\eta}^* = \epsilon_{fs} \: {\eta}^{n} - |
{\eta}^* = \epsilon_{fs} \: {\eta}^{n} - |
298 |
\Delta t {\bf \nabla}_r \cdot \int_{R_{min}}^{R_o} \vec{\bf v}^* dr |
\Delta t {\bf \nabla}_h \cdot \int_{R_{fixed}}^{R_o} \vec{\bf v}^* dr |
299 |
\: + \: \epsilon_{fw} \Delta_t (P-E)^{n} |
\: + \: \epsilon_{fw} \Delta_t (P-E)^{n} |
300 |
\label{solve_2d_rhs} |
\label{eq-solve2D_rhs} |
301 |
\end{eqnarray} |
\end{eqnarray} |
302 |
|
|
303 |
Once ${\eta}^{n+1}$ has been found substituting into \ref{eq-rtd-hmom} |
Once ${\eta}^{n+1}$ has been found, substituting into |
304 |
would yield $\vec{\bf v}^{n+1}$ if the model is hydrostatic |
\ref{eq-tDsC-Hmom} yields $\vec{\bf v}^{n+1}$ if the model is |
305 |
($\epsilon_{nh}=0$): |
hydrostatic ($\epsilon_{nh}=0$): |
306 |
$$ |
$$ |
307 |
\vec{\bf v}^{n+1} = \vec{\bf v}^{*} |
\vec{\bf v}^{n+1} = \vec{\bf v}^{*} |
308 |
- \Delta t {\bf \nabla}_r B_o {\eta}^{n+1} |
- \Delta t {\bf \nabla}_h b_s {\eta}^{n+1} |
309 |
$$ |
$$ |
310 |
|
|
311 |
This is known as the correction step. However, when the model is |
This is known as the correction step. However, when the model is |
312 |
non-hydrostatic ($\epsilon_{nh}=1$) we need an additional step and an |
non-hydrostatic ($\epsilon_{nh}=1$) we need an additional step and an |
313 |
additional equation for $\phi'_{nh}$. This is obtained by |
additional equation for $\phi'_{nh}$. This is obtained by substituting |
314 |
substituting \ref{eq-rtd-hmom} and \ref{eq-rtd-rdot} into |
\ref{eq-tDsC-Hmom} and \ref{eq-tDsC-Vmom} into |
315 |
\ref{eq-rtd-cont}: |
\ref{eq-tDsC-cont}: |
316 |
\begin{equation} |
\begin{equation} |
317 |
\left[ {\bf \nabla}_r^2 + \partial_{rr} \right] {\phi'_{nh}}^{n+1} |
\left[ {\bf \nabla}_h^2 + \partial_{rr} \right] {\phi'_{nh}}^{n+1} |
318 |
= \frac{1}{\Delta t} \left( |
= \frac{1}{\Delta t} \left( |
319 |
{\bf \nabla}_r \cdot \vec{\bf v}^{**} + \partial_r \dot{r}^* \right) |
{\bf \nabla}_h \cdot \vec{\bf v}^{**} + \partial_r \dot{r}^* \right) |
320 |
\end{equation} |
\end{equation} |
321 |
where |
where |
322 |
\begin{displaymath} |
\begin{displaymath} |
323 |
\vec{\bf v}^{**} = \vec{\bf v}^* - \Delta t {\bf \nabla}_r B_o {\eta}^{n+1} |
\vec{\bf v}^{**} = \vec{\bf v}^* - \Delta t {\bf \nabla}_h b_s {\eta}^{n+1} |
324 |
\end{displaymath} |
\end{displaymath} |
325 |
Note that $\eta^{n+1}$ is also used to update the second RHS term |
Note that $\eta^{n+1}$ is also used to update the second RHS term |
326 |
$\partial_r \dot{r}^* $ since |
$\partial_r \dot{r}^* $ since |
330 |
Finally, the horizontal velocities at the new time level are found by: |
Finally, the horizontal velocities at the new time level are found by: |
331 |
\begin{equation} |
\begin{equation} |
332 |
\vec{\bf v}^{n+1} = \vec{\bf v}^{**} |
\vec{\bf v}^{n+1} = \vec{\bf v}^{**} |
333 |
- \epsilon_{nh} \Delta t {\bf \nabla}_r {\phi'_{nh}}^{n+1} |
- \epsilon_{nh} \Delta t {\bf \nabla}_h {\phi'_{nh}}^{n+1} |
334 |
\end{equation} |
\end{equation} |
335 |
and the vertical velocity is found by integrating the continuity |
and the vertical velocity is found by integrating the continuity |
336 |
equation vertically. |
equation vertically. Note that, for the convenience of the restart |
337 |
Note that, for convenience regarding the restart procedure, |
procedure, the vertical integration of the continuity equation has |
338 |
the integration of the continuity equation has been |
been moved to the beginning of the time step (instead of at the end), |
|
moved at the beginning of the time step (instead of at the end), |
|
339 |
without any consequence on the solution. |
without any consequence on the solution. |
340 |
|
|
341 |
Regarding the implementation, all those computation are done |
Regarding the implementation of the surface pressure solver, all |
342 |
within the routine {\it SOLVE\_FOR\_PRESSURE} and its dependent |
computation are done within the routine {\it SOLVE\_FOR\_PRESSURE} and |
343 |
{\it CALL}s. |
its dependent calls. The standard method to solve the 2D elliptic |
344 |
The standard method to solve the 2D elliptic problem (\ref{solve_2d}) |
problem (\ref{eq-solve2D}) uses the conjugate gradient method (routine |
345 |
uses the conjugate gradient method (routine {\it CG2D}); The |
{\it CG2D}); the solver matrix and conjugate gradient operator are |
346 |
the solver matrix and conjugate gradient operator are only function |
only function of the discretized domain and are therefore evaluated |
347 |
of the discretized domain and are therefore evaluated separately, |
separately, before the time iteration loop, within {\it INI\_CG2D}. |
348 |
before the time iteration loop, within {\it INI\_CG2D}. |
The computation of the RHS $\eta^*$ is partly done in {\it |
349 |
The computation of the RHS $\eta^*$ is partly |
CALC\_DIV\_GHAT} and in {\it SOLVE\_FOR\_PRESSURE}. |
350 |
done in {\it CALC\_DIV\_GHAT} and in {\it SOLVE\_FOR\_PRESSURE}. |
|
351 |
|
The same method is applied for the non hydrostatic part, using a |
352 |
The same method is applied for the non hydrostatic part, using |
conjugate gradient 3D solver ({\it CG3D}) that is initialized in {\it |
353 |
a conjugate gradient 3D solver ({\it CG3D}) that is initialized |
INI\_CG3D}. The RHS terms of 2D and 3D problems are computed together |
354 |
in {\it INI\_CG3D}. The RHS terms of 2D and 3D problems |
at the same point in the code. |
355 |
are computed together, within the same part of the code. |
|
356 |
|
|
|
\newpage |
|
|
%----------------------------------------------------------------------------------- |
|
357 |
\subsection{Crank-Nickelson barotropic time stepping} |
\subsection{Crank-Nickelson barotropic time stepping} |
358 |
|
|
359 |
The full implicit time stepping described previously is unconditionally stable |
The full implicit time stepping described previously is |
360 |
but damps the fast gravity waves, resulting in a loss of |
unconditionally stable but damps the fast gravity waves, resulting in |
361 |
gravity potential energy. |
a loss of potential energy. The modification presented now allows one |
362 |
The modification presented hereafter allows to combine an implicit part |
to combine an implicit part ($\beta,\gamma$) and an explicit part |
363 |
($\beta,\gamma$) and an explicit part ($1-\beta,1-\gamma$) for the surface |
($1-\beta,1-\gamma$) for the surface pressure gradient ($\beta$) and |
364 |
pressure gradient ($\beta$) and for the barotropic flow divergence ($\gamma$). |
for the barotropic flow divergence ($\gamma$). |
365 |
\\ |
\\ |
366 |
For instance, $\beta=\gamma=1$ is the previous fully implicit scheme; |
For instance, $\beta=\gamma=1$ is the previous fully implicit scheme; |
367 |
$\beta=\gamma=1/2$ is the non damping (energy conserving), unconditionally |
$\beta=\gamma=1/2$ is the non damping (energy conserving), unconditionally |
372 |
{\it implicSurfPress}, {\it implicDiv2DFlow}. They are read from |
{\it implicSurfPress}, {\it implicDiv2DFlow}. They are read from |
373 |
the main data file "{\it data}" and are set by default to 1,1. |
the main data file "{\it data}" and are set by default to 1,1. |
374 |
|
|
375 |
Equations \ref{eq-rtd-hmom} and \ref{eq-rtd-eta} are modified as follows: |
Equations \ref{eq-tDsC-Hmom} and \ref{eq-tDsC-eta} are modified as follows: |
376 |
$$ |
$$ |
377 |
\frac{ \vec{\bf v}^{n+1} }{ \Delta t } |
\frac{ \vec{\bf v}^{n+1} }{ \Delta t } |
378 |
+ {\bf \nabla}_r B_o [ \beta {\eta}^{n+1} + (1-\beta) {\eta}^{n} ] |
+ {\bf \nabla}_h b_s [ \beta {\eta}^{n+1} + (1-\beta) {\eta}^{n} ] |
379 |
+ \epsilon_{nh} {\bf \nabla}_r {\phi'_{nh}}^{n+1} |
+ \epsilon_{nh} {\bf \nabla}_h {\phi'_{nh}}^{n+1} |
380 |
= \frac{ \vec{\bf v}^* }{ \Delta t } |
= \frac{ \vec{\bf v}^* }{ \Delta t } |
381 |
$$ |
$$ |
382 |
$$ |
$$ |
383 |
\epsilon_{fs} \frac{ {\eta}^{n+1} - {\eta}^{n} }{ \Delta t} |
\epsilon_{fs} \frac{ {\eta}^{n+1} - {\eta}^{n} }{ \Delta t} |
384 |
+ {\bf \nabla}_r \cdot \int_{R_{min}}^{R_o} |
+ {\bf \nabla}_h \cdot \int_{R_{fixed}}^{R_o} |
385 |
[ \gamma \vec{\bf v}^{n+1} + (1-\gamma) \vec{\bf v}^{n}] dr |
[ \gamma \vec{\bf v}^{n+1} + (1-\gamma) \vec{\bf v}^{n}] dr |
386 |
= \epsilon_{fw} (P-E) |
= \epsilon_{fw} (P-E) |
387 |
$$ |
$$ |
389 |
\begin{eqnarray*} |
\begin{eqnarray*} |
390 |
\vec{\bf v}^* & = & |
\vec{\bf v}^* & = & |
391 |
\vec{\bf v} ^{n} + \Delta t \vec{\bf G}_{\vec{\bf v}} ^{(n+1/2)} |
\vec{\bf v} ^{n} + \Delta t \vec{\bf G}_{\vec{\bf v}} ^{(n+1/2)} |
392 |
+ (\beta-1) \Delta t {\bf \nabla}_r B_o {\eta}^{n} |
+ (\beta-1) \Delta t {\bf \nabla}_h b_s {\eta}^{n} |
393 |
+ \Delta t {\bf \nabla}_r {\phi'_{hyd}}^{(n+1/2)} |
+ \Delta t {\bf \nabla}_h {\phi'_{hyd}}^{(n+1/2)} |
394 |
\\ |
\\ |
395 |
{\eta}^* & = & |
{\eta}^* & = & |
396 |
\epsilon_{fs} {\eta}^{n} + \epsilon_{fw} \Delta t (P-E) |
\epsilon_{fs} {\eta}^{n} + \epsilon_{fw} \Delta t (P-E) |
397 |
- \Delta t {\bf \nabla}_r \cdot \int_{R_{min}}^{R_o} |
- \Delta t {\bf \nabla}_h \cdot \int_{R_{fixed}}^{R_o} |
398 |
[ \gamma \vec{\bf v}^* + (1-\gamma) \vec{\bf v}^{n}] dr |
[ \gamma \vec{\bf v}^* + (1-\gamma) \vec{\bf v}^{n}] dr |
399 |
\end{eqnarray*} |
\end{eqnarray*} |
400 |
\\ |
\\ |
401 |
In the hydrostatic case ($\epsilon_{nh}=0$), |
In the hydrostatic case ($\epsilon_{nh}=0$), allowing us to find |
402 |
this allow to find ${\eta}^{n+1}$, according to: |
${\eta}^{n+1}$, thus: |
403 |
$$ |
$$ |
404 |
\epsilon_{fs} {\eta}^{n+1} - |
\epsilon_{fs} {\eta}^{n+1} - |
405 |
{\bf \nabla}_r \cdot \beta\gamma \Delta t^2 B_o (R_o - R_{min}) |
{\bf \nabla}_h \cdot \beta\gamma \Delta t^2 b_s (R_o - R_{fixed}) |
406 |
{\bf \nabla}_r {\eta}^{n+1} |
{\bf \nabla}_h {\eta}^{n+1} |
407 |
= {\eta}^* |
= {\eta}^* |
408 |
$$ |
$$ |
409 |
and then to compute (correction step): |
and then to compute (correction step): |
410 |
$$ |
$$ |
411 |
\vec{\bf v}^{n+1} = \vec{\bf v}^{*} |
\vec{\bf v}^{n+1} = \vec{\bf v}^{*} |
412 |
- \beta \Delta t {\bf \nabla}_r B_o {\eta}^{n+1} |
- \beta \Delta t {\bf \nabla}_h b_s {\eta}^{n+1} |
413 |
$$ |
$$ |
414 |
|
|
415 |
The non-hydrostatic part is solved as described previously. |
The non-hydrostatic part is solved as described previously. |
416 |
\\ \\ |
|
417 |
N.B: |
Note that: |
418 |
\\ |
\begin{enumerate} |
419 |
a) The non-hydrostatic part of the code has not yet been |
\item The non-hydrostatic part of the code has not yet been |
420 |
updated, %since it falls out of the purpose of this test, |
updated, so that this option cannot be used with $(\beta,\gamma) \neq (1,1)$. |
421 |
so that this option cannot be used with $(\beta,\gamma) \neq (1,1)$. |
\item The stability criteria with Crank-Nickelson time stepping |
422 |
\\ |
for the pure linear gravity wave problem in cartesian coordinates is: |
423 |
b) To remind, the stability criteria with the Crank-Nickelson time stepping |
\begin{itemize} |
424 |
for the pure linear gravity wave problem in cartesian coordinate is: |
\item $\beta + \gamma < 1$ : unstable |
425 |
\\ |
\item $\beta \geq 1/2$ and $ \gamma \geq 1/2$ : stable |
426 |
$\star$~ $\beta + \gamma < 1$ : unstable |
\item $\beta + \gamma \geq 1$ : stable if |
|
\\ |
|
|
$\star$~ $\beta \geq 1/2$ and $ \gamma \geq 1/2$ : stable |
|
|
\\ |
|
|
$\star$~ $\beta + \gamma \geq 1$ : stable if |
|
|
%, for all wave length $(k\Delta x,l\Delta y)$ |
|
427 |
$$ |
$$ |
428 |
c_{max}^2 (\beta - 1/2)(\gamma - 1/2) + 1 \geq 0 |
c_{max}^2 (\beta - 1/2)(\gamma - 1/2) + 1 \geq 0 |
429 |
$$ |
$$ |
438 |
c_{max} = 2 \Delta t \: \sqrt{g H} \: |
c_{max} = 2 \Delta t \: \sqrt{g H} \: |
439 |
\sqrt{ \frac{1}{\Delta x^2} + \frac{1}{\Delta y^2} } |
\sqrt{ \frac{1}{\Delta x^2} + \frac{1}{\Delta y^2} } |
440 |
$$ |
$$ |
441 |
|
\end{itemize} |
442 |
|
\end{enumerate} |
443 |
|
|