# 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_model_basics.tex in NEMO/trunk/doc/latex/NEMO/subfiles – NEMO

# source:NEMO/trunk/doc/latex/NEMO/subfiles/chap_model_basics.tex@11598

Last change on this file since 11598 was 11598, checked in by nicolasmartin, 3 years ago

Add template of versioning record at the beginning of chapters

File size: 64.9 KB
Line
1\documentclass[../main/NEMO_manual]{subfiles}
2
3\begin{document}
4
5\chapter{Model Basics}
6\label{chap:MB}
7
8\thispagestyle{plain}
9
10\chaptertoc
11
12\paragraph{Changes record} ~\\
13
14{\footnotesize
15  \begin{tabularx}{\textwidth}{l||X|X}
16    Release & Author(s) & Modifications \\
17    \hline
18    {\em   4.0} & {\em ...} & {\em ...} \\
19    {\em   3.6} & {\em ...} & {\em ...} \\
20    {\em   3.4} & {\em ...} & {\em ...} \\
21    {\em <=3.4} & {\em ...} & {\em ...}
22  \end{tabularx}
23}
24
25\clearpage
26
27%% =================================================================================================
28\section{Primitive equations}
29\label{sec:MB_PE}
30
31%% =================================================================================================
32\subsection{Vector invariant formulation}
33\label{subsec:MB_PE_vector}
34
35The ocean is a fluid that can be described to a good approximation by the primitive equations,
36\ie\ the Navier-Stokes equations along with a nonlinear equation of state which
37couples the two active tracers (temperature and salinity) to the fluid velocity,
39
40\begin{enumerate}
41\item \textit{spherical Earth approximation}: the geopotential surfaces are assumed to be oblate spheriods
42  that follow the Earth's bulge; these spheroids are approximated by spheres with
43  gravity locally vertical (parallel to the Earth's radius) and independent of latitude
44  \citep[][section 2]{white.hoskins.ea_QJRMS05}.
45\item \textit{thin-shell approximation}: the ocean depth is neglected compared to the earth's radius
46\item \textit{turbulent closure hypothesis}: the turbulent fluxes
47  (which represent the effect of small scale processes on the large-scale)
48  are expressed in terms of large-scale features
49\item \textit{Boussinesq hypothesis}: density variations are neglected except in their contribution to
50  the buoyancy force
51  \begin{equation}
52    \label{eq:MB_PE_eos}
53    \rho = \rho \ (T,S,p)
54  \end{equation}
55\item \textit{Hydrostatic hypothesis}: the vertical momentum equation is reduced to a balance between
56  the vertical pressure gradient and the buoyancy force
57  (this removes convective processes from the initial Navier-Stokes equations and so
58  convective processes must be parameterized instead)
59  \begin{equation}
60    \label{eq:MB_PE_hydrostatic}
61    \pd[p]{z} = - \rho \ g
62  \end{equation}
63\item \textit{Incompressibility hypothesis}: the three dimensional divergence of the velocity vector $\vect U$
64  is assumed to be zero.
65  \begin{equation}
66    \label{eq:MB_PE_continuity}
67    \nabla \cdot \vect U = 0
68  \end{equation}
69\item \textit{Neglect of additional Coriolis terms}: the Coriolis terms that vary with the cosine of latitude are neglected.
70  These terms may be non-negligible where the Brunt-Vaisala frequency $N$ is small, either in the deep ocean or
71  in the sub-mesoscale motions of the mixed layer, or near the equator \citep[][section 1]{white.hoskins.ea_QJRMS05}.
72  They can be consistently included as part of the ocean dynamics \citep[][section 3(d)]{white.hoskins.ea_QJRMS05} and are
73  retained in the MIT ocean model.
74\end{enumerate}
75
76Because the gravitational force is so dominant in the equations of large-scale motions,
77it is useful to choose an orthogonal set of unit vectors $(i,j,k)$ linked to the Earth such that
78$k$ is the local upward vector and $(i,j)$ are two vectors orthogonal to $k$,
79\ie\ tangent to the geopotential surfaces.
80Let us define the following variables: $\vect U$ the vector velocity, $\vect U = \vect U_h + w \, \vect k$
81(the subscript $h$ denotes the local horizontal vector, \ie\ over the $(i,j)$ plane),
82$T$ the potential temperature, $S$ the salinity, $\rho$ the \textit{in situ} density.
83The vector invariant form of the primitive equations in the $(i,j,k)$ vector system provides
84the following equations:
85\begin{subequations}
86  \label{eq:MB_PE}
87  \begin{gather}
88    \intertext{$-$ the momentum balance}
89    \label{eq:MB_PE_dyn}
90    \pd[\vect U_h]{t} = - \lt[ (\nabla \times \vect U) \times \vect U + \frac{1}{2} \nabla \lt( \vect U^2 \rt) \rt]_h
91                        - f \; k \times \vect U_h - \frac{1}{\rho_o} \nabla_h p
92                        + \vect D^{\vect U} + \vect F^{\vect U} \\
93    \intertext{$-$ the heat and salt conservation equations}
94    \label{eq:MB_PE_tra_T}
95    \pd[T]{t} = - \nabla \cdot (T \ \vect U) + D^T + F^T \\
96    \label{eq:MB_PE_tra_S}
97    \pd[S]{t} = - \nabla \cdot (S \ \vect U) + D^S + F^S
98  \end{gather}
99\end{subequations}
100where $\nabla$ is the generalised derivative vector operator in $(i,j,k)$ directions, $t$ is the time,
101$z$ is the vertical coordinate, $\rho$ is the \textit{in situ} density given by the equation of state
102(\autoref{eq:MB_PE_eos}), $\rho_o$ is a reference density, $p$ the pressure,
103$f = 2 \vect \Omega \cdot k$ is the Coriolis acceleration
104(where $\vect \Omega$ is the Earth's angular velocity vector), and $g$ is the gravitational acceleration.
105$\vect D^{\vect U}$, $D^T$ and $D^S$ are the parameterisations of small-scale physics for momentum,
106temperature and salinity, and $\vect F^{\vect U}$, $F^T$ and $F^S$ surface forcing terms.
107Their nature and formulation are discussed in \autoref{sec:MB_zdf_ldf} and \autoref{subsec:MB_boundary_condition}.
108
109%% =================================================================================================
110\subsection{Boundary conditions}
111\label{subsec:MB_boundary_condition}
112
113An ocean is bounded by complex coastlines, bottom topography at its base and
114an air-sea or ice-sea interface at its top.
115These boundaries can be defined by two surfaces, $z = - H(i,j)$ and $z = \eta(i,j,k,t)$,
116where $H$ is the depth of the ocean bottom and $\eta$ is the height of the sea surface
117(discretisation can introduce additional artificial side-wall'' boundaries).
118Both $H$ and $\eta$ are referenced to a surface of constant geopotential (\ie\ a mean sea surface height) on which $z = 0$.
119(\autoref{fig:MB_ocean_bc}).
120Through these two boundaries, the ocean can exchange fluxes of heat, fresh water, salt, and momentum with
121the solid earth, the continental margins, the sea ice and the atmosphere.
122However, some of these fluxes are so weak that even on climatic time scales of thousands of years
123they can be neglected.
124In the following, we briefly review the fluxes exchanged at the interfaces between the ocean and
125the other components of the earth system.
126
127\begin{figure}[!ht]
128  \centering
129  \includegraphics[width=0.66\textwidth]{Fig_I_ocean_bc}
130  \caption[Ocean boundary conditions]{
131    The ocean is bounded by two surfaces, $z = - H(i,j)$ and $z = \eta(i,j,t)$,
132    where $H$ is the depth of the sea floor and $\eta$ the height of the sea surface.
133    Both $H$ and $\eta$ are referenced to $z = 0$.}
134  \label{fig:MB_ocean_bc}
135\end{figure}
136
137\begin{description}
138\item [Land - ocean interface:]  the major flux between continental margins and the ocean is a mass exchange of fresh water through river runoff.
139  Such an exchange modifies the sea surface salinity especially in the vicinity of major river mouths.
140  It can be neglected for short range integrations but has to be taken into account for long term integrations as
141  it influences the characteristics of water masses formed (especially at high latitudes).
142  It is required in order to close the water cycle of the climate system.
143  It is usually specified as a fresh water flux at the air-sea interface in the vicinity of river mouths.
144\item [Solid earth - ocean interface:]  heat and salt fluxes through the sea floor are small, except in special areas of little extent.
145  They are usually neglected in the model
146  \footnote{
147    In fact, it has been shown that the heat flux associated with the solid Earth cooling
148    (\ie\ the geothermal heating) is not negligible for the thermohaline circulation of the world ocean
149    (see \autoref{subsec:TRA_bbc}).
150  }.
151  The boundary condition is thus set to no flux of heat and salt across solid boundaries.
152  For momentum, the situation is different. There is no flow across solid boundaries,
153  \ie\ the velocity normal to the ocean bottom and coastlines is zero (in other words,
154  the bottom velocity is parallel to solid boundaries). This kinematic boundary condition
155  can be expressed as:
156  \begin{equation}
157    \label{eq:MB_w_bbc}
158    w = - \vect U_h \cdot \nabla_h (H)
159  \end{equation}
160  In addition, the ocean exchanges momentum with the earth through frictional processes.
161  Such momentum transfer occurs at small scales in a boundary layer.
162  It must be parameterized in terms of turbulent fluxes using bottom and/or lateral boundary conditions.
163  Its specification depends on the nature of the physical parameterisation used for
164  $\vect D^{\vect U}$ in \autoref{eq:MB_PE_dyn}.
165  It is discussed in \autoref{eq:MB_zdf}.% and Chap. III.6 to 9.
166\item [Atmosphere - ocean interface:]  the kinematic surface condition plus the mass flux of fresh water PE (the precipitation minus evaporation budget)
168  $169 % \label{eq:MB_w_sbc} 170 w = \pd[\eta]{t} + \lt. \vect U_h \rt|_{z = \eta} \cdot \nabla_h (\eta) + P - E 171$
172  The dynamic boundary condition, neglecting the surface tension (which removes capillary waves from the system)
173  leads to the continuity of pressure across the interface $z = \eta$.
174  The atmosphere and ocean also exchange horizontal momentum (wind stress), and heat.
175\item [Sea ice - ocean interface:]  the ocean and sea ice exchange heat, salt, fresh water and momentum.
176  The sea surface temperature is constrained to be at the freezing point at the interface.
177  Sea ice salinity is very low ($\sim4-6 \, psu$) compared to those of the ocean ($\sim34 \, psu$).
178  The cycle of freezing/melting is associated with fresh water and salt fluxes that cannot be neglected.
179\end{description}
180
181%% =================================================================================================
183\label{sec:MB_hor_pg}
184
185%% =================================================================================================
186\subsection{Pressure formulation}
187\label{subsec:MB_p_formulation}
188
189The total pressure at a given depth $z$ is composed of a surface pressure $p_s$ at
190a reference geopotential surface ($z = 0$) and a hydrostatic pressure $p_h$ such that:
191$p(i,j,k,t) = p_s(i,j,t) + p_h(i,j,k,t)$.
192The latter is computed by integrating (\autoref{eq:MB_PE_hydrostatic}),
193assuming that pressure in decibars can be approximated by depth in meters in (\autoref{eq:MB_PE_eos}).
194The hydrostatic pressure is then given by:
195$196 % \label{eq:MB_pressure} 197 p_h (i,j,z,t) = \int_{\varsigma = z}^{\varsigma = 0} g \; \rho (T,S,\varsigma) \; d \varsigma 198$
199Two strategies can be considered for the surface pressure term:
200$(a)$ introduce of a  new variable $\eta$, the free-surface elevation,
201for which a prognostic equation can be established and solved;
202$(b)$ assume that the ocean surface is a rigid lid,
203on which the pressure (or its horizontal gradient) can be diagnosed.
204When the former strategy is used, one solution of the free-surface elevation consists of
205the excitation of external gravity waves.
206The flow is barotropic and the surface moves up and down with gravity as the restoring force.
207The phase speed of such waves is high (some hundreds of metres per second) so that
208the time step has to be very short when they are present in the model.
209The latter strategy filters out these waves since the rigid lid approximation implies $\eta = 0$,
210\ie\ the sea surface is the surface $z = 0$.
211This well known approximation increases the surface wave speed to infinity and
212modifies certain other longwave dynamics (\eg\ barotropic Rossby or planetary waves).
213The rigid-lid hypothesis is an obsolescent feature in modern OGCMs.
214It has been available until the release 3.1 of \NEMO, and it has been removed in release 3.2 and followings.
215Only the free surface formulation is now described in this document (see the next sub-section).
216
217%% =================================================================================================
218\subsection{Free surface formulation}
219\label{subsec:MB_free_surface}
220
221In the free surface formulation, a variable $\eta$, the sea-surface height,
222is introduced which describes the shape of the air-sea interface.
223This variable is solution of a prognostic equation which is established by forming the vertical average of
224the kinematic surface condition (\autoref{eq:MB_w_bbc}):
225\begin{equation}
226  \label{eq:MB_ssh}
227  \pd[\eta]{t} = - D + P - E \quad \text{where} \quad D = \nabla \cdot \lt[ (H + \eta) \; \overline{U}_h \, \rt]
228\end{equation}
229and using (\autoref{eq:MB_PE_hydrostatic}) the surface pressure is given by: $p_s = \rho \, g \, \eta$.
230
231Allowing the air-sea interface to move introduces the external gravity waves (EGWs) as
232a class of solution of the primitive equations.
233These waves are barotropic (\ie\ nearly independent of depth) and their phase speed is quite high.
234Their time scale is short with respect to the other processes described by the primitive equations.
235
236Two choices can be made regarding the implementation of the free surface in the model,
237depending on the physical processes of interest.
238
239$\bullet$ If one is interested in EGWs, in particular the tides and their interaction with
240the baroclinic structure of the ocean (internal waves) possibly in shallow seas,
241then a non linear free surface is the most appropriate.
242This means that no approximation is made in \autoref{eq:MB_ssh} and that
243the variation of the ocean volume is fully taken into account.
244Note that in order to study the fast time scales associated with EGWs it is necessary to
245minimize time filtering effects
246(use an explicit time scheme with very small time step, or a split-explicit scheme with reasonably small time step,
247see \autoref{subsec:DYN_spg_exp} or \autoref{subsec:DYN_spg_ts}).
248
249$\bullet$ If one is not interested in EGW but rather sees them as high frequency noise,
250it is possible to apply an explicit filter to slow down the fastest waves while
251not altering the slow barotropic Rossby waves.
252If further, an approximative conservation of heat and salt contents is sufficient for the problem solved,
253then it is sufficient to solve a linearized version of \autoref{eq:MB_ssh},
254which still allows to take into account freshwater fluxes applied at the ocean surface \citep{roullet.madec_JGR00}.
255Nevertheless, with the linearization, an exact conservation of heat and salt contents is lost.
256
257The filtering of EGWs in models with a free surface is usually a matter of discretisation of
258the temporal derivatives,
259using a split-explicit method \citep{killworth.webb.ea_JPO91, zhang.endoh_JGR92} or
260the implicit scheme \citep{dukowicz.smith_JGR94} or
262With the present release, \NEMO\  offers the choice between
263an explicit free surface (see \autoref{subsec:DYN_spg_exp}) or
264a split-explicit scheme strongly inspired the one proposed by \citet{shchepetkin.mcwilliams_OM05}
265(see \autoref{subsec:DYN_spg_ts}).
266
267%% =================================================================================================
268\section{Curvilinear \textit{z-}coordinate system}
269\label{sec:MB_zco}
270
271%% =================================================================================================
272\subsection{Tensorial formalism}
273\label{subsec:MB_tensorial}
274
275In many ocean circulation problems, the flow field has regions of enhanced dynamics
276(\ie\ surface layers, western boundary currents, equatorial currents, or ocean fronts).
277The representation of such dynamical processes can be improved by
278specifically increasing the model resolution in these regions.
279As well, it may be convenient to use a lateral boundary-following coordinate system to
280better represent coastal dynamics.
281Moreover, the common geographical coordinate system has a singular point at the North Pole that
282cannot be easily treated in a global model without filtering.
283A solution consists of introducing an appropriate coordinate transformation that
284shifts the singular point onto land \citep{madec.imbard_CD96, murray_JCP96}.
285As a consequence, it is important to solve the primitive equations in various curvilinear coordinate systems.
286An efficient way of introducing an appropriate coordinate transform can be found when using a tensorial formalism.
287This formalism is suited to any multidimensional curvilinear coordinate system.
288Ocean modellers mainly use three-dimensional orthogonal grids on the sphere (spherical earth approximation),
289with preservation of the local vertical. Here we give the simplified equations for this particular case.
290The general case is detailed by \citet{eiseman.stone_SR80} in their survey of the conservation laws of fluid dynamics.
291
292Let $(i,j,k)$ be a set of orthogonal curvilinear coordinates on
293the sphere associated with the positively oriented orthogonal set of unit vectors
294$(i,j,k)$ linked to the earth such that
295$k$ is the local upward vector and $(i,j)$ are two vectors orthogonal to $k$,
296\ie\ along geopotential surfaces (\autoref{fig:MB_referential}).
297Let $(\lambda,\varphi,z)$ be the geographical coordinate system in which a position is defined by
298the latitude $\varphi(i,j)$, the longitude $\lambda(i,j)$ and
299the distance from the centre of the earth $a + z(k)$ where $a$ is the earth's radius and
300$z$ the altitude above a reference sea level (\autoref{fig:MB_referential}).
301The local deformation of the curvilinear coordinate system is given by $e_1$, $e_2$ and $e_3$,
302the three scale factors:
303\begin{equation}
304  \label{eq:MB_scale_factors}
305  \begin{aligned}
306    e_1 &= (a + z) \lt[ \lt( \pd[\lambda]{i} \cos \varphi \rt)^2 + \lt( \pd[\varphi]{i} \rt)^2 \rt]^{1/2} \\
307    e_2 &= (a + z) \lt[ \lt( \pd[\lambda]{j} \cos \varphi \rt)^2 + \lt( \pd[\varphi]{j} \rt)^2 \rt]^{1/2} \\
308    e_3 &= \lt( \pd[z]{k} \rt)
309  \end{aligned}
310\end{equation}
311
312\begin{figure}[!tb]
313  \centering
314  \includegraphics[width=0.66\textwidth]{Fig_I_earth_referential}
315  \caption[Geographical and curvilinear coordinate systems]{
316    the geographical coordinate system $(\lambda,\varphi,z)$ and the curvilinear
317    coordinate system $(i,j,k)$.}
318  \label{fig:MB_referential}
319\end{figure}
320
321Since the ocean depth is far smaller than the earth's radius, $a + z$, can be replaced by $a$ in
322(\autoref{eq:MB_scale_factors}) (thin-shell approximation).
323The resulting horizontal scale factors $e_1$, $e_2$  are independent of $k$ while
324the vertical scale factor is a single function of $k$ as $k$ is parallel to $z$.
325The scalar and vector operators that appear in the primitive equations
326(\autoref{eq:MB_PE_dyn} to \autoref{eq:MB_PE_eos}) can then be written in the tensorial form,
327invariant in any orthogonal horizontal curvilinear coordinate system transformation:
328\begin{subequations}
329  % \label{eq:MB_discrete_operators}
330  \begin{gather}
332    \nabla q =   \frac{1}{e_1} \pd[q]{i} \; \vect i
333               + \frac{1}{e_2} \pd[q]{j} \; \vect j
334               + \frac{1}{e_3} \pd[q]{k} \; \vect k \\
335    \label{eq:MB_div}
336    \nabla \cdot \vect A =   \frac{1}{e_1 \; e_2} \lt[ \pd[(e_2 \; a_1)]{\partial i} + \pd[(e_1 \; a_2)]{j} \rt]
337                           + \frac{1}{e_3} \lt[ \pd[a_3]{k} \rt]
338  \end{gather}
339  \begin{multline}
340    \label{eq:MB_curl}
341      \nabla \times \vect{A} =   \lt[ \frac{1}{e_2} \pd[a_3]{j} - \frac{1}{e_3} \pd[a_2]{k}   \rt] \vect i \\
342                               + \lt[ \frac{1}{e_3} \pd[a_1]{k} - \frac{1}{e_1} \pd[a_3]{i}   \rt] \vect j \\
343                               + \frac{1}{e_1 e_2} \lt[ \pd[(e_2 a_2)]{i} - \pd[(e_1 a_1)]{j} \rt] \vect k
344  \end{multline}
345  \begin{gather}
346    \label{eq:MB_lap}
347    \Delta q = \nabla \cdot (\nabla q) \\
348    \label{eq:MB_lap_vector}
349    \Delta \vect A = \nabla (\nabla \cdot \vect A) - \nabla \times (\nabla \times \vect A)
350  \end{gather}
351\end{subequations}
352where $q$ is a scalar quantity and $\vect A = (a_1,a_2,a_3)$ a vector in the $(i,j,k)$ coordinates system.
353
354%% =================================================================================================
355\subsection{Continuous model equations}
356\label{subsec:MB_zco_Eq}
357
358In order to express the Primitive Equations in tensorial formalism,
359it is necessary to compute the horizontal component of the non-linear and viscous terms of the equation using
361Let us set $\vect U = (u,v,w) = \vect U_h + w \; \vect k$, the velocity in the $(i,j,k)$ coordinates system and
362define the relative vorticity $\zeta$ and the divergence of the horizontal velocity field $\chi$, by:
363\begin{gather}
364  \label{eq:MB_curl_Uh}
365  \zeta = \frac{1}{e_1 e_2} \lt[ \pd[(e_2 \, v)]{i} - \pd[(e_1 \, u)]{j} \rt] \\
366  \label{eq:MB_div_Uh}
367  \chi  = \frac{1}{e_1 e_2} \lt[ \pd[(e_2 \, u)]{i} + \pd[(e_1 \, v)]{j} \rt]
368\end{gather}
369
370Using again the fact that the horizontal scale factors $e_1$ and $e_2$ are independent of $k$ and that
371$e_3$  is a function of the single variable $k$,
372$NLT$ the nonlinear term of \autoref{eq:MB_PE_dyn} can be transformed as follows:
373\begin{alignat*}{2}
374  &NLT &=   &\lt[ (\nabla \times {\vect U}) \times {\vect U} + \frac{1}{2} \nabla \lt( {\vect U}^2 \rt) \rt]_h \\
375  &    &=   &\lt(
376    \begin{array}{*{20}c}
377                \lt[ \frac{1}{e_3} \pd[u]{k} - \frac{1}{e_1} \pd[w]{i} \rt] w - \zeta \; v   \\
378                \zeta \; u - \lt[ \frac{1}{e_2} \pd[w]{j} - \frac{1}{e_3} \pd[v]{k} \rt] \ w
379    \end{array}
380                                                                                             \rt)
381          + \frac{1}{2} \lt(
382    \begin{array}{*{20}c}
383                             \frac{1}{e_1} \pd[(u^2 + v^2 + w^2)]{i} \\
384                             \frac{1}{e_2} \pd[(u^2 + v^2 + w^2)]{j}
385    \end{array}
386                                                                     \rt) \\
387  &    &=   &\lt(
388    \begin{array}{*{20}c}
389                  -\zeta \; v \\
390                   \zeta \; u
391    \end{array}
392                              \rt)
393          + \frac{1}{2} \lt(
394    \begin{array}{*{20}c}
395                             \frac{1}{e_1} \pd[(u^2 + v^2)]{i} \\
396                             \frac{1}{e_2} \pd[(u^2 + v^2)]{j}
397    \end{array}
398                                                               \rt) \\
399  &    &  &+ \frac{1}{e_3} \lt(
400    \begin{array}{*{20}c}
401                                w \; \pd[u]{k} \\
402                                w \; \pd[v]{k}
403    \end{array}
404                                               \rt)
405           - \lt(
406    \begin{array}{*{20}c}
407                  \frac{w}{e_1} \pd[w]{i} - \frac{1}{2 e_1} \pd[w^2]{i} \\
408                  \frac{w}{e_2} \pd[w]{j} - \frac{1}{2 e_2} \pd[w^2]{j}
409    \end{array}
410                                                                        \rt)
411\end{alignat*}
412The last term of the right hand side is obviously zero, and thus the nonlinear term of
413\autoref{eq:MB_PE_dyn} is written in the $(i,j,k)$ coordinate system:
414\begin{equation}
415  \label{eq:MB_vector_form}
416  NLT =   \zeta \; \vect k \times \vect U_h + \frac{1}{2} \nabla_h \lt( \vect U_h^2 \rt)
417        + \frac{1}{e_3} w \pd[\vect U_h]{k}
418\end{equation}
419
420This is the so-called \textit{vector invariant form} of the momentum advection term.
421For some purposes, it can be advantageous to write this term in the so-called flux form,
422\ie\ to write it as the divergence of fluxes.
423For example, the first component of \autoref{eq:MB_vector_form} (the $i$-component) is transformed as follows:
424\begin{alignat*}{2}
425  &NLT_i &= &- \zeta \; v + \frac{1}{2 \; e_1} \pd[ (u^2 + v^2) ]{i} + \frac{1}{e_3} w \ \pd[u]{k} \\
426  &      &&\frac{1}{e_1 \; e_2} \lt( -v \pd[(e_2 \, v)]{i} + v \pd[(e_1 \, u)]{j} \rt)
427            + \frac{1}{e_1 e_2} \lt( e_2 \; u \pd[u]{i} + e_2 \; v \pd[v]{i} \rt) \\
428  &      & &+ \frac{1}{e_3} \lt( w \; \pd[u]{k} \rt) \\
429  &      &&\frac{1}{e_1 \; e_2} \lt[ - \lt( v^2 \pd[e_2]{i} + e_2 \, v \pd[v]{i} \rt)
430                                     + \lt( \pd[ \lt( e_1 \, u \, v \rt)]{j} -         e_1 \, u \pd[v]{j} \rt) \rt. \\
431  &      &                       &\lt. + \lt( \pd[ \lt( e_2 \, u \, u \rt)]{i} - u \pd[ \lt( e_2 u \rt)]{i} \rt)
432                                     + e_2 v \pd[v]{i}                                                         \rt] \\
433  &      & &+ \frac{1}{e_3} \lt( \pd[(w \, u)]{k} - u \pd[w]{k} \rt) \\
434  &      &&\frac{1}{e_1 \; e_2} \lt( \pd[(e_2 \, u \, u)]{i} + \pd[(e_1 \, u \, v)]{j} \rt)
435            + \frac{1}{e_3} \pd[(w \, u)]{k} \\
436  &      & &+ \frac{1}{e_1 e_2} \lt[ - u \lt( \pd[(e_1 v)]{j} - v \, \pd[e_1]{j} \rt)
437                                  - u \pd[(e_2 u)]{i}                              \rt]
438            - \frac{1}{e_3} \pd[w]{k} u \\
439  &      & &+ \frac{1}{e_1 e_2} \lt( - v^2 \pd[e_2]{i} \rt) \\
440  &      &= &\nabla \cdot (\vect U \, u) - (\nabla \cdot \vect U) \ u
441            + \frac{1}{e_1 e_2} \lt( -v^2 \pd[e_2]{i} + u v \, \pd[e_1]{j} \rt) \\
442  \intertext{as $\nabla \cdot {\vect U} \; = 0$ (incompressibility) it becomes:}
443  &      &= &\, \nabla \cdot (\vect U \, u) + \frac{1}{e_1 e_2} \lt( v \; \pd[e_2]{i} - u \; \pd[e_1]{j} \rt) (-v)
444\end{alignat*}
445
446The flux form of the momentum advection term is therefore given by:
447\begin{equation}
448  \label{eq:MB_flux_form}
449  NLT =   \nabla \cdot \lt(
450    \begin{array}{*{20}c}
451                            \vect U \, u \\
452                            \vect U \, v
453    \end{array}
454                                         \rt)
455        + \frac{1}{e_1 e_2} \lt( v \pd[e_2]{i} - u \pd[e_1]{j} \rt) \vect k \times \vect U_h
456\end{equation}
457
458The flux form has two terms,
459the first one is expressed as the divergence of momentum fluxes (hence the flux form name given to this formulation)
460and the second one is due to the curvilinear nature of the coordinate system used.
461The latter is called the \textit{metric} term and can be viewed as a modification of the Coriolis parameter:
462$463 % \label{eq:MB_cor+metric} 464 f \to f + \frac{1}{e_1 e_2} \lt( v \pd[e_2]{i} - u \pd[e_1]{j} \rt) 465$
466
467Note that in the case of geographical coordinate,
468\ie\ when $(i,j) \to (\lambda,\varphi)$ and $(e_1,e_2) \to (a \, \cos \varphi,a)$,
469we recover the commonly used modification of the Coriolis parameter $f \to f + (u / a) \tan \varphi$.
470
471To sum up, the curvilinear $z$-coordinate equations solved by the ocean model can be written in
472the following tensorial formalism:
473
474\begin{itemize}
475\item \textbf{Vector invariant form of the momentum equations}:
476  \begin{equation}
477    \label{eq:MB_dyn_vect}
478    \begin{split}
479    % \label{eq:MB_dyn_vect_u}
480      \pd[u]{t} = &+ (\zeta + f) \, v - \frac{1}{2 e_1} \pd[]{i} (u^2 + v^2)
481                   - \frac{1}{e_3} w \pd[u]{k} - \frac{1}{e_1} \pd[]{i} \lt( \frac{p_s + p_h}{\rho_o} \rt) \\
482                  &+ D_u^{\vect U} + F_u^{\vect U} \\
483      \pd[v]{t} = &- (\zeta + f) \, u - \frac{1}{2 e_2} \pd[]{j} (u^2 + v^2)
484                   - \frac{1}{e_3} w \pd[v]{k} - \frac{1}{e_2} \pd[]{j} \lt( \frac{p_s + p_h}{\rho_o} \rt) \\
485                  &+ D_v^{\vect U} + F_v^{\vect U}
486    \end{split}
487  \end{equation}
488\item \textbf{flux form of the momentum equations}:
489  % \label{eq:MB_dyn_flux}
490  \begin{multline*}
491    % \label{eq:MB_dyn_flux_u}
492    \pd[u]{t} = + \lt[ f + \frac{1}{e_1 \; e_2} \lt( v \pd[e_2]{i} - u \pd[e_1]{j} \rt) \rt] \, v \\
493                - \frac{1}{e_1 \; e_2} \lt( \pd[(e_2 \, u \, u)]{i} + \pd[(e_1 \, v \, u)]{j} \rt) \\
494                - \frac{1}{e_3} \pd[(w \, u)]{k} - \frac{1}{e_1} \pd[]{i} \lt( \frac{p_s + p_h}{\rho_o} \rt)
495                + D_u^{\vect U} + F_u^{\vect U}
496  \end{multline*}
497  \begin{multline*}
498    % \label{eq:MB_dyn_flux_v}
499    \pd[v]{t} = - \lt[ f + \frac{1}{e_1 \; e_2} \lt( v \pd[e_2]{i} - u \pd[e_1]{j} \rt) \rt] \, u \\
500                - \frac{1}{e_1 \; e_2} \lt( \pd[(e_2 \, u \, v)]{i} + \pd[(e_1 \, v \, v)]{j} \rt) \\
501                - \frac{1}{e_3} \pd[(w \, v)]{k} - \frac{1}{e_2} \pd[]{j} \lt( \frac{p_s + p_h}{\rho_o} \rt)
502                + D_v^{\vect U} + F_v^{\vect U}
503  \end{multline*}
504  where $\zeta$, the relative vorticity, is given by \autoref{eq:MB_curl_Uh} and $p_s$, the surface pressure,
505  is given by:
506  $507 % \label{eq:MB_spg} 508 p_s = \rho \,g \, \eta 509$
510  and $\eta$ is the solution of \autoref{eq:MB_ssh}.
511
512  The vertical velocity and the hydrostatic pressure are diagnosed from the following equations:
513  $514 % \label{eq:MB_w_diag} 515 \pd[w]{k} = - \chi \; e_3 \qquad 516 % \label{eq:MB_hp_diag} 517 \pd[p_h]{k} = - \rho \; g \; e_3 518$
519  where the divergence of the horizontal velocity, $\chi$ is given by \autoref{eq:MB_div_Uh}.
520
521\item \textbf{tracer equations}:
522  \begin{equation}
523  \begin{split}
524    \pd[T]{t} = & - \frac{1}{e_1 e_2} \lt[ \pd[(e_2 T \, u)]{i} + \pd[(e_1 T \, v)]{j} \rt]
525                - \frac{1}{e_3} \pd[(T \, w)]{k} + D^T + F^T \\
526    \pd[S]{t} = & - \frac{1}{e_1 e_2} \lt[ \pd[(e_2 S \, u)]{i} + \pd[(e_1 S \, v)]{j} \rt]
527                - \frac{1}{e_3} \pd[(S \, w)]{k} + D^S + F^S \\
528    \rho = & \rho \big( T,S,z(k) \big)
529  \end{split}
530  \end{equation}
531\end{itemize}
532
533The expression of $\vect D^{U}$, $D^{S}$ and $D^{T}$ depends on the subgrid scale parameterisation used.
534It will be defined in \autoref{eq:MB_zdf}.
535The nature and formulation of $\vect F^{\vect U}$, $F^T$ and $F^S$, the surface forcing terms,
536are discussed in \autoref{chap:SBC}.
537
538%% =================================================================================================
539\section{Curvilinear generalised vertical coordinate system}
540\label{sec:MB_gco}
541
542The ocean domain presents a huge diversity of situation in the vertical.
543First the ocean surface is a time dependent surface (moving surface).
544Second the ocean floor depends on the geographical position,
545varying from more than 6,000 meters in abyssal trenches to zero at the coast.
546Last but not least, the ocean stratification exerts a strong barrier to vertical motions and mixing.
547Therefore, in order to represent the ocean with respect to
548the first point a space and time dependent vertical coordinate that follows the variation of the sea surface height
549\eg\ an \zstar-coordinate;
550for the second point, a space variation to fit the change of bottom topography
551\eg\ a terrain-following or $\sigma$-coordinate;
552and for the third point, one will be tempted to use a space and time dependent coordinate that
553follows the isopycnal surfaces, \eg\ an isopycnic coordinate.
554
555In order to satisfy two or more constraints one can even be tempted to mixed these coordinate systems, as in
556HYCOM (mixture of $z$-coordinate at the surface, isopycnic coordinate in the ocean interior and $\sigma$ at
557the ocean bottom) \citep{chassignet.smith.ea_JPO03} or
558OPA (mixture of $z$-coordinate in vicinity the surface and steep topography areas and $\sigma$-coordinate elsewhere)
560
561In fact one is totally free to choose any space and time vertical coordinate by
562introducing an arbitrary vertical coordinate :
563\begin{equation}
564  \label{eq:MB_s}
565  s = s(i,j,k,t)
566\end{equation}
567with the restriction that the above equation gives a single-valued monotonic relationship between $s$ and $k$,
568when $i$, $j$ and $t$ are held fixed.
569\autoref{eq:MB_s} is a transformation from the $(i,j,k,t)$ coordinate system with independent variables into
570the $(i,j,s,t)$ generalised coordinate system with $s$ depending on the other three variables through
571\autoref{eq:MB_s}.
572This so-called \textit{generalised vertical coordinate} \citep{kasahara_MWR74} is in fact
573an Arbitrary Lagrangian--Eulerian (ALE) coordinate.
574Indeed, one has a great deal of freedom in the choice of expression for $s$. The choice determines
575which part of the vertical velocity (defined from a fixed referential) will cross the levels (Eulerian part) and
576which part will be used to move them (Lagrangian part).
577The coordinate is also sometime referenced as an adaptive coordinate \citep{hofmeister.burchard.ea_OM10},
578since the coordinate system is adapted in the course of the simulation.
579Its most often used implementation is via an ALE algorithm,
580in which a pure lagrangian step is followed by regridding and remapping steps,
581the latter step implicitly embedding the vertical advection
583Here we follow the \citep{kasahara_MWR74} strategy:
584a regridding step (an update of the vertical coordinate) followed by an Eulerian step with
585an explicit computation of vertical advection relative to the moving s-surfaces.
586
587%\gmcomment{
588%A key point here is that the $s$-coordinate depends on $(i,j)$ ==> horizontal pressure gradient...
589The generalized vertical coordinates used in ocean modelling are not orthogonal,
590which contrasts with many other applications in mathematical physics.
591Hence, it is useful to keep in mind the following properties that may seem odd on initial encounter.
592
593The horizontal velocity in ocean models measures motions in the horizontal plane,
594perpendicular to the local gravitational field.
595That is, horizontal velocity is mathematically the same regardless of the vertical coordinate, be it geopotential,
596isopycnal, pressure, or terrain following.
597The key motivation for maintaining the same horizontal velocity component is that
598the hydrostatic and geostrophic balances are dominant in the large-scale ocean.
599Use of an alternative quasi -horizontal velocity, for example one oriented parallel to the generalized surface,
600would lead to unacceptable numerical errors.
601Correspondingly, the vertical direction is anti -parallel to the gravitational force in
602all of the coordinate systems.
603We do not choose the alternative of a quasi -vertical direction oriented normal to
604the surface of a constant generalized vertical coordinate.
605
606It is the method used to measure transport across the generalized vertical coordinate surfaces which differs between
607the vertical coordinate choices.
608That is, computation of the dia-surface velocity component represents the fundamental distinction between
609the various coordinates.
610In some models, such as geopotential, pressure, and terrain following, this transport is typically diagnosed from
611volume or mass conservation.
612In other models, such as isopycnal layered models, this transport is prescribed based on assumptions about
613the physical processes producing a flux across the layer interfaces.
614
615In this section we first establish the PE in the generalised vertical $s$-coordinate,
616then we discuss the particular cases available in \NEMO, namely $z$, \zstar, $s$, and \ztilde.
617%}
618
619%% =================================================================================================
620\subsection{\textit{S}-coordinate formulation}
621
622Starting from the set of equations established in \autoref{sec:MB_zco} for the special case $k = z$ and
623thus $e_3 = 1$, we introduce an arbitrary vertical coordinate $s = s(i,j,k,t)$,
624which includes $z$-, \zstar- and $\sigma$-coordinates as special cases
625($s = z$, $s = \zstar$, and $s = \sigma = z / H$ or $= z / \lt( H + \eta \rt)$, resp.).
626A formal derivation of the transformed equations is given in \autoref{apdx:SCOORD}.
627Let us define the vertical scale factor by $e_3 = \partial_s z$  ($e_3$ is now a function of $(i,j,k,t)$ ),
628and the slopes in the $(i,j)$ directions between $s$- and $z$-surfaces by:
629\begin{equation}
630  \label{eq:MB_sco_slope}
632  \sigma_2 = \frac{1}{e_2} \; \lt. \pd[z]{j} \rt|_s
633\end{equation}
634We also introduce $\omega$, a dia-surface velocity component, defined as the velocity
635relative to the moving $s$-surfaces and normal to them:
636$637 % \label{eq:MB_sco_w} 638 \omega = w - \, \lt. \pd[z]{t} \rt|_s - \sigma_1 \, u - \sigma_2 \, v 639$
640
641The equations solved by the ocean model \autoref{eq:MB_PE} in $s$-coordinate can be written as follows
642(see \autoref{sec:SCOORD_momentum}):
643
644\begin{itemize}
645\item \textbf{Vector invariant form of the momentum equation}:
646  \begin{multline*}
647  % \label{eq:MB_sco_u_vector}
648    \pd[u]{t} = + (\zeta + f) \, v - \frac{1}{2 \, e_1} \pd[]{i} (u^2 + v^2) - \frac{1}{e_3} \omega \pd[u]{k} \\
649                - \frac{1}{e_1} \pd[]{i} \lt( \frac{p_s + p_h}{\rho_o} \rt) - g \frac{\rho}{\rho_o} \sigma_1
650                + D_u^{\vect U} + F_u^{\vect U}
651  \end{multline*}
652  \begin{multline*}
653  % \label{eq:MB_sco_v_vector}
654    \pd[v]{t} = - (\zeta + f) \, u - \frac{1}{2 \, e_2} \pd[]{j}(u^2 + v^2) - \frac{1}{e_3} \omega \pd[v]{k} \\
655                - \frac{1}{e_2} \pd[]{j} \lt( \frac{p_s + p_h}{\rho_o} \rt) - g \frac{\rho}{\rho_o} \sigma_2
656                + D_v^{\vect U} + F_v^{\vect U}
657  \end{multline*}
658\item \textbf{Flux form of the momentum equation}:
659  \begin{multline*}
660  % \label{eq:MB_sco_u_flux}
661    \frac{1}{e_3} \pd[(e_3 \, u)]{t} = + \lt[ f + \frac{1}{e_1 \; e_2} \lt( v \pd[e_2]{i} - u \pd[e_1]{j} \rt) \rt] \, v \\
662                                       - \frac{1}{e_1 \; e_2 \; e_3} \lt( \pd[(e_2 \, e_3 \, u \, u)]{i} + \pd[(e_1 \, e_3 \, v \, u)]{j} \rt) \\
663                                       - \frac{1}{e_3} \pd[(\omega \, u)]{k}
664                                       - \frac{1}{e_1} \pd[]{i} \lt( \frac{p_s + p_h}{\rho_o} \rt)
665                                       - g \frac{\rho}{\rho_o} \sigma_1 + D_u^{\vect U} + F_u^{\vect U}
666  \end{multline*}
667  \begin{multline*}
668  % \label{eq:MB_sco_v_flux}
669    \frac{1}{e_3} \pd[(e_3 \, v)]{t} = - \lt[ f + \frac{1}{e_1 \; e_2} \lt( v \pd[e_2]{i} - u \pd[e_1]{j} \rt) \rt] \, u \\
670                                       - \frac{1}{e_1 \; e_2 \; e_3} \lt( \pd[( e_2 \; e_3 \, u \, v)]{i} + \pd[(e_1 \; e_3 \, v \, v)]{j} \rt) \\
671                                       - \frac{1}{e_3} \pd[(\omega \, v)]{k}
672                                       - \frac{1}{e_2} \pd[]{j} \lt( \frac{p_s + p_h}{\rho_o} \rt)
673                                       - g \frac{\rho}{\rho_o}\sigma_2 + D_v^{\vect U} + F_v^{\vect U}
674  \end{multline*}
675  where the relative vorticity, $\zeta$, the surface pressure gradient,
676  and the hydrostatic pressure have the same expressions as in $z$-coordinates although
677  they do not represent exactly the same quantities.
678  $\omega$ is provided by the continuity equation (see \autoref{apdx:SCOORD}):
679  $680 % \label{eq:MB_sco_continuity} 681 \pd[e_3]{t} + e_3 \; \chi + \pd[\omega]{s} = 0 \quad \text{with} \quad 682 \chi = \frac{1}{e_1 e_2 e_3} \lt( \pd[(e_2 e_3 \, u)]{i} + \pd[(e_1 e_3 \, v)]{j} \rt) 683$
684\item \textit{tracer equations}:
685  \begin{multline*}
686  % \label{eq:MB_sco_t}
687    \frac{1}{e_3} \pd[(e_3 \, T)]{t} = - \frac{1}{e_1 e_2 e_3} \lt(   \pd[(e_2 e_3 \, u \, T)]{i}
688                                                                    + \pd[(e_1 e_3 \, v \, T)]{j} \rt) \\
689                                       - \frac{1}{e_3} \pd[(T \, \omega)]{k} + D^T + F^S
690  \end{multline*}
691  \begin{multline}
692  % \label{eq:MB_sco_s}
693    \frac{1}{e_3} \pd[(e_3 \, S)]{t} = - \frac{1}{e_1 e_2 e_3} \lt(   \pd[(e_2 e_3 \, u \, S)]{i}
694                                                                    + \pd[(e_1 e_3 \, v \, S)]{j} \rt) \\
695                                       - \frac{1}{e_3} \pd[(S \, \omega)]{k} + D^S + F^S
696  \end{multline}
697\end{itemize}
698The equation of state has the same expression as in $z$-coordinate,
699and similar expressions are used for mixing and forcing terms.
700
701\gmcomment{
702  \colorbox{yellow}{ to be updated $= = >$}
703  Add a few works on z and zps and s and underlies the differences between all of them
704  \colorbox{yellow}{$< = =$ end update}
705}
706
707%% =================================================================================================
708\subsection{Curvilinear \zstar-coordinate system}
709\label{subsec:MB_zco_star}
710
711\begin{figure}[!b]
712  \centering
713  \includegraphics[width=0.66\textwidth]{Fig_z_zstar}
714  \caption[Curvilinear z-coordinate systems (\{non-\}linear free-surface cases and re-scaled \zstar)]{
715    (a) $z$-coordinate in linear free-surface case ;
716    (b) $z$-coordinate in non-linear free surface case ;
717    (c) re-scaled height coordinate
718    (become popular as the \zstar-coordinate \citep{adcroft.campin_OM04}).}
719  \label{fig:MB_z_zstar}
720\end{figure}
721
722In this case, the free surface equation is nonlinear, and the variations of volume are fully taken into account.
723These coordinates systems is presented in a report \citep{levier.treguier.ea_rpt07} available on the \NEMO\ web site.
724
725The \zstar coordinate approach is an unapproximated, non-linear free surface implementation which allows one to
726deal with large amplitude free-surface variations relative to the vertical resolution \citep{adcroft.campin_OM04}.
727In the \zstar formulation,
728the variation of the column thickness due to sea-surface undulations is not concentrated in the surface level,
729as in the $z$-coordinate formulation, but is equally distributed over the full water column.
730Thus vertical levels naturally follow sea-surface variations, with a linear attenuation with depth,
731as illustrated by \autoref{fig:MB_z_zstar}.
732Note that with a flat bottom, such as in \autoref{fig:MB_z_zstar}, the bottom-following $z$ coordinate and \zstar are equivalent.
733The definition and modified oceanic equations for the rescaled vertical coordinate \zstar,
734including the treatment of fresh-water flux at the surface, are detailed in Adcroft and Campin (2004).
735The major points are summarized here.
736The position (\zstar) and vertical discretization (\zstar) are expressed as:
737$738 % \label{eq:MB_z-star} 739 H + \zstar = (H + z) / r \quad \text{and} \quad \delta \zstar 740 = \delta z / r \quad \text{with} \quad r 741 = \frac{H + \eta}{H} . 742$
743Simple re-organisation of the above expressions gives
744$745 % \label{eq:MB_zstar_2} 746 \zstar = H \lt( \frac{z - \eta}{H + \eta} \rt) . 747$
748Since the vertical displacement of the free surface is incorporated in the vertical coordinate \zstar,
749the upper and lower boundaries are at fixed  \zstar position,
750$\zstar = 0$ and $\zstar = -H$ respectively.
751Also the divergence of the flow field is no longer zero as shown by the continuity equation:
752$753 \pd[r]{t} = \nabla_{\zstar} \cdot \lt( r \; \vect U_h \rt) + \pd[r \; w^*]{\zstar} = 0 . 754$
755This \zstar coordinate is closely related to the "eta" coordinate used in many atmospheric models
756(see Black (1994) for a review of eta coordinate atmospheric models).
757It was originally used in ocean models by Stacey et al. (1995) for studies of tides next to shelves,
758and it has been recently promoted by Adcroft and Campin (2004) for global climate modelling.
759
760The surfaces of constant \zstar are quasi -horizontal.
761Indeed, the \zstar coordinate reduces to $z$ when $\eta$ is zero.
762In general, when noting the large differences between
763undulations of the bottom topography versus undulations in the surface height,
764it is clear that surfaces constant \zstar are very similar to the depth surfaces.
765These properties greatly reduce difficulties of computing the horizontal pressure gradient relative to
766terrain following sigma models discussed in \autoref{subsec:MB_sco}.
767Additionally, since $\zstar = z$ when $\eta = 0$,
768no flow is spontaneously generated in an unforced ocean starting from rest, regardless the bottom topography.
769This behaviour is in contrast to the case with "s"-models, where pressure gradient errors in the presence of
770nontrivial topographic variations can generate nontrivial spontaneous flow from a resting state,
771depending on the sophistication of the pressure gradient solver.
772The quasi -horizontal nature of the coordinate surfaces also facilitates the implementation of
773neutral physics parameterizations in \zstar  models using the same techniques as in $z$-models
774(see Chapters 13-16 of \cite{griffies_bk04}) for a discussion of neutral physics in $z$-models,
775as well as \autoref{sec:LDF_slp} in this document for treatment in \NEMO).
776
777The range over which \zstar  varies is time independent $-H \leq \zstar \leq 0$.
778Hence, all cells remain nonvanishing, so long as the surface height maintains $\eta > -H$.
779This is a minor constraint relative to that encountered on the surface height when using $s = z$ or $s = z - \eta$.
780
781Because \zstar  has a time independent range, all grid cells have static increments ds,
782and the sum of the vertical increments yields the time independent ocean depth. %k ds = H.
783The \zstar coordinate is therefore invisible to undulations of the free surface,
784since it moves along with the free surface.
785This property means that no spurious vertical transport is induced across surfaces of constant \zstar  by
786the motion of external gravity waves.
787Such spurious transport can be a problem in z-models, especially those with tidal forcing.
788Quite generally, the time independent range for the \zstar  coordinate is a very convenient property that
789allows for a nearly arbitrary vertical resolution even in the presence of large amplitude fluctuations of
790the surface height, again so long as $\eta > -H$.
791%end MOM doc %%%
792
793%% =================================================================================================
794\subsection{Curvilinear terrain-following \textit{s}--coordinate}
795\label{subsec:MB_sco}
796
797%% =================================================================================================
798\subsubsection{Introduction}
799
800Several important aspects of the ocean circulation are influenced by bottom topography.
801Of course, the most important is that bottom topography determines deep ocean sub-basins, barriers, sills and
802channels that strongly constrain the path of water masses, but more subtle effects exist.
803For example, the topographic $\beta$-effect is usually larger than the planetary one along continental slopes.
804Topographic Rossby waves can be excited and can interact with the mean current.
805In the $z$-coordinate system presented in the previous section (\autoref{sec:MB_zco}),
806$z$-surfaces are geopotential surfaces.
807The bottom topography is discretised by steps.
808This often leads to a misrepresentation of a gradually sloping bottom and to
809large localized depth gradients associated with large localized vertical velocities.
810The response to such a velocity field often leads to numerical dispersion effects.
811One solution to strongly reduce this error is to use a partial step representation of bottom topography instead of
813Another solution is to introduce a terrain-following coordinate system (hereafter $s$-coordinate).
814
815The $s$-coordinate avoids the discretisation error in the depth field since the layers of
817Relatively small topographic features as well as  gentle, large-scale slopes of the sea floor in the deep ocean,
818which would be ignored in typical $z$-model applications with the largest grid spacing at greatest depths,
819can easily be represented (with relatively low vertical resolution).
820A terrain-following model (hereafter $s$-model) also facilitates the modelling of the boundary layer flows over
821a large depth range, which in the framework of the $z$-model would require high vertical resolution over
822the whole depth range.
823Moreover, with a $s$-coordinate it is possible, at least in principle, to have the bottom and the sea surface as
824the only boundaries of the domain (no more lateral boundary condition to specify).
825Nevertheless, a $s$-coordinate also has its drawbacks. Perfectly adapted to a homogeneous ocean,
826it has strong limitations as soon as stratification is introduced.
827The main two problems come from the truncation error in the horizontal pressure gradient and
828a possibly increased diapycnal diffusion.
829The horizontal pressure force in $s$-coordinate consists of two terms (see \autoref{apdx:SCOORD}),
830
831\begin{equation}
832  \label{eq:MB_p_sco}
833  \nabla p |_z = \nabla p |_s - \frac{1}{e_3} \pd[p]{s} \nabla z |_s
834\end{equation}
835
836The second term in \autoref{eq:MB_p_sco} depends on the tilt of the coordinate surface and
837leads to a truncation error that is not present in a $z$-model.
838In the special case of a $\sigma$-coordinate (i.e. a depth-normalised coordinate system $\sigma = z/H$),
839\citet{haney_JPO91} and \citet{beckmann.haidvogel_JPO93} have given estimates of the magnitude of this truncation error.
840It depends on topographic slope, stratification, horizontal and vertical resolution, the equation of state,
841and the finite difference scheme.
842This error limits the possible topographic slopes that a model can handle at
843a given horizontal and vertical resolution.
844This is a severe restriction for large-scale applications using realistic bottom topography.
845The large-scale slopes require high horizontal resolution, and the computational cost becomes prohibitive.
846This problem can be at least partially overcome by mixing $s$-coordinate and
847step-like representation of bottom topography \citep{gerdes_JGR93*a,gerdes_JGR93*b,madec.delecluse.ea_JPO96}.
848However, the definition of the model domain vertical coordinate becomes then a non-trivial thing for
849a realistic bottom topography:
850an envelope topography is defined in $s$-coordinate on which a full or
851partial step bottom topography is then applied in order to adjust the model depth to the observed one
852(see \autoref{subsec:DOM_zgr}.
853
854For numerical reasons a minimum of diffusion is required along the coordinate surfaces of
855any finite difference model.
856It causes spurious diapycnal mixing when coordinate surfaces do not coincide with isoneutral surfaces.
857This is the case for a $z$-model as well as for a $s$-model.
858However, density varies more strongly on $s$-surfaces than on horizontal surfaces in regions of
859large topographic slopes, implying larger diapycnal diffusion in a $s$-model than in a $z$-model.
860Whereas such a diapycnal diffusion in a $z$-model tends to weaken horizontal density (pressure) gradients and thus
861the horizontal circulation, it usually reinforces these gradients in a $s$-model, creating spurious circulation.
862For example, imagine an isolated bump of topography in an ocean at rest with a horizontally uniform stratification.
863Spurious diffusion along $s$-surfaces will induce a bump of isoneutral surfaces over the topography,
864and thus will generate there a baroclinic eddy.
865In contrast, the ocean will stay at rest in a $z$-model.
866As for the truncation error, the problem can be reduced by introducing the terrain-following coordinate below
867the strongly stratified portion of the water column (\ie\ the main thermocline) \citep{madec.delecluse.ea_JPO96}.
868An alternate solution consists of rotating the lateral diffusive tensor to geopotential or to isoneutral surfaces
869(see \autoref{subsec:MB_ldf}).
870Unfortunately, the slope of isoneutral surfaces relative to the $s$-surfaces can very large,
871strongly exceeding the stability limit of such a operator when it is discretized (see \autoref{chap:LDF}).
872
873The $s$-coordinates introduced here \citep{lott.madec.ea_OM90,madec.delecluse.ea_JPO96} differ mainly in two aspects from
874similar models:
875it allows a representation of bottom topography with mixed full or partial step-like/terrain following topography;
876It also offers a completely general transformation, $s=s(i,j,z)$ for the vertical coordinate.
877
878%% =================================================================================================
879\subsection{\texorpdfstring{Curvilinear \ztilde-coordinate}{}}
880\label{subsec:MB_zco_tilde}
881
882The \ztilde -coordinate has been developed by \citet{leclair.madec_OM11}.
883It is available in \NEMO\ since the version 3.4 and is more robust in version 4.0 than previously.
884Nevertheless, it is currently not robust enough to be used in all possible configurations.
885Its use is therefore not recommended.
886
887%% =================================================================================================
888\section{Subgrid scale physics}
889\label{sec:MB_zdf_ldf}
890
891The hydrostatic primitive equations describe the behaviour of a geophysical fluid at space and time scales larger than
892a few kilometres in the horizontal, a few meters in the vertical and a few minutes.
893They are usually solved at larger scales: the specified grid spacing and time step of the numerical model.
894The effects of smaller scale motions (coming from the advective terms in the Navier-Stokes equations)
895must be represented entirely in terms of large-scale patterns to close the equations.
896These effects appear in the equations as the divergence of turbulent fluxes
897(\ie\ fluxes associated with the mean correlation of small scale perturbations).
898Assuming a turbulent closure hypothesis is equivalent to choose a formulation for these fluxes.
899It is usually called the subgrid scale physics.
900It must be emphasized that this is the weakest part of the primitive equations,
901but also one of the most important for long-term simulations as
902small scale processes \textit{in fine} balance the surface input of kinetic energy and heat.
903
904The control exerted by gravity on the flow induces a strong anisotropy between the lateral and vertical motions.
905Therefore subgrid-scale physics \textbf{D}$^{\vect U}$, $D^{S}$ and $D^{T}$  in
906\autoref{eq:MB_PE_dyn}, \autoref{eq:MB_PE_tra_T} and \autoref{eq:MB_PE_tra_S} are divided into
907a lateral part \textbf{D}$^{l \vect U}$, $D^{l S}$ and $D^{l T}$ and
908a vertical part \textbf{D}$^{v \vect U}$, $D^{v S}$ and $D^{v T}$.
909The formulation of these terms and their underlying physics are briefly discussed in the next two subsections.
910
911%% =================================================================================================
912\subsection{Vertical subgrid scale physics}
913\label{subsec:MB_zdf}
914
915The model resolution is always larger than the scale at which the major sources of vertical turbulence occur
916(shear instability, internal wave breaking...).
917Turbulent motions are thus never explicitly solved, even partially, but always parameterized.
918The vertical turbulent fluxes are assumed to depend linearly on the gradients of large-scale quantities
919(for example, the turbulent heat flux is given by $\overline{T' w'} = -A^{v T} \partial_z \overline T$,
920where $A^{v T}$ is an eddy coefficient).
921This formulation is analogous to that of molecular diffusion and dissipation.
922This is quite clearly a necessary compromise: considering only the molecular viscosity acting on
923large scale severely underestimates the role of turbulent diffusion and dissipation,
924while an accurate consideration of the details of turbulent motions is simply impractical.
925The resulting vertical momentum and tracer diffusive operators are of second order:
926\begin{equation}
927  \label{eq:MB_zdf}
928  \begin{gathered}
929    \vect D^{v \vect U} = \pd[]{z} \lt( A^{vm} \pd[\vect U_h]{z} \rt) \ , \\
931          D^{vS}       = \pd[]{z} \lt( A^{vT} \pd[S]{z}         \rt)
932  \end{gathered}
933\end{equation}
934where $A^{vm}$ and $A^{vT}$ are the vertical eddy viscosity and diffusivity coefficients, respectively.
935At the sea surface and at the bottom, turbulent fluxes of momentum, heat and salt must be specified
936(see \autoref{chap:SBC} and \autoref{chap:ZDF} and \autoref{sec:TRA_bbl}).
937All the vertical physics is embedded in the specification of the eddy coefficients.
938They can be assumed to be either constant, or function of the local fluid properties
939(\eg\ Richardson number, Brunt-Vais\"{a}l\"{a} frequency, distance from the boundary ...),
940or computed from a turbulent closure model.
941The choices available in \NEMO\ are discussed in \autoref{chap:ZDF}).
942
943%% =================================================================================================
944\subsection{Formulation of the lateral diffusive and viscous operators}
945\label{subsec:MB_ldf}
946
947Lateral turbulence can be roughly divided into a mesoscale turbulence associated with eddies
948(which can be solved explicitly if the resolution is sufficient since
949their underlying physics are included in the primitive equations),
950and a sub mesoscale turbulence which is never explicitly solved even partially, but always parameterized.
951The formulation of lateral eddy fluxes depends on whether the mesoscale is below or above the grid-spacing
952(\ie\ the model is eddy-resolving or not).
953
954In non-eddy-resolving configurations, the closure is similar to that used for the vertical physics.
955The lateral turbulent fluxes are assumed to depend linearly on the lateral gradients of large-scale quantities.
956The resulting lateral diffusive and dissipative operators are of second order.
957Observations show that lateral mixing induced by mesoscale turbulence tends to be along isopycnal surfaces
958(or more precisely neutral surfaces \cite{mcdougall_JPO87}) rather than across them.
959As the slope of neutral surfaces is small in the ocean, a common approximation is to assume that
960the `lateral' direction is the horizontal, \ie\ the lateral mixing is performed along geopotential surfaces.
961This leads to a geopotential second order operator for lateral subgrid scale physics.
962This assumption can be relaxed: the eddy-induced turbulent fluxes can be better approached by assuming that
963they depend linearly on the gradients of large-scale quantities computed along neutral surfaces.
964In such a case, the diffusive operator is an isoneutral second order operator and
965it has components in the three space directions.
966However,
967both horizontal and isoneutral operators have no effect on mean (\ie\ large scale) potential energy whereas
968potential energy is a main source of turbulence (through baroclinic instabilities).
969\citet{gent.mcwilliams_JPO90} proposed a parameterisation of mesoscale eddy-induced turbulence which
970associates an eddy-induced velocity to the isoneutral diffusion.
971Its mean effect is to reduce the mean potential energy of the ocean.
972This leads to a formulation of lateral subgrid-scale physics made up of an isoneutral second order operator and
974In all these lateral diffusive formulations,
975the specification of the lateral eddy coefficients remains the problematic point as
976there is no really satisfactory formulation of these coefficients as a function of large-scale features.
977
978In eddy-resolving configurations, a second order operator can be used,
979but usually the more scale selective biharmonic operator is preferred as
980the grid-spacing is usually not small enough compared to the scale of the eddies.
981The role devoted to the subgrid-scale physics is to dissipate the energy that
982cascades toward the grid scale and thus to ensure the stability of the model while
983not interfering with the resolved mesoscale activity.
984Another approach is becoming more and more popular:
985instead of specifying explicitly a sub-grid scale term in the momentum and tracer time evolution equations,
986one uses an advective scheme which is diffusive enough to maintain the model stability.
987It must be emphasised that then, all the sub-grid scale physics is included in the formulation of
989
990All these parameterisations of subgrid scale physics have advantages and drawbacks.
991They are not all available in \NEMO. For active tracers (temperature and salinity) the main ones are:
992Laplacian and bilaplacian operators acting along geopotential or iso-neutral surfaces,
993\citet{gent.mcwilliams_JPO90} parameterisation, and various slightly diffusive advection schemes.
994For momentum, the main ones are: Laplacian and bilaplacian operators acting along geopotential surfaces,
995and UBS advection schemes when flux form is chosen for the momentum advection.
996
997%% =================================================================================================
998\subsubsection{Lateral laplacian tracer diffusive operator}
999
1000The lateral Laplacian tracer diffusive operator is defined by (see \autoref{apdx:DIFFOPERS}):
1001\begin{equation}
1002  \label{eq:MB_iso_tensor}
1003  D^{lT} = \nabla \vect . \lt( A^{lT} \; \Re \; \nabla T \rt) \quad \text{with} \quad
1004  \Re =
1005    \begin{pmatrix}
1006      1    & 0    & -r_1          \\
1007      0    & 1    & -r_2          \\
1008      -r_1 & -r_2 & r_1^2 + r_2^2 \\
1009    \end{pmatrix}
1010\end{equation}
1011where $r_1$ and $r_2$ are the slopes between the surface along which the diffusive operator acts and
1012the model level (\eg\ $z$- or $s$-surfaces).
1013Note that the formulation \autoref{eq:MB_iso_tensor} is exact for
1014the rotation between geopotential and $s$-surfaces,
1015while it is only an approximation for the rotation between isoneutral and $z$- or $s$-surfaces.
1016Indeed, in the latter case, two assumptions are made to simplify \autoref{eq:MB_iso_tensor} \citep{cox_OM87}.
1017First, the horizontal contribution of the dianeutral mixing is neglected since the ratio between iso and
1018dia-neutral diffusive coefficients is known to be several orders of magnitude smaller than unity.
1019Second, the two isoneutral directions of diffusion are assumed to be independent since
1020the slopes are generally less than $10^{-2}$ in the ocean (see \autoref{apdx:DIFFOPERS}).
1021
1022For \textit{iso-level} diffusion, $r_1$ and $r_2$ are zero.
1023$\Re$ reduces to the identity in the horizontal direction, no rotation is applied.
1024
1025For \textit{geopotential} diffusion,
1026$r_1$ and $r_2$ are the slopes between the geopotential and computational surfaces:
1027they are equal to $\sigma_1$ and $\sigma_2$, respectively (see \autoref{eq:MB_sco_slope}).
1028
1029For \textit{isoneutral} diffusion $r_1$ and $r_2$ are the slopes between the isoneutral and computational surfaces.
1030Therefore, they are different quantities, but have similar expressions in $z$- and $s$-coordinates.
1031In $z$-coordinates:
1032\begin{equation}
1033  \label{eq:MB_iso_slopes}
1034  r_1 = \frac{e_3}{e_1} \lt( \pd[\rho]{i} \rt) \lt( \pd[\rho]{k} \rt)^{-1} \quad
1035  r_2 = \frac{e_3}{e_2} \lt( \pd[\rho]{j} \rt) \lt( \pd[\rho]{k} \rt)^{-1}
1036\end{equation}
1037while in $s$-coordinates $\pd[]{k}$ is replaced by $\pd[]{s}$.
1038
1039%% =================================================================================================
1040\subsubsection{Eddy induced velocity}
1041
1042When the \textit{eddy induced velocity} parametrisation (eiv) \citep{gent.mcwilliams_JPO90} is used,
1043an additional tracer advection is introduced in combination with the isoneutral diffusion of tracers:
1044$1045 % \label{eq:MB_iso+eiv} 1046 D^{lT} = \nabla \cdot \lt( A^{lT} \; \Re \; \nabla T \rt) + \nabla \cdot \lt( \vect U^\ast \, T \rt) 1047$
1048where $\vect U^\ast = \lt( u^\ast,v^\ast,w^\ast \rt)$ is a non-divergent,
1049eddy-induced transport velocity. This velocity field is defined by:
1050\begin{gather}
1051  % \label{eq:MB_eiv}
1052  u^\ast =   \frac{1}{e_3}            \pd[]{k} \lt( A^{eiv} \;        \tilde{r}_1 \rt) \\
1053  v^\ast =   \frac{1}{e_3}            \pd[]{k} \lt( A^{eiv} \;        \tilde{r}_2 \rt) \\
1054  w^\ast = - \frac{1}{e_1 e_2} \lt[   \pd[]{i} \lt( A^{eiv} \; e_2 \, \tilde{r}_1 \rt)
1055                                     + \pd[]{j} \lt( A^{eiv} \; e_1 \, \tilde{r}_2 \rt) \rt]
1056\end{gather}
1057where $A^{eiv}$ is the eddy induced velocity coefficient
1058(or equivalently the isoneutral thickness diffusivity coefficient),
1059and $\tilde r_1$ and $\tilde r_2$ are the slopes between isoneutral and \textit{geopotential} surfaces.
1060Their values are thus independent of the vertical coordinate, but their expression depends on the coordinate:
1061\begin{align}
1062  \label{eq:MB_slopes_eiv}
1063  \tilde{r}_n =
1064    \begin{cases}
1065      r_n            & \text{in $z$-coordinate}                \\
1066      r_n + \sigma_n & \text{in \zstar- and $s$-coordinates}
1067    \end{cases}
1068  \quad \text{where~} n = 1, 2
1069\end{align}
1070
1071The normal component of the eddy induced velocity is zero at all the boundaries.
1072This can be achieved in a model by tapering either the eddy coefficient or the slopes to zero in the vicinity of
1073the boundaries.
1074The latter strategy is used in \NEMO\ (cf. \autoref{chap:LDF}).
1075
1076%% =================================================================================================
1077\subsubsection{Lateral bilaplacian tracer diffusive operator}
1078
1079The lateral bilaplacian tracer diffusive operator is defined by:
1080$1081 % \label{eq:MB_bilapT} 1082 D^{lT}= - \Delta \; (\Delta T) \quad \text{where} \quad 1083 \Delta \bullet = \nabla \lt( \sqrt{B^{lT}} \; \Re \; \nabla \bullet \rt) 1084$
1085It is the Laplacian operator given by \autoref{eq:MB_iso_tensor} applied twice with
1086the harmonic eddy diffusion coefficient set to the square root of the biharmonic one.
1087
1088%% =================================================================================================
1089\subsubsection{Lateral Laplacian momentum diffusive operator}
1090
1091The Laplacian momentum diffusive operator along $z$- or $s$-surfaces is found by
1092applying \autoref{eq:MB_lap_vector} to the horizontal velocity vector (see \autoref{apdx:DIFFOPERS}):
1093\begin{align*}
1094  % \label{eq:MB_lapU}
1095  \vect D^{l \vect U} &=   \nabla_h        \big( A^{lm}    \chi             \big)
1096                         - \nabla_h \times \big( A^{lm} \, \zeta \; \vect k \big) \\
1097                      &= \lt(   \frac{1}{e_1}     \pd[ \lt( A^{lm}    \chi      \rt) ]{i} \rt.
1098                              - \frac{1}{e_2 e_3} \pd[ \lt( A^{lm} \; e_3 \zeta \rt) ]{j} ,
1099                                \frac{1}{e_2}     \pd[ \lt( A^{lm}    \chi      \rt) ]{j}
1100                         \lt. + \frac{1}{e_1 e_3} \pd[ \lt( A^{lm} \; e_3 \zeta \rt) ]{i} \rt)
1101\end{align*}
1102
1103Such a formulation ensures a complete separation between the vorticity and horizontal divergence fields
1104(see \autoref{apdx:INVARIANTS}).
1105Unfortunately, it is only available in \textit{iso-level} direction.
1106When a rotation is required
1107(\ie\ geopotential diffusion in $s$-coordinates or isoneutral diffusion in both $z$- and $s$-coordinates),
1108the $u$ and $v$-fields are considered as independent scalar fields, so that the diffusive operator is given by:
1109\begin{gather*}
1110  % \label{eq:MB_lapU_iso}
1111    D_u^{l \vect U} = \nabla . \lt( A^{lm} \; \Re \; \nabla u \rt) \\
1112    D_v^{l \vect U} = \nabla . \lt( A^{lm} \; \Re \; \nabla v \rt)
1113\end{gather*}
1114where $\Re$ is given by \autoref{eq:MB_iso_tensor}.
1115It is the same expression as those used for diffusive operator on tracers.
1116It must be emphasised that such a formulation is only exact in a Cartesian coordinate system,
1117\ie\ on a $f$- or $\beta$-plane, not on the sphere.
1118It is also a very good approximation in vicinity of the Equator in