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

source: branches/DEV_r1826_DOC/DOC/TexFiles/Chapters/Chap_TRA.tex @ 2195

Last change on this file since 2195 was 2195, checked in by gm, 14 years ago

ticket:#658 update TRA DYN & SBC with sbc, qsr, nxt and rnf considerations

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