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

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.22