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

source: NEMO/trunk/doc/latex/NEMO/subfiles/chap_TRA.tex @ 11597

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

Continuation of coding rules application
Recovery of some sections deleted by the previous commit

File size: 80.7 KB
Line 
1\documentclass[../main/NEMO_manual]{subfiles}
2
3\begin{document}
4\chapter{Ocean Tracers (TRA)}
5\label{chap:TRA}
6
7\chaptertoc
8
9% missing/update
10% traqsr: need to coordinate with SBC module
11
12%STEVEN :  is the use of the word "positive" to describe a scheme enough, or should it be "positive definite"?
13%I added a comment to this effect on some instances of this below
14
15Using the representation described in \autoref{chap:DOM}, several semi -discrete space forms of
16the tracer equations are available depending on the vertical coordinate used and on the physics used.
17In all the equations presented here, the masking has been omitted for simplicity.
18One must be aware that all the quantities are masked fields and that each time a mean or
19difference operator is used, the resulting field is multiplied by a mask.
20
21The two active tracers are potential temperature and salinity.
22Their prognostic equations can be summarized as follows:
23\[
24  \text{NXT} =     \text{ADV} + \text{LDF} + \text{ZDF} + \text{SBC}
25               + \{\text{QSR},  \text{BBC},  \text{BBL},  \text{DMP}\}
26\]
27
28NXT stands for next, referring to the time-stepping.
29From left to right, the terms on the rhs of the tracer equations are the advection (ADV),
30the lateral diffusion (LDF), the vertical diffusion (ZDF), the contributions from the external forcings
31(SBC: Surface Boundary Condition, QSR: penetrative Solar Radiation, and BBC: Bottom Boundary Condition),
32the contribution from the bottom boundary Layer (BBL) parametrisation, and an internal damping (DMP) term.
33The terms QSR, BBC, BBL and DMP are optional.
34The external forcings and parameterisations require complex inputs and complex calculations
35(\eg\ bulk formulae, estimation of mixing coefficients) that are carried out in the SBC,
36LDF and ZDF modules and described in \autoref{chap:SBC}, \autoref{chap:LDF} and
37\autoref{chap:ZDF}, respectively.
38Note that \mdl{tranpc}, the non-penetrative convection module, although located in
39the \path{./src/OCE/TRA} directory as it directly modifies the tracer fields,
40is described with the model vertical physics (ZDF) together with
41other available parameterization of convection.
42
43In the present chapter we also describe the diagnostic equations used to compute the sea-water properties
44(density, Brunt-V\"{a}is\"{a}l\"{a} frequency, specific heat and freezing point with
45associated modules \mdl{eosbn2} and \mdl{phycst}).
46
47The different options available to the user are managed by namelist logicals.
48For each equation term \textit{TTT}, the namelist logicals are \textit{ln\_traTTT\_xxx},
49where \textit{xxx} is a 3 or 4 letter acronym corresponding to each optional scheme.
50The equivalent code can be found in the \textit{traTTT} or \textit{traTTT\_xxx} module,
51in the \path{./src/OCE/TRA} directory.
52
53The user has the option of extracting each tendency term on the RHS of the tracer equation for output
54(\np{ln_tra_trd}{ln\_tra\_trd} or \np[=.true.]{ln_tra_mxl}{ln\_tra\_mxl}), as described in \autoref{chap:DIA}.
55
56%% =================================================================================================
57\section[Tracer advection (\textit{traadv.F90})]{Tracer advection (\protect\mdl{traadv})}
58\label{sec:TRA_adv}
59
60\begin{listing}
61  \nlst{namtra_adv}
62  \caption{\forcode{&namtra_adv}}
63  \label{lst:namtra_adv}
64\end{listing}
65
66When considered (\ie\ when \np{ln_traadv_OFF}{ln\_traadv\_OFF} is not set to \forcode{.true.}),
67the advection tendency of a tracer is expressed in flux form,
68\ie\ as the divergence of the advective fluxes.
69Its discrete expression is given by :
70\begin{equation}
71  \label{eq:TRA_adv}
72  ADV_\tau = - \frac{1}{b_t} \Big(   \delta_i [ e_{2u} \, e_{3u} \; u \; \tau_u]
73                                   + \delta_j [ e_{1v} \, e_{3v} \; v \; \tau_v] \Big)
74             - \frac{1}{e_{3t}} \delta_k [w \; \tau_w]
75\end{equation}
76where $\tau$ is either T or S, and $b_t = e_{1t} \, e_{2t} \, e_{3t}$ is the volume of $T$-cells.
77The flux form in \autoref{eq:TRA_adv} implicitly requires the use of the continuity equation.
78Indeed, it is obtained by using the following equality: $\nabla \cdot (\vect U \, T) = \vect U \cdot \nabla T$ which
79results from the use of the continuity equation, $\partial_t e_3 + e_3 \; \nabla \cdot \vect U = 0$
80(which reduces to $\nabla \cdot \vect U = 0$ in linear free surface, \ie\ \np[=.true.]{ln_linssh}{ln\_linssh}).
81Therefore it is of paramount importance to design the discrete analogue of the advection tendency so that
82it is consistent with the continuity equation in order to enforce the conservation properties of
83the continuous equations.
84In other words, by setting $\tau = 1$ in (\autoref{eq:TRA_adv}) we recover the discrete form of
85the continuity equation which is used to calculate the vertical velocity.
86\begin{figure}[!t]
87  \centering
88  \includegraphics[width=0.66\textwidth]{Fig_adv_scheme}
89  \caption[Ways to evaluate the tracer value and the amount of tracer exchanged]{
90    Schematic representation of some ways used to evaluate the tracer value at $u$-point and
91    the amount of tracer exchanged between two neighbouring grid points.
92    Upsteam biased scheme (ups):
93    the upstream value is used and the black area is exchanged.
94    Piecewise parabolic method (ppm):
95    a parabolic interpolation is used and the black and dark grey areas are exchanged.
96    Monotonic upstream scheme for conservative laws (muscl):
97    a parabolic interpolation is used and black, dark grey and grey areas are exchanged.
98    Second order scheme (cen2):
99    the mean value is used and black, dark grey, grey and light grey areas are exchanged.
100    Note that this illustration does not include the flux limiter used in ppm and muscl schemes.}
101  \label{fig:TRA_adv_scheme}
102\end{figure}
103
104The key difference between the advection schemes available in \NEMO\ is the choice made in space and
105time interpolation to define the value of the tracer at the velocity points
106(\autoref{fig:TRA_adv_scheme}).
107
108Along solid lateral and bottom boundaries a zero tracer flux is automatically specified,
109since the normal velocity is zero there.
110At the sea surface the boundary condition depends on the type of sea surface chosen:
111
112\begin{description}
113\item [linear free surface:]
114  (\np[=.true.]{ln_linssh}{ln\_linssh})
115  the first level thickness is constant in time:
116  the vertical boundary condition is applied at the fixed surface $z = 0$ rather than on
117  the moving surface $z = \eta$.
118  There is a non-zero advective flux which is set for all advection schemes as
119  $\tau_w|_{k = 1/2} = T_{k = 1}$, \ie\ the product of surface velocity (at $z = 0$) by
120  the first level tracer value.
121\item [non-linear free surface:]
122  (\np[=.false.]{ln_linssh}{ln\_linssh})
123  convergence/divergence in the first ocean level moves the free surface up/down.
124  There is no tracer advection through it so that the advective fluxes through the surface are also zero.
125\end{description}
126
127In all cases, this boundary condition retains local conservation of tracer.
128Global conservation is obtained in non-linear free surface case, but \textit{not} in the linear free surface case.
129Nevertheless, in the latter case, it is achieved to a good approximation since
130the non-conservative term is the product of the time derivative of the tracer and the free surface height,
131two quantities that are not correlated \citep{roullet.madec_JGR00, griffies.pacanowski.ea_MWR01, campin.adcroft.ea_OM04}.
132
133The velocity field that appears in (\autoref{eq:TRA_adv} is
134the centred (\textit{now}) \textit{effective} ocean velocity, \ie\ the \textit{eulerian} velocity
135(see \autoref{chap:DYN}) plus the eddy induced velocity (\textit{eiv}) and/or
136the mixed layer eddy induced velocity (\textit{eiv}) when those parameterisations are used
137(see \autoref{chap:LDF}).
138
139Several tracer advection scheme are proposed, namely a $2^{nd}$ or $4^{th}$ order centred schemes (CEN),
140a $2^{nd}$ or $4^{th}$ order Flux Corrected Transport scheme (FCT), a Monotone Upstream Scheme for
141Conservative Laws scheme (MUSCL), a $3^{rd}$ Upstream Biased Scheme (UBS, also often called UP3),
142and a Quadratic Upstream Interpolation for Convective Kinematics with Estimated Streaming Terms scheme (QUICKEST).
143The choice is made in the \nam{tra_adv}{tra\_adv} namelist, by setting to \forcode{.true.} one of
144the logicals \textit{ln\_traadv\_xxx}.
145The corresponding code can be found in the \textit{traadv\_xxx.F90} module, where
146\textit{xxx} is a 3 or 4 letter acronym corresponding to each scheme.
147By default (\ie\ in the reference namelist, \textit{namelist\_ref}), all the logicals are set to \forcode{.false.}.
148If the user does not select an advection scheme in the configuration namelist (\textit{namelist\_cfg}),
149the tracers will \textit{not} be advected!
150
151Details of the advection schemes are given below.
152The choosing an advection scheme is a complex matter which depends on the model physics, model resolution,
153type of tracer, as well as the issue of numerical cost. In particular, we note that
154
155\begin{enumerate}
156\item CEN and FCT schemes require an explicit diffusion operator while the other schemes are diffusive enough so that
157  they do not necessarily need additional diffusion;
158\item CEN and UBS are not \textit{positive} schemes
159  \footnote{negative values can appear in an initially strictly positive tracer field which is advected},
160  implying that false extrema are permitted.
161  Their use is not recommended on passive tracers;
162\item It is recommended that the same advection-diffusion scheme is used on both active and passive tracers.
163\end{enumerate}
164
165Indeed, if a source or sink of a passive tracer depends on an active one, the difference of treatment of active and
166passive tracers can create very nice-looking frontal structures that are pure numerical artefacts.
167Nevertheless, most of our users set a different treatment on passive and active tracers,
168that's the reason why this possibility is offered.
169We strongly suggest them to perform a sensitivity experiment using a same treatment to assess the robustness of
170their results.
171
172%% =================================================================================================
173\subsection[CEN: Centred scheme (\forcode{ln_traadv_cen})]{CEN: Centred scheme (\protect\np{ln_traadv_cen}{ln\_traadv\_cen})}
174\label{subsec:TRA_adv_cen}
175
176%        2nd order centred scheme
177
178The centred advection scheme (CEN) is used when \np[=.true.]{ln_traadv_cen}{ln\_traadv\_cen}.
179Its order ($2^{nd}$ or $4^{th}$) can be chosen independently on horizontal (iso-level) and vertical direction by
180setting \np{nn_cen_h}{nn\_cen\_h} and \np{nn_cen_v}{nn\_cen\_v} to $2$ or $4$.
181CEN implementation can be found in the \mdl{traadv\_cen} module.
182
183In the $2^{nd}$ order centred formulation (CEN2), the tracer at velocity points is evaluated as the mean of
184the two neighbouring $T$-point values.
185For example, in the $i$-direction :
186\begin{equation}
187  \label{eq:TRA_adv_cen2}
188  \tau_u^{cen2} = \overline T ^{i + 1/2}
189\end{equation}
190
191CEN2 is non diffusive (\ie\ it conserves the tracer variance, $\tau^2$) but dispersive
192(\ie\ it may create false extrema).
193It is therefore notoriously noisy and must be used in conjunction with an explicit diffusion operator to
194produce a sensible solution.
195The associated time-stepping is performed using a leapfrog scheme in conjunction with an Asselin time-filter,
196so $T$ in (\autoref{eq:TRA_adv_cen2}) is the \textit{now} tracer value.
197
198Note that using the CEN2, the overall tracer advection is of second order accuracy since
199both (\autoref{eq:TRA_adv}) and (\autoref{eq:TRA_adv_cen2}) have this order of accuracy.
200
201%        4nd order centred scheme
202
203In the $4^{th}$ order formulation (CEN4), tracer values are evaluated at u- and v-points as
204a $4^{th}$ order interpolation, and thus depend on the four neighbouring $T$-points.
205For example, in the $i$-direction:
206\begin{equation}
207  \label{eq:TRA_adv_cen4}
208  \tau_u^{cen4} = \overline{T - \frac{1}{6} \, \delta_i \Big[ \delta_{i + 1/2}[T] \, \Big]}^{\,i + 1/2}
209\end{equation}
210In the vertical direction (\np[=4]{nn_cen_v}{nn\_cen\_v}),
211a $4^{th}$ COMPACT interpolation has been prefered \citep{demange_phd14}.
212In the COMPACT scheme, both the field and its derivative are interpolated, which leads, after a matrix inversion,
213spectral characteristics similar to schemes of higher order \citep{lele_JCP92}.
214
215Strictly speaking, the CEN4 scheme is not a $4^{th}$ order advection scheme but
216a $4^{th}$ order evaluation of advective fluxes,
217since the divergence of advective fluxes \autoref{eq:TRA_adv} is kept at $2^{nd}$ order.
218The expression \textit{$4^{th}$ order scheme} used in oceanographic literature is usually associated with
219the scheme presented here.
220Introducing a \forcode{.true.} $4^{th}$ order advection scheme is feasible but, for consistency reasons,
221it requires changes in the discretisation of the tracer advection together with changes in the continuity equation,
222and the momentum advection and pressure terms.
223
224A direct consequence of the pseudo-fourth order nature of the scheme is that it is not non-diffusive,
225\ie\ the global variance of a tracer is not preserved using CEN4.
226Furthermore, it must be used in conjunction with an explicit diffusion operator to produce a sensible solution.
227As in CEN2 case, the time-stepping is performed using a leapfrog scheme in conjunction with an Asselin time-filter,
228so $T$ in (\autoref{eq:TRA_adv_cen4}) is the \textit{now} tracer.
229
230At a $T$-grid cell adjacent to a boundary (coastline, bottom and surface),
231an additional hypothesis must be made to evaluate $\tau_u^{cen4}$.
232This hypothesis usually reduces the order of the scheme.
233Here we choose to set the gradient of $T$ across the boundary to zero.
234Alternative conditions can be specified, such as a reduction to a second order scheme for
235these near boundary grid points.
236
237%% =================================================================================================
238\subsection[FCT: Flux Corrected Transport scheme (\forcode{ln_traadv_fct})]{FCT: Flux Corrected Transport scheme (\protect\np{ln_traadv_fct}{ln\_traadv\_fct})}
239\label{subsec:TRA_adv_tvd}
240
241The Flux Corrected Transport schemes (FCT) is used when \np[=.true.]{ln_traadv_fct}{ln\_traadv\_fct}.
242Its order ($2^{nd}$ or $4^{th}$) can be chosen independently on horizontal (iso-level) and vertical direction by
243setting \np{nn_fct_h}{nn\_fct\_h} and \np{nn_fct_v}{nn\_fct\_v} to $2$ or $4$.
244FCT implementation can be found in the \mdl{traadv\_fct} module.
245
246In FCT formulation, the tracer at velocity points is evaluated using a combination of an upstream and
247a centred scheme.
248For example, in the $i$-direction :
249\begin{equation}
250  \label{eq:TRA_adv_fct}
251  \begin{split}
252    \tau_u^{ups} &=
253    \begin{cases}
254                     T_{i + 1} & \text{if~} u_{i + 1/2} <    0 \\
255                     T_i       & \text{if~} u_{i + 1/2} \geq 0 \\
256    \end{cases}
257    \\
258    \tau_u^{fct} &= \tau_u^{ups} + c_u \, \big( \tau_u^{cen} - \tau_u^{ups} \big)
259  \end{split}
260\end{equation}
261where $c_u$ is a flux limiter function taking values between 0 and 1.
262The FCT order is the one of the centred scheme used
263(\ie\ it depends on the setting of \np{nn_fct_h}{nn\_fct\_h} and \np{nn_fct_v}{nn\_fct\_v}).
264There exist many ways to define $c_u$, each corresponding to a different FCT scheme.
265The one chosen in \NEMO\ is described in \citet{zalesak_JCP79}.
266$c_u$ only departs from $1$ when the advective term produces a local extremum in the tracer field.
267The resulting scheme is quite expensive but \textit{positive}.
268It can be used on both active and passive tracers.
269A comparison of FCT-2 with MUSCL and a MPDATA scheme can be found in \citet{levy.estublier.ea_GRL01}.
270
271For stability reasons (see \autoref{chap:TD}),
272$\tau_u^{cen}$ is evaluated in (\autoref{eq:TRA_adv_fct}) using the \textit{now} tracer while
273$\tau_u^{ups}$ is evaluated using the \textit{before} tracer.
274In other words, the advective part of the scheme is time stepped with a leap-frog scheme
275while a forward scheme is used for the diffusive part.
276
277%% =================================================================================================
278\subsection[MUSCL: Monotone Upstream Scheme for Conservative Laws (\forcode{ln_traadv_mus})]{MUSCL: Monotone Upstream Scheme for Conservative Laws (\protect\np{ln_traadv_mus}{ln\_traadv\_mus})}
279\label{subsec:TRA_adv_mus}
280
281The Monotone Upstream Scheme for Conservative Laws (MUSCL) is used when \np[=.true.]{ln_traadv_mus}{ln\_traadv\_mus}.
282MUSCL implementation can be found in the \mdl{traadv\_mus} module.
283
284MUSCL has been first implemented in \NEMO\ by \citet{levy.estublier.ea_GRL01}.
285In its formulation, the tracer at velocity points is evaluated assuming a linear tracer variation between
286two $T$-points (\autoref{fig:TRA_adv_scheme}).
287For example, in the $i$-direction :
288\begin{equation}
289  % \label{eq:TRA_adv_mus}
290  \tau_u^{mus} = \lt\{
291  \begin{split}
292                       \tau_i         &+ \frac{1}{2} \lt( 1 - \frac{u_{i + 1/2} \, \rdt}{e_{1u}} \rt)
293                       \widetilde{\partial_i         \tau} & \text{if~} u_{i + 1/2} \geqslant 0 \\
294                       \tau_{i + 1/2} &+ \frac{1}{2} \lt( 1 + \frac{u_{i + 1/2} \, \rdt}{e_{1u}} \rt)
295                       \widetilde{\partial_{i + 1/2} \tau} & \text{if~} u_{i + 1/2} <         0
296  \end{split}
297                                                                                                      \rt.
298\end{equation}
299where $\widetilde{\partial_i \tau}$ is the slope of the tracer on which a limitation is imposed to
300ensure the \textit{positive} character of the scheme.
301
302The time stepping is performed using a forward scheme, that is the \textit{before} tracer field is used to
303evaluate $\tau_u^{mus}$.
304
305For an ocean grid point adjacent to land and where the ocean velocity is directed toward land,
306an upstream flux is used.
307This choice ensure the \textit{positive} character of the scheme.
308In addition, fluxes round a grid-point where a runoff is applied can optionally be computed using upstream fluxes
309(\np[=.true.]{ln_mus_ups}{ln\_mus\_ups}).
310
311%% =================================================================================================
312\subsection[UBS a.k.a. UP3: Upstream-Biased Scheme (\forcode{ln_traadv_ubs})]{UBS a.k.a. UP3: Upstream-Biased Scheme (\protect\np{ln_traadv_ubs}{ln\_traadv\_ubs})}
313\label{subsec:TRA_adv_ubs}
314
315The Upstream-Biased Scheme (UBS) is used when \np[=.true.]{ln_traadv_ubs}{ln\_traadv\_ubs}.
316UBS implementation can be found in the \mdl{traadv\_mus} module.
317
318The UBS scheme, often called UP3, is also known as the Cell Averaged QUICK scheme
319(Quadratic Upstream Interpolation for Convective Kinematics).
320It is an upstream-biased third order scheme based on an upstream-biased parabolic interpolation.
321For example, in the $i$-direction:
322\begin{equation}
323  \label{eq:TRA_adv_ubs}
324  \tau_u^{ubs} = \overline T ^{i + 1/2} - \frac{1}{6}
325    \begin{cases}
326                                                      \tau"_i       & \text{if~} u_{i + 1/2} \geqslant 0 \\
327                                                      \tau"_{i + 1} & \text{if~} u_{i + 1/2} <         0
328    \end{cases}
329  \quad
330  \text{where~} \tau"_i = \delta_i \lt[ \delta_{i + 1/2} [\tau] \rt]
331\end{equation}
332
333This results in a dissipatively dominant (i.e. hyper-diffusive) truncation error
334\citep{shchepetkin.mcwilliams_OM05}.
335The overall performance of the advection scheme is similar to that reported in \cite{farrow.stevens_JPO95}.
336It is a relatively good compromise between accuracy and smoothness.
337Nevertheless the scheme is not \textit{positive}, meaning that false extrema are permitted,
338but the amplitude of such are significantly reduced over the centred second or fourth order method.
339Therefore it is not recommended that it should be applied to a passive tracer that requires positivity.
340
341The intrinsic diffusion of UBS makes its use risky in the vertical direction where
342the control of artificial diapycnal fluxes is of paramount importance
343\citep{shchepetkin.mcwilliams_OM05, demange_phd14}.
344Therefore the vertical flux is evaluated using either a $2^nd$ order FCT scheme or a $4^th$ order COMPACT scheme
345(\np[=2 or 4]{nn_ubs_v}{nn\_ubs\_v}).
346
347For stability reasons (see \autoref{chap:TD}), the first term  in \autoref{eq:TRA_adv_ubs}
348(which corresponds to a second order centred scheme)
349is evaluated using the \textit{now} tracer (centred in time) while the second term
350(which is the diffusive part of the scheme),
351is evaluated using the \textit{before} tracer (forward in time).
352This choice is discussed by \citet{webb.de-cuevas.ea_JAOT98} in the context of the QUICK advection scheme.
353UBS and QUICK schemes only differ by one coefficient.
354Replacing 1/6 with 1/8 in \autoref{eq:TRA_adv_ubs} leads to the QUICK advection scheme \citep{webb.de-cuevas.ea_JAOT98}.
355This option is not available through a namelist parameter, since the 1/6 coefficient is hard coded.
356Nevertheless it is quite easy to make the substitution in the \mdl{traadv\_ubs} module and obtain a QUICK scheme.
357
358Note that it is straightforward to rewrite \autoref{eq:TRA_adv_ubs} as follows:
359\begin{gather}
360  \label{eq:TRA_adv_ubs2}
361  \tau_u^{ubs} = \tau_u^{cen4} + \frac{1}{12}
362    \begin{cases}
363      + \tau"_i       & \text{if} \ u_{i + 1/2} \geqslant 0 \\
364      - \tau"_{i + 1} & \text{if} \ u_{i + 1/2} <         0
365    \end{cases}
366  \intertext{or equivalently}
367  % \label{eq:TRA_adv_ubs2b}
368  u_{i + 1/2} \ \tau_u^{ubs} = u_{i + 1/2} \, \overline{T - \frac{1}{6} \, \delta_i \Big[ \delta_{i + 1/2}[T] \Big]}^{\,i + 1/2}
369                             - \frac{1}{2} |u|_{i + 1/2} \, \frac{1}{6} \, \delta_{i + 1/2} [\tau"_i] \nonumber
370\end{gather}
371
372\autoref{eq:TRA_adv_ubs2} has several advantages.
373Firstly, it clearly reveals that the UBS scheme is based on the fourth order scheme to which
374an upstream-biased diffusion term is added.
375Secondly, this emphasises that the $4^{th}$ order part (as well as the $2^{nd}$ order part as stated above) has to
376be evaluated at the \textit{now} time step using \autoref{eq:TRA_adv_ubs}.
377Thirdly, the diffusion term is in fact a biharmonic operator with an eddy coefficient which
378is simply proportional to the velocity: $A_u^{lm} = \frac{1}{12} \, {e_{1u}}^3 \, |u|$.
379Note the current version of \NEMO\ uses the computationally more efficient formulation \autoref{eq:TRA_adv_ubs}.
380
381%% =================================================================================================
382\subsection[QCK: QuiCKest scheme (\forcode{ln_traadv_qck})]{QCK: QuiCKest scheme (\protect\np{ln_traadv_qck}{ln\_traadv\_qck})}
383\label{subsec:TRA_adv_qck}
384
385The Quadratic Upstream Interpolation for Convective Kinematics with Estimated Streaming Terms (QUICKEST) scheme
386proposed by \citet{leonard_CMAME79} is used when \np[=.true.]{ln_traadv_qck}{ln\_traadv\_qck}.
387QUICKEST implementation can be found in the \mdl{traadv\_qck} module.
388
389QUICKEST is the third order Godunov scheme which is associated with the ULTIMATE QUICKEST limiter
390\citep{leonard_CMAME91}.
391It has been implemented in \NEMO\ by G. Reffray (MERCATOR-ocean) and can be found in the \mdl{traadv\_qck} module.
392The resulting scheme is quite expensive but \textit{positive}.
393It can be used on both active and passive tracers.
394However, the intrinsic diffusion of QCK makes its use risky in the vertical direction where
395the control of artificial diapycnal fluxes is of paramount importance.
396Therefore the vertical flux is evaluated using the CEN2 scheme.
397This no longer guarantees the positivity of the scheme.
398The use of FCT in the vertical direction (as for the UBS case) should be implemented to restore this property.
399
400%%%gmcomment   :  Cross term are missing in the current implementation....
401
402%% =================================================================================================
403\section[Tracer lateral diffusion (\textit{traldf.F90})]{Tracer lateral diffusion (\protect\mdl{traldf})}
404\label{sec:TRA_ldf}
405
406\begin{listing}
407  \nlst{namtra_ldf}
408  \caption{\forcode{&namtra_ldf}}
409  \label{lst:namtra_ldf}
410\end{listing}
411
412Options are defined through the \nam{tra_ldf}{tra\_ldf} namelist variables.
413They are regrouped in four items, allowing to specify
414$(i)$   the type of operator used (none, laplacian, bilaplacian),
415$(ii)$  the direction along which the operator acts (iso-level, horizontal, iso-neutral),
416$(iii)$ some specific options related to the rotated operators (\ie\ non-iso-level operator), and
417$(iv)$  the specification of eddy diffusivity coefficient (either constant or variable in space and time).
418Item $(iv)$ will be described in \autoref{chap:LDF}.
419The direction along which the operators act is defined through the slope between
420this direction and the iso-level surfaces.
421The slope is computed in the \mdl{ldfslp} module and will also be described in \autoref{chap:LDF}.
422
423The lateral diffusion of tracers is evaluated using a forward scheme,
424\ie\ the tracers appearing in its expression are the \textit{before} tracers in time,
425except for the pure vertical component that appears when a rotation tensor is used.
426This latter component is solved implicitly together with the vertical diffusion term (see \autoref{chap:TD}).
427When \np[=.true.]{ln_traldf_msc}{ln\_traldf\_msc}, a Method of Stabilizing Correction is used in which
428the pure vertical component is split into an explicit and an implicit part \citep{lemarie.debreu.ea_OM12}.
429
430%% =================================================================================================
431\subsection[Type of operator (\forcode{ln_traldf_}\{\forcode{OFF,lap,blp}\})]{Type of operator (\protect\np{ln_traldf_OFF}{ln\_traldf\_OFF}, \protect\np{ln_traldf_lap}{ln\_traldf\_lap}, or \protect\np{ln_traldf_blp}{ln\_traldf\_blp})}
432\label{subsec:TRA_ldf_op}
433
434Three operator options are proposed and, one and only one of them must be selected:
435
436\begin{description}
437\item [{\np[=.true.]{ln_traldf_OFF}{ln\_traldf\_OFF}}]
438  no operator selected, the lateral diffusive tendency will not be applied to the tracer equation.
439  This option can be used when the selected advection scheme is diffusive enough (MUSCL scheme for example).
440\item [{\np[=.true.]{ln_traldf_lap}{ln\_traldf\_lap}}]
441  a laplacian operator is selected.
442  This harmonic operator takes the following expression:  $\mathcal{L}(T) = \nabla \cdot A_{ht} \; \nabla T $,
443  where the gradient operates along the selected direction (see \autoref{subsec:TRA_ldf_dir}),
444  and $A_{ht}$ is the eddy diffusivity coefficient expressed in $m^2/s$ (see \autoref{chap:LDF}).
445\item [{\np[=.true.]{ln_traldf_blp}{ln\_traldf\_blp}}]:
446  a bilaplacian operator is selected.
447  This biharmonic operator takes the following expression:
448  $\mathcal{B} = - \mathcal{L}(\mathcal{L}(T)) = - \nabla \cdot b \nabla (\nabla \cdot b \nabla T)$
449  where the gradient operats along the selected direction,
450  and $b^2 = B_{ht}$ is the eddy diffusivity coefficient expressed in $m^4/s$ (see \autoref{chap:LDF}).
451  In the code, the bilaplacian operator is obtained by calling the laplacian twice.
452\end{description}
453
454Both laplacian and bilaplacian operators ensure the total tracer variance decrease.
455Their primary role is to provide strong dissipation at the smallest scale supported by the grid while
456minimizing the impact on the larger scale features.
457The main difference between the two operators is the scale selectiveness.
458The bilaplacian damping time (\ie\ its spin down time) scales like $\lambda^{-4}$ for
459disturbances of wavelength $\lambda$ (so that short waves damped more rapidelly than long ones),
460whereas the laplacian damping time scales only like $\lambda^{-2}$.
461
462%% =================================================================================================
463\subsection[Action direction (\forcode{ln_traldf_}\{\forcode{lev,hor,iso,triad}\})]{Direction of action (\protect\np{ln_traldf_lev}{ln\_traldf\_lev}, \protect\np{ln_traldf_hor}{ln\_traldf\_hor}, \protect\np{ln_traldf_iso}{ln\_traldf\_iso}, or \protect\np{ln_traldf_triad}{ln\_traldf\_triad})}
464\label{subsec:TRA_ldf_dir}
465
466The choice of a direction of action determines the form of operator used.
467The operator is a simple (re-entrant) laplacian acting in the (\textbf{i},\textbf{j}) plane when
468iso-level option is used (\np[=.true.]{ln_traldf_lev}{ln\_traldf\_lev}) or
469when a horizontal (\ie\ geopotential) operator is demanded in \textit{z}-coordinate
470(\np{ln_traldf_hor}{ln\_traldf\_hor} and \np[=.true.]{ln_zco}{ln\_zco}).
471The associated code can be found in the \mdl{traldf\_lap\_blp} module.
472The operator is a rotated (re-entrant) laplacian when
473the direction along which it acts does not coincide with the iso-level surfaces,
474that is when standard or triad iso-neutral option is used
475(\np{ln_traldf_iso}{ln\_traldf\_iso} or \np{ln_traldf_triad}{ln\_traldf\_triad} = \forcode{.true.},
476see \mdl{traldf\_iso} or \mdl{traldf\_triad} module, resp.), or
477when a horizontal (\ie\ geopotential) operator is demanded in \textit{s}-coordinate
478(\np{ln_traldf_hor}{ln\_traldf\_hor} and \np{ln_sco}{ln\_sco} = \forcode{.true.})
479\footnote{In this case, the standard iso-neutral operator will be automatically selected}.
480In that case, a rotation is applied to the gradient(s) that appears in the operator so that
481diffusive fluxes acts on the three spatial direction.
482
483The resulting discret form of the three operators (one iso-level and two rotated one) is given in
484the next two sub-sections.
485
486%% =================================================================================================
487\subsection[Iso-level (bi-)laplacian operator (\forcode{ln_traldf_iso})]{Iso-level (bi-)laplacian operator ( \protect\np{ln_traldf_iso}{ln\_traldf\_iso})}
488\label{subsec:TRA_ldf_lev}
489
490The laplacian diffusion operator acting along the model (\textit{i,j})-surfaces is given by:
491\begin{equation}
492  \label{eq:TRA_ldf_lap}
493  D_t^{lT} = \frac{1}{b_t} \Bigg(   \delta_{i} \lt[ A_u^{lT} \; \frac{e_{2u} \, e_{3u}}{e_{1u}} \; \delta_{i + 1/2} [T] \rt]
494                                  + \delta_{j} \lt[ A_v^{lT} \; \frac{e_{1v} \, e_{3v}}{e_{2v}} \; \delta_{j + 1/2} [T] \rt] \Bigg)
495\end{equation}
496where $b_t = e_{1t} \, e_{2t} \, e_{3t}$  is the volume of $T$-cells and
497where zero diffusive fluxes is assumed across solid boundaries,
498first (and third in bilaplacian case) horizontal tracer derivative are masked.
499It is implemented in the \rou{tra\_ldf\_lap} subroutine found in the \mdl{traldf\_lap\_blp} module.
500The module also contains \rou{tra\_ldf\_blp}, the subroutine calling twice \rou{tra\_ldf\_lap} in order to
501compute the iso-level bilaplacian operator.
502
503It is a \textit{horizontal} operator (\ie acting along geopotential surfaces) in
504the $z$-coordinate with or without partial steps, but is simply an iso-level operator in the $s$-coordinate.
505It is thus used when, in addition to \np{ln_traldf_lap}{ln\_traldf\_lap} or \np[=.true.]{ln_traldf_blp}{ln\_traldf\_blp},
506we have \np[=.true.]{ln_traldf_lev}{ln\_traldf\_lev} or \np{ln_traldf_hor}{ln\_traldf\_hor}~=~\np[=.true.]{ln_zco}{ln\_zco}.
507In both cases, it significantly contributes to diapycnal mixing.
508It is therefore never recommended, even when using it in the bilaplacian case.
509
510Note that in the partial step $z$-coordinate (\np[=.true.]{ln_zps}{ln\_zps}),
511tracers in horizontally adjacent cells are located at different depths in the vicinity of the bottom.
512In this case, horizontal derivatives in (\autoref{eq:TRA_ldf_lap}) at the bottom level require a specific treatment.
513They are calculated in the \mdl{zpshde} module, described in \autoref{sec:TRA_zpshde}.
514
515%% =================================================================================================
516\subsection{Standard and triad (bi-)laplacian operator}
517\label{subsec:TRA_ldf_iso_triad}
518
519%&&    Standard rotated (bi-)laplacian operator
520%&& ----------------------------------------------
521%% =================================================================================================
522\subsubsection[Standard rotated (bi-)laplacian operator (\textit{traldf\_iso.F90})]{Standard rotated (bi-)laplacian operator (\protect\mdl{traldf\_iso})}
523\label{subsec:TRA_ldf_iso}
524The general form of the second order lateral tracer subgrid scale physics (\autoref{eq:MB_zdf})
525takes the following semi -discrete space form in $z$- and $s$-coordinates:
526\begin{equation}
527  \label{eq:TRA_ldf_iso}
528  \begin{split}
529    D_T^{lT} = \frac{1}{b_t} \Bigg[ \quad &\delta_i A_u^{lT} \lt( \frac{e_{2u} e_{3u}}{e_{1u}}                      \, \delta_{i + 1/2} [T]
530                                                                  - e_{2u} r_{1u} \, \overline{\overline{\delta_{k + 1/2} [T]}}^{\,i + 1/2,k} \rt) \Bigg. \\
531                                    +     &\delta_j A_v^{lT} \lt( \frac{e_{1v} e_{3v}}{e_{2v}}                       \, \delta_{j + 1/2} [T]
532                                                                  - e_{1v} r_{2v} \, \overline{\overline{\delta_{k + 1/2} [T]}}^{\,j + 1/2,k} \rt)        \\
533                                   +     &\delta_k A_w^{lT} \lt( \frac{e_{1w} e_{2w}}{e_{3w}} (r_{1w}^2 + r_{2w}^2) \, \delta_{k + 1/2} [T] \rt.           \\
534                                   & \qquad \quad \Bigg. \lt.     - e_{2w} r_{1w} \, \overline{\overline{\delta_{i + 1/2} [T]}}^{\,i,k + 1/2}
535                                                                  - e_{1w} r_{2w} \, \overline{\overline{\delta_{j + 1/2} [T]}}^{\,j,k + 1/2} \rt) \Bigg]
536  \end{split}
537\end{equation}
538where $b_t = e_{1t} \, e_{2t} \, e_{3t}$  is the volume of $T$-cells,
539$r_1$ and $r_2$ are the slopes between the surface of computation ($z$- or $s$-surfaces) and
540the surface along which the diffusion operator acts (\ie\ horizontal or iso-neutral surfaces).
541It is thus used when, in addition to \np[=.true.]{ln_traldf_lap}{ln\_traldf\_lap},
542we have \np[=.true.]{ln_traldf_iso}{ln\_traldf\_iso},
543or both \np[=.true.]{ln_traldf_hor}{ln\_traldf\_hor} and \np[=.true.]{ln_zco}{ln\_zco}.
544The way these slopes are evaluated is given in \autoref{sec:LDF_slp}.
545At the surface, bottom and lateral boundaries, the turbulent fluxes of heat and salt are set to zero using
546the mask technique (see \autoref{sec:LBC_coast}).
547
548The operator in \autoref{eq:TRA_ldf_iso} involves both lateral and vertical derivatives.
549For numerical stability, the vertical second derivative must be solved using the same implicit time scheme as that
550used in the vertical physics (see \autoref{sec:TRA_zdf}).
551For computer efficiency reasons, this term is not computed in the \mdl{traldf\_iso} module,
552but in the \mdl{trazdf} module where, if iso-neutral mixing is used,
553the vertical mixing coefficient is simply increased by $\frac{e_{1w} e_{2w}}{e_{3w}}(r_{1w}^2 + r_{2w}^2)$.
554
555This formulation conserves the tracer but does not ensure the decrease of the tracer variance.
556Nevertheless the treatment performed on the slopes (see \autoref{chap:LDF}) allows the model to run safely without
557any additional background horizontal diffusion \citep{guilyardi.madec.ea_CD01}.
558
559Note that in the partial step $z$-coordinate (\np[=.true.]{ln_zps}{ln\_zps}),
560the horizontal derivatives at the bottom level in \autoref{eq:TRA_ldf_iso} require a specific treatment.
561They are calculated in module zpshde, described in \autoref{sec:TRA_zpshde}.
562
563%&&     Triad rotated (bi-)laplacian operator
564%&&  -------------------------------------------
565%% =================================================================================================
566\subsubsection[Triad rotated (bi-)laplacian operator (\forcode{ln_traldf_triad})]{Triad rotated (bi-)laplacian operator (\protect\np{ln_traldf_triad}{ln\_traldf\_triad})}
567\label{subsec:TRA_ldf_triad}
568
569An alternative scheme developed by \cite{griffies.gnanadesikan.ea_JPO98} which ensures tracer variance decreases
570is also available in \NEMO\ (\np[=.true.]{ln_traldf_triad}{ln\_traldf\_triad}).
571A complete description of the algorithm is given in \autoref{apdx:TRIADS}.
572
573The lateral fourth order bilaplacian operator on tracers is obtained by applying (\autoref{eq:TRA_ldf_lap}) twice.
574The operator requires an additional assumption on boundary conditions:
575both first and third derivative terms normal to the coast are set to zero.
576
577The lateral fourth order operator formulation on tracers is obtained by applying (\autoref{eq:TRA_ldf_iso}) twice.
578It requires an additional assumption on boundary conditions:
579first and third derivative terms normal to the coast,
580normal to the bottom and normal to the surface are set to zero.
581
582%&&    Option for the rotated operators
583%&& ----------------------------------------------
584%% =================================================================================================
585\subsubsection{Option for the rotated operators}
586\label{subsec:TRA_ldf_options}
587
588\begin{itemize}
589\item \np{ln_traldf_msc}{ln\_traldf\_msc} = Method of Stabilizing Correction (both operators)
590\item \np{rn_slpmax}{rn\_slpmax} = slope limit (both operators)
591\item \np{ln_triad_iso}{ln\_triad\_iso} = pure horizontal mixing in ML (triad only)
592\item \np{rn_sw_triad}{rn\_sw\_triad} $= 1$ switching triad; $= 0$ all 4 triads used (triad only)
593\item \np{ln_botmix_triad}{ln\_botmix\_triad} = lateral mixing on bottom (triad only)
594\end{itemize}
595
596%% =================================================================================================
597\section[Tracer vertical diffusion (\textit{trazdf.F90})]{Tracer vertical diffusion (\protect\mdl{trazdf})}
598\label{sec:TRA_zdf}
599
600
601Options are defined through the \nam{zdf}{zdf} namelist variables.
602The formulation of the vertical subgrid scale tracer physics is the same for all the vertical coordinates,
603and is based on a laplacian operator.
604The vertical diffusion operator given by (\autoref{eq:MB_zdf}) takes the following semi -discrete space form:
605\begin{gather*}
606  % \label{eq:TRA_zdf}
607    D^{vT}_T = \frac{1}{e_{3t}} \, \delta_k \lt[ \, \frac{A^{vT}_w}{e_{3w}} \delta_{k + 1/2}[T] \, \rt] \\
608    D^{vS}_T = \frac{1}{e_{3t}} \; \delta_k \lt[ \, \frac{A^{vS}_w}{e_{3w}} \delta_{k + 1/2}[S] \, \rt]
609\end{gather*}
610where $A_w^{vT}$ and $A_w^{vS}$ are the vertical eddy diffusivity coefficients on temperature and salinity,
611respectively.
612Generally, $A_w^{vT} = A_w^{vS}$ except when double diffusive mixing is parameterised
613(\ie\ \np[=.true.]{ln_zdfddm}{ln\_zdfddm},).
614The way these coefficients are evaluated is given in \autoref{chap:ZDF} (ZDF).
615Furthermore, when iso-neutral mixing is used, both mixing coefficients are increased by
616$\frac{e_{1w} e_{2w}}{e_{3w} }({r_{1w}^2 + r_{2w}^2})$ to account for the vertical second derivative of
617\autoref{eq:TRA_ldf_iso}.
618
619At the surface and bottom boundaries, the turbulent fluxes of heat and salt must be specified.
620At the surface they are prescribed from the surface forcing and added in a dedicated routine
621(see \autoref{subsec:TRA_sbc}), whilst at the bottom they are set to zero for heat and salt unless
622a geothermal flux forcing is prescribed as a bottom boundary condition (see \autoref{subsec:TRA_bbc}).
623
624The large eddy coefficient found in the mixed layer together with high vertical resolution implies that
625there would be too restrictive constraint on the time step if we use explicit time stepping.
626Therefore an implicit time stepping is preferred for the vertical diffusion since
627it overcomes the stability constraint.
628
629%% =================================================================================================
630\section{External forcing}
631\label{sec:TRA_sbc_qsr_bbc}
632
633%% =================================================================================================
634\subsection[Surface boundary condition (\textit{trasbc.F90})]{Surface boundary condition (\protect\mdl{trasbc})}
635\label{subsec:TRA_sbc}
636
637The surface boundary condition for tracers is implemented in a separate module (\mdl{trasbc}) instead of
638entering as a boundary condition on the vertical diffusion operator (as in the case of momentum).
639This has been found to enhance readability of the code.
640The two formulations are completely equivalent;
641the forcing terms in trasbc are the surface fluxes divided by the thickness of the top model layer.
642
643Due to interactions and mass exchange of water ($F_{mass}$) with other Earth system components
644(\ie\ atmosphere, sea-ice, land), the change in the heat and salt content of the surface layer of the ocean is due
645both to the heat and salt fluxes crossing the sea surface (not linked with $F_{mass}$) and
646to the heat and salt content of the mass exchange.
647They are both included directly in $Q_{ns}$, the surface heat flux,
648and $F_{salt}$, the surface salt flux (see \autoref{chap:SBC} for further details).
649By doing this, the forcing formulation is the same for any tracer (including temperature and salinity).
650
651The surface module (\mdl{sbcmod}, see \autoref{chap:SBC}) provides the following forcing fields (used on tracers):
652
653\begin{itemize}
654\item $Q_{ns}$, the non-solar part of the net surface heat flux that crosses the sea surface
655  (\ie\ the difference between the total surface heat flux and the fraction of the short wave flux that
656  penetrates into the water column, see \autoref{subsec:TRA_qsr})
657  plus the heat content associated with of the mass exchange with the atmosphere and lands.
658\item $\textit{sfx}$, the salt flux resulting from ice-ocean mass exchange (freezing, melting, ridging...)
659\item \textit{emp}, the mass flux exchanged with the atmosphere (evaporation minus precipitation) and
660  possibly with the sea-ice and ice-shelves.
661\item \textit{rnf}, the mass flux associated with runoff
662  (see \autoref{sec:SBC_rnf} for further detail of how it acts on temperature and salinity tendencies)
663\item \textit{fwfisf}, the mass flux associated with ice shelf melt,
664  (see \autoref{sec:SBC_isf} for further details on how the ice shelf melt is computed and applied).
665\end{itemize}
666
667The surface boundary condition on temperature and salinity is applied as follows:
668\begin{equation}
669  \label{eq:TRA_sbc}
670  \begin{alignedat}{2}
671    F^T &= \frac{1}{C_p} &\frac{1}{\rho_o \lt. e_{3t} \rt|_{k = 1}} &\overline{Q_{ns}      }^t \\
672    F^S &=               &\frac{1}{\rho_o \lt. e_{3t} \rt|_{k = 1}} &\overline{\textit{sfx}}^t
673  \end{alignedat}
674\end{equation}
675where $\overline x^t$ means that $x$ is averaged over two consecutive time steps
676($t - \rdt / 2$ and $t + \rdt / 2$).
677Such time averaging prevents the divergence of odd and even time step (see \autoref{chap:TD}).
678
679In the linear free surface case (\np[=.true.]{ln_linssh}{ln\_linssh}), an additional term has to be added on
680both temperature and salinity.
681On temperature, this term remove the heat content associated with mass exchange that has been added to $Q_{ns}$.
682On salinity, this term mimics the concentration/dilution effect that would have resulted from a change in
683the volume of the first level.
684The resulting surface boundary condition is applied as follows:
685\begin{equation}
686  \label{eq:TRA_sbc_lin}
687  \begin{alignedat}{2}
688    F^T &= \frac{1}{C_p} &\frac{1}{\rho_o \lt. e_{3t} \rt|_{k = 1}}
689          &\overline{(Q_{ns}       - C_p \, \textit{emp} \lt. T \rt|_{k = 1})}^t \\
690    F^S &=               &\frac{1}{\rho_o \lt. e_{3t} \rt|_{k = 1}}
691          &\overline{(\textit{sfx} -        \textit{emp} \lt. S \rt|_{k = 1})}^t
692  \end{alignedat}
693\end{equation}
694Note that an exact conservation of heat and salt content is only achieved with non-linear free surface.
695In the linear free surface case, there is a small imbalance.
696The imbalance is larger than the imbalance associated with the Asselin time filter \citep{leclair.madec_OM09}.
697This is the reason why the modified filter is not applied in the linear free surface case (see \autoref{chap:TD}).
698
699%% =================================================================================================
700\subsection[Solar radiation penetration (\textit{traqsr.F90})]{Solar radiation penetration (\protect\mdl{traqsr})}
701\label{subsec:TRA_qsr}
702
703\begin{listing}
704  \nlst{namtra_qsr}
705  \caption{\forcode{&namtra_qsr}}
706  \label{lst:namtra_qsr}
707\end{listing}
708
709Options are defined through the \nam{tra_qsr}{tra\_qsr} namelist variables.
710When the penetrative solar radiation option is used (\np[=.true.]{ln_traqsr}{ln\_traqsr}),
711the solar radiation penetrates the top few tens of meters of the ocean.
712If it is not used (\np[=.false.]{ln_traqsr}{ln\_traqsr}) all the heat flux is absorbed in the first ocean level.
713Thus, in the former case a term is added to the time evolution equation of temperature \autoref{eq:MB_PE_tra_T} and
714the surface boundary condition is modified to take into account only the non-penetrative part of the surface
715heat flux:
716\begin{equation}
717  \label{eq:TRA_PE_qsr}
718  \begin{gathered}
719    \pd[T]{t} = \ldots + \frac{1}{\rho_o \, C_p \, e_3} \; \pd[I]{k} \\
720    Q_{ns} = Q_\text{Total} - Q_{sr}
721  \end{gathered}
722\end{equation}
723where $Q_{sr}$ is the penetrative part of the surface heat flux (\ie\ the shortwave radiation) and
724$I$ is the downward irradiance ($\lt. I \rt|_{z = \eta} = Q_{sr}$).
725The additional term in \autoref{eq:TRA_PE_qsr} is discretized as follows:
726\begin{equation}
727  \label{eq:TRA_qsr}
728  \frac{1}{\rho_o \, C_p \, e_3} \, \pd[I]{k} \equiv \frac{1}{\rho_o \, C_p \, e_{3t}} \delta_k [I_w]
729\end{equation}
730
731The shortwave radiation, $Q_{sr}$, consists of energy distributed across a wide spectral range.
732The ocean is strongly absorbing for wavelengths longer than 700~nm and these wavelengths contribute to
733heating the upper few tens of centimetres.
734The fraction of $Q_{sr}$ that resides in these almost non-penetrative wavebands, $R$, is $\sim 58\%$
735(specified through namelist parameter \np{rn_abs}{rn\_abs}).
736It is assumed to penetrate the ocean with a decreasing exponential profile, with an e-folding depth scale, $\xi_0$,
737of a few tens of centimetres (typically $\xi_0 = 0.35~m$ set as \np{rn_si0}{rn\_si0} in the \nam{tra_qsr}{tra\_qsr} namelist).
738For shorter wavelengths (400-700~nm), the ocean is more transparent, and solar energy propagates to
739larger depths where it contributes to local heating.
740The way this second part of the solar energy penetrates into the ocean depends on which formulation is chosen.
741In the simple 2-waveband light penetration scheme (\np[=.true.]{ln_qsr_2bd}{ln\_qsr\_2bd})
742a chlorophyll-independent monochromatic formulation is chosen for the shorter wavelengths,
743leading to the following expression \citep{paulson.simpson_JPO77}:
744\[
745  % \label{eq:TRA_qsr_iradiance}
746  I(z) = Q_{sr} \lt[ Re^{- z / \xi_0} + (1 - R) e^{- z / \xi_1} \rt]
747\]
748where $\xi_1$ is the second extinction length scale associated with the shorter wavelengths.
749It is usually chosen to be 23~m by setting the \np{rn_si0}{rn\_si0} namelist parameter.
750The set of default values ($\xi_0, \xi_1, R$) corresponds to a Type I water in Jerlov's (1968) classification
751(oligotrophic waters).
752
753Such assumptions have been shown to provide a very crude and simplistic representation of
754observed light penetration profiles (\cite{morel_JGR88}, see also \autoref{fig:TRA_qsr_irradiance}).
755Light absorption in the ocean depends on particle concentration and is spectrally selective.
756\cite{morel_JGR88} has shown that an accurate representation of light penetration can be provided by
757a 61 waveband formulation.
758Unfortunately, such a model is very computationally expensive.
759Thus, \cite{lengaigne.menkes.ea_CD07} have constructed a simplified version of this formulation in which
760visible light is split into three wavebands: blue (400-500 nm), green (500-600 nm) and red (600-700nm).
761For each wave-band, the chlorophyll-dependent attenuation coefficient is fitted to the coefficients computed from
762the full spectral model of \cite{morel_JGR88} (as modified by \cite{morel.maritorena_JGR01}),
763assuming the same power-law relationship.
764As shown in \autoref{fig:TRA_qsr_irradiance}, this formulation, called RGB (Red-Green-Blue),
765reproduces quite closely the light penetration profiles predicted by the full spectal model,
766but with much greater computational efficiency.
767The 2-bands formulation does not reproduce the full model very well.
768
769The RGB formulation is used when \np[=.true.]{ln_qsr_rgb}{ln\_qsr\_rgb}.
770The RGB attenuation coefficients (\ie\ the inverses of the extinction length scales) are tabulated over
77161 nonuniform chlorophyll classes ranging from 0.01 to 10 g.Chl/L
772(see the routine \rou{trc\_oce\_rgb} in \mdl{trc\_oce} module).
773Four types of chlorophyll can be chosen in the RGB formulation:
774
775\begin{description}
776\item [{\np[=0]{nn_chldta}{nn\_chldta}}]
777  a constant 0.05 g.Chl/L value everywhere ;
778\item [{\np[=1]{nn_chldta}{nn\_chldta}}]
779  an observed time varying chlorophyll deduced from satellite surface ocean color measurement spread uniformly in
780  the vertical direction;
781\item [{\np[=2]{nn_chldta}{nn\_chldta}}]
782  same as previous case except that a vertical profile of chlorophyl is used.
783  Following \cite{morel.berthon_LO89}, the profile is computed from the local surface chlorophyll value;
784\item [{\np[=.true.]{ln_qsr_bio}{ln\_qsr\_bio}}]
785  simulated time varying chlorophyll by TOP biogeochemical model.
786  In this case, the RGB formulation is used to calculate both the phytoplankton light limitation in
787  PISCES and the oceanic heating rate.
788\end{description}
789
790The trend in \autoref{eq:TRA_qsr} associated with the penetration of the solar radiation is added to
791the temperature trend, and the surface heat flux is modified in routine \mdl{traqsr}.
792
793When the $z$-coordinate is preferred to the $s$-coordinate,
794the depth of $w-$levels does not significantly vary with location.
795The level at which the light has been totally absorbed
796(\ie\ it is less than the computer precision) is computed once,
797and the trend associated with the penetration of the solar radiation is only added down to that level.
798Finally, note that when the ocean is shallow ($<$ 200~m), part of the solar radiation can reach the ocean floor.
799In this case, we have chosen that all remaining radiation is absorbed in the last ocean level
800(\ie\ $I$ is masked).
801
802\begin{figure}[!t]
803  \centering
804  \includegraphics[width=0.66\textwidth]{Fig_TRA_Irradiance}
805  \caption[Penetration profile of the downward solar irradiance calculated by four models]{
806    Penetration profile of the downward solar irradiance calculated by four models.
807    Two waveband chlorophyll-independent formulation (blue),
808    a chlorophyll-dependent monochromatic formulation (green),
809    4 waveband RGB formulation (red),
810    61 waveband Morel (1988) formulation (black) for a chlorophyll concentration of
811    (a) Chl=0.05 mg/m$^3$ and (b) Chl=0.5 mg/m$^3$.
812    From \citet{lengaigne.menkes.ea_CD07}.}
813  \label{fig:TRA_qsr_irradiance}
814\end{figure}
815
816%% =================================================================================================
817\subsection[Bottom boundary condition (\textit{trabbc.F90}) - \forcode{ln_trabbc})]{Bottom boundary condition (\protect\mdl{trabbc} - \protect\np{ln_trabbc}{ln\_trabbc})}
818\label{subsec:TRA_bbc}
819
820\begin{listing}
821  \nlst{nambbc}
822  \caption{\forcode{&nambbc}}
823  \label{lst:nambbc}
824\end{listing}
825\begin{figure}[!t]
826  \centering
827  \includegraphics[width=0.66\textwidth]{Fig_TRA_geoth}
828  \caption[Geothermal heat flux]{
829    Geothermal Heat flux (in $mW.m^{-2}$) used by \cite{emile-geay.madec_OS09}.
830    It is inferred from the age of the sea floor and the formulae of \citet{stein.stein_N92}.}
831  \label{fig:TRA_geothermal}
832\end{figure}
833
834Usually it is assumed that there is no exchange of heat or salt through the ocean bottom,
835\ie\ a no flux boundary condition is applied on active tracers at the bottom.
836This is the default option in \NEMO, and it is implemented using the masking technique.
837However, there is a non-zero heat flux across the seafloor that is associated with solid earth cooling.
838This flux is weak compared to surface fluxes (a mean global value of $\sim 0.1 \, W/m^2$ \citep{stein.stein_N92}),
839but it warms systematically the ocean and acts on the densest water masses.
840Taking this flux into account in a global ocean model increases the deepest overturning cell
841(\ie\ the one associated with the Antarctic Bottom Water) by a few Sverdrups \citep{emile-geay.madec_OS09}.
842
843Options are defined through the \nam{bbc}{bbc} namelist variables.
844The presence of geothermal heating is controlled by setting the namelist parameter \np{ln_trabbc}{ln\_trabbc} to true.
845Then, when \np{nn_geoflx}{nn\_geoflx} is set to 1, a constant geothermal heating is introduced whose value is given by
846the \np{rn_geoflx_cst}{rn\_geoflx\_cst}, which is also a namelist parameter.
847When \np{nn_geoflx}{nn\_geoflx} is set to 2, a spatially varying geothermal heat flux is introduced which is provided in
848the \ifile{geothermal\_heating} NetCDF file (\autoref{fig:TRA_geothermal}) \citep{emile-geay.madec_OS09}.
849
850%% =================================================================================================
851\section[Bottom boundary layer (\textit{trabbl.F90} - \forcode{ln_trabbl})]{Bottom boundary layer (\protect\mdl{trabbl} - \protect\np{ln_trabbl}{ln\_trabbl})}
852\label{sec:TRA_bbl}
853
854\begin{listing}
855  \nlst{nambbl}
856  \caption{\forcode{&nambbl}}
857  \label{lst:nambbl}
858\end{listing}
859
860Options are defined through the \nam{bbl}{bbl} namelist variables.
861In a $z$-coordinate configuration, the bottom topography is represented by a series of discrete steps.
862This is not adequate to represent gravity driven downslope flows.
863Such flows arise either downstream of sills such as the Strait of Gibraltar or Denmark Strait,
864where dense water formed in marginal seas flows into a basin filled with less dense water,
865or along the continental slope when dense water masses are formed on a continental shelf.
866The amount of entrainment that occurs in these gravity plumes is critical in determining the density and
867volume flux of the densest waters of the ocean, such as Antarctic Bottom Water, or North Atlantic Deep Water.
868$z$-coordinate models tend to overestimate the entrainment,
869because the gravity flow is mixed vertically by convection as it goes ''downstairs'' following the step topography,
870sometimes over a thickness much larger than the thickness of the observed gravity plume.
871A similar problem occurs in the $s$-coordinate when the thickness of the bottom level varies rapidly downstream of
872a sill \citep{willebrand.barnier.ea_PO01}, and the thickness of the plume is not resolved.
873
874The idea of the bottom boundary layer (BBL) parameterisation, first introduced by \citet{beckmann.doscher_JPO97},
875is to allow a direct communication between two adjacent bottom cells at different levels,
876whenever the densest water is located above the less dense water.
877The communication can be by a diffusive flux (diffusive BBL), an advective flux (advective BBL), or both.
878In the current implementation of the BBL, only the tracers are modified, not the velocities.
879Furthermore, it only connects ocean bottom cells, and therefore does not include all the improvements introduced by
880\citet{campin.goosse_T99}.
881
882%% =================================================================================================
883\subsection[Diffusive bottom boundary layer (\forcode{nn_bbl_ldf=1})]{Diffusive bottom boundary layer (\protect\np[=1]{nn_bbl_ldf}{nn\_bbl\_ldf})}
884\label{subsec:TRA_bbl_diff}
885
886When applying sigma-diffusion (\np[=.true.]{ln_trabbl}{ln\_trabbl} and \np{nn_bbl_ldf}{nn\_bbl\_ldf} set to 1),
887the diffusive flux between two adjacent cells at the ocean floor is given by
888\[
889  % \label{eq:TRA_bbl_diff}
890  \vect F_\sigma = A_l^\sigma \, \nabla_\sigma T
891\]
892with $\nabla_\sigma$ the lateral gradient operator taken between bottom cells, and
893$A_l^\sigma$ the lateral diffusivity in the BBL.
894Following \citet{beckmann.doscher_JPO97}, the latter is prescribed with a spatial dependence,
895\ie\ in the conditional form
896\begin{equation}
897  \label{eq:TRA_bbl_coef}
898  A_l^\sigma (i,j,t) =
899      \begin{cases}
900        A_{bbl} & \text{if~} \nabla_\sigma \rho \cdot \nabla H < 0 \\
901        \\
902        0      & \text{otherwise} \\
903      \end{cases}
904\end{equation}
905where $A_{bbl}$ is the BBL diffusivity coefficient, given by the namelist parameter \np{rn_ahtbbl}{rn\_ahtbbl} and
906usually set to a value much larger than the one used for lateral mixing in the open ocean.
907The constraint in \autoref{eq:TRA_bbl_coef} implies that sigma-like diffusion only occurs when
908the density above the sea floor, at the top of the slope, is larger than in the deeper ocean
909(see green arrow in \autoref{fig:TRA_bbl}).
910In practice, this constraint is applied separately in the two horizontal directions,
911and the density gradient in \autoref{eq:TRA_bbl_coef} is evaluated with the log gradient formulation:
912\[
913  % \label{eq:TRA_bbl_Drho}
914  \nabla_\sigma \rho / \rho = \alpha \, \nabla_\sigma T + \beta \, \nabla_\sigma S
915\]
916where $\rho$, $\alpha$ and $\beta$ are functions of $\overline T^\sigma$, $\overline S^\sigma$ and
917$\overline H^\sigma$, the along bottom mean temperature, salinity and depth, respectively.
918
919%% =================================================================================================
920\subsection[Advective bottom boundary layer (\forcode{nn_bbl_adv=1,2})]{Advective bottom boundary layer (\protect\np[=1,2]{nn_bbl_adv}{nn\_bbl\_adv})}
921\label{subsec:TRA_bbl_adv}
922
923%\sgacomment{
924%  "downsloping flow" has been replaced by "downslope flow" in the following
925%  if this is not what is meant then "downwards sloping flow" is also a possibility"
926%}
927
928\begin{figure}[!t]
929  \centering
930  \includegraphics[width=0.66\textwidth]{Fig_BBL_adv}
931  \caption[Advective/diffusive bottom boundary layer]{
932    Advective/diffusive Bottom Boundary Layer.
933    The BBL parameterisation is activated when $\rho^i_{kup}$ is larger than $\rho^{i + 1}_{kdnw}$.
934    Red arrows indicate the additional overturning circulation due to the advective BBL.
935    The transport of the downslope flow is defined either
936    as the transport of the bottom ocean cell (black arrow),
937    or as a function of the along slope density gradient.
938    The green arrow indicates the diffusive BBL flux directly connecting
939    $kup$ and $kdwn$ ocean bottom cells.}
940  \label{fig:TRA_bbl}
941\end{figure}
942
943%!!      nn_bbl_adv = 1   use of the ocean velocity as bbl velocity
944%!!      nn_bbl_adv = 2   follow Campin and Goosse (1999) implentation
945%!!        i.e. transport proportional to the along-slope density gradient
946
947%%%gmcomment   :  this section has to be really written
948
949When applying an advective BBL (\np[=1..2]{nn_bbl_adv}{nn\_bbl\_adv}), an overturning circulation is added which
950connects two adjacent bottom grid-points only if dense water overlies less dense water on the slope.
951The density difference causes dense water to move down the slope.
952
953\np[=1]{nn_bbl_adv}{nn\_bbl\_adv}:
954the downslope velocity is chosen to be the Eulerian ocean velocity just above the topographic step
955(see black arrow in \autoref{fig:TRA_bbl}) \citep{beckmann.doscher_JPO97}.
956It is a \textit{conditional advection}, that is, advection is allowed only
957if dense water overlies less dense water on the slope (\ie\ $\nabla_\sigma \rho \cdot \nabla H < 0$) and
958if the velocity is directed towards greater depth (\ie\ $\vect U \cdot \nabla H > 0$).
959
960\np[=2]{nn_bbl_adv}{nn\_bbl\_adv}:
961the downslope velocity is chosen to be proportional to $\Delta \rho$,
962the density difference between the higher cell and lower cell densities \citep{campin.goosse_T99}.
963The advection is allowed only  if dense water overlies less dense water on the slope
964(\ie\ $\nabla_\sigma \rho \cdot \nabla H < 0$).
965For example, the resulting transport of the downslope flow, here in the $i$-direction (\autoref{fig:TRA_bbl}),
966is simply given by the following expression:
967\[
968  % \label{eq:TRA_bbl_Utr}
969  u^{tr}_{bbl} = \gamma g \frac{\Delta \rho}{\rho_o} e_{1u} \, min ({e_{3u}}_{kup},{e_{3u}}_{kdwn})
970\]
971where $\gamma$, expressed in seconds, is the coefficient of proportionality provided as \np{rn_gambbl}{rn\_gambbl},
972a namelist parameter, and \textit{kup} and \textit{kdwn} are the vertical index of the higher and lower cells,
973respectively.
974The parameter $\gamma$ should take a different value for each bathymetric step, but for simplicity,
975and because no direct estimation of this parameter is available, a uniform value has been assumed.
976The possible values for $\gamma$ range between 1 and $10~s$ \citep{campin.goosse_T99}.
977
978Scalar properties are advected by this additional transport $(u^{tr}_{bbl},v^{tr}_{bbl})$ using the upwind scheme.
979Such a diffusive advective scheme has been chosen to mimic the entrainment between the downslope plume and
980the surrounding water at intermediate depths.
981The entrainment is replaced by the vertical mixing implicit in the advection scheme.
982Let us consider as an example the case displayed in \autoref{fig:TRA_bbl} where
983the density at level $(i,kup)$ is larger than the one at level $(i,kdwn)$.
984The advective BBL scheme modifies the tracer time tendency of the ocean cells near the topographic step by
985the downslope flow \autoref{eq:TRA_bbl_dw}, the horizontal \autoref{eq:TRA_bbl_hor} and
986the upward \autoref{eq:TRA_bbl_up} return flows as follows:
987\begin{alignat}{3}
988  \label{eq:TRA_bbl_dw}
989  \partial_t T^{do}_{kdw} &\equiv \partial_t T^{do}_{kdw}
990                                &&+ \frac{u^{tr}_{bbl}}{{b_t}^{do}_{kdw}} &&\lt( T^{sh}_{kup} - T^{do}_{kdw} \rt) \\
991  \label{eq:TRA_bbl_hor}
992  \partial_t T^{sh}_{kup} &\equiv \partial_t T^{sh}_{kup}
993                                &&+ \frac{u^{tr}_{bbl}}{{b_t}^{sh}_{kup}} &&\lt( T^{do}_{kup} - T^{sh}_{kup} \rt) \\
994  %
995  \intertext{and for $k =kdw-1,\;..., \; kup$ :}
996  %
997  \label{eq:TRA_bbl_up}
998  \partial_t T^{do}_{k} &\equiv \partial_t S^{do}_{k}
999                                &&+ \frac{u^{tr}_{bbl}}{{b_t}^{do}_{k}}   &&\lt( T^{do}_{k +1} - T^{sh}_{k}   \rt)
1000\end{alignat}
1001where $b_t$ is the $T$-cell volume.
1002
1003Note that the BBL transport, $(u^{tr}_{bbl},v^{tr}_{bbl})$, is available in the model outputs.
1004It has to be used to compute the effective velocity as well as the effective overturning circulation.
1005
1006%% =================================================================================================
1007\section[Tracer damping (\textit{tradmp.F90})]{Tracer damping (\protect\mdl{tradmp})}
1008\label{sec:TRA_dmp}
1009
1010\begin{listing}
1011  \nlst{namtra_dmp}
1012  \caption{\forcode{&namtra_dmp}}
1013  \label{lst:namtra_dmp}
1014\end{listing}
1015
1016In some applications it can be useful to add a Newtonian damping term into the temperature and salinity equations:
1017\begin{equation}
1018  \label{eq:TRA_dmp}
1019  \begin{gathered}
1020    \pd[T]{t} = \cdots - \gamma (T - T_o) \\
1021    \pd[S]{t} = \cdots - \gamma (S - S_o)
1022  \end{gathered}
1023\end{equation}
1024where $\gamma$ is the inverse of a time scale, and $T_o$ and $S_o$ are given temperature and salinity fields
1025(usually a climatology).
1026Options are defined through the  \nam{tra_dmp}{tra\_dmp} namelist variables.
1027The restoring term is added when the namelist parameter \np{ln_tradmp}{ln\_tradmp} is set to true.
1028It also requires that both \np{ln_tsd_init}{ln\_tsd\_init} and \np{ln_tsd_dmp}{ln\_tsd\_dmp} are set to true in
1029\nam{tsd}{tsd} namelist as well as \np{sn_tem}{sn\_tem} and \np{sn_sal}{sn\_sal} structures are correctly set
1030(\ie\ that $T_o$ and $S_o$ are provided in input files and read using \mdl{fldread},
1031see \autoref{subsec:SBC_fldread}).
1032The restoring coefficient $\gamma$ is a three-dimensional array read in during the \rou{tra\_dmp\_init} routine.
1033The file name is specified by the namelist variable \np{cn_resto}{cn\_resto}.
1034The DMP\_TOOLS tool is provided to allow users to generate the netcdf file.
1035
1036The two main cases in which \autoref{eq:TRA_dmp} is used are
1037\textit{(a)} the specification of the boundary conditions along artificial walls of a limited domain basin and
1038\textit{(b)} the computation of the velocity field associated with a given $T$-$S$ field
1039(for example to build the initial state of a prognostic simulation,
1040or to use the resulting velocity field for a passive tracer study).
1041The first case applies to regional models that have artificial walls instead of open boundaries.
1042In the vicinity of these walls, $\gamma$ takes large values (equivalent to a time scale of a few days) whereas
1043it is zero in the interior of the model domain.
1044The second case corresponds to the use of the robust diagnostic method \citep{sarmiento.bryan_JGR82}.
1045It allows us to find the velocity field consistent with the model dynamics whilst
1046having a $T$, $S$ field close to a given climatological field ($T_o$, $S_o$).
1047
1048The robust diagnostic method is very efficient in preventing temperature drift in intermediate waters but
1049it produces artificial sources of heat and salt within the ocean.
1050It also has undesirable effects on the ocean convection.
1051It tends to prevent deep convection and subsequent deep-water formation, by stabilising the water column too much.
1052
1053The namelist parameter \np{nn_zdmp}{nn\_zdmp} sets whether the damping should be applied in the whole water column or
1054only below the mixed layer (defined either on a density or $S_o$ criterion).
1055It is common to set the damping to zero in the mixed layer as the adjustment time scale is short here
1056\citep{madec.delecluse.ea_JPO96}.
1057
1058For generating \ifile{resto}, see the documentation for the DMP tool provided with the source code under
1059\path{./tools/DMP_TOOLS}.
1060
1061%% =================================================================================================
1062\section[Tracer time evolution (\textit{tranxt.F90})]{Tracer time evolution (\protect\mdl{tranxt})}
1063\label{sec:TRA_nxt}
1064
1065Options are defined through the \nam{dom}{dom} namelist variables.
1066The general framework for tracer time stepping is a modified leap-frog scheme \citep{leclair.madec_OM09},
1067\ie\ a three level centred time scheme associated with a Asselin time filter (cf. \autoref{sec:TD_mLF}):
1068\begin{equation}
1069  \label{eq:TRA_nxt}
1070  \begin{alignedat}{3}
1071    &(e_{3t}T)^{t + \rdt} &&= (e_{3t}T)_f^{t - \rdt} &&+ 2 \, \rdt \,e_{3t}^t \ \text{RHS}^t \\
1072    &(e_{3t}T)_f^t        &&= (e_{3t}T)^t            &&+ \, \gamma \, \lt[ (e_{3t}T)_f^{t - \rdt} - 2(e_{3t}T)^t + (e_{3t}T)^{t + \rdt} \rt] \\
1073    &                     &&                         &&- \, \gamma \, \rdt \, \lt[ Q^{t + \rdt/2} - Q^{t - \rdt/2} \rt]
1074  \end{alignedat}
1075\end{equation}
1076where RHS is the right hand side of the temperature equation, the subscript $f$ denotes filtered values,
1077$\gamma$ is the Asselin coefficient, and $S$ is the total forcing applied on $T$
1078(\ie\ fluxes plus content in mass exchanges).
1079$\gamma$ is initialized as \np{rn_atfp}{rn\_atfp} (\textbf{namelist} parameter).
1080Its default value is \np[=10.e-3]{rn_atfp}{rn\_atfp}.
1081Note that the forcing correction term in the filter is not applied in linear free surface
1082(\jp{ln\_linssh}\forcode{=.true.}) (see \autoref{subsec:TRA_sbc}).
1083Not also that in constant volume case, the time stepping is performed on $T$, not on its content, $e_{3t}T$.
1084
1085When the vertical mixing is solved implicitly, the update of the \textit{next} tracer fields is done in
1086\mdl{trazdf} module.
1087In this case only the swapping of arrays and the Asselin filtering is done in the \mdl{tranxt} module.
1088
1089In order to prepare for the computation of the \textit{next} time step, a swap of tracer arrays is performed:
1090$T^{t - \rdt} = T^t$ and $T^t = T_f$.
1091
1092%% =================================================================================================
1093\section[Equation of state (\textit{eosbn2.F90})]{Equation of state (\protect\mdl{eosbn2})}
1094\label{sec:TRA_eosbn2}
1095
1096\begin{listing}
1097  \nlst{nameos}
1098  \caption{\forcode{&nameos}}
1099  \label{lst:nameos}
1100\end{listing}
1101
1102%% =================================================================================================
1103\subsection[Equation of seawater (\forcode{ln_}\{\forcode{teos10,eos80,seos}\})]{Equation of seawater (\protect\np{ln_teos10}{ln\_teos10}, \protect\np{ln_teos80}{ln\_teos80}, or \protect\np{ln_seos}{ln\_seos})}
1104\label{subsec:TRA_eos}
1105
1106The Equation Of Seawater (EOS) is an empirical nonlinear thermodynamic relationship linking seawater density,
1107$\rho$, to a number of state variables, most typically temperature, salinity and pressure.
1108Because density gradients control the pressure gradient force through the hydrostatic balance,
1109the equation of state provides a fundamental bridge between the distribution of active tracers and
1110the fluid dynamics.
1111Nonlinearities of the EOS are of major importance, in particular influencing the circulation through
1112determination of the static stability below the mixed layer,
1113thus controlling rates of exchange between the atmosphere and the ocean interior \citep{roquet.madec.ea_JPO15}.
1114Therefore an accurate EOS based on either the 1980 equation of state (EOS-80, \cite{fofonoff.millard_bk83}) or
1115TEOS-10 \citep{ioc.iapso_bk10} standards should be used anytime a simulation of the real ocean circulation is attempted
1116\citep{roquet.madec.ea_JPO15}.
1117The use of TEOS-10 is highly recommended because
1118\textit{(i)}   it is the new official EOS,
1119\textit{(ii)}  it is more accurate, being based on an updated database of laboratory measurements, and
1120\textit{(iii)} it uses Conservative Temperature and Absolute Salinity (instead of potential temperature and
1121practical salinity for EOS-80, both variables being more suitable for use as model variables
1122\citep{ioc.iapso_bk10, graham.mcdougall_JPO13}.
1123EOS-80 is an obsolescent feature of the \NEMO\ system, kept only for backward compatibility.
1124For process studies, it is often convenient to use an approximation of the EOS.
1125To that purposed, a simplified EOS (S-EOS) inspired by \citet{vallis_bk06} is also available.
1126
1127In the computer code, a density anomaly, $d_a = \rho / \rho_o - 1$, is computed, with $\rho_o$ a reference density.
1128Called \textit{rau0} in the code, $\rho_o$ is set in \mdl{phycst} to a value of $1,026~Kg/m^3$.
1129This is a sensible choice for the reference density used in a Boussinesq ocean climate model, as,
1130with the exception of only a small percentage of the ocean,
1131density in the World Ocean varies by no more than 2$\%$ from that value \citep{gill_bk82}.
1132
1133Options which control the EOS used are defined through the \nam{eos}{eos} namelist variables.
1134
1135\begin{description}
1136\item [{\np[=.true.]{ln_teos10}{ln\_teos10}}]
1137  the polyTEOS10-bsq equation of seawater \citep{roquet.madec.ea_OM15} is used.
1138  The accuracy of this approximation is comparable to the TEOS-10 rational function approximation,
1139  but it is optimized for a boussinesq fluid and the polynomial expressions have simpler and
1140  more computationally efficient expressions for their derived quantities which make them more adapted for
1141  use in ocean models.
1142  Note that a slightly higher precision polynomial form is now used replacement of
1143  the TEOS-10 rational function approximation for hydrographic data analysis \citep{ioc.iapso_bk10}.
1144  A key point is that conservative state variables are used:
1145  Absolute Salinity (unit: g/kg, notation: $S_A$) and Conservative Temperature (unit: \deg{C}, notation: $\Theta$).
1146  The pressure in decibars is approximated by the depth in meters.
1147  With TEOS10, the specific heat capacity of sea water, $C_p$, is a constant.
1148  It is set to $C_p = 3991.86795711963~J\,Kg^{-1}\,^{\circ}K^{-1}$, according to \citet{ioc.iapso_bk10}.
1149  Choosing polyTEOS10-bsq implies that the state variables used by the model are $\Theta$ and $S_A$.
1150  In particular, the initial state deined by the user have to be given as \textit{Conservative} Temperature and
1151  \textit{Absolute} Salinity.
1152  In addition, when using TEOS10, the Conservative SST is converted to potential SST prior to
1153  either computing the air-sea and ice-sea fluxes (forced mode) or
1154  sending the SST field to the atmosphere (coupled mode).
1155\item [{\np[=.true.]{ln_eos80}{ln\_eos80}}]
1156  the polyEOS80-bsq equation of seawater is used.
1157  It takes the same polynomial form as the polyTEOS10, but the coefficients have been optimized to
1158  accurately fit EOS80 (Roquet, personal comm.).
1159  The state variables used in both the EOS80 and the ocean model are:
1160  the Practical Salinity ((unit: psu, notation: $S_p$)) and
1161  Potential Temperature (unit: $^{\circ}C$, notation: $\theta$).
1162  The pressure in decibars is approximated by the depth in meters.
1163  With thsi EOS, the specific heat capacity of sea water, $C_p$, is a function of temperature, salinity and
1164  pressure \citep{fofonoff.millard_bk83}.
1165  Nevertheless, a severe assumption is made in order to have a heat content ($C_p T_p$) which
1166  is conserved by the model: $C_p$ is set to a constant value, the TEOS10 value.
1167\item [{\np[=.true.]{ln_seos}{ln\_seos}}]
1168  a simplified EOS (S-EOS) inspired by \citet{vallis_bk06} is chosen,
1169  the coefficients of which has been optimized to fit the behavior of TEOS10
1170  (Roquet, personal comm.) (see also \citet{roquet.madec.ea_JPO15}).
1171  It provides a simplistic linear representation of both cabbeling and thermobaricity effects which
1172  is enough for a proper treatment of the EOS in theoretical studies \citep{roquet.madec.ea_JPO15}.
1173  With such an equation of state there is no longer a distinction between
1174  \textit{conservative} and \textit{potential} temperature,
1175  as well as between \textit{absolute} and \textit{practical} salinity.
1176  S-EOS takes the following expression:
1177
1178  \begin{gather*}
1179    % \label{eq:TRA_S-EOS}
1180    \begin{alignedat}{2}
1181    &d_a(T,S,z) = \frac{1}{\rho_o} \big[ &- a_0 \; ( 1 + 0.5 \; \lambda_1 \; T_a + \mu_1 \; z ) * &T_a \big. \\
1182    &                                    &+ b_0 \; ( 1 - 0.5 \; \lambda_2 \; S_a - \mu_2 \; z ) * &S_a       \\
1183    &                              \big. &- \nu \;                           T_a                  &S_a \big] \\
1184    \end{alignedat}
1185    \\
1186    \text{with~} T_a = T - 10 \, ; \, S_a = S - 35 \, ; \, \rho_o = 1026~Kg/m^3
1187  \end{gather*}
1188  where the computer name of the coefficients as well as their standard value are given in \autoref{tab:TRA_SEOS}.
1189  In fact, when choosing S-EOS, various approximation of EOS can be specified simply by
1190  changing the associated coefficients.
1191  Setting to zero the two thermobaric coefficients $(\mu_1,\mu_2)$ remove thermobaric effect from S-EOS.
1192  setting to zero the three cabbeling coefficients $(\lambda_1,\lambda_2,\nu)$ remove cabbeling effect from
1193  S-EOS.
1194  Keeping non-zero value to $a_0$ and $b_0$ provide a linear EOS function of T and S.
1195\end{description}
1196
1197\begin{table}[!tb]
1198  \centering
1199  \begin{tabular}{|l|l|l|l|}
1200    \hline
1201    coeff.     & computer name   & S-EOS           & description                      \\
1202    \hline
1203    $a_0$       & \np{rn_a0}{rn\_a0}     & $1.6550~10^{-1}$ & linear thermal expansion coeff. \\
1204    \hline
1205    $b_0$         & \np{rn_b0}{rn\_b0}       & $7.6554~10^{-1}$ & linear haline  expansion coeff. \\
1206    \hline
1207    $\lambda_1$   & \np{rn_lambda1}{rn\_lambda1}& $5.9520~10^{-2}$ & cabbeling coeff. in $T^2$       \\
1208    \hline
1209    $\lambda_2$   & \np{rn_lambda2}{rn\_lambda2}& $5.4914~10^{-4}$ & cabbeling coeff. in $S^2$       \\
1210    \hline
1211    $\nu$       & \np{rn_nu}{rn\_nu}     & $2.4341~10^{-3}$ & cabbeling coeff. in $T \, S$     \\
1212    \hline
1213    $\mu_1$     & \np{rn_mu1}{rn\_mu1}    & $1.4970~10^{-4}$ & thermobaric coeff. in T         \\
1214    \hline
1215    $\mu_2$     & \np{rn_mu2}{rn\_mu2}    & $1.1090~10^{-5}$ & thermobaric coeff. in S         \\
1216    \hline
1217  \end{tabular}
1218  \caption{Standard value of S-EOS coefficients}
1219  \label{tab:TRA_SEOS}
1220\end{table}
1221
1222%% =================================================================================================
1223\subsection[Brunt-V\"{a}is\"{a}l\"{a} frequency]{Brunt-V\"{a}is\"{a}l\"{a} frequency}
1224\label{subsec:TRA_bn2}
1225
1226An accurate computation of the ocean stability (i.e. of $N$, the brunt-V\"{a}is\"{a}l\"{a} frequency) is of
1227paramount importance as determine the ocean stratification and is used in several ocean parameterisations
1228(namely TKE, GLS, Richardson number dependent vertical diffusion, enhanced vertical diffusion,
1229non-penetrative convection, tidal mixing  parameterisation, iso-neutral diffusion).
1230In particular, $N^2$ has to be computed at the local pressure
1231(pressure in decibar being approximated by the depth in meters).
1232The expression for $N^2$  is given by:
1233\[
1234  % \label{eq:TRA_bn2}
1235  N^2 = \frac{g}{e_{3w}} \lt( \beta \; \delta_{k + 1/2}[S] - \alpha \; \delta_{k + 1/2}[T] \rt)
1236\]
1237where $(T,S) = (\Theta,S_A)$ for TEOS10, $(\theta,S_p)$ for TEOS-80, or $(T,S)$ for S-EOS, and,
1238$\alpha$ and $\beta$ are the thermal and haline expansion coefficients.
1239The coefficients are a polynomial function of temperature, salinity and depth which expression depends on
1240the chosen EOS.
1241They are computed through \textit{eos\_rab}, a \fortran\ function that can be found in \mdl{eosbn2}.
1242
1243%% =================================================================================================
1244\subsection{Freezing point of seawater}
1245\label{subsec:TRA_fzp}
1246
1247The freezing point of seawater is a function of salinity and pressure \citep{fofonoff.millard_bk83}:
1248\begin{equation}
1249  \label{eq:TRA_eos_fzp}
1250  \begin{split}
1251    &T_f (S,p) = \lt( a + b \, \sqrt{S} + c \, S \rt) \, S + d \, p \\
1252    &\text{where~} a = -0.0575, \, b = 1.710523~10^{-3}, \, c = -2.154996~10^{-4} \\
1253    &\text{and~} d = -7.53~10^{-3}
1254    \end{split}
1255\end{equation}
1256
1257\autoref{eq:TRA_eos_fzp} is only used to compute the potential freezing point of sea water
1258(\ie\ referenced to the surface $p = 0$),
1259thus the pressure dependent terms in \autoref{eq:TRA_eos_fzp} (last term) have been dropped.
1260The freezing point is computed through \textit{eos\_fzp},
1261a \fortran\ function that can be found in \mdl{eosbn2}.
1262
1263%% =================================================================================================
1264%\subsection{Potential Energy anomalies}
1265%\label{subsec:TRA_bn2}
1266
1267%    =====>>>>> TO BE written
1268%
1269
1270%% =================================================================================================
1271\section[Horizontal derivative in \textit{zps}-coordinate (\textit{zpshde.F90})]{Horizontal derivative in \textit{zps}-coordinate (\protect\mdl{zpshde})}
1272\label{sec:TRA_zpshde}
1273
1274\gmcomment{STEVEN: to be consistent with earlier discussion of differencing and averaging operators,
1275I've changed "derivative" to "difference" and "mean" to "average"}
1276
1277With partial cells (\np[=.true.]{ln_zps}{ln\_zps}) at bottom and top (\np[=.true.]{ln_isfcav}{ln\_isfcav}),
1278in general, tracers in horizontally adjacent cells live at different depths.
1279Horizontal gradients of tracers are needed for horizontal diffusion (\mdl{traldf} module) and
1280the hydrostatic pressure gradient calculations (\mdl{dynhpg} module).
1281The partial cell properties at the top (\np[=.true.]{ln_isfcav}{ln\_isfcav}) are computed in the same way as
1282for the bottom.
1283So, only the bottom interpolation is explained below.
1284
1285Before taking horizontal gradients between the tracers next to the bottom,
1286a linear interpolation in the vertical is used to approximate the deeper tracer as if
1287it actually lived at the depth of the shallower tracer point (\autoref{fig:TRA_Partial_step_scheme}).
1288For example, for temperature in the $i$-direction the needed interpolated temperature, $\widetilde T$, is:
1289
1290\begin{figure}[!p]
1291  \centering
1292  \includegraphics[width=0.66\textwidth]{Fig_partial_step_scheme}
1293  \caption[Discretisation of the horizontal difference and average of tracers in
1294  the $z$-partial step coordinate]{
1295    Discretisation of the horizontal difference and average of tracers in
1296    the $z$-partial step coordinate (\protect\np[=.true.]{ln_zps}{ln\_zps}) in
1297    the case $(e3w_k^{i + 1} - e3w_k^i) > 0$.
1298    A linear interpolation is used to estimate $\widetilde T_k^{i + 1}$,
1299    the tracer value at the depth of the shallower tracer point of
1300    the two adjacent bottom $T$-points.
1301    The horizontal difference is then given by:
1302    $\delta_{i + 1/2} T_k = \widetilde T_k^{\, i + 1} -T_k^{\, i}$ and
1303    the average by:
1304    $\overline T_k^{\, i + 1/2} = (\widetilde T_k^{\, i + 1/2} - T_k^{\, i}) / 2$.}
1305  \label{fig:TRA_Partial_step_scheme}
1306\end{figure}
1307\[
1308  \widetilde T = \lt\{
1309    \begin{alignedat}{2}
1310      &T^{\, i + 1} &-\frac{ \lt( e_{3w}^{i + 1} -e_{3w}^i \rt) }{ e_{3w}^{i + 1} } \; \delta_k T^{i + 1}
1311      & \quad \text{if $e_{3w}^{i + 1} \geq e_{3w}^i$} \\ \\
1312      &T^{\, i}     &+\frac{ \lt( e_{3w}^{i + 1} -e_{3w}^i \rt )}{e_{3w}^i       } \; \delta_k T^{i + 1}
1313      & \quad \text{if $e_{3w}^{i + 1} <    e_{3w}^i$}
1314    \end{alignedat}
1315  \rt.
1316\]
1317and the resulting forms for the horizontal difference and the horizontal average value of $T$ at a $U$-point are:
1318\begin{equation}
1319  \label{eq:TRA_zps_hde}
1320  \begin{split}
1321    \delta_{i + 1/2} T       &=
1322    \begin{cases}
1323                                \widetilde T - T^i          & \text{if~} e_{3w}^{i + 1} \geq e_{3w}^i \\
1324                                \\
1325                                T^{\, i + 1} - \widetilde T & \text{if~} e_{3w}^{i + 1} <    e_{3w}^i
1326    \end{cases}
1327    \\
1328    \overline T^{\, i + 1/2} &=
1329    \begin{cases}
1330                                (\widetilde T - T^{\, i}   ) / 2 & \text{if~} e_{3w}^{i + 1} \geq e_{3w}^i \\
1331                                \\
1332                                (T^{\, i + 1} - \widetilde T) / 2 & \text{if~} e_{3w}^{i + 1} <   e_{3w}^i
1333    \end{cases}
1334  \end{split}
1335\end{equation}
1336
1337The computation of horizontal derivative of tracers as well as of density is performed once for all at
1338each time step in \mdl{zpshde} module and stored in shared arrays to be used when needed.
1339It has to be emphasized that the procedure used to compute the interpolated density, $\widetilde \rho$,
1340is not the same as that used for $T$ and $S$.
1341Instead of forming a linear approximation of density, we compute $\widetilde \rho$ from the interpolated values of
1342$T$ and $S$, and the pressure at a $u$-point
1343(in the equation of state pressure is approximated by depth, see \autoref{subsec:TRA_eos}):
1344\[
1345  % \label{eq:TRA_zps_hde_rho}
1346  \widetilde \rho = \rho (\widetilde T,\widetilde S,z_u) \quad \text{where~} z_u = \min \lt( z_T^{i + 1},z_T^i \rt)
1347\]
1348
1349This is a much better approximation as the variation of $\rho$ with depth (and thus pressure)
1350is highly non-linear with a true equation of state and thus is badly approximated with a linear interpolation.
1351This approximation is used to compute both the horizontal pressure gradient (\autoref{sec:DYN_hpg}) and
1352the slopes of neutral surfaces (\autoref{sec:LDF_slp}).
1353
1354Note that in almost all the advection schemes presented in this Chapter,
1355both averaging and differencing operators appear.
1356Yet \autoref{eq:TRA_zps_hde} has not been used in these schemes:
1357in contrast to diffusion and pressure gradient computations,
1358no correction for partial steps is applied for advection.
1359The main motivation is to preserve the domain averaged mean variance of the advected field when
1360using the $2^{nd}$ order centred scheme.
1361Sensitivity of the advection schemes to the way horizontal averages are performed in the vicinity of
1362partial cells should be further investigated in the near future.
1363%%%
1364\gmcomment{gm :   this last remark has to be done}
1365%%%
1366
1367\onlyinsubfile{\input{../../global/epilogue}}
1368
1369\end{document}
Note: See TracBrowser for help on using the repository browser.