/[MITgcm]/manual/s_algorithm/text/time_stepping.tex
ViewVC logotype

Contents of /manual/s_algorithm/text/time_stepping.tex

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.16 - (show annotations) (download) (as text)
Thu Aug 7 18:27:52 2003 UTC (21 years, 11 months ago) by edhill
Branch: MAIN
Changes since 1.15: +7 -6 lines
File MIME type: application/x-tex
Two improvements:
  - the manual build now works on a "dirty" (post-verification-runs)
    source tree
  - various small fixes to the manual (mostly Y. Hu's comments)

1 % $Header: /u/u3/gcmpack/manual/part2/time_stepping.tex,v 1.15 2002/02/28 19:32:19 cnh Exp $
2 % $Name: $
3
4 This chapter lays out the numerical schemes that are
5 employed in the core MITgcm algorithm. Whenever possible
6 links are made to actual program code in the MITgcm implementation.
7 The chapter begins with a discussion of the temporal discretization
8 used in MITgcm. This discussion is followed by sections that
9 describe the spatial discretization. The schemes employed for momentum
10 terms are described first, afterwards the schemes that apply to
11 passive and dynamically active tracers are described.
12
13
14 \section{Time-stepping}
15 The equations of motion integrated by the model involve four
16 prognostic equations for flow, $u$ and $v$, temperature, $\theta$, and
17 salt/moisture, $S$, and three diagnostic equations for vertical flow,
18 $w$, density/buoyancy, $\rho$/$b$, and pressure/geo-potential,
19 $\phi_{hyd}$. In addition, the surface pressure or height may by
20 described by either a prognostic or diagnostic equation and if
21 non-hydrostatics terms are included then a diagnostic equation for
22 non-hydrostatic pressure is also solved. The combination of prognostic
23 and diagnostic equations requires a model algorithm that can march
24 forward prognostic variables while satisfying constraints imposed by
25 diagnostic equations.
26
27 Since the model comes in several flavors and formulation, it would be
28 confusing to present the model algorithm exactly as written into code
29 along with all the switches and optional terms. Instead, we present
30 the algorithm for each of the basic formulations which are:
31 \begin{enumerate}
32 \item the semi-implicit pressure method for hydrostatic equations
33 with a rigid-lid, variables co-located in time and with
34 Adams-Bashforth time-stepping, \label{it:a}
35 \item as \ref{it:a}. but with an implicit linear free-surface, \label{it:b}
36 \item as \ref{it:a}. or \ref{it:b}. but with variables staggered in time,
37 \label{it:c}
38 \item as \ref{it:a}. or \ref{it:b}. but with non-hydrostatic terms included,
39 \item as \ref{it:b}. or \ref{it:c}. but with non-linear free-surface.
40 \end{enumerate}
41
42 In all the above configurations it is also possible to substitute the
43 Adams-Bashforth with an alternative time-stepping scheme for terms
44 evaluated explicitly in time. Since the over-arching algorithm is
45 independent of the particular time-stepping scheme chosen we will
46 describe first the over-arching algorithm, known as the pressure
47 method, with a rigid-lid model in section
48 \ref{sect:pressure-method-rigid-lid}. This algorithm is essentially
49 unchanged, apart for some coefficients, when the rigid lid assumption
50 is replaced with a linearized implicit free-surface, described in
51 section \ref{sect:pressure-method-linear-backward}. These two flavors
52 of the pressure-method encompass all formulations of the model as it
53 exists today. The integration of explicit in time terms is out-lined
54 in section \ref{sect:adams-bashforth} and put into the context of the
55 overall algorithm in sections \ref{sect:adams-bashforth-sync} and
56 \ref{sect:adams-bashforth-staggered}. Inclusion of non-hydrostatic
57 terms requires applying the pressure method in three dimensions
58 instead of two and this algorithm modification is described in section
59 \ref{sect:non-hydrostatic}. Finally, the free-surface equation may be
60 treated more exactly, including non-linear terms, and this is
61 described in section \ref{sect:nonlinear-freesurface}.
62
63
64 \section{Pressure method with rigid-lid} \label{sect:pressure-method-rigid-lid}
65
66 \begin{figure}
67 \begin{center}
68 \resizebox{4.0in}{!}{\includegraphics{part2/pressure-method-rigid-lid.eps}}
69 \end{center}
70 \caption{
71 A schematic of the evolution in time of the pressure method
72 algorithm. A prediction for the flow variables at time level $n+1$ is
73 made based only on the explicit terms, $G^{(n+^1/_2)}$, and denoted
74 $u^*$, $v^*$. Next, a pressure field is found such that $u^{n+1}$,
75 $v^{n+1}$ will be non-divergent. Conceptually, the $*$ quantities
76 exist at time level $n+1$ but they are intermediate and only
77 temporary.}
78 \label{fig:pressure-method-rigid-lid}
79 \end{figure}
80
81 \begin{figure}
82 \begin{center} \fbox{ \begin{minipage}{4.5in} \begin{tabbing}
83 aaa \= aaa \= aaa \= aaa \= aaa \= aaa \kill
84 \filelink{FORWARD\_STEP}{model-src-forward_step.F} \\
85 \> DYNAMICS \\
86 \>\> TIMESTEP \` $u^*$,$v^*$ (\ref{eq:ustar-rigid-lid},\ref{eq:vstar-rigid-lid}) \\
87 \> SOLVE\_FOR\_PRESSURE \\
88 \>\> CALC\_DIV\_GHAT \` $H\widehat{u^*}$,$H\widehat{v^*}$ (\ref{eq:elliptic}) \\
89 \>\> CG2D \` $\eta^{n+1}$ (\ref{eq:elliptic}) \\
90 \> THE\_CORRECTION\_STEP \\
91 \>\> CALC\_GRAD\_PHI\_SURF \` $\nabla \eta^{n+1}$ \\
92 \>\> CORRECTION\_STEP \` $u^{n+1}$,$v^{n+1}$ (\ref{eq:un+1-rigid-lid},\ref{eq:vn+1-rigid-lid})
93 \end{tabbing} \end{minipage} } \end{center}
94 \caption{Calling tree for the pressure method algorithm
95 (\filelink{FORWARD\_STEP}{model-src-forward_step.F})}
96 \label{fig:call-tree-pressure-method}
97 \end{figure}
98
99 The horizontal momentum and continuity equations for the ocean
100 (\ref{eq:ocean-mom} and \ref{eq:ocean-cont}), or for the atmosphere
101 (\ref{eq:atmos-mom} and \ref{eq:atmos-cont}), can be summarized by:
102 \begin{eqnarray}
103 \partial_t u + g \partial_x \eta & = & G_u \\
104 \partial_t v + g \partial_y \eta & = & G_v \\
105 \partial_x u + \partial_y v + \partial_z w & = & 0
106 \end{eqnarray}
107 where we are adopting the oceanic notation for brevity. All terms in
108 the momentum equations, except for surface pressure gradient, are
109 encapsulated in the $G$ vector. The continuity equation, when
110 integrated over the fluid depth, $H$, and with the rigid-lid/no normal
111 flow boundary conditions applied, becomes:
112 \begin{equation}
113 \partial_x H \widehat{u} + \partial_y H \widehat{v} = 0
114 \label{eq:rigid-lid-continuity}
115 \end{equation}
116 Here, $H\widehat{u} = \int_H u dz$ is the depth integral of $u$,
117 similarly for $H\widehat{v}$. The rigid-lid approximation sets $w=0$
118 at the lid so that it does not move but allows a pressure to be
119 exerted on the fluid by the lid. The horizontal momentum equations and
120 vertically integrated continuity equation are be discretized in time
121 and space as follows:
122 \begin{eqnarray}
123 u^{n+1} + \Delta t g \partial_x \eta^{n+1}
124 & = & u^{n} + \Delta t G_u^{(n+1/2)}
125 \label{eq:discrete-time-u}
126 \\
127 v^{n+1} + \Delta t g \partial_y \eta^{n+1}
128 & = & v^{n} + \Delta t G_v^{(n+1/2)}
129 \label{eq:discrete-time-v}
130 \\
131 \partial_x H \widehat{u^{n+1}}
132 + \partial_y H \widehat{v^{n+1}} & = & 0
133 \label{eq:discrete-time-cont-rigid-lid}
134 \end{eqnarray}
135 As written here, terms on the LHS all involve time level $n+1$ and are
136 referred to as implicit; the implicit backward time stepping scheme is
137 being used. All other terms in the RHS are explicit in time. The
138 thermodynamic quantities are integrated forward in time in parallel
139 with the flow and will be discussed later. For the purposes of
140 describing the pressure method it suffices to say that the hydrostatic
141 pressure gradient is explicit and so can be included in the vector
142 $G$.
143
144 Substituting the two momentum equations into the depth integrated
145 continuity equation eliminates $u^{n+1}$ and $v^{n+1}$ yielding an
146 elliptic equation for $\eta^{n+1}$. Equations
147 \ref{eq:discrete-time-u}, \ref{eq:discrete-time-v} and
148 \ref{eq:discrete-time-cont-rigid-lid} can then be re-arranged as follows:
149 \begin{eqnarray}
150 u^{*} & = & u^{n} + \Delta t G_u^{(n+1/2)} \label{eq:ustar-rigid-lid} \\
151 v^{*} & = & v^{n} + \Delta t G_v^{(n+1/2)} \label{eq:vstar-rigid-lid} \\
152 \partial_x \Delta t g H \partial_x \eta^{n+1}
153 + \partial_y \Delta t g H \partial_y \eta^{n+1}
154 & = &
155 \partial_x H \widehat{u^{*}}
156 + \partial_y H \widehat{v^{*}} \label{eq:elliptic}
157 \\
158 u^{n+1} & = & u^{*} - \Delta t g \partial_x \eta^{n+1} \label{eq:un+1-rigid-lid}\\
159 v^{n+1} & = & v^{*} - \Delta t g \partial_y \eta^{n+1} \label{eq:vn+1-rigid-lid}
160 \end{eqnarray}
161 Equations \ref{eq:ustar-rigid-lid} to \ref{eq:vn+1-rigid-lid}, solved
162 sequentially, represent the pressure method algorithm used in the
163 model. The essence of the pressure method lies in the fact that any
164 explicit prediction for the flow would lead to a divergence flow field
165 so a pressure field must be found that keeps the flow non-divergent
166 over each step of the integration. The particular location in time of
167 the pressure field is somewhat ambiguous; in
168 Fig.~\ref{fig:pressure-method-rigid-lid} we depicted as co-located
169 with the future flow field (time level $n+1$) but it could equally
170 have been drawn as staggered in time with the flow.
171
172 The correspondence to the code is as follows:
173 \begin{itemize}
174 \item
175 the prognostic phase, equations \ref{eq:ustar-rigid-lid} and \ref{eq:vstar-rigid-lid},
176 stepping forward $u^n$ and $v^n$ to $u^{*}$ and $v^{*}$ is coded in
177 \filelink{TIMESTEP()}{model-src-timestep.F}
178 \item
179 the vertical integration, $H \widehat{u^*}$ and $H
180 \widehat{v^*}$, divergence and inversion of the elliptic operator in
181 equation \ref{eq:elliptic} is coded in
182 \filelink{SOLVE\_FOR\_PRESSURE()}{model-src-solve_for_pressure.F}
183 \item
184 finally, the new flow field at time level $n+1$ given by equations
185 \ref{eq:un+1-rigid-lid} and \ref{eq:vn+1-rigid-lid} is calculated in
186 \filelink{CORRECTION\_STEP()}{model-src-correction_step.F}.
187 \end{itemize}
188 The calling tree for these routines is given in
189 Fig.~\ref{fig:call-tree-pressure-method}.
190
191
192
193 \paragraph{Need to discuss implicit viscosity somewhere:}
194 \begin{eqnarray}
195 \frac{1}{\Delta t} u^{n+1} - \partial_z A_v \partial_z u^{n+1}
196 + g \partial_x \eta^{n+1} & = & \frac{1}{\Delta t} u^{n} +
197 G_u^{(n+1/2)}
198 \\
199 \frac{1}{\Delta t} v^{n+1} - \partial_z A_v \partial_z v^{n+1}
200 + g \partial_y \eta^{n+1} & = & \frac{1}{\Delta t} v^{n} + G_v^{(n+1/2)}
201 \end{eqnarray}
202
203
204 \section{Pressure method with implicit linear free-surface}
205 \label{sect:pressure-method-linear-backward}
206
207 The rigid-lid approximation filters out external gravity waves
208 subsequently modifying the dispersion relation of barotropic Rossby
209 waves. The discrete form of the elliptic equation has some zero
210 eigen-values which makes it a potentially tricky or inefficient
211 problem to solve.
212
213 The rigid-lid approximation can be easily replaced by a linearization
214 of the free-surface equation which can be written:
215 \begin{equation}
216 \partial_t \eta + \partial_x H \widehat{u} + \partial_y H \widehat{v} = P-E+R
217 \label{eq:linear-free-surface=P-E+R}
218 \end{equation}
219 which differs from the depth integrated continuity equation with
220 rigid-lid (\ref{eq:rigid-lid-continuity}) by the time-dependent term
221 and fresh-water source term.
222
223 Equation \ref{eq:discrete-time-cont-rigid-lid} in the rigid-lid
224 pressure method is then replaced by the time discretization of
225 \ref{eq:linear-free-surface=P-E+R} which is:
226 \begin{equation}
227 \eta^{n+1}
228 + \Delta t \partial_x H \widehat{u^{n+1}}
229 + \Delta t \partial_y H \widehat{v^{n+1}}
230 =
231 \eta^{n}
232 + \Delta t ( P - E + R )
233 \label{eq:discrete-time-backward-free-surface}
234 \end{equation}
235 where the use of flow at time level $n+1$ makes the method implicit
236 and backward in time. The is the preferred scheme since it still
237 filters the fast unresolved wave motions by damping them. A centered
238 scheme, such as Crank-Nicholson, would alias the energy of the fast
239 modes onto slower modes of motion.
240
241 As for the rigid-lid pressure method, equations
242 \ref{eq:discrete-time-u}, \ref{eq:discrete-time-v} and
243 \ref{eq:discrete-time-backward-free-surface} can be re-arranged as follows:
244 \begin{eqnarray}
245 u^{*} & = & u^{n} + \Delta t G_u^{(n+1/2)} \label{eq:ustar-backward-free-surface} \\
246 v^{*} & = & v^{n} + \Delta t G_v^{(n+1/2)} \label{eq:vstar-backward-free-surface} \\
247 \eta^* & = & \epsilon_{fs} \left( \eta^{n} +P-E+R \right)- \Delta t
248 \partial_x H \widehat{u^{*}}
249 + \partial_y H \widehat{v^{*}}
250 \\
251 \partial_x g H \partial_x \eta^{n+1}
252 + \partial_y g H \partial_y \eta^{n+1}
253 - \frac{\epsilon_{fs} \eta^{n+1}}{\Delta t^2}
254 & = &
255 - \frac{\eta^*}{\Delta t^2}
256 \label{eq:elliptic-backward-free-surface}
257 \\
258 u^{n+1} & = & u^{*} - \Delta t g \partial_x \eta^{n+1} \label{eq:un+1-backward-free-surface}\\
259 v^{n+1} & = & v^{*} - \Delta t g \partial_y \eta^{n+1} \label{eq:vn+1-backward-free-surface}
260 \end{eqnarray}
261 Equations~\ref{eq:ustar-backward-free-surface}
262 to~\ref{eq:vn+1-backward-free-surface}, solved sequentially, represent
263 the pressure method algorithm with a backward implicit, linearized
264 free surface. The method is still formerly a pressure method because
265 in the limit of large $\Delta t$ the rigid-lid method is
266 recovered. However, the implicit treatment of the free-surface allows
267 the flow to be divergent and for the surface pressure/elevation to
268 respond on a finite time-scale (as opposed to instantly). To recover
269 the rigid-lid formulation, we introduced a switch-like parameter,
270 $\epsilon_{fs}$, which selects between the free-surface and rigid-lid;
271 $\epsilon_{fs}=1$ allows the free-surface to evolve; $\epsilon_{fs}=0$
272 imposes the rigid-lid. The evolution in time and location of variables
273 is exactly as it was for the rigid-lid model so that
274 Fig.~\ref{fig:pressure-method-rigid-lid} is still
275 applicable. Similarly, the calling sequence, given in
276 Fig.~\ref{fig:call-tree-pressure-method}, is as for the
277 pressure-method.
278
279
280 \section{Explicit time-stepping: Adams-Bashforth}
281 \label{sect:adams-bashforth}
282
283 In describing the the pressure method above we deferred describing the
284 time discretization of the explicit terms. We have historically used
285 the quasi-second order Adams-Bashforth method for all explicit terms
286 in both the momentum and tracer equations. This is still the default
287 mode of operation but it is now possible to use alternate schemes for
288 tracers (see section \ref{sect:tracer-advection}).
289
290 \begin{figure}
291 \begin{center} \fbox{ \begin{minipage}{4.5in} \begin{tabbing}
292 aaa \= aaa \= aaa \= aaa \= aaa \= aaa \kill
293 FORWARD\_STEP \\
294 \> THERMODYNAMICS \\
295 \>\> CALC\_GT \\
296 \>\>\> GAD\_CALC\_RHS \` $G_\theta^n = G_\theta( u, \theta^n )$ \\
297 \>\>\> EXTERNAL\_FORCING \` $G_\theta^n = G_\theta^n + {\cal Q}$ \\
298 \>\>\> ADAMS\_BASHFORTH2 \` $G_\theta^{(n+1/2)}$ (\ref{eq:adams-bashforth2}) \\
299 \>\> TIMESTEP\_TRACER \` $\tau^*$ (\ref{eq:taustar}) \\
300 \>\> IMPLDIFF \` $\tau^{(n+1)}$ (\ref{eq:tau-n+1-implicit})
301 \end{tabbing} \end{minipage} } \end{center}
302 \caption{
303 Calling tree for the Adams-Bashforth time-stepping of temperature with
304 implicit diffusion.}
305 \label{fig:call-tree-adams-bashforth}
306 \end{figure}
307
308 In the previous sections, we summarized an explicit scheme as:
309 \begin{equation}
310 \tau^{*} = \tau^{n} + \Delta t G_\tau^{(n+1/2)}
311 \label{eq:taustar}
312 \end{equation}
313 where $\tau$ could be any prognostic variable ($u$, $v$, $\theta$ or
314 $S$) and $\tau^*$ is an explicit estimate of $\tau^{n+1}$ and would be
315 exact if not for implicit-in-time terms. The parenthesis about $n+1/2$
316 indicates that the term is explicit and extrapolated forward in time
317 and for this we use the quasi-second order Adams-Bashforth method:
318 \begin{equation}
319 G_\tau^{(n+1/2)} = ( 3/2 + \epsilon_{AB}) G_\tau^n
320 - ( 1/2 + \epsilon_{AB}) G_\tau^{n-1}
321 \label{eq:adams-bashforth2}
322 \end{equation}
323 This is a linear extrapolation, forward in time, to
324 $t=(n+1/2+{\epsilon_{AB}})\Delta t$. An extrapolation to the mid-point
325 in time, $t=(n+1/2)\Delta t$, corresponding to $\epsilon_{AB}=0$,
326 would be second order accurate but is weakly unstable for oscillatory
327 terms. A small but finite value for $\epsilon_{AB}$ stabilizes the
328 method. Strictly speaking, damping terms such as diffusion and
329 dissipation, and fixed terms (forcing), do not need to be inside the
330 Adams-Bashforth extrapolation. However, in the current code, it is
331 simpler to include these terms and this can be justified if the flow
332 and forcing evolves smoothly. Problems can, and do, arise when forcing
333 or motions are high frequency and this corresponds to a reduced
334 stability compared to a simple forward time-stepping of such terms.
335
336 A stability analysis for an oscillation equation should be given at this point.
337 \marginpar{AJA needs to find his notes on this...}
338
339 A stability analysis for a relaxation equation should be given at this point.
340 \marginpar{...and for this too.}
341
342
343 \section{Implicit time-stepping: backward method}
344
345 Vertical diffusion and viscosity can be treated implicitly in time
346 using the backward method which is an intrinsic scheme. For tracers,
347 the time discretized equation is:
348 \begin{equation}
349 \tau^{n+1} - \Delta t \partial_r \kappa_v \partial_r \tau^{n+1} =
350 \tau^{n} + \Delta t G_\tau^{(n+1/2)}
351 \label{eq:implicit-diffusion}
352 \end{equation}
353 where $G_\tau^{(n+1/2)}$ is the remaining explicit terms extrapolated
354 using the Adams-Bashforth method as described above. Equation
355 \ref{eq:implicit-diffusion} can be split split into:
356 \begin{eqnarray}
357 \tau^* & = & \tau^{n} + \Delta t G_\tau^{(n+1/2)}
358 \label{eq:taustar-implicit} \\
359 \tau^{n+1} & = & {\cal L}_\tau^{-1} ( \tau^* )
360 \label{eq:tau-n+1-implicit}
361 \end{eqnarray}
362 where ${\cal L}_\tau^{-1}$ is the inverse of the operator
363 \begin{equation}
364 {\cal L} = \left[ 1 + \Delta t \partial_r \kappa_v \partial_r \right]
365 \end{equation}
366 Equation \ref{eq:taustar-implicit} looks exactly as \ref{eq:taustar}
367 while \ref{eq:tau-n+1-implicit} involves an operator or matrix
368 inversion. By re-arranging \ref{eq:implicit-diffusion} in this way we
369 have cast the method as an explicit prediction step and an implicit
370 step allowing the latter to be inserted into the over all algorithm
371 with minimal interference.
372
373 Fig.~\ref{fig:call-tree-adams-bashforth} shows the calling sequence for
374 stepping forward a tracer variable such as temperature.
375
376 In order to fit within the pressure method, the implicit viscosity
377 must not alter the barotropic flow. In other words, it can on ly
378 redistribute momentum in the vertical. The upshot of this is that
379 although vertical viscosity may be backward implicit and
380 unconditionally stable, no-slip boundary conditions may not be made
381 implicit and are thus cast as a an explicit drag term.
382
383 \section{Synchronous time-stepping: variables co-located in time}
384 \label{sect:adams-bashforth-sync}
385
386 \begin{figure}
387 \begin{center}
388 \resizebox{5.0in}{!}{\includegraphics{part2/adams-bashforth-sync.eps}}
389 \end{center}
390 \caption{
391 A schematic of the explicit Adams-Bashforth and implicit time-stepping
392 phases of the algorithm. All prognostic variables are co-located in
393 time. Explicit tendencies are evaluated at time level $n$ as a
394 function of the state at that time level (dotted arrow). The explicit
395 tendency from the previous time level, $n-1$, is used to extrapolate
396 tendencies to $n+1/2$ (dashed arrow). This extrapolated tendency
397 allows variables to be stably integrated forward-in-time to render an
398 estimate ($*$-variables) at the $n+1$ time level (solid
399 arc-arrow). The operator ${\cal L}$ formed from implicit-in-time terms
400 is solved to yield the state variables at time level $n+1$. }
401 \label{fig:adams-bashforth-sync}
402 \end{figure}
403
404 \begin{figure}
405 \begin{center} \fbox{ \begin{minipage}{4.5in} \begin{tabbing}
406 aaa \= aaa \= aaa \= aaa \= aaa \= aaa \kill
407 FORWARD\_STEP \\
408 \> THERMODYNAMICS \\
409 \>\> CALC\_GT \\
410 \>\>\> GAD\_CALC\_RHS \` $G_\theta^n = G_\theta( u, \theta^n )$ (\ref{eq:Gt-n-sync})\\
411 \>\>\> EXTERNAL\_FORCING \` $G_\theta^n = G_\theta^n + {\cal Q}$ \\
412 \>\>\> ADAMS\_BASHFORTH2 \` $G_\theta^{(n+1/2)}$ (\ref{eq:Gt-n+5-sync}) \\
413 \>\> TIMESTEP\_TRACER \` $\tau^*$ (\ref{eq:tstar-sync}) \\
414 \>\> IMPLDIFF \` $\tau^{(n+1)}$ (\ref{eq:t-n+1-sync}) \\
415 \> DYNAMICS \\
416 \>\> CALC\_PHI\_HYD \` $\phi_{hyd}^n$ (\ref{eq:phi-hyd-sync}) \\
417 \>\> MOM\_FLUXFORM or MOM\_VECINV \` $G_{\vec{\bf v}}^n$ (\ref{eq:Gv-n-sync})\\
418 \>\> TIMESTEP \` $\vec{\bf v}^*$ (\ref{eq:Gv-n+5-sync}, \ref{eq:vstar-sync}) \\
419 \>\> IMPLDIFF \` $\vec{\bf v}^{**}$ (\ref{eq:vstarstar-sync}) \\
420 \> SOLVE\_FOR\_PRESSURE \\
421 \>\> CALC\_DIV\_GHAT \` $\eta^*$ (\ref{eq:nstar-sync}) \\
422 \>\> CG2D \` $\eta^{n+1}$ (\ref{eq:elliptic-sync}) \\
423 \> THE\_CORRECTION\_STEP \\
424 \>\> CALC\_GRAD\_PHI\_SURF \` $\nabla \eta^{n+1}$ \\
425 \>\> CORRECTION\_STEP \` $u^{n+1}$,$v^{n+1}$ (\ref{eq:v-n+1-sync})
426 \end{tabbing} \end{minipage} } \end{center}
427 \caption{
428 Calling tree for the overall synchronous algorithm using
429 Adams-Bashforth time-stepping.}
430 \label{fig:call-tree-adams-bashforth-sync}
431 \end{figure}
432
433 The Adams-Bashforth extrapolation of explicit tendencies fits neatly
434 into the pressure method algorithm when all state variables are
435 co-located in time. Fig.~\ref{fig:adams-bashforth-sync} illustrates
436 the location of variables in time and the evolution of the algorithm
437 with time. The algorithm can be represented by the sequential solution
438 of the follow equations:
439 \begin{eqnarray}
440 G_{\theta,S}^{n} & = & G_{\theta,S} ( u^n, \theta^n, S^n )
441 \label{eq:Gt-n-sync} \\
442 G_{\theta,S}^{(n+1/2)} & = & (3/2+\epsilon_{AB}) G_{\theta,S}^{n}-(1/2+\epsilon_{AB}) G_{\theta,S}^{n-1}
443 \label{eq:Gt-n+5-sync} \\
444 (\theta^*,S^*) & = & (\theta^{n},S^{n}) + \Delta t G_{\theta,S}^{(n+1/2)}
445 \label{eq:tstar-sync} \\
446 (\theta^{n+1},S^{n+1}) & = & {\cal L}^{-1}_{\theta,S} (\theta^*,S^*)
447 \label{eq:t-n+1-sync} \\
448 \phi^n_{hyd} & = & \int b(\theta^n,S^n) dr
449 \label{eq:phi-hyd-sync} \\
450 \vec{\bf G}_{\vec{\bf v}}^{n} & = & \vec{\bf G}_{\vec{\bf v}} ( \vec{\bf v}^n, \phi^n_{hyd} )
451 \label{eq:Gv-n-sync} \\
452 \vec{\bf G}_{\vec{\bf v}}^{(n+1/2)} & = & (3/2 + \epsilon_{AB} ) \vec{\bf G}_{\vec{\bf v}}^{n} - (1/2 + \epsilon_{AB} ) \vec{\bf G}_{\vec{\bf v}}^{n-1}
453 \label{eq:Gv-n+5-sync} \\
454 \vec{\bf v}^{*} & = & \vec{\bf v}^{n} + \Delta t \vec{\bf G}_{\vec{\bf v}}^{(n+1/2)}
455 \label{eq:vstar-sync} \\
456 \vec{\bf v}^{**} & = & {\cal L}_{\vec{\bf v}}^{-1} ( \vec{\bf v}^* )
457 \label{eq:vstarstar-sync} \\
458 \eta^* & = & \epsilon_{fs} \left( \eta^{n} +P-E+R \right)- \Delta t
459 \nabla \cdot H \widehat{ \vec{\bf v}^{**} }
460 \label{eq:nstar-sync} \\
461 \nabla \cdot g H \nabla \eta^{n+1} - \frac{\epsilon_{fs} \eta^{n+1}}{\Delta t^2}
462 & = & - \frac{\eta^*}{\Delta t^2}
463 \label{eq:elliptic-sync} \\
464 \vec{\bf v}^{n+1} & = & \vec{\bf v}^{*} - \Delta t g \nabla \eta^{n+1}
465 \label{eq:v-n+1-sync}
466 \end{eqnarray}
467 Fig.~\ref{fig:adams-bashforth-sync} illustrates the location of
468 variables in time and evolution of the algorithm with time. The
469 Adams-Bashforth extrapolation of the tracer tendencies is illustrated
470 by the dashed arrow, the prediction at $n+1$ is indicated by the
471 solid arc. Inversion of the implicit terms, ${\cal
472 L}^{-1}_{\theta,S}$, then yields the new tracer fields at $n+1$. All
473 these operations are carried out in subroutine {\em THERMODYNAMICS} an
474 subsidiaries, which correspond to equations \ref{eq:Gt-n-sync} to
475 \ref{eq:t-n+1-sync}.
476 Similarly illustrated is the Adams-Bashforth extrapolation of
477 accelerations, stepping forward and solving of implicit viscosity and
478 surface pressure gradient terms, corresponding to equations
479 \ref{eq:Gv-n-sync} to \ref{eq:v-n+1-sync}.
480 These operations are carried out in subroutines {\em DYNAMCIS}, {\em
481 SOLVE\_FOR\_PRESSURE} and {\em THE\_CORRECTION\_STEP}. This, then,
482 represents an entire algorithm for stepping forward the model one
483 time-step. The corresponding calling tree is given in
484 \ref{fig:call-tree-adams-bashforth-sync}.
485
486 \section{Staggered baroclinic time-stepping}
487 \label{sect:adams-bashforth-staggered}
488
489 \begin{figure}
490 \begin{center}
491 \resizebox{5.5in}{!}{\includegraphics{part2/adams-bashforth-staggered.eps}}
492 \end{center}
493 \caption{
494 A schematic of the explicit Adams-Bashforth and implicit time-stepping
495 phases of the algorithm but with staggering in time of thermodynamic
496 variables with the flow. Explicit thermodynamics tendencies are
497 evaluated at time level $n-1/2$ as a function of the thermodynamics
498 state at that time level $n$ and flow at time $n$ (dotted arrow). The
499 explicit tendency from the previous time level, $n-3/2$, is used to
500 extrapolate tendencies to $n$ (dashed arrow). This extrapolated
501 tendency allows thermo-dynamics variables to be stably integrated
502 forward-in-time to render an estimate ($*$-variables) at the $n+1/2$
503 time level (solid arc-arrow). The implicit-in-time operator ${\cal
504 L_{\theta,S}}$ is solved to yield the thermodynamic variables at time
505 level $n+1/2$. These are then used to calculate the hydrostatic
506 pressure/geo-potential, $\phi_{hyd}$ (vertical arrows). The
507 hydrostatic pressure gradient is evaluated directly an time level
508 $n+1/2$ in stepping forward the flow variables from $n$ to $n+1$
509 (solid arc-arrow). }
510 \label{fig:adams-bashforth-staggered}
511 \end{figure}
512
513 For well stratified problems, internal gravity waves may be the
514 limiting process for determining a stable time-step. In the
515 circumstance, it is more efficient to stagger in time the
516 thermodynamic variables with the flow
517 variables. Fig.~\ref{fig:adams-bashforth-staggered} illustrates the
518 staggering and algorithm. The key difference between this and
519 Fig.~\ref{fig:adams-bashforth-sync} is that the new thermodynamics
520 fields are used to compute the hydrostatic pressure at time level
521 $n+1/2$. The essentially allows the gravity wave terms to leap-frog in
522 time giving second order accuracy and more stability.
523
524 The essential change in the staggered algorithm is the calculation of
525 hydrostatic pressure which, in the context of the synchronous
526 algorithm involves replacing equation \ref{eq:phi-hyd-sync} with
527 \begin{displaymath}
528 \phi_{hyd}^n = \int b(\theta^{n+1},S^{n+1}) dr
529 \end{displaymath}
530 but the pressure gradient must also be taken out of the
531 Adams-Bashforth extrapolation. Also, retaining the integer time-levels,
532 $n$ and $n+1$, does not give a user the sense of where variables are
533 located in time. Instead, we re-write the entire algorithm,
534 \ref{eq:Gt-n-sync} to \ref{eq:v-n+1-sync}, annotating the
535 position in time of variables appropriately:
536 \begin{eqnarray}
537 G_{\theta,S}^{n-1/2} & = & G_{\theta,S} ( u^n, \theta^{n-1/2}, S^{n-1/2} )
538 \label{eq:Gt-n-staggered} \\
539 G_{\theta,S}^{(n)} & = & (3/2+\epsilon_{AB}) G_{\theta,S}^{n-1/2}-(1/2+\epsilon_{AB}) G_{\theta,S}^{n-3/2}
540 \label{eq:Gt-n+5-staggered} \\
541 (\theta^*,S^*) & = & (\theta^{n},S^{n}) + \Delta t G_{\theta,S}^{(n)}
542 \label{eq:tstar-staggered} \\
543 (\theta^{n+1/2},S^{n+1/2}) & = & {\cal L}^{-1}_{\theta,S} (\theta^*,S^*)
544 \label{eq:t-n+1-staggered} \\
545 \phi^{n+1/2}_{hyd} & = & \int b(\theta^{n+1/2},S^{n+1/2}) dr
546 \label{eq:phi-hyd-staggered} \\
547 \vec{\bf G}_{\vec{\bf v}}^{n} & = & \vec{\bf G}_{\vec{\bf v}} ( \vec{\bf v}^n )
548 \label{eq:Gv-n-staggered} \\
549 \vec{\bf G}_{\vec{\bf v}}^{(n+1/2)} & = & (3/2 + \epsilon_{AB} ) \vec{\bf G}_{\vec{\bf v}}^{n} - (1/2 + \epsilon_{AB} ) \vec{\bf G}_{\vec{\bf v}}^{n-1}
550 \label{eq:Gv-n+5-staggered} \\
551 \vec{\bf v}^{*} & = & \vec{\bf v}^{n} + \Delta t \left( \vec{\bf G}_{\vec{\bf v}}^{(n+1/2)} - \nabla \phi_{hyd}^{n+1/2} \right)
552 \label{eq:vstar-staggered} \\
553 \vec{\bf v}^{**} & = & {\cal L}_{\vec{\bf v}}^{-1} ( \vec{\bf v}^* )
554 \label{eq:vstarstar-staggered} \\
555 \eta^* & = & \epsilon_{fs} \left( \eta^{n} +P-E+R \right)- \Delta t
556 \nabla \cdot H \widehat{ \vec{\bf v}^{**} }
557 \label{eq:nstar-staggered} \\
558 \nabla \cdot g H \nabla \eta^{n+1} - \frac{\epsilon_{fs} \eta^{n+1}}{\Delta t^2}
559 & = & - \frac{\eta^*}{\Delta t^2}
560 \label{eq:elliptic-staggered} \\
561 \vec{\bf v}^{n+1} & = & \vec{\bf v}^{*} - \Delta t g \nabla \eta^{n+1}
562 \label{eq:v-n+1-staggered}
563 \end{eqnarray}
564 The calling sequence is unchanged from
565 Fig.~\ref{fig:call-tree-adams-bashforth-sync}. The staggered algorithm
566 is activated with the run-time flag {\bf staggerTimeStep=.TRUE.} in
567 {\em PARM01} of {\em data}.
568
569 The only difficulty with this approach is apparent in equation
570 \ref{eq:Gt-n-staggered} and illustrated by the dotted arrow
571 connecting $u,v^n$ with $G_\theta^{n-1/2}$. The flow used to advect
572 tracers around is not naturally located in time. This could be avoided
573 by applying the Adams-Bashforth extrapolation to the tracer field
574 itself and advecting that around but this approach is not yet
575 available. We're not aware of any detrimental effect of this
576 feature. The difficulty lies mainly in interpretation of what
577 time-level variables and terms correspond to.
578
579
580 \section{Non-hydrostatic formulation}
581 \label{sect:non-hydrostatic}
582
583 The non-hydrostatic formulation re-introduces the full vertical
584 momentum equation and requires the solution of a 3-D elliptic
585 equations for non-hydrostatic pressure perturbation. We still
586 intergrate vertically for the hydrostatic pressure and solve a 2-D
587 elliptic equation for the surface pressure/elevation for this reduces
588 the amount of work needed to solve for the non-hydrostatic pressure.
589
590 The momentum equations are discretized in time as follows:
591 \begin{eqnarray}
592 \frac{1}{\Delta t} u^{n+1} + g \partial_x \eta^{n+1} + \partial_x \phi_{nh}^{n+1}
593 & = & \frac{1}{\Delta t} u^{n} + G_u^{(n+1/2)} \label{eq:discrete-time-u-nh} \\
594 \frac{1}{\Delta t} v^{n+1} + g \partial_y \eta^{n+1} + \partial_y \phi_{nh}^{n+1}
595 & = & \frac{1}{\Delta t} v^{n} + G_v^{(n+1/2)} \label{eq:discrete-time-v-nh} \\
596 \frac{1}{\Delta t} w^{n+1} + \partial_r \phi_{nh}^{n+1}
597 & = & \frac{1}{\Delta t} w^{n} + G_w^{(n+1/2)} \label{eq:discrete-time-w-nh} \\
598 \end{eqnarray}
599 which must satisfy the discrete-in-time depth integrated continuity,
600 equation~\ref{eq:discrete-time-backward-free-surface} and the local continuity equation
601 \begin{equation}
602 \partial_x u^{n+1} + \partial_y v^{n+1} + \partial_r w^{n+1} = 0
603 \label{eq:non-divergence-nh}
604 \end{equation}
605 As before, the explicit predictions for momentum are consolidated as:
606 \begin{eqnarray*}
607 u^* & = & u^n + \Delta t G_u^{(n+1/2)} \\
608 v^* & = & v^n + \Delta t G_v^{(n+1/2)} \\
609 w^* & = & w^n + \Delta t G_w^{(n+1/2)}
610 \end{eqnarray*}
611 but this time we introduce an intermediate step by splitting the
612 tendancy of the flow as follows:
613 \begin{eqnarray}
614 u^{n+1} = u^{**} - \Delta t \partial_x \phi_{nh}^{n+1}
615 & &
616 u^{**} = u^{*} - \Delta t g \partial_x \eta^{n+1} \\
617 v^{n+1} = v^{**} - \Delta t \partial_y \phi_{nh}^{n+1}
618 & &
619 v^{**} = v^{*} - \Delta t g \partial_y \eta^{n+1}
620 \end{eqnarray}
621 Substituting into the depth integrated continuity
622 (equation~\ref{eq:discrete-time-backward-free-surface}) gives
623 \begin{equation}
624 \partial_x H \partial_x \left( g \eta^{n+1} + \widehat{\phi}_{nh}^{n+1} \right)
625 +
626 \partial_y H \partial_y \left( g \eta^{n+1} + \widehat{\phi}_{nh}^{n+1} \right)
627 - \frac{\epsilon_{fs}\eta^*}{\Delta t^2}
628 = - \frac{\eta^*}{\Delta t^2}
629 \end{equation}
630 which is approximated by equation
631 \ref{eq:elliptic-backward-free-surface} on the basis that i)
632 $\phi_{nh}^{n+1}$ is not yet known and ii) $\nabla \widehat{\phi}_{nh}
633 << g \nabla \eta$. If \ref{eq:elliptic-backward-free-surface} is
634 solved accurately then the implication is that $\widehat{\phi}_{nh}
635 \approx 0$ so that thet non-hydrostatic pressure field does not drive
636 barotropic motion.
637
638 The flow must satisfy non-divergence
639 (equation~\ref{eq:non-divergence-nh}) locally, as well as depth
640 integrated, and this constraint is used to form a 3-D elliptic
641 equations for $\phi_{nh}^{n+1}$:
642 \begin{equation}
643 \partial_{xx} \phi_{nh}^{n+1} + \partial_{yy} \phi_{nh}^{n+1} +
644 \partial_{rr} \phi_{nh}^{n+1} =
645 \partial_x u^{**} + \partial_y v^{**} + \partial_r w^{*}
646 \end{equation}
647
648 The entire algorithm can be summarized as the sequential solution of
649 the following equations:
650 \begin{eqnarray}
651 u^{*} & = & u^{n} + \Delta t G_u^{(n+1/2)} \label{eq:ustar-nh} \\
652 v^{*} & = & v^{n} + \Delta t G_v^{(n+1/2)} \label{eq:vstar-nh} \\
653 w^{*} & = & w^{n} + \Delta t G_w^{(n+1/2)} \label{eq:wstar-nh} \\
654 \eta^* & = & \epsilon_{fs} \left( \eta^{n} +P-E+R \right)- \Delta t
655 \partial_x H \widehat{u^{*}}
656 + \partial_y H \widehat{v^{*}}
657 \\
658 \partial_x g H \partial_x \eta^{n+1}
659 + \partial_y g H \partial_y \eta^{n+1}
660 - \frac{\epsilon_{fs} \eta^{n+1}}{\Delta t^2}
661 & = &
662 - \frac{\eta^*}{\Delta t^2}
663 \label{eq:elliptic-nh}
664 \\
665 u^{**} & = & u^{*} - \Delta t g \partial_x \eta^{n+1} \label{eq:unx-nh}\\
666 v^{**} & = & v^{*} - \Delta t g \partial_y \eta^{n+1} \label{eq:vnx-nh}\\
667 \partial_{xx} \phi_{nh}^{n+1} + \partial_{yy} \phi_{nh}^{n+1} +
668 \partial_{rr} \phi_{nh}^{n+1} & = &
669 \partial_x u^{**} + \partial_y v^{**} + \partial_r w^{*} \\
670 u^{n+1} & = & u^{**} - \Delta t \partial_x \phi_{nh}^{n+1} \label{eq:un+1-nh}\\
671 v^{n+1} & = & v^{**} - \Delta t \partial_y \phi_{nh}^{n+1} \label{eq:vn+1-nh}\\
672 \partial_r w^{n+1} & = & - \partial_x u^{n+1} - \partial_y v^{n+1}
673 \end{eqnarray}
674 where the last equation is solved by vertically integrating for
675 $w^{n+1}$.
676
677
678
679 \section{Variants on the Free Surface}
680
681 We now describe the various formulations of the free-surface that
682 include non-linear forms, implicit in time using Crank-Nicholson,
683 explicit and [one day] split-explicit. First, we'll reiterate the
684 underlying algorithm but this time using the notation consistent with
685 the more general vertical coordinate $r$. The elliptic equation for
686 free-surface coordinate (units of $r$), corresponding to
687 \ref{eq:discrete-time-backward-free-surface}, and
688 assuming no non-hydrostatic effects ($\epsilon_{nh} = 0$) is:
689 \begin{eqnarray}
690 \epsilon_{fs} {\eta}^{n+1} -
691 {\bf \nabla}_h \cdot \Delta t^2 (R_o-R_{fixed}) {\bf \nabla}_h b_s
692 {\eta}^{n+1} = {\eta}^*
693 \label{eq-solve2D}
694 \end{eqnarray}
695 where
696 \begin{eqnarray}
697 {\eta}^* = \epsilon_{fs} \: {\eta}^{n} -
698 \Delta t {\bf \nabla}_h \cdot \int_{R_{fixed}}^{R_o} \vec{\bf v}^* dr
699 \: + \: \epsilon_{fw} \Delta_t (P-E)^{n}
700 \label{eq-solve2D_rhs}
701 \end{eqnarray}
702
703 \fbox{ \begin{minipage}{4.75in}
704 {\em S/R SOLVE\_FOR\_PRESSURE} ({\em solve\_for\_pressure.F})
705
706 $u^*$: {\bf GuNm1} ({\em DYNVARS.h})
707
708 $v^*$: {\bf GvNm1} ({\em DYNVARS.h})
709
710 $\eta^*$: {\bf cg2d\_b} (\em SOLVE\_FOR\_PRESSURE.h)
711
712 $\eta^{n+1}$: {\bf etaN} (\em DYNVARS.h)
713
714 \end{minipage} }
715
716
717 Once ${\eta}^{n+1}$ has been found, substituting into
718 \ref{eq:discrete-time-u,eq:discrete-time-v} yields $\vec{\bf v}^{n+1}$ if the model is
719 hydrostatic ($\epsilon_{nh}=0$):
720 $$
721 \vec{\bf v}^{n+1} = \vec{\bf v}^{*}
722 - \Delta t {\bf \nabla}_h b_s {\eta}^{n+1}
723 $$
724
725 This is known as the correction step. However, when the model is
726 non-hydrostatic ($\epsilon_{nh}=1$) we need an additional step and an
727 additional equation for $\phi'_{nh}$. This is obtained by substituting
728 \ref{eq:discrete-time-u-nh}, \ref{eq:discrete-time-v-nh} and \ref{eq:discrete-time-w-nh}
729 into continuity:
730 \begin{equation}
731 \left[ {\bf \nabla}_h^2 + \partial_{rr} \right] {\phi'_{nh}}^{n+1}
732 = \frac{1}{\Delta t} \left(
733 {\bf \nabla}_h \cdot \vec{\bf v}^{**} + \partial_r \dot{r}^* \right)
734 \end{equation}
735 where
736 \begin{displaymath}
737 \vec{\bf v}^{**} = \vec{\bf v}^* - \Delta t {\bf \nabla}_h b_s {\eta}^{n+1}
738 \end{displaymath}
739 Note that $\eta^{n+1}$ is also used to update the second RHS term
740 $\partial_r \dot{r}^* $ since
741 the vertical velocity at the surface ($\dot{r}_{surf}$)
742 is evaluated as $(\eta^{n+1} - \eta^n) / \Delta t$.
743
744 Finally, the horizontal velocities at the new time level are found by:
745 \begin{equation}
746 \vec{\bf v}^{n+1} = \vec{\bf v}^{**}
747 - \epsilon_{nh} \Delta t {\bf \nabla}_h {\phi'_{nh}}^{n+1}
748 \end{equation}
749 and the vertical velocity is found by integrating the continuity
750 equation vertically. Note that, for the convenience of the restart
751 procedure, the vertical integration of the continuity equation has
752 been moved to the beginning of the time step (instead of at the end),
753 without any consequence on the solution.
754
755 \fbox{ \begin{minipage}{4.75in}
756 {\em S/R CORRECTION\_STEP} ({\em correction\_step.F})
757
758 $\eta^{n+1}$: {\bf etaN} (\em DYNVARS.h)
759
760 $\phi_{nh}^{n+1}$: {\bf phi\_nh} (\em DYNVARS.h)
761
762 $u^*$: {\bf GuNm1} ({\em DYNVARS.h})
763
764 $v^*$: {\bf GvNm1} ({\em DYNVARS.h})
765
766 $u^{n+1}$: {\bf uVel} ({\em DYNVARS.h})
767
768 $v^{n+1}$: {\bf vVel} ({\em DYNVARS.h})
769
770 \end{minipage} }
771
772
773
774 Regarding the implementation of the surface pressure solver, all
775 computation are done within the routine {\it SOLVE\_FOR\_PRESSURE} and
776 its dependent calls. The standard method to solve the 2D elliptic
777 problem (\ref{eq-solve2D}) uses the conjugate gradient method (routine
778 {\it CG2D}); the solver matrix and conjugate gradient operator are
779 only function of the discretized domain and are therefore evaluated
780 separately, before the time iteration loop, within {\it INI\_CG2D}.
781 The computation of the RHS $\eta^*$ is partly done in {\it
782 CALC\_DIV\_GHAT} and in {\it SOLVE\_FOR\_PRESSURE}.
783
784 The same method is applied for the non hydrostatic part, using a
785 conjugate gradient 3D solver ({\it CG3D}) that is initialized in {\it
786 INI\_CG3D}. The RHS terms of 2D and 3D problems are computed together
787 at the same point in the code.
788
789
790
791 \subsection{Crank-Nickelson barotropic time stepping}
792
793 The full implicit time stepping described previously is
794 unconditionally stable but damps the fast gravity waves, resulting in
795 a loss of potential energy. The modification presented now allows one
796 to combine an implicit part ($\beta,\gamma$) and an explicit part
797 ($1-\beta,1-\gamma$) for the surface pressure gradient ($\beta$) and
798 for the barotropic flow divergence ($\gamma$).
799 \\
800 For instance, $\beta=\gamma=1$ is the previous fully implicit scheme;
801 $\beta=\gamma=1/2$ is the non damping (energy conserving), unconditionally
802 stable, Crank-Nickelson scheme; $(\beta,\gamma)=(1,0)$ or $=(0,1)$
803 corresponds to the forward - backward scheme that conserves energy but is
804 only stable for small time steps.\\
805 In the code, $\beta,\gamma$ are defined as parameters, respectively
806 {\it implicSurfPress}, {\it implicDiv2DFlow}. They are read from
807 the main data file "{\it data}" and are set by default to 1,1.
808
809 Equations \ref{eq:ustar-backward-free-surface} --
810 \ref{eq:vn+1-backward-free-surface} are modified as follows:
811 $$
812 \frac{ \vec{\bf v}^{n+1} }{ \Delta t }
813 + {\bf \nabla}_h b_s [ \beta {\eta}^{n+1} + (1-\beta) {\eta}^{n} ]
814 + \epsilon_{nh} {\bf \nabla}_h {\phi'_{nh}}^{n+1}
815 = \frac{ \vec{\bf v}^* }{ \Delta t }
816 $$
817 $$
818 \epsilon_{fs} \frac{ {\eta}^{n+1} - {\eta}^{n} }{ \Delta t}
819 + {\bf \nabla}_h \cdot \int_{R_{fixed}}^{R_o}
820 [ \gamma \vec{\bf v}^{n+1} + (1-\gamma) \vec{\bf v}^{n}] dr
821 = \epsilon_{fw} (P-E)
822 $$
823 where:
824 \begin{eqnarray*}
825 \vec{\bf v}^* & = &
826 \vec{\bf v} ^{n} + \Delta t \vec{\bf G}_{\vec{\bf v}} ^{(n+1/2)}
827 + (\beta-1) \Delta t {\bf \nabla}_h b_s {\eta}^{n}
828 + \Delta t {\bf \nabla}_h {\phi'_{hyd}}^{(n+1/2)}
829 \\
830 {\eta}^* & = &
831 \epsilon_{fs} {\eta}^{n} + \epsilon_{fw} \Delta t (P-E)
832 - \Delta t {\bf \nabla}_h \cdot \int_{R_{fixed}}^{R_o}
833 [ \gamma \vec{\bf v}^* + (1-\gamma) \vec{\bf v}^{n}] dr
834 \end{eqnarray*}
835 \\
836 In the hydrostatic case ($\epsilon_{nh}=0$), allowing us to find
837 ${\eta}^{n+1}$, thus:
838 $$
839 \epsilon_{fs} {\eta}^{n+1} -
840 {\bf \nabla}_h \cdot \beta\gamma \Delta t^2 b_s (R_o - R_{fixed})
841 {\bf \nabla}_h {\eta}^{n+1}
842 = {\eta}^*
843 $$
844 and then to compute (correction step):
845 $$
846 \vec{\bf v}^{n+1} = \vec{\bf v}^{*}
847 - \beta \Delta t {\bf \nabla}_h b_s {\eta}^{n+1}
848 $$
849
850 The non-hydrostatic part is solved as described previously.
851
852 Note that:
853 \begin{enumerate}
854 \item The non-hydrostatic part of the code has not yet been
855 updated, so that this option cannot be used with $(\beta,\gamma) \neq (1,1)$.
856 \item The stability criteria with Crank-Nickelson time stepping
857 for the pure linear gravity wave problem in cartesian coordinates is:
858 \begin{itemize}
859 \item $\beta + \gamma < 1$ : unstable
860 \item $\beta \geq 1/2$ and $ \gamma \geq 1/2$ : stable
861 \item $\beta + \gamma \geq 1$ : stable if
862 $$
863 c_{max}^2 (\beta - 1/2)(\gamma - 1/2) + 1 \geq 0
864 $$
865 $$
866 \mbox{with }~
867 %c^2 = 2 g H {\Delta t}^2
868 %(\frac{1-cos 2 \pi / k}{\Delta x^2}
869 %+\frac{1-cos 2 \pi / l}{\Delta y^2})
870 %$$
871 %Practically, the most stringent condition is obtained with $k=l=2$ :
872 %$$
873 c_{max} = 2 \Delta t \: \sqrt{g H} \:
874 \sqrt{ \frac{1}{\Delta x^2} + \frac{1}{\Delta y^2} }
875 $$
876 \end{itemize}
877 \end{enumerate}
878

  ViewVC Help
Powered by ViewVC 1.1.22