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.
Annex_ISO.tex in branches/2015/nemo_v3_6_STABLE/DOC/TexFiles/Chapters – NEMO

source: branches/2015/nemo_v3_6_STABLE/DOC/TexFiles/Chapters/Annex_ISO.tex @ 6993

Last change on this file since 6993 was 6993, checked in by nicolasmartin, 8 years ago

Add missing files and modifications from previous commit

File size: 59.0 KB
Line 
1\documentclass[NEMO_book]{subfiles}
2\begin{document}
3% ================================================================
4% Iso-neutral diffusion :
5% ================================================================
6\chapter[Iso-neutral diffusion and eddy advection using
7triads]{Iso-neutral diffusion and eddy advection using triads}
8\label{sec:triad}
9\minitoc
10\pagebreak
11\section{Choice of \ngn{namtra\_ldf} namelist parameters}
12%-----------------------------------------nam_traldf------------------------------------------------------
13\namdisplay{namtra_ldf}
14%---------------------------------------------------------------------------------------------------------
15If the namelist variable \np{ln\_traldf\_grif} is set true (and
16\key{ldfslp} is set), \NEMO updates both active and passive tracers
17using the Griffies triad representation of iso-neutral diffusion and
18the eddy-induced advective skew (GM) fluxes. Otherwise (by default) the
19filtered version of Cox's original scheme is employed
20(\S\ref{LDF_slp}). In the present implementation of the Griffies
21scheme, the advective skew fluxes are implemented even if
22\key{traldf\_eiv} is not set.
23
24Values of iso-neutral diffusivity and GM coefficient are set as
25described in \S\ref{LDF_coef}. If none of the keys \key{traldf\_cNd},
26N=1,2,3 is set (the default), spatially constant iso-neutral $A_l$ and
27GM diffusivity $A_e$ are directly set by \np{rn\_aeih\_0} and
28\np{rn\_aeiv\_0}. If 2D-varying coefficients are set with
29\key{traldf\_c2d} then $A_l$ is reduced in proportion with horizontal
30scale factor according to \eqref{Eq_title} \footnote{Except in global ORCA
31  $0.5^{\circ}$ runs with \key{traldf\_eiv}, where
32  $A_l$ is set like $A_e$ but with a minimum vale of
33  $100\;\mathrm{m}^2\;\mathrm{s}^{-1}$}. In idealised setups with
34\key{traldf\_c2d}, $A_e$ is reduced similarly, but if \key{traldf\_eiv}
35is set in the global configurations with \key{traldf\_c2d}, a horizontally varying $A_e$ is
36instead set from the Held-Larichev parameterisation\footnote{In this
37  case, $A_e$ at low latitudes $|\theta|<20^{\circ}$ is further
38  reduced by a factor $|f/f_{20}|$, where $f_{20}$ is the value of $f$
39  at $20^{\circ}$~N} (\mdl{ldfeiv}) and \np{rn\_aeiv\_0} is ignored
40unless it is zero.
41
42The options specific to the Griffies scheme include:
43\begin{description}[font=\normalfont]
44\item[\np{ln\_traldf\_gdia}] Default value is false. See \S\ref{sec:triad:sfdiag}. If this is set true, time-mean
45  eddy-advective (GM) velocities are output for diagnostic purposes, even
46  though the eddy advection is accomplished by means of the skew
47  fluxes.
48\item[\np{ln\_traldf\_iso}] See \S\ref{sec:triad:taper}. If this is set false (the default), then
49  `iso-neutral' mixing is accomplished within the surface mixed-layer
50  along slopes linearly decreasing with depth from the value immediately below
51  the mixed-layer to zero (flat) at the surface (\S\ref{sec:triad:lintaper}). This is the same
52  treatment as used in the default implementation
53  \S\ref{LDF_slp_iso}; Fig.~\ref{Fig_eiv_slp}.  Where
54  \np{ln\_traldf\_iso} is set true, the vertical skew flux is further
55  reduced to ensure no vertical buoyancy flux, giving an almost pure
56  horizontal diffusive tracer flux within the mixed layer. This is similar to
57  the tapering suggested by \citet{Gerdes1991}. See \S\ref{sec:triad:Gerdes-taper}
58\item[\np{ln\_traldf\_botmix}] See \S\ref{sec:triad:iso_bdry}. If this
59  is set false (the default) then the lateral diffusive fluxes
60  associated with triads partly masked by topography are neglected. If
61  it is set true, however, then these lateral diffusive fluxes are
62  applied, giving smoother bottom tracer fields at the cost of
63  introducing diapycnal mixing.
64\end{description}
65\section{Triad formulation of iso-neutral diffusion}
66\label{sec:triad:iso}
67We have implemented into \NEMO a scheme inspired by \citet{Griffies_al_JPO98}, but formulated within the \NEMO
68framework, using scale factors rather than grid-sizes.
69
70\subsection{The iso-neutral diffusion operator}
71The iso-neutral second order tracer diffusive operator for small
72angles between iso-neutral surfaces and geopotentials is given by
73\eqref{Eq_PE_iso_tensor}:
74\begin{subequations} \label{eq:triad:PE_iso_tensor}
75  \begin{equation}
76    D^{lT}=-\Div\vect{f}^{lT}\equiv
77    -\frac{1}{e_1e_2e_3}\left[\pd{i}\left (f_1^{lT}e_2e_3\right) +
78      \pd{j}\left (f_2^{lT}e_2e_3\right) + \pd{k}\left (f_3^{lT}e_1e_2\right)\right],
79  \end{equation}
80  where the diffusive flux per unit area of physical space
81  \begin{equation}
82    \vect{f}^{lT}=-\Alt\Re\cdot\grad T,
83  \end{equation}
84  \begin{equation}
85    \label{eq:triad:PE_iso_tensor:c}
86    \mbox{with}\quad \;\;\Re =
87    \begin{pmatrix}
88      1&0&-r_1\mystrut \\
89      0&1&-r_2\mystrut \\
90      -r_1&-r_2&r_1 ^2+r_2 ^2\mystrut
91    \end{pmatrix}
92    \quad \text{and} \quad\grad T=
93    \begin{pmatrix}
94      \frac{1}{e_1}\pd[T]{i}\mystrut \\
95      \frac{1}{e_2}\pd[T]{j}\mystrut \\
96      \frac{1}{e_3}\pd[T]{k}\mystrut
97    \end{pmatrix}.
98  \end{equation}
99\end{subequations}
100% \left( {{\begin{array}{*{20}c}
101%  1 \hfill & 0 \hfill & {-r_1 } \hfill \\
102%  0 \hfill & 1 \hfill & {-r_2 } \hfill \\
103%  {-r_1 } \hfill & {-r_2 } \hfill & {r_1 ^2+r_2 ^2} \hfill \\
104% \end{array} }} \right)
105 Here \eqref{Eq_PE_iso_slopes}
106\begin{align*}
107  r_1 &=-\frac{e_3 }{e_1 } \left( \frac{\partial \rho }{\partial i}
108  \right)
109  \left( {\frac{\partial \rho }{\partial k}} \right)^{-1} \\
110  &=-\frac{e_3 }{e_1 } \left( -\alpha\frac{\partial T }{\partial i} +
111    \beta\frac{\partial S }{\partial i} \right) \left(
112    -\alpha\frac{\partial T }{\partial k} + \beta\frac{\partial S
113    }{\partial k} \right)^{-1}
114\end{align*}
115is the $i$-component of the slope of the iso-neutral surface relative to the computational
116surface, and $r_2$ is the $j$-component.
117
118We will find it useful to consider the fluxes per unit area in $i,j,k$
119space; we write
120\begin{equation}
121  \label{eq:triad:Fijk}
122  \vect{F}_{\mathrm{iso}}=\left(f_1^{lT}e_2e_3, f_2^{lT}e_1e_3, f_3^{lT}e_1e_2\right).
123\end{equation}
124Additionally, we will sometimes write the contributions towards the
125fluxes $\vect{f}$ and $\vect{F}_\mathrm{iso}$ from the component
126$R_{ij}$ of $\Re$ as $f_{ij}$, $F_{\mathrm{iso}\: ij}$, with
127$f_{ij}=R_{ij}e_i^{-1}\partial T/\partial x_i$ (no summation) etc.
128
129The off-diagonal terms of the small angle diffusion tensor
130\eqref{Eq_PE_iso_tensor}, \eqref{eq:triad:PE_iso_tensor:c} produce skew-fluxes along the
131$i$- and $j$-directions resulting from the vertical tracer gradient:
132\begin{align}
133  \label{eq:triad:i13c}
134  f_{13}=&+\Alt r_1\frac{1}{e_3}\frac{\partial T}{\partial k},\qquad f_{23}=+\Alt r_2\frac{1}{e_3}\frac{\partial T}{\partial k}\\
135\intertext{and in the k-direction resulting from the lateral tracer gradients}
136  \label{eq:triad:i31c}
137 f_{31}+f_{32}=& \Alt r_1\frac{1}{e_1}\frac{\partial T}{\partial i}+\Alt r_2\frac{1}{e_1}\frac{\partial T}{\partial i}
138\end{align}
139
140The vertical diffusive flux associated with the $_{33}$
141component of the small angle diffusion tensor is
142\begin{equation}
143  \label{eq:triad:i33c}
144  f_{33}=-\Alt(r_1^2 +r_2^2) \frac{1}{e_3}\frac{\partial T}{\partial k}.
145\end{equation}
146
147Since there are no cross terms involving $r_1$ and $r_2$ in the above, we can
148consider the iso-neutral diffusive fluxes separately in the $i$-$k$ and $j$-$k$
149planes, just adding together the vertical components from each
150plane. The following description will describe the fluxes on the $i$-$k$
151plane.
152
153There is no natural discretization for the $i$-component of the
154skew-flux, \eqref{eq:triad:i13c}, as
155although it must be evaluated at $u$-points, it involves vertical
156gradients (both for the tracer and the slope $r_1$), defined at
157$w$-points. Similarly, the vertical skew flux, \eqref{eq:triad:i31c}, is evaluated at
158$w$-points but involves horizontal gradients defined at $u$-points.
159
160\subsection{The standard discretization}
161The straightforward approach to discretize the lateral skew flux
162\eqref{eq:triad:i13c} from tracer cell $i,k$ to $i+1,k$, introduced in 1995
163into OPA, \eqref{Eq_tra_ldf_iso}, is to calculate a mean vertical
164gradient at the $u$-point from the average of the four surrounding
165vertical tracer gradients, and multiply this by a mean slope at the
166$u$-point, calculated from the averaged surrounding vertical density
167gradients. The total area-integrated skew-flux (flux per unit area in
168$ijk$ space) from tracer cell $i,k$
169to $i+1,k$, noting that the $e_{{3}_{i+1/2}^k}$ in the area
170$e{_{3}}_{i+1/2}^k{e_{2}}_{i+1/2}i^k$ at the $u$-point cancels out with
171the $1/{e_{3}}_{i+1/2}^k$ associated with the vertical tracer
172gradient, is then \eqref{Eq_tra_ldf_iso}
173\begin{equation*}
174  \left(F_u^{13} \right)_{i+\hhalf}^k = \Alts_{i+\hhalf}^k
175  {e_{2}}_{i+1/2}^k \overline{\overline
176    r_1} ^{\,i,k}\,\overline{\overline{\delta_k T}}^{\,i,k},
177\end{equation*}
178where
179\begin{equation*}
180  \overline{\overline
181   r_1} ^{\,i,k} = -\frac{{e_{3u}}_{i+1/2}^k}{{e_{1u}}_{i+1/2}^k}
182  \frac{\delta_{i+1/2} [\rho]}{\overline{\overline{\delta_k \rho}}^{\,i,k}},
183\end{equation*}
184and here and in the following we drop the $^{lT}$ superscript from
185$\Alt$ for simplicity.
186Unfortunately the resulting combination $\overline{\overline{\delta_k
187    \bullet}}^{\,i,k}$ of a $k$ average and a $k$ difference %of the tracer
188reduces to $\bullet_{k+1}-\bullet_{k-1}$, so two-grid-point oscillations are
189invisible to this discretization of the iso-neutral operator. These
190\emph{computational modes} will not be damped by this operator, and
191may even possibly be amplified by it.  Consequently, applying this
192operator to a tracer does not guarantee the decrease of its
193global-average variance. To correct this, we introduced a smoothing of
194the slopes of the iso-neutral surfaces (see \S\ref{LDF}). This
195technique works for $T$ and $S$ in so far as they are active tracers
196($i.e.$ they enter the computation of density), but it does not work
197for a passive tracer.
198\subsection{Expression of the skew-flux in terms of triad slopes}
199\citep{Griffies_al_JPO98} introduce a different discretization of the
200off-diagonal terms that nicely solves the problem.
201% Instead of multiplying the mean slope calculated at the $u$-point by
202% the mean vertical gradient at the $u$-point,
203% >>>>>>>>>>>>>>>>>>>>>>>>>>>>
204\begin{figure}[h] \begin{center}
205    \includegraphics[width=1.05\textwidth]{Fig_GRIFF_triad_fluxes}
206    \caption{ \label{fig:triad:ISO_triad}
207      (a) Arrangement of triads $S_i$ and tracer gradients to
208           give lateral tracer flux from box $i,k$ to $i+1,k$
209      (b) Triads $S'_i$ and tracer gradients to give vertical tracer flux from
210            box $i,k$ to $i,k+1$.}
211 \end{center} \end{figure}
212% >>>>>>>>>>>>>>>>>>>>>>>>>>>>
213They get the skew flux from the products of the vertical gradients at
214each $w$-point surrounding the $u$-point with the corresponding `triad'
215slope calculated from the lateral density gradient across the $u$-point
216divided by the vertical density gradient at the same $w$-point as the
217tracer gradient. See Fig.~\ref{fig:triad:ISO_triad}a, where the thick lines
218denote the tracer gradients, and the thin lines the corresponding
219triads, with slopes $s_1, \dotsc s_4$. The total area-integrated
220skew-flux from tracer cell $i,k$ to $i+1,k$
221\begin{multline}
222  \label{eq:triad:i13}
223  \left( F_u^{13}  \right)_{i+\frac{1}{2}}^k = \Alts_{i+1}^k a_1 s_1
224  \delta _{k+\frac{1}{2}} \left[ T^{i+1}
225  \right]/e_{{3w}_{i+1}}^{k+\frac{1}{2}}  + \Alts _i^k a_2 s_2 \delta
226  _{k+\frac{1}{2}} \left[ T^i
227  \right]/e_{{3w}_{i+1}}^{k+\frac{1}{2}} \\
228   +\Alts _{i+1}^k a_3 s_3 \delta _{k-\frac{1}{2}} \left[ T^{i+1}
229  \right]/e_{{3w}_{i+1}}^{k+\frac{1}{2}}  +\Alts _i^k a_4 s_4 \delta
230  _{k-\frac{1}{2}} \left[ T^i \right]/e_{{3w}_{i+1}}^{k+\frac{1}{2}},
231\end{multline}
232where the contributions of the triad fluxes are weighted by areas
233$a_1, \dotsc a_4$, and $\Alts$ is now defined at the tracer points
234rather than the $u$-points. This discretization gives a much closer
235stencil, and disallows the two-point computational modes.
236
237 The vertical skew flux \eqref{eq:triad:i31c} from tracer cell $i,k$ to $i,k+1$ at the
238$w$-point $i,k+\hhalf$ is constructed similarly (Fig.~\ref{fig:triad:ISO_triad}b)
239by multiplying lateral tracer gradients from each of the four
240surrounding $u$-points by the appropriate triad slope:
241\begin{multline}
242  \label{eq:triad:i31}
243  \left( F_w^{31} \right) _i ^{k+\frac{1}{2}} =  \Alts_i^{k+1} a_{1}'
244  s_{1}' \delta _{i-\frac{1}{2}} \left[ T^{k+1} \right]/{e_{3u}}_{i-\frac{1}{2}}^{k+1}
245   +\Alts_i^{k+1} a_{2}' s_{2}' \delta _{i+\frac{1}{2}} \left[ T^{k+1} \right]/{e_{3u}}_{i+\frac{1}{2}}^{k+1}\\
246  + \Alts_i^k a_{3}' s_{3}' \delta _{i-\frac{1}{2}} \left[ T^k\right]/{e_{3u}}_{i-\frac{1}{2}}^k
247  +\Alts_i^k a_{4}' s_{4}' \delta _{i+\frac{1}{2}} \left[ T^k \right]/{e_{3u}}_{i+\frac{1}{2}}^k.
248\end{multline}
249
250We notate the triad slopes $s_i$ and $s'_i$ in terms of the `anchor point' $i,k$
251(appearing in both the vertical and lateral gradient), and the $u$- and
252$w$-points $(i+i_p,k)$, $(i,k+k_p)$ at the centres of the `arms' of the
253triad as follows (see also Fig.~\ref{fig:triad:ISO_triad}):
254\begin{equation}
255  \label{eq:triad:R}
256  _i^k \mathbb{R}_{i_p}^{k_p}
257  =-\frac{ {e_{3w}}_{\,i}^{\,k+k_p}} { {e_{1u}}_{\,i+i_p}^{\,k}}
258  \
259  \frac
260  {\left(\alpha / \beta \right)_i^\ \delta_{i + i_p}[T^k] - \delta_{i + i_p}[S^k] }
261  {\left(\alpha / \beta \right)_i^\ \delta_{k+k_p}[T^i ] - \delta_{k+k_p}[S^i ] }.
262\end{equation}
263In calculating the slopes of the local neutral
264surfaces, the expansion coefficients $\alpha$ and $\beta$ are
265evaluated at the anchor points of the triad \footnote{Note that in \eqref{eq:triad:R} we use the ratio $\alpha / \beta$
266instead of multiplying the temperature derivative by $\alpha$ and the
267salinity derivative by $\beta$. This is more efficient as the ratio
268$\alpha / \beta$ can to be evaluated directly}, while the metrics are
269calculated at the $u$- and $w$-points on the arms.
270
271% >>>>>>>>>>>>>>>>>>>>>>>>>>>>
272\begin{figure}[h] \begin{center}
273    \includegraphics[width=0.80\textwidth]{Fig_GRIFF_qcells}
274    \caption{   \label{fig:triad:qcells}
275    Triad notation for quarter cells. $T$-cells are inside
276      boxes, while the  $i+\half,k$ $u$-cell is shaded in green and the
277      $i,k+\half$ $w$-cell is shaded in pink.}
278  \end{center} \end{figure}
279% >>>>>>>>>>>>>>>>>>>>>>>>>>>>
280
281Each triad $\{_i^k\:_{i_p}^{k_p}\}$ is associated (Fig.~\ref{fig:triad:qcells}) with the quarter
282cell that is the intersection of the $i,k$ $T$-cell, the $i+i_p,k$
283$u$-cell and the $i,k+k_p$ $w$-cell. Expressing the slopes $s_i$ and
284$s'_i$ in \eqref{eq:triad:i13} and \eqref{eq:triad:i31} in this notation, we have
285e.g.\ $s_1=s'_1={\:}_i^k \mathbb{R}_{1/2}^{1/2}$. Each triad slope $_i^k
286\mathbb{R}_{i_p}^{k_p}$ is used once (as an $s$) to calculate the
287lateral flux along its $u$-arm, at $(i+i_p,k)$, and then again as an
288$s'$ to calculate the vertical flux along its $w$-arm at
289$(i,k+k_p)$. Each vertical area $a_i$ used to calculate the lateral
290flux and horizontal area $a'_i$ used to calculate the vertical flux
291can also be identified as the area across the $u$- and $w$-arms of a
292unique triad, and we notate these areas, similarly to the triad
293slopes, as $_i^k{\mathbb{A}_u}_{i_p}^{k_p}$,
294$_i^k{\mathbb{A}_w}_{i_p}^{k_p}$, where e.g. in \eqref{eq:triad:i13}
295$a_{1}={\:}_i^k{\mathbb{A}_u}_{1/2}^{1/2}$, and in \eqref{eq:triad:i31}
296$a'_{1}={\:}_i^k{\mathbb{A}_w}_{1/2}^{1/2}$.
297
298\subsection{The full triad fluxes}
299A key property of iso-neutral diffusion is that it should not affect
300the (locally referenced) density. In particular there should be no
301lateral or vertical density flux. The lateral density flux disappears so long as the
302area-integrated lateral diffusive flux from tracer cell $i,k$ to
303$i+1,k$ coming from the $_{11}$ term of the diffusion tensor takes the
304form
305\begin{equation}
306  \label{eq:triad:i11}
307  \left( F_u^{11} \right) _{i+\frac{1}{2}} ^{k} =
308  - \left( \Alts_i^{k+1} a_{1} + \Alts_i^{k+1} a_{2} + \Alts_i^k
309    a_{3} + \Alts_i^k a_{4} \right)
310  \frac{\delta _{i+1/2} \left[ T^k\right]}{{e_{1u}}_{\,i+1/2}^{\,k}},
311\end{equation}
312where the areas $a_i$ are as in \eqref{eq:triad:i13}. In this case,
313separating the total lateral flux, the sum of \eqref{eq:triad:i13} and
314\eqref{eq:triad:i11}, into triad components, a lateral tracer
315flux
316\begin{equation}
317  \label{eq:triad:latflux-triad}
318  _i^k {\mathbb{F}_u}_{i_p}^{k_p} (T) = - \Alts_i^k{ \:}_i^k{\mathbb{A}_u}_{i_p}^{k_p}
319  \left(
320    \frac{ \delta_{i+ i_p}[T^k] }{ {e_{1u}}_{\,i + i_p}^{\,k} }
321    -\ {_i^k\mathbb{R}_{i_p}^{k_p}} \
322    \frac{ \delta_{k+k_p} [T^i] }{{e_{3w}}_{\,i}^{\,k+k_p} }
323  \right)
324\end{equation}
325can be identified with each triad. Then, because the
326same metric factors ${e_{3w}}_{\,i}^{\,k+k_p}$ and
327${e_{1u}}_{\,i+i_p}^{\,k}$ are employed for both the density gradients
328in $ _i^k \mathbb{R}_{i_p}^{k_p}$ and the tracer gradients, the lateral
329density flux associated with each triad separately disappears.
330\begin{equation}
331  \label{eq:triad:latflux-rho}
332  {\mathbb{F}_u}_{i_p}^{k_p} (\rho)=-\alpha _i^k {\:}_i^k {\mathbb{F}_u}_{i_p}^{k_p} (T) + \beta_i^k {\:}_i^k {\mathbb{F}_u}_{i_p}^{k_p} (S)=0
333\end{equation}
334Thus the total flux $\left( F_u^{31} \right) ^i _{i,k+\frac{1}{2}} +
335\left( F_u^{11} \right) ^i _{i,k+\frac{1}{2}}$ from tracer cell $i,k$
336to $i+1,k$ must also vanish since it is a sum of four such triad fluxes.
337
338The squared slope $r_1^2$ in the expression \eqref{eq:triad:i33c} for the
339$_{33}$ component is also expressed in terms of area-weighted
340squared triad slopes, so the area-integrated vertical flux from tracer
341cell $i,k$ to $i,k+1$ resulting from the $r_1^2$ term is
342\begin{equation}
343  \label{eq:triad:i33}
344  \left( F_w^{33} \right) _i^{k+\frac{1}{2}} =
345    - \left( \Alts_i^{k+1} a_{1}' s_{1}'^2
346    + \Alts_i^{k+1} a_{2}' s_{2}'^2
347    + \Alts_i^k a_{3}' s_{3}'^2
348    + \Alts_i^k a_{4}' s_{4}'^2 \right)\delta_{k+\frac{1}{2}} \left[ T^{i+1} \right],
349\end{equation}
350where the areas $a'$ and slopes $s'$ are the same as in
351\eqref{eq:triad:i31}.
352Then, separating the total vertical flux, the sum of \eqref{eq:triad:i31} and
353\eqref{eq:triad:i33}, into triad components,  a vertical flux
354\begin{align}
355  \label{eq:triad:vertflux-triad}
356  _i^k {\mathbb{F}_w}_{i_p}^{k_p} (T)
357  &= \Alts_i^k{\: }_i^k{\mathbb{A}_w}_{i_p}^{k_p}
358  \left(
359    {_i^k\mathbb{R}_{i_p}^{k_p}}\frac{ \delta_{i+ i_p}[T^k] }{ {e_{1u}}_{\,i + i_p}^{\,k} }
360    -\ \left({_i^k\mathbb{R}_{i_p}^{k_p}}\right)^2 \
361    \frac{ \delta_{k+k_p} [T^i] }{{e_{3w}}_{\,i}^{\,k+k_p} }
362  \right) \\
363  &= - \left(\left.{ }_i^k{\mathbb{A}_w}_{i_p}^{k_p}\right/{ }_i^k{\mathbb{A}_u}_{i_p}^{k_p}\right)
364   {_i^k\mathbb{R}_{i_p}^{k_p}}{\: }_i^k{\mathbb{F}_u}_{i_p}^{k_p} (T) \label{eq:triad:vertflux-triad2}
365\end{align}
366may be associated with each triad. Each vertical density flux $_i^k {\mathbb{F}_w}_{i_p}^{k_p} (\rho)$
367associated with a triad then separately disappears (because the
368lateral flux $_i^k{\mathbb{F}_u}_{i_p}^{k_p} (\rho)$
369disappears). Consequently the total vertical density flux $\left( F_w^{31} \right)_i ^{k+\frac{1}{2}} +
370\left( F_w^{33} \right)_i^{k+\frac{1}{2}}$ from tracer cell $i,k$
371to $i,k+1$ must also vanish since it is a sum of four such triad
372fluxes.
373
374We can explicitly identify (Fig.~\ref{fig:triad:qcells}) the triads associated with the $s_i$, $a_i$, and $s'_i$, $a'_i$ used in the definition of
375the $u$-fluxes and $w$-fluxes in
376\eqref{eq:triad:i31}, \eqref{eq:triad:i13}, \eqref{eq:triad:i11} \eqref{eq:triad:i33} and
377Fig.~\ref{fig:triad:ISO_triad} to  write out the iso-neutral fluxes at $u$- and
378$w$-points as sums of the triad fluxes that cross the $u$- and $w$-faces:
379%(Fig.~\ref{Fig_ISO_triad}):
380\begin{flalign} \label{Eq_iso_flux} \vect{F}_\mathrm{iso}(T) &\equiv
381  \sum_{\substack{i_p,\,k_p}}
382  \begin{pmatrix}
383    {_{i+1/2-i_p}^k {\mathbb{F}_u}_{i_p}^{k_p} } (T)      \\
384    \\
385    {_i^{k+1/2-k_p} {\mathbb{F}_w}_{i_p}^{k_p} } (T)      \\
386  \end{pmatrix}.
387\end{flalign}
388\subsection{Ensuring the scheme does not increase tracer variance}
389\label{sec:triad:variance}
390
391We now require that this operator should not increase the
392globally-integrated tracer variance.
393%This changes according to
394% \begin{align*}
395% &\int_D  D_l^T \; T \;dv \equiv  \sum_{i,k} \left\{ T \ D_l^T \ b_T \right\}    \\
396% &\equiv + \sum_{i,k} \sum_{\substack{i_p,\,k_p}} \left\{
397%     \delta_{i} \left[{_{i+1/2-i_p}^k {\mathbb{F}_u }_{i_p}^{k_p}} \right]
398%       + \delta_{k} \left[ {_i^{k+1/2-k_p} {\mathbb{F}_w}_{i_p}^{k_p}} \right]  \ T \right\}    \\
399% &\equiv  - \sum_{i,k} \sum_{\substack{i_p,\,k_p}} \left\{
400%                 {_{i+1/2-i_p}^k {\mathbb{F}_u }_{i_p}^{k_p}} \ \delta_{i+1/2} [T]
401%              + {_i^{k+1/2-k_p} {\mathbb{F}_w}_{i_p}^{k_p}}  \ \delta_{k+1/2} [T]   \right\}      \\
402% \end{align*}
403Each triad slope $_i^k\mathbb{R}_{i_p}^{k_p}$ drives a lateral flux
404$_i^k{\mathbb{F}_u}_{i_p}^{k_p} (T)$ across the $u$-point $i+i_p,k$ and
405a vertical flux $_i^k{\mathbb{F}_w}_{i_p}^{k_p} (T)$ across the
406$w$-point $i,k+k_p$.  The lateral flux drives a net rate of change of
407variance, summed over the two $T$-points $i+i_p-\half,k$ and $i+i_p+\half,k$, of
408\begin{multline}
409  {b_T}_{i+i_p-1/2}^k\left(\frac{\partial T}{\partial t}T\right)_{i+i_p-1/2}^k+
410  \quad {b_T}_{i+i_p+1/2}^k\left(\frac{\partial T}{\partial
411      t}T\right)_{i+i_p+1/2}^k \\
412 \begin{split}
413  &= -T_{i+i_p-1/2}^k{\;} _i^k{\mathbb{F}_u}_{i_p}^{k_p} (T) \quad + \quad  T_{i+i_p+1/2}^k
414  {\;}_i^k{\mathbb{F}_u}_{i_p}^{k_p} (T) \\
415  &={\;} _i^k{\mathbb{F}_u}_{i_p}^{k_p} (T)\,\delta_{i+ i_p}[T^k], \label{eq:triad:dvar_iso_i}
416 \end{split}
417\end{multline}
418while the vertical flux similarly drives a net rate of change of
419variance summed over the $T$-points $i,k+k_p-\half$ (above) and
420$i,k+k_p+\half$ (below) of
421\begin{equation}
422\label{eq:triad:dvar_iso_k}
423  _i^k{\mathbb{F}_w}_{i_p}^{k_p} (T) \,\delta_{k+ k_p}[T^i].
424\end{equation}
425The total variance tendency driven by the triad is the sum of these
426two. Expanding $_i^k{\mathbb{F}_u}_{i_p}^{k_p} (T)$ and
427$_i^k{\mathbb{F}_w}_{i_p}^{k_p} (T)$ with \eqref{eq:triad:latflux-triad} and
428\eqref{eq:triad:vertflux-triad}, it is
429\begin{multline*}
430-\Alts_i^k\left \{
431{ } _i^k{\mathbb{A}_u}_{i_p}^{k_p}
432  \left(
433    \frac{ \delta_{i+ i_p}[T^k] }{ {e_{1u}}_{\,i + i_p}^{\,k} }
434    - {_i^k\mathbb{R}_{i_p}^{k_p}} \
435    \frac{ \delta_{k+k_p} [T^i] }{{e_{3w}}_{\,i}^{\,k+k_p} }\right)\,\delta_{i+ i_p}[T^k] \right.\\
436- \left. { } _i^k{\mathbb{A}_w}_{i_p}^{k_p}
437  \left(
438    \frac{ \delta_{i+ i_p}[T^k] }{ {e_{1u}}_{\,i + i_p}^{\,k} }
439    -{\:}_i^k\mathbb{R}_{i_p}^{k_p}
440    \frac{ \delta_{k+k_p} [T^i] }{{e_{3w}}_{\,i}^{\,k+k_p} }
441  \right) {\,}_i^k\mathbb{R}_{i_p}^{k_p}\delta_{k+ k_p}[T^i]
442\right \}.
443\end{multline*}
444The key point is then that if we require
445$_i^k{\mathbb{A}_u}_{i_p}^{k_p}$ and $_i^k{\mathbb{A}_w}_{i_p}^{k_p}$
446to be related to a triad volume $_i^k\mathbb{V}_{i_p}^{k_p}$ by
447\begin{equation}
448  \label{eq:triad:V-A}
449  _i^k\mathbb{V}_{i_p}^{k_p}
450  ={\;}_i^k{\mathbb{A}_u}_{i_p}^{k_p}\,{e_{1u}}_{\,i + i_p}^{\,k}
451  ={\;}_i^k{\mathbb{A}_w}_{i_p}^{k_p}\,{e_{3w}}_{\,i}^{\,k + k_p},
452\end{equation}
453the variance tendency reduces to the perfect square
454\begin{equation}
455  \label{eq:triad:perfect-square}
456  -\Alts_i^k{\:} _i^k\mathbb{V}_{i_p}^{k_p}
457  \left(
458    \frac{ \delta_{i+ i_p}[T^k] }{ {e_{1u}}_{\,i + i_p}^{\,k} }
459    -{\:}_i^k\mathbb{R}_{i_p}^{k_p}
460    \frac{ \delta_{k+k_p} [T^i] }{{e_{3w}}_{\,i}^{\,k+k_p} }
461  \right)^2\leq 0.
462\end{equation}
463Thus, the constraint \eqref{eq:triad:V-A} ensures that the fluxes (\ref{eq:triad:latflux-triad}, \ref{eq:triad:vertflux-triad}) associated
464with a given slope triad $_i^k\mathbb{R}_{i_p}^{k_p}$ do not increase
465the net variance. Since the total fluxes are sums of such fluxes from
466the various triads, this constraint, applied to all triads, is
467sufficient to ensure that the globally integrated variance does not
468increase.
469
470The expression \eqref{eq:triad:V-A} can be interpreted as a discretization
471of the global integral
472\begin{equation}
473  \label{eq:triad:cts-var}
474  \frac{\partial}{\partial t}\int\!\half T^2\, dV =
475  \int\!\mathbf{F}\cdot\nabla T\, dV,
476\end{equation}
477where, within each triad volume $_i^k\mathbb{V}_{i_p}^{k_p}$, the
478lateral and vertical fluxes/unit area
479\[
480\mathbf{F}=\left(
481\left.{}_i^k{\mathbb{F}_u}_{i_p}^{k_p} (T)\right/{}_i^k{\mathbb{A}_u}_{i_p}^{k_p},
482\left.{\:}_i^k{\mathbb{F}_w}_{i_p}^{k_p} (T)\right/{}_i^k{\mathbb{A}_w}_{i_p}^{k_p}
483 \right)
484\]
485and the gradient
486 \[\nabla T = \left(
487\left.\delta_{i+ i_p}[T^k] \right/ {e_{1u}}_{\,i + i_p}^{\,k},
488\left.\delta_{k+ k_p}[T^i] \right/ {e_{3w}}_{\,i}^{\,k + k_p}
489\right)
490\]
491\subsection{Triad volumes in Griffes's scheme and in \NEMO}
492To complete the discretization we now need only specify the triad
493volumes $_i^k\mathbb{V}_{i_p}^{k_p}$. \citet{Griffies_al_JPO98} identify
494these $_i^k\mathbb{V}_{i_p}^{k_p}$ as the volumes of the quarter
495cells, defined in terms of the distances between $T$, $u$,$f$ and
496$w$-points. This is the natural discretization of
497\eqref{eq:triad:cts-var}. The \NEMO model, however, operates with scale
498factors instead of grid sizes, and scale factors for the quarter
499cells are not defined. Instead, therefore we simply choose
500\begin{equation}
501  \label{eq:triad:V-NEMO}
502  _i^k\mathbb{V}_{i_p}^{k_p}=\quarter {b_u}_{i+i_p}^k,
503\end{equation}
504as a quarter of the volume of the $u$-cell inside which the triad
505quarter-cell lies. This has the nice property that when the slopes
506$\mathbb{R}$ vanish, the lateral flux from tracer cell $i,k$ to
507$i+1,k$ reduces to the classical form
508\begin{equation}
509  \label{eq:triad:lat-normal}
510-\overline\Alts_{\,i+1/2}^k\;
511\frac{{b_u}_{i+1/2}^k}{{e_{1u}}_{\,i + i_p}^{\,k}}
512\;\frac{\delta_{i+ 1/2}[T^k] }{{e_{1u}}_{\,i + i_p}^{\,k}}
513 = -\overline\Alts_{\,i+1/2}^k\;\frac{{e_{1w}}_{\,i + 1/2}^{\,k}\:{e_{1v}}_{\,i + 1/2}^{\,k}\;\delta_{i+ 1/2}[T^k]}{{e_{1u}}_{\,i + 1/2}^{\,k}}.
514\end{equation}
515In fact if the diffusive coefficient is defined at $u$-points, so that
516we employ $\Alts_{i+i_p}^k$ instead of  $\Alts_i^k$ in the definitions of the
517triad fluxes \eqref{eq:triad:latflux-triad} and \eqref{eq:triad:vertflux-triad},
518we can replace $\overline{A}_{\,i+1/2}^k$ by $A_{i+1/2}^k$ in the above.
519
520\subsection{Summary of the scheme}
521The iso-neutral fluxes at $u$- and
522$w$-points are the sums of the triad fluxes that cross the $u$- and
523$w$-faces \eqref{Eq_iso_flux}:
524\begin{subequations}\label{eq:triad:alltriadflux}
525  \begin{flalign}\label{eq:triad:vect_isoflux}
526    \vect{F}_\mathrm{iso}(T) &\equiv
527    \sum_{\substack{i_p,\,k_p}}
528    \begin{pmatrix}
529      {_{i+1/2-i_p}^k {\mathbb{F}_u}_{i_p}^{k_p} } (T)      \\
530      \\
531      {_i^{k+1/2-k_p} {\mathbb{F}_w}_{i_p}^{k_p} } (T)
532    \end{pmatrix},
533  \end{flalign}
534  where \eqref{eq:triad:latflux-triad}:
535  \begin{align}
536    \label{eq:triad:triadfluxu}
537    _i^k {\mathbb{F}_u}_{i_p}^{k_p} (T) &= - \Alts_i^k{
538      \:}\frac{{{}_i^k\mathbb{V}}_{i_p}^{k_p}}{{e_{1u}}_{\,i + i_p}^{\,k}}
539    \left(
540      \frac{ \delta_{i+ i_p}[T^k] }{ {e_{1u}}_{\,i + i_p}^{\,k} }
541      -\ {_i^k\mathbb{R}_{i_p}^{k_p}} \
542      \frac{ \delta_{k+k_p} [T^i] }{{e_{3w}}_{\,i}^{\,k+k_p} }
543    \right),\\
544    \intertext{and}
545    _i^k {\mathbb{F}_w}_{i_p}^{k_p} (T)
546    &= \Alts_i^k{\: }\frac{{{}_i^k\mathbb{V}}_{i_p}^{k_p}}{{e_{3w}}_{\,i}^{\,k+k_p}}
547    \left(
548      {_i^k\mathbb{R}_{i_p}^{k_p}}\frac{ \delta_{i+ i_p}[T^k] }{ {e_{1u}}_{\,i + i_p}^{\,k} }
549      -\ \left({_i^k\mathbb{R}_{i_p}^{k_p}}\right)^2 \
550      \frac{ \delta_{k+k_p} [T^i] }{{e_{3w}}_{\,i}^{\,k+k_p} }
551    \right),\label{eq:triad:triadfluxw}
552  \end{align}
553  with \eqref{eq:triad:V-NEMO}
554  \begin{equation}
555    \label{eq:triad:V-NEMO2}
556    _i^k{\mathbb{V}}_{i_p}^{k_p}=\quarter {b_u}_{i+i_p}^k.
557  \end{equation}
558\end{subequations}
559
560 The divergence of the expression \eqref{Eq_iso_flux} for the fluxes gives the iso-neutral diffusion tendency at
561each tracer point:
562\begin{equation} \label{eq:triad:iso_operator} D_l^T = \frac{1}{b_T}
563  \sum_{\substack{i_p,\,k_p}} \left\{ \delta_{i} \left[{_{i+1/2-i_p}^k
564        {\mathbb{F}_u }_{i_p}^{k_p}} \right] + \delta_{k} \left[
565      {_i^{k+1/2-k_p} {\mathbb{F}_w}_{i_p}^{k_p}} \right] \right\}
566\end{equation}
567where $b_T= e_{1T}\,e_{2T}\,e_{3T}$ is the volume of $T$-cells.
568The diffusion scheme satisfies the following six properties:
569\begin{description}
570\item[$\bullet$ horizontal diffusion] The discretization of the
571  diffusion operator recovers \eqref{eq:triad:lat-normal} the traditional five-point Laplacian in
572  the limit of flat iso-neutral direction :
573  \begin{equation} \label{eq:triad:iso_property0} D_l^T = \frac{1}{b_T} \
574    \delta_{i} \left[ \frac{e_{2u}\,e_{3u}}{e_{1u}} \;
575      \overline\Alts^{\,i} \; \delta_{i+1/2}[T] \right] \qquad
576    \text{when} \quad { _i^k \mathbb{R}_{i_p}^{k_p} }=0
577  \end{equation}
578
579\item[$\bullet$ implicit treatment in the vertical] Only tracer values
580  associated with a single water column appear in the expression
581  \eqref{eq:triad:i33} for the $_{33}$ fluxes, vertical fluxes driven by
582  vertical gradients. This is of paramount importance since it means
583  that a time-implicit algorithm can be used to solve the vertical
584  diffusion equation. This is necessary
585 since the vertical eddy
586  diffusivity associated with this term,
587  \begin{equation}
588    \frac{1}{b_w}\sum_{\substack{i_p, \,k_p}} \left\{
589      {\:}_i^k\mathbb{V}_{i_p}^{k_p} \: \Alts_i^k \: \left(_i^k \mathbb{R}_{i_p}^{k_p}\right)^2
590    \right\}  =
591    \frac{1}{4b_w}\sum_{\substack{i_p, \,k_p}} \left\{
592      {b_u}_{i+i_p}^k\: \Alts_i^k \: \left(_i^k \mathbb{R}_{i_p}^{k_p}\right)^2
593    \right\},
594 \end{equation}
595  (where $b_w= e_{1w}\,e_{2w}\,e_{3w}$ is the volume of $w$-cells) can be quite large.
596
597\item[$\bullet$ pure iso-neutral operator] The iso-neutral flux of
598  locally referenced potential density is zero. See
599  \eqref{eq:triad:latflux-rho} and \eqref{eq:triad:vertflux-triad2}.
600
601\item[$\bullet$ conservation of tracer] The iso-neutral diffusion
602  conserves tracer content, $i.e.$
603  \begin{equation} \label{eq:triad:iso_property1} \sum_{i,j,k} \left\{ D_l^T \
604      b_T \right\} = 0
605  \end{equation}
606  This property is trivially satisfied since the iso-neutral diffusive
607  operator is written in flux form.
608
609\item[$\bullet$ no increase of tracer variance] The iso-neutral diffusion
610  does not increase the tracer variance, $i.e.$
611  \begin{equation} \label{eq:triad:iso_property2} \sum_{i,j,k} \left\{ T \ D_l^T
612      \ b_T \right\} \leq 0
613  \end{equation}
614  The property is demonstrated in
615  \S\ref{sec:triad:variance} above. It is a key property for a diffusion
616  term. It means that it is also a dissipation term, $i.e.$ it
617  dissipates the square of the quantity on which it is applied.  It
618  therefore ensures that, when the diffusivity coefficient is large
619  enough, the field on which it is applied becomes free of grid-point
620  noise.
621
622\item[$\bullet$ self-adjoint operator] The iso-neutral diffusion
623  operator is self-adjoint, $i.e.$
624  \begin{equation} \label{eq:triad:iso_property3} \sum_{i,j,k} \left\{ S \ D_l^T
625      \ b_T \right\} = \sum_{i,j,k} \left\{ D_l^S \ T \ b_T \right\}
626  \end{equation}
627  In other word, there is no need to develop a specific routine from
628  the adjoint of this operator. We just have to apply the same
629  routine. This property can be demonstrated similarly to the proof of
630  the `no increase of tracer variance' property. The contribution by a
631  single triad towards the left hand side of \eqref{eq:triad:iso_property3}, can
632  be found by replacing $\delta[T]$ by $\delta[S]$ in \eqref{eq:triad:dvar_iso_i}
633  and \eqref{eq:triad:dvar_iso_k}. This results in a term similar to
634  \eqref{eq:triad:perfect-square},
635\begin{equation}
636  \label{eq:triad:TScovar}
637  - \Alts_i^k{\:} _i^k\mathbb{V}_{i_p}^{k_p}
638  \left(
639    \frac{ \delta_{i+ i_p}[T^k] }{ {e_{1u}}_{\,i + i_p}^{\,k} }
640    -{\:}_i^k\mathbb{R}_{i_p}^{k_p}
641    \frac{ \delta_{k+k_p} [T^i] }{{e_{3w}}_{\,i}^{\,k+k_p} }
642  \right)
643  \left(
644    \frac{ \delta_{i+ i_p}[S^k] }{ {e_{1u}}_{\,i + i_p}^{\,k} }
645    -{\:}_i^k\mathbb{R}_{i_p}^{k_p}
646    \frac{ \delta_{k+k_p} [S^i] }{{e_{3w}}_{\,i}^{\,k+k_p} }
647  \right).
648\end{equation}
649This is symmetrical in $T $ and $S$, so exactly the same term arises
650from the discretization of this triad's contribution towards the
651RHS of \eqref{eq:triad:iso_property3}.
652\end{description}
653\subsection{Treatment of the triads at the boundaries}\label{sec:triad:iso_bdry}
654The triad slope can only be defined where both the grid boxes centred at
655the end of the arms exist. Triads that would poke up
656through the upper ocean surface into the atmosphere, or down into the
657ocean floor, must be masked out. See Fig.~\ref{fig:triad:bdry_triads}. Surface layer triads
658$\triad{i}{1}{R}{1/2}{-1/2}$ (magenta) and
659$\triad{i+1}{1}{R}{-1/2}{-1/2}$ (blue) that require density to be
660specified above the ocean surface are masked (Fig.~\ref{fig:triad:bdry_triads}a): this ensures that lateral
661tracer gradients produce no flux through the ocean surface. However,
662to prevent surface noise, it is customary to retain the $_{11}$ contributions towards
663the lateral triad fluxes $\triad[u]{i}{1}{F}{1/2}{-1/2}$ and
664$\triad[u]{i+1}{1}{F}{-1/2}{-1/2}$; this drives diapycnal tracer
665fluxes. Similar comments apply to triads that would intersect the
666ocean floor (Fig.~\ref{fig:triad:bdry_triads}b). Note that both near bottom
667triad slopes $\triad{i}{k}{R}{1/2}{1/2}$ and
668$\triad{i+1}{k}{R}{-1/2}{1/2}$ are masked when either of the $i,k+1$
669or $i+1,k+1$ tracer points is masked, i.e.\ the $i,k+1$ $u$-point is
670masked. The associated lateral fluxes (grey-black dashed line) are
671masked if \np{ln\_botmix\_grif}=false, but left unmasked,
672giving bottom mixing, if \np{ln\_botmix\_grif}=true.
673
674The default option \np{ln\_botmix\_grif}=false is suitable when the
675bbl mixing option is enabled (\key{trabbl}, with \np{nn\_bbl\_ldf}=1),
676or  for simple idealized  problems. For setups with topography without
677bbl mixing, \np{ln\_botmix\_grif}=true may be necessary.
678% >>>>>>>>>>>>>>>>>>>>>>>>>>>>
679\begin{figure}[h] \begin{center}
680    \includegraphics[width=0.60\textwidth]{Fig_GRIFF_bdry_triads}
681    \caption{  \label{fig:triad:bdry_triads}
682      (a) Uppermost model layer $k=1$ with $i,1$ and $i+1,1$ tracer
683      points (black dots), and $i+1/2,1$ $u$-point (blue square). Triad
684      slopes $\triad{i}{1}{R}{1/2}{-1/2}$ (magenta) and $\triad{i+1}{1}{R}{-1/2}{-1/2}$
685      (blue) poking through the ocean surface are masked (faded in
686      figure). However, the lateral $_{11}$ contributions towards
687      $\triad[u]{i}{1}{F}{1/2}{-1/2}$ and $\triad[u]{i+1}{1}{F}{-1/2}{-1/2}$
688      (yellow line) are still applied, giving diapycnal diffusive
689      fluxes.\\
690      (b) Both near bottom triad slopes $\triad{i}{k}{R}{1/2}{1/2}$ and
691      $\triad{i+1}{k}{R}{-1/2}{1/2}$ are masked when either of the $i,k+1$
692      or $i+1,k+1$ tracer points is masked, i.e.\ the $i,k+1$ $u$-point
693      is masked. The associated lateral fluxes (grey-black dashed
694      line) are masked if \np{botmix\_grif}=.false., but left
695      unmasked, giving bottom mixing, if \np{botmix\_grif}=.true.}
696 \end{center} \end{figure}
697% >>>>>>>>>>>>>>>>>>>>>>>>>>>>
698\subsection{ Limiting of the slopes within the interior}\label{sec:triad:limit}
699As discussed in \S\ref{LDF_slp_iso}, iso-neutral slopes relative to
700geopotentials must be bounded everywhere, both for consistency with the small-slope
701approximation and for numerical stability \citep{Cox1987,
702  Griffies_Bk04}. The bound chosen in \NEMO is applied to each
703component of the slope separately and has a value of $1/100$ in the ocean interior.
704%, ramping linearly down above 70~m depth to zero at the surface
705It is of course relevant to the iso-neutral slopes $\tilde{r}_i=r_i+\sigma_i$ relative to
706geopotentials (here the $\sigma_i$ are the slopes of the coordinate surfaces relative to
707geopotentials) \eqref{Eq_PE_slopes_eiv} rather than the slope $r_i$ relative to coordinate
708surfaces, so we require
709\begin{equation*}
710  |\tilde{r}_i|\leq \tilde{r}_\mathrm{max}=0.01.
711\end{equation*}
712and then recalculate the slopes $r_i$ relative to coordinates.
713Each individual triad slope
714 \begin{equation}
715   \label{eq:triad:Rtilde}
716_i^k\tilde{\mathbb{R}}_{i_p}^{k_p} = {}_i^k\mathbb{R}_{i_p}^{k_p}  + \frac{\delta_{i+i_p}[z_T^k]}{{e_{1u}}_{\,i + i_p}^{\,k}}
717 \end{equation}
718is limited like this and then the corresponding
719$_i^k\mathbb{R}_{i_p}^{k_p} $ are recalculated and combined to form the fluxes.
720Note that where the slopes have been limited, there is now a non-zero
721iso-neutral density flux that drives dianeutral mixing.  In particular this iso-neutral density flux
722is always downwards, and so acts to reduce gravitational potential energy.
723\subsection{Tapering within the surface mixed layer}\label{sec:triad:taper}
724
725Additional tapering of the iso-neutral fluxes is necessary within the
726surface mixed layer. When the Griffies triads are used, we offer two
727options for this.
728\subsubsection{Linear slope tapering within the surface mixed layer}\label{sec:triad:lintaper}
729This is the option activated by the default choice
730\np{ln\_triad\_iso}=false. Slopes $\tilde{r}_i$ relative to
731geopotentials are tapered linearly from their value immediately below the mixed layer to zero at the
732surface, as described in option (c) of Fig.~\ref{Fig_eiv_slp}, to values
733\begin{subequations}
734  \begin{equation}
735   \label{eq:triad:rmtilde}
736     \rMLt =
737  -\frac{z}{h}\left.\tilde{r}_i\right|_{z=-h}\quad \text{ for  } z>-h,
738  \end{equation}
739and then the $r_i$ relative to vertical coordinate surfaces are appropriately
740adjusted to
741  \begin{equation}
742   \label{eq:triad:rm}
743 \rML =\rMLt -\sigma_i \quad \text{ for  } z>-h.
744  \end{equation}
745\end{subequations}
746Thus the diffusion operator within the mixed layer is given by:
747\begin{equation} \label{eq:triad:iso_tensor_ML}
748D^{lT}=\nabla {\rm {\bf .}}\left( {A^{lT}\;\Re \;\nabla T} \right) \qquad
749\mbox{with}\quad \;\;\Re =\left( {{\begin{array}{*{20}c}
750 1 \hfill & 0 \hfill & {-\rML[1]}\hfill \\
751 0 \hfill & 1 \hfill & {-\rML[2]} \hfill \\
752 {-\rML[1]}\hfill &   {-\rML[2]} \hfill & {\rML[1]^2+\rML[2]^2} \hfill
753\end{array} }} \right)
754\end{equation}
755
756This slope tapering gives a natural connection between tracer in the
757mixed-layer and in isopycnal layers immediately below, in the
758thermocline. It is consistent with the way the $\tilde{r}_i$ are
759tapered within the mixed layer (see \S\ref{sec:triad:taperskew} below)
760so as to ensure a uniform GM eddy-induced velocity throughout the
761mixed layer. However, it gives a downwards density flux and so acts so
762as to reduce potential energy in the same way as does the slope
763limiting discussed above in \S\ref{sec:triad:limit}.
764 
765As in \S\ref{sec:triad:limit} above, the tapering
766\eqref{eq:triad:rmtilde} is applied separately to each triad
767$_i^k\tilde{\mathbb{R}}_{i_p}^{k_p}$, and the
768$_i^k\mathbb{R}_{i_p}^{k_p}$ adjusted. For clarity, we assume
769$z$-coordinates in the following; the conversion from
770$\mathbb{R}$ to $\tilde{\mathbb{R}}$ and back to $\mathbb{R}$ follows exactly as described
771above by \eqref{eq:triad:Rtilde}.
772\begin{enumerate}
773\item Mixed-layer depth is defined so as to avoid including regions of weak
774vertical stratification in the slope definition.
775 At each $i,j$ (simplified to $i$ in
776Fig.~\ref{fig:triad:MLB_triad}), we define the mixed-layer by setting
777the vertical index of the tracer point immediately below the mixed
778layer, $k_\mathrm{ML}$, as the maximum $k$ (shallowest tracer point)
779such that the potential density
780${\rho_0}_{i,k}>{\rho_0}_{i,k_{10}}+\Delta\rho_c$, where $i,k_{10}$ is
781the tracer gridbox within which the depth reaches 10~m. See the left
782side of Fig.~\ref{fig:triad:MLB_triad}. We use the $k_{10}$-gridbox
783instead of the surface gridbox to avoid problems e.g.\ with thin
784daytime mixed-layers. Currently we use the same
785$\Delta\rho_c=0.01\;\mathrm{kg\:m^{-3}}$ for ML triad tapering as is
786used to output the diagnosed mixed-layer depth
787$h_\mathrm{ML}=|z_{W}|_{k_\mathrm{ML}+1/2}$, the depth of the $w$-point
788above the $i,k_\mathrm{ML}$ tracer point.
789
790\item We define `basal' triad slopes
791${\:}_i{\mathbb{R}_\mathrm{base}}_{\,i_p}^{k_p}$ as the slopes
792of those triads whose vertical `arms' go down from the
793$i,k_\mathrm{ML}$ tracer point to the $i,k_\mathrm{ML}-1$ tracer point
794below. This is to ensure that the vertical density gradients
795associated with these basal triad slopes
796${\:}_i{\mathbb{R}_\mathrm{base}}_{\,i_p}^{k_p}$ are
797representative of the thermocline. The four basal triads defined in the bottom part
798of Fig.~\ref{fig:triad:MLB_triad} are then
799\begin{align}
800  {\:}_i{\mathbb{R}_\mathrm{base}}_{\,i_p}^{k_p} &=
801 {\:}^{k_\mathrm{ML}-k_p-1/2}_i{\mathbb{R}_\mathrm{base}}_{\,i_p}^{k_p}, \label{eq:triad:Rbase}
802\\
803\intertext{with e.g.\ the green triad}
804{\:}_i{\mathbb{R}_\mathrm{base}}_{1/2}^{-1/2}&=
805{\:}^{k_\mathrm{ML}}_i{\mathbb{R}_\mathrm{base}}_{\,1/2}^{-1/2}. \notag
806\end{align}
807The vertical flux associated with each of these triads passes through the $w$-point
808$i,k_\mathrm{ML}-1/2$ lying \emph{below} the $i,k_\mathrm{ML}$ tracer point,
809so it is this depth
810\begin{equation}
811  \label{eq:triad:zbase}
812  {z_\mathrm{base}}_{\,i}={z_{w}}_{k_\mathrm{ML}-1/2}
813\end{equation}
814(one gridbox deeper than the
815diagnosed ML depth $z_\mathrm{ML})$ that sets the $h$ used to taper
816the slopes in \eqref{eq:triad:rmtilde}.
817\item Finally, we calculate the adjusted triads
818${\:}_i^k{\mathbb{R}_\mathrm{ML}}_{\,i_p}^{k_p}$ within the mixed
819layer, by multiplying the appropriate
820${\:}_i{\mathbb{R}_\mathrm{base}}_{\,i_p}^{k_p}$ by the ratio of
821the depth of the $w$-point ${z_w}_{k+k_p}$ to ${z_\mathrm{base}}_{\,i}$. For
822instance the green triad centred on $i,k$
823\begin{align}
824  {\:}_i^k{\mathbb{R}_\mathrm{ML}}_{\,1/2}^{-1/2} &=
825\frac{{z_w}_{k-1/2}}{{z_\mathrm{base}}_{\,i}}{\:}_i{\mathbb{R}_\mathrm{base}}_{\,1/2}^{-1/2}
826\notag \\
827\intertext{and more generally}
828 {\:}_i^k{\mathbb{R}_\mathrm{ML}}_{\,i_p}^{k_p} &=
829\frac{{z_w}_{k+k_p}}{{z_\mathrm{base}}_{\,i}}{\:}_i{\mathbb{R}_\mathrm{base}}_{\,i_p}^{k_p}.\label{eq:triad:RML}
830\end{align}
831\end{enumerate}
832
833% >>>>>>>>>>>>>>>>>>>>>>>>>>>>
834\begin{figure}[h]
835  \fcapside {\caption{\label{fig:triad:MLB_triad} Definition of
836      mixed-layer depth and calculation of linearly tapered
837      triads. The figure shows a water column at a given $i,j$
838      (simplified to $i$), with the ocean surface at the top. Tracer points are denoted by
839      bullets, and black lines the edges of the tracer cells; $k$
840      increases upwards. \\
841      \hspace{5 em}We define the mixed-layer by setting the vertical index
842      of the tracer point immediately below the mixed layer,
843      $k_\mathrm{ML}$, as the maximum $k$ (shallowest tracer point)
844      such that ${\rho_0}_{i,k}>{\rho_0}_{i,k_{10}}+\Delta\rho_c$,
845      where $i,k_{10}$ is the tracer gridbox within which the depth
846      reaches 10~m. We calculate the triad slopes within the mixed
847      layer by linearly tapering them from zero (at the surface) to
848      the `basal' slopes, the slopes of the four triads passing through the
849      $w$-point $i,k_\mathrm{ML}-1/2$ (blue square),
850      ${\:}_i{\mathbb{R}_\mathrm{base}}_{\,i_p}^{k_p}$. Triads with
851    different $i_p,k_p$, denoted by different colours, (e.g. the green
852    triad $i_p=1/2,k_p=-1/2$) are tapered to the appropriate basal triad.}}
853  {\includegraphics[width=0.60\textwidth]{Fig_GRIFF_MLB_triads}}
854\end{figure}
855% >>>>>>>>>>>>>>>>>>>>>>>>>>>>
856
857\subsubsection{Additional truncation of skew iso-neutral flux
858  components}
859\label{sec:triad:Gerdes-taper}
860The alternative option is activated by setting \np{ln\_triad\_iso} =
861  true. This retains the same tapered slope $\rML$  described above for the
862calculation of the $_{33}$ term of the iso-neutral diffusion tensor (the
863vertical tracer flux driven by vertical tracer gradients), but
864replaces the $\rML$ in the skew term by
865\begin{equation}
866  \label{eq:triad:rm*}
867  \rML^*=\left.\rMLt^2\right/\tilde{r}_i-\sigma_i,
868\end{equation}
869giving a ML diffusive operator
870\begin{equation} \label{eq:triad:iso_tensor_ML2}
871D^{lT}=\nabla {\rm {\bf .}}\left( {A^{lT}\;\Re \;\nabla T} \right) \qquad
872\mbox{with}\quad \;\;\Re =\left( {{\begin{array}{*{20}c}
873 1 \hfill & 0 \hfill & {-\rML[1]^*}\hfill \\
874 0 \hfill & 1 \hfill & {-\rML[2]^*} \hfill \\
875 {-\rML[1]^*}\hfill &   {-\rML[2]^*} \hfill & {\rML[1]^2+\rML[2]^2} \hfill \\
876\end{array} }} \right).
877\end{equation}
878This operator
879\footnote{To ensure good behaviour where horizontal density
880  gradients are weak, we in fact follow \citet{Gerdes1991} and set
881$\rML^*=\mathrm{sgn}(\tilde{r}_i)\min(|\rMLt^2/\tilde{r}_i|,|\tilde{r}_i|)-\sigma_i$.}
882then has the property it gives no vertical density flux, and so does
883not change the potential energy.
884This approach is similar to multiplying the iso-neutral  diffusion
885coefficient by $\tilde{r}_\mathrm{max}^{-2}\tilde{r}_i^{-2}$ for steep
886slopes, as suggested by \citet{Gerdes1991} (see also \citet{Griffies_Bk04}).
887Again it is applied separately to each triad $_i^k\mathbb{R}_{i_p}^{k_p}$
888
889In practice, this approach gives weak vertical tracer fluxes through
890the mixed-layer, as well as vanishing density fluxes. While it is
891theoretically advantageous that it does not change the potential
892energy, it may give a discontinuity between the
893fluxes within the mixed-layer (purely horizontal) and just below (along
894iso-neutral surfaces).
895% This may give strange looking results,
896% particularly where the mixed-layer depth varies strongly laterally.
897% ================================================================
898% Skew flux formulation for Eddy Induced Velocity :
899% ================================================================
900\section{Eddy induced advection formulated as a skew flux}\label{sec:triad:skew-flux}
901
902\subsection{The continuous skew flux formulation}\label{sec:triad:continuous-skew-flux}
903
904 When Gent and McWilliams's [1990] diffusion is used,
905an additional advection term is added. The associated velocity is the so called
906eddy induced velocity, the formulation of which depends on the slopes of iso-
907neutral surfaces. Contrary to the case of iso-neutral mixing, the slopes used
908here are referenced to the geopotential surfaces, $i.e.$ \eqref{Eq_ldfslp_geo}
909is used in $z$-coordinate, and the sum \eqref{Eq_ldfslp_geo}
910+ \eqref{Eq_ldfslp_iso} in $z^*$ or $s$-coordinates.
911
912The eddy induced velocity is given by:
913\begin{subequations} \label{eq:triad:eiv}
914\begin{equation}\label{eq:triad:eiv_v}
915\begin{split}
916 u^* & = - \frac{1}{e_{3}}\;          \partial_i\psi_1,  \\
917 v^* & = - \frac{1}{e_{3}}\;          \partial_j\psi_2,    \\
918w^* & =    \frac{1}{e_{1}e_{2}}\; \left\{ \partial_\left( e_{2} \, \psi_1\right)
919                         + \partial_\left( e_{1} \, \psi_2\right) \right\},
920\end{split}
921\end{equation}
922where the streamfunctions $\psi_i$ are given by
923\begin{equation} \label{eq:triad:eiv_psi}
924\begin{split}
925\psi_1 & = A_{e} \; \tilde{r}_1,   \\
926\psi_2 & = A_{e} \; \tilde{r}_2,
927\end{split}
928\end{equation}
929\end{subequations}
930with $A_{e}$ the eddy induced velocity coefficient, and $\tilde{r}_1$ and $\tilde{r}_2$ the slopes between the iso-neutral and the geopotential surfaces.
931
932The traditional way to implement this additional advection is to add
933it to the Eulerian velocity prior to computing the tracer
934advection. This is implemented if \key{traldf\_eiv} is set in the
935default implementation, where \np{ln\_traldf\_grif} is set
936false. This allows us to take advantage of all the advection schemes
937offered for the tracers (see \S\ref{TRA_adv}) and not just a $2^{nd}$
938order advection scheme. This is particularly useful for passive
939tracers where \emph{positivity} of the advection scheme is of
940paramount importance.
941
942However, when \np{ln\_traldf\_grif} is set true, \NEMO instead
943implements eddy induced advection according to the so-called skew form
944\citep{Griffies_JPO98}. It is based on a transformation of the advective fluxes
945using the non-divergent nature of the eddy induced velocity.
946For example in the (\textbf{i},\textbf{k}) plane, the tracer advective
947fluxes per unit area in $ijk$ space can be
948transformed as follows:
949\begin{flalign*}
950\begin{split}
951\textbf{F}_\mathrm{eiv}^T =
952\begin{pmatrix}
953           {e_{2}\,e_{3}\;  u^*}       \\
954      {e_{1}\,e_{2}\; w^*}  \\
955\end{pmatrix}   \;   T
956&=
957\begin{pmatrix}
958           { - \partial_k \left( e_{2} \,\psi_1 \right) \; T \;}     \\
959      {+ \partial_\left( e_{2} \, \psi_1 \right) \; T \;}    \\
960\end{pmatrix}        \\
961&=
962\begin{pmatrix}
963           { - \partial_k \left( e_{2} \, \psi_\; T \right) \;}  \\
964      {+ \partial_\left( e_{2} \,\psi_1 \; T \right) \;}  \\
965\end{pmatrix}
966 +
967\begin{pmatrix}
968           {+ e_{2} \, \psi_\; \partial_k T}  \\
969      { - e_{2} \, \psi_\; \partial_i  T}  \\
970\end{pmatrix}
971\end{split}
972\end{flalign*}
973and since the eddy induced velocity field is non-divergent, we end up with the skew
974form of the eddy induced advective fluxes per unit area in $ijk$ space:
975\begin{equation} \label{eq:triad:eiv_skew_ijk}
976\textbf{F}_\mathrm{eiv}^T = \begin{pmatrix}
977           {+ e_{2} \, \psi_\; \partial_k T}   \\
978      { - e_{2} \, \psi_\; \partial_i  T}  \\
979                                 \end{pmatrix}
980\end{equation}
981The total fluxes per unit physical area are then
982\begin{equation}\label{eq:triad:eiv_skew_physical}
983\begin{split}
984 f^*_1 & = \frac{1}{e_{3}}\; \psi_1 \partial_k T   \\
985 f^*_2 & = \frac{1}{e_{3}}\; \psi_2 \partial_k T   \\
986 f^*_3 & =  -\frac{1}{e_{1}e_{2}}\; \left\{ e_{2} \psi_1 \partial_i T
987   + e_{1} \psi_2 \partial_j T \right\}. \\
988\end{split}
989\end{equation}
990Note that Eq.~ \eqref{eq:triad:eiv_skew_physical} takes the same form whatever the
991vertical coordinate, though of course the slopes
992$\tilde{r}_i$ which define the $\psi_i$ in \eqref{eq:triad:eiv_psi} are relative to geopotentials.
993The tendency associated with eddy induced velocity is then simply the convergence
994of the fluxes (\ref{eq:triad:eiv_skew_ijk}, \ref{eq:triad:eiv_skew_physical}), so
995\begin{equation} \label{eq:triad:skew_eiv_conv}
996\frac{\partial T}{\partial t}= -\frac{1}{e_1 \, e_2 \, e_3 }      \left[
997  \frac{\partial}{\partial i} \left( e_2 \psi_1 \partial_k T\right)
998  + \frac{\partial}{\partial j} \left( e_\;
999    \psi_2 \partial_k T\right)
1000 -  \frac{\partial}{\partial k} \left( e_{2} \psi_1 \partial_i T
1001   + e_{1} \psi_2 \partial_j T \right\right]
1002\end{equation}
1003 It naturally conserves the tracer content, as it is expressed in flux
1004 form. Since it has the same divergence as the advective form it also
1005 preserves the tracer variance.
1006
1007\subsection{The discrete skew flux formulation}
1008The skew fluxes in (\ref{eq:triad:eiv_skew_physical}, \ref{eq:triad:eiv_skew_ijk}), like the off-diagonal terms
1009(\ref{eq:triad:i13c}, \ref{eq:triad:i31c}) of the small angle diffusion tensor, are best
1010expressed in terms of the triad slopes, as in Fig.~\ref{fig:triad:ISO_triad}
1011and Eqs~(\ref{eq:triad:i13}, \ref{eq:triad:i31}); but now in terms of the triad slopes
1012$\tilde{\mathbb{R}}$ relative to geopotentials instead of the
1013$\mathbb{R}$ relative to coordinate surfaces. The discrete form of
1014\eqref{eq:triad:eiv_skew_ijk} using the slopes \eqref{eq:triad:R} and
1015defining $A_e$ at $T$-points is then given by:
1016
1017
1018\begin{subequations}\label{eq:triad:allskewflux}
1019  \begin{flalign}\label{eq:triad:vect_skew_flux}
1020    \vect{F}_\mathrm{eiv}(T) &\equiv
1021    \sum_{\substack{i_p,\,k_p}}
1022    \begin{pmatrix}
1023      {_{i+1/2-i_p}^k {\mathbb{S}_u}_{i_p}^{k_p} } (T)      \\
1024      \\
1025      {_i^{k+1/2-k_p} {\mathbb{S}_w}_{i_p}^{k_p} } (T)      \\
1026    \end{pmatrix},
1027  \end{flalign}
1028  where the skew flux in the $i$-direction associated with a given
1029  triad is (\ref{eq:triad:latflux-triad}, \ref{eq:triad:triadfluxu}):
1030  \begin{align}
1031    \label{eq:triad:skewfluxu}
1032    _i^k {\mathbb{S}_u}_{i_p}^{k_p} (T) &= + \quarter {A_e}_i^k{
1033      \:}\frac{{b_u}_{i+i_p}^k}{{e_{1u}}_{\,i + i_p}^{\,k}}
1034     \ {_i^k\tilde{\mathbb{R}}_{i_p}^{k_p}} \
1035      \frac{ \delta_{k+k_p} [T^i] }{{e_{3w}}_{\,i}^{\,k+k_p} },
1036   \\
1037    \intertext{and \eqref{eq:triad:triadfluxw} in the $k$-direction, changing the sign
1038      to be consistent with \eqref{eq:triad:eiv_skew_ijk}:}
1039    _i^k {\mathbb{S}_w}_{i_p}^{k_p} (T)
1040    &= -\quarter {A_e}_i^k{\: }\frac{{b_u}_{i+i_p}^k}{{e_{3w}}_{\,i}^{\,k+k_p}}
1041     {_i^k\tilde{\mathbb{R}}_{i_p}^{k_p}}\frac{ \delta_{i+ i_p}[T^k] }{ {e_{1u}}_{\,i + i_p}^{\,k} }.\label{eq:triad:skewfluxw}
1042  \end{align}
1043\end{subequations}
1044
1045Such a discretisation is consistent with the iso-neutral
1046operator as it uses the same definition for the slopes.  It also
1047ensures the following two key properties.
1048\subsubsection{No change in tracer variance}
1049The discretization conserves tracer variance, $i.e.$ it does not
1050include a diffusive component but is a `pure' advection term. This can
1051be seen
1052%either from Appendix \ref{Apdx_eiv_skew} or
1053by considering the
1054fluxes associated with a given triad slope
1055$_i^k{\mathbb{R}}_{i_p}^{k_p} (T)$. For, following
1056\S\ref{sec:triad:variance} and \eqref{eq:triad:dvar_iso_i}, the
1057associated horizontal skew-flux $_i^k{\mathbb{S}_u}_{i_p}^{k_p} (T)$
1058drives a net rate of change of variance, summed over the two
1059$T$-points $i+i_p-\half,k$ and $i+i_p+\half,k$, of
1060\begin{equation}
1061\label{eq:triad:dvar_eiv_i}
1062  _i^k{\mathbb{S}_u}_{i_p}^{k_p} (T)\,\delta_{i+ i_p}[T^k],
1063\end{equation}
1064while the associated vertical skew-flux gives a variance change summed over the
1065$T$-points $i,k+k_p-\half$ (above) and $i,k+k_p+\half$ (below) of
1066\begin{equation}
1067\label{eq:triad:dvar_eiv_k}
1068  _i^k{\mathbb{S}_w}_{i_p}^{k_p} (T) \,\delta_{k+ k_p}[T^i].
1069\end{equation}
1070Inspection of the definitions (\ref{eq:triad:skewfluxu}, \ref{eq:triad:skewfluxw})
1071shows that these two variance changes (\ref{eq:triad:dvar_eiv_i}, \ref{eq:triad:dvar_eiv_k})
1072sum to zero. Hence the two fluxes associated with each triad make no
1073net contribution to the variance budget.
1074
1075\subsubsection{Reduction in gravitational PE}
1076The vertical density flux associated with the vertical skew-flux
1077always has the same sign as the vertical density gradient; thus, so
1078long as the fluid is stable (the vertical density gradient is
1079negative) the vertical density flux is negative (downward) and hence
1080reduces the gravitational PE.
1081
1082For the change in gravitational PE driven by the $k$-flux is
1083\begin{align}
1084  \label{eq:triad:vert_densityPE}
1085  g {e_{3w}}_{\,i}^{\,k+k_p}{\mathbb{S}_w}_{i_p}^{k_p} (\rho)
1086  &=g {e_{3w}}_{\,i}^{\,k+k_p}\left[-\alpha _i^k {\:}_i^k
1087    {\mathbb{S}_w}_{i_p}^{k_p} (T) + \beta_i^k {\:}_i^k
1088    {\mathbb{S}_w}_{i_p}^{k_p} (S) \right]. \notag \\
1089\intertext{Substituting  ${\:}_i^k {\mathbb{S}_w}_{i_p}^{k_p}$ from
1090  \eqref{eq:triad:skewfluxw}, gives}
1091% and separating out
1092% $\rtriadt{R}=\rtriad{R} + \delta_{i+i_p}[z_T^k]$,
1093% gives two terms. The
1094% first $\rtriad{R}$ term (the only term for $z$-coordinates) is:
1095 &=-\quarter g{A_e}_i^k{\: }{b_u}_{i+i_p}^k {_i^k\tilde{\mathbb{R}}_{i_p}^{k_p}}
1096\frac{ -\alpha _i^k\delta_{i+ i_p}[T^k]+ \beta_i^k\delta_{i+ i_p}[S^k]} { {e_{1u}}_{\,i + i_p}^{\,k} } \notag \\
1097 &=+\quarter g{A_e}_i^k{\: }{b_u}_{i+i_p}^k
1098     \left({_i^k\mathbb{R}_{i_p}^{k_p}}+\frac{\delta_{i+i_p}[z_T^k]}{{e_{1u}}_{\,i + i_p}^{\,k}}\right) {_i^k\mathbb{R}_{i_p}^{k_p}}
1099\frac{-\alpha_i^k \delta_{k+ k_p}[T^i]+ \beta_i^k\delta_{k+ k_p}[S^i]} {{e_{3w}}_{\,i}^{\,k+k_p}},
1100\end{align}
1101using the definition of the triad slope $\rtriad{R}$,
1102\eqref{eq:triad:R} to express $-\alpha _i^k\delta_{i+ i_p}[T^k]+
1103\beta_i^k\delta_{i+ i_p}[S^k]$ in terms of  $-\alpha_i^k \delta_{k+
1104  k_p}[T^i]+ \beta_i^k\delta_{k+ k_p}[S^i]$.
1105
1106Where the coordinates slope, the $i$-flux gives a PE change
1107\begin{multline}
1108  \label{eq:triad:lat_densityPE}
1109 g \delta_{i+i_p}[z_T^k]
1110\left[
1111-\alpha _i^k {\:}_i^k {\mathbb{S}_u}_{i_p}^{k_p} (T) + \beta_i^k {\:}_i^k {\mathbb{S}_u}_{i_p}^{k_p} (S)
1112\right] \\
1113= +\quarter g{A_e}_i^k{\: }{b_u}_{i+i_p}^k
1114     \frac{\delta_{i+i_p}[z_T^k]}{{e_{1u}}_{\,i + i_p}^{\,k}}
1115\left({_i^k\mathbb{R}_{i_p}^{k_p}}+\frac{\delta_{i+i_p}[z_T^k]}{{e_{1u}}_{\,i + i_p}^{\,k}}\right)
1116\frac{-\alpha_i^k \delta_{k+ k_p}[T^i]+ \beta_i^k\delta_{k+ k_p}[S^i]} {{e_{3w}}_{\,i}^{\,k+k_p}},
1117\end{multline}
1118(using \eqref{eq:triad:skewfluxu}) and so the total PE change
1119\eqref{eq:triad:vert_densityPE} + \eqref{eq:triad:lat_densityPE} associated with the triad fluxes is
1120\begin{multline}
1121  \label{eq:triad:tot_densityPE}
1122  g{e_{3w}}_{\,i}^{\,k+k_p}{\mathbb{S}_w}_{i_p}^{k_p} (\rho) +
1123g\delta_{i+i_p}[z_T^k] {\:}_i^k {\mathbb{S}_u}_{i_p}^{k_p} (\rho) \\
1124= +\quarter g{A_e}_i^k{\: }{b_u}_{i+i_p}^k
1125     \left({_i^k\mathbb{R}_{i_p}^{k_p}}+\frac{\delta_{i+i_p}[z_T^k]}{{e_{1u}}_{\,i + i_p}^{\,k}}\right)^2
1126\frac{-\alpha_i^k \delta_{k+ k_p}[T^i]+ \beta_i^k\delta_{k+ k_p}[S^i]} {{e_{3w}}_{\,i}^{\,k+k_p}}.
1127\end{multline}
1128Where the fluid is stable, with $-\alpha_i^k \delta_{k+ k_p}[T^i]+
1129\beta_i^k\delta_{k+ k_p}[S^i]<0$, this PE change is negative.
1130
1131\subsection{Treatment of the triads at the boundaries}\label{sec:triad:skew_bdry}
1132Triad slopes \rtriadt{R} used for the calculation of the eddy-induced skew-fluxes
1133are masked at the boundaries in exactly the same way as are the triad
1134slopes \rtriad{R} used for the iso-neutral diffusive fluxes, as
1135described in \S\ref{sec:triad:iso_bdry} and
1136Fig.~\ref{fig:triad:bdry_triads}. Thus surface layer triads
1137$\triadt{i}{1}{R}{1/2}{-1/2}$ and $\triadt{i+1}{1}{R}{-1/2}{-1/2}$ are
1138masked, and both near bottom triad slopes $\triadt{i}{k}{R}{1/2}{1/2}$
1139and $\triadt{i+1}{k}{R}{-1/2}{1/2}$ are masked when either of the
1140$i,k+1$ or $i+1,k+1$ tracer points is masked, i.e.\ the $i,k+1$
1141$u$-point is masked. The namelist parameter \np{ln\_botmix\_grif} has
1142no effect on the eddy-induced skew-fluxes.
1143
1144\subsection{ Limiting of the slopes within the interior}\label{sec:triad:limitskew}
1145Presently, the iso-neutral slopes $\tilde{r}_i$ relative
1146to geopotentials are limited to be less than $1/100$, exactly as in
1147calculating the iso-neutral diffusion, \S \ref{sec:triad:limit}. Each
1148individual triad \rtriadt{R} is so limited.
1149
1150\subsection{Tapering within the surface mixed layer}\label{sec:triad:taperskew}
1151The slopes $\tilde{r}_i$ relative to
1152geopotentials (and thus the individual triads \rtriadt{R}) are always tapered linearly from their value immediately below the mixed layer to zero at the
1153surface \eqref{eq:triad:rmtilde}, as described in \S\ref{sec:triad:lintaper}. This is
1154option (c) of Fig.~\ref{Fig_eiv_slp}. This linear tapering for the
1155slopes used to calculate the eddy-induced fluxes is
1156unaffected by the value of \np{ln\_triad\_iso}.
1157
1158The justification for this linear slope tapering is that, for $A_e$
1159that is constant or varies only in the horizontal (the most commonly
1160used options in \NEMO: see \S\ref{LDF_coef}), it is
1161equivalent to a horizontal eiv (eddy-induced velocity) that is uniform
1162within the mixed layer \eqref{eq:triad:eiv_v}. This ensures that the
1163eiv velocities do not restratify the mixed layer \citep{Treguier1997,
1164  Danabasoglu_al_2008}. Equivantly, in terms
1165of the skew-flux formulation we use here, the
1166linear slope tapering within the mixed-layer gives a linearly varying
1167vertical flux, and so a tracer convergence uniform in depth (the
1168horizontal flux convergence is relatively insignificant within the mixed-layer).
1169
1170\subsection{Streamfunction diagnostics}\label{sec:triad:sfdiag}
1171Where the namelist parameter \np{ln\_traldf\_gdia}=true, diagnosed
1172mean eddy-induced velocities are output. Each time step,
1173streamfunctions are calculated in the $i$-$k$ and $j$-$k$ planes at
1174$uw$ (integer +1/2 $i$, integer $j$, integer +1/2 $k$) and $vw$
1175(integer $i$, integer +1/2 $j$, integer +1/2 $k$) points (see Table
1176\ref{Tab_cell}) respectively. We follow \citep{Griffies_Bk04} and
1177calculate the streamfunction at a given $uw$-point from the
1178surrounding four triads according to:
1179\begin{equation}
1180  \label{eq:triad:sfdiagi}
1181  {\psi_1}_{i+1/2}^{k+1/2}={\quarter}\sum_{\substack{i_p,\,k_p}}
1182  {A_e}_{i+1/2-i_p}^{k+1/2-k_p}\:\triadd{i+1/2-i_p}{k+1/2-k_p}{R}{i_p}{k_p}.
1183\end{equation}
1184The streamfunction $\psi_1$ is calculated similarly at $vw$ points.
1185The eddy-induced velocities are then calculated from the
1186straightforward discretisation of \eqref{eq:triad:eiv_v}:
1187\begin{equation}\label{eq:triad:eiv_v_discrete}
1188\begin{split}
1189 {u^*}_{i+1/2}^{k} & = - \frac{1}{{e_{3u}}_{i}^{k}}\left({\psi_1}_{i+1/2}^{k+1/2}-{\psi_1}_{i+1/2}^{k+1/2}\right),   \\
1190 {v^*}_{j+1/2}^{k} & = - \frac{1}{{e_{3v}}_{j}^{k}}\left({\psi_2}_{j+1/2}^{k+1/2}-{\psi_2}_{j+1/2}^{k+1/2}\right),   \\
1191 {w^*}_{i,j}^{k+1/2} & =    \frac{1}{e_{1t}e_{2t}}\; \left\{
1192 {e_{2u}}_{i+1/2}^{k+1/2} \,{\psi_1}_{i+1/2}^{k+1/2} -
1193 {e_{2u}}_{i-1/2}^{k+1/2} \,{\psi_1}_{i-1/2}^{k+1/2} \right. + \\
1194\phantom{=} & \qquad\qquad\left. {e_{2v}}_{j+1/2}^{k+1/2} \,{\psi_2}_{j+1/2}^{k+1/2} - {e_{2v}}_{j-1/2}^{k+1/2} \,{\psi_2}_{j-1/2}^{k+1/2} \right\},
1195\end{split}
1196\end{equation}
1197\end{document}
Note: See TracBrowser for help on using the repository browser.