source: NEMO/trunk/doc/latex/NEMO/subfiles/apdx_triads.tex @ 11693

Last change on this file since 11693 was 11693, checked in by nicolasmartin, 12 months ago

Macros renaming

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