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 @ 10406

Last change on this file since 10406 was 10406, checked in by nicolasmartin, 5 years ago

Edition of math environments

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