New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
annex_iso.tex in NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles – NEMO

source: NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/annex_iso.tex @ 10419

Last change on this file since 10419 was 10419, checked in by smasson, 5 years ago

dev_r10164_HPC09_ESIWACE_PREP_MERGE: merge with trunk@10418, see #2133

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