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

source: branches/UKMO/icebergs_restart_single_file/DOC/TexFiles/Chapters/Annex_ISO.tex @ 6019

Last change on this file since 6019 was 6019, checked in by timgraham, 8 years ago

Reinstated svn keywords before upgrading to head of trunk

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