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 NEMO/trunk/doc/latex/NEMO/subfiles – NEMO

source: NEMO/trunk/doc/latex/NEMO/subfiles/chap_DYN.tex @ 10146

Last change on this file since 10146 was 10146, checked in by nicolasmartin, 6 years ago

Reorganisation for future addition of .rst files from users wiki extraction

  • Create root directories latex and rst for tidy up
  • Move namelists folder to the root with the aim to gather later all namelist groups here (OCE, ICE & TOP) Also building scripts have been modified so that figures is now expected to be present at the root
  • Create bin directory with namelist utilities (check and update)
  • Under rst, add 4 dummy files that would gather the whole documentation existing currently in users wiki
    • model_interfacing.rst
    • reference_configurations.rst
    • setup_configuration.rst
    • test_cases.rst
File size: 74.1 KB
Line 
1\documentclass[../tex_main/NEMO_manual]{subfiles}
2\begin{document}
3% ================================================================
4% Chapter ——— Ocean Dynamics (DYN)
5% ================================================================
6\chapter{Ocean Dynamics (DYN)}
7\label{chap:DYN}
8\minitoc
9
10%\vspace{2.cm}
11$\ $\newline      %force an empty line
12
13Using the representation described in \autoref{chap: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 an
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*}
26NXT stands for next, referring to the time-stepping. The first group of terms on
27the rhs of this equation corresponds to the Coriolis and advection
28terms that are decomposed into either a vorticity part (VOR), a kinetic energy part (KEG)
29and a vertical advection part (ZAD) in the vector invariant formulation, or a Coriolis
30and advection part (COR+ADV) in the flux formulation. The terms following these
31are the pressure gradient contributions (HPG, Hydrostatic Pressure Gradient,
32and SPG, Surface Pressure Gradient); and contributions from lateral diffusion
33(LDF) and vertical diffusion (ZDF), which are added to the rhs in the \mdl{dynldf} 
34and \mdl{dynzdf} modules. The vertical diffusion term includes the surface and
35bottom stresses. The external forcings and parameterisations require complex
36inputs (surface wind stress calculation using bulk formulae, estimation of mixing
37coefficients) that are carried out in modules SBC, LDF and ZDF and are described
38in \autoref{chap:SBC}, \autoref{chap:LDF} and \autoref{chap:ZDF}, respectively.
39
40In the present chapter we also describe the diagnostic equations used to compute
41the horizontal divergence, curl of the velocities (\emph{divcur} module) and
42the vertical velocity (\emph{wzvmod} module).
43
44The different options available to the user are managed by namelist variables.
45For term \textit{ttt} in the momentum equations, the logical namelist variables are \textit{ln\_dynttt\_xxx},
46where \textit{xxx} is a 3 or 4 letter acronym corresponding to each optional scheme.
47If a CPP key is used for this term its name is \key{ttt}. The corresponding
48code can be found in the \textit{dynttt\_xxx} module in the DYN directory, and it is
49usually computed in the \textit{dyn\_ttt\_xxx} subroutine.
50
51The user has the option of extracting and outputting each tendency term from the
523D momentum equations (\key{trddyn} defined), as described in
53\autoref{chap:MISC}.  Furthermore, the tendency terms associated with the 2D
54barotropic vorticity balance (when \key{trdvor} is defined) can be derived from the
553D terms.
56%%%
57\gmcomment{STEVEN: not quite sure I've got the sense of the last sentence. does
58MISC correspond to "extracting tendency terms" or "vorticity balance"?}
59
60$\ $\newline    % force a new ligne
61
62% ================================================================
63% Sea Surface Height evolution & Diagnostics variables
64% ================================================================
65\section{Sea surface height and diagnostic variables ($\eta$, $\zeta$, $\chi$, $w$)}
66\label{sec:DYN_divcur_wzv}
67
68%--------------------------------------------------------------------------------------------------------------
69%           Horizontal divergence and relative vorticity
70%--------------------------------------------------------------------------------------------------------------
71\subsection{Horizontal divergence and relative vorticity (\protect\mdl{divcur})}
72\label{subsec:DYN_divcur}
73
74The vorticity is defined at an $f$-point ($i.e.$ corner point) as follows:
75\begin{equation} \label{eq:divcur_cur}
76\zeta =\frac{1}{e_{1f}\,e_{2f} }\left( {\;\delta _{i+1/2} \left[ {e_{2v}\;v} \right]
77                          -\delta _{j+1/2} \left[ {e_{1u}\;u} \right]\;} \right)
78\end{equation} 
79
80The horizontal divergence is defined at a $T$-point. It is given by:
81\begin{equation} \label{eq:divcur_div}
82\chi =\frac{1}{e_{1t}\,e_{2t}\,e_{3t} }
83      \left( {\delta _i \left[ {e_{2u}\,e_{3u}\,u} \right]
84             +\delta _j \left[ {e_{1v}\,e_{3v}\,v} \right]} \right)
85\end{equation} 
86
87Note that although the vorticity has the same discrete expression in $z$-
88and $s$-coordinates, its physical meaning is not identical. $\zeta$ is a pseudo
89vorticity along $s$-surfaces (only pseudo because $(u,v)$ are still defined along
90geopotential surfaces, but are not necessarily defined at the same depth).
91
92The vorticity and divergence at the \textit{before} step are used in the computation
93of the horizontal diffusion of momentum. Note that because they have been
94calculated prior to the Asselin filtering of the \textit{before} velocities, the
95\textit{before} vorticity and divergence arrays must be included in the restart file
96to ensure perfect restartability. The vorticity and divergence at the \textit{now} 
97time step are used for the computation of the nonlinear advection and of the
98vertical velocity respectively.
99
100%--------------------------------------------------------------------------------------------------------------
101%           Sea Surface Height evolution
102%--------------------------------------------------------------------------------------------------------------
103\subsection{Horizontal divergence and relative vorticity (\protect\mdl{sshwzv})}
104\label{subsec:DYN_sshwzv}
105
106The sea surface height is given by :
107\begin{equation} \label{eq:dynspg_ssh}
108\begin{aligned}
109\frac{\partial \eta }{\partial t}
110&\equiv    \frac{1}{e_{1t} e_{2t} }\sum\limits_k { \left\{  \delta _i \left[ {e_{2u}\,e_{3u}\;u} \right]
111                                                                                  +\delta _j \left[ {e_{1v}\,e_{3v}\;v} \right]  \right\} } 
112           -    \frac{\textit{emp}}{\rho _w }   \\
113&\equiv    \sum\limits_k {\chi \ e_{3t}}  -  \frac{\textit{emp}}{\rho _w }
114\end{aligned}
115\end{equation}
116where \textit{emp} is the surface freshwater budget (evaporation minus precipitation),
117expressed in Kg/m$^2$/s (which is equal to mm/s), and $\rho _w$=1,035~Kg/m$^3$ 
118is the reference density of sea water (Boussinesq approximation). If river runoff is
119expressed as a surface freshwater flux (see \autoref{chap:SBC}) then \textit{emp} can be
120written as the evaporation minus precipitation, minus the river runoff.
121The sea-surface height is evaluated using exactly the same time stepping scheme
122as the tracer equation \autoref{eq:tra_nxt}:
123a leapfrog scheme in combination with an Asselin time filter, $i.e.$ the velocity appearing
124in \autoref{eq:dynspg_ssh} is centred in time (\textit{now} velocity).
125This is of paramount importance. Replacing $T$ by the number $1$ in the tracer equation and summing
126over the water column must lead to the sea surface height equation otherwise tracer content
127will not be conserved \citep{Griffies_al_MWR01, Leclair_Madec_OM09}.
128
129The vertical velocity is computed by an upward integration of the horizontal
130divergence starting at the bottom, taking into account the change of the thickness of the levels :
131\begin{equation} \label{eq:wzv}
132\left\{   \begin{aligned}
133&\left. w \right|_{k_b-1/2} \quad= 0    \qquad \text{where } k_b \text{ is the level just above the sea floor }   \\
134&\left. w \right|_{k+1/2}     = \left. w \right|_{k-1/2}  +  \left. e_{3t} \right|_{k}\;  \left. \chi \right|_
135                                         - \frac{1} {2 \rdt} \left\left. e_{3t}^{t+1}\right|_{k} - \left. e_{3t}^{t-1}\right|_{k}\right)
136\end{aligned}   \right.
137\end{equation}
138
139In the case of a non-linear free surface (\key{vvl}), the top vertical velocity is $-\textit{emp}/\rho_w$,
140as changes in the divergence of the barotropic transport are absorbed into the change
141of the level thicknesses, re-orientated downward.
142\gmcomment{not sure of this...  to be modified with the change in emp setting}
143In the case of a linear free surface, the time derivative in \autoref{eq:wzv} disappears.
144The upper boundary condition applies at a fixed level $z=0$. The top vertical velocity
145is thus equal to the divergence of the barotropic transport ($i.e.$ the first term in the
146right-hand-side of \autoref{eq:dynspg_ssh}).
147
148Note also that whereas the vertical velocity has the same discrete
149expression in $z$- and $s$-coordinates, its physical meaning is not the same:
150in the second case, $w$ is the velocity normal to the $s$-surfaces.
151Note also that the $k$-axis is re-orientated downwards in the \textsc{fortran} code compared
152to the indexing used in the semi-discrete equations such as \autoref{eq:wzv} 
153(see \autoref{subsec:DOM_Num_Index_vertical}).
154
155
156% ================================================================
157% Coriolis and Advection terms: vector invariant form
158% ================================================================
159\section{Coriolis and advection: vector invariant form}
160\label{sec:DYN_adv_cor_vect}
161%-----------------------------------------nam_dynadv----------------------------------------------------
162
163\nlst{namdyn_adv} 
164%-------------------------------------------------------------------------------------------------------------
165
166The vector invariant form of the momentum equations is the one most
167often used in applications of the \NEMO ocean model. The flux form option
168(see next section) has been present since version $2$. Options are defined
169through the \ngn{namdyn\_adv} namelist variables
170Coriolis and momentum advection terms are evaluated using a leapfrog
171scheme, $i.e.$ the velocity appearing in these expressions is centred in
172time (\textit{now} velocity).
173At the lateral boundaries either free slip, no slip or partial slip boundary
174conditions are applied following \autoref{chap:LBC}.
175
176% -------------------------------------------------------------------------------------------------------------
177%        Vorticity term
178% -------------------------------------------------------------------------------------------------------------
179\subsection{Vorticity term (\protect\mdl{dynvor})}
180\label{subsec:DYN_vor}
181%------------------------------------------nam_dynvor----------------------------------------------------
182
183\nlst{namdyn_vor} 
184%-------------------------------------------------------------------------------------------------------------
185
186Options are defined through the \ngn{namdyn\_vor} namelist variables.
187Four discretisations of the vorticity term (\np{ln\_dynvor\_xxx}\forcode{ = .true.}) are available:
188conserving potential enstrophy of horizontally non-divergent flow (ENS scheme) ;
189conserving horizontal kinetic energy (ENE scheme) ; conserving potential enstrophy for
190the relative vorticity term and horizontal kinetic energy for the planetary vorticity
191term (MIX scheme) ; or conserving both the potential enstrophy of horizontally non-divergent
192flow and horizontal kinetic energy (EEN scheme) (see \autoref{subsec:C_vorEEN}). In the
193case of ENS, ENE or MIX schemes the land sea mask may be slightly modified to ensure the
194consistency of vorticity term with analytical equations (\np{ln\_dynvor\_con}\forcode{ = .true.}).
195The vorticity terms are all computed in dedicated routines that can be found in
196the \mdl{dynvor} module.
197
198%-------------------------------------------------------------
199%                 enstrophy conserving scheme
200%-------------------------------------------------------------
201\subsubsection{Enstrophy conserving scheme (\protect\np{ln\_dynvor\_ens}\forcode{ = .true.})}
202\label{subsec:DYN_vor_ens}
203
204In the enstrophy conserving case (ENS scheme), the discrete formulation of the
205vorticity term provides a global conservation of the enstrophy
206($ [ (\zeta +f ) / e_{3f} ]^2 $ in $s$-coordinates) for a horizontally non-divergent
207flow ($i.e.$ $\chi$=$0$), but does not conserve the total kinetic energy. It is given by:
208\begin{equation} \label{eq:dynvor_ens}
209\left\{ 
210\begin{aligned}
211{+\frac{1}{e_{1u} } } & {\overline {\left( { \frac{\zeta +f}{e_{3f} }} \right)} }^{\,i} 
212                                & {\overline{\overline {\left( {e_{1v}\,e_{3v}\;v} \right)}} }^{\,i, j+1/2}    \\
213{- \frac{1}{e_{2v} } } & {\overline {\left( {\frac{\zeta +f}{e_{3f} }} \right)} }^{\,j} 
214                                & {\overline{\overline {\left( {e_{2u}\,e_{3u}\;u} \right)}} }^{\,i+1/2, j} 
215\end{aligned} 
216 \right.
217\end{equation} 
218
219%-------------------------------------------------------------
220%                 energy conserving scheme
221%-------------------------------------------------------------
222\subsubsection{Energy conserving scheme (\protect\np{ln\_dynvor\_ene}\forcode{ = .true.})}
223\label{subsec:DYN_vor_ene}
224
225The kinetic energy conserving scheme (ENE scheme) conserves the global
226kinetic energy but not the global enstrophy. It is given by:
227\begin{equation} \label{eq:dynvor_ene}
228\left\{   \begin{aligned}
229{+\frac{1}{e_{1u}}\; {\overline {\left( {\frac{\zeta +f}{e_{3f} }} \right)
230                            \;  \overline {\left( {e_{1v}\,e_{3v}\;v} \right)} ^{\,i+1/2}} }^{\,j} }    \\
231{- \frac{1}{e_{2v}}\; {\overline {\left( {\frac{\zeta +f}{e_{3f} }} \right)
232                            \;  \overline {\left( {e_{2u}\,e_{3u}\;u} \right)} ^{\,j+1/2}} }^{\,i} }
233\end{aligned}    \right.
234\end{equation} 
235
236%-------------------------------------------------------------
237%                 mix energy/enstrophy conserving scheme
238%-------------------------------------------------------------
239\subsubsection{Mixed energy/enstrophy conserving scheme (\protect\np{ln\_dynvor\_mix}\forcode{ = .true.}) }
240\label{subsec:DYN_vor_mix}
241
242For the mixed energy/enstrophy conserving scheme (MIX scheme), a mixture of the
243two previous schemes is used. It consists of the ENS scheme (\autoref{eq:dynvor_ens})
244for the relative vorticity term, and of the ENE scheme (\autoref{eq:dynvor_ene}) applied
245to the planetary vorticity term.
246\begin{equation} \label{eq:dynvor_mix}
247\left\{ {     \begin{aligned}
248 {+\frac{1}{e_{1u} }\; {\overline {\left( {\frac{\zeta }{e_{3f} }} \right)} }^{\,i} 
249 \; {\overline{\overline {\left( {e_{1v}\,e_{3v}\;v} \right)}} }^{\,i,j+1/2} -\frac{1}{e_{1u} }
250 \; {\overline {\left( {\frac{f}{e_{3f} }} \right)
251 \;\overline {\left( {e_{1v}\,e_{3v}\;v} \right)} ^{\,i+1/2}} }^{\,j} } \\
252{-\frac{1}{e_{2v} }\; {\overline {\left( {\frac{\zeta }{e_{3f} }} \right)} }^j
253 \; {\overline{\overline {\left( {e_{2u}\,e_{3u}\;u} \right)}} }^{\,i+1/2,j} +\frac{1}{e_{2v} }
254 \; {\overline {\left( {\frac{f}{e_{3f} }} \right)
255 \;\overline {\left( {e_{2u}\,e_{3u}\;u} \right)} ^{\,j+1/2}} }^{\,i} } \hfill
256\end{aligned}     } \right.
257\end{equation} 
258
259%-------------------------------------------------------------
260%                 energy and enstrophy conserving scheme
261%-------------------------------------------------------------
262\subsubsection{Energy and enstrophy conserving scheme (\protect\np{ln\_dynvor\_een}\forcode{ = .true.}) }
263\label{subsec:DYN_vor_een}
264
265In both the ENS and ENE schemes, it is apparent that the combination of $i$ and $j$ 
266averages of the velocity allows for the presence of grid point oscillation structures
267that will be invisible to the operator. These structures are \textit{computational modes} 
268that will be at least partly damped by the momentum diffusion operator ($i.e.$ the
269subgrid-scale advection), but not by the resolved advection term. The ENS and ENE schemes
270therefore do not contribute to dump any grid point noise in the horizontal velocity field.
271Such noise would result in more noise in the vertical velocity field, an undesirable feature.
272This is a well-known characteristic of $C$-grid discretization where $u$ and $v$ are located
273at different grid points, a price worth paying to avoid a double averaging in the pressure
274gradient term as in the $B$-grid.
275\gmcomment{ To circumvent this, Adcroft (ADD REF HERE)
276Nevertheless, this technique strongly distort the phase and group velocity of Rossby waves....}
277
278A very nice solution to the problem of double averaging was proposed by \citet{Arakawa_Hsu_MWR90}.
279The idea is to get rid of the double averaging by considering triad combinations of vorticity.
280It is noteworthy that this solution is conceptually quite similar to the one proposed by
281\citep{Griffies_al_JPO98} for the discretization of the iso-neutral diffusion operator (see \autoref{apdx:C}).
282
283The \citet{Arakawa_Hsu_MWR90} vorticity advection scheme for a single layer is modified
284for spherical coordinates as described by \citet{Arakawa_Lamb_MWR81} to obtain the EEN scheme.
285First consider the discrete expression of the potential vorticity, $q$, defined at an $f$-point:
286\begin{equation} \label{eq:pot_vor}
287q  = \frac{\zeta +f} {e_{3f} }
288\end{equation}
289where the relative vorticity is defined by (\autoref{eq:divcur_cur}), the Coriolis parameter
290is given by $f=2 \,\Omega \;\sin \varphi _f $ and the layer thickness at $f$-points is:
291\begin{equation} \label{eq:een_e3f}
292e_{3f} = \overline{\overline {e_{3t} }} ^{\,i+1/2,j+1/2}
293\end{equation}
294
295%>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
296\begin{figure}[!ht]    \begin{center}
297\includegraphics[width=0.70\textwidth]{Fig_DYN_een_triad}
298\caption{ \protect\label{fig:DYN_een_triad} 
299Triads used in the energy and enstrophy conserving scheme (een) for
300$u$-component (upper panel) and $v$-component (lower panel).}
301\end{center}   \end{figure}
302%>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
303
304A key point in \autoref{eq:een_e3f} is how the averaging in the \textbf{i}- and \textbf{j}- directions is made.
305It uses the sum of masked t-point vertical scale factor divided either
306by the sum of the four t-point masks (\np{nn\_een\_e3f}\forcode{ = 1}),
307or  just by $4$ (\np{nn\_een\_e3f}\forcode{ = .true.}).
308The latter case preserves the continuity of $e_{3f}$ when one or more of the neighbouring $e_{3t}$ 
309tends to zero and extends by continuity the value of $e_{3f}$ into the land areas.
310This case introduces a sub-grid-scale topography at f-points (with a systematic reduction of $e_{3f}$ 
311when a model level intercept the bathymetry) that tends to reinforce the topostrophy of the flow
312($i.e.$ the tendency of the flow to follow the isobaths) \citep{Penduff_al_OS07}.
313
314Next, the vorticity triads, $ {^i_j}\mathbb{Q}^{i_p}_{j_p}$ can be defined at a $T$-point as
315the following triad combinations of the neighbouring potential vorticities defined at f-points
316(\autoref{fig:DYN_een_triad}):
317\begin{equation} \label{eq:Q_triads}
318_i^j \mathbb{Q}^{i_p}_{j_p}
319= \frac{1}{12} \ \left(   q^{i-i_p}_{j+j_p} + q^{i+j_p}_{j+i_p} + q^{i+i_p}_{j-j_p}  \right)
320\end{equation}
321where the indices $i_p$ and $k_p$ take the values: $i_p = -1/2$ or $1/2$ and $j_p = -1/2$ or $1/2$.
322
323Finally, the vorticity terms are represented as:
324\begin{equation} \label{eq:dynvor_een}
325\left\{ {
326\begin{aligned}
327 +q\,e_3 \, v  &\equiv +\frac{1}{e_{1u} }   \sum_{\substack{i_p,\,k_p}} 
328                         {^{i+1/2-i_p}_j}  \mathbb{Q}^{i_p}_{j_p}  \left( e_{1v}\,e_{3v} \;\right)^{i+1/2-i_p}_{j+j_p}   \\
329 - q\,e_3 \, u     &\equiv -\frac{1}{e_{2v} }    \sum_{\substack{i_p,\,k_p}} 
330                         {^i_{j+1/2-j_p}}  \mathbb{Q}^{i_p}_{j_p}  \left( e_{2u}\,e_{3u} \;\right)^{i+i_p}_{j+1/2-j_p}   \\
331\end{aligned} 
332} \right.
333\end{equation} 
334
335This EEN scheme in fact combines the conservation properties of the ENS and ENE schemes.
336It conserves both total energy and potential enstrophy in the limit of horizontally
337nondivergent flow ($i.e.$ $\chi$=$0$) (see \autoref{subsec:C_vorEEN}).
338Applied to a realistic ocean configuration, it has been shown that it leads to a significant
339reduction of the noise in the vertical velocity field \citep{Le_Sommer_al_OM09}.
340Furthermore, used in combination with a partial steps representation of bottom topography,
341it improves the interaction between current and topography, leading to a larger
342topostrophy of the flow  \citep{Barnier_al_OD06, Penduff_al_OS07}.
343
344%--------------------------------------------------------------------------------------------------------------
345%           Kinetic Energy Gradient term
346%--------------------------------------------------------------------------------------------------------------
347\subsection{Kinetic energy gradient term (\protect\mdl{dynkeg})}
348\label{subsec:DYN_keg}
349
350As demonstrated in \autoref{apdx:C}, there is a single discrete formulation
351of the kinetic energy gradient term that, together with the formulation chosen for
352the vertical advection (see below), conserves the total kinetic energy:
353\begin{equation} \label{eq:dynkeg}
354\left\{ \begin{aligned}
355 -\frac{1}{2 \; e_{1u} }  & \ \delta _{i+1/2} \left[ {\overline {u^2}^{\,i} + \overline{v^2}^{\,j}} \right]   \\
356 -\frac{1}{2 \; e_{2v} }  & \ \delta _{j+1/2} \left[ {\overline {u^2}^{\,i} + \overline{v^2}^{\,j}} \right]   
357\end{aligned} \right.
358\end{equation} 
359
360%--------------------------------------------------------------------------------------------------------------
361%           Vertical advection term
362%--------------------------------------------------------------------------------------------------------------
363\subsection{Vertical advection term (\protect\mdl{dynzad}) }
364\label{subsec:DYN_zad}
365
366The discrete formulation of the vertical advection, together with the formulation
367chosen for the gradient of kinetic energy (KE) term, conserves the total kinetic
368energy. Indeed, the change of KE due to the vertical advection is exactly
369balanced by the change of KE due to the gradient of KE (see \autoref{apdx:C}).
370\begin{equation} \label{eq:dynzad}
371\left\{     \begin{aligned}
372-\frac{1} {e_{1u}\,e_{2u}\,e_{3u}} &\ \overline{\ \overline{ e_{1t}\,e_{2t}\;w } ^{\,i+1/2}  \;\delta _{k+1/2} \left[ u \right]\  }^{\,k}  \\
373-\frac{1} {e_{1v}\,e_{2v}\,e_{3v}}  &\ \overline{\ \overline{ e_{1t}\,e_{2t}\;w } ^{\,j+1/2}  \;\delta _{k+1/2} \left[ u \right]\  }^{\,k} 
374\end{aligned}         \right.
375\end{equation} 
376When \np{ln\_dynzad\_zts}\forcode{ = .true.}, a split-explicit time stepping with 5 sub-timesteps is used
377on the vertical advection term.
378This option can be useful when the value of the timestep is limited by vertical advection \citep{Lemarie_OM2015}.
379Note that in this case, a similar split-explicit time stepping should be used on
380vertical advection of tracer to ensure a better stability,
381an option which is only available with a TVD scheme (see \np{ln\_traadv\_tvd\_zts} in \autoref{subsec:TRA_adv_tvd}).
382
383
384% ================================================================
385% Coriolis and Advection : flux form
386% ================================================================
387\section{Coriolis and advection: flux form}
388\label{sec:DYN_adv_cor_flux}
389%------------------------------------------nam_dynadv----------------------------------------------------
390
391\nlst{namdyn_adv} 
392%-------------------------------------------------------------------------------------------------------------
393
394Options are defined through the \ngn{namdyn\_adv} namelist variables.
395In the flux form (as in the vector invariant form), the Coriolis and momentum
396advection terms are evaluated using a leapfrog scheme, $i.e.$ the velocity
397appearing in their expressions is centred in time (\textit{now} velocity). At the
398lateral boundaries either free slip, no slip or partial slip boundary conditions
399are applied following \autoref{chap:LBC}.
400
401
402%--------------------------------------------------------------------------------------------------------------
403%           Coriolis plus curvature metric terms
404%--------------------------------------------------------------------------------------------------------------
405\subsection{Coriolis plus curvature metric terms (\protect\mdl{dynvor}) }
406\label{subsec:DYN_cor_flux}
407
408In flux form, the vorticity term reduces to a Coriolis term in which the Coriolis
409parameter has been modified to account for the "metric" term. This altered
410Coriolis parameter is thus discretised at $f$-points. It is given by:
411\begin{multline} \label{eq:dyncor_metric}
412f+\frac{1}{e_1 e_2 }\left( {v\frac{\partial e_2 }{\partial i}  -  u\frac{\partial e_1 }{\partial j}} \right\\
413   \equiv   f + \frac{1}{e_{1f} e_{2f} } \left( { \ \overline v ^{i+1/2}\delta _{i+1/2} \left[ {e_{2u} } \right] 
414                                                                 -  \overline u ^{j+1/2}\delta _{j+1/2} \left[ {e_{1u} } \right]  }  \ \right)
415\end{multline} 
416
417Any of the (\autoref{eq:dynvor_ens}), (\autoref{eq:dynvor_ene}) and (\autoref{eq:dynvor_een})
418schemes can be used to compute the product of the Coriolis parameter and the
419vorticity. However, the energy-conserving scheme (\autoref{eq:dynvor_een}) has
420exclusively been used to date. This term is evaluated using a leapfrog scheme,
421$i.e.$ the velocity is centred in time (\textit{now} velocity).
422
423%--------------------------------------------------------------------------------------------------------------
424%           Flux form Advection term
425%--------------------------------------------------------------------------------------------------------------
426\subsection{Flux form advection term (\protect\mdl{dynadv}) }
427\label{subsec:DYN_adv_flux}
428
429The discrete expression of the advection term is given by :
430\begin{equation} \label{eq:dynadv}
431\left\{ 
432\begin{aligned}
433\frac{1}{e_{1u}\,e_{2u}\,e_{3u}} 
434\left(      \delta _{i+1/2} \left[ \overline{e_{2u}\,e_{3u}\;u }^{i       }  \ u_t      \right]   
435          + \delta _{j       } \left[ \overline{e_{1u}\,e_{3u}\;v }^{i+1/2}  \ u_f      \right] \right\ \;   \\
436\left.   + \delta _{k      } \left[ \overline{e_{1w}\,e_{2w}\;w}^{i+1/2}  \ u_{uw} \right] \right)   \\
437\\
438\frac{1}{e_{1v}\,e_{2v}\,e_{3v}} 
439\left(     \delta _{i       } \left[ \overline{e_{2u}\,e_{3u }\;u }^{j+1/2} \ v_f       \right] 
440         + \delta _{j+1/2} \left[ \overline{e_{1u}\,e_{3u }\;v }^{i       } \ v_t       \right] \right\ \, \, \\
441\left.  + \delta _{k      } \left[ \overline{e_{1w}\,e_{2w}\;w}^{j+1/2} \ v_{vw}  \right] \right) \\
442\end{aligned}
443\right.
444\end{equation}
445
446Two advection schemes are available: a $2^{nd}$ order centered finite
447difference scheme, CEN2, or a $3^{rd}$ order upstream biased scheme, UBS.
448The latter is described in \citet{Shchepetkin_McWilliams_OM05}. The schemes are
449selected using the namelist logicals \np{ln\_dynadv\_cen2} and \np{ln\_dynadv\_ubs}.
450In flux form, the schemes differ by the choice of a space and time interpolation to
451define the value of $u$ and $v$ at the centre of each face of $u$- and $v$-cells,
452$i.e.$ at the $T$-, $f$-, and $uw$-points for $u$ and at the $f$-, $T$- and
453$vw$-points for $v$.
454
455%-------------------------------------------------------------
456%                 2nd order centred scheme
457%-------------------------------------------------------------
458\subsubsection{CEN2: $2^{nd}$ order centred scheme (\protect\np{ln\_dynadv\_cen2}\forcode{ = .true.})}
459\label{subsec:DYN_adv_cen2}
460
461In the centered $2^{nd}$ order formulation, the velocity is evaluated as the
462mean of the two neighbouring points :
463\begin{equation} \label{eq:dynadv_cen2}
464\left\{     \begin{aligned}
465 u_T^{cen2} &=\overline u^{i }       \quad &  u_F^{cen2} &=\overline u^{j+1/2}  \quad &  u_{uw}^{cen2} &=\overline u^{k+1/2}   \\
466 v_F^{cen2} &=\overline v ^{i+1/2} \quad & v_F^{cen2} &=\overline v^j      \quad &  v_{vw}^{cen2} &=\overline v ^{k+1/2}  \\
467\end{aligned}      \right.
468\end{equation} 
469
470The scheme is non diffusive (i.e. conserves the kinetic energy) but dispersive
471($i.e.$ it may create false extrema). It is therefore notoriously noisy and must be
472used in conjunction with an explicit diffusion operator to produce a sensible solution.
473The associated time-stepping is performed using a leapfrog scheme in conjunction
474with an Asselin time-filter, so $u$ and $v$ are the \emph{now} velocities.
475
476%-------------------------------------------------------------
477%                 UBS scheme
478%-------------------------------------------------------------
479\subsubsection{UBS: Upstream Biased Scheme (\protect\np{ln\_dynadv\_ubs}\forcode{ = .true.})}
480\label{subsec:DYN_adv_ubs}
481
482The UBS advection scheme is an upstream biased third order scheme based on
483an upstream-biased parabolic interpolation. For example, the evaluation of
484$u_T^{ubs} $ is done as follows:
485\begin{equation} \label{eq:dynadv_ubs}
486u_T^{ubs} =\overline u ^i-\;\frac{1}{6}   \begin{cases}
487      u"_{i-1/2}&    \text{if $\ \overline{e_{2u}\,e_{3u} \ u}^i  \geqslant 0$ }    \\
488      u"_{i+1/2}&    \text{if $\ \overline{e_{2u}\,e_{3u} \ u}^i  < 0$ }
489\end{cases}
490\end{equation}
491where $u"_{i+1/2} =\delta _{i+1/2} \left[ {\delta _i \left[ u \right]} \right]$. This results
492in a dissipatively dominant ($i.e.$ hyper-diffusive) truncation error \citep{Shchepetkin_McWilliams_OM05}.
493The overall performance of the advection scheme is similar to that reported in
494\citet{Farrow1995}. It is a relatively good compromise between accuracy and
495smoothness. It is not a \emph{positive} scheme, meaning that false extrema are
496permitted. But the amplitudes of the false extrema are significantly reduced over
497those in the centred second order method. As the scheme already includes
498a diffusion component, it can be used without explicit lateral diffusion on momentum
499($i.e.$ \np{ln\_dynldf\_lap}\forcode{ = }\np{ln\_dynldf\_bilap}\forcode{ = .false.}), and it is recommended to do so.
500
501The UBS scheme is not used in all directions. In the vertical, the centred $2^{nd}$ 
502order evaluation of the advection is preferred, $i.e.$ $u_{uw}^{ubs}$ and
503$u_{vw}^{ubs}$ in \autoref{eq:dynadv_cen2} are used. UBS is diffusive and is
504associated with vertical mixing of momentum. \gmcomment{ gm  pursue the
505sentence:Since vertical mixing of momentum is a source term of the TKE equation...  }
506
507For stability reasons, the first term in (\autoref{eq:dynadv_ubs}), which corresponds
508to a second order centred scheme, is evaluated using the \textit{now} velocity
509(centred in time), while the second term, which is the diffusion part of the scheme,
510is evaluated using the \textit{before} velocity (forward in time). This is discussed
511by \citet{Webb_al_JAOT98} in the context of the Quick advection scheme.
512
513Note that the UBS and QUICK (Quadratic Upstream Interpolation for Convective Kinematics)
514schemes only differ by one coefficient. Replacing $1/6$ by $1/8$ in
515(\autoref{eq:dynadv_ubs}) leads to the QUICK advection scheme \citep{Webb_al_JAOT98}.
516This option is not available through a namelist parameter, since the $1/6$ coefficient
517is hard coded. Nevertheless it is quite easy to make the substitution in the
518\mdl{dynadv\_ubs} module and obtain a QUICK scheme.
519
520Note also that in the current version of \mdl{dynadv\_ubs}, there is also the
521possibility of using a $4^{th}$ order evaluation of the advective velocity as in
522ROMS. This is an error and should be suppressed soon.
523%%%
524\gmcomment{action :  this have to be done}
525%%%
526
527% ================================================================
528%           Hydrostatic pressure gradient term
529% ================================================================
530\section{Hydrostatic pressure gradient (\protect\mdl{dynhpg})}
531\label{sec:DYN_hpg}
532%------------------------------------------nam_dynhpg---------------------------------------------------
533
534\nlst{namdyn_hpg} 
535%-------------------------------------------------------------------------------------------------------------
536
537Options are defined through the \ngn{namdyn\_hpg} namelist variables.
538The key distinction between the different algorithms used for the hydrostatic
539pressure gradient is the vertical coordinate used, since HPG is a \emph{horizontal} 
540pressure gradient, $i.e.$ computed along geopotential surfaces. As a result, any
541tilt of the surface of the computational levels will require a specific treatment to
542compute the hydrostatic pressure gradient.
543
544The hydrostatic pressure gradient term is evaluated either using a leapfrog scheme,
545$i.e.$ the density appearing in its expression is centred in time (\emph{now} $\rho$), or
546a semi-implcit scheme. At the lateral boundaries either free slip, no slip or partial slip
547boundary conditions are applied.
548
549%--------------------------------------------------------------------------------------------------------------
550%           z-coordinate with full step
551%--------------------------------------------------------------------------------------------------------------
552\subsection{Full step $Z$-coordinate (\protect\np{ln\_dynhpg\_zco}\forcode{ = .true.})}
553\label{subsec:DYN_hpg_zco}
554
555The hydrostatic pressure can be obtained by integrating the hydrostatic equation
556vertically from the surface. However, the pressure is large at great depth while its
557horizontal gradient is several orders of magnitude smaller. This may lead to large
558truncation errors in the pressure gradient terms. Thus, the two horizontal components
559of the hydrostatic pressure gradient are computed directly as follows:
560
561for $k=km$ (surface layer, $jk=1$ in the code)
562\begin{equation} \label{eq:dynhpg_zco_surf}
563\left\{ \begin{aligned}
564               \left. \delta _{i+1/2} \left[  p^h         \right] \right|_{k=km} 
565&= \frac{1}{2} g \   \left. \delta _{i+1/2} \left[  e_{3w} \ \rho \right] \right|_{k=km}   \\
566                  \left. \delta _{j+1/2} \left[  p^h            \right] \right|_{k=km} 
567&= \frac{1}{2} g \   \left. \delta _{j+1/2} \left[  e_{3w} \ \rho \right] \right|_{k=km}   \\
568\end{aligned} \right.
569\end{equation} 
570
571for $1<k<km$ (interior layer)
572\begin{equation} \label{eq:dynhpg_zco}
573\left\{ \begin{aligned}
574               \left. \delta _{i+1/2} \left[  p^h         \right] \right|_{k} 
575&=             \left. \delta _{i+1/2} \left[  p^h         \right] \right|_{k-1} 
576+    \frac{1}{2}\;g\;   \left. \delta _{i+1/2} \left[  e_{3w} \ \overline {\rho}^{k+1/2} \right] \right|_{k}   \\
577                  \left. \delta _{j+1/2} \left[  p^h            \right] \right|_{k} 
578&=                \left. \delta _{j+1/2} \left[  p^h            \right] \right|_{k-1} 
579+    \frac{1}{2}\;g\;   \left. \delta _{j+1/2} \left[  e_{3w} \ \overline {\rho}^{k+1/2} \right] \right|_{k}   \\
580\end{aligned} \right.
581\end{equation} 
582
583Note that the $1/2$ factor in (\autoref{eq:dynhpg_zco_surf}) is adequate because of
584the definition of $e_{3w}$ as the vertical derivative of the scale factor at the surface
585level ($z=0$). Note also that in case of variable volume level (\key{vvl} defined), the
586surface pressure gradient is included in \autoref{eq:dynhpg_zco_surf} and \autoref{eq:dynhpg_zco} 
587through the space and time variations of the vertical scale factor $e_{3w}$.
588
589%--------------------------------------------------------------------------------------------------------------
590%           z-coordinate with partial step
591%--------------------------------------------------------------------------------------------------------------
592\subsection{Partial step $Z$-coordinate (\protect\np{ln\_dynhpg\_zps}\forcode{ = .true.})}
593\label{subsec:DYN_hpg_zps}
594
595With partial bottom cells, tracers in horizontally adjacent cells generally live at
596different depths. Before taking horizontal gradients between these tracer points,
597a linear interpolation is used to approximate the deeper tracer as if it actually lived
598at the depth of the shallower tracer point.
599
600Apart from this modification, the horizontal hydrostatic pressure gradient evaluated
601in the $z$-coordinate with partial step is exactly as in the pure $z$-coordinate case.
602As explained in detail in section \autoref{sec:TRA_zpshde}, the nonlinearity of pressure
603effects in the equation of state is such that it is better to interpolate temperature and
604salinity vertically before computing the density. Horizontal gradients of temperature
605and salinity are needed for the TRA modules, which is the reason why the horizontal
606gradients of density at the deepest model level are computed in module \mdl{zpsdhe} 
607located in the TRA directory and described in \autoref{sec:TRA_zpshde}.
608
609%--------------------------------------------------------------------------------------------------------------
610%           s- and s-z-coordinates
611%--------------------------------------------------------------------------------------------------------------
612\subsection{$S$- and $Z$-$S$-coordinates}
613\label{subsec:DYN_hpg_sco}
614
615Pressure gradient formulations in an $s$-coordinate have been the subject of a vast
616number of papers ($e.g.$, \citet{Song1998, Shchepetkin_McWilliams_OM05}).
617A number of different pressure gradient options are coded but the ROMS-like, density Jacobian with
618cubic polynomial method is currently disabled whilst known bugs are under investigation.
619
620$\bullet$ Traditional coding (see for example \citet{Madec_al_JPO96}: (\np{ln\_dynhpg\_sco}\forcode{ = .true.})
621\begin{equation} \label{eq:dynhpg_sco}
622\left\{ \begin{aligned}
623 - \frac{1}                   {\rho_o \, e_{1u}} \;   \delta _{i+1/2} \left[  p^h  \right] 
624+ \frac{g\; \overline {\rho}^{i+1/2}}  {\rho_o \, e_{1u}} \;   \delta _{i+1/2} \left[  z_t   \right]    \\
625 - \frac{1}                   {\rho_o \, e_{2v}} \;   \delta _{j+1/2} \left[  p^h  \right] 
626+ \frac{g\; \overline {\rho}^{j+1/2}}  {\rho_o \, e_{2v}} \;   \delta _{j+1/2} \left[  z_t   \right]    \\
627\end{aligned} \right.
628\end{equation} 
629
630Where the first term is the pressure gradient along coordinates, computed as in
631\autoref{eq:dynhpg_zco_surf} - \autoref{eq:dynhpg_zco}, and $z_T$ is the depth of
632the $T$-point evaluated from the sum of the vertical scale factors at the $w$-point
633($e_{3w}$).
634 
635$\bullet$ Traditional coding with adaptation for ice shelf cavities (\np{ln\_dynhpg\_isf}\forcode{ = .true.}).
636This scheme need the activation of ice shelf cavities (\np{ln\_isfcav}\forcode{ = .true.}).
637
638$\bullet$ Pressure Jacobian scheme (prj) (a research paper in preparation) (\np{ln\_dynhpg\_prj}\forcode{ = .true.})
639
640$\bullet$ Density Jacobian with cubic polynomial scheme (DJC) \citep{Shchepetkin_McWilliams_OM05} 
641(\np{ln\_dynhpg\_djc}\forcode{ = .true.}) (currently disabled; under development)
642
643Note that expression \autoref{eq:dynhpg_sco} is commonly used when the variable volume formulation is
644activated (\key{vvl}) because in that case, even with a flat bottom, the coordinate surfaces are not
645horizontal but follow the free surface \citep{Levier2007}. The pressure jacobian scheme
646(\np{ln\_dynhpg\_prj}\forcode{ = .true.}) is available as an improved option to \np{ln\_dynhpg\_sco}\forcode{ = .true.} when
647\key{vvl} is active.  The pressure Jacobian scheme uses a constrained cubic spline to reconstruct
648the density profile across the water column. This method maintains the monotonicity between the
649density nodes  The pressure can be calculated by analytical integration of the density profile and a
650pressure Jacobian method is used to solve the horizontal pressure gradient. This method can provide
651a more accurate calculation of the horizontal pressure gradient than the standard scheme.
652
653\subsection{Ice shelf cavity}
654\label{subsec:DYN_hpg_isf}
655Beneath an ice shelf, the total pressure gradient is the sum of the pressure gradient due to the ice shelf load and
656 the pressure gradient due to the ocean load. If cavity opened (\np{ln\_isfcav}\forcode{ = .true.}) these 2 terms can be
657 calculated by setting \np{ln\_dynhpg\_isf}\forcode{ = .true.}. No other scheme are working with the ice shelf.\\
658
659$\bullet$ The main hypothesis to compute the ice shelf load is that the ice shelf is in an isostatic equilibrium.
660 The top pressure is computed integrating from surface to the base of the ice shelf a reference density profile
661(prescribed as density of a water at 34.4 PSU and -1.9\degC) and corresponds to the water replaced by the ice shelf.
662This top pressure is constant over time. A detailed description of this method is described in \citet{Losch2008}.\\
663
664$\bullet$ The ocean load is computed using the expression \autoref{eq:dynhpg_sco} described in \autoref{subsec:DYN_hpg_sco}.
665
666%--------------------------------------------------------------------------------------------------------------
667%           Time-scheme
668%--------------------------------------------------------------------------------------------------------------
669\subsection{Time-scheme (\protect\np{ln\_dynhpg\_imp}\forcode{ = .true./.false.})}
670\label{subsec:DYN_hpg_imp}
671
672The default time differencing scheme used for the horizontal pressure gradient is
673a leapfrog scheme and therefore the density used in all discrete expressions given
674above is the  \textit{now} density, computed from the \textit{now} temperature and
675salinity. In some specific cases (usually high resolution simulations over an ocean
676domain which includes weakly stratified regions) the physical phenomenon that
677controls the time-step is internal gravity waves (IGWs). A semi-implicit scheme for
678doubling the stability limit associated with IGWs can be used \citep{Brown_Campana_MWR78,
679Maltrud1998}. It involves the evaluation of the hydrostatic pressure gradient as an
680average over the three time levels $t-\rdt$, $t$, and $t+\rdt$ ($i.e.$ 
681\textit{before}\textit{now} and  \textit{after} time-steps), rather than at the central
682time level $t$ only, as in the standard leapfrog scheme.
683
684$\bullet$ leapfrog scheme (\np{ln\_dynhpg\_imp}\forcode{ = .true.}):
685
686\begin{equation} \label{eq:dynhpg_lf}
687\frac{u^{t+\rdt}-u^{t-\rdt}}{2\rdt} = \;\cdots \;
688   -\frac{1}{\rho _o \,e_{1u} }\delta _{i+1/2} \left[ {p_h^t } \right]
689\end{equation}
690
691$\bullet$ semi-implicit scheme (\np{ln\_dynhpg\_imp}\forcode{ = .true.}):
692\begin{equation} \label{eq:dynhpg_imp}
693\frac{u^{t+\rdt}-u^{t-\rdt}}{2\rdt} = \;\cdots \;
694   -\frac{1}{4\,\rho _o \,e_{1u} } \delta_{i+1/2} \left[ p_h^{t+\rdt} +2\,p_h^t +p_h^{t-\rdt}  \right]
695\end{equation}
696
697The semi-implicit time scheme \autoref{eq:dynhpg_imp} is made possible without
698significant additional computation since the density can be updated to time level
699$t+\rdt$ before computing the horizontal hydrostatic pressure gradient. It can
700be easily shown that the stability limit associated with the hydrostatic pressure
701gradient doubles using \autoref{eq:dynhpg_imp} compared to that using the
702standard leapfrog scheme \autoref{eq:dynhpg_lf}. Note that \autoref{eq:dynhpg_imp} 
703is equivalent to applying a time filter to the pressure gradient to eliminate high
704frequency IGWs. Obviously, when using \autoref{eq:dynhpg_imp}, the doubling of
705the time-step is achievable only if no other factors control the time-step, such as
706the stability limits associated with advection or diffusion.
707
708In practice, the semi-implicit scheme is used when \np{ln\_dynhpg\_imp}\forcode{ = .true.}.
709In this case, we choose to apply the time filter to temperature and salinity used in
710the equation of state, instead of applying it to the hydrostatic pressure or to the
711density, so that no additional storage array has to be defined. The density used to
712compute the hydrostatic pressure gradient (whatever the formulation) is evaluated
713as follows:
714\begin{equation} \label{eq:rho_flt}
715   \rho^t = \rho( \widetilde{T},\widetilde {S},z_t)
716 \quad     \text{with}  \quad 
717   \widetilde{X} = 1 / 4 \left(  X^{t+\rdt} +2 \,X^t + X^{t-\rdt}  \right)
718\end{equation}
719
720Note that in the semi-implicit case, it is necessary to save the filtered density, an
721extra three-dimensional field, in the restart file to restart the model with exact
722reproducibility. This option is controlled by  \np{nn\_dynhpg\_rst}, a namelist parameter.
723
724% ================================================================
725% Surface Pressure Gradient
726% ================================================================
727\section{Surface pressure gradient (\protect\mdl{dynspg})}
728\label{sec:DYN_spg}
729%-----------------------------------------nam_dynspg----------------------------------------------------
730
731\nlst{namdyn_spg} 
732%------------------------------------------------------------------------------------------------------------
733
734$\ $\newline      %force an empty line
735
736Options are defined through the \ngn{namdyn\_spg} namelist variables.
737The surface pressure gradient term is related to the representation of the free surface (\autoref{sec:PE_hor_pg}).
738The main distinction is between the fixed volume case (linear free surface) and the variable volume case
739(nonlinear free surface, \key{vvl} is defined). In the linear free surface case (\autoref{subsec:PE_free_surface})
740the vertical scale factors $e_{3}$ are fixed in time, while they are time-dependent in the nonlinear case
741(\autoref{subsec:PE_free_surface}).
742With both linear and nonlinear free surface, external gravity waves are allowed in the equations,
743which imposes a very small time step when an explicit time stepping is used.
744Two methods are proposed to allow a longer time step for the three-dimensional equations:
745the filtered free surface, which is a modification of the continuous equations (see \autoref{eq:PE_flt}),
746and the split-explicit free surface described below.
747The extra term introduced in the filtered method is calculated implicitly,
748so that the update of the next velocities is done in module \mdl{dynspg\_flt} and not in \mdl{dynnxt}.
749
750
751The form of the surface pressure gradient term depends on how the user wants to handle
752the fast external gravity waves that are a solution of the analytical equation (\autoref{sec:PE_hor_pg}).
753Three formulations are available, all controlled by a CPP key (ln\_dynspg\_xxx):
754an explicit formulation which requires a small time step ;
755a filtered free surface formulation which allows a larger time step by adding a filtering
756term into the momentum equation ;
757and a split-explicit free surface formulation, described below, which also allows a larger time step.
758
759The extra term introduced in the filtered method is calculated
760implicitly, so that a solver is used to compute it. As a consequence the update of the $next$ 
761velocities is done in module \mdl{dynspg\_flt} and not in \mdl{dynnxt}.
762
763
764%--------------------------------------------------------------------------------------------------------------
765% Explicit free surface formulation
766%--------------------------------------------------------------------------------------------------------------
767\subsection{Explicit free surface (\protect\key{dynspg\_exp})}
768\label{subsec:DYN_spg_exp}
769
770In the explicit free surface formulation (\key{dynspg\_exp} defined), the model time step
771is chosen to be small enough to resolve the external gravity waves (typically a few tens of seconds).
772The surface pressure gradient, evaluated using a leap-frog scheme ($i.e.$ centered in time),
773is thus simply given by :
774\begin{equation} \label{eq:dynspg_exp}
775\left\{ \begin{aligned}
776 - \frac{1}{e_{1u}\,\rho_o} \;   \delta _{i+1/2} \left[  \,\rho \,\eta\,  \right]   \\
777 - \frac{1}{e_{2v}\,\rho_o} \;   \delta _{j+1/2} \left[  \,\rho \,\eta\,  \right] 
778\end{aligned} \right.
779\end{equation} 
780
781Note that in the non-linear free surface case ($i.e.$ \key{vvl} defined), the surface pressure
782gradient is already included in the momentum tendency  through the level thickness variation
783allowed in the computation of the hydrostatic pressure gradient. Thus, nothing is done in the \mdl{dynspg\_exp} module.
784
785%--------------------------------------------------------------------------------------------------------------
786% Split-explict free surface formulation
787%--------------------------------------------------------------------------------------------------------------
788\subsection{Split-explicit free surface (\protect\key{dynspg\_ts})}
789\label{subsec:DYN_spg_ts}
790%------------------------------------------namsplit-----------------------------------------------------------
791%
792%\nlst{namsplit}
793%-------------------------------------------------------------------------------------------------------------
794
795The split-explicit free surface formulation used in \NEMO (\key{dynspg\_ts} defined),
796also called the time-splitting formulation, follows the one
797proposed by \citet{Shchepetkin_McWilliams_OM05}. The general idea is to solve the free surface
798equation and the associated barotropic velocity equations with a smaller time
799step than $\rdt$, the time step used for the three dimensional prognostic
800variables (\autoref{fig:DYN_dynspg_ts}).
801The size of the small time step, $\rdt_e$ (the external mode or barotropic time step)
802 is provided through the \np{nn\_baro} namelist parameter as:
803$\rdt_e = \rdt / nn\_baro$. This parameter can be optionally defined automatically (\np{ln\_bt\_nn\_auto}\forcode{ = .true.})
804considering that the stability of the barotropic system is essentially controled by external waves propagation.
805Maximum Courant number is in that case time independent, and easily computed online from the input bathymetry.
806Therefore, $\rdt_e$ is adjusted so that the Maximum allowed Courant number is smaller than \np{rn\_bt\_cmax}.
807
808%%%
809The barotropic mode solves the following equations:
810\begin{subequations} \label{eq:BT}
811  \begin{equation}     \label{eq:BT_dyn}
812\frac{\partial {\rm \overline{{\bf U}}_h} }{\partial t}=
813 -f\;{\rm {\bf k}}\times {\rm \overline{{\bf U}}_h} 
814-g\nabla _h \eta -\frac{c_b^{\textbf U}}{H+\eta} \rm {\overline{{\bf U}}_h} + \rm {\overline{\bf G}}
815  \end{equation}
816
817  \begin{equation} \label{eq:BT_ssh}
818\frac{\partial \eta }{\partial t}=-\nabla \cdot \left[ {\left( {H+\eta } \right) \; {\rm{\bf \overline{U}}}_h \,} \right]+P-E
819  \end{equation}
820\end{subequations}
821where $\rm {\overline{\bf G}}$ is a forcing term held constant, containing coupling term between modes, surface atmospheric forcing as well as slowly varying barotropic terms not explicitly computed to gain efficiency. The third term on the right hand side of \autoref{eq:BT_dyn} represents the bottom stress (see section \autoref{sec:ZDF_bfr}), explicitly accounted for at each barotropic iteration. Temporal discretization of the system above follows a three-time step Generalized Forward Backward algorithm detailed in \citet{Shchepetkin_McWilliams_OM05}. AB3-AM4 coefficients used in \NEMO follow the second-order accurate, "multi-purpose" stability compromise as defined in \citet{Shchepetkin_McWilliams_Bk08} (see their figure 12, lower left).
822
823%>   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >
824\begin{figure}[!t]    \begin{center}
825\includegraphics[width=0.7\textwidth]{Fig_DYN_dynspg_ts}
826\caption{  \protect\label{fig:DYN_dynspg_ts}
827Schematic of the split-explicit time stepping scheme for the external
828and internal modes. Time increases to the right. In this particular exemple,
829a boxcar averaging window over $nn\_baro$ barotropic time steps is used ($nn\_bt\_flt=1$) and $nn\_baro=5$.
830Internal mode time steps (which are also the model time steps) are denoted
831by $t-\rdt$, $t$ and $t+\rdt$. Variables with $k$ superscript refer to instantaneous barotropic variables,
832$< >$ and $<< >>$ operator refer to time filtered variables using respectively primary (red vertical bars) and secondary weights (blue vertical bars).
833The former are used to obtain time filtered quantities at $t+\rdt$ while the latter are used to obtain time averaged
834transports to advect tracers.
835a) Forward time integration: \protect\np{ln\_bt\_fw}\forcode{ = .true.}\protect\np{ln\_bt\_av}\forcode{ = .true.}.
836b) Centred time integration: \protect\np{ln\_bt\_fw}\forcode{ = .false.}, \protect\np{ln\_bt\_av}\forcode{ = .true.}.
837c) Forward time integration with no time filtering (POM-like scheme): \protect\np{ln\_bt\_fw}\forcode{ = .true.}, \protect\np{ln\_bt\_av}\forcode{ = .false.}. }
838\end{center}    \end{figure}
839%>   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >
840
841In the default case (\np{ln\_bt\_fw}\forcode{ = .true.}), the external mode is integrated
842between \textit{now} and  \textit{after} baroclinic time-steps (\autoref{fig:DYN_dynspg_ts}a). To avoid aliasing of fast barotropic motions into three dimensional equations, time filtering is eventually applied on barotropic
843quantities (\np{ln\_bt\_av}\forcode{ = .true.}). In that case, the integration is extended slightly beyond  \textit{after} time step to provide time filtered quantities.
844These are used for the subsequent initialization of the barotropic mode in the following baroclinic step.
845Since external mode equations written at baroclinic time steps finally follow a forward time stepping scheme,
846asselin filtering is not applied to barotropic quantities. \\
847Alternatively, one can choose to integrate barotropic equations starting
848from \textit{before} time step (\np{ln\_bt\_fw}\forcode{ = .false.}). Although more computationaly expensive ( \np{nn\_baro} additional iterations are indeed necessary), the baroclinic to barotropic forcing term given at \textit{now} time step
849become centred in the middle of the integration window. It can easily be shown that this property
850removes part of splitting errors between modes, which increases the overall numerical robustness.
851%references to Patrick Marsaleix' work here. Also work done by SHOM group.
852
853%%%
854
855As far as tracer conservation is concerned, barotropic velocities used to advect tracers must also be updated
856at \textit{now} time step. This implies to change the traditional order of computations in \NEMO: most of momentum 
857trends (including the barotropic mode calculation) updated first, tracers' after. This \textit{de facto} makes semi-implicit hydrostatic
858pressure gradient (see section \autoref{subsec:DYN_hpg_imp}) and time splitting not compatible.
859Advective barotropic velocities are obtained by using a secondary set of filtering weights, uniquely defined from the filter
860coefficients used for the time averaging (\citet{Shchepetkin_McWilliams_OM05}). Consistency between the time averaged continuity equation and the time stepping of tracers is here the key to obtain exact conservation.
861
862%%%
863
864One can eventually choose to feedback instantaneous values by not using any time filter (\np{ln\_bt\_av}\forcode{ = .false.}).
865In that case, external mode equations are continuous in time, ie they are not re-initialized when starting a new
866sub-stepping sequence. This is the method used so far in the POM model, the stability being maintained by refreshing at (almost)
867each barotropic time step advection and horizontal diffusion terms. Since the latter terms have not been added in \NEMO for
868computational efficiency, removing time filtering is not recommended except for debugging purposes.
869This may be used for instance to appreciate the damping effect of the standard formulation on external gravity waves in idealized or weakly non-linear cases. Although the damping is lower than for the filtered free surface, it is still significant as shown by \citet{Levier2007} in the case of an analytical barotropic Kelvin wave.
870
871%>>>>>===============
872\gmcomment{               %%% copy from griffies Book
873
874\textbf{title: Time stepping the barotropic system }
875
876Assume knowledge of the full velocity and tracer fields at baroclinic time $\tau$. Hence,
877we can update the surface height and vertically integrated velocity with a leap-frog
878scheme using the small barotropic time step $\rdt$. We have
879
880\begin{equation} \label{eq:DYN_spg_ts_eta}
881\eta^{(b)}(\tau,t_{n+1}) - \eta^{(b)}(\tau,t_{n+1}) (\tau,t_{n-1})
882   = 2 \rdt \left[-\nabla \cdot \textbf{U}^{(b)}(\tau,t_n) + \text{EMP}_w(\tau) \right] 
883\end{equation}
884\begin{multline} \label{eq:DYN_spg_ts_u}
885\textbf{U}^{(b)}(\tau,t_{n+1}) - \textbf{U}^{(b)}(\tau,t_{n-1}\\
886   = 2\rdt \left[ - f \textbf{k} \times \textbf{U}^{(b)}(\tau,t_{n})
887   - H(\tau) \nabla p_s^{(b)}(\tau,t_{n}) +\textbf{M}(\tau) \right]
888\end{multline}
889\
890
891In these equations, araised (b) denotes values of surface height and vertically integrated velocity updated with the barotropic time steps. The $\tau$ time label on $\eta^{(b)}$ 
892and $U^{(b)}$ denotes the baroclinic time at which the vertically integrated forcing $\textbf{M}(\tau)$ (note that this forcing includes the surface freshwater forcing), the tracer fields, the freshwater flux $\text{EMP}_w(\tau)$, and total depth of the ocean $H(\tau)$ are held for the duration of the barotropic time stepping over a single cycle. This is also the time
893that sets the barotropic time steps via
894\begin{equation} \label{eq:DYN_spg_ts_t}
895t_n=\tau+n\rdt   
896\end{equation}
897with $n$ an integer. The density scaled surface pressure is evaluated via
898\begin{equation} \label{eq:DYN_spg_ts_ps}
899p_s^{(b)}(\tau,t_{n}) = \begin{cases}
900   g \;\eta_s^{(b)}(\tau,t_{n}) \;\rho(\tau)_{k=1}) / \rho_&      \text{non-linear case} \\
901   g \;\eta_s^{(b)}(\tau,t_{n}&      \text{linear case} 
902   \end{cases}
903\end{equation}
904To get started, we assume the following initial conditions
905\begin{equation} \label{eq:DYN_spg_ts_eta}
906\begin{split}
907\eta^{(b)}(\tau,t_{n=0}) &= \overline{\eta^{(b)}(\tau)}
908\\
909\eta^{(b)}(\tau,t_{n=1}) &= \eta^{(b)}(\tau,t_{n=0}) + \rdt \ \text{RHS}_{n=0} 
910\end{split}
911\end{equation}
912with
913\begin{equation} \label{eq:DYN_spg_ts_etaF}
914 \overline{\eta^{(b)}(\tau)} = \frac{1}{N+1} \sum\limits_{n=0}^N \eta^{(b)}(\tau-\rdt,t_{n})
915\end{equation}
916the time averaged surface height taken from the previous barotropic cycle. Likewise,
917\begin{equation} \label{eq:DYN_spg_ts_u}
918\textbf{U}^{(b)}(\tau,t_{n=0}) = \overline{\textbf{U}^{(b)}(\tau)}   \\
919\\
920\textbf{U}(\tau,t_{n=1}) = \textbf{U}^{(b)}(\tau,t_{n=0}) + \rdt \ \text{RHS}_{n=0}   
921\end{equation}
922with
923\begin{equation} \label{eq:DYN_spg_ts_u}
924 \overline{\textbf{U}^{(b)}(\tau)} 
925   = \frac{1}{N+1} \sum\limits_{n=0}^N\textbf{U}^{(b)}(\tau-\rdt,t_{n})
926\end{equation}
927the time averaged vertically integrated transport. Notably, there is no Robert-Asselin time filter used in the barotropic portion of the integration.
928
929Upon reaching $t_{n=N} = \tau + 2\rdt \tau$ , the vertically integrated velocity is time averaged to produce the updated vertically integrated velocity at baroclinic time $\tau + \rdt \tau$ 
930\begin{equation} \label{eq:DYN_spg_ts_u}
931\textbf{U}(\tau+\rdt) = \overline{\textbf{U}^{(b)}(\tau+\rdt)} 
932   = \frac{1}{N+1} \sum\limits_{n=0}^N\textbf{U}^{(b)}(\tau,t_{n})
933\end{equation}
934The surface height on the new baroclinic time step is then determined via a baroclinic leap-frog using the following form
935
936\begin{equation} \label{eq:DYN_spg_ts_ssh}
937\eta(\tau+\Delta) - \eta^{F}(\tau-\Delta) = 2\rdt \ \left[ - \nabla \cdot \textbf{U}(\tau) + \text{EMP}_w \right] 
938\end{equation}
939
940 The use of this "big-leap-frog" scheme for the surface height ensures compatibility between the mass/volume budgets and the tracer budgets. More discussion of this point is provided in Chapter 10 (see in particular Section 10.2).
941 
942In general, some form of time filter is needed to maintain integrity of the surface
943height field due to the leap-frog splitting mode in equation \autoref{eq:DYN_spg_ts_ssh}. We
944have tried various forms of such filtering, with the following method discussed in
945\cite{Griffies_al_MWR01} chosen due to its stability and reasonably good maintenance of
946tracer conservation properties (see ??)
947
948\begin{equation} \label{eq:DYN_spg_ts_sshf}
949\eta^{F}(\tau-\Delta) =  \overline{\eta^{(b)}(\tau)} 
950\end{equation}
951Another approach tried was
952
953\begin{equation} \label{eq:DYN_spg_ts_sshf2}
954\eta^{F}(\tau-\Delta) = \eta(\tau)
955   + (\alpha/2) \left[\overline{\eta^{(b)}}(\tau+\rdt)
956                + \overline{\eta^{(b)}}(\tau-\rdt) -2 \;\eta(\tau) \right]
957\end{equation}
958
959which is useful since it isolates all the time filtering aspects into the term multiplied
960by $\alpha$. This isolation allows for an easy check that tracer conservation is exact when
961eliminating tracer and surface height time filtering (see ?? for more complete discussion). However, in the general case with a non-zero $\alpha$, the filter \autoref{eq:DYN_spg_ts_sshf} was found to be more conservative, and so is recommended.
962
963}            %%end gm comment (copy of griffies book)
964
965%>>>>>===============
966
967
968%--------------------------------------------------------------------------------------------------------------
969% Filtered free surface formulation
970%--------------------------------------------------------------------------------------------------------------
971\subsection{Filtered free surface (\protect\key{dynspg\_flt})}
972\label{subsec:DYN_spg_fltp}
973
974The filtered formulation follows the \citet{Roullet_Madec_JGR00} implementation.
975The extra term introduced in the equations (see \autoref{subsec:PE_free_surface}) is solved implicitly.
976The elliptic solvers available in the code are documented in \autoref{chap:MISC}.
977
978%% gm %%======>>>>   given here the discrete eqs provided to the solver
979\gmcomment{               %%% copy from chap-model basics
980\begin{equation} \label{eq:spg_flt}
981\frac{\partial {\rm {\bf U}}_h }{\partial t}= {\rm {\bf M}}
982- g \nabla \left( \tilde{\rho} \ \eta \right)
983- g \ T_c \nabla \left( \widetilde{\rho} \ \partial_t \eta \right)
984\end{equation}
985where $T_c$, is a parameter with dimensions of time which characterizes the force,
986$\widetilde{\rho} = \rho / \rho_o$ is the dimensionless density, and $\rm {\bf M}$ 
987represents the collected contributions of the Coriolis, hydrostatic pressure gradient,
988non-linear and viscous terms in \autoref{eq:PE_dyn}.
989}   %end gmcomment
990
991Note that in the linear free surface formulation (\key{vvl} not defined), the ocean depth
992is time-independent and so is the matrix to be inverted. It is computed once and for all and applies to all ocean time steps.
993
994% ================================================================
995% Lateral diffusion term
996% ================================================================
997\section{Lateral diffusion term and operators (\protect\mdl{dynldf})}
998\label{sec:DYN_ldf}
999%------------------------------------------nam_dynldf----------------------------------------------------
1000
1001\nlst{namdyn_ldf} 
1002%-------------------------------------------------------------------------------------------------------------
1003
1004Options are defined through the \ngn{namdyn\_ldf} namelist variables.
1005The options available for lateral diffusion are to use either laplacian
1006(rotated or not) or biharmonic operators. The coefficients may be constant
1007or spatially variable; the description of the coefficients is found in the chapter
1008on lateral physics (\autoref{chap:LDF}). The lateral diffusion of momentum is
1009evaluated using a forward scheme, $i.e.$ the velocity appearing in its expression
1010is the \textit{before} velocity in time, except for the pure vertical component
1011that appears when a tensor of rotation is used. This latter term is solved
1012implicitly together with the vertical diffusion term (see \autoref{chap:STP})
1013
1014At the lateral boundaries either free slip, no slip or partial slip boundary
1015conditions are applied according to the user's choice (see \autoref{chap:LBC}).
1016
1017\gmcomment{
1018Hyperviscous operators are frequently used in the simulation of turbulent flows to control
1019the dissipation of unresolved small scale features.
1020Their primary role is to provide strong dissipation at the smallest scale supported by the grid
1021while minimizing the impact on the larger scale features.
1022Hyperviscous operators are thus designed to be more scale selective than the traditional,
1023physically motivated Laplace operator.
1024In finite difference methods, the biharmonic operator is frequently the method of choice to achieve
1025this scale selective dissipation since its damping time ($i.e.$ its spin down time)
1026scale like $\lambda^{-4}$ for disturbances of wavelength $\lambda$ 
1027(so that short waves damped more rapidelly than long ones),
1028whereas the Laplace operator damping time scales only like $\lambda^{-2}$.
1029}
1030
1031% ================================================================
1032\subsection[Iso-level laplacian (\protect\np{ln\_dynldf\_lap}\forcode{ = .true.})]
1033            {Iso-level laplacian operator (\protect\np{ln\_dynldf\_lap}\forcode{ = .true.})}
1034\label{subsec:DYN_ldf_lap}
1035
1036For lateral iso-level diffusion, the discrete operator is:
1037\begin{equation} \label{eq:dynldf_lap}
1038\left\{ \begin{aligned}
1039 D_u^{l{\rm {\bf U}}} =\frac{1}{e_{1u} }\delta _{i+1/2} \left[ {A_T^{lm} 
1040\;\chi } \right]-\frac{1}{e_{2u} {\kern 1pt}e_{3u} }\delta _j \left[
1041{A_f^{lm} \;e_{3f} \zeta } \right] \\ 
1042\\
1043 D_v^{l{\rm {\bf U}}} =\frac{1}{e_{2v} }\delta _{j+1/2} \left[ {A_T^{lm} 
1044\;\chi } \right]+\frac{1}{e_{1v} {\kern 1pt}e_{3v} }\delta _i \left[
1045{A_f^{lm} \;e_{3f} \zeta } \right] \\ 
1046\end{aligned} \right.
1047\end{equation} 
1048
1049As explained in \autoref{subsec:PE_ldf}, this formulation (as the gradient of a divergence
1050and curl of the vorticity) preserves symmetry and ensures a complete
1051separation between the vorticity and divergence parts of the momentum diffusion.
1052
1053%--------------------------------------------------------------------------------------------------------------
1054%           Rotated laplacian operator
1055%--------------------------------------------------------------------------------------------------------------
1056\subsection[Rotated laplacian (\protect\np{ln\_dynldf\_iso}\forcode{ = .true.})]
1057            {Rotated laplacian operator (\protect\np{ln\_dynldf\_iso}\forcode{ = .true.})}
1058\label{subsec:DYN_ldf_iso}
1059
1060A rotation of the lateral momentum diffusion operator is needed in several cases:
1061for iso-neutral diffusion in the $z$-coordinate (\np{ln\_dynldf\_iso}\forcode{ = .true.}) and for
1062either iso-neutral (\np{ln\_dynldf\_iso}\forcode{ = .true.}) or geopotential
1063(\np{ln\_dynldf\_hor}\forcode{ = .true.}) diffusion in the $s$-coordinate. In the partial step
1064case, coordinates are horizontal except at the deepest level and no
1065rotation is performed when \np{ln\_dynldf\_hor}\forcode{ = .true.}. The diffusion operator
1066is defined simply as the divergence of down gradient momentum fluxes on each
1067momentum component. It must be emphasized that this formulation ignores
1068constraints on the stress tensor such as symmetry. The resulting discrete
1069representation is:
1070\begin{equation} \label{eq:dyn_ldf_iso}
1071\begin{split}
1072 D_u^{l\textbf{U}} &= \frac{1}{e_{1u} \, e_{2u} \, e_{3u} } \\
1073&  \left\{\quad  {\delta _{i+1/2} \left[ {A_T^{lm}  \left(
1074    {\frac{e_{2t} \; e_{3t} }{e_{1t} } \,\delta _{i}[u]
1075   -e_{2t} \; r_{1t} \,\overline{\overline {\delta _{k+1/2}[u]}}^{\,i,\,k}}
1076 \right)} \right]}   \right.
1077\\ 
1078& \qquad +\ \delta_j \left[ {A_f^{lm} \left( {\frac{e_{1f}\,e_{3f} }{e_{2f} 
1079}\,\delta _{j+1/2} [u] - e_{1f}\, r_{2f} 
1080\,\overline{\overline {\delta _{k+1/2} [u]}} ^{\,j+1/2,\,k}} 
1081\right)} \right]
1082\\ 
1083&\qquad +\ \delta_k \left[ {A_{uw}^{lm} \left( {-e_{2u} \, r_{1uw} \,\overline{\overline 
1084{\delta_{i+1/2} [u]}}^{\,i+1/2,\,k+1/2} } 
1085\right.} \right.
1086\\ 
1087&  \ \qquad \qquad \qquad \quad\
1088- e_{1u} \, r_{2uw} \,\overline{\overline {\delta_{j+1/2} [u]}} ^{\,j,\,k+1/2}
1089\\ 
1090& \left. {\left. { \ \qquad \qquad \qquad \ \ \ \left. {\
1091+\frac{e_{1u}\, e_{2u} }{e_{3uw} }\,\left( {r_{1uw}^2+r_{2uw}^2} 
1092\right)\,\delta_{k+1/2} [u]} \right)} \right]\;\;\;} \right\} 
1093\\
1094\\
1095 D_v^{l\textbf{V}} &= \frac{1}{e_{1v} \, e_{2v} \, e_{3v} }    \\
1096&  \left\{\quad  {\delta _{i+1/2} \left[ {A_f^{lm}  \left(
1097    {\frac{e_{2f} \; e_{3f} }{e_{1f} } \,\delta _{i+1/2}[v]
1098   -e_{2f} \; r_{1f} \,\overline{\overline {\delta _{k+1/2}[v]}}^{\,i+1/2,\,k}}
1099 \right)} \right]}   \right.
1100\\ 
1101& \qquad +\ \delta_j \left[ {A_T^{lm} \left( {\frac{e_{1t}\,e_{3t} }{e_{2t} 
1102}\,\delta _{j} [v] - e_{1t}\, r_{2t} 
1103\,\overline{\overline {\delta _{k+1/2} [v]}} ^{\,j,\,k}} 
1104\right)} \right]
1105\\ 
1106& \qquad +\ \delta_k \left[ {A_{vw}^{lm} \left( {-e_{2v} \, r_{1vw} \,\overline{\overline 
1107{\delta_{i+1/2} [v]}}^{\,i+1/2,\,k+1/2} }\right.} \right.
1108\\
1109&  \ \qquad \qquad \qquad \quad\
1110- e_{1v} \, r_{2vw} \,\overline{\overline {\delta_{j+1/2} [v]}} ^{\,j+1/2,\,k+1/2}
1111\\ 
1112& \left. {\left. { \ \qquad \qquad \qquad \ \ \ \left. {\
1113+\frac{e_{1v}\, e_{2v} }{e_{3vw} }\,\left( {r_{1vw}^2+r_{2vw}^2} 
1114\right)\,\delta_{k+1/2} [v]} \right)} \right]\;\;\;} \right\} 
1115 \end{split}
1116\end{equation}
1117where $r_1$ and $r_2$ are the slopes between the surface along which the
1118diffusion operator acts and the surface of computation ($z$- or $s$-surfaces).
1119The way these slopes are evaluated is given in the lateral physics chapter
1120(\autoref{chap:LDF}).
1121
1122%--------------------------------------------------------------------------------------------------------------
1123%           Iso-level bilaplacian operator
1124%--------------------------------------------------------------------------------------------------------------
1125\subsection[Iso-level bilaplacian (\protect\np{ln\_dynldf\_bilap}\forcode{ = .true.})]
1126            {Iso-level bilaplacian operator (\protect\np{ln\_dynldf\_bilap}\forcode{ = .true.})}
1127\label{subsec:DYN_ldf_bilap}
1128
1129The lateral fourth order operator formulation on momentum is obtained by
1130applying \autoref{eq:dynldf_lap} twice. It requires an additional assumption on
1131boundary conditions: the first derivative term normal to the coast depends on
1132the free or no-slip lateral boundary conditions chosen, while the third
1133derivative terms normal to the coast are set to zero (see \autoref{chap:LBC}).
1134%%%
1135\gmcomment{add a remark on the the change in the position of the coefficient}
1136%%%
1137
1138% ================================================================
1139%           Vertical diffusion term
1140% ================================================================
1141\section{Vertical diffusion term (\protect\mdl{dynzdf})}
1142\label{sec:DYN_zdf}
1143%----------------------------------------------namzdf------------------------------------------------------
1144
1145\nlst{namzdf} 
1146%-------------------------------------------------------------------------------------------------------------
1147
1148Options are defined through the \ngn{namzdf} namelist variables.
1149The large vertical diffusion coefficient found in the surface mixed layer together
1150with high vertical resolution implies that in the case of explicit time stepping there
1151would be too restrictive a constraint on the time step. Two time stepping schemes
1152can be used for the vertical diffusion term : $(a)$ a forward time differencing
1153scheme (\np{ln\_zdfexp}\forcode{ = .true.}) using a time splitting technique
1154(\np{nn\_zdfexp} $>$ 1) or $(b)$ a backward (or implicit) time differencing scheme
1155(\np{ln\_zdfexp}\forcode{ = .false.}) (see \autoref{chap:STP}). Note that namelist variables
1156\np{ln\_zdfexp} and \np{nn\_zdfexp} apply to both tracers and dynamics.
1157
1158The formulation of the vertical subgrid scale physics is the same whatever
1159the vertical coordinate is. The vertical diffusion operators given by
1160\autoref{eq:PE_zdf} take the following semi-discrete space form:
1161\begin{equation} \label{eq:dynzdf}
1162\left\{   \begin{aligned}
1163D_u^{vm} &\equiv \frac{1}{e_{3u}} \ \delta _k \left[ \frac{A_{uw}^{vm} }{e_{3uw} }
1164                              \ \delta _{k+1/2} [\,u\,]         \right]     \\
1165\\
1166D_v^{vm} &\equiv \frac{1}{e_{3v}} \ \delta _k \left[ \frac{A_{vw}^{vm} }{e_{3vw} }
1167                              \ \delta _{k+1/2} [\,v\,]         \right]
1168\end{aligned}   \right.
1169\end{equation} 
1170where $A_{uw}^{vm} $ and $A_{vw}^{vm} $ are the vertical eddy viscosity and
1171diffusivity coefficients. The way these coefficients are evaluated
1172depends on the vertical physics used (see \autoref{chap:ZDF}).
1173
1174The surface boundary condition on momentum is the stress exerted by
1175the wind. At the surface, the momentum fluxes are prescribed as the boundary
1176condition on the vertical turbulent momentum fluxes,
1177\begin{equation} \label{eq:dynzdf_sbc}
1178\left.{\left( {\frac{A^{vm} }{e_3 }\ \frac{\partial \textbf{U}_h}{\partial k}} \right)} \right|_{z=1}
1179    = \frac{1}{\rho _o} \binom{\tau _u}{\tau _v }
1180\end{equation}
1181where $\left( \tau _u ,\tau _v \right)$ are the two components of the wind stress
1182vector in the (\textbf{i},\textbf{j}) coordinate system. The high mixing coefficients
1183in the surface mixed layer ensure that the surface wind stress is distributed in
1184the vertical over the mixed layer depth. If the vertical mixing coefficient
1185is small (when no mixed layer scheme is used) the surface stress enters only
1186the top model level, as a body force. The surface wind stress is calculated
1187in the surface module routines (SBC, see \autoref{chap:SBC})
1188
1189The turbulent flux of momentum at the bottom of the ocean is specified through
1190a bottom friction parameterisation (see \autoref{sec:ZDF_bfr})
1191
1192% ================================================================
1193% External Forcing
1194% ================================================================
1195\section{External forcings}
1196\label{sec:DYN_forcing}
1197
1198Besides the surface and bottom stresses (see the above section) which are
1199introduced as boundary conditions on the vertical mixing, three other forcings
1200may enter the dynamical equations by affecting the surface pressure gradient.
1201
1202(1) When \np{ln\_apr\_dyn}\forcode{ = .true.} (see \autoref{sec:SBC_apr}), the atmospheric pressure is taken
1203into account when computing the surface pressure gradient.
1204
1205(2) When \np{ln\_tide\_pot}\forcode{ = .true.} and \np{ln\_tide}\forcode{ = .true.} (see \autoref{sec:SBC_tide}),
1206the tidal potential is taken into account when computing the surface pressure gradient.
1207
1208(3) When \np{nn\_ice\_embd}\forcode{ = 2} and LIM or CICE is used ($i.e.$ when the sea-ice is embedded in the ocean),
1209the snow-ice mass is taken into account when computing the surface pressure gradient.
1210
1211
1212\gmcomment{ missing : the lateral boundary condition !!!   another external forcing
1213 }
1214
1215% ================================================================
1216% Time evolution term
1217% ================================================================
1218\section{Time evolution term (\protect\mdl{dynnxt})}
1219\label{sec:DYN_nxt}
1220
1221%----------------------------------------------namdom----------------------------------------------------
1222
1223\nlst{namdom} 
1224%-------------------------------------------------------------------------------------------------------------
1225
1226Options are defined through the \ngn{namdom} namelist variables.
1227The general framework for dynamics time stepping is a leap-frog scheme,
1228$i.e.$ a three level centred time scheme associated with an Asselin time filter
1229(cf. \autoref{chap:STP}). The scheme is applied to the velocity, except when using
1230the flux form of momentum advection (cf. \autoref{sec:DYN_adv_cor_flux}) in the variable
1231volume case (\key{vvl} defined), where it has to be applied to the thickness
1232weighted velocity (see \autoref{sec:A_momentum}
1233
1234$\bullet$ vector invariant form or linear free surface (\np{ln\_dynhpg\_vec}\forcode{ = .true.} ; \key{vvl} not defined):
1235\begin{equation} \label{eq:dynnxt_vec}
1236\left\{   \begin{aligned}
1237&u^{t+\rdt} = u_f^{t-\rdt} + 2\rdt  \ \text{RHS}_u^t     \\
1238&u_f^t \;\quad = u^t+\gamma \,\left[ {u_f^{t-\rdt} -2u^t+u^{t+\rdt}} \right]
1239\end{aligned}   \right.
1240\end{equation} 
1241
1242$\bullet$ flux form and nonlinear free surface (\np{ln\_dynhpg\_vec}\forcode{ = .false.} ; \key{vvl} defined):
1243\begin{equation} \label{eq:dynnxt_flux}
1244\left\{   \begin{aligned}
1245&\left(e_{3u}\,u\right)^{t+\rdt} = \left(e_{3u}\,u\right)_f^{t-\rdt} + 2\rdt \; e_{3u} \;\text{RHS}_u^t     \\
1246&\left(e_{3u}\,u\right)_f^t \;\quad = \left(e_{3u}\,u\right)^t
1247  +\gamma \,\left[ {\left(e_{3u}\,u\right)_f^{t-\rdt} -2\left(e_{3u}\,u\right)^t+\left(e_{3u}\,u\right)^{t+\rdt}} \right]
1248\end{aligned}   \right.
1249\end{equation} 
1250where RHS is the right hand side of the momentum equation, the subscript $f$ 
1251denotes filtered values and $\gamma$ is the Asselin coefficient. $\gamma$ is
1252initialized as \np{nn\_atfp} (namelist parameter). Its default value is \np{nn\_atfp}\forcode{ = 10.e-3}.
1253In both cases, the modified Asselin filter is not applied since perfect conservation
1254is not an issue for the momentum equations.
1255
1256Note that with the filtered free surface, the update of the \textit{after} velocities
1257is done in the \mdl{dynsp\_flt} module, and only array swapping
1258and Asselin filtering is done in \mdl{dynnxt}.
1259
1260% ================================================================
1261\end{document}
Note: See TracBrowser for help on using the repository browser.