New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Chap_DYN.tex in trunk/DOC/TexFiles/Chapters – NEMO

source: trunk/DOC/TexFiles/Chapters/Chap_DYN.tex @ 999

Last change on this file since 999 was 998, checked in by gm, 16 years ago

trunk - DOC - update .tex due to the change in position of NEMO_book

  • Property svn:executable set to *
File size: 58.2 KB
Line 
1% ================================================================
2% Chapter Ñ Ocean Dynamics (DYN)
3% ================================================================
4\chapter{Ocean Dynamics (DYN)}
5\label{DYN}
6\minitoc
7
8% add a figure for  dynvor ens, ene latices
9
10
11$\ $\newline      %force an empty line
12
13Using the representation described in Chap.\ref{DOM}, several semi-discrete
14space forms of the dynamical equations are available depending on the vertical
15coordinate used and on the conservation properties of the vorticity term. In all
16the equations presented here, the masking has been omitted for simplicity.
17One must be aware that all the quantities are masked fields and that each time a
18average or difference operator is used, the resulting field is multiplied by a mask.
19
20The prognostic ocean dynamics equation can be summarized as follows:
21\begin{equation*}
22\text{NXT} = \dbinom {\text{VOR} + \text{KEG} + \text {ZAD} }
23                  {\text{COR} + \text{ADV}                       }
24         + \text{HPG} + \text{SPG} + \text{LDF} + \text{ZDF}
25\end{equation*}
26
27NXT stands for next, referring to the time-stepping. The first group of terms on
28the rhs of the momentum equations corresponds to the Coriolis and advection
29terms that are decomposed into a vorticity part (VOR), a kinetic energy part (KEG)
30and, a vertical advection part (ZAD) in the vector invariant formulation or a Coriolis
31and advection part(COR+ADV) in the flux formulation. The terms following these
32are the pressure gradient contributions (HPG, Hydrostatic Pressure Gradient,
33and SPG, Surface Pressure Gradient); and contributions from lateral diffusion
34(LDF) and vertical diffusion (ZDF), which are added to the rhs in the \mdl{dynldf} 
35and \mdl{dynzdf} modules. The vertical diffusion term includes the surface and
36bottom stresses. The external forcings and parameterisations require complex
37inputs (surface wind stress calculation using bulk formulae, estimation of mixing
38coefficients) that are carried out in modules SBC, LDF and ZDF and are described
39in Chapters \ref{SBC}, \ref{LDF} and \ref{ZDF}, respectively.
40
41In the present chapter we also describe the diagnostic equations used to compute
42the horizontal divergence and curl of the velocities (\emph{divcur} module) as well
43as the vertical velocity (\emph{wzvmod} module).
44
45The different options available to the user are managed by namelist variables.
46For equation term \textit{ttt}, the logical namelist variables are \textit{ln\_dynttt\_xxx},
47where \textit{xxx} is a 3 or 4 letter acronym corresponding to each optional scheme.
48If a CPP key is used for this term its name is \textbf{key\_ttt}. The corresponding
49code can be found in the \textit{dynttt\_xxx} module in the DYN directory, and it is
50usually computed in the \textit{dyn\_ttt\_xxx} subroutine.
51
52The user has the option of extracting each tendency term of both the rhs of the
533D momentum equation (\key{trddyn} defined) for output, as described in
54Chap.\ref{MISC}.  Furthermore, the tendency terms associated to the 2D
55barotropic vorticity balance (\key{trdvor} defined) can be derived on-line from the
563D terms.
57%%%
58\gmcomment{STEVEN: not quite sure I've got the sense of the last sentence. does
59MISC correspond to "extracting tendency terms" or "vorticity balance"?}
60
61% ================================================================
62% Coriolis and Advection terms: vector invariant form
63% ================================================================
64\section{Coriolis and Advection: vector invariant form}
65\label{DYN_adv_cor_vect}
66%-----------------------------------------nam_dynadv----------------------------------------------------
67\namdisplay{nam_dynadv} 
68%-------------------------------------------------------------------------------------------------------------
69
70The vector invariant form of the momentum equations is the one most
71often used in applications of \NEMO ocean model. The flux form option
72(see next section) has been recently introduced in version $2$.
73Coriolis and momentum
74advection terms are evaluated using a leapfrog scheme, $i.e.$ the velocity
75appearing in these expressions is centred in time (\textit{now} velocity).
76At the lateral boundaries either free slip, no slip or partial slip boundary
77conditions are applied following Chap.\ref{LBC}.
78
79% -------------------------------------------------------------------------------------------------------------
80%        Vorticity term
81% -------------------------------------------------------------------------------------------------------------
82\subsection   [Vorticity term (\textit{dynvor}) ]
83         {Vorticity term (\mdl{dynvor})}
84\label{DYN_vor}
85%------------------------------------------nam_dynvor----------------------------------------------------
86\namdisplay{nam_dynvor} 
87%-------------------------------------------------------------------------------------------------------------
88
89Different discretisations of the vorticity term (\textit{ln\_dynvor\_xxx}=.true.) are
90available: conserving potential enstrophy of horizontally non-divergent flow;
91conserving horizontal kinetic energy; or conserving potential enstrophy for the
92relative vorticity term and horizontal kinetic energy for the planetary vorticity term
93(see  Appendix~\ref{Apdx_C}). The vorticity terms are given below for the general
94case, but note that in the full step $z$-coordinate (\key{zco} is defined),
95$e_{3u} =e_{3v} =e_{3f}$ so that the vertical scale factors disappear.
96
97%-------------------------------------------------------------
98%                 enstrophy conserving scheme
99%-------------------------------------------------------------
100\subsubsection{Enstrophy conserving scheme (\np{ln\_dynvor\_ens}=.true.)}
101\label{DYN_vor_ens}
102
103In the enstrophy conserving case (ENS scheme), the discrete formulation of the
104vorticity term provides a global conservation of the enstrophy
105($ [ (\zeta +f ) / e_{3f} ]^2 $ in $s$-coordinates) for a horizontally non-divergent
106flow ($i.e.$ $\chi=0$), but does not conserve the total kinetic energy. It is given by:
107\begin{equation} \label{Eq_dynvor_ens}
108\left\{ 
109\begin{aligned}
110{+\frac{1}{e_{1u} } } & {\overline {\left( { \frac{\zeta +f}{e_{3f} }} \right)} }^{\,i} & {\overline{\overline {\left( {e_{1v} e_{3v} v} \right)}} }^{\,i, j+1/2}    \\
111{-\frac{1}{e_{2v} } } & {\overline {\left( {\frac{\zeta +f}{e_{3f} }} \right)} }^{\,j}  & {\overline{\overline {\left( {e_{2u} e_{3u} u} \right)}} }^{\,i+1/2, j} 
112\end{aligned} 
113 \right.
114\end{equation} 
115
116%-------------------------------------------------------------
117%                 energy conserving scheme
118%-------------------------------------------------------------
119\subsubsection{Energy conserving scheme (\np{ln\_dynvor\_ene}=.true.)}
120\label{DYN_vor_ene}
121
122The kinetic energy conserving scheme (ENE scheme) conserves the global
123kinetic energy but not the global enstrophy. It is given by:
124\begin{equation} \label{Eq_dynvor_ene}
125\left\{ {
126\begin{aligned}
127{+\frac{1}{e_{1u} }\; {\overline {\left( {\frac{\zeta +f}{e_{3f} }} \right)
128\;\overline {\left( {e_{1v} e_{3v} v} \right)} ^{\,i+1/2}} }^{\,j} }    \\
129{-\frac{1}{e_{2v} }\; {\overline {\left( {\frac{\zeta +f}{e_{3f} }} \right)
130\;\overline {\left( {e_{2u} e_{3u} u} \right)} ^{\,j+1/2}} }^{\,i} }
131\end{aligned} 
132} \right.
133\end{equation} 
134
135%-------------------------------------------------------------
136%                 mix energy/enstrophy conserving scheme
137%-------------------------------------------------------------
138\subsubsection{Mixed energy/enstrophy conserving scheme (\np{ln\_dynvor\_mix}=.true.) }
139\label{DYN_vor_mix}
140
141The mixed energy/enstrophy conserving scheme (MIX scheme), a mixture of the
142two previous schemes is used. It consists of the ENS scheme (\ref{Eq_dynvor_ens})
143to the relative vorticity term, and of the ENE scheme (\ref{Eq_dynvor_ene}) applied
144to the planetary vorticity term.
145\begin{equation} \label{Eq_dynvor_mix}
146\left\{ {
147\begin{aligned}
148 {+\frac{1}{e_{1u} }\; {\overline {\left( {\frac{\zeta }{e_{3f} }} \right)} }^{\,i} 
149 \; {\overline{\overline {\left( {e_{1v} \; e_{3v} \ v} \right)}} }^{\,i,j+1/2} -\frac{1}{e_{1u} }
150 \; {\overline {\left( {\frac{f}{e_{3f} }} \right)
151 \;\overline {\left( {e_{1v} \; e_{3v} \ v} \right)} ^{\,i+1/2}} }^{\,j} } \\
152{-\frac{1}{e_{2v} }\; {\overline {\left( {\frac{\zeta }{e_{3f} }} \right)} }^j
153 \; {\overline{\overline {\left( {e_{2u} \; e_{3u} \ u} \right)}} }^{\,i+1/2,j} +\frac{1}{e_{2v} }
154 \; {\overline {\left( {\frac{f}{e_{3f} }} \right)
155 \;\overline {\left( {e_{2u}\; e_{3u} \ u} \right)} ^{\,j+1/2}} }^{\,i} } \hfill
156\end{aligned} 
157} \right.
158\end{equation} 
159
160%-------------------------------------------------------------
161%                 energy and enstrophy conserving scheme
162%-------------------------------------------------------------
163\subsubsection{Energy and enstrophy conserving scheme (\np{ln\_dynvor\_een}=.true.) }
164\label{DYN_vor_een}
165
166In the energy and enstrophy conserving scheme (EEN scheme), the vorticity term
167is  evaluated using the vorticity advection scheme of \citet{Arakawa1990}.
168This scheme conserves both total energy and potential enstrophy in the limit of
169horizontally nondivergent flow ($i.e. \ \chi=0$). While EEN is more complicated
170than ENS or ENE and does not conserve potential enstrophy and total energy in
171general flow, it tolerates arbitrarily thin layers. This feature is essential for
172$z$-coordinate with partial step.
173%%%
174\gmcomment{gm :   it actually conserve kinetic energy  !   show that in appendix C }
175%%%
176
177The \citet{Arakawa1990} vorticity advection scheme for a single layer is modified
178for spherical coordinates as described by \citet{Arakawa1981} to obtain the EEN
179scheme. The potential vorticity, defined at an $f$-point, is:
180\begin{equation} \label{Eq_pot_vor}
181q_f  = \frac{\zeta +f} {e_{3f} }
182\end{equation}
183where the relative vorticity is defined by (\ref{Eq_divcur_cur}), the Coriolis parameter
184is given by $f=2 \,\Omega \;\sin \varphi _f $ and the layer thickness at $f$-points is:
185\begin{equation} \label{Eq_een_e3f}
186e_{3f} = \overline{\overline {e_{3t} }} ^{\,i+1/2,j+1/2}
187\end{equation}
188
189%>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
190\begin{figure}[!ht] \label{Fig_DYN_een_triad}
191\begin{center}
192\includegraphics[width=0.70\textwidth]{./TexFiles/Figures/Fig_DYN_een_triad.pdf}
193\caption{Triads used in the energy and enstrophy conserving scheme (een) for
194$u$-component (upper panel) and $v$-component (lower panel).}
195\end{center}
196\end{figure}
197%>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
198
199Note that a key point in \eqref{Eq_een_e3f} is that the averaging in \textbf{i}- and
200\textbf{j}- directions uses the masked vertical scale factor but is always divided by
201$4$, not by the sum of the mask at $T$-point. This preserves the continuity of
202$e_{3f}$ when one or more of the neighbouring $e_{3T}$ tends to zero and
203extends by continuity the value of $e_{3f}$ in the land areas.
204%%%
205\gmcomment{this has to be further investigate in case of several step topography}
206%%%
207
208The vorticity terms are represented as:
209\begin{equation} \label{Eq_dynvor_een}
210\left\{ {
211\begin{aligned}
212 +q\,e_3 \, v  &\equiv +\frac{1}{e_{1u} }  \left[
213{{\begin{array}{*{20}c}
214      {\,\ \ a_{j+1/2}^{i   } \left( {e_{1v} e_{3v} \ v} \right)_{j+1}^{i+1/2} } 
215   {\,+\,b_{j+1/2}^{i   } \left( {e_{1v} e_{3v} \ v} \right)_{j+1}^{i-1/2}  } \\
216 \\
217     {  +\,c_{j-1/2}^{i   }  \left( {e_{1v} e_{3v} \ v} \right)_{j    }^{i+1/2}         } 
218   {\,+\,d_{j+1/2}^{i   } \left( {e_{1v} e_{3v} \ v} \right)_{j+1}^{i+1/2} } \\
219\end{array} }} \right] \\ 
220\\
221-q\,e_3 \,u       &\equiv -\frac{1}{e_{2v} }  \left[
222{{\begin{array}{*{20}c}
223   {\,\ \ a_{j-1/2}^{i   }  \left( {e_{2u} e_{3u} \ u} \right)_{j+1}^{i+1/2} } 
224   {\,+\,b_{j-1/2}^{i+1}  \left( {e_{2u} e_{3u} \ u} \right)_{j+1/2}^{i+1} } \\
225 \\
226      {  +\,c_{j+1/2}^{i+1} \left( {e_{2u} e_{3u} \ u} \right)_{j+1/2}^{i+1} } 
227   {\,+\,d_{j+1/2}^{i   }  \left( {e_{2u} e_{3u} \ u} \right)_{j+1/2}^{i   } } \\
228\end{array} }} \right]
229\end{aligned} 
230} \right.
231\end{equation} 
232where $a$, $b$, $c$ and $d$ are triad combinations of the neighbouring
233potential vorticities (Fig. \ref{Fig_DYN_een_triad}):
234\begin{equation} \label{Eq_een_triads}
235\left\{ 
236\begin{aligned}
237 a_{\,j+1/2}^i & = \frac{1}  {12} \left( q_{j+1/2}^{i+1} + q_{j+1 /2}^i + q_{j-1/2}^\right)    \\ 
238 \\
239 b_{\,j+1/2}^i & = \frac{1}  {12} \left( q_{j+1/2}^{i-1} +q_{j+1/2}^i +q_{j-1/2}^i   \right)     \\ 
240\\
241 c_{\,j+1/2}^i & = \frac{1}  {12} \left( q_{j-1/2}^{i-1} +q_{j+1/2}^i +q_{j-1/2}^i   \right)     \\ 
242\\
243 d_{\,j+1/2}^i & = \frac{1}  {12} \left( q_{j-1/2}^{i+1} +q_{j+1/2}^i +q_{j-1/2}^\right)     \\ 
244\end{aligned} 
245\right.
246\end{equation}
247
248%--------------------------------------------------------------------------------------------------------------
249%           Kinetic Energy Gradient term
250%--------------------------------------------------------------------------------------------------------------
251\subsection   [Kinetic Energy Gradient term (\textit{dynkeg})]
252         {Kinetic Energy Gradient term (\mdl{dynkeg})}
253\label{DYN_keg}
254
255As demonstarted in Appendix~\ref{Apdx_C}, there is a single discrete formulation
256of the kinetic energy gradient term that, together with the formulation chosen for
257the vertical advection (see below), conserves the total kinetic energy:
258\begin{equation} \label{Eq_dynkeg}
259\left\{ \begin{aligned}
260 -\frac{1}{2 \; e_{1u} } 
261 & \ \delta _{i+1/2} \left[ {\overline {u^2}^{\,i} + \overline{v^2}^{\,j}} \right]   \\
262 -\frac{1}{2 \; e_{2v} } 
263 & \ \delta _{j+1/2} \left[ {\overline {u^2}^{\,i} + \overline{v^2}^{\,j}} \right]   
264\end{aligned} \right.
265\end{equation} 
266
267%--------------------------------------------------------------------------------------------------------------
268%           Vertical advection term
269%--------------------------------------------------------------------------------------------------------------
270\subsection   [Vertical advection term (\textit{dynzad}) ]
271         {Vertical advection term (\mdl{dynzad}) }
272\label{DYN_zad}
273
274The discrete formulation of the vertical advection, together with the formulation
275chosen for the gradient of kinetic energy (KE) term, conserves the total kinetic
276energy. Indeed, the change of KE due to the vertical advection is exactly
277balanced by the change of KE due to the gradient of KE (see Appendix~\ref{Apdx_C}).
278\begin{equation} \label{Eq_dynzad}
279\left\{     \begin{aligned}
280 -\frac{1}  { e_{1u}\,e_{2u}\,e_{3u} }  & 
281  \ {\overline {\overline{ e_{1T}\,e_{2T}\,w } ^{\,i+1/2}  \;\delta _{k+1/2} \left[ u \right]  }^{\,k}   } \\
282 -\frac{1}  { e_{1v}\,e_{2v}\,e_{3v} }  &
283  \ {\overline {\overline{ e_{1T}\,e_{2T}\,w } ^{\,j+1/2}  \;\delta _{k+1/2} \left[ u \right]  }^{\,k}   }
284\end{aligned} \right.
285\end{equation} 
286
287% ================================================================
288% Coriolis and Advection : flux form
289% ================================================================
290\section{Coriolis and Advection: flux form}
291\label{DYN_adv_cor_flux}
292%------------------------------------------nam_dynadv----------------------------------------------------
293\namdisplay{nam_dynadv} 
294%-------------------------------------------------------------------------------------------------------------
295
296In the flux form (as in the vector invariant form), the Coriolis and momentum
297advection terms are evaluated using a leapfrog scheme, $i.e.$ the velocity
298appearing in their expressions is centred in time (\textit{now} velocity). At the
299lateral boundaries either free slip, no slip or partial slip boundary conditions
300are applied following Chap.\ref{LBC}.
301
302
303%--------------------------------------------------------------------------------------------------------------
304%           Coriolis plus curvature metric terms
305%--------------------------------------------------------------------------------------------------------------
306\subsection   [Coriolis plus curvature metric terms (\textit{dynvor}) ]
307         {Coriolis plus curvature metric terms (\mdl{dynvor}) }
308\label{DYN_cor_flux}
309
310In flux form, the vorticity term reduces to a Coriolis term in which the Coriolis
311parameter has been modified to account for the "metric" term. This altered
312Coriolis parameter is thus discretised at $f$-points. It is given by:
313\begin{multline} \label{Eq_dyncor_metric}
314f+\frac{1}{e_1 e_2 }\left( {v\frac{\partial e_2 }{\partial i}  -  u\frac{\partial e_1 }{\partial j}} \right\\
315   \equiv   f + \frac{1}{e_{1f} e_{2f} } 
316   \left( { \ \overline v ^{i+1/2}\delta _{i+1/2} \left[ {e_{2u} } \right] 
317            -  \overline u ^{j+1/2}\delta _{j+1/2} \left[ {e_{1u} } \right]  }  \ \right)
318\end{multline} 
319
320Any of the (\ref{Eq_dynvor_ens}), (\ref{Eq_dynvor_ene}) and (\ref{Eq_dynvor_een})
321schemes can be used to compute the product of the Coriolis parameter and the
322vorticity. However, the energy-conserving scheme  (\ref{Eq_dynvor_een}) has
323exclusively been used to date. This term is evaluated using a leapfrog scheme,
324$i.e.$ the velocity is centred in time (\textit{now} velocity).
325
326%--------------------------------------------------------------------------------------------------------------
327%           Flux form Advection term
328%--------------------------------------------------------------------------------------------------------------
329\subsection   [Flux form Advection term (\textit{dynadv}) ]
330         {Flux form Advection term (\mdl{dynadv}) }
331\label{DYN_adv_flux}
332
333The discrete expression of the advection term is given by :
334\begin{equation} \label{Eq_dynadv}
335\left\{ 
336\begin{aligned}
337\frac{1}{e_{1u}\,e_{2u}\,e_{3u}} 
338\left(      \delta _{i+1/2} \left[ \overline{e_{2u}\,e_{3u}\ u }^{i       }  \ u_T      \right]   
339          + \delta _{j       } \left[ \overline{e_{1u}\,e_{3u}\ v }^{i+1/2}  \ u_F      \right] \right\ \;   \\
340\left.   + \delta _{k      } \left[ \overline{e_{1w}\,e_{2w} w}^{i+1/2}  \ u_{uw} \right] \right)   \\
341\\
342\frac{1}{e_{1v}\,e_{2v}\,e_{3v}} 
343\left(   \delta _{i      } \left[  \overline{e_{2u}\,e_{3u } \ u }^{j+1/2} \ v_F       \right] 
344         + \delta _{j+1/2} \left[ \overline{e_{1u}\,e_{3u } \ v }^{i       } \ v_T       \right] \right\ \, \\
345\left.  + \delta _{k     } \left[  \overline{e_{1w}\,e_{2w} \ w}^{j+1/2} \ v_{vw}  \right] \right) \\
346\end{aligned}
347\right.
348\end{equation}
349
350Two advection schemes are available: a $2^{nd}$ order centered finite
351difference scheme, CEN2, or a $3^{rd}$ order upstream biased scheme, UBS.
352The latter is described in \citet{Sacha2005}. The schemes are selected using
353the namelist logicals \np{ln\_dynadv\_cen2} and \np{ln\_dynadv\_ubs}. In flux
354form, the schemes differ by the choice of a space and time interpolation to
355define the value of $u$ and $v$ at the centre of each face of $u$- and $v$-cells,
356$i.e.$ at the $T$-, $f$-, and $uw$-points for $u$ and at the $f$-, $T$- and
357$vw$-points for $v$.
358
359%-------------------------------------------------------------
360%                 2nd order centred scheme
361%-------------------------------------------------------------
362\subsubsection{$2^{nd}$ order centred scheme (cen2) (\np{ln\_dynadv\_cen2}=.true.)}
363\label{DYN_adv_cen2}
364
365In the centered $2^{nd}$ order formulation, the velocity is evaluated as the
366mean of the two neighbouring points :
367\begin{equation} \label{Eq_dynadv_cen2}
368\left\{     \begin{aligned}
369 u_T^{cen2} &=\overline u^{i }      \quad & 
370  u_F^{cen2} &=\overline u^{j+1/2}     \quad &
371 u_{uw}^{cen2} &=\overline u^{k+1/2}      \\
372 v_F^{cen2} &=\overline v ^{i+1/2}     \quad &
373 v_F^{cen2} &=\overline v^j      \quad &
374 v_{vw}^{cen2} &=\overline v ^{k+1/2}      \\
375\end{aligned} \right.
376\end{equation} 
377
378The scheme is non diffusive (i.e. conserves the kinetic energy) but dispersive
379($i.e.$ it may create false extrema). It is therefore notoriously noisy and must
380be used in conjunction with an explicit diffusion operator to produce a sensible
381solution. The associated time-stepping is performed using a leapfrog scheme in conjunction with an Asselin time-filter, so $u$ and $v$ are the \emph{now} 
382velocities.
383
384%-------------------------------------------------------------
385%                 UBS scheme
386%-------------------------------------------------------------
387\subsubsection{Upstream Biased Scheme (UBS) (\np{ln\_dynadv\_ubs}=.true.)}
388\label{DYN_adv_ubs}
389
390The UBS advection scheme is an upstream biased third order scheme based on
391an upstream-biased parabolic interpolation. For example, the evaluation of
392$u_T^{ubs} $ is done as follows:
393\begin{equation} \label{Eq_dynadv_ubs}
394u_T^{ubs} =\overline u ^i-\;\frac{1}{6}   \begin{cases}
395      u"_{i-1/2}&    \text{if $\ \overline{e_{2u}\,e_{3u} \ u}^i  \geqslant 0$ }    \\
396      u"_{i+1/2}&    \text{if $\ \overline{e_{2u}\,e_{3u} \ u}^i  < 0$ }
397\end{cases}
398\end{equation}
399where $u"_{i+1/2} =\delta _{i+1/2} \left[ {\delta _i \left[ u \right]} \right]$. This results
400in a dissipatively dominant ($i.e.$ hyper-diffusive) truncation error \citep{Sacha2005}.
401The overall performance of the advection scheme is similar to that reported in
402\citet{Farrow1995}. It is a relatively good compromise between accuracy and
403smoothness. It is not a \emph{positive} scheme, meaning that false extrema are
404permitted. But the amplitudes of the false extrema are significantly reduced over
405those in the centred second order method.
406
407The UBS scheme is not used in all directions. In the vertical, the centred $2^{nd}$ 
408order evaluation of the advection is preferred, $i.e.$ $u_{uw}^{ubs}$ and
409$u_{vw}^{ubs}$ in \eqref{Eq_dynadv_cen2} are used. UBS is diffusive and is
410associated with vertical mixing of momentum. \gmcomment{ gm  pursue the
411sentence:Since vertical mixing of momentum is a source term of the TKE equation...  }
412
413For stability reasons,  the first term in (\ref{Eq_dynadv_ubs}), which corresponds
414to a second order centred scheme, is evaluated using the \textit{now} velocity
415(centred in time), while the second term, which is the diffusive part of the scheme,
416is evaluated using the \textit{before} velocity (forward in time). This is discussed
417by \citet{Webb1998} in the context of the Quick advection scheme.
418
419Note that the UBS and Quadratic Upstream Interpolation for Convective Kinematics
420(QUICK) schemes only differ by one coefficient. Substituting $1/6$ with $1/8$ in
421(\ref{Eq_dynadv_ubs}) leads to the QUICK advection scheme \citep{Webb1998}.
422This option is not available through a namelist parameter, since the $1/6$ coefficient
423is hard coded. Nevertheless it is quite easy to make the substitution in
424\mdl{dynadv\_ubs} module and obtain a QUICK scheme.
425
426Note also that in the current version of \mdl{dynadv\_ubs}, there is also the
427possibility of using a $4^{th}$ order evaluation of the advective velocity as in
428ROMS. This is an error and should be suppressed soon.
429%%%
430\gmcomment{action :  this have to be done}
431%%%
432
433% ================================================================
434%           Hydrostatic pressure gradient term
435% ================================================================
436\section  [Hydrostatic pressure gradient (\textit{dynhpg})]
437      {Hydrostatic pressure gradient (\mdl{dynhpg})}
438\label{DYN_hpg}
439%------------------------------------------nam_dynhpg---------------------------------------------------
440\namdisplay{nam_dynhpg} 
441\namdisplay{namflg} 
442%-------------------------------------------------------------------------------------------------------------
443%%%
444\gmcomment{Suppress the namflg namelist and incorporate it in the namhpg namelist}
445%%%
446
447The key distinction between the different algorithms used for the hydrostatic
448pressure gradient is the vertical coordinate used, since HPG is a \emph{horizontal} 
449pressure gradient, $i.e.$ computed along geopotential surfaces. As a result, any
450tilt of the surface of the computational levels will require a specific treatment to
451compute the hydrostatic pressure gradient.
452
453The hydrostatic pressure gradient term is evaluated either using a leapfrog scheme,
454$i.e.$ the density appearing in its expression is centred in time (\emph{now} rho), or
455a semi-implcit scheme. At the lateral boundaries either free slip, no slip or partial slip
456boundary conditions are applied.
457
458%--------------------------------------------------------------------------------------------------------------
459%           z-coordinate with full step
460%--------------------------------------------------------------------------------------------------------------
461\subsection   [$z$-coordinate with full step (\np{ln\_dynhpg\_zco}) ]
462         {$z$-coordinate with full step (\np{ln\_dynhpg\_zco}=.true.)}
463\label{DYN_hpg_zco}
464
465The hydrostatic pressure can be obtained by integrating the hydrostatic equation
466vertically from the surface. However, the pressure is large at great depth while its
467horizontal gradient is several orders of magnitude smaller. This may lead to large
468truncation errors in the pressure gradient terms. Thus, the two horizontal components
469of the hydrostatic pressure gradient are computed directly as follows:
470
471for $k=km$ (surface layer, $jk=1$ in the code)
472\begin{equation} \label{Eq_dynhpg_zco_surf}
473\left\{ \begin{aligned}
474               \left. \delta _{i+1/2} \left[  p^h         \right] \right|_{k=km} 
475&= \frac{1}{2} g \   \left. \delta _{i+1/2} \left[  e_{3w} \ \rho \right] \right|_{k=km}   \\
476                  \left. \delta _{j+1/2} \left[  p^h            \right] \right|_{k=km} 
477&= \frac{1}{2} g \   \left. \delta _{j+1/2} \left[  e_{3w} \ \rho \right] \right|_{k=km}   \\
478\end{aligned} \right.
479\end{equation} 
480
481for $1<k<km$ (interior layer)
482\begin{equation} \label{Eq_dynhpg_zco}
483\left\{ \begin{aligned}
484               \left. \delta _{i+1/2} \left[  p^h         \right] \right|_{k} 
485&=             \left. \delta _{i+1/2} \left[  p^h         \right] \right|_{k-1} 
486+    \frac{1}{2}\;g\;   \left. \delta _{i+1/2} \left[  e_{3w} \ \overline {\rho}^{k+1/2} \right] \right|_{k}   \\
487                  \left. \delta _{j+1/2} \left[  p^h            \right] \right|_{k} 
488&=                \left. \delta _{j+1/2} \left[  p^h            \right] \right|_{k-1} 
489+    \frac{1}{2}\;g\;   \left. \delta _{j+1/2} \left[  e_{3w} \ \overline {\rho}^{k+1/2} \right] \right|_{k}   \\
490\end{aligned} \right.
491\end{equation} 
492
493Note that the $1/2$ factor in (\ref{Eq_dynhpg_zco_surf}) is adequate because of
494the definition of $e_{3w}$ as the vertical derivative of the scale factor at the surface
495level ($z=0)$.
496
497%--------------------------------------------------------------------------------------------------------------
498%           z-coordinate with partial step
499%--------------------------------------------------------------------------------------------------------------
500\subsection   [$z$-coordinate with partial step (\np{ln\_dynhpg\_zps})]
501         {$z$-coordinate with partial step (\np{ln\_dynhpg\_zps}=.true.)}
502\label{DYN_hpg_zps}
503
504With partial bottom cells, tracers in horizontally adjacent cells generally live at
505different depths. Before taking horizontal gradients between these tracer points,
506a linear interpolation is used to approximate the deeper tracer as if it actually lived
507at the depth of the shallower tracer point.
508
509Apart from this modification, the horizontal hydrostatic pressure gradient evaluated
510in the $z$-coordinate with partial step is exactly as in the pure $z$-coordinate case.
511As explained in detail in section \S\ref{TRA_zpshde}, the nonlinearity of pressure
512effects in the equation of state is such that it is better to interpolate temperature and
513salinity vertically before computing the density. Horizontal gradients of temperature
514and salinity are needed for the TRA modules, which is the reason why the horizontal
515gradients of density at the deepest model level are computed in module \mdl{zpsdhe} 
516located in the TRA directory and described in \S\ref{TRA_zpshde}.
517
518%--------------------------------------------------------------------------------------------------------------
519%           s- and s-z-coordinates
520%--------------------------------------------------------------------------------------------------------------
521\subsection{$s$- and $z$-$s$-coordinates}
522\label{DYN_hpg_sco}
523
524Pressure gradient formulations in $s$-coordinate have been the subject of a vast
525literature ($e.g.$, \citet{Song1998, Sacha2003}). A number of different pressure
526gradient options are coded, but they are not yet fully documented or tested.
527
528$\bullet$ Traditional coding (see for example \citet{Madec1996}: (\np{ln\_dynhpg\_sco}=.true.,
529\np{ln\_dynhpg\_hel}=.true.)
530\begin{equation} \label{Eq_dynhpg_sco}
531\left\{ \begin{aligned}
532 - \frac{1}                   {\rho_o \, e_{1u}} \;   \delta _{i+1/2} \left[  p^h  \right] 
533+ \frac{g\; \overline {\rho}^{i+1/2}}  {\rho_o \, e_{1u}} \;   \delta _{i+1/2} \left[  z_T  \right]    \\
534 - \frac{1}                   {\rho_o \, e_{2v}} \;   \delta _{j+1/2} \left[  p^h  \right] 
535+ \frac{g\; \overline {\rho}^{j+1/2}}  {\rho_o \, e_{2v}} \;   \delta _{j+1/2} \left[  z_T  \right]    \\
536\end{aligned} \right.
537\end{equation} 
538
539Where the first term is the pressure gradient along coordinates, computed as in
540\eqref{Eq_dynhpg_zco_surf} - \eqref{Eq_dynhpg_zco}, and $z_T$ is the depth of
541the $T$-point evaluated from the sum of the vertical scale factors at the $w$-point
542($e_{3w}$). The version \np{ln\_dynhpg\_hel}=.true. has been added by Aike
543Beckmann and involves a redefinition of the relative position of $T$-points relative
544to $w$-points.
545
546$\bullet$ Weighted density Jacobian (WDJ) \citep{Song1998} (\np{ln\_dynhpg\_wdj}=.true.)
547
548$\bullet$ Density Jacobian with cubic polynomial scheme (DJC) \citep{Sacha2003} 
549(\np{ln\_dynhpg\_djc}=.true.)
550
551$\bullet$ Rotated axes scheme (rot) \citep{Thiem2006} (\np{ln\_dynhpg\_rot}=.true.)
552
553Note that expression \eqref{Eq_dynhpg_sco} is used when the variable volume
554formulation is activated (\key{vvl}) because in that case, even with a flat bottom,
555the coordinate surfaces are not horizontal but follow the free surface
556\citep{Levier2007}. The other pressure gradient options are not yet available.
557
558%--------------------------------------------------------------------------------------------------------------
559%           Time-scheme
560%--------------------------------------------------------------------------------------------------------------
561\subsection   [Time-scheme (\np{ln\_dynhpg\_imp}) ]
562         {Time-scheme (\np{ln\_dynhpg\_imp}=.true./.false.)}
563\label{DYN_hpg_imp}
564
565The default time differencing scheme used for the horizontal pressure gradient is
566a leapfrog scheme and therefore the density used in all discrete expressions given
567above is the  \textit{now} density, computed from the \textit{now} temperature and
568salinity. In some specific cases (usually high resolution simulations over an ocean
569domain which includes weakly stratified regions) the physical phenomenum that
570controls the time-step is internal gravity waves (IGWs). A semi-implicit scheme for
571doubling the stability limit associated with IGWs can be used \citep{Brown1978,
572Maltrud1998}. It involves the evaluation of the hydrostatic pressure gradient as an
573average over the three time levels $t-\Delta t$, $t$, and $t+\Delta t$ ($i.e.$ 
574\textit{before}\textit{now} and  \textit{after} time-steps), rather than at central
575time level $t$ only, as in the standard leapfrog scheme.
576
577$\bullet$ leapfrog scheme (\np{ln\_dynhpg\_imp}=.true.):
578
579\begin{equation} \label{Eq_dynhpg_lf}
580\frac{u^{t+\Delta t}-u^{t-\Delta t}}{2\Delta t}
581=\;\cdots \;-\frac{1}{\rho _o \,e_{1u} }\delta _{i+1/2} \left[ {p_h^t } \right]
582\end{equation}
583
584$\bullet$ semi-implicit scheme (\np{ln\_dynhpg\_imp}=.true.):
585\begin{equation} \label{Eq_dynhpg_imp}
586\frac{u^{t+\Delta t}-u^{t-\Delta t}}{2\Delta t}
587=\;\cdots \;-\frac{1}{\rho _o \,e_{1u} } \delta _{i+1/2} \left[ \frac{ p_h^{t+\Delta t} +2p_h^t
588+p_h^{t-\Delta t} } { 4 }  \right]
589\end{equation}
590
591The semi-implicit time scheme \eqref{Eq_dynhpg_imp} is made possible without
592significant additional computation since the density can be updated to time level
593$t+\Delta t$ before computing the horizontal hydrostatic pressure gradient. It can
594be easily shown that the stability limit associated with the hydrostatic pressure
595gradient doubles using \eqref{Eq_dynhpg_imp} compared to that using the
596standard leapfrog scheme \eqref{Eq_dynhpg_lf}. Note that \eqref{Eq_dynhpg_imp} 
597is equivalent to applying a time filter to the pressure gradient to eliminate high
598frequency IGWs. Obviously, when using \eqref{Eq_dynhpg_imp}, the doubling of
599the time-step is achievable only if no other factors control the time-step, such as
600the stability limits associated with advection or diffusion.
601
602In practice, the semi-implicit scheme is used when \np{ln\_dynhpg\_imp}=.true..
603In this case, we choose to apply the time filter to temperature and salinity used in
604the equation of state, instead of applying it to the hydrostatic pressure or to the
605density, so that no additional storage array has to be defined. The density used to
606compute the hydrostatic pressure gradient (whatever the formulation) is evaluated
607as follows:
608\begin{equation} \label{Eq_rho_flt}
609   \rho^t = \rho( \widetilde{T},\widetilde {S},z_T)
610 \quad     \text{with}  \quad 
611   \widetilde{\,\cdot\,} = \frac{  \,\cdot\,^{t+\Delta t} +2 \,\,\cdot\,^t + \,\cdot\,^{t-\Delta t}  } {4}
612\end{equation}
613\gmcomment{STEVEN: bullets look odd in this, could use X}
614
615Note that in the semi-implicit case, it is necessary to save the filtered density, an
616extra three-dimensional field, in the restart file to restart the model with exact
617reproducibility. This option is controlled by the namelist parameter
618\np{nn\_dynhpg\_rst}=.true..
619
620% ================================================================
621% Surface Pressure Gradient
622% ================================================================
623\section  [Surface pressure gradient (\textit{dynspg}) ]
624      {Surface pressure gradient (\mdl{dynspg})}
625\label{DYN_hpg_spg}
626%-----------------------------------------nam_dynspg----------------------------------------------------
627\namdisplay{nam_dynspg} 
628%------------------------------------------------------------------------------------------------------------
629
630The form of the surface pressure gradient term is dependent on the representation
631of the free surface (\S\ref{PE_hor_pg}). The main distinction is between the fixed
632volume case (linear free surface or rigid lid) and the variable volume case
633(nonlinear free surface, \key{vvl} is defined). In the linear free surface case
634(\S\ref{PE_free_surface}) and the rigid lid case (\S\ref{PE_rigid_lid}), the vertical
635scale factors $e_{3}$ are fixed in time, whilst in the nonlinear case
636(\S\ref{PE_free_surface}) they are time-dependent. With both linear and nonlinear
637free surface, external gravity waves are allowed in the equations, which imposes
638a very small time step when an explicit time stepping is used. Two methods are
639proposed to allow a longer time step for the three-dimensional equations: the
640filtered free surface method, which involves a modification of the continuous
641equations (see \eqref{Eq_PE_flt}), and the split-explicit free surface method
642described below. The extra term introduced in the filtered method is calculated
643implicitly, so that the update of the $next$ velocities is done in module
644\mdl{dynspg\_flt} and not in \mdl{dynnxt}.
645
646%--------------------------------------------------------------------------------------------------------------
647% Linear free surface formulation
648%--------------------------------------------------------------------------------------------------------------
649\subsection{Linear free surface formulation (\key{exp} or \textbf{\_ts} or \textbf{\_flt})}
650\label{DYN_spg_linear}
651
652In the linear free surface formulation, the sea surface height is assumed to be
653small compared to the thickness of the ocean levels, so that $(a)$ the time
654evolution of the sea surface height becomes a linear equation, and $(b)$ the
655thickness of the ocean levels is assumed to be constant with time.
656As mentioned in (\S\ref{PE_free_surface}) the linearization affects the
657conservation of tracers.
658
659%-------------------------------------------------------------
660% Explicit
661%-------------------------------------------------------------
662\subsubsection{Explicit (\key{dynspg\_exp})}
663\label{DYN_spg_exp}
664
665In the explicit free surface formulation, the model time step is chosen to be
666small enough to describe the external gravity waves (typically a few tens of
667seconds). The sea surface height is given by :
668\begin{equation} \label{Eq_dynspg_ssh}
669\frac{\partial \eta }{\partial t}\equiv \frac{\text{EMP}}{\rho _w }+\frac{1}{e_{1T} 
670e_{2T} }\sum\limits_k {\left( {\delta _i \left[ {e_{2u} e_{3u} u} 
671\right]+\delta _j \left[ {e_{1v} e_{3v} v} \right]} \right)} 
672\end{equation}
673where EMP is the surface freshwater budget, expressed in Kg/m$^2$/s
674(which is equal to mm/s), and $\rho _w$=1,000~Kg/m$^3$ is the volumic
675mass of pure water. If river runoff is expressed as a surface freshwater flux
676(see \S\ref{SBC}) then EMP can be written as the evaporation minus
677precipitation, minus the river runoff. The sea-surface height is evaluated
678using a leapfrog scheme in combination with an Asselin time filter, $i.e.$ 
679the velocity appearing in \eqref{Eq_dynspg_ssh} is centred in time
680(\textit{now} velocity).
681
682The surface pressure gradient, also evaluated using a leap-frog scheme, is
683then simply given by :
684\begin{equation} \label{Eq_dynspg_exp}
685\left\{ \begin{aligned}
686 - \frac{1}{e_{1u}} \;  \delta _{i+1/2} \left[  \,\eta\,  \right]    \\
687 - \frac{1}{e_{2v}} \;  \delta _{j+1/2} \left[  \,\eta\,  \right] 
688\end{aligned} \right.
689\end{equation} 
690
691Consistent with the linearization, a factor of $\left. \rho \right|_{k=1} / \rho _o$ 
692is omitted in \eqref{Eq_dynspg_exp}.
693
694%-------------------------------------------------------------
695% Split-explicit time-stepping
696%-------------------------------------------------------------
697\subsubsection{Split-explicit time-stepping (\key{dynspg\_ts})}
698\label{DYN_spg_ts}
699%--------------------------------------------namdom----------------------------------------------------
700\namdisplay{namdom} 
701%--------------------------------------------------------------------------------------------------------------
702
703The split-explicit free surface formulation used in \NEMO follows the one
704proposed by \citet{Griffies2004}. The general idea is to solve the free surface
705equation with a small time step \np{rdtbt}, while the three dimensional
706prognostic variables are solved with a longer time step that is a multiple of
707\np{rdtbt} (Fig.\ref {Fig_DYN_dynspg_ts}).
708
709%>   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >
710\begin{figure}[!t] \label{Fig_DYN_dynspg_ts}
711\begin{center}
712\includegraphics[width=0.90\textwidth]{./TexFiles/Figures/Fig_DYN_dynspg_ts.pdf}
713\caption{Schematic of the split-explicit time stepping scheme for the external
714and internal modes. Time increases to the right.
715Internal mode time steps (which are also the model time steps) are denoted
716by $t-\Delta t$, $t, t+\Delta t$, and $t+2\Delta t$.
717The curved line represents a leap-frog time step, and the smaller time
718steps $N \Delta t_e=\frac{3}{2}\Delta t$ are denoted by the zig-zag line. The vertically
719integrated forcing \textbf{M}(t) computed at the model time step $t$ 
720represents the interaction between the external and internal motions.
721While keeping \textbf{M} and freshwater forcing field fixed, a
722leap-frog integration carries the external mode variables (surface height and vertically integrated velocity) from $t$ to $t+\frac{3}{2} \Delta t$ using N external time steps of length $\Delta t_e$.
723Time averaging the external fields over the $\frac{2}{3}N+1$ time steps (endpoints
724included) centers the vertically integrated velocity and the sea surface height at the model timestep $t+\Delta t$. These averaged values are used to update \textbf{M}(t) with both the surface pressure gradient and the Coriolis force.
725A baroclinic leap-frog time step carries the surface height to The model time stepping scheme can then be achieved by
726$t+\Delta t$ using the convergence of the time averaged vertically integrated
727velocity taken from baroclinic time step t. }
728%%%
729\gmcomment{STEVEN: what does convergence mean in this context?}
730%%%
731\end{center}
732\end{figure}
733%>   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >
734
735The split-explicit formulation has a damping effect on external gravity waves,
736which is weaker damping than for the filtered free surface but still significant as
737shown by \citet{Levier2007} in the case of an analytical barotropic Kelvin wave.
738
739%-------------------------------------------------------------
740% Filtered formulation
741%-------------------------------------------------------------
742\subsubsection{Filtered formulation (\key{dynspg\_flt})}
743\label{DYN_spg_flt}
744
745The filtered formulation follows the \citet{Roullet2000} implementation. The extra
746term introduced in the equations (see {\S}I.2.2) is solved implicitly. The elliptic
747solvers available in the code are documented in \S\ref{MISC}. The amplitude of
748the extra term is given by the namelist variable \np{rnu}. The default value is 1,
749as recommended by \citet{Roullet2000}
750
751\gmcomment{\np{rnu}=1 to be suppressed from namelist !}
752
753%-------------------------------------------------------------
754% Non-linear free surface formulation
755%-------------------------------------------------------------
756\subsection{Non-linear free surface formulation (\key{vvl})}
757\label{DYN_spg_vvl}
758
759In the non-linear free surface formulation, the variations of volume are fully
760taken into account. This option is presented in a report \citep{Levier2007} 
761available on the \NEMO web site. The three time-stepping methods (explicit,
762split-explicit and filtered) are the same as in \S\ref{DYN_spg_linear} except
763that the ocean depth is now time-dependent. In particular, this means that
764in the filtered case, the matrix to be inverted has to be recomputed at each
765time-step.
766
767%--------------------------------------------------------------------------------------------------------------
768%           Rigid-lid formulation
769%--------------------------------------------------------------------------------------------------------------
770\subsection{Rigid-lid formulation (\key{dynspg\_rl})}
771\label{DYN_spg_rl}
772
773With the rigid lid formulation, an elliptic equation has to be solved for
774the barotropic streamfunction. For consistency this equation is obtained by
775taking the discrete curl of the discrete vertical sum of the discrete
776momentum equation:
777\begin{equation}\label{Eq_dynspg_rl}
778\frac{1}{\rho _o }\nabla _h p_s \equiv \left( {{\begin{array}{*{20}c}
779 {\overline M_u +\frac{1}{H\;e_2 } \delta_ j \left[ \partial_t \psi \right]}      \\
780 \\
781 {\overline M_v -\frac{1}{H\;e_1 }  \delta_\left[ \partial_t \psi \right]}        \\
782\end{array} }} \right)
783\end{equation}
784
785Here ${\rm {\bf M}}= \left( M_u,M_v \right)$ represents the collected
786contributions of nonlinear, viscous and hydrostatic pressure gradient terms in
787\eqref{Eq_PE_dyn} and the overbar indicates a vertical average over the
788whole water column (i.e. from $z=-H$, the ocean bottom, to $z=0$, the rigid-lid).
789The time derivative of $\psi$ is the solution of an elliptic equation:
790\begin{multline} \label{Eq_bsf}
791   \delta_{i+1/2} \left[ \frac{e_{2v}}{H_v\;e_{1v}} \delta_{i} \left[  \partial_t \psi \right] \right]
792+ \delta_{j+1/2} \left[ \frac{e_{1u}}{H_u\;e_{2u}} \delta_{j} \left[  \partial_t \psi \right] \right]
793\\ =
794  \delta_{i+1/2} \left[ e_{2v} M_v  \right]
795- \delta_{j+1/2} \left[ e_{1u} M_u  \right]
796\end{multline}
797
798The elliptic solvers available in the code are documented in \S\ref{MISC}).
799The boundary conditions must be given on all separate landmasses (islands),
800which is done by integrating the vorticity equation around each island. This
801requires identifying each island in the bathymetry file, a cumbersome task.
802This explains why the rigid lid option is not recommended with complex
803domains such as the global ocean. Parameters jpisl (number of islands) and
804jpnisl (maximum number of points per island) of the \hf{par\_oce} file are
805related to this option.
806
807
808% ================================================================
809% Lateral diffusion term
810% ================================================================
811\section  [Lateral diffusion term (\textit{dynldf})]
812      {Lateral diffusion term (\mdl{dynldf})}
813\label{DYN_ldf}
814%------------------------------------------nam_dynldf----------------------------------------------------
815\namdisplay{nam_dynldf} 
816%-------------------------------------------------------------------------------------------------------------
817
818The options available for lateral diffusion are for the choice of  laplacian
819(rotated or not) or biharmonic operators. The coefficients may be constant
820or spatially variable; the description of the coefficients is found in the chapter
821on lateralphysics (Chap.\ref{LDF}). The lateral diffusion of momentum is
822evaluated using a forward scheme, i.e. the velocity appearing in its expression
823is the \textit{before} velocity in time, except for the pure vertical component
824that appears when a tensor of rotation is used. This latter term is solved
825implicitly together with the vertical diffusion term (see \S\ref{DOM_nxt})
826
827At the lateral boundaries either free slip, no slip or partial slip boundary
828conditions are applied according to the user's choice (see Chap.\ref{LBC}).
829
830% ================================================================
831\subsection   [Iso-level laplacian operator (\np{ln\_dynldf\_lap}) ]
832         {Iso-level laplacian operator (\np{ln\_dynldf\_lap}=.true.)}
833\label{DYN_ldf_lap}
834
835For lateral iso-level diffusion, the discrete operator is:
836\begin{equation} \label{Eq_dynldf_lap}
837\left\{ \begin{aligned}
838 D_u^{l{\rm {\bf U}}} =\frac{1}{e_{1u} }\delta _{i+1/2} \left[ {A_T^{lm} 
839\;\chi } \right]-\frac{1}{e_{2u} {\kern 1pt}e_{3u} }\delta _j \left[
840{A_f^{lm} \;e_{3f} \zeta } \right] \\ 
841\\
842 D_v^{l{\rm {\bf U}}} =\frac{1}{e_{2v} }\delta _{j+1/2} \left[ {A_T^{lm} 
843\;\chi } \right]+\frac{1}{e_{1v} {\kern 1pt}e_{3v} }\delta _i \left[
844{A_f^{lm} \;e_{3f} \zeta } \right] \\ 
845\end{aligned} \right.
846\end{equation} 
847
848As explained in \S\ref{PE_ldf}, this formulation (as the gradient of a divergence
849and curl of the vorticity) preserves symmetry and ensures a complete
850separation between the vorticity and divergence parts. Note that in the full step
851$z$-coordinate (\key{zco} is defined), $e_{3u} =e_{3v} =e_{3f}$ so that they
852cancel in the rotational part of \eqref{Eq_dynldf_lap}.
853
854%--------------------------------------------------------------------------------------------------------------
855%           Rotated laplacian operator
856%--------------------------------------------------------------------------------------------------------------
857\subsection   [Rotated laplacian operator (\np{ln\_dynldf\_iso}) ]
858         {Rotated laplacian operator (\np{ln\_dynldf\_iso}=.true.)}
859\label{DYN_ldf_iso}
860
861A rotation of the lateral momentum diffusive operator is needed in several cases:
862for iso-neutral diffusion in $z$-coordinate (\np{ln\_dynldf\_iso}=.true.) and for
863either iso-neutral (\np{ln\_dynldf\_iso}=.true.) or geopotential
864(\np{ln\_dynldf\_hor}=.true.) diffusion in $s$-coordinate. In the partial step
865case, coordinates are horizontal excepted at the deepest level and no
866rotation is performed when \np{ln\_dynldf\_hor}=.true.. The diffusive operator
867is defined simply as the divergence of down gradient momentum fluxes on each
868momentum component. It must be emphasized that this formulation ignores
869constraints on the stress tensor such as symmetry. The resulting discrete
870representation is:
871\begin{equation} \label{Eq_dyn_ldf_iso}
872\begin{split}
873 D_u^{l\textbf{U}} &= \frac{1}{e_{1u} \, e_{2u} \, e_{3u} } \\
874&  \left\{\quad  {\delta _{i+1/2} \left[ {A_T^{lm}  \left(
875    {\frac{e_{2T} \; e_{3T} }{e_{1T} } \,\delta _{i}[u]
876   -e_{2T} \; r_{1T} \,\overline{\overline {\delta _{k+1/2}[u]}}^{\,i,\,k}}
877 \right)} \right]}   \right.
878\\ 
879& \qquad +\ \delta_j \left[ {A_f^{lm} \left( {\frac{e_{1f}\,e_{3f} }{e_{2f} 
880}\,\delta _{j+1/2} [u] - e_{1f}\, r_{2f} 
881\,\overline{\overline {\delta _{k+1/2} [u]}} ^{\,j+1/2,\,k}} 
882\right)} \right]
883\\ 
884&\qquad +\ \delta_k \left[ {A_{uw}^{lm} \left( {-e_{2u} \, r_{1uw} \,\overline{\overline 
885{\delta_{i+1/2} [u]}}^{\,i+1/2,\,k+1/2} } 
886\right.} \right.
887\\ 
888&  \ \qquad \qquad \qquad \quad\
889- e_{1u} \, r_{2uw} \,\overline{\overline {\delta_{j+1/2} [u]}} ^{\,j,\,k+1/2}
890\\ 
891& \left. {\left. { \ \qquad \qquad \qquad \ \ \ \left. {\
892+\frac{e_{1u}\, e_{2u} }{e_{3uw} }\,\left( {r_{1uw}^2+r_{2uw}^2} 
893\right)\,\delta_{k+1/2} [u]} \right)} \right]\;\;\;} \right\} 
894\\
895\\
896 D_v^{l\textbf{V}} &= \frac{1}{e_{1v} \, e_{2v} \, e_{3v} }    \\
897&  \left\{\quad  {\delta _{i+1/2} \left[ {A_f^{lm}  \left(
898    {\frac{e_{2f} \; e_{3f} }{e_{1f} } \,\delta _{i+1/2}[v]
899   -e_{2f} \; r_{1f} \,\overline{\overline {\delta _{k+1/2}[v]}}^{\,i+1/2,\,k}}
900 \right)} \right]}   \right.
901\\ 
902& \qquad +\ \delta_j \left[ {A_T^{lm} \left( {\frac{e_{1T}\,e_{3T} }{e_{2T} 
903}\,\delta _{j} [v] - e_{1T}\, r_{2T} 
904\,\overline{\overline {\delta _{k+1/2} [v]}} ^{\,j,\,k}} 
905\right)} \right]
906\\ 
907& \qquad +\ \delta_k \left[ {A_{vw}^{lm} \left( {-e_{2v} \, r_{1vw} \,\overline{\overline 
908{\delta_{i+1/2} [v]}}^{\,i+1/2,\,k+1/2} }\right.} \right.
909\\
910&  \ \qquad \qquad \qquad \quad\
911- e_{1v} \, r_{2vw} \,\overline{\overline {\delta_{j+1/2} [v]}} ^{\,j+1/2,\,k+1/2}
912\\ 
913& \left. {\left. { \ \qquad \qquad \qquad \ \ \ \left. {\
914+\frac{e_{1v}\, e_{2v} }{e_{3vw} }\,\left( {r_{1vw}^2+r_{2vw}^2} 
915\right)\,\delta_{k+1/2} [v]} \right)} \right]\;\;\;} \right\} 
916 \end{split}
917\end{equation}
918where $r_1$ and $r_2$ are the slopes between the surface along which the
919diffusive operator acts and the surface of computation ($z$- or $s$-surfaces).
920The way these slopes are evaluated is given in the lateral physics chapter
921(Chap.\ref{LDF}).
922
923%--------------------------------------------------------------------------------------------------------------
924%           Iso-level bilaplacian operator
925%--------------------------------------------------------------------------------------------------------------
926\subsection   [Iso-level bilaplacian operator (\np{ln\_dynldf\_bilap})]
927         {Iso-level bilaplacian operator (\np{ln\_dynldf\_bilap}=.true.)}
928\label{DYN_ldf_bilap}
929
930The lateral fourth order operator formulation on momentum is obtained by
931applying \eqref{Eq_dynldf_lap} twice. It requires an additional assumption on
932boundary conditions: the first derivative term normal to the coast depends on
933the free or no-slip lateral boundary conditions chosen, while the third
934derivative terms normal to the coast are set to zero (see Chap.\ref{LBC}).
935%%%
936\gmcomment{add a remark on the the change in the position of the coefficient}
937%%%
938
939% ================================================================
940%           Vertical diffusion term
941% ================================================================
942\section  [Vertical diffusion term (\mdl{dynzdf})]
943      {Vertical diffusion term (\mdl{dynzdf})}
944\label{DYN_zdf}
945%----------------------------------------------namzdf------------------------------------------------------
946\namdisplay{namzdf} 
947%-------------------------------------------------------------------------------------------------------------
948
949The large vertical diffusion coefficient found in the surface mixed layer together
950with high vertical resolution implies that in the case of explicit time stepping there
951would be too restrictive a constraint on the time step. Two time stepping schemes
952can be used for the vertical diffusion term : $(a)$ a forward time differencing
953scheme (\np{ln\_zdfexp}=.true.) using a time splitting technique
954(\np{n\_zdfexp} $>$ 1) or $(b)$ a backward (or implicit) time differencing scheme
955(\np{ln\_zdfexp}=.false.) (see \S\ref{DOM_nxt}). Note that namelist variables
956\np{ln\_zdfexp} and \np{n\_zdfexp} apply to both tracers and dynamics.
957
958The formulation of the vertical subgrid scale physics is the same whatever
959the vertical coordinate is. The vertical diffusion operators given by
960\eqref{Eq_PE_zdf} take the following semi-discrete space form:
961\begin{equation} \label{Eq_dynzdf}
962\left\{   \begin{aligned}
963D_u^{vm} &\equiv \frac{1}{e_{3u}} \ \delta _k \left[ \frac{A_{uw}^{vm} }{e_{3uw} }
964                              \ \delta _{k+1/2} [\,u\,]         \right]     \\
965\\
966D_v^{vm} &\equiv \frac{1}{e_{3v}} \ \delta _k \left[ \frac{A_{vw}^{vm} }{e_{3vw} }
967                              \ \delta _{k+1/2} [\,v\,]         \right]
968\end{aligned}   \right.
969\end{equation} 
970where $A_{uw}^{vm} $ and $A_{vw}^{vm} $ are the vertical eddy viscosity and
971diffusivity coefficients. The way these coefficients are evaluated
972depends on the vertical physics used (see \S\ref{ZDF}).
973
974The surface boundary condition on momentum is given by the stress exerted by
975the wind. At the surface, the momentum fluxes are prescribed as the boundary
976condition on the vertical turbulent momentum fluxes,
977\begin{equation} \label{Eq_dynzdf_sbc}
978\left.{\left( {\frac{A^{vm} }{e_3 }\ \frac{\partial \textbf{U}_h}{\partial k}} \right)} \right|_{z=1}
979    = \frac{1}{\rho _o} \binom{\tau _u}{\tau _v }
980\end{equation}
981where $\left( \tau _u ,\tau _v \right)$ are the two components of the wind stress
982vector in the (\textbf{i},\textbf{j}) coordinate system. The high mixing coefficients
983in the surface mixed layer ensure that the surface wind stress is distributed in
984the vertical over the mixed layer depth. If the vertical mixing coefficient
985is small (when no mixed layer scheme is used) the surface stress enters only
986the top model level, as a body force. The surface wind stress is calculated
987in the surface module routines (SBC, see Chap.\ref{SBC})
988
989The turbulent flux of momentum at the bottom of the ocean is specified through
990a bottom friction parameterization (see \S\ref{ZDF_bfr})
991
992% ================================================================
993% External Forcing
994% ================================================================
995\section{External Forcings}
996\label{DYN_forcing}
997
998Besides the surface and bottom stresses (see the above section) which are
999introduced as boundary conditions on the vertical mixing, two other forcings
1000enter the dynamical equations.
1001
1002One is the effect of atmospheric pressure on the ocean dynamics (to be
1003introduced later).
1004
1005Another forcing term is the tidal potential, which will be introduced in the
1006reference version soon.
1007
1008% ================================================================
1009% Time evolution term
1010% ================================================================
1011\section  [Time evolution term (\textit{dynnxt})]
1012      {Time evolution term (\mdl{dynnxt})}
1013\label{DYN_nxt}
1014
1015%----------------------------------------------namdom----------------------------------------------------
1016\namdisplay{namdom} 
1017%-------------------------------------------------------------------------------------------------------------
1018
1019The general framework for dynamics time stepping is a leap-frog scheme,
1020$i.e.$ a three level centred time scheme associated with an Asselin time filter
1021(cf. \S\ref{DOM_nxt})
1022\begin{equation} \label{Eq_dynnxt}
1023\begin{split}
1024&u^{t+\Delta t} = u^{t-\Delta t} + 2 \, \Delta t  \ \text{RHS}_u^t   \\
1025\\
1026&u_f^t \;\quad = u^t+\gamma \,\left[ {u_f^{t-\Delta t} -2u^t+u^{t+\Delta t}} \right]
1027\end{split}
1028\end{equation} 
1029where RHS is the right hand side of the momentum equation, the subscript $f$ 
1030denotes filtered values and $\gamma$ is the Asselin coefficient. $\gamma$ is
1031initialized as \np{atfp} (namelist parameter). Its default value is \np{atfp} = 0.1.
1032
1033Note that whith the filtered free surface, the update of the \textit{next} velocities
1034is done in the \mdl{dynsp\_flt} module, and only the swap of arrays
1035and Asselin filtering is done in \mdl{dynnxt.}
1036
1037% ================================================================
1038% Diagnostic variables
1039% ================================================================
1040\section{Diagnostic variables ($\zeta$, $\chi$, $w$)}
1041\label{DYN_divcur_wzv}
1042
1043%--------------------------------------------------------------------------------------------------------------
1044%           Horizontal divergence and relative vorticity
1045%--------------------------------------------------------------------------------------------------------------
1046\subsection   [Horizontal divergence and relative vorticity (\textit{divcur})]
1047         {Horizontal divergence and relative vorticity (\mdl{divcur})}
1048\label{DYN_divcur}
1049
1050The vorticity is defined at an $f$-point ($i.e.$ corner point) as follows:
1051\begin{equation} \label{Eq_divcur_cur}
1052\zeta =\frac{1}{e_{1f}\,e_{2f} }\left( {\;\delta _{i+1/2} \left[ {e_{2v}\;v} \right]
1053                          -\delta _{j+1/2} \left[ {e_{1u}\;u} \right]\;} \right)
1054\end{equation} 
1055
1056The horizontal divergence is defined at a $T$-point. It is given by:
1057\begin{equation} \label{Eq_divcur_div}
1058\chi =\frac{1}{e_{1T}\,e_{2T}\,e_{3T} }
1059      \left( {\delta _i \left[ {e_{2u}\,e_{3u}\,u} \right]
1060           +\delta _j \left[ {e_{1v}\,e_{3v}\,v} \right]} \right)
1061\end{equation} 
1062
1063Note that in the $z$-coordinate with full step (\key{zco} is defined), $e_{3u} =e_{3v} =e_{3f}$ so that they cancel in \eqref{Eq_divcur_div}.
1064
1065Note also that whereas the vorticity have the same discrete expression in $z$-
1066and $s$-coordinate, its physical meaning is not identical. $\zeta$ is a pseudo
1067vorticity along $s$-surfaces (only pseudo because $(u,v)$ are still defined along
1068geopotential surfaces, but are no more necessary defined at the same depth).
1069
1070The vorticity and divergence at the \textit{before} step are used in the computation
1071of the horizontal diffusion of momentum. Note that because they have been
1072calculated prior to the Asselin filtering of the \textit{before} velocities, the
1073\textit{before} vorticity and divergence arrays must be included in the restart file
1074to ensure perfect restartability. The vorticity and divergence at the \textit{now} 
1075time step are used for the computation of the nonlinear advection and of the
1076vertical velocity respectively.
1077
1078%--------------------------------------------------------------------------------------------------------------
1079%           Vertical Velocity
1080%--------------------------------------------------------------------------------------------------------------
1081\subsection   [Vertical velocity (\textit{wzvmod})]
1082         {Vertical velocity (\mdl{wzvmod})}
1083\label{DYN_wzv}
1084
1085The vertical velocity is computed by an upward integration of the horizontal
1086divergence from the bottom :
1087
1088\begin{equation} \label{Eq_wzv}
1089\left\{   \begin{aligned}
1090&\left. w \right|_{3/2} \quad= 0    \\
1091\\
1092&\left. w \right|_{k+1/2}     = \left. w \right|_{k+1/2}  + e_{3t}\;  \left. \chi \right|_
1093\end{aligned}   \right.
1094\end{equation} 
1095
1096With a free surface, the top vertical velocity is non-zero, due to the
1097freshwater forcing and the variations of the free surface elevation. With a
1098linear free surface or with a rigid lid, the upper boundary condition
1099applies at a fixed level $z=0$. Note that in the rigid-lid case (\key{dynspg\_rl} 
1100is defined), the surface boundary condition ($\left. w \right|_\text{surface}=0)$ is
1101automatically achieved at least at computer accuracy, due to the the way the
1102surface pressure gradient is expressed in discrete form (Appendix~\ref{Apdx_C}).
1103
1104Note also that whereas the vertical velocity has the same discrete
1105expression in $z$- and $s$-coordinate, its physical meaning is not the same:
1106in the second case, $w$ is the velocity normal to the $s$-surfaces.
1107
1108With the variable volume option, the calculation of the vertical velocity is
1109modified (see \citet{Levier2007}, report available on the \NEMO web site).
1110
1111% ================================================================
Note: See TracBrowser for help on using the repository browser.