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 trunk/DOC/TexFiles/Chapters – NEMO

source: trunk/DOC/TexFiles/Chapters/Chap_TRA.tex @ 996

Last change on this file since 996 was 996, checked in by gm, 16 years ago

trunk - DOC update to correct error in previous update

  • Property svn:executable set to *
File size: 70.8 KB
Line 
1% ================================================================
2% Chapter 1 Ñ Ocean Tracers (TRA)
3% ================================================================
4\chapter{Ocean Tracers (TRA)}
5\label{TRA}
6\minitoc
7
8% missing/update
9% traqsr: need to coordinate with SBC module
10% trabbl : advective case to be discussed
11%        diffusive case : add : only the bottom ocean cell is concerned
12%        ==> addfigure on bbl
13
14%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
15
16\newpage
17$\ $\newline    % force a new ligne
18
19Using the representation described in Chap.~\ref{DOM}, several semi-discrete
20space forms of the tracer equations are available depending on the vertical
21coordinate used and on the physics used. In all the equations presented
22here, the masking has been omitted for simplicity. One must be aware that
23all the quantities are masked fields and that each time a mean or difference
24operator is used, the resulting field is multiplied by a mask.
25
26The two active tracers are potential temperature and salinity. Their prognostic
27equations can be summarized as follows:
28\begin{equation*}
29\text{NXT} = \text{ADV}+\text{LDF}+\text{ZDF}+\text{SBC}
30                   \ (+\text{QSR})\ (+\text{BBC})\ (+\text{BBL})\ (+\text{DMP})
31\end{equation*}
32
33NXT stands for next, referring to the time-stepping. From left to right, the terms
34on the rhs of the tracer equations are the advection (ADV), the lateral diffusion
35(LDF), the vertical diffusion (ZDF), the contributions from the external forcings
36(SBC: Surface Boundary Condition, QSR: penetrative Solar Radiation, and BBC:
37Bottom Boundary Condition), the contribution from the bottom boundary Layer
38(BBL) parametrisation, and an internal damping (DMP) term. The terms QSR,
39BBC, BBL and DMP are optional. The external forcings and parameterizations
40require complex inputs and complex calculations (e.g. bulk formulae, estimation
41of mixing coefficients) that are carried out in the SBC, LDF and ZDF modules and
42described in chapters \S\ref{SBC}, \S\ref{LDF} and  \S\ref{ZDF}, respectively.
43Note that \mdl{tranpc}, the non-penetrative convection module,  although
44(temporarily) located in the NEMO/OPA/TRA directory, is described with the
45model vertical physics (ZDF).
46%%%
47\gmcomment{change the position of eosbn2 in the reference code}
48%%%
49
50In the present chapter we also describe the diagnostic equations used to compute
51the sea-water properties (density, Brunt-Vais\"{a}l\"{a} frequency, specific heat and
52freezing point) although the associated modules ($i.e.$ \mdl{eosbn2}, \mdl{ocfzpt} 
53and \mdl{phycst}) are (temporarily) located in the NEMO/OPA directory.
54
55The different options available to the user are managed by namelist logical or
56CPP keys. For each equation term ttt, the namelist logicals are \textit{ln\_trattt\_xxx},
57where \textit{xxx} is a 3 or 4 letter acronym accounting for each optional scheme.
58The CPP key (when it exists) is \textbf{key\_trattt}. The corresponding code can be
59found in the \textit{trattt} or \textit{trattt\_xxx} module, in the NEMO/OPA/TRA directory.
60
61The user has the option of extracting each tendency term on the rhs of the tracer
62equation for output (\key{trdtra} is defined), as described in Chap.~\ref{MISC}.
63
64% ================================================================
65% Tracer Advection
66% ================================================================
67\section  [Tracer Advection (\textit{traadv})]
68      {Tracer Advection (\mdl{traadv})}
69\label{TRA_adv}
70%------------------------------------------nam_traadv-----------------------------------------------------
71\namdisplay{nam_traadv}
72%-------------------------------------------------------------------------------------------------------------
73
74The advection tendency of a tracer in flux form is the divergence of the advective
75fluxes. Its discrete expression is given by :
76\begin{equation} \label{Eq_tra_adv}
77ADV_\tau =-\frac{1}{e_{1T} {\kern 1pt}e_{2T} {\kern 1pt}e_{3T} }\left(
78{\;\delta _i \left[ {e_{2u} {\kern 1pt}e_{3u} {\kern 1pt}\;u\;\tau _u } 
79\right]+\delta _j \left[ {e_{1v} {\kern 1pt}e_{3v} {\kern 1pt}v\;\tau _v } 
80\right]\;} \right)-\frac{1}{\mathop e\nolimits_{3T} }\delta _k \left[
81{w\;\tau _w } \right]
82\end{equation}
83where $\tau$ is either T or S. In pure $z$-coordinate (\key{zco} is defined),
84it reduces to :
85\begin{equation} \label{Eq_tra_adv_zco}
86ADV_\tau =-\frac{1}{e_{1T} {\kern 1pt}e_{2T} {\kern 1pt}}\left( {\;\delta _i
87\left[ {e_{2u} {\kern 1pt}{\kern 1pt}\;u\;\tau _u } \right]+\delta _j \left[
88{e_{1v} {\kern 1pt}v\;\tau _v } \right]\;} \right)-\frac{1}{\mathop 
89e\nolimits_{3T} }\delta _k \left[ {w\;\tau _w } \right]
90\end{equation}
91since the vertical scale factors are functions of $k$ only, and thus $e_{3u}
92=e_{3v} =e_{3T} $.
93
94The flux form in \eqref{Eq_tra_adv} requires implicitly the use of the continuity equation:
95$\nabla \cdot \left( \vect{U}\,T \right)=\vect{U} \cdot \nabla T$ 
96(using $\nabla \cdot \vect{U}=0)$ or $\partial _t e_3 + e_3\;\nabla \cdot \vect{U}=0$
97 in variable volume case ($i.e.$ \key{vvl} defined). Therefore it is of
98paramount importance to design the discrete analogue of the advection
99tendency so that it is consistent with the continuity equation in order to
100enforce the conservation properties of the continuous equations. In other words,
101by substituting $\tau$ by 1 in (\ref{Eq_tra_adv}) we recover the discrete form of
102the continuity equation which is used to calculate the vertical velocity.
103%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
104\begin{figure}[!t] \label{Fig_adv_scheme}  \begin{center}
105\includegraphics[width=0.9\textwidth]{./Figures/Fig_adv_scheme.pdf}
106\caption{Schematic representation of some ways used to evaluate the tracer value
107at $u$-point and the amount of tracer exchanged between two neighbouring grid
108points. Upsteam biased scheme (ups): the upstream value is used and the black
109area is exchanged. Piecewise parabolic method (ppm): a parabolic interpolation
110is used and the black and dark grey areas are exchanged. Monotonic upstream
111scheme for conservative laws (muscl):  a parabolic interpolation is used and black,
112dark grey and grey areas are exchanged. Second order scheme (cen2): the mean
113value is used and black, dark grey, grey and light grey areas are exchanged. Note
114that this illustration does not include the flux limiter used in ppm and muscl schemes.}
115\end{center}   \end{figure}
116%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
117
118The key difference between the advection schemes used in \NEMO is the choice
119made in space and time interpolation to define the value of the tracer at the
120velocity points (Fig.~\ref{Fig_adv_scheme}).
121
122Along solid lateral and bottom boundaries a zero tracer flux is naturally
123specified, since the normal velocity is zero there. At the sea surface the
124boundary condition depends on the type of sea surface chosen:
125\begin{description}
126\item  [rigid-lid formulation:] $w=0$ at the surface, so the advective
127fluxes through the surface are zero.
128\item [linear free surface:] the first level thickness is constant in time:
129the vertical boundary condition is applied at the fixed surface $z=0$ 
130rather than on the moving surface $z=\eta$. There is a non-zero advective
131flux which is set for all advection schemes as the product of surface
132velocity (at $z=0$) by the first level tracer value:
133$\left. {\tau _w } \right|_{k=1/2} =T_{k=1} $.
134\item [non-linear free surface:] (\key{vvl} is defined)
135convergence/divergence in the first ocean level moves the free surface
136up/down. There is no tracer advection through it so that the advective
137fluxes through the surface are also zero
138\end{description}
139In all cases, this boundary condition retains local conservation of tracer.
140Global conservation is obtained in both rigid-lid and non-linear free surface
141cases, but not in the linear free surface case. Nevertheless, in the latter
142case, it is achieved to a good approximation since the non-conservative
143term is the product of the time derivative of the tracer and the free surface
144height, two quantities that are not correlated (see \S\ref{PE_free_surface},
145and also \citet{Roullet2000,Griffies2001,Campin2004}).
146
147The velocity field that appears in (\ref{Eq_tra_adv}) and (\ref{Eq_tra_adv_zco})
148is the centred (\textit{now}) \textit{eulerian} ocean velocity (see Chap.~\ref{DYN}).
149When advective bottom boundary layer (\textit{bbl}) and/or eddy induced velocity
150(\textit{eiv}) parameterisations are used it is the \textit{now} \textit{effective} 
151velocity ($i.e.$ the sum of the eulerian, the bbl and/or the eiv velocities) which is used.
152
153The choice of an advection scheme is made in the \np{nam\_traadv} namelist, by
154setting to \textit{true} one and only one of the logicals \textit{ln\_traadv\_xxx}. The
155corresponding code can be found in the \textit{traadv\_xxx.F90} module, where
156\textit{xxx} is a 3 or 4 letter acronym corresponding to each scheme. Details
157of the advection schemes are given below. The choice of an advection scheme
158is a complex matter which depends on the model physics, model resolution,
159type of tracer, as well as the issue of numerical cost.
160
161Note that
162(1) cen2, cen4 and TVD schemes require an explicit diffusion
163operator while the other schemes are diffusive enough so that they do not
164require additional diffusion ;
165(2) cen2, cen4, MUSCL2, and UBS are not \textit{positive} schemes
166\footnote{negative values can appear in an initially strictly positive tracer field
167which is advected}
168, implying that false extrema are permitted. Their use is not recommended on passive tracers ;
169(3) It is highly recommended that the same advection-diffusion scheme is
170used on both active and passive tracers. Indeed, if a source or sink of a
171passive tracer depends on an active one, the difference of treatment of
172active and passive tracers can create very nice-looking frontal structures
173that are pure numerical artefacts.
174
175% -------------------------------------------------------------------------------------------------------------
176%        2nd order centred scheme 
177% -------------------------------------------------------------------------------------------------------------
178\subsection   [$2^{nd}$ order centred scheme (cen2) (\np{ln\_traadv\_cen2})]
179         {$2^{nd}$ order centred scheme (cen2) (\np{ln\_traadv\_cen2}=.true.)}
180\label{TRA_adv_cen2}
181
182In the centred second order formulation, the tracer at velocity points is
183evaluated as the mean of the two neighbouring $T$-point values.
184For example, in the $i$-direction :
185\begin{equation} \label{Eq_tra_adv_cen2}
186\tau _u^{cen2} =\overline T ^{i+1/2}
187\end{equation}
188
189The scheme is non diffusive ($i.e.$ it conserves the tracer variance, $\tau^2)$ 
190but dispersive ($i.e.$ it may create false extrema). It is therefore notoriously
191noisy and must be used in conjunction with an explicit diffusion operator to
192produce a sensible solution. The associated time-stepping is performed using
193a leapfrog scheme in conjunction with an Asselin time-filter, so $T$ in
194(\ref{Eq_tra_adv_cen2}) is the \textit{now} tracer value.
195
196Note that using the cen2 scheme, the overall tracer advection is of second
197order accuracy since both (\ref{Eq_tra_adv}) and (\ref{Eq_tra_adv_cen2})
198have this order of accuracy.
199
200% -------------------------------------------------------------------------------------------------------------
201%        4nd order centred scheme 
202% -------------------------------------------------------------------------------------------------------------
203\subsection   [$4^{nd}$ order centred scheme (cen4) (\np{ln\_traadv\_cen4})]
204           {$4^{nd}$ order centred scheme (cen4) (\np{ln\_traadv\_cen4}=.true.)}
205\label{TRA_adv_cen4}
206
207In the $4^{th}$ order formulation (to be implemented), tracer values are
208evaluated at velocity points as a $4^{th}$ order interpolation, and thus uses
209the four neighbouring $T$-points. For example, in the $i$-direction:
210\begin{equation} \label{Eq_tra_adv_cen4}
211\tau _u^{cen4} 
212=\overline{   T - \frac{1}{6}\,\delta _i \left[ \delta_{i+1/2}[T] \,\right]   }^{\,i+1/2}
213\end{equation}
214
215Strictly speaking, the cen4 scheme is not a $4^{th}$ order advection scheme
216but a $4^{th}$ order evaluation of advective fluxes, since the divergence of
217advective fluxes \eqref{Eq_tra_adv} is kept at $2^{nd}$ order. The phrase ``$4^{th}$ 
218order scheme'' used in oceanographic literature is usually associated
219with the scheme presented here. Introducing a \textit{true} $4^{th}$ order advection
220scheme is feasible but, for consistency reasons, it requires changes in the
221discretisation of the tracer advection together with changes in both the
222continuity equation and the momentum advection terms. 
223
224A direct consequence of the pseudo-fourth order nature of the scheme is that
225it is not non-diffusive, i.e. the global variance of a tracer is not
226preserved using \textit{cen4}. Furthermore, it must be used in conjunction with an
227explicit diffusion operator to produce a sensible solution. The
228time-stepping is also performed using a leapfrog scheme in conjunction with
229an Asselin time-filter, so $T$ in (\ref{Eq_tra_adv_cen4}) is the \textit{now} tracer.
230
231At a $T$-grid cell adjacent to a boundary (coastline, bottom and surface), an
232additional hypothesis must be made to evaluate $\tau _u^{cen4}$. This
233hypothesis usually reduces the order of the scheme. Here we choose to set
234the gradient of $T$ across the boundary to zero. Alternative conditions can be
235specified, such as a reduction to a second order scheme for these near boundary
236grid points.
237
238% -------------------------------------------------------------------------------------------------------------
239%        TVD scheme 
240% -------------------------------------------------------------------------------------------------------------
241\subsection   [Total Variance Dissipation scheme (TVD) (\np{ln\_traadv\_tvd})]
242         {Total Variance Dissipation scheme (TVD) (\np{ln\_traadv\_tvd}=.true.)}
243\label{TRA_adv_tvd}
244
245In the Total Variance Dissipation (TVD) formulation, the tracer at velocity
246points is evaluated using a combination of an upstream and a centred scheme. For
247example, in the $i$-direction :
248\begin{equation} \label{Eq_tra_adv_tvd}
249\begin{split}
250\tau _u^{ups}&= \begin{cases}
251               T_{i+1}  & \text{if $\ u_{i+1/2} <     0$} \hfill \\
252               T_i         & \text{if $\ u_{i+1/2} \geq 0$} \hfill \\
253              \end{cases}     \\
254\\
255\tau _u^{tvd}&=\tau _u^{ups} +c_u \;\left( {\tau _u^{cen2} -\tau _u^{ups} } \right)
256\end{split}
257\end{equation}
258where $c_u$ is a flux limiter function taking values between 0 and 1. There
259exist many ways to define $c_u$, each correcponding to a different total
260variance decreasing scheme. The one chosen in \NEMO is described in
261\citet{Zalesak1979}. $c_u$ only departs from $1$ when the advective term
262produces a local extremum in the tracer field. The resulting scheme is quite
263expensive but \emph{positive}. It can be used on both active and passive tracers.
264This scheme is tested and compared with MUSCL and the MPDATA scheme in
265\citet{Levy2001}; note that in this paper it is referred to as "FCT" (Flux corrected
266transport) rather than TVD.
267
268For stability reasons (see \S\ref{DOM_nxt}), in (\ref{Eq_tra_adv_tvd})
269$\tau _u^{cen2}$ is evaluated using the \textit{now} tracer while $\tau _u^{ups}$ 
270is evaluated using the \textit{before} tracer. In other words, the advective part of
271the scheme is time stepped with a leap-frog scheme while a forward scheme is
272used for the diffusive part.
273
274% -------------------------------------------------------------------------------------------------------------
275%        MUSCL scheme 
276% -------------------------------------------------------------------------------------------------------------
277\subsection[MUSCL scheme  (\np{ln\_traadv\_muscl})]
278   {Monotone Upstream Scheme for Conservative Laws (MUSCL) (\np{ln\_traadv\_muscl}=T)}
279\label{TRA_adv_muscl}
280
281The Monotone Upstream Scheme for Conservative Laws (MUSCL) has been
282implemented by \citet{Levy2001}. In its formulation, the tracer at velocity points
283is evaluated assuming a linear tracer variation between two $T$-points
284(Fig.\ref{Fig_adv_scheme}). For example, in the $i$-direction :
285\begin{equation} \label{Eq_tra_adv_muscl}
286   \tau _u^{mus} = \left\{      \begin{aligned}
287         &\tau _&+ \frac{1}{2} \;\left( 1-\frac{u_{i+1/2} \;\Delta t}{e_{1u}} \right)
288         &\ \widetilde{\partial _i \tau}  & \quad \text{if }\;u_{i+1/2} \geqslant 0      \\
289         &\tau _{i+1/2} &+\frac{1}{2}\;\left( 1+\frac{u_{i+1/2} \;\Delta t}{e_{1u} } \right)
290         &\ \widetilde{\partial_{i+1/2} \tau } & \text{if }\;u_{i+1/2} <0
291   \end{aligned}    \right.
292\end{equation}
293where $\widetilde{\partial _i \tau}$ is the slope of the tracer on which a limitation
294is imposed to ensure the \textit{positive} character of the scheme.
295
296The time stepping is performed using a forward scheme, that is the \textit{before} 
297tracer field is used to evaluate $\tau _u^{mus}$.
298
299For an ocean grid point adjacent to land and where the ocean velocity is
300directed toward land, two choices are available: an upstream flux
301(\np{ln\_traadv\_muscl}=.true.) or a second order flux
302(\np{ln\_traadv\_muscl2}=.true.). Note that the latter choice does not ensure
303the \textit{positive} character of the scheme. Only the former can be used
304on both active and passive tracers.
305
306% -------------------------------------------------------------------------------------------------------------
307%        UBS scheme 
308% -------------------------------------------------------------------------------------------------------------
309\subsection   [Upstream-Biased Scheme (UBS) (\np{ln\_traadv\_ubs})]
310         {Upstream-Biased Scheme (UBS) (\np{ln\_traadv\_ubs}=.true.)}
311\label{TRA_adv_ubs}
312
313The UBS advection scheme is an upstream-biased third order scheme based on
314an upstream-biased parabolic interpolation. It is also known as the Cell
315Averaged QUICK scheme (Quadratic Upstream Interpolation for Convective
316Kinematics). For example, in the $i$-direction :
317\begin{equation} \label{Eq_tra_adv_ubs}
318   \tau _u^{ubs} =\overline T ^{i+1/2}-\;\frac{1}{6} \left\{     
319   \begin{aligned}
320         &\tau"_i          & \quad \text{if }\ u_{i+1/2} \geqslant 0      \\
321         &\tau"_{i+1}   & \quad \text{if }\ u_{i+1/2}       <       0
322   \end{aligned}    \right.
323\end{equation}
324where $\tau "_i =\delta _i \left[ {\delta _{i+1/2} \left[ \tau \right]} \right]$.
325
326This results in a dissipatively dominant (i.e. hyper-diffusive) truncation
327error \citep{Sacha2005}. The overall performance of the
328advection scheme is similar to that reported in \cite{Farrow1995}.
329It is a relatively good compromise between accuracy and smoothness. It is
330not a \emph{positive} scheme, meaning that false extrema are permitted, but the
331amplitude of such are significantly reduced over the centred second order
332method. Nevertheless it is not recommended that it should be applied to a passive
333tracer that requires positivity.
334
335The intrinsic diffusion of UBS makes its use risky in the vertical direction
336where the control of artificial diapycnal fluxes is of paramount importance.
337Therefore the vertical flux is evaluated using the TVD
338scheme when \np{ln\_traadv\_ubs}=.true..
339
340For stability reasons  (see \S\ref{DOM_nxt}), in \eqref{Eq_tra_adv_ubs},
341the first term (which corresponds to a second order centred scheme)
342is evaluated using the \textit{now} tracer (centred in time) while the
343second term (which is the diffusive part of the scheme), is
344evaluated using the \textit{before} tracer (forward in time).
345This is discussed by \citet{Webb1998} in the context of the Quick
346advection scheme. UBS and QUICK
347schemes only differ by one coefficient. Replacing 1/6 with 1/8 in
348\eqref{Eq_tra_adv_ubs} leads to the QUICK advection scheme
349\citep{Webb1998}. This option is not available through a namelist
350parameter, since the 1/6 coefficient is hard coded. Nevertheless
351it is quite easy to make the substitution in the \mdl{traadv\_ubs} module
352and obtain a QUICK scheme.
353
354Note that :
355
356(1): When a high vertical resolution $O(1m)$ is used, the model stability can
357be controlled by vertical advection (not vertical diffusion which is usually
358solved using an implicit scheme). Computer time can be saved by using a
359time-splitting technique on vertical advection. This case has been
360implemented and validated in ORCA05 with 301 levels. It is not available in the
361current reference version.
362
363(2) : In a forthcoming release four options will be available for the vertical
364component used in the UBS scheme. $\tau _w^{ubs}$ will be evaluated
365using either \textit{(a)} a centred $2^{nd}$ order scheme , or  \textit{(b)} 
366a TVD scheme, or  \textit{(c)} an interpolation based on conservative
367parabolic splines following the \citet{Sacha2005} implementation of UBS
368in ROMS, or  \textit{(d)} a UBS. The $3^{rd}$ case has dispersion properties
369similar to an eighth-order accurate conventional scheme.
370
371following \citet{Sacha2005} implementation of UBS in ROMS, or  \textit{(d)} 
372an UBS. The $3^{rd}$ case has dispersion properties similar to an
373eight-order accurate conventional scheme.
374
375(3) : It is straightforward to rewrite \eqref{Eq_tra_adv_ubs} as follows:
376\begin{equation} \label{Eq_tra_adv_ubs2}
377\tau _u^{ubs} = \left\{  \begin{aligned}
378   & \tau _u^{cen4} + \frac{1}{12} \tau"_i      & \quad \text{if }\ u_{i+1/2} \geqslant 0 \\
379   & \tau _u^{cen4} - \frac{1}{12} \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_tra_adv_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\eqref{Eq_tra_adv_ubs2} has several advantages. Firstly, it clearly reveals
389that the UBS scheme is based on the fourth order scheme to which an
390upstream-biased diffusion term is added. Secondly, this emphasises that the
391$4^{th}$ order part (as well as the $2^{nd}$ order part as stated above) has
392to be evaluated at the \emph{now} time step using \eqref{Eq_tra_adv_ubs}.
393Thirdly, the diffusion term is in fact a biharmonic operator with an eddy
394coefficient which is simply proportional to the velocity:
395 $A_u^{lm}= - \frac{1}{12}\,{e_{1u}}^3\,|u|$. Note that NEMO v2.3 still uses
396 \eqref{Eq_tra_adv_ubs}, not \eqref{Eq_tra_adv_ubs2}. This should be
397 changed in forthcoming release.
398 %%%
399 \gmcomment{the change in UBS scheme has to be done}
400 %%%
401
402% -------------------------------------------------------------------------------------------------------------
403%        QCK scheme 
404% -------------------------------------------------------------------------------------------------------------
405\subsection   [QUICKEST scheme (QCK) (\np{ln\_traadv\_qck})]
406         {QUICKEST scheme (QCK) (\np{ln\_traadv\_qck}=.true.)}
407\label{TRA_adv_qck}
408
409The Quadratic Upstream Interpolation for Convective Kinematics with
410Estimated Streaming Terms (QUICKEST) scheme proposed by \citet{Leonard1979} 
411is the third order Godunov scheme. It is associated with the ULTIMATE QUICKEST
412limiter \citep{Leonard1991}. It has been implemented in NEMO by G. Reffray
413(MERCATOR-ocean).
414The resulting scheme is quite expensive but \emph{positive}. It can be used on both active and passive tracers. Nevertheless, the intrinsic diffusion of QCK makes its use
415risky in the vertical direction where the control of artificial diapycnal fluxes is of
416paramount importance. Therefore the vertical flux is evaluated using the CEN2
417scheme. This no more ensure the positivity of the scheme. The use of TVD in the
418vertical direction as for the UBS case should be implemented to maintain the property.
419
420
421% -------------------------------------------------------------------------------------------------------------
422%        PPM scheme 
423% -------------------------------------------------------------------------------------------------------------
424\subsection   [Piecewise Parabolic Method (PPM) (\np{ln\_traadv\_ppm})]
425         {Piecewise Parabolic Method (PPM) (\np{ln\_traadv\_ppm}=.true.)}
426\label{TRA_adv_ppm}
427
428The Piecewise Parabolic Method (PPM) proposed by Colella and Woodward (1984)
429is based on a quadradic piecewise rebuilding. Like the QCK scheme, it is associated
430with the ULTIMATE QUICKEST limiter \citep{Leonard1991}. It has been implemented
431in \NEMO by G. Reffray (MERCATOR-ocean) but is not yet offered in the reference
432version 2.3.
433
434% ================================================================
435% Tracer Lateral Diffusion
436% ================================================================
437\section  [Tracer Lateral Diffusion (\textit{traldf})]
438      {Tracer Lateral Diffusion (\mdl{traldf})}
439\label{TRA_ldf}
440%-----------------------------------------nam_traldf------------------------------------------------------
441\namdisplay{nam_traldf}
442%-------------------------------------------------------------------------------------------------------------
443 
444The options available for lateral diffusion are a laplacian (rotated or not)
445or a biharmonic operator, the latter being more scale-selective (more
446diffusive at small scales). The specification of eddy diffusivity
447coefficients (either constant or variable in space and time) as well as the
448computation of the slope along which the operators act, are performed in the
449\mdl{ldftra} and \mdl{ldfslp} modules, respectively. This is described in Chap.~\ref{LDF}. The lateral diffusion of tracers is evaluated using a forward scheme,
450$i.e.$ the tracers appearing in its expression are the \textit{before} tracers in time,
451except for the pure vertical component that appears when a rotation tensor
452is used. This latter term is solved implicitly together with the
453vertical diffusion term (see \S\ref{DOM_nxt}).
454
455% -------------------------------------------------------------------------------------------------------------
456%        Iso-level laplacian operator
457% -------------------------------------------------------------------------------------------------------------
458\subsection   [Iso-level laplacian operator (\textit{traldf\_lap} - \np{ln\_traldf\_lap})]
459         {Iso-level laplacian operator (\mdl{traldf\_lap} - \np{ln\_traldf\_lap}=.true.) }
460\label{TRA_ldf_lap}
461
462A laplacian diffusion operator (i.e. a harmonic operator) acting along the model
463surfaces is given by:
464\begin{equation} \label{Eq_tra_ldf_lap}
465\begin{split}
466D_T^{lT} =\frac{1}{e_{1T} \; e_{2T}\;  e_{3T} } &\left[ {\quad \delta _i
467\left[ {A_u^{lT} \left( {\frac{e_{2u} e_{3u} }{e_{1u} }\;\delta _{i+1/2} 
468\left[ T \right]} \right)} \right]} \right.
469\\
470&\ \left. {+\; \delta _j \left[
471{A_v^{lT} \left( {\frac{e_{1v} e_{3v} }{e_{2v} }\;\delta _{j+1/2} \left[ T
472\right]} \right)} \right]\quad } \right]
473\end{split}
474\end{equation}
475
476This lateral operator is a \emph{horizontal} one ($i.e.$ acting along
477geopotential surfaces) in the $z$-coordinate with or without partial step,
478but is simply an iso-level operator in the $s$-coordinate.
479It is thus used when, in addition to \np{ln\_traldf\_lap}=.true., we have
480\np{ln\_traldf\_level}=.true., or both \np{ln\_traldf\_hor}=.true. and
481\np{ln\_zco}=.false.. In both cases, it significantly contributes to
482diapycnal mixing. It is therefore not recommended.
483
484Note that
485(1) In pure $z$-coordinate (\key{zco} is defined), $e_{3u}=e_{3v}=e_{3T}$, so
486that the vertical scale factors disappear from (\ref{Eq_tra_ldf_lap}).
487(2) In partial step $z$-coordinate (\np{ln\_zps}=.true.), tracers in horizontally
488adjacent cells are located at different depths in the vicinity of the bottom.
489In this case, horizontal derivatives in (\ref{Eq_tra_ldf_lap}) at the bottom level
490require a specific treatment. They are calculated in the \mdl{zpshde} module,
491described in \S\ref{TRA_zpshde}.
492
493% -------------------------------------------------------------------------------------------------------------
494%        Rotated laplacian operator
495% -------------------------------------------------------------------------------------------------------------
496\subsection   [Rotated laplacian operator (\textit{traldf\_iso} - \np{ln\_traldf\_lap})]
497         {Rotated laplacian operator (\mdl{traldf\_iso} - \np{ln\_traldf\_lap}=.true.)}
498\label{TRA_ldf_iso}
499
500The general form of the second order lateral tracer subgrid scale physics
501(\ref{Eq_PE_zdf}) takes the following semi-discrete space form in $z$- and
502$s$-coordinates:
503
504\begin{equation} \label{Eq_tra_ldf_iso}
505\begin{split}
506 D_T^{lT} =& \frac{1}{e_{1T}\,e_{2T}\,e_{3T} }
507 \\
508& \left\{ {\delta _i \left[ {A_u^{lT}  \left(
509    {\frac{e_{2u} \; e_{3u} }{e_{1u} } \,\delta _{i+1/2}[T]
510   -e_{2u} \; r_{1u} \,\overline{\overline {\delta _{k+1/2}[T]}}^{\,i+1/2,k}}
511 \right)} \right]} \right.
512\\ 
513& +\delta 
514_j \left[ {A_v^{lT} \left( {\frac{e_{1v}\,e_{3v} }{e_{2v} 
515}\,\delta _{j+1/2} \left[ T \right]-e_{1v}\,r_{2v} 
516\,\overline{\overline {\delta _{k+1/2} \left[ T \right]}} ^{\,j+1/2,k}} 
517\right)} \right]
518\\ 
519& +\delta 
520_k \left[ {A_w^{lT} \left(
521-e_{2w}\,r_{1w} \,\overline{\overline {\delta _{i+1/2} \left[ T \right]}} ^{\,i,k+1/2}
522\right.} \right.
523\\ 
524& \qquad \qquad \quad 
525-e_{1w}\,r_{2w} \,\overline{\overline {\delta _{j+1/2} \left[ T \right]}} ^{\,j,k+1/2}
526\\
527& \left. {\left. { 
528 \quad \quad \quad \left. {{\kern 
5291pt}+\frac{e_{1w}\,e_{2w} }{e_{3w} }\,\left( {r_{1w} ^2+r_{2w} ^2} 
530\right)\,\delta _{k+1/2} \left[ T \right]} \right)} \right]\;\;\;} \right\} 
531 \end{split}
532 \end{equation}
533where $r_1$ and $r_2$ are the slopes between the surface of computation
534($z$- or $s$-surfaces) and the surface along which the diffusion operator
535acts ($i.e.$ horizontal or iso-neutral surfaces).  It is thus used when,
536in addition to \np{ln\_traldf\_lap}=.true., we have \np{ln\_traldf\_iso}=.true.,
537or both \np{ln\_traldf\_hor}=.true. and \np{ln\_zco}=.true.. The way these
538slopes are evaluated is given in \S\ref{LDF_slp}. At the surface, bottom
539and lateral boundaries, the turbulent fluxes of heat and salt are set to zero
540using the mask technique (see \S\ref{LBC_coast}).
541
542The operator in \eqref{Eq_tra_ldf_iso} involves both lateral and vertical
543derivatives. For numerical stability, the vertical second derivative must
544be solved using the same implicit time scheme as that used in the vertical
545physics (see \S\ref{TRA_zdf}). For computer efficiency reasons, this term
546is not computed in the \mdl{traldf} module, but in the \mdl{trazdf} module
547where, if iso-neutral mixing is used, the vertical mixing coefficient is simply
548increased by $\frac{e_{1w}\,e_{2w} }{e_{3w} }\ \left( {r_{1w} ^2+r_{2w} ^2} \right)$.
549
550This formulation conserves the tracer but does not ensure the decrease
551of the tracer variance. Nevertheless the treatment performed on the slopes
552(see \S\ref{LDF}) allows the model to run safely without any additional
553background horizontal diffusion \citep{Guily2001}. An alternative scheme
554\citep{Griffies1998} which preserves both tracer and its variance is currently
555been tested in \NEMO.
556
557Note that in the partial step $z$-coordinate (\np{ln\_zps}=.true.), the horizontal
558derivatives at the bottom level in \eqref{Eq_tra_ldf_iso} require a specific
559treatment. They are calculated in module zpshde, described in \S\ref{TRA_zpshde}.
560
561% -------------------------------------------------------------------------------------------------------------
562%        Iso-level bilaplacian operator
563% -------------------------------------------------------------------------------------------------------------
564\subsection   [Iso-level bilaplacian operator (\textit{traldf\_bilap} - \np{ln\_traldf\_bilap})]
565         {Iso-level bilaplacian operator (\mdl{traldf\_bilap} - \np{ln\_traldf\_bilap}=.true.)}
566\label{TRA_ldf_bilap}
567
568The lateral fourth order bilaplacian operator on tracers is obtained by
569applying (\ref{Eq_tra_ldf_lap}) twice. It requires an additional assumption
570on boundary conditions: the first and third derivative terms normal to the
571coast are set to zero.
572
573It is used when, in addition to \np{ln\_traldf\_bilap}=.true., we have
574\np{ln\_traldf\_level}=.true., or both \np{ln\_traldf\_hor}=.true. and
575\np{ln\_zco}=.false.. In both cases, it can contribute diapycnal mixing,
576although less than in the laplacian case. It is therefore not recommended.
577
578Note that in the code, the bilaplacian routine does not call the laplacian
579routine twice but is rather a separate routine. This is due to the fact that we
580introduce the eddy diffusivity coefficient, A, in the operator as: $\nabla 
581\cdot \nabla \left( {A\nabla \cdot \nabla T} \right)$, instead of
582$-\nabla \cdot a\nabla \left( {\nabla \cdot a\nabla T} \right)$ where
583$a=\sqrt{|A|}$ and $A<0$. This was a mistake: both formulations
584ensure the total variance decrease, but the former requires a larger number
585of code-lines. It will be corrected in a forthcoming release.
586
587% -------------------------------------------------------------------------------------------------------------
588%        Rotated bilaplacian operator
589% -------------------------------------------------------------------------------------------------------------
590\subsection   [Rotated bilaplacian operator (\textit{traldf\_bilapg} - \np{ln\_traldf\_bilap})]
591         {Rotated bilaplacian operator (\mdl{traldf\_bilapg} - \np{ln\_traldf\_bilap}=.true.)}
592\label{TRA_ldf_bilapg}
593
594The lateral fourth order operator formulation on tracers is obtained by
595applying (\ref{Eq_tra_ldf_iso}) twice. It requires an additional assumption
596on boundary conditions: first and third derivative terms normal to the
597coast, the bottom and the surface are set to zero.
598
599It is used when, in addition to \np{ln\_traldf\_bilap}=T, we have
600\np{ln\_traldf\_iso}=T, or both \np{ln\_traldf\_hor}=T and \np{ln\_zco}=T.
601Nevertheless, this rotated bilaplacian operator has never been seriously
602tested. No warranties that it is neither free of bugs or correctly formulated.
603Moreover, the stability range of such an operator will be probably quite
604narrow, requiring a significantly smaller time-step than the one used on
605unrotated operator.
606
607% ================================================================
608% Tracer Vertical Diffusion
609% ================================================================
610\section  [Tracer Vertical Diffusion (\textit{trazdf})]
611      {Tracer Vertical Diffusion (\mdl{trazdf})}
612\label{TRA_zdf}
613%--------------------------------------------namzdf---------------------------------------------------------
614\namdisplay{namzdf}
615%--------------------------------------------------------------------------------------------------------------
616
617The formulation of the vertical subgrid scale tracer physics is the same
618for all the vertical coordinates, and is based on a laplacian operator.
619The vertical diffusion operator given by (\ref{Eq_PE_zdf}) takes the
620following semi-discrete space form:
621(\ref{Eq_PE_zdf}) takes the following semi-discrete space form:
622\begin{equation} \label{Eq_tra_zdf}
623\begin{split}
624D^{vT}_T &= \frac{1}{e_{3T}} \; \delta_k \left[
625\frac{A^{vT}_w}{e_{3w}}  \delta_{k+1/2}[T]   \right]
626\\
627D^{vS}_T &= \frac{1}{e_{3T}} \; \delta_k \left[
628\frac{A^{vS}_w}{e_{3w}}  \delta_{k+1/2}[S]   \right]
629\end{split}
630\end{equation}
631
632where $A_w^{vT}$ and $A_w^{vS}$ are the vertical eddy diffusivity
633coefficients on Temperature and Salinity, respectively. Generally,
634$A_w^{vT}=A_w^{vS}$ except when double diffusive mixing is
635parameterised (\key{zdfddm} is defined). The way these coefficients
636are evaluated is given in \S\ref{ZDF} (ZDF). Furthermore, when
637iso-neutral mixing is used, both mixing coefficients are increased
638by $\frac{e_{1w}\,e_{2w} }{e_{3w} }\ \left( {r_{1w} ^2+r_{2w} ^2} \right)$ 
639to account for the vertical second derivative of \eqref{Eq_tra_ldf_iso}.
640
641At the surface and bottom boundaries, the turbulent fluxes of
642momentum, heat and salt must be specified. At the surface they
643are prescribed from the surface forcing (see \S\ref{TRA_sbc}),
644whilst at the bottom they are set to zero for heat and salt unless
645a geothermal flux forcing is prescribed as a bottom boundary
646condition (\S\ref{TRA_bbc}).
647
648The large eddy coefficient found in the mixed layer together with high
649vertical resolution implies that in the case of explicit time stepping
650(\np{ln\_zdfexp}=.true.) there would be too restrictive a constraint on
651the time step. Therefore, the default implicit time stepping is preferred
652for the vertical diffusion since it overcomes the stability constraint.
653A forward time differencing scheme (\np{ln\_zdfexp}=.true.) using a time
654splitting technique (\np{n\_zdfexp} $> 1$) is provided as an alternative.
655Namelist variables \np{ln\_zdfexp} and \np{n\_zdfexp} apply to both
656tracers and dynamics.
657
658% ================================================================
659% External Forcing
660% ================================================================
661\section{External Forcing}
662\label{TRA_sbc_qsr_bbc}
663
664% -------------------------------------------------------------------------------------------------------------
665%        surface boundary condition
666% -------------------------------------------------------------------------------------------------------------
667\subsection   [Surface boundary condition (\textit{trasbc})]
668         {Surface boundary condition (\mdl{trasbc})}
669\label{TRA_sbc}
670
671The surface boundary condition for tracers is implemented in a separate
672module (\mdl{trasbc}) instead of entering as a boundary condition on the vertical
673diffusion operator (as in the case of momentum). This has been found to
674enhance readability of the code. The two formulations are completely
675equivalent; the forcing terms in trasbc are the surface fluxes divided by
676the thickness of the top model layer. Following \citet{Roullet2000} the
677forcing on an ocean tracer, $c$, can be split into two parts: $F_{ext}$, the
678flux of tracer crossing the sea surface and not linked with the water
679exchange with the atmosphere, $F_{wf}^d$, and $F_{wf}^i$ the forcing
680on the tracer concentration associated with this water exchange.
681The latter forcing has two components: a direct effect of change
682in concentration associated with the tracer carried by the water flux,
683and an indirect concentration/dilution effect :
684\begin{equation*}
685\begin{split}
686 F^C &= F_{ext} + F_{wf}^d                                          +F_{wf}^i    \\
687        &= F_{ext} - \left( c_E \, E - c_p \,P - c_R \,R \right) +c\left( E-P-R \right)
688\end{split}
689\end{equation*} 
690
691\gmcomment{add here a description of the variable names used in the above equation}
692
693Two cases must be distinguished, the nonlinear free surface case
694(\key{vvl} is defined) and the linear free surface case. The first case
695is simpler, because the indirect concentration/dilution effect is naturally
696taken into account by letting the vertical scale factors vary in time.
697The salinity of water exchanged at the surface is assumed to be zero,
698so there is no salt flux at the free surface, except in the presence of sea ice.
699The heat flux at the free surface is the sum of $F_{ext}$, the direct
700heating/cooling (by the total non-penetrative heat flux) and $F_{wf}^e$ 
701the heat carried by the water exchanged through the surface (evaporation,
702precipitation, runoff). The temperature of precipitation is not well known.
703In the model we assume that this water has the same temperature as
704the sea surface temperature. The resulting forcing terms for temperature
705T and salinity S are:
706\begin{equation} \label{Eq_tra_forcing}
707\begin{aligned}
708 &F^T =\frac{Q_{ns} }{\rho _o \;C_p \,e_{3T} }-\frac{\text{EMP}\;\left. T
709\right|_{k=1} }{e_{3T} }  & \\ 
710\\
711& F^S =\frac{\text{EMP}_S\;\left. S \right|_{k=1} }{e_{3T} }   &
712 \end{aligned}
713\end{equation} 
714
715where EMP is the freshwater budget (evaporation minus precipitation
716minus river runoff) which forces the ocean volume, $Q_{ns}$ is the
717non-penetrative part of the net surface heat flux (difference between
718the total surface heat flux and the fraction of the short wave flux that
719penetrates into the water column), the product EMP$_S\;.\left. S \right|_{k=1}$ 
720is  the ice-ocean salt flux, and $\left. S\right|_{k=1}$ is the sea surface
721salinity (\textit{SSS}). The total salt content is conserved in this formulation
722(except for the effect of the Asselin filter).
723
724%AMT note: the ice-ocean flux had been forgotten in the first release of the key_vvl option, has this been corrected in the code?
725
726In the second case (linear free surface), the vertical scale factors are
727fixed in time so that the concentration/dilution effect must be added in
728the \mdl{trasbc} module. Because of the hypothesis made for the
729temperature of precipitation and runoffs, $F_{wf}^e +F_{wf}^i =0$ 
730for temperature. The resulting forcing term for temperature is:
731
732\begin{equation} \label{Eq_tra_forcing_q}
733F^T=\frac{Q_{ns} }{\rho _o \;C_p \,e_{3T} }
734\end{equation} 
735
736The salinity forcing is still given by \eqref{Eq_tra_forcing} but the
737definition of EMP$_S$ is different: it is the total surface freshwater
738budget (evaporation minus precipitation minus river runoff plus
739the rate of change of the sea ice thickness). The total salt content
740is not exactly conserved (\citet{Roullet2000}.
741See also \S\ref{PE_free_surface}).
742
743In the case of the rigid lid approximation, the surface salinity forcing $F^s$ 
744is also expressed by \eqref{Eq_tra_forcing}, but now the global integral of
745the product of EMP and S, is not compensated by the advection of fluid
746through the top level: this is because in the rigid lid case \textit{w(k=1) = 0} 
747(in contrast to the linear free surface case). As a result, even if the budget
748of \textit{EMP} is zero on average over the whole ocean domain, the
749associated salt flux is not, since sea-surface salinity and \textit{EMP} are
750intrinsically correlated (high \textit{SSS} are found where evaporation is
751strong whilst low \textit{SSS} is usually associated with high precipitation
752or river runoff).
753
754The $Q_{ns} $ and \textit{EMP} fields are defined and updated in the
755\mdl{sbcmod} module (see \S\ref{SBC}).
756
757% -------------------------------------------------------------------------------------------------------------
758%        Solar Radiation Penetration
759% -------------------------------------------------------------------------------------------------------------
760\subsection   [Solar Radiation Penetration (\textit{traqsr})]
761         {Solar Radiation Penetration (\mdl{traqsr})}
762\label{TRA_qsr}
763%--------------------------------------------namqsr--------------------------------------------------------
764\namdisplay{namqsr}
765%--------------------------------------------------------------------------------------------------------------
766
767When the penetrative solar radiation option is used (\np{ln\_flxqsr}=.true.),
768the solar radiation penetrates the top few meters of the ocean, otherwise
769all the heat flux is absorbed in the first ocean level (\np{ln\_flxqsr}=.false.).
770Thus, in the former case a term is added to the time evolution equation of
771temperature \eqref{Eq_PE_tra_T} whilst the surface boundary condition is
772modified 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}
780
781where $I$ is the downward irradiance. The additional term in \eqref{Eq_PE_qsr} is discretized as follows:
782\begin{equation} \label{Eq_tra_qsr}
783\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]
784\end{equation}
785
786A formulation involving two extinction coefficients is assumed for the
787downward irradiance $I$ \citep{Paulson1977}:
788\begin{equation} \label{Eq_traqsr_iradiance}
789I(z) = Q_{sr} \left[Re^{-z / \xi_1} + \left( 1-R\right) e^{-z / \xi_2} \right]
790\end{equation}
791where $Q_{sr}$ is the penetrative part of the surface heat flux,
792$\xi_1$ and $\xi_2$ are two extinction length scales and $R$ 
793determines the relative contribution of the two terms.
794The default values used correspond to a Type I water in Jerlov's [1968]
795%
796\gmcomment : Jerlov reference to be added
797%
798classification: $\xi_1 = 0.35m$, $\xi_2 = 0.23m$ and $R = 0.58$ 
799(corresponding to \np{xsi1}, \np{xsi2} and \np{rabs} namelist parameters,
800respectively). $I$ is masked (no flux through the ocean bottom),
801so all the solar radiation that reaches the last ocean level is absorbed
802in that level. The trend in \eqref{Eq_tra_qsr} associated with the
803penetration of the solar radiation is added to the temperature trend,
804and the surface heat flux is modified in routine \mdl{traqsr}.
805Note that in the $z$-coordinate, the depth of $T-$levels depends
806on the single variable $k$. A one dimensional array of the coefficients
807$gdsr(k) = Re^{-z_w (k)/\xi_1} + (1-R)e^{-z_w (k)/\xi_2}$ can then
808be computed once and saved in memory. Moreover \textit{nksr},
809the level at which $gdrs$ becomes negligible (less than the
810computer precision) is computed once, and the trend associated
811with the penetration of the solar radiation is only added until that level.
812Finally, note that when the ocean is shallow (< 200~m), part of the
813solar radiation can reach the ocean floor. In this case, we have
814chosen that all remaining radiation is absorbed in the last ocean
815level ($i.e.$ $I_w$ is masked).
816
817When coupling with a biological model (for example PISCES or LOBSTER),
818it is possible to calculate the light attenuation using information from
819the biology model. Without biological model, it is still possible to introduce
820a horizontal variation of the light attenuation by using the observed ocean
821surface color. At the time of writing, the latter has not been implemented
822 in the reference version.
823%
824\gmcomment{  {yellow}{case 4 bands and bio-coupling to add !!!}  }
825%
826
827% -------------------------------------------------------------------------------------------------------------
828%        Bottom Boundary Condition
829% -------------------------------------------------------------------------------------------------------------
830\subsection   [Bottom Boundary Condition (\textit{trabbc} - \key{bbc})]
831         {Bottom Boundary Condition (\mdl{trabbc} - \key{bbc})}
832\label{TRA_bbc}
833%--------------------------------------------nambbc--------------------------------------------------------
834\namdisplay{nambbc}
835%--------------------------------------------------------------------------------------------------------------
836%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
837\begin{figure}[!t] \label{Fig_geothermal}  \begin{center}
838\includegraphics[width=1.0\textwidth]{./Figures/Fig_TRA_geoth.pdf}
839\caption{Geothermal Heat flux (in $mW.m^{-2}$) as inferred from the age
840of the sea floor and the formulae of \citet{Stein1992}.}
841\end{center}   \end{figure}
842%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
843
844Usually it is assumed that there is no exchange of heat or salt through
845the ocean bottom, $i.e.$ a no flux boundary condition is applied on active
846tracers at the bottom. This is the default option in \NEMO, and it is
847implemented using the masking technique. Hoever, there is a
848non-zero heat flux across the seafloor that is associated with solid
849earth cooling. This flux is weak compared to surface fluxes (a mean
850global value of $\sim0.1\;W/m^2$ \citep{Stein1992}), but it is
851systematically positive and acts on the densest water masses. Taking
852this flux into account in a global ocean model increases
853the deepest overturning cell (i.e. the one associated with the Antarctic
854Bottom Water) by a few Sverdrups.
855
856The presence or not of geothermal heating is controlled by the namelist
857parameter  \np{ngeo\_flux}. If this parameter is set to 1, a constant
858geothermal heating is introduced whose value is given by the
859\np{ngeo\_flux\_const}, which is also a namelist parameter. If it is set to 2,
860a spatially varying geothermal heat flux is introduced which is provided
861in the geothermal\_heating.nc NetCDF file (Fig.\ref{Fig_geothermal}).
862
863% ================================================================
864% Bottom Boundary Layer
865% ================================================================
866\section  [Bottom Boundary Layer (\textit{trabbl}, \textit{trabbl\_adv} )]
867      {Bottom Boundary Layer (\mdl{trabbl}, \mdl{trabbl\_adv})}
868\label{TRA_bbl}
869%--------------------------------------------nambbl---------------------------------------------------------
870\namdisplay{nambbl}
871%--------------------------------------------------------------------------------------------------------------
872
873In a $z$-coordinate configuration, the bottom topography is represented by a
874series of discrete steps. This is not adequate to represent gravity driven
875downslope flows. Such flows arise downstream of sills such as the Strait of
876Gibraltar, Bab El Mandeb, or Denmark Strait, where dense water formed in
877marginal seas flows into a basin filled with less dense water. The amount of
878entrainment that occurs in these gravity plumes is critical in determining the
879density and volume flux of the densest waters of the ocean, such as
880Antarctic Bottom Water, or North Atlantic Deep Water. $z$-coordinate
881models tend to overestimate the entrainment, because the gravity flow is
882mixed down vertically by convection as it goes ``downstairs'' following the
883step topography, sometimes over a thickness much larger than the thickness
884of the observed gravity plume. A similar problem occurs in the $s$-coordinate when
885the thickness of the bottom level varies in large proportions downstream of
886a sill \citep{Willebrand2001}, and the thickness of the plume is not resolved.
887
888The idea of the bottom boundary layer (BBL) parameterization first introduced by
889\citet{BeckDos1998} is to allow a direct communication between
890two adjacent bottom cells at different levels, whenever the densest water is
891located above the less dense water. The communication can be by a diffusive
892(diffusive BBL), advective fluxes (advective BBL), or both. In the current
893implementation of the BBL, only the tracers are modified, not the velocities.
894Furthermore, it only connects ocean bottom cells, and therefore does not include
895the improvment proposed by \citet{Campin_Goosse_Tel99}.
896
897% -------------------------------------------------------------------------------------------------------------
898%        Diffusive BBL
899% -------------------------------------------------------------------------------------------------------------
900\subsection{Diffusive Bottom Boundary layer (\key{bbl\_diff})}
901\label{TRA_bbl_diff}
902
903When applying sigma-diffusion (\key{trabbl} is defined), the diffusive flux between
904two adjacent cells living at the ocean bottom is given by
905\begin{equation} \label{Eq_tra_bbl_diff}
906{\rm {\bf F}}_\sigma=A_l^\sigma \; \nabla_\sigma T
907\end{equation} 
908with $\nabla_\sigma$ the lateral gradient operator taken between bottom cells,
909and  $A_l^\sigma $ the lateral diffusivity in the BBL. Following \citet{BeckDos1998},
910the latter is prescribed with a spatial dependence, $e.g.$ in the conditional form
911\begin{equation} \label{Eq_tra_bbl_coef}
912A_l^\sigma (i,j,t)=\left\{ {\begin{array}{l}
913 A_{bbl}  \quad \quad   \mbox{if}  \quad   \nabla_\sigma \rho  \cdot  \nabla H<0 \\ 
914 \\
915 0\quad \quad \;\,\mbox{otherwise} \\ 
916 \end{array}} \right.
917\end{equation} 
918where $A_{bbl}$ is the BBL diffusivity coefficient, given by the namelist
919parameter \np{atrbbl}. $A_{bbl}$ is usually set to a value much larger
920than the one used on lateral mixing in open ocean.
921Note that in practice, \eqref{Eq_tra_bbl_coef} constraint is applied
922separately in the two horizontal directions, and the density gradient in
923\eqref{Eq_tra_bbl_coef} is evaluated at $\overline{H}^i$ ($\overline{H}^j$)
924using the along bottom mean temperature and salinity.
925
926% -------------------------------------------------------------------------------------------------------------
927%        Advective BBL
928% -------------------------------------------------------------------------------------------------------------
929\subsection   {Advective Bottom Boundary Layer (\key{bbl\_adv})}
930\label{TRA_bbl_adv}
931
932
933%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
934\begin{figure}[!t] \label{Fig_bbl}  \begin{center}
935\includegraphics[width=1.0\textwidth]{./Figures/Fig_BBL_adv.pdf}
936\caption{Advective Bottom Boundary Layer.}
937\end{center}   \end{figure}
938%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
939
940%%%gmcomment   :  this section has to be really written
941
942The advective BBL is in fact not only an advective one but include a diffusive
943component as we chose an upstream scheme to perform the advection within
944the BBL. The associated diffusion only act in the stream direction and is
945proportional to the velocity.
946
947When applying sigma-advection (\key{trabbl\_adv} defined), the advective
948flux between two adjacent cells living at the ocean bottom is given by
949\begin{equation} \label{Eq_tra_bbl_fadv}
950{\rm {\bf F}}_\sigma={\rm {\bf U}}_h^\sigma \; \overline{T}^\sigma
951\end{equation} 
952with $\nabla_\sigma$ the lateral gradient operator taken between bottom cells,
953and  $A_l^\sigma$ the lateral diffusivity in the BBL. Following \citet{BeckDos1998},
954the latter is prescribed with a spatial dependence, $e.g.$ in the conditional form
955\begin{equation} \label{Eq_tra_bbl_Aadv}
956A_l^\sigma (i,j,t)=\left\{ {\begin{array}{l}
957 A_{bbl} \quad \quad \mbox{if}     \quad    \nabla_\sigma \rho \cdot \nabla H<0
958              \quad \quad \mbox{and} \quad         {\rm {\bf U}}_\cdot \nabla H<0 \\ 
959 \\
960 0\quad \quad \;\,\mbox{otherwise} \\ 
961 \end{array}} \right.
962\end{equation} 
963
964% ================================================================
965% Tracer damping
966% ================================================================
967\section  [Tracer damping (\textit{tradmp})]
968      {Tracer damping (\mdl{tradmp})}
969\label{TRA_dmp}
970%--------------------------------------------namdmp-----------------------------------------------------
971\namdisplay{namdmp}
972%--------------------------------------------------------------------------------------------------------------
973
974In some applications it can be useful to add a Newtonian damping term
975into the temperature and salinity equations:
976\begin{equation} \label{Eq_tra_dmp}
977\begin{split}
978 \frac{\partial T}{\partial t}=\;\cdots \;-\gamma \,\left( {T-T_o } \right\\
979\\ 
980 \frac{\partial S}{\partial t}=\;\cdots \;-\gamma \,\left( {S-S_o } \right)
981 \end{split}
982 \end{equation} 
983where $\gamma$ is the inverse of a time scale, and $T_o$ and $S_o$ 
984are given temperature and salinity fields (usually a climatology).
985The restoring term is added when \key{tradmp} is defined.
986It also requires that both \key{temdta} and \key{saldta} are defined
987($i.e.$ that $T_o$ and $S_o$ are read). The restoring coefficient
988$S_o$ is a three-dimensional array initialized by the user in routine
989\rou{dtacof} also located in module \mdl{tradmp}.
990
991The two main cases in which \eqref{Eq_tra_dmp} is used are \textit{(a)} 
992the specification of the boundary conditions along artificial walls of a
993limited domain basin and \textit{(b)} the computation of the velocity
994field associated with a given $T$-$S$ field (for example to build the
995initial state of a prognostic simulation, or to use the resulting velocity
996field for a passive tracer study). The first case applies to regional
997models that have artificial walls instead of open boundaries.
998In the vicinity of these walls, $S_o$ takes large values (equivalent to
999a time scale of a few days) whereas it is zero in the interior of the
1000model domain. The second case corresponds to the use of the robust
1001diagnostic method \citep{Sarmiento1982}. It allows us to find the velocity
1002field consistent with the model dynamics whilst having a $T$-$S$ field
1003close to a given climatological field ($T_o -S_o$). The time scale
1004associated with $S_o$ is generally not a constant but spatially varying
1005in order to respect other properties. For example, it is usually set to zero
1006in the mixed layer (defined either on a density or $S_o$ criterion)
1007\citep{Madec1996} and in the equatorial region
1008\citep{Reverdin1991, Fujio1991, MartiTh1992} since these two regions
1009have a short time scale of adjustment; while smaller $S_o$ are used
1010in the deep ocean where the typical time scale is long \citep{Sarmiento1982}.
1011In addition the time scale is reduced (even to zero) along the western
1012boundary to allow the model to reconstruct its own western boundary
1013structure in equilibrium with its physics. The choice of a
1014Newtonian damping acting in the mixed layer or not is controlled by
1015namelist parameter \np{nmldmp}.
1016
1017The robust diagnostic method is very efficient in preventing temperature
1018drift in intermediate waters but it produces artificial sources of heat and salt
1019within the ocean. It also has undesirable effects on the ocean convection.
1020It tends to prevent deep convection and subsequent deep-water formation,
1021by stabilising the water column too much.
1022
1023An example of the computation of $S_o$ for robust diagnostic experiments
1024with the ORCA2 model is provided in the \mdl{tradmp} module
1025(subroutines \rou{dtacof} and \rou{cofdis} which compute the coefficient
1026and the distance to the bathymetry, respectively). These routines are
1027provided as examples and can be customised by the user.
1028
1029% ================================================================
1030% Tracer time evolution
1031% ================================================================
1032\section  [Tracer time evolution (\textit{tranxt})]
1033      {Tracer time evolution (\mdl{tranxt})}
1034\label{TRA_nxt}
1035%--------------------------------------------namdom-----------------------------------------------------
1036\namdisplay{namdom}
1037%--------------------------------------------------------------------------------------------------------------
1038
1039The general framework for tracer time stepping is a leap-frog scheme,
1040$i.e.$ a three level centred time scheme associated with a Asselin time
1041filter (cf. \S\ref{DOM_nxt}):
1042\begin{equation} \label{Eq_tra_nxt}
1043\begin{split}
1044T^{t+\Delta t} &= T^{t-\Delta t} + 2 \, \Delta t  \ \text{RHS}_T^t   \\
1045\\
1046T_f^\;\ \quad &= T^t \;\quad +\gamma \,\left[ {T_f^{t-\Delta t} -2T^t+T^{t+\Delta t}} \right]
1047\end{split}
1048\end{equation} 
1049
1050where $\text{RHS}_T$ is the right hand side of the temperature equation,
1051the subscript $f$ denotes filtered values and $\gamma$ is the Asselin
1052coefficient. $\gamma$ is initialized as \np{atfp} (\textbf{namelist} parameter).
1053Its default value is \np{atfp=0.1}.
1054
1055When the vertical mixing is solved implicitly, the update of the \textit{next} tracer
1056fields is done in module \mdl{trazdf}. In this case only the swapping of arrays
1057and the Asselin filtering is done in the \mdl{tranxt} module.
1058
1059In order to prepare for the computation of the \textit{next} time step,
1060a swap of tracer arrays is performed: $T^{t-\Delta t} = T^t$ and $T^t = T_f$.
1061
1062% ================================================================
1063% Equation of State (eosbn2)
1064% ================================================================
1065\section  [Equation of State (\textit{eosbn2}) ]
1066      {Equation of State (\mdl{eosbn2}) }
1067\label{TRA_eosbn2}
1068%--------------------------------------------nameos-----------------------------------------------------
1069\namdisplay{nameos}
1070%--------------------------------------------------------------------------------------------------------------
1071
1072% -------------------------------------------------------------------------------------------------------------
1073%        Equation of State
1074% -------------------------------------------------------------------------------------------------------------
1075\subsection{Equation of State (\np{neos} = 0, 1 or 2)}
1076\label{TRA_eos}
1077
1078It is necessary to know the equation of state for the ocean very accurately
1079to determine stability properties (especially the Brunt-Vais\"{a}l\"{a} frequency),
1080particularly in the deep ocean. The ocean density is a non linear empirical
1081function of \textit{in situ }temperature, salinity and pressure. The reference
1082equation of state is that defined by the Joint Panel on Oceanographic Tables
1083and Standards \citep{UNESCO1983}. It was the standard equation of state
1084used in early releases of OPA. However, even though this computation is
1085fully vectorised, it is quite time consuming ($15$ to $20${\%} of the total
1086CPU time) since it requires the prior computation of the \textit{in situ} 
1087temperature from the model \textit{potential} temperature using the
1088\citep{Bryden1973} polynomial for adiabatic lapse rate and a $4^th$ order
1089Runge-Kutta integration scheme. Since OPA6, we have used the
1090\citet{JackMcD1995} equation of state for seawater instead. It allows the
1091computation of the \textit{in situ} ocean density directly as a function of
1092\textit{potential} temperature relative to the surface (an \NEMO variable),
1093the practical salinity (another \NEMO variable) and the pressure (assuming no
1094pressure variation along geopotential surfaces, i.e. the pressure in decibars is
1095approximated by the depth in meters). Both the \citet{UNESCO1983} and \citet{JackMcD1995} equations of state have exactly the same except that
1096the values of the various coefficients have been adjusted by \citet{JackMcD1995} 
1097in order to directly use the \textit{potential} temperature instead of the
1098\textit{in situ} one. This reduces the CPU time of the in situ density computation
1099to about $3${\%} of the total CPU time, while maintaining a quite accurate
1100equation of state.
1101
1102In the computer code, a \textit{true} density $d$ is computed, $i.e.$ the ratio
1103of seawater volumic mass to $\rho_o$, a reference volumic mass (\textit{rau0} 
1104defined in \mdl{phycst}, usually $rau0= 1,020~Kg/m^3$). The default option
1105(namelist prameter \np{neos}=0) is the \citet{JackMcD1995} equation of state.
1106Its use is highly recommended. However, for process studies, it is often
1107convenient to use a linear approximation of the density$^{\ast}$
1108\footnote{$^{\ast }$ With the linear equation of state there is no longer
1109a distinction between \textit{in situ} and \textit{potential} density. Cabling
1110and thermobaric effects are also removed.}.
1111Two linear formulations are available: a function of $T$ only (\np{neos}=1)
1112and a function of both $T$ and $S$ (\np{neos}=2):
1113\begin{equation} \label{Eq_tra_eos_linear}
1114\begin{aligned}
1115 d(T)    &= {\rho (T)} / {\rho _0 } &&= 1.028 - \alpha \;T     \\ 
1116 d(T,S) &= {\rho (T,S)}                &&= \ \ \ \beta \;S - \alpha \;T
1117\end{aligned}
1118\end{equation} 
1119where $\alpha$ and $\beta$ are the thermal and haline expansion
1120coefficients, and $\rho_o$, the reference volumic mass, $rau0$.
1121($\alpha$ and $\beta$ can be modified through the \np{ralpha} and
1122\np{rbeta} namelist parameters). Note that when $d$ is a function
1123of $T$ only (\np{neos}=1), the salinity is a passive tracer and can be
1124used as such.
1125
1126% -------------------------------------------------------------------------------------------------------------
1127%        Brunt-Vais\"{a}l\"{a} Frequency
1128% -------------------------------------------------------------------------------------------------------------
1129\subsection{Brunt-Vais\"{a}l\"{a} Frequency (\np{neos} = 0, 1 or 2)}
1130\label{TRA_bn2}
1131
1132An accurate computation of the ocean stability (i.e. of $N$, the brunt-Vais\"{a}l\"{a}
1133 frequency) is of paramount importance as it is used in several ocean
1134 parameterisations (namely TKE, KPP, Richardson number dependent
1135 vertical diffusion, enhanced vertical diffusion, non-penetrative convection,
1136 iso-neutral diffusion). In particular, one must be aware that $N^2$ has to
1137 be computed with an \textit{in situ} reference. The expression for $N^2$ 
1138 depends on the type of equation of state used (\np{neos} namelist parameter).
1139
1140For \np{neos}=0 (\citet{JackMcD1995} equation of state), the \citet{McDougall1987} 
1141polynomial expression is used (with the pressure in decibar approximated by
1142the depth in meters):
1143\begin{equation} \label{Eq_tra_bn2}
1144N^2 = \frac{g}{e_{3w}} \; \beta   \
1145      \left\alpha / \beta \ \delta_{k+1/2}[T]     - \delta_{k+1/2}[S]   \right)
1146\end{equation} 
1147where $\alpha$ ($\beta$) is the thermal (haline) expansion coefficient.
1148They are a function of 
1149$\overline{T}^{\,k+1/2},\widetilde{S}=\overline{S}^{\,k+1/2} - 35.$,
1150and  $z_w$, with $T$ the \textit{potential} temperature and
1151$\widetilde{S}$ a salinity anomaly.
1152Note that both $\alpha$ and $\beta$ depend on \textit{potential} 
1153temperature and salinity which are averaged at $w$-points prior
1154to the computation instead of being computed at $T$-points and
1155then averaged to $w$-points.
1156
1157When a linear equation of state is used (\np{neos}=1 or 2,
1158\eqref{Eq_tra_bn2} reduces to:
1159\begin{equation} \label{Eq_tra_bn2_linear}
1160N^2 = \frac{g}{e_{3w}} \left(   \beta \;\delta_{k+1/2}[S] - \alpha \;\delta_{k+1/2}[T]   \right)
1161\end{equation} 
1162where $\alpha$ and $\beta $ are the constant coefficients used to
1163defined the linear equation of state \eqref{Eq_tra_eos_linear}.
1164
1165% -------------------------------------------------------------------------------------------------------------
1166%        Specific Heat
1167% -------------------------------------------------------------------------------------------------------------
1168\subsection   [Specific Heat (\textit{phycst})]
1169         {Specific Heat (\mdl{phycst})}
1170\label{TRA_adv_ldf}
1171
1172The specific heat of sea water, $C_p$, is a function of temperature, salinity
1173and pressure \citep{UNESCO1983}. It is only used in the model to convert
1174surface heat fluxes into surface temperature increase and so the pressure
1175dependence is neglected. The dependence on $T$ and $S$ is weak.
1176For example, with $S=35~psu$, $C_p$ increases from $3989$ to $4002$ 
1177when $T$ varies from -2~\degres C to 31~\degres C. Therefore, $C_p$ has
1178been chosen as a constant: $C_p=4.10^3~J\,Kg^{-1}\,\degres K^{-1}$.
1179Its value is set in \mdl{phycst} module.
1180
1181%%%
1182\gmcomment{ STEVEN:  consistency, no other computer variable names are
1183supplied, so why this one}
1184%%%
1185
1186% -------------------------------------------------------------------------------------------------------------
1187%        Freezing Point of Seawater
1188% -------------------------------------------------------------------------------------------------------------
1189\subsection   [Freezing Point of Seawater (\textit{ocfzpt})]
1190         {Freezing Point of Seawater (\mdl{ocfzpt})}
1191\label{TRA_fzp}
1192
1193The freezing point of seawater is a function of salinity and pressure \citep{UNESCO1983}:
1194\begin{equation} \label{Eq_tra_eos_fzp}
1195   \begin{split}
1196T_f (S,p) &= \left( -0.0575 + 1.710523 \;10^{-3} \, \sqrt{S} 
1197                       -  2.154996 \;10^{-4} \,\right) \ S    \\
1198               & - 7.53\,10^{-3}\,p
1199   \end{split}
1200\end{equation}
1201
1202\eqref{Eq_tra_eos_fzp} is only used to compute the potential freezing point of
1203sea water ($i.e.$ referenced to the surface $p=0$), thus the pressure dependent
1204terms in \eqref{Eq_tra_eos_fzp} (last term) have been dropped. The \textit{before} 
1205and \textit{now} surface freezing point is introduced in the code as $fzptb$ and
1206$fzptn$ 2D arrays together with a  \textit{now} mask (\textit{freezn}) which takes
1207the value 0 or 1 depending on whether the ocean temperature is above or at the
1208freezing point. Caution: do not confuse \textit{freezn} with the fraction of lead
1209(\textit{frld}) defined in LIM. 
1210
1211%%%
1212\gmcomment{STEVEN: consistency, not many computer variable names are supplied, so why these    ===>  gm  I agree   this should evolve both here and in the code itself}
1213%%%
1214
1215% ================================================================
1216% Horizontal Derivative in zps-coordinate
1217% ================================================================
1218\section  [Horizontal Derivative in \textit{zps}-coordinate (\textit{zpshde})]
1219      {Horizontal Derivative in \textit{zps}-coordinate (\mdl{zpshde})}
1220\label{TRA_zpshde}
1221
1222\gmcomment{STEVEN: to be consistent with earlier discussion of differencing and averaging operators, I've changed "derivative" to "difference" and "mean" to "average"}
1223
1224With partial bottom cells (\np{ln\_zps}=.true.), in general, tracers in horizontally
1225adjacent cells live at different depths. Horizontal gradients of tracers are needed
1226for horizontal diffusion (\mdl{traldf} module) and for the hydrostatic pressure
1227gradient (\mdl{dynhpg} module) to be active.
1228\gmcomment{STEVEN from gm : question: not sure of  what -to be active- means}
1229Before taking horizontal gradients between the tracers next to the bottom, a linear
1230interpolation in the vertical is used to approximate the deeper tracer as if it actually
1231lived at the depth of the shallower tracer point (Fig.~\ref{Fig_Partial_step_scheme}).
1232For example, for temperature in the $i$-direction the needed interpolated
1233temperature, $\widetilde{T}$, is:
1234
1235%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
1236\begin{figure}[!p] \label{Fig_Partial_step_scheme}  \begin{center}
1237\includegraphics[width=0.9\textwidth]{./Figures/Partial_step_scheme.pdf}
1238\caption{ Discretisation of the horizontal difference and average of tracers in the $z$-partial step coordinate (\np{ln\_zps}=.true.) in the case $( e3w_k^{i+1} - e3w_k^i  )>0$. A linear interpolation is used to estimate $\widetilde{T}_k^{i+1}$, the tracer value at the depth of the shallower tracer point of the two adjacent bottom $T$-points. The horizontal difference is then given by: $\delta _{i+1/2} T_k=  \widetilde{T}_k^{\,i+1} -T_k^{\,i}$ and the average by: $\overline{T}_k^{\,i+1/2}= ( \widetilde{T}_k^{\,i+1/2} - T_k^{\,i} ) / 2$}
1239\end{center}   \end{figure}
1240%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
1241\begin{equation*}
1242\widetilde{T}= \left\{  \begin{aligned} 
1243&T^{\,i+1}      -\frac{ \left( e_{3w}^{i+1} -e_{3w}^i \right)}{ e_{3w}^{i+1} }\;\delta _k T^{i+1} 
1244                        && \quad\text{if  $\ e_{3w}^{i+1} \geq e_{3w}^i$   }  \\
1245                              \\
1246&T^{\,i} \ \ \ \,+\frac{ \left( e_{3w}^{i+1} -e_{3w}^i \right) }{e_{3w}^i       }\;\delta _k T^{i+1}
1247                        && \quad\text{if  $\ e_{3w}^{i+1}    <   e_{3w}^i$   } 
1248            \end{aligned}   \right.
1249\end{equation*}
1250and the resulting forms for the horizontal difference and the horizontal average
1251value of $T$ at a $U$-point are:
1252\begin{equation} \label{Eq_zps_hde}
1253\begin{aligned}
1254 \delta _{i+1/2} T=  \begin{cases}
1255\ \ \ \widetilde {T}\quad\ -T^i     & \ \ \quad\quad\text{if  $\ e_{3w}^{i+1} \geq e_{3w}^i$ } \\
1256                              \\
1257\ \ \ T^{\,i+1}-\widetilde{T}    & \ \ \quad\quad\text{if  $\ e_{3w}^{i+1}    <   e_{3w}^i$   } 
1258                  \end{cases}     \\
1259\\
1260\overline {T}^{\,i+1/2} \ =   \begin{cases}
1261( \widetilde {T}\ \ \;\,-T^{\,i})    / 2  & \;\ \ \quad\text{if  $\ e_{3w}^{i+1} \geq e_{3w}^i$ } \\
1262                              \\
1263( T^{\,i+1}-\widetilde{T} ) / 2     & \;\ \ \quad\text{if  $\ e_{3w}^{i+1}    <   e_{3w}^i$   } 
1264            \end{cases}
1265\end{aligned}
1266\end{equation}
1267
1268The computation of horizontal derivative of tracers as well as of density is
1269performed once for all at each time step in \mdl{zpshde} module and stored
1270in shared arrays to be used when needed. It has to be emphasized that the
1271procedure used to compute the interpolated density, $\widetilde{\rho}$, is not
1272the same as that used for $T$ and $S$. Instead of forming a linear approximation
1273of density, we compute $\widetilde{\rho }$ from the interpolated values of $T$ 
1274and $S$, and the pressure at a $u$-point (in the equation of state pressure is
1275approximated by depth, see \S\ref{TRA_eos} ) :
1276\begin{equation} \label{Eq_zps_hde_rho}
1277\widetilde{\rho } = \rho ( {\widetilde{T},\widetilde {S},z_u })
1278\quad \text{where }\  z_u = \min \left( {z_T^{i+1} ,z_T^i } \right)
1279\end{equation} 
1280
1281This is a much better approximation as the variation of $\rho$ with depth (and
1282thus pressure) is highly non-linear with a true equation of state and thus is badly
1283approximated with a linear interpolation. This approximation is used to compute
1284both the horizontal pressure gradient (\S\ref{DYN_hpg}) and the slopes of neutral
1285surfaces (\S\ref{LDF_slp})
1286
1287Note that in almost all the advection schemes presented in this Chapter, both
1288averaging and differencing operators appear. Yet \eqref{Eq_zps_hde} has not
1289been used in these schemes: in contrast to diffusion and pressure gradient
1290computations, no correction for partial steps is applied for advection. The main
1291motivation is to preserve the domain averaged mean variance of the advected
1292field when using the $2^{nd}$ order centred scheme. Sensitivity of the advection
1293schemes to the way horizontal averages are performed in the vicinity of partial
1294cells should be further investigated in the near future.
1295%%%
1296\gmcomment{gm :   this last remark has to be done}
1297%%%
Note: See TracBrowser for help on using the repository browser.