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

source: trunk/DOC/TexFiles/Chapters/Annex_ISO.tex @ 6289

Last change on this file since 6289 was 6289, checked in by gm, 8 years ago

#1673 DOC of the trunk - Update, see associated wiki page for description

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