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/BETA/Chapters – NEMO

source: trunk/DOC/BETA/Chapters/Chap_TRA.tex @ 817

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

trunk - update including Steven correction of the first 5 chapters (until DYN) and activation of Appendix A & B

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