Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
\documentclass[../main/NEMO_manual]{subfiles}
\begin{document}
\chapter{Ocean Dynamics (DYN)}
\label{chap:DYN}
\chaptertoc
\paragraph{Changes record} ~\\
{\footnotesize
\begin{tabularx}{\textwidth}{l||X|X}
Release & Author(s) & Modifications \\
\hline
{\em 4.0} & {\em ...} & {\em ...} \\
{\em 3.6} & {\em ...} & {\em ...} \\
{\em 3.4} & {\em ...} & {\em ...} \\
{\em <=3.4} & {\em ...} & {\em ...}
\end{tabularx}
}
\clearpage
Using the representation described in \autoref{chap:DOM},
several semi-discrete space forms of the dynamical equations are available depending on
the vertical coordinate used and on the conservation properties of the vorticity term.
In all the equations presented here, the masking has been omitted for simplicity.
One must be aware that all the quantities are masked fields and
that each time an average or difference operator is used, the resulting field is multiplied by a mask.
The prognostic ocean dynamics equation can be summarized as follows:
\[
\text{NXT} = \dbinom {\text{VOR} + \text{KEG} + \text {ZAD} }
{\text{COR} + \text{ADV} }
+ \text{HPG} + \text{SPG} + \text{LDF} + \text{ZDF}
\]
NXT stands for next, referring to the time-stepping.
The first group of terms on the rhs of this equation corresponds to the Coriolis and advection terms that
are decomposed into either a vorticity part (VOR), a kinetic energy part (KEG) and
a vertical advection part (ZAD) in the vector invariant formulation,
or a Coriolis and advection part (COR+ADV) in the flux formulation.
The terms following these are the pressure gradient contributions
(HPG, Hydrostatic Pressure Gradient, and SPG, Surface Pressure Gradient);
and contributions from lateral diffusion (LDF) and vertical diffusion (ZDF),
which are added to the rhs in the \mdl{dynldf} and \mdl{dynzdf} modules.
The vertical diffusion term includes the surface and bottom stresses.
The external forcings and parameterisations require complex inputs
(surface wind stress calculation using bulk formulae, estimation of mixing coefficients)
that are carried out in modules SBC, LDF and ZDF and are described in
\autoref{chap:SBC}, \autoref{chap:LDF} and \autoref{chap:ZDF}, respectively.
In the present chapter we also describe the diagnostic equations used to compute the horizontal divergence,
curl of the velocities (\emph{divcur} module) and the vertical velocity (\emph{wzvmod} module).
The different options available to the user are managed by namelist variables.
For term \textit{ttt} in the momentum equations, the logical namelist variables are \textit{ln\_dynttt\_xxx},
where \textit{xxx} is a 3 or 4 letter acronym corresponding to each optional scheme.
%If a CPP key is used for this term its name is \key{ttt}.
The corresponding code can be found in the \textit{dynttt\_xxx} module in the DYN directory,
and it is usually computed in the \textit{dyn\_ttt\_xxx} subroutine.
The user has the option of extracting and outputting each tendency term from the 3D momentum equations
(\texttt{trddyn?} defined), as described in \autoref{chap:MISC}.
Furthermore, the tendency terms associated with the 2D barotropic vorticity balance (when \texttt{trdvor?} is defined)
can be derived from the 3D terms.
\cmtgm{STEVEN: not quite sure I've got the sense of the last sentence.
Does MISC correspond to "extracting tendency terms" or "vorticity balance"?}
%% =================================================================================================
\section{Sea surface height and diagnostic variables ($\eta$, $\zeta$, $\chi$, $w$)}
\label{sec:DYN_divcur_wzv}
%% =================================================================================================
\subsection[Horizontal divergence and relative vorticity (\textit{divhor.F90})]{Horizontal divergence and relative vorticity (\protect\mdl{divcur})}
\label{subsec:DYN_divcur}
The vorticity is defined at an $f$-point (\ie\ corner point) as follows (used in ):
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
\begin{equation}
\label{eq:DYN_divcur_cur}
\zeta =\frac{1}{e_{1f}\,e_{2f} }\left( {\;\delta_{i+1/2} \left[ {e_{2v}\;v} \right]
-\delta_{j+1/2} \left[ {e_{1u}\;u} \right]\;} \right)
\end{equation}
The horizontal divergence is defined at a $T$-point.
It is given by:
\[
% \label{eq:DYN_divcur_div}
\chi =\frac{1}{e_{1t}\,e_{2t}\,e_{3t} }
\left( {\delta_i \left[ {e_{2u}\,e_{3u}\,u} \right]
+\delta_j \left[ {e_{1v}\,e_{3v}\,v} \right]} \right)
\]
Note that although the vorticity has the same discrete expression in $z$- and $s$-coordinates,
its physical meaning is not identical.
$\zeta$ is a pseudo vorticity along $s$-surfaces
(only pseudo because $(u,v)$ are still defined along geopotential surfaces,
but are not necessarily defined at the same depth).
The vorticity and divergence at the \textit{before} step are used in the computation of
the horizontal diffusion of momentum.
Note that because they have been calculated prior to the Asselin filtering of the \textit{before} velocities,
the \textit{before} vorticity and divergence arrays must be included in the restart file to
ensure perfect restartability.
The vorticity and divergence at the \textit{now} time step are used for the computation of
the nonlinear advection and of the vertical velocity respectively.
%% =================================================================================================
\subsection[Horizontal divergence and relative vorticity (\textit{sshwzv.F90})]{Horizontal divergence and relative vorticity (\protect\mdl{sshwzv})}
\label{subsec:DYN_sshwzv}
The sea surface height is given by:
\begin{equation}
\label{eq:DYN_spg_ssh}
\begin{aligned}
\frac{\partial \eta }{\partial t}
&\equiv \frac{1}{e_{1t} e_{2t} }\sum\limits_k { \left\{ \delta_i \left[ {e_{2u}\,e_{3u}\;u} \right]
+\delta_j \left[ {e_{1v}\,e_{3v}\;v} \right] \right\} }
- \frac{\textit{emp}}{\rho_w } \\
&\equiv \sum\limits_k {\chi \ e_{3t}} - \frac{\textit{emp}}{\rho_w }
\end{aligned}
\end{equation}
where \textit{emp} is the surface freshwater budget (evaporation minus precipitation),
expressed in Kg/m$^2$/s (which is equal to mm/s),
and $\rho_w$=1,035~Kg/m$^3$ is the reference density of sea water (Boussinesq approximation).
If river runoff is expressed as a surface freshwater flux (see \autoref{chap:SBC}) then
\textit{emp} can be written as the evaporation minus precipitation, minus the river runoff.
In the presence of ice-shelf (\np[=.true.]{ln_isf}{ln\_isf})
\textit{emp} can be written as the evaporation minus precipitation, minus the ice-shelf water flux.
In the leapfrog case, the sea-surface height is evaluated using exactly the same time stepping scheme as
the tracer equation \autoref{eq:TRA_nxt}:
a leapfrog scheme in combination with an Asselin time filter,
\ie\ the velocity appearing in \autoref{eq:DYN_spg_ssh} is centred in time (\textit{now} velocity).
This is of paramount importance.
Replacing $T$ by the number $1$ in the tracer equation and summing over the water column must lead to
the sea surface height equation otherwise tracer content will not be conserved
\citep{griffies.pacanowski.ea_MWR01, leclair.madec_OM09}.
The vertical velocity is computed by an upward integration of the horizontal divergence starting at the bottom,
taking into account the change of the thickness of the levels:
\begin{equation}
\label{eq:DYN_wzv}
\left\{
\begin{aligned}
&\left. w \right|_{k_b-1/2} \quad= 0 \qquad \text{where } k_b \text{ is the level just above the sea floor } \\
&\left. w \right|_{k+1/2} = \left. w \right|_{k-1/2} + \left. e_{3t} \right|_{k}\; \left. \chi \right|_k
- \frac{1} {2 \rdt} \left( \left. e_{3t}^{t+1}\right|_{k} - \left. e_{3t}^{t-1}\right|_{k}\right)
\end{aligned}
\right.
\end{equation}
In the case of a non-linear free surface (\key{qco}), the top vertical velocity is $-\textit{emp}/\rho_w$,
as changes in the divergence of the barotropic transport are absorbed into the change of the level thicknesses,
re-orientated downward.
\cmtgm{not sure of this... to be modified with the change in emp setting}
In the case of a linear free surface(\key{linssh}), the time derivative in \autoref{eq:DYN_wzv} disappears.
The upper boundary condition applies at a fixed level $z=0$.
The top vertical velocity is thus equal to the divergence of the barotropic transport
(\ie\ the first term in the right-hand-side of \autoref{eq:DYN_spg_ssh}).
Note also that whereas the vertical velocity has the same discrete expression in $z$- and $s$-coordinates,
its physical meaning is not the same:
in the second case, $w$ is the velocity normal to the $s$-surfaces.
Note also that the $k$-axis is re-orientated downwards in the \fortran\ code compared to
the indexing used in the semi-discrete equations such as \autoref{eq:DYN_wzv}
(see \autoref{subsec:DOM_Num_Index_vertical}).
When \np[=.true.]{ln_zad_Aimp}{ln\_zad\_Aimp},
a proportion of the vertical advection can be treated implicitly (see \autoref{sec:DYN_zdf}) depending on the Courant number.
This option can be useful when the value of the timestep is limited by vertical advection \citep{lemarie.debreu.ea_OM15}.
%% =================================================================================================
\section{Coriolis and advection: vector invariant form}
\label{sec:DYN_adv_cor_vect}
\begin{listing}
\nlst{namdyn_adv}
\caption{\forcode{&namdyn_adv}}
\label{lst:namdyn_adv}
\end{listing}
The vector invariant form of the momentum equations is the one most often used in
applications of the \NEMO\ ocean model.
The flux form option (see next section) has been present since version $2$.
Options are defined through the \nam{dyn_adv}{dyn\_adv} namelist variables Coriolis and
momentum advection terms are evaluated either using a leapfrog scheme or a RK3 scheme.
In the leapfrog case the velocity appearing in these expressions is centred in time (\textit{now} velocity).
In the RK3 case the velocity appearing in these expressions is forward in time (\textit{before} velocity) at stage 1,
it is is centred in time (\textit{now} velocity) at stage 2 and 3.
At the lateral boundaries either free slip, no slip or partial slip boundary conditions are applied following
\autoref{chap:LBC}.
%% =================================================================================================
\subsection[Vorticity term (\textit{dynvor.F90})]{Vorticity term (\protect\mdl{dynvor})}
\label{subsec:DYN_vor}
\begin{listing}
\nlst{namdyn_vor}
\caption{\forcode{&namdyn_vor}}
\label{lst:namdyn_vor}
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
\end{listing}
Options are defined through the \nam{dyn_vor}{dyn\_vor} namelist variables.
Four discretisations of the vorticity term (\texttt{ln\_dynvor\_xxx}\forcode{=.true.}) are available:
conserving potential enstrophy of horizontally non-divergent flow (ENS scheme);
conserving horizontal kinetic energy (ENE scheme);
conserving potential enstrophy for the relative vorticity term and
horizontal kinetic energy for the planetary vorticity term (MIX scheme);
or conserving both the potential enstrophy of horizontally non-divergent flow and horizontal kinetic energy
(EEN scheme) (see \autoref{subsec:INVARIANTS_vorEEN}).
In the case of ENS, ENE or MIX schemes the land sea mask may be slightly modified to ensure the consistency of
vorticity term with analytical equations (\np[=.true.]{ln_dynvor_con}{ln\_dynvor\_con}).
The vorticity terms are all computed in dedicated routines that can be found in the \mdl{dynvor} module.
% enstrophy conserving scheme
%% =================================================================================================
\subsubsection[Enstrophy conserving scheme (\forcode{ln_dynvor_ens})]{Enstrophy conserving scheme (\protect\np{ln_dynvor_ens}{ln\_dynvor\_ens})}
\label{subsec:DYN_vor_ens}
In the enstrophy conserving case (ENS scheme),
the discrete formulation of the vorticity term provides a global conservation of the enstrophy
($ [ (\zeta +f ) / e_{3f} ]^2 $ in $s$-coordinates) for a horizontally non-divergent flow (\ie\ $\chi$=$0$),
but does not conserve the total kinetic energy.
It is given by:
\begin{equation}
\label{eq:DYN_vor_ens}
\left\{
\begin{aligned}
{+\frac{1}{e_{1u} } } & {\overline {\left( { \frac{\zeta +f}{e_{3f} }} \right)} }^{\,i}
& {\overline{\overline {\left( {e_{1v}\,e_{3v}\;v} \right)}} }^{\,i, j+1/2} \\
{- \frac{1}{e_{2v} } } & {\overline {\left( {\frac{\zeta +f}{e_{3f} }} \right)} }^{\,j}
& {\overline{\overline {\left( {e_{2u}\,e_{3u}\;u} \right)}} }^{\,i+1/2, j}
\end{aligned}
\right.
\end{equation}
% energy conserving scheme
%% =================================================================================================
\subsubsection[Energy conserving scheme (\forcode{ln_dynvor_ene})]{Energy conserving scheme (\protect\np{ln_dynvor_ene}{ln\_dynvor\_ene})}
\label{subsec:DYN_vor_ene}
The kinetic energy conserving scheme (ENE scheme) conserves the global kinetic energy but not the global enstrophy.
It is given by:
\begin{equation}
\label{eq:DYN_vor_ene}
\left\{
\begin{aligned}
{+\frac{1}{e_{1u}}\; {\overline {\left( {\frac{\zeta +f}{e_{3f} }} \right)
\; \overline {\left( {e_{1v}\,e_{3v}\;v} \right)} ^{\,i+1/2}} }^{\,j} } \\
{- \frac{1}{e_{2v}}\; {\overline {\left( {\frac{\zeta +f}{e_{3f} }} \right)
\; \overline {\left( {e_{2u}\,e_{3u}\;u} \right)} ^{\,j+1/2}} }^{\,i} }
\end{aligned}
\right.
\end{equation}
% mix energy/enstrophy conserving scheme
%% =================================================================================================
\subsubsection[Mixed energy/enstrophy conserving scheme (\forcode{ln_dynvor_mix})]{Mixed energy/enstrophy conserving scheme (\protect\np{ln_dynvor_mix}{ln\_dynvor\_mix})}
\label{subsec:DYN_vor_mix}
For the mixed energy/enstrophy conserving scheme (MIX scheme), a mixture of the two previous schemes is used.
It consists of the ENS scheme (\autoref{eq:DYN_vor_ens}) for the relative vorticity term,
and of the ENE scheme (\autoref{eq:DYN_vor_ene}) applied to the planetary vorticity term.
\[
% \label{eq:DYN_vor_mix}
\left\{ {
\begin{aligned}
{+\frac{1}{e_{1u} }\; {\overline {\left( {\frac{\zeta }{e_{3f} }} \right)} }^{\,i}
\; {\overline{\overline {\left( {e_{1v}\,e_{3v}\;v} \right)}} }^{\,i,j+1/2} -\frac{1}{e_{1u} }
\; {\overline {\left( {\frac{f}{e_{3f} }} \right)
\;\overline {\left( {e_{1v}\,e_{3v}\;v} \right)} ^{\,i+1/2}} }^{\,j} } \\
{-\frac{1}{e_{2v} }\; {\overline {\left( {\frac{\zeta }{e_{3f} }} \right)} }^j
\; {\overline{\overline {\left( {e_{2u}\,e_{3u}\;u} \right)}} }^{\,i+1/2,j} +\frac{1}{e_{2v} }
\; {\overline {\left( {\frac{f}{e_{3f} }} \right)
\;\overline {\left( {e_{2u}\,e_{3u}\;u} \right)} ^{\,j+1/2}} }^{\,i} } \hfill
\end{aligned}
} \right.
\]
% energy and enstrophy conserving scheme
%% =================================================================================================
\subsubsection[Energy and enstrophy conserving scheme (\forcode{ln_dynvor_een})]{Energy and enstrophy conserving scheme (\protect\np{ln_dynvor_een}{ln\_dynvor\_een})}
\label{subsec:DYN_vor_een}
In both the ENS and ENE schemes,
it is apparent that the combination of $i$ and $j$ averages of the velocity allows for
the presence of grid point oscillation structures that will be invisible to the operator.
These structures are \textit{computational modes} that will be at least partly damped by
the momentum diffusion operator (\ie\ the subgrid-scale advection), but not by the resolved advection term.
The ENS and ENE schemes therefore do not contribute to dump any grid point noise in the horizontal velocity field.
Such noise would result in more noise in the vertical velocity field, an undesirable feature.
This is a well-known characteristic of $C$-grid discretization where
$u$ and $v$ are located at different grid points,
a price worth paying to avoid a double averaging in the pressure gradient term as in the $B$-grid.
\cmtgm{ To circumvent this, Adcroft (ADD REF HERE)
Nevertheless, this technique strongly distort the phase and group velocity of Rossby waves....}
A very nice solution to the problem of double averaging was proposed by \citet{arakawa.hsu_MWR90}.
The idea is to get rid of the double averaging by considering triad combinations of vorticity.
It is noteworthy that this solution is conceptually quite similar to the one proposed by
\citep{griffies.gnanadesikan.ea_JPO98} for the discretization of the iso-neutral diffusion operator (see \autoref{apdx:INVARIANTS}).
The \citet{arakawa.hsu_MWR90} vorticity advection scheme for a single layer is modified
for spherical coordinates as described by \citet{arakawa.lamb_MWR81} to obtain the EEN scheme.
First consider the discrete expression of the potential vorticity, $q$, defined at an $f$-point:
\[
% \label{eq:DYN_pot_vor}
q = \frac{\zeta +f} {e_{3f} }
\]
where the relative vorticity is defined by (\autoref{eq:DYN_divcur_cur}),
the Coriolis parameter is given by $f=2 \,\Omega \;\sin \varphi _f $ and the layer thickness at $f$-points is:
\begin{equation}
\label{eq:DYN_een_e3f}
e_{3f} = \overline{\overline {e_{3t} }} ^{\,i+1/2,j+1/2}
\end{equation}
\begin{figure}[!ht]
\centering
\includegraphics[width=0.66\textwidth]{DYN_een_triad}
\caption[Triads used in the energy and enstrophy conserving scheme (EEN)]{
Triads used in the energy and enstrophy conserving scheme (EEN) for
$u$-component (upper panel) and $v$-component (lower panel).}
\label{fig:DYN_een_triad}
\end{figure}
A key point in \autoref{eq:DYN_een_e3f} is how the averaging in the \textbf{i}- and \textbf{j}- directions is made.
It uses the sum of masked t-point vertical scale factor divided either by the sum of the four t-point masks
(\np[=1]{nn_een_e3f}{nn\_een\_e3f}), or just by $4$ (\np[=.true.]{nn_een_e3f}{nn\_een\_e3f}).
The latter case preserves the continuity of $e_{3f}$ when one or more of the neighbouring $e_{3t}$ tends to zero and
extends by continuity the value of $e_{3f}$ into the land areas.
This case introduces a sub-grid-scale topography at f-points
(with a systematic reduction of $e_{3f}$ when a model level intercept the bathymetry)
that tends to reinforce the topostrophy of the flow
(\ie\ the tendency of the flow to follow the isobaths) \citep{penduff.le-sommer.ea_OS07}.
Next, the vorticity triads, $ {^i_j}\mathbb{Q}^{i_p}_{j_p}$ can be defined at a $T$-point as
the following triad combinations of the neighbouring potential vorticities defined at f-points
(\autoref{fig:DYN_een_triad}):
\begin{equation}
\label{eq:DYN_Q_triads}
_i^j \mathbb{Q}^{i_p}_{j_p}
= \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)
\end{equation}
where 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$.
Finally, the vorticity terms are represented as:
\begin{equation}
\label{eq:DYN_vor_een}
\left\{ {
\begin{aligned}
+q\,e_3 \, v &\equiv +\frac{1}{e_{1u} } \sum_{\substack{i_p,\,k_p}}
{^{i+1/2-i_p}_j} \mathbb{Q}^{i_p}_{j_p} \left( e_{1v}\,e_{3v} \;v \right)^{i+1/2-i_p}_{j+j_p} \\
- q\,e_3 \, u &\equiv -\frac{1}{e_{2v} } \sum_{\substack{i_p,\,k_p}}
{^i_{j+1/2-j_p}} \mathbb{Q}^{i_p}_{j_p} \left( e_{2u}\,e_{3u} \;u \right)^{i+i_p}_{j+1/2-j_p} \\
\end{aligned}
} \right.
\end{equation}
This EEN scheme in fact combines the conservation properties of the ENS and ENE schemes.
It conserves both total energy and potential enstrophy in the limit of horizontally nondivergent flow
(\ie\ $\chi$=$0$) (see \autoref{subsec:INVARIANTS_vorEEN}).
Applied to a realistic ocean configuration, it has been shown that it leads to a significant reduction of
the noise in the vertical velocity field \citep{le-sommer.penduff.ea_OM09}.
Furthermore, used in combination with a partial steps representation of bottom topography,
it improves the interaction between current and topography,
leading to a larger topostrophy of the flow \citep{barnier.madec.ea_OD06, penduff.le-sommer.ea_OS07}.
%% =================================================================================================
\subsection[Kinetic energy gradient term (\textit{dynkeg.F90})]{Kinetic energy gradient term (\protect\mdl{dynkeg})}
\label{subsec:DYN_keg}
As demonstrated in \autoref{apdx:INVARIANTS},
there is a single discrete formulation of the kinetic energy gradient term that,
together with the formulation chosen for the vertical advection (see below),
conserves the total kinetic energy:
\[
% \label{eq:DYN_keg}
\left\{
\begin{aligned}
-\frac{1}{2 \; e_{1u} } & \ \delta_{i+1/2} \left[ {\overline {u^2}^{\,i} + \overline{v^2}^{\,j}} \right] \\
-\frac{1}{2 \; e_{2v} } & \ \delta_{j+1/2} \left[ {\overline {u^2}^{\,i} + \overline{v^2}^{\,j}} \right]
\end{aligned}
\right.
\]
%% =================================================================================================
\subsection[Vertical advection term (\textit{dynzad.F90})]{Vertical advection term (\protect\mdl{dynzad})}
\label{subsec:DYN_zad}
The discrete formulation of the vertical advection, t
ogether with the formulation chosen for the gradient of kinetic energy (KE) term,
conserves the total kinetic energy.
Indeed, the change of KE due to the vertical advection is exactly balanced by
the change of KE due to the gradient of KE (see \autoref{apdx:INVARIANTS}).
\[
% \label{eq:DYN_zad}
\left\{
\begin{aligned}
-\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} \\
-\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}
\end{aligned}
\right.
\]
%% =================================================================================================
\section{Coriolis and advection: flux form}
\label{sec:DYN_adv_cor_flux}
Options are defined through the \nam{dyn_adv}{dyn\_adv} namelist variables.
In the flux form (as in the vector invariant form),
the Coriolis and momentum advection terms are evaluated using either a leapfrog scheme or a RK3 scheme.
In the leapfrog case the velocity appearing in these expressions is centred in time (\textit{now} velocity).
In the RK3 case the velocity appearing in these expressions is forward in time (\textit{before} velocity) at stage 1,
it is is centred in time (\textit{now} velocity) at stage 2 and 3.
At the lateral boundaries either free slip,
no slip or partial slip boundary conditions are applied following \autoref{chap:LBC}.
%% =================================================================================================
\subsection[Coriolis plus curvature metric terms (\textit{dynvor.F90})]{Coriolis plus curvature metric terms (\protect\mdl{dynvor})}
\label{subsec:DYN_cor_flux}
In flux form, the vorticity term reduces to a Coriolis term in which the Coriolis parameter has been modified to account for the "metric" term.
This altered Coriolis parameter is thus discretised at $f$-points.
It is given by:
\begin{multline*}
% \label{eq:DYN_cor_metric}
f+\frac{1}{e_1 e_2 }\left( {v\frac{\partial e_2 }{\partial i} - u\frac{\partial e_1 }{\partial j}} \right) \\
\equiv f + \frac{1}{e_{1f} e_{2f} } \left( { \ \overline v ^{i+1/2}\delta_{i+1/2} \left[ {e_{2u} } \right]
- \overline u ^{j+1/2}\delta_{j+1/2} \left[ {e_{1u} } \right] } \ \right)
\end{multline*}
% energy conserving scheme at T-point
%% =================================================================================================
\subsubsection[Energy conserving scheme (\forcode{ln_dynvor_enT})]{Energy conserving scheme (\protect\np{ln_dynvor_enT}{ln\_dynvor\_enT})}
\label{subsec:DYN_vor_enT}
The kinetic energy conserving scheme at T-point (ENT scheme) conserves the global kinetic energy but not the global enstrophy.
It is given by:
\begin{equation}
\label{eq:DYN_vor_enT}
\left\{
\begin{aligned}
&+\frac{1}{e_{1u}\,e_{2u}\,e_{3u}} \, \overline{ \left( f^T + \overline{\overline{ \zeta }}^{\,i,j} \right)
e_{1t}\,e_{2t}\,e_{3t} \, \overline{v}^{\,j}}^{\,i+1/2} \\
&-\frac{1}{e_{1v}\,e_{2v}\,e_{3v}} \, \overline{ \left( f^T + \overline{\overline{ \zeta }}^{\,i,j} \right)
e_{1t}\,e_{2t}\,e_{3t} \, \overline{u}^{\,i}}^{\,j+1/2}
\end{aligned}
\right.
\end{equation}
Any of the (\autoref{eq:DYN_vor_ens}), (\autoref{eq:DYN_vor_ene}), (\autoref{eq:DYN_vor_enT}) and (\autoref{eq:DYN_vor_een})
schemes can be used to
compute the product of the Coriolis parameter and the vorticity.
However, the energy-conserving schemes (\autoref{eq:DYN_vor_een} and \autoref{eq:DYN_vor_enT})
have exclusively been used to date.
This term is evaluated using either a leapfrog scheme or a RK3 scheme.
In the leapfrog case it is centred in time (\textit{now} velocity).
In the RK3 case it is forward in time (\textit{before} velocity) at stage 1,
it is is centred in time (\textit{now} velocity) at stage 2 and 3.
%% =================================================================================================
\subsection[Flux form advection term (\textit{dynadv.F90})]{Flux form advection term (\protect\mdl{dynadv})}
\label{subsec:DYN_adv_flux}
The discrete expression of the advection term is given by:
\[
% \label{eq:DYN_adv}
\left\{
\begin{aligned}
\frac{1}{e_{1u}\,e_{2u}\,e_{3u}}
\left( \delta_{i+1/2} \left[ \overline{e_{2u}\,e_{3u}\;u }^{i } \ u_t \right]
+ \delta_{j } \left[ \overline{e_{1u}\,e_{3u}\;v }^{i+1/2} \ u_f \right] \right. \ \; \\
\left. + \delta_{k } \left[ \overline{e_{1w}\,e_{2w}\;w}^{i+1/2} \ u_{uw} \right] \right) \\
\\
\frac{1}{e_{1v}\,e_{2v}\,e_{3v}}
\left( \delta_{i } \left[ \overline{e_{2u}\,e_{3u }\;u }^{j+1/2} \ v_f \right]
+ \delta_{j+1/2} \left[ \overline{e_{1u}\,e_{3u }\;v }^{i } \ v_t \right] \right. \ \, \, \\
\left. + \delta_{k } \left[ \overline{e_{1w}\,e_{2w}\;w}^{j+1/2} \ v_{vw} \right] \right) \\
\end{aligned}
\right.
\]
Two advection schemes are available:
a $2^{nd}$ order centered finite difference scheme, CEN2,
or a $3^{rd}$ order upstream biased scheme, UP3.
The latter is described in \citet{shchepetkin.mcwilliams_OM05}.
The schemes are selected using the namelist logicals \np{ln_dynadv_cen2}{ln\_dynadv\_cen2} and \np{ln_dynadv_up3}{ln\_dynadv\_up3}.
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
In flux form, the schemes differ by the choice of a space and time interpolation to define the value of
$u$ and $v$ at the centre of each face of $u$- and $v$-cells, \ie\ at the $T$-, $f$-,
and $uw$-points for $u$ and at the $f$-, $T$- and $vw$-points for $v$.
% 2nd order centred scheme
%% =================================================================================================
\subsubsection[CEN2: $2^{nd}$ order centred scheme (\forcode{ln_dynadv_cen2})]{CEN2: $2^{nd}$ order centred scheme (\protect\np{ln_dynadv_cen2}{ln\_dynadv\_cen2})}
\label{subsec:DYN_adv_cen2}
In the centered $2^{nd}$ order formulation, the velocity is evaluated as the mean of the two neighbouring points:
\begin{equation}
\label{eq:DYN_adv_cen2}
\left\{
\begin{aligned}
u_T^{cen2} &=\overline u^{i } \quad & u_F^{cen2} &=\overline u^{j+1/2} \quad & u_{uw}^{cen2} &=\overline u^{k+1/2} \\
v_F^{cen2} &=\overline v ^{i+1/2} \quad & v_F^{cen2} &=\overline v^j \quad & v_{vw}^{cen2} &=\overline v ^{k+1/2} \\
\end{aligned}
\right.
\end{equation}
The scheme is non diffusive (\ie\ conserves the kinetic energy) but dispersive (\ie\ it may create false extrema).
It is therefore notoriously noisy and must be used in conjunction with an explicit diffusion operator to
produce a sensible solution.
The associated time-stepping is performed using a leapfrog scheme in conjunction with an Asselin time-filter,
so $u$ and $v$ are the \emph{now} velocities.
%% =================================================================================================
\subsubsection[UP3: Upstream Biased Scheme (\forcode{ln_dynadv_up3})]{UP3: Upstream Biased Scheme (\protect\np{ln_dynadv_up3}{ln\_dynadv\_up3})}
\label{subsec:DYN_adv_up3}
The UP3 advection scheme is an upstream biased third order scheme based on
an upstream-biased parabolic interpolation.
For example, the evaluation of $u_T^{up3} $ is done as follows:
\begin{equation}
\label{eq:DYN_adv_up3}
u_T^{up3} =\overline u ^i-\;\frac{1}{6}
\begin{cases}
u"_{i-1/2}& \text{if $\ \overline{e_{2u}\,e_{3u} \ u}^i \geqslant 0$ } \\
u"_{i+1/2}& \text{if $\ \overline{e_{2u}\,e_{3u} \ u}^i < 0$ }
\end{cases}
\end{equation}
where $u"_{i+1/2} =\delta_{i+1/2} \left[ {\delta_i \left[ u \right]} \right]$.
This results in a dissipatively dominant (\ie\ hyper-diffusive) truncation error
\citep{shchepetkin.mcwilliams_OM05}.
The overall performance of the advection scheme is similar to that reported in \citet{farrow.stevens_JPO95}.
It is a relatively good compromise between accuracy and smoothness.
It is not a \emph{positive} scheme, meaning that false extrema are permitted.
But the amplitudes of the false extrema are significantly reduced over those in the centred second order method.
As the scheme already includes a diffusion component, it can be used without explicit lateral diffusion on momentum
(\ie\ \np[=]{ln_dynldf_lap}{ln\_dynldf\_lap}\np[=.false.]{ln_dynldf_bilap}{ln\_dynldf\_bilap}),
and it is recommended to do so.
The UP3 scheme is used in all directions.
UP3 is diffusive and is associated with vertical mixing of momentum. \cmtgm{ gm pursue the
sentence:Since vertical mixing of momentum is a source term of the TKE equation... }
For stability reasons, the first term in (\autoref{eq:DYN_adv_up3}),
which corresponds to a second order centred scheme, is evaluated using the \textit{now} velocity (centred in time),
while the second term, which is the diffusion part of the scheme,
is evaluated using the \textit{before} velocity (forward in time).
This is discussed by \citet{webb.de-cuevas.ea_JAOT98} in the context of the Quick advection scheme.
Note that the UP3 and QUICK (Quadratic Upstream Interpolation for Convective Kinematics) schemes only differ by
one coefficient.
Replacing $1/6$ by $1/8$ in (\autoref{eq:DYN_adv_up3}) leads to the QUICK advection scheme \citep{webb.de-cuevas.ea_JAOT98}.
This option is not available through a namelist parameter, since the $1/6$ coefficient is hard coded.
Nevertheless it is quite easy to make the substitution in the \mdl{dynadv\_up3} module and obtain a QUICK scheme.
%% =================================================================================================
\section[Hydrostatic pressure gradient (\textit{dynhpg.F90})]{Hydrostatic pressure gradient (\protect\mdl{dynhpg})}
\label{sec:DYN_hpg}
\begin{listing}
\nlst{namdyn_hpg}
\caption{\forcode{&namdyn_hpg}}
\label{lst:namdyn_hpg}
\end{listing}
%Options are defined through the \nam{dyn_hpg}{dyn\_hpg} namelist variables.
%The key distinction between the different algorithms used for
%the hydrostatic pressure gradient is the vertical coordinate used,
%since HPG is a \emph{horizontal} pressure gradient, \ie\ computed along geopotential surfaces.
%As a result, any tilt of the surface of the computational levels will require a specific treatment to
%compute the hydrostatic pressure gradient.
%In v5.0 partial cells are considered as penalized cells. A penalized cell has a solid fraction and
%a liquid fraction, both are distributed homogeneouly across the cell. Therefore adjacent cells are not
%expected to live at distinct depth because of their content differences.
NEMO offers a selection of different algorithms to compute the hydrostatic pressure gradient (HPG) term in the momentum equation.
Options are defined through the \nam{dyn_hpg}{dyn\_hpg} namelist variables.
Since HPGs are computed along geopotential surfaces, a key distinction between the various algorithms is the type of vertical
coordinate they target. In particular, NEMO offers a number of options to compute HPGs with generalised $s$-coordinates that
may be not aligned with geopotentials.
The hydrostatic pressure gradient term is evaluated either using a leapfrog scheme,
\ie\ the density appearing in its expression is centred in time (\emph{now} $\rho$),
or a RK3 scheme \ie\ the density appearing in its expression is forward in time (\emph{before} $\rho$),
it is centred in time (\emph{now} $\rho$) at stage 2 and 3.
At the lateral boundaries either free slip, no slip or partial slip boundary conditions are applied.
%% =================================================================================================
\subsection[Full step $Z$-coordinate (\forcode{ln_dynhpg_zco})]{Full step $Z$-coordinate (\protect\np{ln_dynhpg_zco}{ln\_dynhpg\_zco})}
\label{subsec:DYN_hpg_zco}
When using standard geopotential coordinates (\np[=.true.]{ln_zco}{ln\_zco}), the hydrostatic pressure can be directly obtained
by vertically integrating the hydrostatic equation from the surface to the bottom. However, pressure is large at great depths while
its horizontal gradient is several orders of magnitude smaller. This may lead to large truncation errors in the pressure gradient terms.
Thus, the two horizontal components of the hydrostatic pressure gradient are computed directly as follows:
for $k=km$ (surface layer, $jk=1$ in the code)
\begin{equation}
\label{eq:DYN_hpg_zco_surf}
\left\{
\begin{aligned}
\left. \delta_{i+1/2} \left[ p^h \right] \right|_{k=km}
&= \frac{1}{2} g \ \left. \delta_{i+1/2} \left[ e_{3w} \ \rho \right] \right|_{k=km} \\
\left. \delta_{j+1/2} \left[ p^h \right] \right|_{k=km}
&= \frac{1}{2} g \ \left. \delta_{j+1/2} \left[ e_{3w} \ \rho \right] \right|_{k=km} \\
\end{aligned}
\right.
\end{equation}
for $1<k<km$ (interior layer)
\begin{equation}
\label{eq:DYN_hpg_zco}
\left\{
\begin{aligned}
\left. \delta_{i+1/2} \left[ p^h \right] \right|_{k}
&= \left. \delta_{i+1/2} \left[ p^h \right] \right|_{k-1}
+ g\; \left. \delta_{i+1/2} \left[ e_{3w} \ \overline {\rho}^{k+1/2} \right] \right|_{k} \\
\left. \delta_{j+1/2} \left[ p^h \right] \right|_{k}
&= \left. \delta_{j+1/2} \left[ p^h \right] \right|_{k-1}
+ g\; \left. \delta_{j+1/2} \left[ e_{3w} \ \overline {\rho}^{k+1/2} \right] \right|_{k} \\
\end{aligned}
\right.
\end{equation}
Note that the $1/2$ factor in (\autoref{eq:DYN_hpg_zco_surf}) is adequate because of the definition of $e_{3w}$ as
the vertical derivative of the scale factor at the surface level ($z=0$).
%% =================================================================================================
\subsection{Generalised $S$-coordinates}
\label{subsec:DYN_hpg_sco}
Pressure gradient formulations with a generalised $s(x,y,z,t)$ coordinate have been the subject of a vast number of papers
(\eg, \citet{song_MWR98, shchepetkin.mcwilliams_jgro03}). A number of different pressure gradient options are available in NEMO:
\begin{itemize}
\item
\textbf{Traditional coding} (\np[=.true.]{ln_hpg_sco}{ln\_hpg\_sco}, e.g. \citet{madec.delecluse.ea_JPO96}):
%\end{itemize}
\begin{equation}
\label{eq:DYN_hpg_sco}
\left\{
\begin{aligned}
- \frac{1} {\rho_o \, e_{1u}} \; \delta_{i+1/2} \left[ p^h \right]
+ \frac{g\; \overline {\rho}^{i+1/2}} {\rho_o \, e_{1u}} \; \delta_{i+1/2} \left[ z_t \right], \\
- \frac{1} {\rho_o \, e_{2v}} \; \delta_{j+1/2} \left[ p^h \right]
+ \frac{g\; \overline {\rho}^{j+1/2}} {\rho_o \, e_{2v}} \; \delta_{j+1/2} \left[ z_t \right], \\
\end{aligned}
\right.
\end{equation}
where the first term is the pressure gradient along coordinates (computed as in \autoref{eq:DYN_hpg_zco_surf} - \autoref{eq:DYN_hpg_zco})
and $z_T$ is the depth of the $T$-point evaluated from the sum of the vertical scale factors at the $W$-point ($e_{3w}$).
Note that this scheme is not recommended when using steeply inclined computational levels (e.g., terrain-following or hybrid generalised
vertical coordinates, i.e., \np[=.true.]{ln_sco}{ln\_sco}) - see e.g. \citet{shchepetkin.mcwilliams_jgro03}.
However, it should be the standard choice when using $z$-coordinates (\np[=.true.]{ln_zco}{ln\_zps} or \np[=.true.]{ln_zps}{ln\_zps})
with the non-linear free surface (\np[=.false.]{ln_linssh}{ln\_linssh} and \key{qco}), since in this case model levels will follow the barotropic motion of the ocean \citep{levier.treguier.ea_trpt07}.
\textbf{Traditional coding with adaptation for ice shelf cavities} (\np[=.true.]{ln_hpg_isf}{ln\_hpg\_isf}):
this scheme must be used when ice shelf cavities are activated (\np[=.true.]{ln_isfcav}{ln\_isfcav} and the inclusion of \key{isf}).
\textbf{Pressure Jacobian scheme} (\np[=.true.]{ln_hpg_prj}{ln\_hpg\_prj}):
this scheme uses a constrained cubic spline to reconstruct the vertical density profile within a water column.
This method maintains the monotonicity between the density nodes. The pressure is calculated by analytical integration of the density
profile. For the force in the $i$-direction, it calculates the difference of the pressures on the $i+\tfrac{1}{2}$ and $i-\tfrac{1}{2}$
faces of the cell using pressures calculated at the same height. In grid cells just above the bathymetry, this height is higher than the
cells’ centre. This scheme works well for moderately steep computational levels but produces large velocities in the SEAMOUNT test case
when model levels are steeply inclined.
\textbf{Density Jacobian with cubic polynomial scheme} (\np[=.true.]{ln_hpg_djc}{ln\_hpg\_djc}, \cite{shchepetkin.mcwilliams_jgro03}:
the ROMS-like, density Jacobian with cubic polynomial method has been debugged and from vn4.2 is available as an option.
This scheme is based on section 5 of \cite{shchepetkin.mcwilliams_jgro03} For the force in the $i$-direction, it uses constrained cubic
splines to re-construct the density along lines of constant $s$ and constant $i$ in the $(i,s)$ plane. It calculates a line integral of
$\rho$ and then integrates vertically to obtain the horizontal pressure gradient. The constrained cubic splines require boundary conditions
to be specified at the upper and lower boundaries and at points where model levels encrop the model bathymetry (i.e., with geopotential
or hybrid vertical coordinates). The user can choose between von Neumann and linear extrapolation boundary conditions via the
\texttt{ln\_hpg\_djc\_vnh} and \texttt{ln\_hpg\_djc\_vnv} namelist switches, respectively. This scheme can be used with any type of
generalised $s$-coordinates - i.e., $z$ or $z^*$, terrain-following or hybrids of these two (e.g., via the vanishing quasi-sigma or
multi-envelope methods, see e.g. \cite{shapiro.luneva.ea_OS13,bruciaferri.shapiro.wobus_OD18,wise.harle.ea_OM21}) - but at the moment
can not be used with ice shelf cavities.
\end{itemize}
Starting from version 4.2, the density field used by dyn\_hpg is the density anomaly field rhd rather than $1+\mathrm{rhd}$.
The calculation of the source term for the free surface has been adjusted to take this into account.
The true in situ density $\rho= \rho_0 (1 + r_0(z) + rhd )$ where $r_0(z)$ accounts for the variation of density
with depth for water with a potential temperature of $4^{\circ}$C and salinity of $35.16504$g/kg
(see (13) and (14) of \citet{roquet.madec.ea_OM15}).
%% =================================================================================================
\subsection{Ice shelf cavity}
\label{subsec:DYN_hpg_isf}
Beneath an ice shelf, the total pressure gradient is the sum of the pressure gradient due to the ice shelf load and
the pressure gradient due to the ocean load (\np[=.true.]{ln_hpg_isf}{ln\_hpg\_isf} with the inclusion of \key{isf}).\\
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
The main hypothesis to compute the ice shelf load is that the ice shelf is in an isostatic equilibrium.
The top pressure is computed integrating from surface to the base of the ice shelf a reference density profile
(prescribed as density of a water at 34.4 PSU and -1.9\deg{C}) and
corresponds to the water replaced by the ice shelf.
This top pressure is constant over time.
A detailed description of this method is described in \citet{losch_JGR08}.\\
The pressure gradient due to ocean load is computed using the expression \autoref{eq:DYN_hpg_sco} described in
\autoref{subsec:DYN_hpg_sco}.
%% =================================================================================================
%% \subsection[Time-scheme (\forcode{ln_dynhpg_imp})]{Time-scheme (\protect\np{ln_dynhpg_imp}{ln\_dynhpg\_imp})}
%% \label{subsec:DYN_hpg_imp}
%%
%% The default time differencing scheme used for the horizontal pressure gradient is a leapfrog scheme and
%% therefore the density used in all discrete expressions given above is the \textit{now} density,
%% computed from the \textit{now} temperature and salinity.
%% In some specific cases
%% (usually high resolution simulations over an ocean domain which includes weakly stratified regions)
%% the physical phenomenon that controls the time-step is internal gravity waves (IGWs).
%% A semi-implicit scheme for doubling the stability limit associated with IGWs can be used
%% \citep{brown.campana_MWR78, maltrud.smith.ea_JGR98}.
%% It involves the evaluation of the hydrostatic pressure gradient as
%% an average over the three time levels $t-\rdt$, $t$, and $t+\rdt$
%% (\ie\ \textit{before}, \textit{now} and \textit{after} time-steps),
%% rather than at the central time level $t$ only, as in the standard leapfrog scheme.
%%
%% $\bullet$ leapfrog scheme (\np[=.true.]{ln_dynhpg_imp}{ln\_dynhpg\_imp}):
%%
%% \begin{equation}
%% \label{eq:DYN_hpg_lf}
%% \frac{u^{t+\rdt}-u^{t-\rdt}}{2\rdt} = \;\cdots \;
%% -\frac{1}{\rho_o \,e_{1u} }\delta_{i+1/2} \left[ {p_h^t } \right]
%% \end{equation}
%%
%% $\bullet$ semi-implicit scheme (\np[=.true.]{ln_dynhpg_imp}{ln\_dynhpg\_imp}):
%% \begin{equation}
%% \label{eq:DYN_hpg_imp}
%% \frac{u^{t+\rdt}-u^{t-\rdt}}{2\rdt} = \;\cdots \;
%% -\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]
%% \end{equation}
%%
%% The semi-implicit time scheme \autoref{eq:DYN_hpg_imp} is made possible without
%% significant additional computation since the density can be updated to time level $t+\rdt$ before
%% computing the horizontal hydrostatic pressure gradient.
%% It can be easily shown that the stability limit associated with the hydrostatic pressure gradient doubles using
%% \autoref{eq:DYN_hpg_imp} compared to that using the standard leapfrog scheme \autoref{eq:DYN_hpg_lf}.
%% Note that \autoref{eq:DYN_hpg_imp} is equivalent to applying a time filter to the pressure gradient to
%% eliminate high frequency IGWs.
%% Obviously, when using \autoref{eq:DYN_hpg_imp},
%% the doubling of the time-step is achievable only if no other factors control the time-step,
%% such as the stability limits associated with advection or diffusion.
%%
%% In practice, the semi-implicit scheme is used when \np[=.true.]{ln_dynhpg_imp}{ln\_dynhpg\_imp}.
%% In this case, we choose to apply the time filter to temperature and salinity used in the equation of state,
%% instead of applying it to the hydrostatic pressure or to the density,
%% so that no additional storage array has to be defined.
%% The density used to compute the hydrostatic pressure gradient (whatever the formulation) is evaluated as follows:
%% \[
%% % \label{eq:DYN_rho_flt}
%% \rho^t = \rho( \widetilde{T},\widetilde {S},z_t)
%% \quad \text{with} \quad
%% \widetilde{X} = 1 / 4 \left( X^{t+\rdt} +2 \,X^t + X^{t-\rdt} \right)
%% \]
%%
%% Note that in the semi-implicit case, it is necessary to save the filtered density,
%% an extra three-dimensional field, in the restart file to restart the model with exact reproducibility.
%% This option is controlled by \np{nn_dynhpg_rst}{nn\_dynhpg\_rst}, a namelist parameter.
%%
%% =================================================================================================
\section[Surface pressure gradient (\textit{dynspg.F90})]{Surface pressure gradient (\protect\mdl{dynspg})}
\label{sec:DYN_spg}
\begin{listing}
\nlst{namdyn_spg}
\caption{\forcode{&namdyn_spg}}
\label{lst:namdyn_spg}
\end{listing}
Options are defined through the \nam{dyn_spg}{dyn\_spg} namelist variables.
The surface pressure gradient term is related to the representation of the free surface (\autoref{sec:MB_hor_pg}).
The main distinction is between the fixed volume case (linear free surface, \ie\ with the inclusion of \key{linssh}) and
the variable volume case (nonlinear free surface, \key{qco}).
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
In the linear free surface case (\autoref{subsec:MB_free_surface})
the vertical scale factors $e_{3}$ are fixed in time,
while they are time-dependent in the nonlinear case (\autoref{subsec:MB_free_surface}).
With both linear and nonlinear free surface, external gravity waves are allowed in the equations,
which imposes a very small time step when an explicit time stepping is used (\np[=.true.]{ln_dynspg_exp}{ln\_dynspg\_exp}).
To allow a longer time step for the three-dimensional equations, one can use a split-explicit free surface
(\np[=.true.]{ln_dynspg_ts}{ln\_dynspg\_ts}). In that case, only a quasi-linear
form of 2d barotropic equations is substepped with a small time increment.
%% =================================================================================================
\subsection[Explicit free surface (\forcode{ln_dynspg_exp})]{Explicit free surface (\protect\np{ln_dynspg_exp}{ln\_dynspg\_exp})}
\label{subsec:DYN_spg_exp}
In the explicit free surface formulation (\np{ln_dynspg_exp}{ln\_dynspg\_exp} set to true),
the model time step is chosen to be small enough to resolve the external gravity waves
(typically a few tens of seconds).
The surface pressure gradient, evaluated using a leap-frog scheme (\ie\ centered in time),
is thus simply given by :
\begin{equation}
\label{eq:DYN_spg_exp}
\left\{
\begin{aligned}
- \frac{1}{e_{1u}\,\rho_o} \; \delta_{i+1/2} \left[ \,\rho \,\eta\, \right] \\
- \frac{1}{e_{2v}\,\rho_o} \; \delta_{j+1/2} \left[ \,\rho \,\eta\, \right]
\end{aligned}
\right.
\end{equation}
Note that this option is not yet compatible with RK3 time-stepping.
%% =================================================================================================
\subsection[Split-explicit free surface (\forcode{ln_dynspg_ts})]{Split-explicit free surface (\protect\np{ln_dynspg_ts}{ln\_dynspg\_ts})}
\label{subsec:DYN_spg_ts}
%\nlst{namsplit}
The split-explicit free surface formulation used in \NEMO\ (\np{ln_dynspg_ts}{ln\_dynspg\_ts} set to true),
also called the time-splitting formulation, follows the one proposed by \citet{shchepetkin.mcwilliams_OM05}.
The general idea is to solve the free surface equation and the associated barotropic velocity equations with
a smaller time step than $\rdt$, the time step used for the three dimensional prognostic variables
(\autoref{fig:DYN_spg_ts}).
The size of the small time step, $\rdt_e$ (the external mode or barotropic time step) is provided through
the \np{nn_e}{nn\_e} namelist parameter as: $\rdt_e = \rdt / nn\_e$.
This parameter can be optionally defined automatically (\np[=.true.]{ln_bt_auto}{ln\_bt\_auto}) considering that
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
the stability of the barotropic system is essentially controled by external waves propagation.
Maximum Courant number is in that case time independent, and easily computed online from the input bathymetry.
Therefore, $\rdt_e$ is adjusted so that the Maximum allowed Courant number is smaller than \np{rn_bt_cmax}{rn\_bt\_cmax}.
The barotropic mode solves the following equations:
% \begin{subequations}
% \label{eq:DYN_BT}
\begin{equation}
\label{eq:DYN_BT_dyn}
\frac{\partial {\mathrm \overline{{\mathbf U}}_h} }{\partial t}=
-f\;{\mathrm {\mathbf k}}\times {\mathrm \overline{{\mathbf U}}_h}
-g\nabla _h \eta -\frac{c_b^{\textbf U}}{H+\eta} \mathrm {\overline{{\mathbf U}}_h} + \mathrm {\overline{\mathbf G}}
\end{equation}
\[
% \label{eq:DYN_BT_ssh}
\frac{\partial \eta }{\partial t}=-\nabla \cdot \left[ {\left( {H+\eta } \right) \; {\mathrm{\mathbf \overline{U}}}_h \,} \right]+P-E
\]
% \end{subequations}
where $\mathrm {\overline{\mathbf 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:DYN_BT_dyn} represents the bottom stress
(see section \autoref{sec:ZDF_drg}), 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_ibk09}
(see their figure 12, lower left).
\begin{figure}[!t]
\centering
\includegraphics[width=0.66\textwidth]{DYN_dynspg_ts}
\caption[Split-explicit time stepping scheme for the external and internal modes]{
Schematic of the split-explicit time stepping scheme for the external and internal modes.
Time increases to the right.
In this particular exemple,
a boxcar averaging window over \np{nn_e}{nn\_e} barotropic time steps is used
(\np[=1]{nn_bt_flt}{nn\_bt\_flt}) and \np[=5]{nn_e}{nn\_e}.
Internal mode time steps (which are also the model time steps) are denoted by
$t-\rdt$, $t$ and $t+\rdt$.
Variables with $k$ superscript refer to instantaneous barotropic variables,
$< >$ and $<< >>$ operator refer to time filtered variables using respectively primary
(red vertical bars) and secondary weights (blue vertical bars).
The former are used to obtain time filtered quantities at $t+\rdt$ while
the latter are used to obtain time averaged transports to advect tracers.
a) Forward time integration:
\protect\np[=1]{nn_bt_flt}{nn\_bt\_flt}.
b) Centred time integration:
\protect\np[=2]{nn_bt_flt}{nn\_bt\_flt}.
c) Forward time integration with no time filtering (POM-like scheme):
\protect\np[=3]{nn_bt_flt}{nn\_bt\_flt}.}
\label{fig:DYN_spg_ts}
\end{figure}
In the default case (\protect\np[=1]{nn_bt_flt}{nn\_bt\_flt}),
the external mode is integrated between \textit{now} and \textit{after} baroclinic time-steps
(\autoref{fig:DYN_spg_ts}a).
To avoid aliasing of fast barotropic motions into three dimensional equations,
time filtering is eventually applied on barotropic quantities.
In that case, the integration is extended slightly beyond \textit{after} time step to
provide time filtered quantities.
These are used for the subsequent initialization of the barotropic mode in the following baroclinic step.
Since external mode equations written at baroclinic time steps finally follow a forward time stepping scheme,
asselin filtering is not applied to barotropic quantities.\\
Alternatively, one can choose to integrate barotropic equations starting from \textit{before} time step
(\protect\np[=2]{nn_bt_flt}{nn\_bt\_flt}).
Although more computationaly expensive ( \np{nn_e}{nn\_e} additional iterations are indeed necessary),
the baroclinic to barotropic forcing term given at \textit{now} time step become centred in
the middle of the integration window.
It can easily be shown that this property removes part of splitting errors between modes,
which increases the overall numerical robustness.
%references to Patrick Marsaleix' work here. Also work done by SHOM group.
As far as tracer conservation is concerned,
barotropic velocities used to advect tracers must also be updated at \textit{now} time step.
This implies to change the traditional order of computations in \NEMO:
most of momentum trends (including the barotropic mode calculation) updated first, tracers' after.
%%This \textit{de facto} makes semi-implicit hydrostatic pressure gradient
%%(see section \autoref{subsec:DYN_hpg_imp})
%%and time splitting not compatible.
Advective barotropic velocities are obtained by using a secondary set of filtering weights,
uniquely defined from the filter coefficients 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.
One can eventually choose to feedback instantaneous values by not using any time filter
(\protect\np[=3]{nn_bt_flt}{nn\_bt\_flt}).
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
In that case, external mode equations are continuous in time,
\ie\ they are not re-initialized when starting a new sub-stepping sequence.
This is the method used in the POM model for example, the stability being maintained by
refreshing at (almost) each barotropic time step advection and horizontal diffusion terms.
Since the latter terms have not been added in \NEMO\ for computational efficiency,
removing time filtering would be inevitably unstable. One can however add some dissipation, but in the time domain, by slightly modifying the barotropic time stepping coefficients (\citet{demange_JCP19}). This is implemented here through an additional parameter (\np{rn_bt_alpha}{rn\_bt\_alpha}), which controls the amount of temporal diffusion.
\cmtgm{ %%% copy from griffies Book
\textbf{title: Time stepping the barotropic system }
Assume knowledge of the full velocity and tracer fields at baroclinic time $\tau$.
Hence, we can update the surface height and vertically integrated velocity with a leap-frog scheme using
the small barotropic time step $\rdt$.
We have
\[
% \label{eq:DYN_spg_ts_eta}
\eta^{(b)}(\tau,t_{n+1}) - \eta^{(b)}(\tau,t_{n+1}) (\tau,t_{n-1})
= 2 \rdt \left[-\nabla \cdot \textbf{U}^{(b)}(\tau,t_n) + \text{EMP}_w(\tau) \right]
\]
\begin{multline*}
% \label{eq:DYN_spg_ts_u}
\textbf{U}^{(b)}(\tau,t_{n+1}) - \textbf{U}^{(b)}(\tau,t_{n-1}) \\
= 2\rdt \left[ - f \textbf{k} \times \textbf{U}^{(b)}(\tau,t_{n})
- H(\tau) \nabla p_s^{(b)}(\tau,t_{n}) +\textbf{M}(\tau) \right]
\end{multline*}
\
In 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)}$ and $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 that sets the barotropic time steps via
\[
% \label{eq:DYN_spg_ts_t}
t_n=\tau+n\rdt
\]
with $n$ an integer.
The density scaled surface pressure is evaluated via
\[
% \label{eq:DYN_spg_ts_ps}
p_s^{(b)}(\tau,t_{n}) =
\begin{cases}
g \;\eta_s^{(b)}(\tau,t_{n}) \;\rho(\tau)_{k=1}) / \rho_o & \text{non-linear case} \\
g \;\eta_s^{(b)}(\tau,t_{n}) & \text{linear case}
\end{cases}
\]
To get started, we assume the following initial conditions
\[
% \label{eq:DYN_spg_ts_eta}
\begin{split}
\eta^{(b)}(\tau,t_{n=0}) &= \overline{\eta^{(b)}(\tau)} \\
\eta^{(b)}(\tau,t_{n=1}) &= \eta^{(b)}(\tau,t_{n=0}) + \rdt \ \text{RHS}_{n=0}
\end{split}
\]
with
\[
% \label{eq:DYN_spg_ts_etaF}
\overline{\eta^{(b)}(\tau)} = \frac{1}{N+1} \sum\limits_{n=0}^N \eta^{(b)}(\tau-\rdt,t_{n})
\]
the time averaged surface height taken from the previous barotropic cycle.
Likewise,
\[
% \label{eq:DYN_spg_ts_u}
\textbf{U}^{(b)}(\tau,t_{n=0}) = \overline{\textbf{U}^{(b)}(\tau)} \\ \\
\textbf{U}(\tau,t_{n=1}) = \textbf{U}^{(b)}(\tau,t_{n=0}) + \rdt \ \text{RHS}_{n=0}
\]
with
\[
% \label{eq:DYN_spg_ts_u}
\overline{\textbf{U}^{(b)}(\tau)} = \frac{1}{N+1} \sum\limits_{n=0}^N\textbf{U}^{(b)}(\tau-\rdt,t_{n})
\]
the time averaged vertically integrated transport.
Notably, there is no Robert-Asselin time filter used in the barotropic portion of the integration.
Upon 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$
\[
% \label{eq:DYN_spg_ts_u}
\textbf{U}(\tau+\rdt) = \overline{\textbf{U}^{(b)}(\tau+\rdt)} = \frac{1}{N+1} \sum\limits_{n=0}^N\textbf{U}^{(b)}(\tau,t_{n})
\]
The surface height on the new baroclinic time step is then determined via a baroclinic leap-frog using
the following form
\begin{equation}
\label{eq:DYN_spg_ts_ssh}
\eta(\tau+\Delta) - \eta^{F}(\tau-\Delta) = 2\rdt \ \left[ - \nabla \cdot \textbf{U}(\tau) + \text{EMP}_w \right]
\end{equation}
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).
In general, some form of time filter is needed to maintain integrity of the surface height field due to
the leap-frog splitting mode in equation \autoref{eq:DYN_spg_ts_ssh}.
We have tried various forms of such filtering,
with the following method discussed in \cite{griffies.pacanowski.ea_MWR01} chosen due to
its stability and reasonably good maintenance of tracer conservation properties (see ??).
\begin{equation}
\label{eq:DYN_spg_ts_sshf}
\eta^{F}(\tau-\Delta) = \overline{\eta^{(b)}(\tau)}
\end{equation}
Another approach tried was
\[
% \label{eq:DYN_spg_ts_sshf2}
\eta^{F}(\tau-\Delta) = \eta(\tau)
+ (\alpha/2) \left[\overline{\eta^{(b)}}(\tau+\rdt)
+ \overline{\eta^{(b)}}(\tau-\rdt) -2 \;\eta(\tau) \right]
\]
which is useful since it isolates all the time filtering aspects into the term multiplied by $\alpha$.
This isolation allows for an easy check that tracer conservation is exact when
eliminating 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.
} %%end gm comment (copy of griffies book)
%% =================================================================================================
\section[Lateral diffusion term and operators (\textit{dynldf.F90})]{Lateral diffusion term and operators (\protect\mdl{dynldf})}
\label{sec:DYN_ldf}
\begin{listing}
\nlst{namdyn_ldf}
\caption{\forcode{&namdyn_ldf}}
\label{lst:namdyn_ldf}
\end{listing}
Options are defined through the \nam{dyn_ldf}{dyn\_ldf} namelist variables.
The options available for lateral diffusion are to use either laplacian (rotated or not) or biharmonic operators.
The coefficients may be constant or spatially variable;
the description of the coefficients is found in the chapter on lateral physics (\autoref{chap:LDF}).
The lateral diffusion of momentum is evaluated using a forward scheme,
\ie\ the velocity appearing in its expression is the \textit{before} velocity in time,
except for the pure vertical component that appears when a tensor of rotation is used.
This latter term is solved implicitly together with the vertical diffusion term (see \autoref{chap:TD}).
At the lateral boundaries either free slip,
no slip or partial slip boundary conditions are applied according to the user's choice (see \autoref{chap:LBC}).
\cmtgm{
Hyperviscous operators are frequently used in the simulation of turbulent flows to
control the dissipation of unresolved small scale features.
Their primary role is to provide strong dissipation at the smallest scale supported by
the grid while minimizing the impact on the larger scale features.
Hyperviscous operators are thus designed to be more scale selective than the traditional,
physically motivated Laplace operator.
In finite difference methods,
the biharmonic operator is frequently the method of choice to achieve this scale selective dissipation since
its damping time (\ie\ its spin down time) scale like $\lambda^{-4}$ for disturbances of wavelength $\lambda$
(so that short waves damped more rapidelly than long ones),
whereas the Laplace operator damping time scales only like $\lambda^{-2}$.
}
%% =================================================================================================
\subsection[Iso-level laplacian (\forcode{ln_dynldf_lap})]{Iso-level laplacian operator (\protect\np{ln_dynldf_lap}{ln\_dynldf\_lap})}
\label{subsec:DYN_ldf_lap}
For lateral iso-level diffusion, the discrete operator is:
\begin{equation}
\label{eq:DYN_ldf_lap}
\left\{
\begin{aligned}
D_u^{l{\mathrm {\mathbf U}}} =\frac{1}{e_{1u} }\delta_{i+1/2} \left[ {A_T^{lm}
\;\chi } \right]-\frac{1}{e_{2u} {\kern 1pt}e_{3u} }\delta_j \left[
{A_f^{lm} \;e_{3f} \zeta } \right] \\ \\
D_v^{l{\mathrm {\mathbf U}}} =\frac{1}{e_{2v} }\delta_{j+1/2} \left[ {A_T^{lm}
\;\chi } \right]+\frac{1}{e_{1v} {\kern 1pt}e_{3v} }\delta_i \left[
{A_f^{lm} \;e_{3f} \zeta } \right]
\end{aligned}
\right.
\end{equation}
As explained in \autoref{sec:DIFFOPERS_3}, this formulation (as the gradient of a divergence and curl of the vorticity) preserves
symmetry and ensures a complete separation between the vorticity and divergence parts of the momentum diffusion.
In v5.0 a symetrical lateral iso-level operator has been introduced :
\begin{equation}
\label{eq:DYN_ldf_lap_sym}
\left\{
\begin{aligned}
D_u^{l{\mathrm {\mathbf U}}} &= \frac{1}{e_{1u}\,e_{2u}\,e_{3u} } \left(
\frac{1}{e_{2u}} \delta_{i+1/2} \left[ e_{2t}\,e_{2t}\,e_{3t}\, A_T^{lm} \,\epsilon_T \right]
- \frac{1}{e_{1u}} \delta_{j+1/2} \left[ e_{1f}\,e_{1f}\,e_{3f}\,A_F^{lm} \epsilon_F \right] \right) \\ \\
D_v^{l{\mathrm {\mathbf U}}} &= \frac{1}{e_{1v}\,e_{2v}\,e_{3v} } \left(
\frac{1}{e_{2v}} \delta_{j+1/2} \left[ e_{2f}\,e_{2f}\,e_{3f}\, A_F^{lm} \,\epsilon_F \right]
- \frac{1}{e_{1v}} \delta_{i+1/2} \left[ e_{1t}\,e_{1t}\,e_{3t}\,A_T^{lm} \epsilon_T \right] \right)
\end{aligned}
\right.
\end{equation}
Where $\epsilon_F$ and $\epsilon_T$ are respectively the shearing stress component (F-point) and the
tension stress component (T-point) defined as :
\begin{equation}
\label{eq:DYN_ldf_lap_sheten}
\left\{
\begin{aligned}
\epsilon_F &= \frac{e_{1f}}{e_{2f}}\; \delta_{j+1/2} \left[ \frac{u}{e_{1u}} \right] + \frac{e_{2f}}{e_{1f}}\;
\delta_{i+1/2} \left[ \frac{v}{e_{2v}} \right] \\ \\
\epsilon_T &= \frac{e_{2t}}{e_{1t}}\; \delta_{i} \left[ \frac{u}{e_{2u}} \right] - \frac{e_{1t}}{e_{2t}}\;
\delta_j \left[ \frac{v}{e_{1v}} \right]
\end{aligned}
\right.
\end{equation}
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
%% =================================================================================================
\subsection[Rotated laplacian (\forcode{ln_dynldf_iso})]{Rotated laplacian operator (\protect\np{ln_dynldf_iso}{ln\_dynldf\_iso})}
\label{subsec:DYN_ldf_iso}
A rotation of the lateral momentum diffusion operator is needed in several cases:
for iso-neutral diffusion in the $z$-coordinate (\np[=.true.]{ln_dynldf_iso}{ln\_dynldf\_iso}) and
for either iso-neutral (\np[=.true.]{ln_dynldf_iso}{ln\_dynldf\_iso}) or
geopotential (\np[=.true.]{ln_dynldf_hor}{ln\_dynldf\_hor}) diffusion in the $s$-coordinate.
In the partial step case, coordinates are horizontal except at the deepest level and
no rotation is performed when \np[=.true.]{ln_dynldf_hor}{ln\_dynldf\_hor}.
The diffusion operator is defined simply as the divergence of down gradient momentum fluxes on
each momentum component.
It must be emphasized that this formulation ignores constraints on the stress tensor such as symmetry.
The resulting discrete representation is:
\begin{equation}
\label{eq:DYN_ldf_iso}
\begin{split}
D_u^{l\textbf{U}} &= \frac{1}{e_{1u} \, e_{2u} \, e_{3u} } \\
& \left\{\quad {\delta_{i+1/2} \left[ {A_T^{lm} \left(
{\frac{e_{2t} \; e_{3t} }{e_{1t} } \,\delta_{i}[u]
-e_{2t} \; r_{1t} \,\overline{\overline {\delta_{k+1/2}[u]}}^{\,i,\,k}}
\right)} \right]} \right. \\
& \qquad +\ \delta_j \left[ {A_f^{lm} \left( {\frac{e_{1f}\,e_{3f} }{e_{2f}
}\,\delta_{j+1/2} [u] - e_{1f}\, r_{2f}
\,\overline{\overline {\delta_{k+1/2} [u]}} ^{\,j+1/2,\,k}}
\right)} \right] \\
&\qquad +\ \delta_k \left[ {A_{uw}^{lm} \left( {-e_{2u} \, r_{1uw} \,\overline{\overline
{\delta_{i+1/2} [u]}}^{\,i+1/2,\,k+1/2} }
\right.} \right. \\
& \ \qquad \qquad \qquad \quad\
- e_{1u} \, r_{2uw} \,\overline{\overline {\delta_{j+1/2} [u]}} ^{\,j,\,k+1/2} \\
& \left. {\left. { \ \qquad \qquad \qquad \ \ \ \left. {\
+\frac{e_{1u}\, e_{2u} }{e_{3uw} }\,\left( {r_{1uw}^2+r_{2uw}^2}
\right)\,\delta_{k+1/2} [u]} \right)} \right]\;\;\;} \right\} \\ \\
D_v^{l\textbf{V}} &= \frac{1}{e_{1v} \, e_{2v} \, e_{3v} } \\
& \left\{\quad {\delta_{i+1/2} \left[ {A_f^{lm} \left(
{\frac{e_{2f} \; e_{3f} }{e_{1f} } \,\delta_{i+1/2}[v]
-e_{2f} \; r_{1f} \,\overline{\overline {\delta_{k+1/2}[v]}}^{\,i+1/2,\,k}}
\right)} \right]} \right. \\
& \qquad +\ \delta_j \left[ {A_T^{lm} \left( {\frac{e_{1t}\,e_{3t} }{e_{2t}
}\,\delta_{j} [v] - e_{1t}\, r_{2t}
\,\overline{\overline {\delta_{k+1/2} [v]}} ^{\,j,\,k}}
\right)} \right] \\
& \qquad +\ \delta_k \left[ {A_{vw}^{lm} \left( {-e_{2v} \, r_{1vw} \,\overline{\overline
{\delta_{i+1/2} [v]}}^{\,i+1/2,\,k+1/2} }\right.} \right. \\
& \ \qquad \qquad \qquad \quad\
- e_{1v} \, r_{2vw} \,\overline{\overline {\delta_{j+1/2} [v]}} ^{\,j+1/2,\,k+1/2} \\
& \left. {\left. { \ \qquad \qquad \qquad \ \ \ \left. {\
+\frac{e_{1v}\, e_{2v} }{e_{3vw} }\,\left( {r_{1vw}^2+r_{2vw}^2}
\right)\,\delta_{k+1/2} [v]} \right)} \right]\;\;\;} \right\}
\end{split}
\end{equation}
where $r_1$ and $r_2$ are the slopes between the surface along which the diffusion operator acts and
the surface of computation ($z$- or $s$-surfaces).
The way these slopes are evaluated is given in the lateral physics chapter (\autoref{chap:LDF}).
%% =================================================================================================
\subsection[Iso-level bilaplacian (\forcode{ln_dynldf_bilap})]{Iso-level bilaplacian operator (\protect\np{ln_dynldf_bilap}{ln\_dynldf\_bilap})}
\label{subsec:DYN_ldf_bilap}
The lateral fourth order operator formulation on momentum is obtained by applying \autoref{eq:DYN_ldf_lap} twice.
It requires an additional assumption on boundary conditions:
the first derivative term normal to the coast depends on the free or no-slip lateral boundary conditions chosen,
while the third derivative terms normal to the coast are set to zero (see \autoref{chap:LBC}).
\cmtgm{add a remark on the the change in the position of the coefficient}
%% =================================================================================================
\section[Vertical diffusion term (\textit{dynzdf.F90})]{Vertical diffusion term (\protect\mdl{dynzdf})}
\label{sec:DYN_zdf}
Options are defined through the \nam{zdf}{zdf} namelist variables.
The 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.
In v5.0 only a backward (or implicit) time differencing scheme can be used for the vertical diffusion term.
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
(see \autoref{chap:TD}).
The formulation of the vertical subgrid scale physics is the same whatever the vertical coordinate is.
The vertical diffusion operators given by \autoref{eq:MB_zdf} take the following semi-discrete space form:
\[
% \label{eq:DYN_zdf}
\left\{
\begin{aligned}
D_u^{vm} &\equiv \frac{1}{e_{3u}} \ \delta_k \left[ \frac{A_{uw}^{vm} }{e_{3uw} }
\ \delta_{k+1/2} [\,u\,] \right] \\
\\
D_v^{vm} &\equiv \frac{1}{e_{3v}} \ \delta_k \left[ \frac{A_{vw}^{vm} }{e_{3vw} }
\ \delta_{k+1/2} [\,v\,] \right]
\end{aligned}
\right.
\]
where $A_{uw}^{vm} $ and $A_{vw}^{vm} $ are the vertical eddy viscosity and diffusivity coefficients.
The way these coefficients are evaluated depends on the vertical physics used (see \autoref{chap:ZDF}).
The surface boundary condition on momentum is the stress exerted by the wind.
At the surface, the momentum fluxes are prescribed as the boundary condition on
the vertical turbulent momentum fluxes,
\begin{equation}
\label{eq:DYN_zdf_sbc}
\left.{\left( {\frac{A^{vm} }{e_3 }\ \frac{\partial \textbf{U}_h}{\partial k}} \right)} \right|_{z=1}
= \frac{1}{\rho_o} \binom{\tau_u}{\tau_v }
\end{equation}
where $\left( \tau_u ,\tau_v \right)$ are the two components of the wind stress vector in
the (\textbf{i},\textbf{j}) coordinate system.
The high mixing coefficients in the surface mixed layer ensure that the surface wind stress is distributed in
the vertical over the mixed layer depth.
If the vertical mixing coefficient is small (when no mixed layer scheme is used)
the surface stress enters only the top model level, as a body force.
The surface wind stress is calculated in the surface module routines (SBC, see \autoref{chap:SBC}).
The turbulent flux of momentum at the bottom of the ocean is specified through a bottom friction parameterisation
(see \autoref{sec:ZDF_drg})
When activated (\np[=.true.]{ln_zad_Aimp}{ln\_zad\_Aimp}) vertical advection of momentum
can be done partly implicitely.
Appart from $w_i$ variables appearing in these expressions are implicit in time (\textit{after})
and vertical derivatives are done with a $1^{st}$ order upstream scheme.
w_i \, \delta_{k} [u] &= \frac{1}{e_{1u}\,e_{2u}} \overline{\overline{ e_{1t}\,e_{2t}\,w_i }}^{\,i,k+1/2} \, \delta_{k} \left[\frac{u}{e_{3uw}}\right]^{up1}, \\[10pt]
w_i \, \delta_{k} [v] &= \frac{1}{e_{1v}\,e_{2v}} \overline{\overline{ e_{1t}\,e_{2t}\,w_i }}^{\,j,k+1/2} \, \delta_{k} \left[\frac{v}{e_{3vw}}\right]^{up1}.
\delta_{k} [w_i u] &= \frac{1}{e_{1u}\,e_{2u}\,e_{3u}} \left( \left( \overline{ e_{1t}\,e_{2t}\,w_i }^{\,i} \, u \right)^{k,up1} - \left( \overline{ e_{1t}\,e_{2t}\,w_i }^{\,i} \, u \right)^{k+1,up1}\right), \\[10pt]
\delta_{k} [w_i v] &= \frac{1}{e_{1v}\,e_{2v}\,e_{3v}} \left(\left( \overline{ e_{1t}\,e_{2t}\,w_i }^{\,j} \, v \right)^{k,up1} - \left( \overline{ e_{1t}\,e_{2t}\,w_i }^{\,j} \, v \right)^{k+1,up1}\right).
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
%% =================================================================================================
\section{External forcings}
\label{sec:DYN_forcing}
Besides the surface and bottom stresses (see the above section)
which are introduced as boundary conditions on the vertical mixing,
three other forcings may enter the dynamical equations by affecting the surface pressure gradient.
(1) When \np[=.true.]{ln_apr_dyn}{ln\_apr\_dyn} (see \autoref{sec:SBC_apr}),
the atmospheric pressure is taken into account when computing the surface pressure gradient.
(2) When \np[=.true.]{ln_tide_pot}{ln\_tide\_pot} and \np[=.true.]{ln_tide}{ln\_tide} (see \autoref{sec:SBC_TDE}),
the tidal potential is taken into account when computing the surface pressure gradient.
(3) When \np[=2]{nn_ice_embd}{nn\_ice\_embd} and SI3 is used
(\ie\ when the sea-ice is embedded in the ocean),
the snow-ice mass is taken into account when computing the surface pressure gradient.
\cmtgm{ missing : the lateral boundary condition !!! another external forcing
}
%% =================================================================================================
\section{Wetting and drying }
\label{sec:DYN_wetdry}
There is currently only one choice of limiter for the wetting and drying code
(wd): a directional limiter (dl). Previous versions also provided an iterative
limiter (il) but this has been removed due to performance and robustness issues.
The framework for providing alternatives has been retained in case of future
interest so the directional limiter has to be exlicitly selected despite being
the only choice.
The directional limiter is based on the scheme developed by \cite{warner.defne.ea_CG13}
for ROMS which was in turn based on ideas developed for POM by \cite{oey_OM06}. The
directional limiter is activated by setting $\mathrm{ln\_wd\_dl} = \mathrm{.true.}$.
\begin{listing}
\nlst{namwad}
\caption{\forcode{&namwad}}
\label{lst:namwad}
\end{listing}
The following terminology is used. The depth of the topography (positive downwards)
at each $(i,j)$ point is the quantity stored in array $\mathrm{ht\_wd}$ in the \NEMO\ code.
The height of the free surface (positive upwards) is denoted by $ \mathrm{ssh}$. Given the sign
conventions used, the water depth, $h$, is the height of the free surface plus the depth of the
topography (i.e. $\mathrm{ssh} + \mathrm{ht\_wd}$).
Wetting and Drying schemes take all points in the domain below a land elevation of
$\mathrm{rn\_wdld}$ to be covered by water. The topography specified with a model
configuration is required to have negative depths at points where the land is higher than
the topography's reference sea-level. The vertical grid in \NEMO\ is normally computed
relative to an initial state with zero sea surface height elevation. The user can choose
to compute the vertical grid and heights in the model relative to a non-zero reference
height for the free surface. This choice affects the calculation of the metrics and depths
(i.e. the $\mathrm{e3t\_0, ht\_0}$ etc. arrays).
Points where the water depth is less than $\mathrm{rn\_wdmin1}$ are interpreted as ``dry''.
$\mathrm{rn\_wdmin1}$ is usually chosen to be of order $0.05$m but extreme topographies
with very steep slopes require larger values for normal choices of time-step.
Surface fluxes are switched off for dry cells to prevent freezing, boiling etc. of
very thin water layers. The fluxes are tappered down using a $\mathrm{tanh}$ weighting
function to no flux as the dry limit $\mathrm{rn\_wdmin1}$ is approached. Even wet cells
can be very shallow and may need their surface fluxes reduced. The depth at which to
start tapering is controlled by the user by setting $\mathrm{rn\_wd\_sbcdep}$. The
fraction $(<1)$ of sufrace fluxes to use at this depth is set by
$\mathrm{rn\_wd\_sbcfra}$.
The code has been tested in six test cases provided in the WAD\_TEST\_CASES configuration
and in ``realistic'' configurations covering parts of the north-west European shelf.
All these configurations have used pure sigma coordinates. It is expected that
the wetting and drying code will work in domains with more general s-coordinates provided
the coordinates are pure sigma in the region where wetting and drying actually occurs.
The next sub-section describes the directional limiter. The final sub-section covers some
additional considerations that are relevant to all possible limiting schemes.
\subsection[Directional limiter (\textit{wet\_dry.F90})]{Directional limiter (\mdl{wet\_dry})}
\label{subsec:DYN_wd_directional_limiter}
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
The principal idea of the directional limiter is that water should not be allowed to flow
out of a dry tracer cell (i.e. one whose water depth is less than
\np{rn_wdmin1}{rn\_wdmin1}).
All the changes associated with this option are made to the barotropic solver for the
non-linear free surface code within $\mathrm{dynspg\_ts}$. On each barotropic sub-step
the scheme determines the direction of the flow across each face of all the tracer cells
and sets the flux across the face to zero when the flux is from a dry tracer cell. This
prevents cells whose depth is $\mathrm{rn\_wdmin1}$ or less from drying out further. The
scheme does not force $h$ (the water depth) at tracer cells to be at least the minimum
depth and hence is able to conserve mass / volume.
The flux across each $u$-face of a tracer cell is multiplied by a factor
$\mathrm{zuwdmask}$ (an array which depends on ji and jj). If the user sets
\np[=.false.]{ln_wd_dl_ramp}{ln\_wd\_dl\_ramp} then $\mathrm{zuwdmask}$ is 1 when the flux
is from a cell with water depth greater than \np{rn_wdmin1}{rn\_wdmin1} and 0 otherwise.
If the user sets \np[=.true.]{ln_wd_dl_ramp}{ln\_wd\_dl\_ramp} the flux across the face is
ramped down as the water depth decreases from 2 * \np{rn_wdmin1}{rn\_wdmin1} to
\np{rn_wdmin1}{rn\_wdmin1}. The use of this ramp reduced grid-scale noise in idealised
test cases.
At the point where the flux across a $u$-face is multiplied by $\mathrm{zuwdmask}$ , we
have chosen also to multiply the corresponding velocity on the ``now'' step at that face
by $\mathrm{zuwdmask}$. We could have chosen not to do that and to allow fairly large
velocities to occur in these ``dry'' cells. The rationale for setting the velocity to
zero is that it is the momentum equations that are being solved and the total momentum of
the upstream cell (treating it as a finite volume) should be considered to be its depth
times its velocity. This depth is considered to be zero at ``dry'' $u$-points consistent
with its treatment in the calculation of the flux of mass across the cell face.
\cite{warner.defne.ea_CG13} state that in their scheme the velocity masks at the cell
faces for the baroclinic timesteps are set to 0 or 1 depending on whether the average of
the masks over the barotropic sub-steps is respectively less than or greater than 0.5.
That scheme does not conserve tracers in integrations started from constant tracer fields
(tracers independent of $x$, $y$ and $z$). Our scheme conserves constant tracers because
the velocities used at the tracer cell faces on the baroclinic timesteps are carefully
calculated by $\mathrm{dynspg\_ts}$ to equal their mean value during the barotropic steps.
If the user sets \np[=.true.]{ln_wd_dl_bc}{ln\_wd\_dl\_bc}, the baroclinic velocities are
also multiplied by a suitably weighted average of $\mathrm{zuwdmask}$.
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
%% =================================================================================================
\subsubsection[Additional considerations (\textit{usrdef\_zgr.F90})]{Additional considerations (\mdl{usrdef\_zgr})}
\label{subsec:DYN_WAD_additional}
In the very shallow water where wetting and drying occurs the parametrisation of
bottom drag is clearly very important. In order to promote stability
it is sometimes useful to calculate the bottom drag using an implicit time-stepping approach.
Suitable specifcation of the surface heat flux in wetting and drying domains in forced and
coupled simulations needs further consideration. In order to prevent freezing or boiling
in uncoupled integrations the net surface heat fluxes need to be appropriately limited.
% The WAD test cases
%% =================================================================================================
\subsection[The WAD test cases (\textit{usrdef\_zgr.F90})]{The WAD test cases (\mdl{usrdef\_zgr})}
\label{subsec:DYN_WAD_test_cases}
See the WAD tests MY\_DOC documention for details of the WAD test cases.
%% =================================================================================================
\section[Time evolution term (\textit{dynnxt.F90})]{Time evolution term (\protect\mdl{dynnxt})}
\label{sec:DYN_nxt}
Options are defined through the \nam{dom}{dom} namelist variables.
The general framework for dynamics time stepping is a leap-frog scheme,
\ie\ a three level centred time scheme associated with an Asselin time filter (cf. \autoref{chap:TD}).
The scheme is applied to the velocity, except when
using the flux form of momentum advection (cf. \autoref{sec:DYN_adv_cor_flux})
in the variable volume case (\np[=.false.]{ln_linssh}{ln\_linssh}),
where it has to be applied to the thickness weighted velocity (see \autoref{sec:SCOORD_momentum})
$\bullet$ vector invariant form or linear free surface
(\np[=.true.]{ln_dynhpg_vec}{ln\_dynhpg\_vec} or \np[=.true.]{ln_linssh}{ln\_linssh}):
\[
% \label{eq:DYN_nxt_vec}
\left\{
\begin{aligned}
&u^{t+\rdt} = u_f^{t-\rdt} + 2\rdt \ \text{RHS}_u^t \\
&u_f^t \;\quad = u^t+\gamma \,\left[ {u_f^{t-\rdt} -2u^t+u^{t+\rdt}} \right]
\end{aligned}
\right.
\]
$\bullet$ flux form and nonlinear free surface
(\np[=.false.]{ln_dynhpg_vec}{ln\_dynhpg\_vec} and \np[=.false.]{ln_linssh}{ln\_linssh}):
\[
% \label{eq:DYN_nxt_flux}
\left\{
\begin{aligned}
&\left(e_{3u}\,u\right)^{t+\rdt} = \left(e_{3u}\,u\right)_f^{t-\rdt} + 2\rdt \; e_{3u} \;\text{RHS}_u^t \\
&\left(e_{3u}\,u\right)_f^t \;\quad = \left(e_{3u}\,u\right)^t
+\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]
\end{aligned}
\right.
\]
where RHS is the right hand side of the momentum equation,
the subscript $f$ denotes filtered values and $\gamma$ is the Asselin coefficient.
$\gamma$ is initialized as \np{nn_atfp}{nn\_atfp} (namelist parameter).
Its default value is \np[=10.e-3]{nn_atfp}{nn\_atfp}.
In both cases, the modified Asselin filter is not applied since perfect conservation is not an issue for
the momentum equations.
\subinc{\input{../../global/epilogue}}
\end{document}