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/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles – NEMO

source: NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/chap_TRA.tex @ 10368

Last change on this file since 10368 was 10368, checked in by smasson, 5 years ago

dev_r10164_HPC09_ESIWACE_PREP_MERGE: merge with trunk@10365, see #2133

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