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

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

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

revision 1.1.1.1 by adcroft, Wed Aug 8 16:15:16 2001 UTC revision 1.17 by jmc, Wed Oct 13 18:50:54 2004 UTC
# Line 1  Line 1 
1  % $Header$  % $Header$
2  % $Name$  % $Name$
3    
4  The convention used in this section is as follows:  This chapter lays out the numerical schemes that are
5  Time is "discretize" using a time step $\Delta t$    employed in the core MITgcm algorithm. Whenever possible
6  and $\Phi^n$ refers to the variable $\Phi$  links are made to actual program code in the MITgcm implementation.
7  at time $t = n \Delta t$ . We used the notation $\Phi^{(n)}$  The chapter begins with a discussion of the temporal discretization
8  when time interpolation is required to estimate the value of $\phi$  used in MITgcm. This discussion is followed by sections that
9  at the time $n \Delta t$.  describe the spatial discretization. The schemes employed for momentum
10    terms are described first, afterwards the schemes that apply to
11  \section{Time Integration}  passive and dynamically active tracers are described.
12    
13  The discretization in time of the model equations (cf section I )  
14  does not depend of the discretization in space of each  \section{Time-stepping}
15  term, so that this section can be read independently.  The equations of motion integrated by the model involve four
16  Also for this purpose, we will refers to the continuous  prognostic equations for flow, $u$ and $v$, temperature, $\theta$, and
17  space-derivative form of model equations, and focus on  salt/moisture, $S$, and three diagnostic equations for vertical flow,
18  the time discretization.  $w$, density/buoyancy, $\rho$/$b$, and pressure/geo-potential,
19    $\phi_{hyd}$. In addition, the surface pressure or height may by
20  The continuous form of the model equations is:  described by either a prognostic or diagnostic equation and if
21    non-hydrostatics terms are included then a diagnostic equation for
22  \begin{eqnarray}  non-hydrostatic pressure is also solved. The combination of prognostic
23  \partial_t \theta & = & G_\theta  and diagnostic equations requires a model algorithm that can march
24  \\  forward prognostic variables while satisfying constraints imposed by
25  \partial_t S & = & G_s  diagnostic equations.
26  \\  
27  b' & = & b'(\theta,S,r)  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  \partial_r \phi'_{hyd} & = & -b'  along with all the switches and optional terms. Instead, we present
30  \label{eq-r-split-hyd}  the algorithm for each of the basic formulations which are:
31  \\  \begin{enumerate}
32  \partial_t \vec{\bf v}  \item the semi-implicit pressure method for hydrostatic equations
33  + {\bf \nabla}_r B_o \eta  with a rigid-lid, variables co-located in time and with
34  + \epsilon_{nh} {\bf \nabla}_r \phi'_{nh}  Adams-Bashforth time-stepping, \label{it:a}
35  & = & \vec{\bf G}_{\vec{\bf v}}  \item as \ref{it:a}. but with an implicit linear free-surface, \label{it:b}
36  - {\bf \nabla}_r \phi'_{hyd}  \item as \ref{it:a}. or \ref{it:b}. but with variables staggered in time,
37  \label{eq-r-split-hmom}  \label{it:c}
38  \\  \item as \ref{it:a}. or \ref{it:b}. but with non-hydrostatic terms included,
39  \epsilon_{nh} \frac {\partial{\dot{r}}}{\partial{t}}  \item as \ref{it:b}. or \ref{it:c}. but with non-linear free-surface.
40  + \epsilon_{nh} \partial_r \phi'_{nh}  \end{enumerate}
41  & = & \epsilon_{nh} G_{\dot{r}}  
42  \label{eq-r-split-rdot}  In all the above configurations it is also possible to substitute the
43  \\  Adams-Bashforth with an alternative time-stepping scheme for terms
44  {\bf \nabla}_r \cdot \vec{\bf v} + \partial_r \dot{r}  evaluated explicitly in time. Since the over-arching algorithm is
45  & = & 0  independent of the particular time-stepping scheme chosen we will
46  \label{eq-r-cont}  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    \> MOMENTUM\_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}  \end{eqnarray}
107  where  where we are adopting the oceanic notation for brevity. All terms in
108  \begin{eqnarray*}  the momentum equations, except for surface pressure gradient, are
109  G_\theta & = &  encapsulated in the $G$ vector. The continuity equation, when
110  - \vec{\bf v} \cdot {\bf \nabla}_r \theta + {\cal Q}_\theta  integrated over the fluid depth, $H$, and with the rigid-lid/no normal
111  \\  flow boundary conditions applied, becomes:
112  G_S & = &  \begin{equation}
113  - \vec{\bf v} \cdot {\bf \nabla}_r S + {\cal Q}_S  \partial_x H \widehat{u} + \partial_y H \widehat{v} = 0
114  \\  \label{eq:rigid-lid-continuity}
115  \vec{\bf G}_{\vec{\bf v}}  \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  - \vec{\bf v} \cdot {\bf \nabla}_r \vec{\bf v}    \partial_x H \widehat{u^{*}}
156  - f \hat{\bf k} \wedge \vec{\bf v}  + \partial_y H \widehat{v^{*}} \label{eq:elliptic}
 + \vec{\cal F}_{\vec{\bf v}}  
157  \\  \\
158  G_{\dot{r}}  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  - \vec{\bf v} \cdot {\bf \nabla}_r \dot{r}  \end{eqnarray}
161  + {\cal F}_{\dot{r}}  Equations \ref{eq:ustar-rigid-lid} to \ref{eq:vn+1-rigid-lid}, solved
162  \end{eqnarray*}  sequentially, represent the pressure method algorithm used in the
163  The exact form of all the "{\it G}"s terms is described in the next  model. The essence of the pressure method lies in the fact that any
164  section (). Here its sufficient to mention that they contains  explicit prediction for the flow would lead to a divergence flow field
165  all the RHS terms except the pressure / geo- potential terms.  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 switch $\epsilon_{nh}$ allows to activate the non hydrostatic  the pressure field is somewhat ambiguous; in
168  mode ($\epsilon_{nh}=1$) for the ocean model. Otherwise,  Fig.~\ref{fig:pressure-method-rigid-lid} we depicted as co-located
169  in the hydrostatic limit $\epsilon_{nh} = 0$ and the 3rd equation vanishes.  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  The equation for $\eta$ is obtained by integrating the  
172  continuity equation over the entire depth of the fluid,  The correspondence to the code is as follows:
173  from $R_{min}(x,y)$ up to $R_o(x,y)$  \begin{itemize}
174  (Linear free surface):  \item
175  \begin{displaymath}  the prognostic phase, equations \ref{eq:ustar-rigid-lid} and \ref{eq:vstar-rigid-lid},
176  \epsilon_{fs} \partial_t \eta =  stepping forward $u^n$ and $v^n$ to $u^{*}$ and $v^{*}$ is coded in
177  \left. \dot{r} \right|_{r=r_{surf}} + \epsilon_{fw} (P-E) =  \filelink{TIMESTEP()}{model-src-timestep.F}
178  - {\bf \nabla}_r \cdot \int_{R_{min}}^{R_o} \vec{\bf v} dr  \item
179  + \epsilon_{fw} (P-E)  the vertical integration, $H \widehat{u^*}$ and $H
180  \end{displaymath}  \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    
 Where $\epsilon_{fs}$,$\epsilon_{fw}$ are two flags to  
 distinguish between a free-surface equation ($\epsilon_{fs}=1$)  
 or the rigid-lid approximation ($\epsilon_{fs}=0$);    
 and to distinguish when exchange of Fresh-Water is included  
 at the ocean surface (natural BC) ($\epsilon_{fw} = 1$)  
 or not ($\epsilon_{fw} = 0$).  
   
 The hydrostatic potential is found by  
 integrating \ref{eq-r-split-hyd} with the boundary condition that  
 $\phi'_{hyd}(r=R_o) = 0$:  
 \begin{eqnarray*}  
 & &  
 \int_{r'}^{R_o} \partial_r \phi'_{hyd} dr =  
 \left[ \phi'_{hyd} \right]_{r'}^{R_o} =  
 \int_{r'}^{R_o} - b' dr  
 \\  
 \Rightarrow & &  
 \phi'_{hyd}(x,y,r') = \int_{r'}^{R_o} b' dr  
 \end{eqnarray*}  
191    
 \subsection{standard synchronous time stepping}  
192    
193  In the standard formulation, the surface pressure is  \paragraph{Need to discuss implicit viscosity somewhere:}
 evaluated at time step n+1 (implicit method).  
 The above set of equations is then discretized in time  
 as follows:  
 \begin{eqnarray}  
 \left[ 1 - \partial_r \kappa_v^\theta \partial_r \right]  
 \theta^{n+1} & = & \theta^*  
 \\  
 \left[ 1 - \partial_r \kappa_v^S \partial_r \right]  
 S^{n+1} & = & S^*  
 \\  
 %{b'}^{n} & = & b'(\theta^{n},S^{n},r)  
 %\partial_r {\phi'_{hyd}}^{n} & = & {-b'}^{n}  
 %\\  
 {\phi'_{hyd}}^{n} & = & \int_{r'}^{R_o} b'(\theta^{n},S^{n},r) dr  
 \label{eq-rtd-hyd}  
 \\  
 \vec{\bf v} ^{n+1}  
 + \Delta t {\bf \nabla}_r B_o {\eta}^{n+1}  
 + \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}  
 \nonumber  
 \\  
 % = \epsilon_{fs} {\eta}^{n} & + & \epsilon_{fw} \Delta_t (P-E)^{n}  
 \label{eq-rtd-eta}  
 \\  
 \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}  
 where  
194  \begin{eqnarray}  \begin{eqnarray}
195  \theta^* & = &  \frac{1}{\Delta t} u^{n+1} - \partial_z A_v \partial_z u^{n+1}
196  \theta ^{n} + \Delta t G_{\theta} ^{(n+1/2)}  + g \partial_x \eta^{n+1} & = & \frac{1}{\Delta t} u^{n} +
197  \\  G_u^{(n+1/2)}
 S^* & = &  
 S ^{n} + \Delta t G_{S} ^{(n+1/2)}  
 \\  
 \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)}  
198  \\  \\
199  \dot{r}^* & = &  \frac{1}{\Delta t} v^{n+1} - \partial_z A_v \partial_z v^{n+1}
200  \dot{r} ^{n} + \Delta t G_{\dot{r}} ^{(n+1/2)}  + g \partial_y \eta^{n+1} & = & \frac{1}{\Delta t} v^{n} + G_v^{(n+1/2)}
201  \end{eqnarray}  \end{eqnarray}
202    
 Note that implicit vertical terms (viscosity and diffusivity) are  
 not considered as part of the "{\it G}" terms, but are  
 written separately here.  
   
 To ensure a second order time discretization for both  
 momentum and tracer,  
 The "G" terms are "extrapolated" forward in time  
 (Adams Bashforth time stepping)  
 from the values computed at time step $n$ and $n-1$  
 to the time $n+1/2$:  
 $$G^{(n+1/2)} = G^n + (1/2+\epsilon_{AB}) (G^n - G^{n-1})$$  
 A small number for the parameter $\epsilon_{AB}$ is generally used  
 to stabilize this time 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}  
   
 An alternative is to evaluate $\phi'_{hyd}$ with the  
 new tracer fields, and step forward the momentum after.  
 This option is known as stagger baroclinic time stepping,  
 since tracer and momentum are step forward in time one after the other.  
 It can be activated turning on a running flag parameter  
 {\it staggerTimeStep} in file "{\it data}").  
   
 The main advantage of this time stepping compared to a synchronous one,  
 is a better stability, specially regarding internal gravity waves,  
 and a very natural implementation of a 2nd order in time  
 hydrostatic pressure / geo- potential term.  
 In the other hand, a synchronous time step might be  better  
 for convection problems; Its also make simpler time dependent forcing  
 and diagnostic implementation ; and allows a more efficient threading.  
   
 Although the stagger time step does not affect deeply the  
 structure of the code --- a switch allows to evaluate the  
 hydrostatic pressure / geo- potential from new $\theta,S$  
 instead of the Adams-Bashforth estimation ---  
 this affect the way the time discretization is presented :  
203    
204  \begin{eqnarray*}  \section{Pressure method with implicit linear free-surface}
205  \left[ 1 - \partial_r \kappa_v^\theta \partial_r \right]  \label{sect:pressure-method-linear-backward}
206  \theta^{n+1/2} & = & \theta^*  
207  \\  The rigid-lid approximation filters out external gravity waves
208  \left[ 1 - \partial_r \kappa_v^S \partial_r \right]  subsequently modifying the dispersion relation of barotropic Rossby
209  S^{n+1/2} & = & S^*  waves. The discrete form of the elliptic equation has some zero
210  \end{eqnarray*}  eigen-values which makes it a potentially tricky or inefficient
211  with  problem to solve.
212  \begin{eqnarray*}  
213  \theta^* & = &  The rigid-lid approximation can be easily replaced by a linearization
214  \theta ^{(n-1/2)} + \Delta t G_{\theta} ^{(n)}  of the free-surface equation which can be written:
215  \\  \begin{equation}
216  S^* & = &  \partial_t \eta + \partial_x H \widehat{u} + \partial_y H \widehat{v} = P-E+R
217  S ^{(n-1/2)} + \Delta t G_{S} ^{(n)}  \label{eq:linear-free-surface=P-E+R}
218  \end{eqnarray*}  \end{equation}
219  And  which differs from the depth integrated continuity equation with
220  \begin{eqnarray*}  rigid-lid (\ref{eq:rigid-lid-continuity}) by the time-dependent term
221  %{b'}^{n+1/2} & = & b'(\theta^{n+1/2},S^{n+1/2},r)  and fresh-water source term.
222  %\\  
223  %\partial_r {\phi'_{hyd}}^{n+1/2} & = & {-b'}^{n+1/2}  Equation \ref{eq:discrete-time-cont-rigid-lid} in the rigid-lid
224  {\phi'_{hyd}}^{n+1/2} & = & \int_{r'}^{R_o} b'(\theta^{n+1/2},S^{n+1/2},r) dr  pressure method is then replaced by the time discretization of
225  %\label{eq-rtd-hyd}  \ref{eq:linear-free-surface=P-E+R} which is:
226  \\  \begin{equation}
227  \vec{\bf v} ^{n+1}  \eta^{n+1}
228  + \Delta t {\bf \nabla}_r B_o {\eta}^{n+1}  + \Delta t \partial_x H \widehat{u^{n+1}}
229  + \epsilon_{nh} \Delta t {\bf \nabla}_r {\phi'_{nh}}^{n+1}  + \Delta t \partial_y H \widehat{v^{n+1}}
230  - \partial_r A_v \partial_r \vec{\bf v}^{n+1}  =
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  \vec{\bf v}^*  - \frac{\eta^*}{\Delta t^2}
256  %\label{eq-rtd-hmom}  \label{eq:elliptic-backward-free-surface}
257  \\  \\
258  \epsilon_{fs} {\eta}^{n+1} + \Delta t  u^{n+1} & = & u^{*} - \Delta t g \partial_x \eta^{n+1} \label{eq:un+1-backward-free-surface}\\
259  {\bf \nabla}_r \cdot \int_{R_{min}}^{R_o} \vec{\bf v}^{n+1} dr  v^{n+1} & = & v^{*} - \Delta t g \partial_y \eta^{n+1} \label{eq:vn+1-backward-free-surface}
260  & = &  \end{eqnarray}
261  \epsilon_{fs} {\eta}^{n} + \epsilon_{fw} \Delta_t (P-E)^{n}  Equations~\ref{eq:ustar-backward-free-surface}
262  \\  to~\ref{eq:vn+1-backward-free-surface}, solved sequentially, represent
263  \epsilon_{nh} \left( \dot{r} ^{n+1}  the pressure method algorithm with a backward implicit, linearized
264  + \Delta t \partial_r {\phi'_{nh}} ^{n+1}  free surface. The method is still formerly a pressure method because
265  \right)  in the limit of large $\Delta t$ the rigid-lid method is
266  & = & \epsilon_{nh} \dot{r}^*  recovered. However, the implicit treatment of the free-surface allows
267  %\label{eq-rtd-rdot}  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  {\bf \nabla}_r \cdot \vec{\bf v}^{n+1} + \partial_r \dot{r}^{n+1}  the rigid-lid formulation, we introduced a switch-like parameter,
270  & = & 0  $\epsilon_{fs}$, which selects between the free-surface and rigid-lid;
271  %\label{eq-rtd-cont}  $\epsilon_{fs}=1$ allows the free-surface to evolve; $\epsilon_{fs}=0$
272  \end{eqnarray*}  imposes the rigid-lid. The evolution in time and location of variables
273  with  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    \>either\>\> EXTERNAL\_FORCING \` $G_\theta^n = G_\theta^n + {\cal Q}$ \\
298    \>\>\> ADAMS\_BASHFORTH2 \` $G_\theta^{(n+1/2)}$ (\ref{eq:adams-bashforth2}) \\
299    \>or\>\> EXTERNAL\_FORCING \` $G_\theta^{(n+1/2)} = G_\theta^{(n+1/2)} + {\cal Q}$ \\
300    \>\> TIMESTEP\_TRACER \` $\tau^*$ (\ref{eq:taustar}) \\
301    \>\> IMPLDIFF \` $\tau^{(n+1)}$ (\ref{eq:tau-n+1-implicit})
302    \end{tabbing} \end{minipage} } \end{center}
303    \caption{
304    Calling tree for the Adams-Bashforth time-stepping of temperature with
305    implicit diffusion.}
306    \label{fig:call-tree-adams-bashforth}
307    \end{figure}
308    
309    In the previous sections, we summarized an explicit scheme as:
310    \begin{equation}
311    \tau^{*} = \tau^{n} + \Delta t G_\tau^{(n+1/2)}
312    \label{eq:taustar}
313    \end{equation}
314    where $\tau$ could be any prognostic variable ($u$, $v$, $\theta$ or
315    $S$) and $\tau^*$ is an explicit estimate of $\tau^{n+1}$ and would be
316    exact if not for implicit-in-time terms. The parenthesis about $n+1/2$
317    indicates that the term is explicit and extrapolated forward in time
318    and for this we use the quasi-second order Adams-Bashforth method:
319    \begin{equation}
320    G_\tau^{(n+1/2)} = ( 3/2 + \epsilon_{AB}) G_\tau^n
321    - ( 1/2 + \epsilon_{AB}) G_\tau^{n-1}
322    \label{eq:adams-bashforth2}
323    \end{equation}
324    This is a linear extrapolation, forward in time, to
325    $t=(n+1/2+{\epsilon_{AB}})\Delta t$. An extrapolation to the mid-point
326    in time, $t=(n+1/2)\Delta t$, corresponding to $\epsilon_{AB}=0$,
327    would be second order accurate but is weakly unstable for oscillatory
328    terms. A small but finite value for $\epsilon_{AB}$ stabilizes the
329    method. Strictly speaking, damping terms such as diffusion and
330    dissipation, and fixed terms (forcing), do not need to be inside the
331    Adams-Bashforth extrapolation. However, in the current code, it is
332    simpler to include these terms and this can be justified if the flow
333    and forcing evolves smoothly. Problems can, and do, arise when forcing
334    or motions are high frequency and this corresponds to a reduced
335    stability compared to a simple forward time-stepping of such terms.
336    The model offers the possibility to leave the forcing term outside the
337    Adams-Bashforth extrapolation, by turning off the logical flag
338    {\bf forcing\_In\_AB } (parameter file {\em data}, namelist {\em PARM01},
339    default value = True).
340    
341    A stability analysis for an oscillation equation should be given at this point.
342    \marginpar{AJA needs to find his notes on this...}
343    
344    A stability analysis for a relaxation equation should be given at this point.
345    \marginpar{...and for this too.}
346    
347    
348    \section{Implicit time-stepping: backward method}
349    
350    Vertical diffusion and viscosity can be treated implicitly in time
351    using the backward method which is an intrinsic scheme.
352    Recently, the option to treat the vertical advection
353    implicitly has been added, but not yet tested; therefore,
354    the description hereafter is limited to diffusion and viscosity.
355    For tracers,
356    the time discretized equation is:
357    \begin{equation}
358    \tau^{n+1} - \Delta t \partial_r \kappa_v \partial_r \tau^{n+1} =
359    \tau^{n} + \Delta t G_\tau^{(n+1/2)}
360    \label{eq:implicit-diffusion}
361    \end{equation}
362    where $G_\tau^{(n+1/2)}$ is the remaining explicit terms extrapolated
363    using the Adams-Bashforth method as described above.  Equation
364    \ref{eq:implicit-diffusion} can be split split into:
365    \begin{eqnarray}
366    \tau^* & = & \tau^{n} + \Delta t G_\tau^{(n+1/2)}
367    \label{eq:taustar-implicit} \\
368    \tau^{n+1} & = & {\cal L}_\tau^{-1} ( \tau^* )
369    \label{eq:tau-n+1-implicit}
370    \end{eqnarray}
371    where ${\cal L}_\tau^{-1}$ is the inverse of the operator
372    \begin{equation}
373    {\cal L} = \left[ 1 + \Delta t \partial_r \kappa_v \partial_r \right]
374    \end{equation}
375    Equation \ref{eq:taustar-implicit} looks exactly as \ref{eq:taustar}
376    while \ref{eq:tau-n+1-implicit} involves an operator or matrix
377    inversion. By re-arranging \ref{eq:implicit-diffusion} in this way we
378    have cast the method as an explicit prediction step and an implicit
379    step allowing the latter to be inserted into the over all algorithm
380    with minimal interference.
381    
382    Fig.~\ref{fig:call-tree-adams-bashforth} shows the calling sequence for
383    stepping forward a tracer variable such as temperature.
384    
385    In order to fit within the pressure method, the implicit viscosity
386    must not alter the barotropic flow. In other words, it can only
387    redistribute momentum in the vertical. The upshot of this is that
388    although vertical viscosity may be backward implicit and
389    unconditionally stable, no-slip boundary conditions may not be made
390    implicit and are thus cast as a an explicit drag term.
391    
392    \section{Synchronous time-stepping: variables co-located in time}
393    \label{sect:adams-bashforth-sync}
394    
395    \begin{figure}
396    \begin{center}
397    \resizebox{5.0in}{!}{\includegraphics{part2/adams-bashforth-sync.eps}}
398    \end{center}
399    \caption{
400    A schematic of the explicit Adams-Bashforth and implicit time-stepping
401    phases of the algorithm. All prognostic variables are co-located in
402    time. Explicit tendencies are evaluated at time level $n$ as a
403    function of the state at that time level (dotted arrow). The explicit
404    tendency from the previous time level, $n-1$, is used to extrapolate
405    tendencies to $n+1/2$ (dashed arrow). This extrapolated tendency
406    allows variables to be stably integrated forward-in-time to render an
407    estimate ($*$-variables) at the $n+1$ time level (solid
408    arc-arrow). The operator ${\cal L}$ formed from implicit-in-time terms
409    is solved to yield the state variables at time level $n+1$. }
410    \label{fig:adams-bashforth-sync}
411    \end{figure}
412    
413    \begin{figure}
414    \begin{center} \fbox{ \begin{minipage}{4.7in} \begin{tabbing}
415    aaa \= aaa \= aaa \= aaa \= aaa \= aaa \kill
416    FORWARD\_STEP \\
417    \>\> EXTERNAL\_FIELDS\_LOAD\\
418    \>\> DO\_ATMOSPHERIC\_PHYS \\
419    \>\> DO\_OCEANIC\_PHYS \\
420    \> THERMODYNAMICS \\
421    \>\> CALC\_GT \\
422    \>\>\> GAD\_CALC\_RHS \` $G_\theta^n = G_\theta( u, \theta^n )$ (\ref{eq:Gt-n-sync})\\
423    \>\>\> EXTERNAL\_FORCING \` $G_\theta^n = G_\theta^n + {\cal Q}$ \\
424    \>\>\> ADAMS\_BASHFORTH2 \` $G_\theta^{(n+1/2)}$ (\ref{eq:Gt-n+5-sync}) \\
425    \>\> TIMESTEP\_TRACER \` $\tau^*$ (\ref{eq:tstar-sync}) \\
426    \>\> IMPLDIFF \` $\tau^{(n+1)}$ (\ref{eq:t-n+1-sync}) \\
427    \> DYNAMICS \\
428    \>\> CALC\_PHI\_HYD \` $\phi_{hyd}^n$ (\ref{eq:phi-hyd-sync}) \\
429    \>\> MOM\_FLUXFORM or MOM\_VECINV \` $G_{\vec{\bf v}}^n$ (\ref{eq:Gv-n-sync})\\
430    \>\> TIMESTEP \` $\vec{\bf v}^*$ (\ref{eq:Gv-n+5-sync}, \ref{eq:vstar-sync}) \\
431    \>\> IMPLDIFF \` $\vec{\bf v}^{**}$ (\ref{eq:vstarstar-sync}) \\
432    \> UPDATE\_R\_STAR or UPDATE\_SURF\_DR \` (NonLin-FS only)\\
433    \> SOLVE\_FOR\_PRESSURE \\
434    \>\> CALC\_DIV\_GHAT \` $\eta^*$ (\ref{eq:nstar-sync}) \\
435    \>\> CG2D \` $\eta^{n+1}$ (\ref{eq:elliptic-sync}) \\
436    \> MOMENTUM\_CORRECTION\_STEP  \\
437    \>\> CALC\_GRAD\_PHI\_SURF \` $\nabla \eta^{n+1}$ \\
438    \>\> CORRECTION\_STEP \` $u^{n+1}$,$v^{n+1}$ (\ref{eq:v-n+1-sync})\\
439    \> TRACERS\_CORRECTION\_STEP  \\
440    \>\> CYCLE\_TRACER \` $\theta^{n+1}$ \\
441    \>\> FILTER \` Shapiro Filter, Zonal Filter (FFT) \\
442    \>\> CONVECTIVE\_ADJUSTMENT \` \\
443    \end{tabbing} \end{minipage} } \end{center}
444    \caption{
445    Calling tree for the overall synchronous algorithm using
446    Adams-Bashforth time-stepping.
447    The place where the model geometry
448    ({\em hFac} factors) is updated is added here but is only relevant
449    for the non-linear free-surface algorithm.
450    For completeness, the external forcing,
451    ocean and atmospheric physics have been added, although they are mainly
452    optional}
453    \label{fig:call-tree-adams-bashforth-sync}
454    \end{figure}
455    
456    The Adams-Bashforth extrapolation of explicit tendencies fits neatly
457    into the pressure method algorithm when all state variables are
458    co-located in time. Fig.~\ref{fig:adams-bashforth-sync} illustrates
459    the location of variables in time and the evolution of the algorithm
460    with time. The algorithm can be represented by the sequential solution
461    of the follow equations:
462    \begin{eqnarray}
463    G_{\theta,S}^{n} & = & G_{\theta,S} ( u^n, \theta^n, S^n )
464    \label{eq:Gt-n-sync} \\
465    G_{\theta,S}^{(n+1/2)} & = & (3/2+\epsilon_{AB}) G_{\theta,S}^{n}-(1/2+\epsilon_{AB}) G_{\theta,S}^{n-1}
466    \label{eq:Gt-n+5-sync} \\
467    (\theta^*,S^*) & = & (\theta^{n},S^{n}) + \Delta t G_{\theta,S}^{(n+1/2)}
468    \label{eq:tstar-sync} \\
469    (\theta^{n+1},S^{n+1}) & = & {\cal L}^{-1}_{\theta,S} (\theta^*,S^*)
470    \label{eq:t-n+1-sync} \\
471    \phi^n_{hyd} & = & \int b(\theta^n,S^n) dr
472    \label{eq:phi-hyd-sync} \\
473    \vec{\bf G}_{\vec{\bf v}}^{n} & = & \vec{\bf G}_{\vec{\bf v}} ( \vec{\bf v}^n, \phi^n_{hyd} )
474    \label{eq:Gv-n-sync} \\
475    \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}
476    \label{eq:Gv-n+5-sync} \\
477    \vec{\bf v}^{*} & = & \vec{\bf v}^{n} + \Delta t \vec{\bf G}_{\vec{\bf v}}^{(n+1/2)}
478    \label{eq:vstar-sync} \\
479    \vec{\bf v}^{**} & = & {\cal L}_{\vec{\bf v}}^{-1} ( \vec{\bf v}^* )
480    \label{eq:vstarstar-sync} \\
481    \eta^* & = & \epsilon_{fs} \left( \eta^{n} + \Delta t (P-E) \right)- \Delta t
482      \nabla \cdot H \widehat{ \vec{\bf v}^{**} }
483    \label{eq:nstar-sync} \\
484    \nabla \cdot g H \nabla \eta^{n+1} & - & \frac{\epsilon_{fs} \eta^{n+1}}{\Delta t^2}
485    ~ = ~ - \frac{\eta^*}{\Delta t^2}
486    \label{eq:elliptic-sync} \\
487    \vec{\bf v}^{n+1} & = & \vec{\bf v}^{*} - \Delta t g \nabla \eta^{n+1}
488    \label{eq:v-n+1-sync}
489    \end{eqnarray}
490    Fig.~\ref{fig:adams-bashforth-sync} illustrates the location of
491    variables in time and evolution of the algorithm with time. The
492    Adams-Bashforth extrapolation of the tracer tendencies is illustrated
493    by the dashed arrow, the prediction at $n+1$ is indicated by the
494    solid arc. Inversion of the implicit terms, ${\cal
495    L}^{-1}_{\theta,S}$, then yields the new tracer fields at $n+1$. All
496    these operations are carried out in subroutine {\em THERMODYNAMICS} an
497    subsidiaries, which correspond to equations \ref{eq:Gt-n-sync} to
498    \ref{eq:t-n+1-sync}.
499    Similarly illustrated is the Adams-Bashforth extrapolation of
500    accelerations, stepping forward and solving of implicit viscosity and
501    surface pressure gradient terms, corresponding to equations
502    \ref{eq:Gv-n-sync} to \ref{eq:v-n+1-sync}.
503    These operations are carried out in subroutines {\em DYNAMCIS}, {\em
504    SOLVE\_FOR\_PRESSURE} and {\em MOMENTUM\_CORRECTION\_STEP}. This, then,
505    represents an entire algorithm for stepping forward the model one
506    time-step. The corresponding calling tree is given in
507    \ref{fig:call-tree-adams-bashforth-sync}.
508    
509    \section{Staggered baroclinic time-stepping}
510    \label{sect:adams-bashforth-staggered}
511    
512    \begin{figure}
513    \begin{center}
514    \resizebox{5.5in}{!}{\includegraphics{part2/adams-bashforth-staggered.eps}}
515    \end{center}
516    \caption{
517    A schematic of the explicit Adams-Bashforth and implicit time-stepping
518    phases of the algorithm but with staggering in time of thermodynamic
519    variables with the flow. Explicit thermodynamics tendencies are
520    evaluated at time level $n$ as a function of the thermodynamics
521    state at that time level $n$ and flow at time $n+1/2$ (dotted arrow). The
522    explicit tendency from the previous time level, $n-1$, is used to
523    extrapolate tendencies to $n+1/2$ (dashed arrow). This extrapolated
524    tendency allows thermo-dynamics variables to be stably integrated
525    forward-in-time to render an estimate ($*$-variables) at the $n+1$
526    time level (solid arc-arrow). The implicit-in-time operator ${\cal
527    L_{\theta,S}}$ is solved to yield the thermodynamic variables at time
528    level $n+1$. These are then used to calculate the hydrostatic
529    pressure/geo-potential, $\phi_{hyd}$ (vertical arrows). The
530    hydrostatic pressure gradient is evaluated directly at time level
531    $n+1$ in stepping forward the flow variables from $n+1/2$ to $n+3/2$
532    (solid arc-arrow). }
533    \label{fig:adams-bashforth-staggered}
534    \end{figure}
535    
536    For well stratified problems, internal gravity waves may be the
537    limiting process for determining a stable time-step. In the
538    circumstance, it is more efficient to stagger in time the
539    thermodynamic variables with the flow
540    variables. Fig.~\ref{fig:adams-bashforth-staggered} illustrates the
541    staggering and algorithm. The key difference between this and
542    Fig.~\ref{fig:adams-bashforth-sync} is that the thermodynamic variables
543    are solved after the dynamics, using the recently updated flow field.
544    This essentially allows the gravity wave terms to leap-frog in
545    time giving second order accuracy and more stability.
546    
547    The essential change in the staggered algorithm is that the
548    thermodynamics solver is delayed from half a time step,
549    allowing the use of the most recent velocities to compute
550    the advection terms. Once the thermodynamics fields are
551    updated, the hydrostatic pressure is computed
552    to step frowrad the dynamics
553    Note that the pressure gradient must also be taken out of the
554    Adams-Bashforth extrapolation. Also, retaining the integer time-levels,
555    $n$ and $n+1$, does not give a user the sense of where variables are
556    located in time.  Instead, we re-write the entire algorithm,
557    \ref{eq:Gt-n-sync} to \ref{eq:v-n+1-sync}, annotating the
558    position in time of variables appropriately:
559    \begin{eqnarray}
560    \vec{\bf G}_{\vec{\bf v}}^{n-1/2} & = & \vec{\bf G}_{\vec{\bf v}} ( \vec{\bf v}^{n-1/2} )
561    \label{eq:Gv-n-staggered} \\
562    \vec{\bf G}_{\vec{\bf v}}^{(n)} & = & (3/2 + \epsilon_{AB} ) \vec{\bf G}_{\vec{\bf v}}^{n-1/2} - (1/2 + \epsilon_{AB} ) \vec{\bf G}_{\vec{\bf v}}^{n-3/2}
563    \label{eq:Gv-n+5-staggered} \\
564    \phi^{n}_{hyd} & = & \int b(\theta^{n},S^{n}) dr
565    \label{eq:phi-hyd-staggered} \\
566    \vec{\bf v}^{*} & = & \vec{\bf v}^{n-1/2} + \Delta t \left( \vec{\bf G}_{\vec{\bf v}}^{(n)} - \nabla \phi_{hyd}^{n} \right)
567    \label{eq:vstar-staggered} \\
568    \vec{\bf v}^{**} & = & {\cal L}_{\vec{\bf v}}^{-1} ( \vec{\bf v}^* )
569    \label{eq:vstarstar-staggered} \\
570    \eta^* & = & \epsilon_{fs} \left( \eta^{n-1/2} + \Delta t (P-E)^n \right)- \Delta t
571      \nabla \cdot H \widehat{ \vec{\bf v}^{**} }
572    \label{eq:nstar-staggered} \\
573    \nabla \cdot g H \nabla \eta^{n+1/2} & - & \frac{\epsilon_{fs} \eta^{n+1/2}}{\Delta t^2}
574    ~ = ~ - \frac{\eta^*}{\Delta t^2}
575    \label{eq:elliptic-staggered} \\
576    \vec{\bf v}^{n+1/2} & = & \vec{\bf v}^{*} - \Delta t g \nabla \eta^{n+1/2}
577    \label{eq:v-n+1-staggered} \\
578    G_{\theta,S}^{n} & = & G_{\theta,S} ( u^{n+1/2}, \theta^{n}, S^{n} )
579    \label{eq:Gt-n-staggered} \\
580    G_{\theta,S}^{(n+1/2)} & = & (3/2+\epsilon_{AB}) G_{\theta,S}^{n}-(1/2+\epsilon_{AB}) G_{\theta,S}^{n-1}
581    \label{eq:Gt-n+5-staggered} \\
582    (\theta^*,S^*) & = & (\theta^{n},S^{n}) + \Delta t G_{\theta,S}^{(n+1/2)}
583    \label{eq:tstar-staggered} \\
584    (\theta^{n+1},S^{n+1}) & = & {\cal L}^{-1}_{\theta,S} (\theta^*,S^*)
585    \label{eq:t-n+1-staggered} \\
586    \end{eqnarray}
587    The corresponding calling tree is given in
588    \ref{fig:call-tree-adams-bashforth-staggered}.
589    The staggered algorithm is activated with the run-time flag
590    {\bf staggerTimeStep=.TRUE.} in parameter file {\em data},
591    namelist {\em PARM01}.
592    
593    \begin{figure}
594    \begin{center} \fbox{ \begin{minipage}{4.7in} \begin{tabbing}
595    aaa \= aaa \= aaa \= aaa \= aaa \= aaa \kill
596    FORWARD\_STEP \\
597    \>\> EXTERNAL\_FIELDS\_LOAD\\
598    \>\> DO\_ATMOSPHERIC\_PHYS \\
599    \>\> DO\_OCEANIC\_PHYS \\
600    \> DYNAMICS \\
601    \>\> CALC\_PHI\_HYD \` $\phi_{hyd}^n$ (\ref{eq:phi-hyd-staggered}) \\
602    \>\> MOM\_FLUXFORM or MOM\_VECINV \` $G_{\vec{\bf v}}^{n-1/2}$
603        (\ref{eq:Gv-n-staggered})\\
604    \>\> TIMESTEP \` $\vec{\bf v}^*$ (\ref{eq:Gv-n+5-staggered},
605                                      \ref{eq:vstar-staggered}) \\
606    \>\> IMPLDIFF \` $\vec{\bf v}^{**}$ (\ref{eq:vstarstar-staggered}) \\
607    \> UPDATE\_R\_STAR or UPDATE\_SURF\_DR \` (NonLin-FS only)\\
608    \> SOLVE\_FOR\_PRESSURE \\
609    \>\> CALC\_DIV\_GHAT \` $\eta^*$ (\ref{eq:nstar-staggered}) \\
610    \>\> CG2D \` $\eta^{n+1/2}$ (\ref{eq:elliptic-staggered}) \\
611    \> MOMENTUM\_CORRECTION\_STEP  \\
612    \>\> CALC\_GRAD\_PHI\_SURF \` $\nabla \eta^{n+1/2}$ \\
613    \>\> CORRECTION\_STEP \` $u^{n+1/2}$,$v^{n+1/2}$ (\ref{eq:v-n+1-staggered})\\
614    \> THERMODYNAMICS \\
615    \>\> CALC\_GT \\
616    \>\>\> GAD\_CALC\_RHS \` $G_\theta^n = G_\theta( u, \theta^n )$
617         (\ref{eq:Gt-n-staggered})\\
618    \>\>\> EXTERNAL\_FORCING \` $G_\theta^n = G_\theta^n + {\cal Q}$ \\
619    \>\>\> ADAMS\_BASHFORTH2 \` $G_\theta^{(n+1/2)}$ (\ref{eq:Gt-n+5-staggered}) \\
620    \>\> TIMESTEP\_TRACER \` $\tau^*$ (\ref{eq:tstar-staggered}) \\
621    \>\> IMPLDIFF \` $\tau^{(n+1)}$ (\ref{eq:t-n+1-staggered}) \\
622    \> TRACERS\_CORRECTION\_STEP  \\
623    \>\> CYCLE\_TRACER \` $\theta^{n+1}$ \\
624    \>\> FILTER \` Shapiro Filter, Zonal Filter (FFT) \\
625    \>\> CONVECTIVE\_ADJUSTMENT \` \\
626    \end{tabbing} \end{minipage} } \end{center}
627    \caption{
628    Calling tree for the overall staggered algorithm using
629    Adams-Bashforth time-stepping.
630    The place where the model geometry
631    ({\em hFac} factors) is updated is added here but is only relevant
632    for the non-linear free-surface algorithm.
633    }
634    \label{fig:call-tree-adams-bashforth-staggered}
635    \end{figure}
636    
637    The only difficulty with this approach is apparent in equation
638    \ref{eq:Gt-n-staggered} and illustrated by the dotted arrow
639    connecting $u,v^n$ with $G_\theta^{n-1/2}$. The flow used to advect
640    tracers around is not naturally located in time. This could be avoided
641    by applying the Adams-Bashforth extrapolation to the tracer field
642    itself and advecting that around but this approach is not yet
643    available. We're not aware of any detrimental effect of this
644    feature. The difficulty lies mainly in interpretation of what
645    time-level variables and terms correspond to.
646    
647    
648    \section{Non-hydrostatic formulation}
649    \label{sect:non-hydrostatic}
650    
651    The non-hydrostatic formulation re-introduces the full vertical
652    momentum equation and requires the solution of a 3-D elliptic
653    equations for non-hydrostatic pressure perturbation. We still
654    intergrate vertically for the hydrostatic pressure and solve a 2-D
655    elliptic equation for the surface pressure/elevation for this reduces
656    the amount of work needed to solve for the non-hydrostatic pressure.
657    
658    The momentum equations are discretized in time as follows:
659    \begin{eqnarray}
660    \frac{1}{\Delta t} u^{n+1} + g \partial_x \eta^{n+1} + \partial_x \phi_{nh}^{n+1}
661    & = & \frac{1}{\Delta t} u^{n} + G_u^{(n+1/2)} \label{eq:discrete-time-u-nh} \\
662    \frac{1}{\Delta t} v^{n+1} + g \partial_y \eta^{n+1} + \partial_y \phi_{nh}^{n+1}
663    & = & \frac{1}{\Delta t} v^{n} + G_v^{(n+1/2)} \label{eq:discrete-time-v-nh} \\
664    \frac{1}{\Delta t} w^{n+1} + \partial_r \phi_{nh}^{n+1}
665    & = & \frac{1}{\Delta t} w^{n} + G_w^{(n+1/2)} \label{eq:discrete-time-w-nh} \\
666    \end{eqnarray}
667    which must satisfy the discrete-in-time depth integrated continuity,
668    equation~\ref{eq:discrete-time-backward-free-surface} and the local continuity equation
669    \begin{equation}
670    \partial_x u^{n+1} + \partial_y v^{n+1} + \partial_r w^{n+1} = 0
671    \label{eq:non-divergence-nh}
672    \end{equation}
673    As before, the explicit predictions for momentum are consolidated as:
674  \begin{eqnarray*}  \begin{eqnarray*}
675  \vec{\bf v}^* & = &  u^* & = & u^n + \Delta t G_u^{(n+1/2)} \\
676  \vec{\bf v} ^{n} + \Delta t \vec{\bf G}_{\vec{\bf v}} ^{(n+1/2)}  v^* & = & v^n + \Delta t G_v^{(n+1/2)} \\
677  + \Delta t  {\bf \nabla}_r {\phi'_{hyd}}^{n+1/2}  w^* & = & w^n + \Delta t G_w^{(n+1/2)}
 \\  
 \dot{r}^* & = &  
 \dot{r} ^{n} + \Delta t G_{\dot{r}} ^{(n+1/2)}  
678  \end{eqnarray*}  \end{eqnarray*}
679    but this time we introduce an intermediate step by splitting the
680    tendancy of the flow as follows:
681    \begin{eqnarray}
682    u^{n+1} = u^{**} - \Delta t \partial_x \phi_{nh}^{n+1}
683    & &
684    u^{**} = u^{*} - \Delta t g \partial_x \eta^{n+1} \\
685    v^{n+1} = v^{**} - \Delta t \partial_y \phi_{nh}^{n+1}
686    & &
687    v^{**} = v^{*} - \Delta t g \partial_y \eta^{n+1}
688    \end{eqnarray}
689    Substituting into the depth integrated continuity
690    (equation~\ref{eq:discrete-time-backward-free-surface}) gives
691    \begin{equation}
692    \partial_x H \partial_x \left( g \eta^{n+1} + \widehat{\phi}_{nh}^{n+1} \right)
693    +
694    \partial_y H \partial_y \left( g \eta^{n+1} + \widehat{\phi}_{nh}^{n+1} \right)
695     - \frac{\epsilon_{fs}\eta^*}{\Delta t^2}
696    = - \frac{\eta^*}{\Delta t^2}
697    \end{equation}
698    which is approximated by equation
699    \ref{eq:elliptic-backward-free-surface} on the basis that i)
700    $\phi_{nh}^{n+1}$ is not yet known and ii) $\nabla \widehat{\phi}_{nh}
701    << g \nabla \eta$. If \ref{eq:elliptic-backward-free-surface} is
702    solved accurately then the implication is that $\widehat{\phi}_{nh}
703    \approx 0$ so that thet non-hydrostatic pressure field does not drive
704    barotropic motion.
705    
706    The flow must satisfy non-divergence
707    (equation~\ref{eq:non-divergence-nh}) locally, as well as depth
708    integrated, and this constraint is used to form a 3-D elliptic
709    equations for $\phi_{nh}^{n+1}$:
710    \begin{equation}
711    \partial_{xx} \phi_{nh}^{n+1} + \partial_{yy} \phi_{nh}^{n+1} +
712    \partial_{rr} \phi_{nh}^{n+1} =
713    \partial_x u^{**} + \partial_y v^{**} + \partial_r w^{*}
714    \end{equation}
715    
716  %---------------------------------------------------------------------  The entire algorithm can be summarized as the sequential solution of
717    the following equations:
718    \begin{eqnarray}
719    u^{*} & = & u^{n} + \Delta t G_u^{(n+1/2)} \label{eq:ustar-nh} \\
720    v^{*} & = & v^{n} + \Delta t G_v^{(n+1/2)} \label{eq:vstar-nh} \\
721    w^{*} & = & w^{n} + \Delta t G_w^{(n+1/2)} \label{eq:wstar-nh} \\
722    \eta^* ~ = ~ \epsilon_{fs} \left( \eta^{n} + \Delta t (P-E) \right)
723    & - & \Delta t
724      \partial_x H \widehat{u^{*}}
725    + \partial_y H \widehat{v^{*}}
726    \\
727      \partial_x g H \partial_x \eta^{n+1}
728    + \partial_y g H \partial_y \eta^{n+1}
729    & - & \frac{\epsilon_{fs} \eta^{n+1}}{\Delta t^2}
730    ~ = ~
731    - \frac{\eta^*}{\Delta t^2}
732    \label{eq:elliptic-nh}
733    \\
734    u^{**} & = & u^{*} - \Delta t g \partial_x \eta^{n+1} \label{eq:unx-nh}\\
735    v^{**} & = & v^{*} - \Delta t g \partial_y \eta^{n+1} \label{eq:vnx-nh}\\
736    \partial_{xx} \phi_{nh}^{n+1} + \partial_{yy} \phi_{nh}^{n+1} +
737    \partial_{rr} \phi_{nh}^{n+1} & = &
738    \partial_x u^{**} + \partial_y v^{**} + \partial_r w^{*} \\
739    u^{n+1} & = & u^{**} - \Delta t \partial_x \phi_{nh}^{n+1} \label{eq:un+1-nh}\\
740    v^{n+1} & = & v^{**} - \Delta t \partial_y \phi_{nh}^{n+1} \label{eq:vn+1-nh}\\
741    \partial_r w^{n+1} & = & - \partial_x u^{n+1} - \partial_y v^{n+1}
742    \end{eqnarray}
743    where the last equation is solved by vertically integrating for
744    $w^{n+1}$.
745    
 \subsection{surface pressure}  
746    
747  Substituting \ref{eq-rtd-hmom} into \ref{eq-rtd-cont}, assuming  
748  $\epsilon_{nh} = 0$ yields a Helmholtz equation for ${\eta}^{n+1}$:  \section{Variants on the Free Surface}
749  $$  
750    We now describe the various formulations of the free-surface that
751    include non-linear forms, implicit in time using Crank-Nicholson,
752    explicit and [one day] split-explicit. First, we'll reiterate the
753    underlying algorithm but this time using the notation consistent with
754    the more general vertical coordinate $r$. The elliptic equation for
755    free-surface coordinate (units of $r$), corresponding to
756    \ref{eq:discrete-time-backward-free-surface}, and
757    assuming no non-hydrostatic effects ($\epsilon_{nh} = 0$) is:
758    \begin{eqnarray}
759  \epsilon_{fs} {\eta}^{n+1} -  \epsilon_{fs} {\eta}^{n+1} -
760  {\bf \nabla}_r \cdot \Delta t^2 (R_o-R_{min})  {\bf \nabla}_h \cdot \Delta t^2 (R_o-R_{fixed}) {\bf \nabla}_h b_s
761  {\bf \nabla}_r B_o {\eta}^{n+1}  {\eta}^{n+1} = {\eta}^*
762  = {\eta}^*  \label{eq-solve2D}
763  \label{solve_2d}  \end{eqnarray}
 $$  
764  where  where
765  $$  \begin{eqnarray}
766  {\eta}^* = \epsilon_{fs} \: {\eta}^{n} -  {\eta}^* = \epsilon_{fs} \: {\eta}^{n} -
767  \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
768  \: + \: \epsilon_{fw} \Delta_t (P-E)^{n}  \: + \: \epsilon_{fw} \Delta_t (P-E)^{n}
769  $$  \label{eq-solve2D_rhs}
770    \end{eqnarray}
771    
772    \fbox{ \begin{minipage}{4.75in}
773    {\em S/R SOLVE\_FOR\_PRESSURE} ({\em solve\_for\_pressure.F})
774    
775    $u^*$: {\bf GuNm1} ({\em DYNVARS.h})
776    
777    $v^*$: {\bf GvNm1} ({\em DYNVARS.h})
778    
779    $\eta^*$: {\bf cg2d\_b} (\em SOLVE\_FOR\_PRESSURE.h)
780    
781    $\eta^{n+1}$: {\bf etaN} (\em DYNVARS.h)
782    
783    \end{minipage} }
784    
785  Once ${\eta}^{n+1}$ has been found substituting into \ref{eq-rtd-hmom}  
786  would yield $\vec{\bf v}^{n+1}$ if the model is hydrostatic  Once ${\eta}^{n+1}$ has been found, substituting into
787  ($\epsilon_{nh}=0$):  \ref{eq:discrete-time-u,eq:discrete-time-v} yields $\vec{\bf v}^{n+1}$ if the model is
788    hydrostatic ($\epsilon_{nh}=0$):
789  $$  $$
790  \vec{\bf v}^{n+1} = \vec{\bf v}^{*}  \vec{\bf v}^{n+1} = \vec{\bf v}^{*}
791  - \Delta t {\bf \nabla}_r B_o {\eta}^{n+1}  - \Delta t {\bf \nabla}_h b_s {\eta}^{n+1}
792  $$  $$
793    
794  This is known as the correction step. However, when the model is  This is known as the correction step. However, when the model is
795  non-hydrostatic ($\epsilon_{nh}=1$) we need an additional step and an  non-hydrostatic ($\epsilon_{nh}=1$) we need an additional step and an
796  additional equation for $\phi'_{nh}$. This is obtained by  additional equation for $\phi'_{nh}$. This is obtained by substituting
797  substituting \ref{eq-rtd-hmom} and \ref{eq-rtd-rdot} into  \ref{eq:discrete-time-u-nh}, \ref{eq:discrete-time-v-nh} and \ref{eq:discrete-time-w-nh}
798  \ref{eq-rtd-cont}:  into continuity:
799  \begin{equation}  \begin{equation}
800  \left[ {\bf \nabla}_r^2 + \partial_{rr} \right] {\phi'_{nh}}^{n+1}  \left[ {\bf \nabla}_h^2 + \partial_{rr} \right] {\phi'_{nh}}^{n+1}
801  = \frac{1}{\Delta t} \left(  = \frac{1}{\Delta t} \left(
802  {\bf \nabla}_r \cdot \vec{\bf v}^{**} + \partial_r \dot{r}^* \right)  {\bf \nabla}_h \cdot \vec{\bf v}^{**} + \partial_r \dot{r}^* \right)
803  \end{equation}  \end{equation}
804  where  where
805  \begin{displaymath}  \begin{displaymath}
806  \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}
807  \end{displaymath}  \end{displaymath}
808  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
809  $\partial_r \dot{r}^* $ since  $\partial_r \dot{r}^* $ since
# Line 369  is evaluated as $(\eta^{n+1} - \eta^n) / Line 813  is evaluated as $(\eta^{n+1} - \eta^n) /
813  Finally, the horizontal velocities at the new time level are found by:  Finally, the horizontal velocities at the new time level are found by:
814  \begin{equation}  \begin{equation}
815  \vec{\bf v}^{n+1} = \vec{\bf v}^{**}  \vec{\bf v}^{n+1} = \vec{\bf v}^{**}
816  - \epsilon_{nh} \Delta t {\bf \nabla}_r {\phi'_{nh}}^{n+1}  - \epsilon_{nh} \Delta t {\bf \nabla}_h {\phi'_{nh}}^{n+1}
817  \end{equation}  \end{equation}
818  and the vertical velocity is found by integrating the continuity  and the vertical velocity is found by integrating the continuity
819  equation vertically.  equation vertically.  Note that, for the convenience of the restart
820  Note that, for convenience regarding the restart procedure,  procedure, the vertical integration of the continuity equation has
821  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),  
822  without any consequence on the solution.  without any consequence on the solution.
823    
824  Regarding the implementation, all those computation are done  \fbox{ \begin{minipage}{4.75in}
825  within the routine {\it SOLVE\_FOR\_PRESSURE} and its dependent  {\em S/R CORRECTION\_STEP} ({\em correction\_step.F})
826  {\it CALL}s.  
827  The standard method to solve the 2D elliptic problem (\ref{solve_2d})  $\eta^{n+1}$: {\bf etaN} (\em DYNVARS.h)
828  uses the conjugate gradient method (routine {\it CG2D}); The  
829  the solver matrix and conjugate gradient operator are only function  $\phi_{nh}^{n+1}$: {\bf phi\_nh} (\em DYNVARS.h)
830  of the discretized domain and are therefore evaluated separately,  
831  before the time iteration loop, within {\it INI\_CG2D}.  $u^*$: {\bf GuNm1} ({\em DYNVARS.h})
832  The computation of the RHS $\eta^*$ is partly  
833  done in {\it CALC\_DIV\_GHAT} and in {\it SOLVE\_FOR\_PRESSURE}.  $v^*$: {\bf GvNm1} ({\em DYNVARS.h})
834    
835  The same method is applied for the non hydrostatic part, using  $u^{n+1}$: {\bf uVel} ({\em DYNVARS.h})
836  a conjugate gradient 3D solver ({\it CG3D}) that is initialized  
837  in {\it INI\_CG3D}. The RHS terms of 2D and 3D problems  $v^{n+1}$: {\bf vVel} ({\em DYNVARS.h})
838  are computed together, within the same part of the code.  
839    \end{minipage} }
840    
841    
842    
843    Regarding the implementation of the surface pressure solver, all
844    computation are done within the routine {\it SOLVE\_FOR\_PRESSURE} and
845    its dependent calls.  The standard method to solve the 2D elliptic
846    problem (\ref{eq-solve2D}) uses the conjugate gradient method (routine
847    {\it CG2D}); the solver matrix and conjugate gradient operator are
848    only function of the discretized domain and are therefore evaluated
849    separately, before the time iteration loop, within {\it INI\_CG2D}.
850    The computation of the RHS $\eta^*$ is partly done in {\it
851    CALC\_DIV\_GHAT} and in {\it SOLVE\_FOR\_PRESSURE}.
852    
853    The same method is applied for the non hydrostatic part, using a
854    conjugate gradient 3D solver ({\it CG3D}) that is initialized in {\it
855    INI\_CG3D}. The RHS terms of 2D and 3D problems are computed together
856    at the same point in the code.
857    
858    
859    
 \newpage  
 %-----------------------------------------------------------------------------------  
860  \subsection{Crank-Nickelson barotropic time stepping}  \subsection{Crank-Nickelson barotropic time stepping}
861    
862  The full implicit time stepping described previously is unconditionally stable  The full implicit time stepping described previously is
863  but damps the fast gravity waves, resulting in a loss of  unconditionally stable but damps the fast gravity waves, resulting in
864  gravity potential energy.  a loss of potential energy.  The modification presented now allows one
865  The modification presented hereafter allows to combine an implicit part  to combine an implicit part ($\beta,\gamma$) and an explicit part
866  ($\beta,\gamma$) and an explicit part ($1-\beta,1-\gamma$) for the surface  ($1-\beta,1-\gamma$) for the surface pressure gradient ($\beta$) and
867  pressure gradient ($\beta$) and for the barotropic flow divergence ($\gamma$).  for the barotropic flow divergence ($\gamma$).
868  \\  \\
869  For instance, $\beta=\gamma=1$ is the previous fully implicit scheme;  For instance, $\beta=\gamma=1$ is the previous fully implicit scheme;
870  $\beta=\gamma=1/2$ is the non damping (energy conserving), unconditionally  $\beta=\gamma=1/2$ is the non damping (energy conserving), unconditionally
# Line 414  In the code, $\beta,\gamma$ are defined Line 875  In the code, $\beta,\gamma$ are defined
875  {\it implicSurfPress}, {\it implicDiv2DFlow}. They are read from  {\it implicSurfPress}, {\it implicDiv2DFlow}. They are read from
876  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.
877    
878  Equations \ref{eq-rtd-hmom} and \ref{eq-rtd-eta} are modified as follows:  Equations \ref{eq:ustar-backward-free-surface} --
879    \ref{eq:vn+1-backward-free-surface} are modified as follows:
880  $$  $$
881  \frac{ \vec{\bf v}^{n+1} }{ \Delta t }  \frac{ \vec{\bf v}^{n+1} }{ \Delta t }
882  + {\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} ]
883  + \epsilon_{nh} {\bf \nabla}_r {\phi'_{nh}}^{n+1}  + \epsilon_{nh} {\bf \nabla}_h {\phi'_{nh}}^{n+1}
884   = \frac{ \vec{\bf v}^* }{ \Delta t }   = \frac{ \vec{\bf v}^* }{ \Delta t }
885  $$  $$
886  $$  $$
887  \epsilon_{fs} \frac{ {\eta}^{n+1} - {\eta}^{n} }{ \Delta t}  \epsilon_{fs} \frac{ {\eta}^{n+1} - {\eta}^{n} }{ \Delta t}
888  + {\bf \nabla}_r \cdot \int_{R_{min}}^{R_o}  + {\bf \nabla}_h \cdot \int_{R_{fixed}}^{R_o}
889  [ \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
890  = \epsilon_{fw} (P-E)  = \epsilon_{fw} (P-E)
891  $$  $$
# Line 431  where: Line 893  where:
893  \begin{eqnarray*}  \begin{eqnarray*}
894  \vec{\bf v}^* & = &  \vec{\bf v}^* & = &
895  \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)}
896  + (\beta-1) \Delta t {\bf \nabla}_r B_o {\eta}^{n}  + (\beta-1) \Delta t {\bf \nabla}_h b_s {\eta}^{n}
897  + \Delta t {\bf \nabla}_r {\phi'_{hyd}}^{(n+1/2)}  + \Delta t {\bf \nabla}_h {\phi'_{hyd}}^{(n+1/2)}
898  \\  \\
899  {\eta}^* & = &  {\eta}^* & = &
900  \epsilon_{fs} {\eta}^{n} + \epsilon_{fw} \Delta t (P-E)  \epsilon_{fs} {\eta}^{n} + \epsilon_{fw} \Delta t (P-E)
901  - \Delta t {\bf \nabla}_r \cdot \int_{R_{min}}^{R_o}  - \Delta t {\bf \nabla}_h \cdot \int_{R_{fixed}}^{R_o}
902  [ \gamma \vec{\bf v}^* + (1-\gamma) \vec{\bf v}^{n}] dr  [ \gamma \vec{\bf v}^* + (1-\gamma) \vec{\bf v}^{n}] dr
903  \end{eqnarray*}  \end{eqnarray*}
904  \\  \\
905  In the hydrostatic case ($\epsilon_{nh}=0$),  In the hydrostatic case ($\epsilon_{nh}=0$), allowing us to find
906  this allow to find ${\eta}^{n+1}$, according to:  ${\eta}^{n+1}$, thus:
907  $$  $$
908  \epsilon_{fs} {\eta}^{n+1} -  \epsilon_{fs} {\eta}^{n+1} -
909  {\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})
910  {\bf \nabla}_r {\eta}^{n+1}  {\bf \nabla}_h {\eta}^{n+1}
911  = {\eta}^*  = {\eta}^*
912  $$  $$
913  and then to compute (correction step):  and then to compute (correction step):
914  $$  $$
915  \vec{\bf v}^{n+1} = \vec{\bf v}^{*}  \vec{\bf v}^{n+1} = \vec{\bf v}^{*}
916  - \beta \Delta t {\bf \nabla}_r B_o {\eta}^{n+1}  - \beta \Delta t {\bf \nabla}_h b_s {\eta}^{n+1}
917  $$  $$
918    
919  The non-hydrostatic part is solved as described previously.  The non-hydrostatic part is solved as described previously.
920  \\ \\  
921  N.B:  Note that:
922  \\  \begin{enumerate}
923   a) The non-hydrostatic part of the code has not yet been  \item The non-hydrostatic part of the code has not yet been
924  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)$.
925  so that this option cannot be used with $(\beta,\gamma) \neq (1,1)$.  \item The stability criteria with Crank-Nickelson time stepping
926  \\  for the pure linear gravity wave problem in cartesian coordinates is:
927  b) To remind, the stability criteria with the Crank-Nickelson time stepping  \begin{itemize}
928  for the pure linear gravity wave problem in cartesian coordinate is:  \item $\beta + \gamma < 1$ : unstable
929  \\  \item $\beta \geq 1/2$ and $ \gamma \geq 1/2$ : stable
930  $\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)$  
931  $$  $$
932  c_{max}^2 (\beta - 1/2)(\gamma - 1/2) + 1 \geq 0  c_{max}^2 (\beta - 1/2)(\gamma - 1/2) + 1 \geq 0
933  $$  $$
# Line 485  $$ Line 942  $$
942  c_{max} =  2 \Delta t \: \sqrt{g H} \:  c_{max} =  2 \Delta t \: \sqrt{g H} \:
943  \sqrt{ \frac{1}{\Delta x^2} + \frac{1}{\Delta y^2} }  \sqrt{ \frac{1}{\Delta x^2} + \frac{1}{\Delta y^2} }
944  $$  $$
945    \end{itemize}
946    \end{enumerate}
947    

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.17

  ViewVC Help
Powered by ViewVC 1.1.22