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

source: tags/nemo_v3_2/nemo_v3_2/DOC/TexFiles/Chapters/Chap_TRA.tex @ 1878

Last change on this file since 1878 was 1878, checked in by flavoni, 14 years ago

initial test for nemogcm

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