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/trunk/doc/latex/NEMO/subfiles – NEMO

source: NEMO/trunk/doc/latex/NEMO/subfiles/annex_iso.tex @ 11151

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

New version of NEMO_manual.tex
New class scrreport for the document (KOMA-script version of default report)
Foreword is now placed before ToC.
All figures are configured with 1.0\textwidth as default.
For compatibilty, \frontmatter, \mainmatter and \backmatter cmds have been removed and old fonts in LaTeX subfiles have been replaced

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