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.
apdx_triads.tex in NEMO/trunk/doc/latex/NEMO/subfiles – NEMO

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

Last change on this file since 11596 was 11596, checked in by nicolasmartin, 5 years ago

Application of some coding rules

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