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

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

source: NEMO/trunk/doc/latex/NEMO/subfiles/apdx_algos.tex

Last change on this file was 14257, checked in by nicolasmartin, 3 years ago

Overall review of LaTeX sources (not tested completely as of now):

  • Reworking global files: main document.tex, add glossary.tex, cosmetic changes...
  • Ignore missing namelists (namsbc_isf, namsbc_iscpl and namptr)
  • Removal of references for unused indices (\hfile, \ifile and \jp)
  • Update of .svnignore and svn:ignore properties accordingly
  • Split of manual abstract into a common NEMO abs for all and a specific one for each engine
  • Shrinking variables names used in the frontmatter
File size: 40.2 KB
Line 
1\documentclass[../main/NEMO_manual]{subfiles}
2
3\begin{document}
4
5\chapter{Note on some algorithms}
6\label{apdx:ALGOS}
7
8\chaptertoc
9
10\paragraph{Changes record} ~\\
11
12{\footnotesize
13  \begin{tabularx}{\textwidth}{l||X|X}
14    Release & Author(s) & Modifications \\
15    \hline
16    {\em   4.0} & {\em ...} & {\em ...} \\
17    {\em   3.6} & {\em ...} & {\em ...} \\
18    {\em   3.4} & {\em ...} & {\em ...} \\
19    {\em <=3.4} & {\em ...} & {\em ...}
20  \end{tabularx}
21}
22
23\clearpage
24
25This appendix some on going consideration on algorithms used or planned to be used in \NEMO.
26
27%% =================================================================================================
28\section{Upstream Biased Scheme (UBS) (\protect\np[=.true.]{ln_traadv_ubs}{ln\_traadv\_ubs})}
29\label{sec:ALGOS_tra_adv_ubs}
30
31The UBS advection scheme is an upstream biased third order scheme based on
32an upstream-biased parabolic interpolation.
33It is also known as Cell Averaged QUICK scheme (Quadratic Upstream Interpolation for Convective Kinematics).
34For example, in the $i$-direction:
35\begin{equation}
36  \label{eq:ALGOS_tra_adv_ubs2}
37  \tau_u^{ubs} = \left\{
38    \begin{aligned}
39      & \tau_u^{cen4} + \frac{1}{12} \,\tau"_i     & \quad \text{if }\ u_{i+1/2} \geqslant 0 \\
40      & \tau_u^{cen4} - \frac{1}{12} \,\tau"_{i+1} & \quad \text{if }\ u_{i+1/2}       <       0
41    \end{aligned}
42  \right.
43\end{equation}
44or equivalently, the advective flux is
45\begin{equation}
46  \label{eq:ALGOS_tra_adv_ubs2}
47  U_{i+1/2} \ \tau_u^{ubs}
48  =U_{i+1/2} \ \overline{ T_i - \frac{1}{6}\,\tau"_i }^{\,i+1/2}
49  - \frac{1}{2}\, |U|_{i+1/2} \;\frac{1}{6} \;\delta_{i+1/2}[\tau"_i]
50\end{equation}
51where $U_{i+1/2} = e_{1u}\,e_{3u}\,u_{i+1/2}$ and
52$\tau "_i =\delta_i \left[ {\delta_{i+1/2} \left[ \tau \right]} \right]$.
53By choosing this expression for $\tau "$ we consider a fourth order approximation of $\partial_i^2$ with
54a constant i-grid spacing ($\Delta i=1$).
55
56Alternative choice: introduce the scale factors:
57$\tau "_i =\frac{e_{1T}}{e_{2T}\,e_{3T}}\delta_i \left[ \frac{e_{2u} e_{3u} }{e_{1u} }\delta_{i+1/2}[\tau] \right]$.
58
59This results in a dissipatively dominant (\ie\ hyper-diffusive) truncation error
60\citep{shchepetkin.mcwilliams_OM05}.
61The overall performance of the advection scheme is similar to that reported in \cite{farrow.stevens_JPO95}.
62It is a relatively good compromise between accuracy and smoothness.
63It is not a \emph{positive} scheme meaning false extrema are permitted but
64the amplitude of such are significantly reduced over the centred second order method.
65Nevertheless it is not recommended to apply it to a passive tracer that requires positivity.
66
67The intrinsic diffusion of UBS makes its use risky in the vertical direction where
68the control of artificial diapycnal fluxes is of paramount importance.
69It has therefore been preferred to evaluate the vertical flux using the TVD scheme when
70\np[=.true.]{ln_traadv_ubs}{ln\_traadv\_ubs}.
71
72For stability reasons, in \autoref{eq:TRA_adv_ubs}, the first term which corresponds to
73a second order centred scheme is evaluated using the \textit{now} velocity (centred in time) while
74the second term which is the diffusive part of the scheme, is evaluated using the \textit{before} velocity
75(forward in time).
76This is discussed by \citet{webb.de-cuevas.ea_JAOT98} in the context of the Quick advection scheme.
77UBS and QUICK schemes only differ by one coefficient.
78Substituting 1/6 with 1/8 in (\autoref{eq:TRA_adv_ubs}) leads to the QUICK advection scheme \citep{webb.de-cuevas.ea_JAOT98}.
79This option is not available through a namelist parameter, since the 1/6 coefficient is hard coded.
80Nevertheless it is quite easy to make the substitution in \mdl{traadv\_ubs} module and obtain a QUICK scheme.
81
82NB 1: When a high vertical resolution $O(1m)$ is used, the model stability can be controlled by vertical advection
83(not vertical diffusion which is usually solved using an implicit scheme).
84Computer time can be saved by using a time-splitting technique on vertical advection.
85This possibility have been implemented and validated in ORCA05-L301.
86It is not currently offered in the current reference version.
87
88NB 2: In a forthcoming release four options will be proposed for the vertical component used in the UBS scheme.
89$\tau_w^{ubs}$ will be evaluated using either \textit{(a)} a centered $2^{nd}$ order scheme,
90or \textit{(b)} a TVD scheme, or \textit{(c)} an interpolation based on conservative parabolic splines following
91\citet{shchepetkin.mcwilliams_OM05} implementation of UBS in ROMS, or \textit{(d)} an UBS.
92The $3^{rd}$ case has dispersion properties similar to an eight-order accurate conventional scheme.
93
94NB 3: It is straight forward to rewrite \autoref{eq:TRA_adv_ubs} as follows:
95\begin{equation}
96  \label{eq:ALGOS_tra_adv_ubs2}
97  \tau_u^{ubs} = \left\{
98    \begin{aligned}
99      & \tau_u^{cen4} + \frac{1}{12} \tau"_i    & \quad \text{if }\ u_{i+1/2} \geqslant 0 \\
100      & \tau_u^{cen4} - \frac{1}{12} \tau"_{i+1}   & \quad \text{if }\ u_{i+1/2}       <       0
101    \end{aligned}
102  \right.
103\end{equation}
104or equivalently
105\begin{equation}
106  \label{eq:ALGOS_tra_adv_ubs2}
107  \begin{split}
108    e_{2u} e_{3u}\,u_{i+1/2} \ \tau_u^{ubs}
109    &= e_{2u} e_{3u}\,u_{i+1/2} \ \overline{ T - \frac{1}{6}\,\tau"_i }^{\,i+1/2} \\
110    & - \frac{1}{2} e_{2u} e_{3u}\,|u|_{i+1/2} \;\frac{1}{6} \;\delta_{i+1/2}[\tau"_i]
111  \end{split}
112\end{equation}
113\autoref{eq:TRA_adv_ubs2} has several advantages.
114First it clearly evidences that the UBS scheme is based on the fourth order scheme to which
115is added an upstream biased diffusive term.
116Second, this emphasises that the $4^{th}$ order part have to be evaluated at \emph{now} time step,
117not only the $2^{th}$ order part as stated above using \autoref{eq:TRA_adv_ubs}.
118Third, the diffusive term is in fact a biharmonic operator with a eddy coefficient which
119is simply proportional to the velocity.
120
121laplacian diffusion:
122\begin{equation}
123  \label{eq:ALGOS_tra_ldf_lap}
124  \begin{split}
125    D_T^{lT} =\frac{1}{e_{1T} \; e_{2T}\;  e_{3T} } &\left[ {\quad \delta_i
126        \left[ {A_u^{lT} \frac{e_{2u} e_{3u} }{e_{1u} }\;\delta_{i+1/2}
127            \left[ T \right]} \right]} \right. \\
128    &\ \left. {+\; \delta_j \left[
129          {A_v^{lT} \left( {\frac{e_{1v} e_{3v} }{e_{2v} }\;\delta_{j+1/2} \left[ T
130                \right]} \right)} \right]\quad } \right]
131  \end{split}
132\end{equation}
133
134bilaplacian:
135\begin{equation}
136  \label{eq:ALGOS_tra_ldf_lap}
137  \begin{split}
138    D_T^{lT} =&-\frac{1}{e_{1T} \; e_{2T}\;  e_{3T}} \\
139    & \delta_i \left\sqrt{A_u^{lT}}\ \frac{e_{2u}\,e_{3u}}{e_{1u}}\;\delta_{i+1/2}
140      \left[ \frac{1}{e_{1T}\,e_{2T}\, e_{3T}}
141        \delta_i \left[ \sqrt{A_u^{lT}}\ \frac{e_{2u}\,e_{3u}}{e_{1u}}\;\delta_{i+1/2}
142          [T] \right] \right] \right]
143  \end{split}
144\end{equation}
145with ${A_u^{lT}}^2 = \frac{1}{12} {e_{1u}}^3\ |u|$,
146\ie\ $A_u^{lT} = \frac{1}{\sqrt{12}} \,e_{1u}\ \sqrt{ e_{1u}\,|u|\,}$
147it comes:
148\begin{equation}
149  \label{eq:ALGOS_tra_ldf_lap}
150  \begin{split}
151    D_T^{lT} =&-\frac{1}{12}\,\frac{1}{e_{1T} \; e_{2T}\;  e_{3T}} \\
152    & \delta_i \left[ e_{2u}\,e_{3u}\,\sqrt{ e_{1u}\,|u|\,}\;\delta_{i+1/2}
153      \left[ \frac{1}{e_{1T}\,e_{2T}\, e_{3T}}
154        \delta_i \left[ e_{2u}\,e_{3u}\,\sqrt{ e_{1u}\,|u|\,}\;\delta_{i+1/2}
155          [T] \right] \right] \right]
156  \end{split}
157\end{equation}
158if the velocity is uniform (\ie\ $|u|=cst$) then the diffusive flux is
159\begin{equation}
160  \label{eq:ALGOS_tra_ldf_lap}
161  \begin{split}
162    F_u^{lT} = - \frac{1}{12}
163    e_{2u}\,e_{3u}\,|u| \;\sqrt{ e_{1u}}\,\delta_{i+1/2}
164    \left[ \frac{1}{e_{1T}\,e_{2T}\, e_{3T}}
165      \delta_i \left[ e_{2u}\,e_{3u}\,\sqrt{ e_{1u}}\:\delta_{i+1/2}
166        [T] \right] \right]
167  \end{split}
168\end{equation}
169beurk....  reverte the logic: starting from the diffusive part of the advective flux it comes:
170
171\begin{equation}
172  \label{eq:ALGOS_tra_adv_ubs2}
173  \begin{split}
174    F_u^{lT} &= - \frac{1}{2} e_{2u} e_{3u}\,|u|_{i+1/2} \;\frac{1}{6} \;\delta_{i+1/2}[\tau"_i]
175  \end{split}
176\end{equation}
177if the velocity is uniform (\ie\ $|u|=cst$) and
178choosing $\tau "_i =\frac{e_{1T}}{e_{2T}\,e_{3T}}\delta_i \left[ \frac{e_{2u} e_{3u} }{e_{1u} } \delta_{i+1/2}[\tau] \right]$
179
180sol 1 coefficient at T-point ( add $e_{1u}$ and $e_{1T}$ on both side of first $\delta$):
181\begin{equation}
182  \label{eq:ALGOS_tra_adv_ubs2}
183  \begin{split}
184    F_u^{lT} &= - \frac{1}{12} \frac{e_{2u} e_{3u}}{e_{1u}}\;\delta_{i+1/2}\left[ \frac{e_{1T}^3\,|u|}{e_{1T}e_{2T}\,e_{3T}}\,\delta_i \left[ \frac{e_{2u} e_{3u} }{e_{1u} } \delta_{i+1/2}[\tau] \right] \right]
185  \end{split}
186\end{equation}
187which leads to ${A_T^{lT}}^2 = \frac{1}{12} {e_{1T}}^3\ \overline{|u|}^{\,i+1/2}$
188
189sol 2 coefficient at u-point: split $|u|$ into $\sqrt{|u|}$ and $e_{1T}$ into $\sqrt{e_{1u}}$
190\begin{equation}
191  \label{eq:ALGOS_tra_adv_ubs2}
192  \begin{split}
193    F_u^{lT} &= - \frac{1}{12} {e_{1u}}^1 \sqrt{e_{1u}|u|} \frac{e_{2u} e_{3u}}{e_{1u}}\;\delta_{i+1/2}\left[ \frac{1}{e_{2T}\,e_{3T}}\,\delta_i \left[ \sqrt{e_{1u}|u|} \frac{e_{2u} e_{3u} }{e_{1u} } \delta_{i+1/2}[\tau] \right] \right] \\
194    &= - \frac{1}{12} e_{1u} \sqrt{e_{1u}|u|\,} \frac{e_{2u} e_{3u}}{e_{1u}}\;\delta_{i+1/2}\left[ \frac{1}{e_{1T}\,e_{2T}\,e_{3T}}\,\delta_i \left[ e_{1u} \sqrt{e_{1u}|u|\,} \frac{e_{2u} e_{3u} }{e_{1u}} \delta_{i+1/2}[\tau] \right] \right]
195  \end{split}
196\end{equation}
197which leads to ${A_u^{lT}} = \frac{1}{12} {e_{1u}}^3\ |u|$
198
199%% =================================================================================================
200\section{Leapfrog energetic}
201\label{sec:ALGOS_LF}
202
203We adopt the following semi-discrete notation for time derivative.
204Given the values of a variable $q$ at successive time step,
205the time derivation and averaging operators at the mid time step are:
206\[
207  % \label{eq:ALGOS_dt_mt}
208  \begin{split}
209    \delta_{t+\rdt/2} [q]     &=  \  \ \,   q^{t+\rdt- q^{t}      \\
210    \overline q^{\,t+\rdt/2} &= \left\{ q^{t+\rdt} + q^{t} \right\} \; / \; 2
211  \end{split}
212\]
213As for space operator,
214the adjoint of the derivation and averaging time operators are $\delta_t^*=\delta_{t+\rdt/2}$ and
215$\overline{\cdot}^{\,t\,*}= \overline{\cdot}^{\,t+\Delta/2}$, respectively.
216
217The Leap-frog time stepping given by \autoref{eq:DOM_nxt} can be defined as:
218\[
219  % \label{eq:ALGOS_LF}
220  \frac{\partial q}{\partial t}
221  \equiv \frac{1}{\rdt} \overline{ \delta_{t+\rdt/2}[q]}^{\,t}
222  =         \frac{q^{t+\rdt}-q^{t-\rdt}}{2\rdt}
223\]
224Note that \autoref{chap:LF} shows that the leapfrog time step is $\rdt$,
225not $2\rdt$ as it can be found sometimes in literature.
226The leap-Frog time stepping is a second order centered scheme.
227As such it respects the quadratic invariant in integral forms, \ie\ the following continuous property,
228\[
229  % \label{eq:ALGOS_Energy}
230  \int_{t_0}^{t_1} {q\, \frac{\partial q}{\partial t} \;dt}
231  =\int_{t_0}^{t_1} {\frac{1}{2}\, \frac{\partial q^2}{\partial t} \;dt}
232  =  \frac{1}{2} \left( {q_{t_1}}^2 - {q_{t_0}}^2 \right) ,
233\]
234is satisfied in discrete form.
235Indeed,
236\[
237  \begin{split}
238    \int_{t_0}^{t_1} {q\, \frac{\partial q}{\partial t} \;dt}
239    &\equiv \sum\limits_{0}^{N}
240    {\frac{1}{\rdt} q^t \ \overline{ \delta_{t+\rdt/2}[q]}^{\,t} \ \rdt}
241    \equiv \sum\limits_{0}^{N}  { q^t \ \overline{ \delta_{t+\rdt/2}[q]}^{\,t} } \\
242    &\equiv \sum\limits_{0}^{N}  { \overline{q}^{\,t+\Delta/2}{ \delta_{t+\rdt/2}[q]}}
243    \equiv \sum\limits_{0}^{N}  { \frac{1}{2} \delta_{t+\rdt/2}[q^2] }\\
244    &\equiv \sum\limits_{0}^{N}  { \frac{1}{2} \delta_{t+\rdt/2}[q^2] }
245    \equiv \frac{1}{2} \left( {q_{t_1}}^2 - {q_{t_0}}^2 \right)
246  \end{split}
247\]
248NB here pb of boundary condition when applying the adjoint!
249In space, setting to 0 the quantity in land area is sufficient to get rid of the boundary condition
250(equivalently of the boundary value of the integration by part).
251In time this boundary condition is not physical and \textbf{add something here!!!}
252
253%% =================================================================================================
254\section{Lateral diffusion operator}
255
256%% =================================================================================================
257\subsection{Griffies iso-neutral diffusion operator}
258
259Let try to define a scheme that get its inspiration from the \citet{griffies.gnanadesikan.ea_JPO98} scheme,
260but is formulated within the \NEMO\ framework
261(\ie\ using scale factors rather than grid-size and having a position of $T$-points that
262is not necessary in the middle of vertical velocity points, see \autoref{fig:DOM_zgr_e3}).
263
264In the formulation \autoref{eq:TRA_ldf_iso} introduced in 1995 in OPA, the ancestor of \NEMO,
265the off-diagonal terms of the small angle diffusion tensor contain several double spatial averages of a gradient,
266for example $\overline{\overline{\delta_k \cdot}}^{\,i,k}$.
267It is apparent that the combination of a $k$ average and a $k$ derivative of the tracer allows for
268the presence of grid point oscillation structures that will be invisible to the operator.
269These structures are \textit{computational modes}.
270They will not be damped by the iso-neutral operator, and even possibly amplified by it.
271In other word, the operator applied to a tracer does not warranties the decrease of its global average variance.
272To circumvent this, we have introduced a smoothing of the slopes of the iso-neutral surfaces
273(see \autoref{chap:LDF}).
274Nevertheless, this technique works fine for $T$ and $S$ as they are active tracers
275(\ie\ they enter the computation of density), but it does not work for a passive tracer.
276\citep{griffies.gnanadesikan.ea_JPO98} introduce a different way to discretise the off-diagonal terms that
277nicely solve the problem.
278The idea is to get rid of combinations of an averaged in one direction combined with
279a derivative in the same direction by considering triads.
280For example in the (\textbf{i},\textbf{k}) plane, the four triads are defined at the $(i,k)$ $T$-point as follows:
281\begin{equation}
282  \label{eq:ALGOS_Gf_triads}
283  _i^k \mathbb{T}_{i_p}^{k_p} (T)
284  = \frac{1}{4} \ {b_u}_{\,i+i_p}^{\,k}  \  A_i^k     \left(
285    \frac{ \delta_{i + i_p}[T^k] }{ {e_{1u}}_{\,i + i_p}^{\,k} }
286    -\ {_i^k \mathbb{R}_{i_p}^{k_p}} \ \frac{ \delta_{k+k_p} [T^i] }{ {e_{3w}}_{\,i}^{\,k+k_p} }
287  \right)
288\end{equation}
289where the indices $i_p$ and $k_p$ define the four triads and take the following value:
290$i_p = -1/2$ or $1/2$ and $k_p = -1/2$ or $1/2$,
291$b_u= e_{1u}\,e_{2u}\,e_{3u}$ is the volume of $u$-cells,
292$A_i^k$ is the lateral eddy diffusivity coefficient defined at $T$-point,
293and $_i^k \mathbb{R}_{i_p}^{k_p}$ is the slope associated with each triad:
294\begin{equation}
295  \label{eq:ALGOS_Gf_slopes}
296  _i^k \mathbb{R}_{i_p}^{k_p}
297  =\frac{ {e_{3w}}_{\,i}^{\,k+k_p}} { {e_{1u}}_{\,i+i_p}^{\,k}} \ \frac
298  {\left(\alpha / \beta \right)_i^\ \delta_{i + i_p}[T^k] - \delta_{i + i_p}[S^k] }
299  {\left(\alpha / \beta \right)_i^\ \delta_{k+k_p}[T^i ] - \delta_{k+k_p}[S^i ] }
300\end{equation}
301Note that in \autoref{eq:ALGOS_Gf_slopes} we use the ratio $\alpha / \beta$ instead of
302multiplying the temperature derivative by $\alpha$ and the salinity derivative by $\beta$.
303This is more efficient as the ratio $\alpha / \beta$ can to be evaluated directly.
304
305Note that in \autoref{eq:ALGOS_Gf_triads}, we chose to use ${b_u}_{\,i+i_p}^{\,k}$ instead of ${b_{uw}}_{\,i+i_p}^{\,k+k_p}$.
306This choice has been motivated by the decrease of tracer variance and
307the presence of partial cell at the ocean bottom (see \autoref{subsec:ALGOS_Gf_operator}).
308
309\begin{figure}[!ht]
310  \centering
311  %\includegraphics[width=0.66\textwidth]{ALGOS_ISO_triad}
312  \caption[Triads used in the Griffies's like iso-neutral diffision scheme for
313    $u$- and $w$-components)]{
314    Triads used in the Griffies's like iso-neutral diffision scheme for
315    $u$-component (upper panel) and $w$-component (lower panel).}
316  \label{fig:ALGOS_ISO_triad}
317\end{figure}
318
319The four iso-neutral fluxes associated with the triads are defined at $T$-point.
320They take the following expression:
321\begin{flalign*}
322  % \label{eq:ALGOS_Gf_fluxes}
323  \begin{split}
324    {_i^k {\mathbb{F}_u}_{i_p}^{k_p} } (T)
325    &= \ \; \qquad  \quad    { _i^k \mathbb{T}_{i_p}^{k_p} }(T) \;\ / \ { {e_{1u}}_{\,i+i_p}^{\,k}}    \\
326    {_i^k {\mathbb{F}_w}_{i_p}^{k_p} } (T)
327    &=  -\; { _i^k \mathbb{R}_{i_p}^{k_p} }
328    \ \; { _i^k \mathbb{T}_{i_p}^{k_p} }(T) \;\ / \ { {e_{3w}}_{\,i}^{\,k+k_p}}
329  \end{split}
330\end{flalign*}
331
332The resulting iso-neutral fluxes at $u$- and $w$-points are then given by
333the sum of the fluxes that cross the $u$- and $w$-face (\autoref{fig:TRIADS_ISO_triad}):
334\begin{flalign}
335  \label{eq:ALGOS_iso_flux}
336  \textbf{F}_{iso}(T)
337  &\equiv  \sum_{\substack{i_p,\,k_p}}
338  \begin{pmatrix}
339    {_{i+1/2-i_p}^k {\mathbb{F}_u}_{i_p}^{k_p} } (T) \\ \\
340    {_i^{k+1/2-k_p} {\mathbb{F}_w}_{i_p}^{k_p} } (T)
341  \end{pmatrix}
342  \notag \\
343  &  \notag \\
344  &\equiv  \sum_{\substack{i_p,\,k_p}}
345  \begin{pmatrix}
346    && { _{i+1/2-i_p}^k \mathbb{T}_{i_p}^{k_p} }(T) \;\ / \ { {e_{1u}}_{\,i+1/2}^{\,k} } \\ \\
347    & -\; { _i^{k+1/2-k_p} \mathbb{R}_{i_p}^{k_p} }
348    & {_i^{k+1/2-k_p} \mathbb{T}_{i_p}^{k_p} }(T) \;\ / \ { {e_{3w}}_{\,i}^{\,k+1/2} }
349  \end{pmatrix}      % \\
350  % &\\
351  % &\equiv  \sum_{\substack{i_p,\,k_p}}
352  % \begin{pmatrix}
353  %   \qquad  \qquad  \qquad
354  %   \frac{1}{ {e_{1u}}_{\,i+1/2}^{\,k} }  \ \;
355  %   { _{i+1/2-i_p}^k \mathbb{T}_{i_p}^{k_p} }(T)\\
356  %   \\
357  %   -\frac{1}{ {e_{3w}}_{\,i}^{\,k+1/2} }  \ \;
358  %   { _i^{k+1/2-k_p} \mathbb{R}_{i_p}^{k_p} } \ \;
359  %   {_i^{k+1/2-k_p} \mathbb{T}_{i_p}^{k_p} }(T)\\
360  % \end{pmatrix}
361\end{flalign}
362resulting in a iso-neutral diffusion tendency on temperature given by
363the divergence of the sum of all the four triad fluxes:
364\begin{equation}
365  \label{eq:ALGOS_Gf_operator}
366  D_l^T = \frac{1}{b_T}  \sum_{\substack{i_p,\,k_p}} \left\{
367    \delta_{i} \left[{_{i+1/2-i_p}^k {\mathbb{F}_u }_{i_p}^{k_p}} \right]
368    + \delta_{k} \left[ {_i^{k+1/2-k_p} {\mathbb{F}_w}_{i_p}^{k_p}} \right]   \right\}
369\end{equation}
370where $b_T= e_{1T}\,e_{2T}\,e_{3T}$ is the volume of $T$-cells.
371
372This expression of the iso-neutral diffusion has been chosen in order to satisfy the following six properties:
373\begin{description}
374\item [Horizontal diffusion] The discretization of the diffusion operator recovers the traditional five-point Laplacian in the limit of flat iso-neutral direction:
375  \[
376    % \label{eq:ALGOS_Gf_property1a}
377    D_l^T = \frac{1}{b_T}  \ \delta_{i}
378    \left[ \frac{e_{2u}\,e_{3u}}{e_{1u}} \; \overline{A}^{\,i} \; \delta_{i+1/2}[T] \right]
379    \qquad  \text{when} \quad
380    { _i^k \mathbb{R}_{i_p}^{k_p} }=0
381  \]
382\item [Implicit treatment in the vertical] In the diagonal term associated with the vertical divergence of the iso-neutral fluxes
383  \ie\ the term associated with a second order vertical derivative)
384  appears only tracer values associated with a single water column.
385  This is of paramount importance since it means that
386  the implicit in time algorithm for solving the vertical diffusion equation can be used to evaluate this term.
387  It is a necessity since the vertical eddy diffusivity associated with this term,
388  \[
389    \sum_{\substack{i_p, \,k_p}} \left\{
390      A_i^k \; \left(_i^k \mathbb{R}_{i_p}^{k_p}\right)^2
391    \right\}
392  \]
393  can be quite large.
394\item [Pure iso-neutral operator] The iso-neutral flux of locally referenced potential density is zero, \ie
395  \begin{align*}
396    % \label{eq:ALGOS_Gf_property2}
397    \begin{matrix}
398      &{_i^k {\mathbb{F}_u}_{i_p}^{k_p} (\rho)}
399      &=    &\alpha_i^k   &{_i^k {\mathbb{F}_u}_{i_p}^{k_p} } (T)
400      &- \ \;  \beta _i^k    &{_i^k {\mathbb{F}_u}_{i_p}^{k_p} } (S) & = \ 0   \\
401      &{_i^k {\mathbb{F}_w}_{i_p}^{k_p} (\rho)}
402      &=    &\alpha_i^k   &{_i^k {\mathbb{F}_w}_{i_p}^{k_p} } (T)
403      &- \  \; \beta _i^k    &{_i^k {\mathbb{F}_w}_{i_p}^{k_p} } (S)  &= \ 0
404    \end{matrix}
405  \end{align*}
406  This result is trivially obtained using the \autoref{eq:ALGOS_Gf_triads} applied to $T$ and $S$ and
407  the definition of the triads' slopes \autoref{eq:ALGOS_Gf_slopes}.
408\item [Conservation of tracer] The iso-neutral diffusion term conserve the total tracer content, \ie
409  \[
410    % \label{eq:ALGOS_Gf_property1}
411    \sum_{i,j,k} \left\{ D_l^T \ b_T \right\} = 0
412  \]
413This property is trivially satisfied since the iso-neutral diffusive operator is written in flux form.
414\item [Decrease of tracer variance] The iso-neutral diffusion term does not increase the total tracer variance, \ie
415  \[
416    % \label{eq:ALGOS_Gf_property1}
417    \sum_{i,j,k} \left\{ T \ D_l^T \ b_T \right\} \leq 0
418  \]
419The property is demonstrated in the \autoref{subsec:ALGOS_Gf_operator}.
420It is a key property for a diffusion term.
421It means that the operator is also a dissipation term,
422\ie\ it is a sink term for the square of the quantity on which it is applied.
423It therfore ensures that, when the diffusivity coefficient is large enough,
424the field on which it is applied become free of grid-point noise.
425\item [Self-adjoint operator] The iso-neutral diffusion operator is self-adjoint, \ie
426  \[
427    % \label{eq:ALGOS_Gf_property1}
428    \sum_{i,j,k} \left\{ S \ D_l^T \ b_T \right\} = \sum_{i,j,k} \left\{ D_l^S \ T \ b_T \right\}
429  \]
430In other word, there is no needs to develop a specific routine from the adjoint of this operator.
431We just have to apply the same routine.
432This properties can be demonstrated quite easily in a similar way the "non increase of tracer variance" property
433has been proved (see \autoref{apdx:ALGOS_Gf_operator}).
434\end{description}
435
436%% =================================================================================================
437\subsection{Eddy induced velocity and skew flux formulation}
438
439When Gent and McWilliams [1990] diffusion is used (\key{traldf\_eiv} defined),
440an additional advection term is added.
441The associated velocity is the so called eddy induced velocity,
442the formulation of which depends on the slopes of iso-neutral surfaces.
443Contrary to the case of iso-neutral mixing, the slopes used here are referenced to the geopotential surfaces,
444\ie\ \autoref{eq:LDF_slp_geo} is used in $z$-coordinate,
445and the sum \autoref{eq:LDF_slp_geo} + \autoref{eq:LDF_slp_iso} in $z^*$ or $s$-coordinates.
446
447The eddy induced velocity is given by:
448\begin{equation}
449  \label{eq:ALGOS_eiv_v}
450  \begin{split}
451    u^* & = - \frac{1}{e_2\,e_{3}}          \;\partial_k \left( e_2 \, A_e \; r_\right)
452    = - \frac{1}{e_3}                     \;\partial_k \left(           A_e \; r_\right)            \\
453    v^* & = - \frac{1}{e_1\,e_3}\;             \partial_k \left( e_1 \, A_e \; r_\right)
454    = - \frac{1}{e_3}                     \;\partial_k \left(           A_e \; r_\right)             \\
455    w^* & =    \frac{1}{e_1\,e_2}\; \left\{   \partial_\left( e_2 \, A_e \; r_\right)
456      + \partial_\left( e_1 \, A_e \;r_j   \right) \right\}
457  \end{split}
458\end{equation}
459where $A_{e}$ is the eddy induced velocity coefficient,
460and $r_i$ and $r_j$ the slopes between the iso-neutral and the geopotential surfaces.
461\cmtgm{Wrong: to be modified with 2 2D streamfunctions}
462In other words, the eddy induced velocity can be derived from a vector streamfuntion, $\phi$,
463which is given by $\phi = A_e\,\textbf{r}$ as $\textbf{U}^*  = \textbf{k} \times \nabla \phi$.
464
465A traditional way to implement this additional advection is to add it to the eulerian velocity prior to
466compute the tracer advection.
467This allows us to take advantage of all the advection schemes offered for the tracers
468(see \autoref{sec:TRA_adv}) and not just a $2^{nd}$ order advection scheme.
469This is particularly useful for passive tracers where
470\emph{positivity} of the advection scheme is of paramount importance.
471% give here the expression using the triads. It is different from the one given in \autoref{eq:LDF_eiv}
472% see just below a copy of this equation:
473%\begin{equation} \label{eq:ALGOS_ldfeiv}
474%\begin{split}
475% u^* & = \frac{1}{e_{2u}e_{3u}}\; \delta_k \left[e_{2u} \, A_{uw}^{eiv} \; \overline{r_{1w}}^{\,i+1/2} \right]\\
476% v^* & = \frac{1}{e_{1u}e_{3v}}\; \delta_k \left[e_{1v} \, A_{vw}^{eiv} \; \overline{r_{2w}}^{\,j+1/2} \right]\\
477%w^* & = \frac{1}{e_{1w}e_{2w}}\; \left\{ \delta_i \left[e_{2u} \, A_{uw}^{eiv} \; \overline{r_{1w}}^{\,i+1/2} \right] + %\delta_j \left[e_{1v} \, A_{vw}^{eiv} \; \overline{r_{2w}}^{\,j+1/2} \right] \right\} \\
478%\end{split}
479%\end{equation}
480\[
481  % \label{eq:ALGOS_eiv_vd}
482  \textbf{F}_{eiv}^T   \equiv   \left(
483    \begin{aligned}
484      \sum_{\substack{i_p,\,k_p}} &
485      +{e_{2u}}_{i+1/2-i_p}^{k}                                  \ \ {A_{e}}_{i+1/2-i_p}^{k}
486      \ \ \ { _{i+1/2-i_p}^k \mathbb{R}_{i_p}^{k_p} }    \ \ \delta_{k+k_p}[T_{i+1/2-i_p}] \\ \\
487      \sum_{\substack{i_p,\,k_p}} &
488      - {e_{2u}}_i^{k+1/2-k_p}                                      \ {A_{e}}_i^{k+1/2-k_p}
489      \ \ { _i^{k+1/2-k_p} \mathbb{R}_{i_p}^{k_p} }    \ \delta_{i+i_p}[T^{k+1/2-k_p}]
490    \end{aligned}
491  \right)
492\]
493
494\citep{griffies_JPO98} introduces another way to implement the eddy induced advection, the so-called skew form.
495It is based on a transformation of the advective fluxes using the non-divergent nature of the eddy induced velocity.
496For example in the (\textbf{i},\textbf{k}) plane, the tracer advective fluxes can be transformed as follows:
497\begin{flalign*}
498  \begin{split}
499    \textbf{F}_{eiv}^T =
500    \begin{pmatrix}
501      {e_{2}\,e_{3}\;  u^*}      \\
502      {e_{1}\,e_{2}\; w^*}
503    \end{pmatrix}
504    \;   T
505    &=
506    \begin{pmatrix}
507      { - \partial_k \left( e_{2} \, A_{e} \; r_i \right) \; T \;}      \\
508      {+ \partial_\left( e_{2} \, A_{e} \; r_i \right) \; T \;}
509    \end{pmatrix}
510    \\
511    &=
512    \begin{pmatrix}
513      { - \partial_k \left( e_{2} \, A_{e} \; r_\; T \right) \;}  \\
514      {+ \partial_\left( e_{2} \, A_{e} \; r_\; T \right) \;}
515    \end{pmatrix}
516    +
517    \begin{pmatrix}
518      {+ e_{2} \, A_{e} \; r_\; \partial_k T}  \\
519      { - e_{2} \, A_{e} \; r_\; \partial_i  T}
520    \end{pmatrix}
521  \end{split}
522\end{flalign*}
523and since the eddy induces velocity field is no-divergent,
524we end up with the skew form of the eddy induced advective fluxes:
525\begin{equation}
526  \label{eq:ALGOS_eiv_skew_continuous}
527  \textbf{F}_{eiv}^T =
528  \begin{pmatrix}
529    {+ e_{2} \, A_{e} \; r_\; \partial_k T}   \\
530    { - e_{2} \, A_{e} \; r_\; \partial_i  T}
531  \end{pmatrix}
532\end{equation}
533The tendency associated with eddy induced velocity is then simply the divergence of
534the \autoref{eq:ALGOS_eiv_skew_continuous} fluxes.
535It naturally conserves the tracer content, as it is expressed in flux form and,
536as the advective form, it preserves the tracer variance.
537Another interesting property of \autoref{eq:ALGOS_eiv_skew_continuous} form is that when $A=A_e$,
538a simplification occurs in the sum of the iso-neutral diffusion and eddy induced velocity terms:
539\begin{flalign*}
540  % \label{eq:ALGOS_eiv_skew+eiv_continuous}
541  \textbf{F}_{iso}^T + \textbf{F}_{eiv}^T &=
542  \begin{pmatrix}
543    + \frac{e_2\,e_3\,}{e_1} A \;\partial_i T -  e_2 \, A \; r_i                              \;\partial_k T   \\
544    -  e_2 \, A_{e} \; r_i           \;\partial_i T + \frac{e_1\,e_2}{e_3} \, A \; r_i^2 \;\partial_k T
545  \end{pmatrix}
546  +
547  \begin{pmatrix}
548    {+ e_{2} \, A_{e} \; r_\; \partial_k T}   \\
549    { - e_{2} \, A_{e} \; r_\; \partial_i  T}
550  \end{pmatrix}
551  \\
552  &=
553  \begin{pmatrix}
554    + \frac{e_2\,e_3\,}{e_1} A \;\partial_i T    \\
555    -  2\; e_2 \, A_{e} \; r_i      \;\partial_i T + \frac{e_1\,e_2}{e_3} \, A \; r_i^2 \;\partial_k T
556  \end{pmatrix}
557\end{flalign*}
558The horizontal component reduces to the one use for an horizontal laplacian operator and
559the vertical one keeps the same complexity, but not more.
560This property has been used to reduce the computational time \citep{griffies_JPO98},
561but it is not of practical use as usually $A \neq A_e$.
562Nevertheless this property can be used to choose a discret form of \autoref{eq:ALGOS_eiv_skew_continuous} which
563is consistent with the iso-neutral operator \autoref{eq:ALGOS_Gf_operator}.
564Using the slopes \autoref{eq:ALGOS_Gf_slopes} and defining $A_e$ at $T$-point(\ie\ as $A$,
565the eddy diffusivity coefficient), the resulting discret form is given by:
566\begin{equation}
567  \label{eq:ALGOS_eiv_skew}
568  \textbf{F}_{eiv}^T   \equiv   \frac{1}{4} \left(
569    \begin{aligned}
570      \sum_{\substack{i_p,\,k_p}} &
571      +{e_{2u}}_{i+1/2-i_p}^{k}                                  \ \ {A_{e}}_{i+1/2-i_p}^{k}
572      \ \ \ { _{i+1/2-i_p}^k \mathbb{R}_{i_p}^{k_p} }    \ \ \delta_{k+k_p}[T_{i+1/2-i_p}] \\ \\
573      \sum_{\substack{i_p,\,k_p}} &
574      - {e_{2u}}_i^{k+1/2-k_p}                                      \ {A_{e}}_i^{k+1/2-k_p}
575      \ \ { _i^{k+1/2-k_p} \mathbb{R}_{i_p}^{k_p} }    \ \delta_{i+i_p}[T^{k+1/2-k_p}]
576    \end{aligned}
577  \right)
578\end{equation}
579Note that \autoref{eq:ALGOS_eiv_skew} is valid in $z$-coordinate with or without partial cells.
580In $z^*$ or $s$-coordinate, the slope between the level and the geopotential surfaces must be added to
581$\mathbb{R}$ for the discret form to be exact.
582
583Such a choice of discretisation is consistent with the iso-neutral operator as
584it uses the same definition for the slopes.
585It also ensures the conservation of the tracer variance (see \autoref{subsec:ALGOS_eiv_skew}),
586\ie\ it does not include a diffusive component but is a "pure" advection term.
587
588%% =================================================================================================
589\subsection{Discrete invariants of the iso-neutral diffrusion}
590\label{subsec:ALGOS_Gf_operator}
591
592Demonstration of the decrease of the tracer variance in the (\textbf{i},\textbf{j}) plane.
593
594This part will be moved in an Appendix.
595
596The continuous property to be demonstrated is:
597\[
598  \int_D  D_l^T \; T \;dv   \leq 0
599\]
600The discrete form of its left hand side is obtained using \autoref{eq:TRIADS_iso_flux}
601
602\begin{align*}
603  &\int_D  D_l^T \; T \;dv \equiv  \sum_{i,k} \left\{ T \ D_l^T \ b_T \right\}    \\
604  &\equiv + \sum_{i,k} \sum_{\substack{i_p,\,k_p}} \left\{
605    \delta_{i} \left[{_{i+1/2-i_p}^k {\mathbb{F}_u }_{i_p}^{k_p}} \right]
606    + \delta_{k} \left[ {_i^{k+1/2-k_p} {\mathbb{F}_w}_{i_p}^{k_p}} \right]  \ T \right\}    \\
607  &\equiv  - \sum_{i,k} \sum_{\substack{i_p,\,k_p}} \left\{
608    {_{i+1/2-i_p}^k {\mathbb{F}_u }_{i_p}^{k_p}} \ \delta_{i+1/2} [T]
609    + {_i^{k+1/2-k_p} {\mathbb{F}_w}_{i_p}^{k_p}}  \ \delta_{k+1/2} [T]   \right\}      \\
610  &\equiv -\sum_{i,k} \sum_{\substack{i_p,\,k_p}} \left\{
611    \frac{ _{i+1/2-i_p}^k \mathbb{T}_{i_p}^{k_p} (T) }{ {e_{1u}}_{\,i+1/2}^{\,k} }  \ \delta_{i+1/2} [T]
612    - { _i^{k+1/2-k_p} \mathbb{R}_{i_p}^{k_p} } \ \;
613    \frac{ _i^{k+1/2-k_p} \mathbb{T}_{i_p}^{k_p} (T) }{ {e_{3w}}_{\,i}^{\,k+1/2}  } \ \delta_{k+1/2} [T]
614    \right\}      \\
615    %
616  \allowdisplaybreaks
617  \intertext{ Expending the summation on $i_p$ and $k_p$, it becomes:}
618  %
619  &\equiv -\sum_{i,k}
620    \begin{Bmatrix}
621      &\ \ \Bigl{ _{i+1}^{k} \mathbb{T}_{-1/2}^{-1/2} (T) }
622      &\frac{ \delta_{i +1/2} [T] }{{e_{1u} }_{\,i+1/2}^{\,k}}
623      & -\ \ {_{i}^{k+1} \mathbb{R}_{-1/2}^{-1/2}}
624      &      {_{i}^{k+1} \mathbb{T}_{-1/2}^{-1/2} (T) }
625      &\frac{ \delta_{k+1/2} [T] }{{e_{3w}}_{\,i}^{\,k+1/2}}     \Bigr)
626      & \\
627      &+\Bigl( \ \;\; { _i^k \mathbb{T}_{+1/2}^{-1/2} (T) }
628      &\frac{ \delta_{i +1/2} [T] }{{e_{1u} }_{\,i+1/2}^{\,k}}
629      & -\ \ {_i^{k+1} \mathbb{R}_{+1/2}^{-1/2}}
630      & { _i^{k+1} \mathbb{T}_{+1/2}^{-1/2} (T) }
631      &\frac{ \delta_{k+1/2} [T] }{{e_{3w}}_{\,i}^{\,k+1/2}}      \Bigr)
632      & \\
633      &+\Bigl{ _{i+1}^{k} \mathbb{T}_{-1/2}^{+1/2} (T) }
634      &\frac{ \delta_{i +1/2} [T] }{{e_{1u} }_{\,i+1/2}^{\,k}}
635      & -\ \ \ \;\;{_{i}^{k} \mathbb{R}_{-1/2}^{+1/2}}
636      &      \ \;\;{_{i}^{k} \mathbb{T}_{-1/2}^{+1/2} (T) }
637      &\frac{ \delta_{k+1/2} [T] }{{e_{3w}}_{\,i}^{\,k+1/2}}     \Bigr)
638      & \\
639      &+\Bigl( \ \;\; { _{i}^{k} \mathbb{T}_{+1/2}^{+1/2} (T) }
640      &\frac{ \delta_{i +1/2} [T] }{{e_{1u} }_{\,i+1/2}^{\,k}}
641      & -\ \ \ \;\;{_{i}^{k} \mathbb{R}_{+1/2}^{+1/2}}
642      &      \ \;\;{_{i}^{k} \mathbb{T}_{+1/2}^{+1/2} (T) }
643      &\frac{ \delta_{k+1/2} [T] }{{e_{3w}}_{\,i}^{\,k+1/2}}     \Bigr)   \\
644    \end{Bmatrix}
645    %
646  \allowdisplaybreaks
647  \intertext{
648  The summation is done over all $i$ and $k$ indices,
649  it is therefore possible to introduce a shift of $-1$ either in $i$ or $k$ direction in order to
650  regroup all the terms of the summation by triad at a ($i$,$k$) point.
651  In other words, we regroup all the terms in the neighbourhood that contain a triad at the same ($i$,$k$) indices.
652  It becomes:
653  }
654  %
655  &\equiv -\sum_{i,k}
656    \begin{Bmatrix}
657      &\ \ \Bigl{_i^k \mathbb{T}_{-1/2}^{-1/2} (T) }
658      &\frac{ \delta_{i -1/2} [T] }{{e_{1u} }_{\,i-1/2}^{\,k}}
659      & -\ \ {_i^k \mathbb{R}_{-1/2}^{-1/2}}
660      &      {_i^k \mathbb{T}_{-1/2}^{-1/2} (T) }
661      &\frac{ \delta_{k-1/2} [T] }{{e_{3w}}_{\,i}^{\,k-1/2}}     \Bigr)
662      & \\
663      &+\Bigl{ _i^k \mathbb{T}_{+1/2}^{-1/2} (T) }
664      &\frac{ \delta_{i +1/2} [T] }{{e_{1u} }_{\,i+1/2}^{\,k}}
665      & -\ \ {_i^k \mathbb{R}_{+1/2}^{-1/2}}
666      &      { _i^k \mathbb{T}_{+1/2}^{-1/2} (T) }
667      &\frac{ \delta_{k-1/2} [T] }{{e_{3w}}_{\,i}^{\,k-1/2}}      \Bigr)
668      & \\
669      &+\Bigl{_i^k \mathbb{T}_{-1/2}^{+1/2} (T) }
670      &\frac{ \delta_{i -1/2} [T] }{{e_{1u} }_{\,i-1/2}^{\,k}}
671      & -\ \ {_i^k \mathbb{R}_{-1/2}^{+1/2}}
672      &      {_i^k \mathbb{T}_{-1/2}^{+1/2} (T) }
673      &\frac{ \delta_{k+1/2} [T] }{{e_{3w}}_{\,i}^{\,k+1/2}}     \Bigr)
674      & \\
675      &+\Bigl( { _i^k \mathbb{T}_{+1/2}^{+1/2} (T) }
676      &\frac{ \delta_{i +1/2} [T] }{{e_{1u} }_{\,i+1/2}^{\,k}}
677      & -\ \ {_i^k \mathbb{R}_{+1/2}^{+1/2}}
678      &      {_i^k \mathbb{T}_{+1/2}^{+1/2} (T) }
679      &\frac{ \delta_{k+1/2} [T] }{{e_{3w}}_{\,i}^{\,k+1/2}}     \Bigr)   \\
680    \end{Bmatrix}   \\
681    %
682  \allowdisplaybreaks
683  \intertext{
684  Then outing in factor the triad in each of the four terms of the summation and
685  substituting the triads by their expression given in \autoref{eq:ALGOS_Gf_triads}.
686  It becomes:
687  }
688  %
689  &\equiv -\sum_{i,k}
690    \begin{Bmatrix}
691      &\ \ \Bigl\frac{ \delta_{i -1/2} [T] }{{e_{1u} }_{\,i-1/2}^{\,k}}
692      & -\ \ {_i^k \mathbb{R}_{-1/2}^{-1/2}}
693      &\frac{ \delta_{k-1/2} [T] }{{e_{3w}}_{\,i}^{\,k-1/2}}     \Bigr)^2
694      & \frac{1}{4} \ {b_u}_{\,i-1/2}^{\,k}  \  A_i^k
695      & \\
696      &+\Bigl\frac{ \delta_{i +1/2} [T] }{{e_{1u} }_{\,i+1/2}^{\,k}}
697      & -\ \ {_i^k \mathbb{R}_{+1/2}^{-1/2}}
698      &\frac{ \delta_{k-1/2} [T] }{{e_{3w}}_{\,i}^{\,k-1/2}}      \Bigr)^2
699      & \frac{1}{4} \ {b_u}_{\,i+1/2}^{\,k}  \  A_i^k
700      & \\
701      &+\Bigl\frac{ \delta_{i -1/2} [T] }{{e_{1u} }_{\,i-1/2}^{\,k}}
702      & -\ \ {_i^k \mathbb{R}_{-1/2}^{+1/2}}
703      &\frac{ \delta_{k+1/2} [T] }{{e_{3w}}_{\,i}^{\,k+1/2}}     \Bigr)^2
704      & \frac{1}{4} \ {b_u}_{\,i-1/2}^{\,k}  \  A_i^k
705      & \\
706      &+\Bigl( \frac{ \delta_{i +1/2} [T] }{{e_{1u} }_{\,i+1/2}^{\,k}}
707      & -\ \ {_i^k \mathbb{R}_{+1/2}^{+1/2}}
708      &\frac{ \delta_{k+1/2} [T] }{{e_{3w}}_{\,i}^{\,k+1/2}}     \Bigr)^2
709      & \frac{1}{4} \ {b_u}_{\,i+1/2}^{\,k}  \  A_i^k      \\
710    \end{Bmatrix}
711  \\
712  & \\
713  %
714  &\equiv - \sum_{i,k} \sum_{\substack{i_p,\,k_p}} \left\{
715    \begin{matrix}
716      &\Bigl( \frac{ \delta_{i +i_p} [T] }{{e_{1u} }_{\,i+i_p}^{\,k}}
717      & -\ \ {_i^k \mathbb{R}_{i_p}^{k_p}}
718      &\frac{ \delta_{k+k_p} [T] }{{e_{3w}}_{\,i}^{\,k+k_p}}     \Bigr)^2
719      & \frac{1}{4} \ {b_u}_{\,i+i_p}^{\,k}  \  A_i^k   \ \
720    \end{matrix}
721        \right\}
722        \quad   \leq 0
723\end{align*}
724The last inequality is obviously obtained as we succeed in obtaining a negative summation of square quantities.
725
726Note that, if instead of multiplying $D_l^T$ by $T$, we were using another tracer field, let say $S$,
727then the previous demonstration would have let to:
728\begin{align*}
729  \int_D  S \; D_l^\;dv &\equiv  \sum_{i,k} \left\{ S \ D_l^T \ b_T \right\}    \\
730                           &\equiv - \sum_{i,k} \sum_{\substack{i_p,\,k_p}} \left\{
731                             \left( \frac{ \delta_{i +i_p} [S] }{{e_{1u} }_{\,i+i_p}^{\,k}}
732                             - {_i^k \mathbb{R}_{i_p}^{k_p}}
733                             \frac{ \delta_{k+k_p} [S] }{{e_{3w}}_{\,i}^{\,k+k_p}}     \right\right. \\
734                           & \qquad \qquad \qquad \ \left.
735                             \left( \frac{ \delta_{i +i_p} [T] }{{e_{1u} }_{\,i+i_p}^{\,k}}
736                             - {_i^k \mathbb{R}_{i_p}^{k_p}}
737                             \frac{ \delta_{k+k_p} [T] }{{e_{3w}}_{\,i}^{\,k+k_p}}     \right)
738                             \frac{1}{4} \ {b_u}_{\,i+i_p}^{\,k}  \  A_i^k   \
739                             \right\}
740                             %
741                             \allowdisplaybreaks
742                             \intertext{
743                             which, by applying the same operation as before but in reverse order, leads to:
744                             }
745                             %
746                           &\equiv  \sum_{i,k} \left\{ D_l^S \ T \ b_T \right\}
747\end{align*}
748This means that the iso-neutral operator is self-adjoint.
749There is no need to develop a specific to obtain it.
750
751%% =================================================================================================
752\subsection{Discrete invariants of the skew flux formulation}
753\label{subsec:ALGOS_eiv_skew}
754
755Demonstration for the conservation of the tracer variance in the (\textbf{i},\textbf{j}) plane.
756
757This have to be moved in an Appendix.
758
759The continuous property to be demonstrated is:
760\begin{align*}
761  \int_D \nabla \cdot \textbf{F}_{eiv}(T) \; T \;dv  \equiv 0
762\end{align*}
763The discrete form of its left hand side is obtained using \autoref{eq:ALGOS_eiv_skew}
764\begin{align*}
765  \sum\limits_{i,k} \sum_{\substack{i_p,\,k_p}}  \Biggl\{   \;\;
766  \delta_&\left[
767              {e_{2u}}_{i+i_p+1/2}^{k}                                  \;\ \ {A_{e}}_{i+i_p+1/2}^{k}
768              \ \ \ { _{i+i_p+1/2}^k \mathbb{R}_{-i_p}^{k_p} }   \quad \delta_{k+k_p}[T_{i+i_p+1/2}]
769              \right] \; T_i^k      \\
770  - \delta_k &\left[
771               {e_{2u}}_i^{k+k_p+1/2}                                     \ \ {A_{e}}_i^{k+k_p+1/2}
772               \ \ { _i^{k+k_p+1/2} \mathbb{R}_{i_p}^{-k_p} }   \ \ \delta_{i+i_p}[T^{k+k_p+1/2}]
773               \right] \; T_i^k      \         \Biggr\}
774\end{align*}
775apply the adjoint of delta operator, it becomes
776\begin{align*}
777  \sum\limits_{i,k} \sum_{\substack{i_p,\,k_p}}  \Biggl\{   \;\;
778  &\left(
779    {e_{2u}}_{i+i_p+1/2}^{k}                                  \;\ \ {A_{e}}_{i+i_p+1/2}^{k}
780    \ \ \ { _{i+i_p+1/2}^k \mathbb{R}_{-i_p}^{k_p} }   \quad \delta_{k+k_p}[T_{i+i_p+1/2}]
781    \right) \; \delta_{i+1/2}[T^{k}]      \\
782  - &\left(
783      {e_{2u}}_i^{k+k_p+1/2}                                     \ \ {A_{e}}_i^{k+k_p+1/2}
784      \ \ { _i^{k+k_p+1/2} \mathbb{R}_{i_p}^{-k_p} }   \ \ \delta_{i+i_p}[T^{k+k_p+1/2}]
785      \right) \; \delta_{k+1/2}[T_{i}]       \         \Biggr\}
786\end{align*}
787Expending the summation on $i_p$ and $k_p$, it becomes:
788\begin{align*}
789  \begin{matrix}
790    &\sum\limits_{i,k}   \Bigl\{
791    &+{e_{2u}}_{i+1}^{k}                             &{A_{e}}_{i+1    }^{k}
792    &\ {_{i+1}^k \mathbb{R}_{- 1/2}^{-1/2}} &\delta_{k-1/2}[T_{i+1}]    &\delta_{i+1/2}[T^{k}]   &\\
793    &&+{e_{2u}}_i^{k\ \ \ \:}                            &{A_{e}}_{i}^{k\ \ \ \:}
794    &\ {\ \ \;_i^k \mathbb{R}_{+1/2}^{-1/2}}  &\delta_{k-1/2}[T_{i\ \ \ \;}&\delta_{i+1/2}[T^{k}] &\\
795    &&+{e_{2u}}_{i+1}^{k}                             &{A_{e}}_{i+1    }^{k}
796    &\ {_{i+1}^k \mathbb{R}_{- 1/2}^{+1/2}} &\delta_{k+1/2}[T_{i+1}]     &\delta_{i+1/2}[T^{k}] &\\
797    &&+{e_{2u}}_i^{k\ \ \ \:}                            &{A_{e}}_{i}^{k\ \ \ \:}
798    &\ {\ \ \;_i^k \mathbb{R}_{+1/2}^{+1/2}} &\delta_{k+1/2}[T_{i\ \ \ \;}] &\delta_{i+1/2}[T^{k}] &\\
799    %
800    &&-{e_{2u}}_i^{k+1}                                &{A_{e}}_i^{k+1}
801    &{_i^{k+1} \mathbb{R}_{-1/2}^{- 1/2}}   &\delta_{i-1/2}[T^{k+1}]      &\delta_{k+1/2}[T_{i}] &\\
802    &&-{e_{2u}}_i^{k\ \ \ \:}                             &{A_{e}}_i^{k\ \ \ \:}
803    &{\ \ \;_i^\mathbb{R}_{-1/2}^{+1/2}}   &\delta_{i-1/2}[T^{k\ \ \ \:}&\delta_{k+1/2}[T_{i}] &\\
804    &&-{e_{2u}}_i^{k+1    }                             &{A_{e}}_i^{k+1}
805    &{_i^{k+1} \mathbb{R}_{+1/2}^{- 1/2}}   &\delta_{i+1/2}[T^{k+1}]      &\delta_{k+1/2}[T_{i}] &\\
806    &&-{e_{2u}}_i^{k\ \ \ \:}                             &{A_{e}}_i^{k\ \ \ \:}
807    &{\ \ \;_i^\mathbb{R}_{+1/2}^{+1/2}}   &\delta_{i+1/2}[T^{k\ \ \ \:}&\delta_{k+1/2}[T_{i}]
808    &\Bigr\}  \\
809  \end{matrix}
810\end{align*}
811The two terms associated with the triad ${_i^k \mathbb{R}_{+1/2}^{+1/2}}$ are the same but of opposite signs,
812they cancel out.
813Exactly the same thing occurs for the triad ${_i^k \mathbb{R}_{-1/2}^{-1/2}}$.
814The two terms associated with the triad ${_i^k \mathbb{R}_{+1/2}^{-1/2}}$ are the same but both of opposite signs and
815shifted by 1 in $k$ direction.
816When summing over $k$ they cancel out with the neighbouring grid points.
817Exactly the same thing occurs for the triad ${_i^k \mathbb{R}_{-1/2}^{+1/2}}$ in the $i$ direction.
818Therefore the sum over the domain is zero,
819\ie\ the variance of the tracer is preserved by the discretisation of the skew fluxes.
820
821\subinc{\input{../../global/epilogue}}
822
823\end{document}
Note: See TracBrowser for help on using the repository browser.