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

source: NEMO/trunk/doc/latex/NEMO/subfiles/apdx_invariants.tex @ 11598

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

Add template of versioning record at the beginning of chapters

File size: 71.4 KB
Line 
1\documentclass[../main/NEMO_manual]{subfiles}
2
3\begin{document}
4
5\chapter{Discrete Invariants of the Equations}
6\label{apdx:INVARIANTS}
7
8\thispagestyle{plain}
9
10\chaptertoc
11
12\paragraph{Changes record} ~\\
13
14{\footnotesize
15  \begin{tabularx}{\textwidth}{l||X|X}
16    Release & Author(s) & Modifications \\
17    \hline
18    {\em   4.0} & {\em ...} & {\em ...} \\
19    {\em   3.6} & {\em ...} & {\em ...} \\
20    {\em   3.4} & {\em ...} & {\em ...} \\
21    {\em <=3.4} & {\em ...} & {\em ...}
22  \end{tabularx}
23}
24
25\clearpage
26
27%%%  Appendix put in gmcomment as it has not been updated for \zstar and s coordinate
28%I'm writting this appendix. It will be available in a forthcoming release of the documentation
29
30%\gmcomment{
31
32%% =================================================================================================
33\section{Introduction / Notations}
34\label{sec:INVARIANTS_0}
35
36Notation used in this appendix in the demonstations:
37
38fluxes at the faces of a $T$-box:
39\[
40  U = e_{2u}\,e_{3u}\; u  \qquad  V = e_{1v}\,e_{3v}\; v  \qquad W = e_{1w}\,e_{2w}\; \omega
41\]
42
43volume of cells at $u$-, $v$-, and $T$-points:
44\[
45  b_u = e_{1u}\,e_{2u}\,e_{3u}  \qquad  b_v = e_{1v}\,e_{2v}\,e_{3v}  \qquad b_t = e_{1t}\,e_{2t}\,e_{3t}
46\]
47
48partial derivative notation: $\partial_\bullet = \frac{\partial}{\partial \bullet}$
49
50$dv=e_1\,e_2\,e_3 \,di\,dj\,dk$  is the volume element, with only $e_3$ that depends on time.
51$D$ and $S$ are the ocean domain volume and surface, respectively.
52No wetting/drying is allow (\ie\ $\frac{\partial S}{\partial t} = 0$).
53Let $k_s$ and $k_b$ be the ocean surface and bottom, resp.
54(\ie\ $s(k_s) = \eta$ and $s(k_b)=-H$, where $H$ is the bottom depth).
55\begin{flalign*}
56  z(k) = \eta - \int\limits_{\tilde{k}=k}^{\tilde{k}=k_s}  e_3(\tilde{k}) \;d\tilde{k}
57  = \eta - \int\limits_k^{k_s}  e_3 \;d\tilde{k}
58\end{flalign*}
59
60Continuity equation with the above notation:
61\[
62  \frac{1}{e_{3t}} \partial_t (e_{3t})+ \frac{1}{b_t}  \biggl\{  \delta_i [U] + \delta_j [V] + \delta_k [W] \biggr\} = 0
63\]
64
65A quantity, $Q$ is conserved when its domain averaged time change is zero, that is when:
66\[
67  \partial_t \left( \int_D{ Q\;dv } \right) =0
68\]
69Noting that the coordinate system used ....  blah blah
70\[
71  \partial_t \left( \int_D {Q\;dv} \right) =  \int_D { \partial_t \left( e_3 \, Q \right) e_1e_2\;di\,dj\,dk }
72  =  \int_D { \frac{1}{e_3} \partial_t \left( e_3 \, Q \right) dv } =0
73\]
74equation of evolution of $Q$ written as
75the time evolution of the vertical content of $Q$ like for tracers, or momentum in flux form,
76the quadratic quantity $\frac{1}{2}Q^2$ is conserved when:
77\begin{flalign*}
78  \partial_t \left(   \int_D{ \frac{1}{2} \,Q^2\;dv }   \right)
79  =&  \int_D{ \frac{1}{2} \partial_t \left( \frac{1}{e_3}\left( e_3 \, Q \right)^2 \right) e_1e_2\;di\,dj\,dk } \\
80  =&  \int_D {         Q   \;\partial_t\left( e_3 \, Q \right) e_1e_2\;di\,dj\,dk }
81  -  \int_D { \frac{1}{2} Q^2 \,\partial_t  (e_3) \;e_1e_2\;di\,dj\,dk } \\
82\end{flalign*}
83that is in a more compact form :
84\begin{flalign}
85  \label{eq:INVARIANTS_Q2_flux}
86  \partial_t \left( \int_D {\frac{1}{2} Q^2\;dv} \right)
87  =&                   \int_D { \frac{Q}{e_3}  \partial_t \left( e_3 \, Q \right) dv }
88  -   \frac{1}{2} \int_D {  \frac{Q^2}{e_3} \partial_t (e_3) \;dv }
89\end{flalign}
90equation of evolution of $Q$ written as the time evolution of $Q$ like for momentum in vector invariant form,
91the quadratic quantity $\frac{1}{2}Q^2$ is conserved when:
92\begin{flalign*}
93  \partial_t \left( \int_D {\frac{1}{2} Q^2\;dv} \right)
94  =&  \int_D { \frac{1}{2} \partial_t \left( e_3 \, Q^2 \right) \;e_1e_2\;di\,dj\,dk } \\
95  =& \int_D {         Q      \partial_t Q  \;e_1e_2e_3\;di\,dj\,dk }
96  +  \int_D { \frac{1}{2} Q^2 \, \partial_t e_\;e_1e_2\;di\,dj\,dk } \\
97\end{flalign*}
98that is in a more compact form:
99\begin{flalign}
100  \label{eq:INVARIANTS_Q2_vect}
101  \partial_t \left( \int_D {\frac{1}{2} Q^2\;dv} \right)
102  =& \int_D {         Q   \,\partial_t Q  \;dv }
103  +   \frac{1}{2} \int_D { \frac{1}{e_3} Q^2 \partial_t e_3 \;dv }
104\end{flalign}
105
106%% =================================================================================================
107\section{Continuous conservation}
108\label{sec:INVARIANTS_1}
109
110The discretization of pimitive equation in $s$-coordinate (\ie\ time and space varying vertical coordinate)
111must be chosen so that the discrete equation of the model satisfy integral constrains on energy and enstrophy.
112
113Let us first establish those constraint in the continuous world.
114The total energy (\ie\ kinetic plus potential energies) is conserved:
115\begin{flalign}
116  \label{eq:INVARIANTS_Tot_Energy}
117  \partial_t \left( \int_D \left( \frac{1}{2} {\textbf{U}_h}^2 +  \rho \, g \, z \right) \;dv \right)  = & 0
118\end{flalign}
119under the following assumptions: no dissipation, no forcing (wind, buoyancy flux, atmospheric pressure variations),
120mass conservation, and closed domain.
121
122This equation can be transformed to obtain several sub-equalities.
123The transformation for the advection term depends on whether the vector invariant form or
124the flux form is used for the momentum equation.
125Using \autoref{eq:INVARIANTS_Q2_vect} and introducing \autoref{eq:SCOORD_dyn_vect} in
126\autoref{eq:INVARIANTS_Tot_Energy} for the former form and
127using \autoref{eq:INVARIANTS_Q2_flux} and introducing \autoref{eq:SCOORD_dyn_flux} in
128\autoref{eq:INVARIANTS_Tot_Energy} for the latter form leads to:
129
130% \label{eq:INVARIANTS_E_tot}
131advection term (vector invariant form):
132\[
133  % \label{eq:INVARIANTS_E_tot_vect_vor_1}
134  \int\limits_D  \zeta \; \left( \textbf{k} \times \textbf{U}_h  \right) \cdot \textbf{U}_h  \;  dv   = 0   \\
135\]
136%
137\[
138  % \label{eq:INVARIANTS_E_tot_vect_adv_1}
139  \int\limits_D  \textbf{U}_h \cdot \nabla_h \left( \frac{{\textbf{U}_h}^2}{2} \right)     dv
140  + \int\limits_D  \textbf{U}_h \cdot \nabla_z \textbf{U}_h  \;dv
141  -  \int\limits_D { \frac{{\textbf{U}_h}^2}{2} \frac{1}{e_3} \partial_t e_3 \;dv }   = 0
142\]
143advection term (flux form):
144\[
145  % \label{eq:INVARIANTS_E_tot_flux_metric}
146  \int\limits_D  \frac{1} {e_1 e_2 } \left( v \,\partial_i e_2 - u \,\partial_j e_1  \right)\;
147  \left(  \textbf{k} \times \textbf{U}_h  \right) \cdot \textbf{U}_h  \;  dv   = 0
148\]
149\[
150  % \label{eq:INVARIANTS_E_tot_flux_adv}
151  \int\limits_D \textbf{U}_h \cdot     \left(                 {{
152        \begin{array} {*{20}c}
153          \nabla \cdot \left( \textbf{U}\,u \right) \hfill \\
154          \nabla \cdot \left( \textbf{U}\,v \right) \hfill
155        \end{array}}
156    }           \right)   \;dv
157  +   \frac{1}{2} \int\limits_D {  {\textbf{U}_h}^2 \frac{1}{e_3} \partial_t e_3 \;dv } =\;0
158\]
159coriolis term
160\[
161  % \label{eq:INVARIANTS_E_tot_cor}
162  \int\limits_D  f   \; \left( \textbf{k} \times \textbf{U}_h  \right) \cdot \textbf{U}_h  \;  dv   = 0
163\]
164pressure gradient:
165\[
166  % \label{eq:INVARIANTS_E_tot_pg_1}
167  - \int\limits_D  \left. \nabla p \right|_z \cdot \textbf{U}_h \;dv
168  = - \int\limits_D \nabla \cdot \left( \rho \,\textbf {U} \right)\;g\;z\;\;dv
169  + \int\limits_D g\, \rho \; \partial_t z  \;dv
170\]
171
172where $\nabla_h = \left. \nabla \right|_k$ is the gradient along the $s$-surfaces.
173
174blah blah....
175
176The prognostic ocean dynamics equation can be summarized as follows:
177\[
178  \text{NXT} = \dbinom  {\text{VOR} + \text{KEG} + \text {ZAD} }
179  {\text{COR} + \text{ADV}                       }
180  + \text{HPG} + \text{SPG} + \text{LDF} + \text{ZDF}
181\]
182
183Vector invariant form:
184% \label{eq:INVARIANTS_E_tot_vect}
185\[
186  % \label{eq:INVARIANTS_E_tot_vect_vor_2}
187  \int\limits_D   \textbf{U}_h \cdot \text{VOR} \;dv   = 0
188\]
189\[
190  % \label{eq:INVARIANTS_E_tot_vect_adv_2}
191  \int\limits_D  \textbf{U}_h \cdot \text{KEG}  \;dv
192  + \int\limits_D  \textbf{U}_h \cdot \text{ZAD}  \;dv
193  -  \int\limits_D { \frac{{\textbf{U}_h}^2}{2} \frac{1}{e_3} \partial_t e_3 \;dv }   = 0
194\]
195\[
196  % \label{eq:INVARIANTS_E_tot_pg_2}
197  - \int\limits_D  \textbf{U}_h \cdot (\text{HPG}+ \text{SPG}) \;dv
198  = - \int\limits_D \nabla \cdot \left( \rho \,\textbf {U} \right)\;g\;z\;\;dv
199  + \int\limits_D g\, \rho \; \partial_t z  \;dv
200\]
201
202Flux form:
203\begin{subequations}
204  \label{eq:INVARIANTS_E_tot_flux}
205  \[
206    % \label{eq:INVARIANTS_E_tot_flux_metric_2}
207    \int\limits_D  \textbf{U}_h \cdot \text {COR} \;  dv   = 0
208  \]
209  \[
210    % \label{eq:INVARIANTS_E_tot_flux_adv_2}
211    \int\limits_D \textbf{U}_h \cdot \text{ADV}   \;dv
212    +   \frac{1}{2} \int\limits_D {  {\textbf{U}_h}^2 \frac{1}{e_3} \partial_t e_3  \;dv } =\;0
213  \]
214  \begin{equation}
215    \label{eq:INVARIANTS_E_tot_pg_3}
216    - \int\limits_\textbf{U}_h \cdot (\text{HPG}+ \text{SPG}) \;dv
217    = - \int\limits_D \nabla \cdot \left( \rho \,\textbf {U} \right)\;g\;z\;\;dv
218    + \int\limits_D g\, \rho \; \partial_t  z  \;dv
219  \end{equation}
220\end{subequations}
221
222\autoref{eq:INVARIANTS_E_tot_pg_3} is the balance between the conversion KE to PE and PE to KE.
223Indeed the left hand side of \autoref{eq:INVARIANTS_E_tot_pg_3} can be transformed as follows:
224\begin{flalign*}
225  \partial_\left( \int\limits_D { \rho \, g \, z  \;dv} \right)
226  &= + \int\limits_D \frac{1}{e_3} \partial_t (e_3\,\rho) \;g\;z\;\;dv
227  +  \int\limits_D g\, \rho \; \partial_t z  \;dv   &&&\\
228  &= - \int\limits_D \nabla \cdot \left( \rho \,\textbf {U} \right)\;g\;z\;\;dv
229  + \int\limits_D g\, \rho \; \partial_t z \;dv   &&&\\
230  &= + \int\limits_\rho \,g \left( \textbf {U}_h \cdot \nabla_h z + \omega \frac{1}{e_3} \partial_k z \right\;dv
231  + \int\limits_D g\, \rho \; \partial_t z \;dv   &&&\\
232  &= + \int\limits_\rho \,g \left( \omega + \partial_t z + \textbf {U}_h \cdot \nabla_h z  \right\;dv  &&&\\
233  &=+  \int\limits_D g\, \rho \; w \; dv   &&&\\
234\end{flalign*}
235where the last equality is obtained by noting that the brackets is exactly the expression of $w$,
236the vertical velocity referenced to the fixe $z$-coordinate system (see \autoref{eq:SCOORD_w_s}).
237
238The left hand side of \autoref{eq:INVARIANTS_E_tot_pg_3} can be transformed as follows:
239\begin{flalign*}
240  - \int\limits_\left. \nabla p \right|_z & \cdot \textbf{U}_h \;dv
241  = - \int\limits_\left( \nabla_h p + \rho \, g \nabla_h z \right) \cdot \textbf{U}_h \;dv   &&&\\
242  \allowdisplaybreaks
243  &= - \int\limits_\nabla_h  p \cdot \textbf{U}_h \;dv   - \int\limits_\rho \, g \, \nabla_h z \cdot \textbf{U}_h \;dv   &&&\\
244  \allowdisplaybreaks
245  &= +\int\limits_D p \,\nabla_h \cdot \textbf{U}_h \;dv   + \int\limits_\rho \, g \left( \omega - w + \partial_t z \right) \;dv   &&&\\
246  \allowdisplaybreaks
247  &= -\int\limits_D p \left( \frac{1}{e_3} \partial_t e_3 + \frac{1}{e_3} \partial_k \omega  \right) \;dv
248  +\int\limits_\rho \, g \left( \omega - w + \partial_t z \right) \;dv   &&&\\
249  \allowdisplaybreaks
250  &= -\int\limits_D \frac{p}{e_3} \partial_t e_\;dv
251  +\int\limits_D \frac{1}{e_3} \partial_k p\; \omega \;dv
252  +\int\limits_\rho \, g \left( \omega - w + \partial_t z \right) \;dv   &&&\\
253  &= -\int\limits_D \frac{p}{e_3} \partial_t e_\;dv
254  -\int\limits_D \rho \, g \, \omega \;dv
255  +\int\limits_\rho \, g \left( \omega - w + \partial_t z \right) \;dv   &&&\\
256  &= - \int\limits_D \frac{p}{e_3} \partial_t e_3 \; \;dv
257  - \int\limits_\rho \, g \, w \;dv
258  + \int\limits_D   \rho \, g \, \partial_t z \;dv   &&&\\
259  \allowdisplaybreaks
260  \intertext{introducing the hydrostatic balance $\partial_k p=-\rho \,g\,e_3$ in the last term,
261    it becomes:}
262  &= - \int\limits_D \frac{p}{e_3} \partial_t e_3 \;dv
263  - \int\limits_\rho \, g \, w \;dv
264  - \int\limits_\frac{1}{e_3} \partial_k p\, \partial_t z \;dv   &&&\\
265  &= - \int\limits_D \frac{p}{e_3} \partial_t e_3 \;dv
266  - \int\limits_\rho \, g \, w \;dv
267  + \int\limits_D \,\frac{p}{e_3}\partial_t ( \partial_k z )  dv   &&&\\
268  %
269  &= - \int\limits_\rho \, g \, w \;dv   &&&\\
270\end{flalign*}
271
272%gm comment
273\gmcomment{
274%
275The last equality comes from the following equation,
276\begin{flalign*}
277  \int\limits_D p \frac{1}{e_3} \frac{\partial e_3}{\partial t}\; \;dv
278  = \int\limits_D   \rho \, g \, \frac{\partial z }{\partial t} \;dv \quad,
279\end{flalign*}
280that can be demonstrated as follows:
281
282\begin{flalign*}
283  \int\limits_D   \rho \, g \, \frac{\partial z }{\partial t} \;dv
284  &= \int\limits_D    \rho \, g \, \frac{\partial \eta}{\partial t} \;dv
285  -  \int\limits_D    \rho \, g \, \frac{\partial}{\partial t} \left\int\limits_k^{k_s}  e_3 \;d\tilde{k} \right) \;dv   &&&\\
286  &= \int\limits_D    \rho \, g \, \frac{\partial \eta}{\partial t} \;dv
287  -  \int\limits_D    \rho \, g    \left\int\limits_k^{k_s}  \frac{\partial e_3}{\partial t} \;d\tilde{k} \right) \;dv   &&&\\
288  %
289  \allowdisplaybreaks
290  \intertext{The second term of the right hand side can be transformed by applying the integration by part rule:
291    $\left[ a\,b \right]_{k_b}^{k_s} = \int_{k_b}^{k_s}  a\,\frac{\partial b}{\partial k}       \;dk
292    + \int_{k_b}^{k_s}      \frac{\partial a}{\partial k} \,b \;dk $
293    to the following function: $a=  \int_k^{k_s}  \frac{\partial e_3}{\partial t} \;d\tilde{k}$
294    and $b=  \int_k^{k_s}  \rho \, e_3 \;d\tilde{k}$
295    (note that $\frac{\partial}{\partial k} \left(  \int_k^{k_s}  a \;d\tilde{k}  \right) = - a$ as $k$ is the lower bound of the integral).
296    This leads to:  }
297\end{flalign*}
298\begin{flalign*}
299  &\left[ \int\limits_{k}^{k_s}  \frac{\partial e_3}{\partial t} \,dk \cdot \int\limits_{k}^{k_s}  \rho \, e_3 \,dk   \right]_{k_b}^{k_s}
300  =-\int\limits_{k_b}^{k_s} \left\int\limits_k^{k_s}  \frac{\partial e_3}{\partial t} \;d\tilde{k} \right\rho \,e_3 \;dk
301  -\int\limits_{k_b}^{k_s}  \frac{\partial e_3}{\partial t}  \left\int\limits_k^{k_s}  \rho \, e_3 \;d\tilde{k} \right)   dk  &&&\\
302  \allowdisplaybreaks
303  \intertext{Noting that $\frac{\partial \eta}{\partial t}
304    = \frac{\partial}{\partial t}  \left( \int_{k_b}^{k_s}   e_3  \;d\tilde{k}  \right)
305    = \int_{k_b}^{k_s}  \frac{\partial e_3}{\partial t} \;d\tilde{k}$
306    and
307    $p(k) = \int_k^{k_s}  \rho \,g \, e_3 \;d\tilde{k} $,
308    but also that $\frac{\partial \eta}{\partial t}$ does not depends on $k$, it comes:
309  }
310  & - \int\limits_{k_b}^{k_s}  \rho \, \frac{\partial \eta}{\partial t} \, e_3 \;dk
311  = - \int\limits_{k_b}^{k_s} \left\int\limits_k^{k_s}  \frac{\partial e_3}{\partial t} \;d\tilde{k} \right)   \, \rho \, g   e_3\;dk
312  - \int\limits_{k_b}^{k_s}  \frac{\partial e_3}{\partial t} \frac{p}{g}         \;dk       &&&\\
313\end{flalign*}
314Mutliplying by $g$ and integrating over the $(i,j)$ domain it becomes:
315\begin{flalign*}
316  \int\limits_\rho \, g \, \left\int\limits_k^{k_s}  \frac{\partial e_3}{\partial t} \;d\tilde{k} \right)    \;dv
317  =  \int\limits_\rho \, g \, \frac{\partial \eta}{\partial t} dv
318  - \int\limits_\frac{p}{e_3}\frac{\partial e_3}{\partial t}         \;dv
319\end{flalign*}
320Using this property, we therefore have:
321\begin{flalign*}
322  \int\limits_D   \rho \, g \, \frac{\partial z }{\partial t} \;dv
323  &= \int\limits_D    \rho \, g \, \frac{\partial \eta}{\partial t}   \;dv
324  - \left\int\limits_\rho \, g \, \frac{\partial \eta}{\partial t} dv
325    - \int\limits_\frac{p}{e_3}\frac{\partial e_3}{\partial t}   \;dv  \right)    &&&\\
326  %
327  &=\int\limits_D \frac{p}{e_3} \frac{\partial (e_3\,\rho)}{\partial t}\; \;dv
328\end{flalign*}
329% end gm comment
330}
331%
332
333%% =================================================================================================
334\section{Discrete total energy conservation: vector invariant form}
335\label{sec:INVARIANTS_2}
336
337%% =================================================================================================
338\subsection{Total energy conservation}
339\label{subsec:INVARIANTS_KE+PE_vect}
340
341The discrete form of the total energy conservation, \autoref{eq:INVARIANTS_Tot_Energy}, is given by:
342\begin{flalign*}
343  \partial_\left\sum\limits_{i,j,k} \biggl\{ \frac{u^2}{2} \,b_u + \frac{v^2}{2}\, b_v +  \rho \, g \, z_t \,b_\biggr\} \right) &=0
344\end{flalign*}
345which in vector invariant forms, it leads to:
346\begin{equation}
347  \label{eq:INVARIANTS_KE+PE_vect_discrete}
348  \begin{split}
349    \sum\limits_{i,j,k} \biggl\{   u\,                        \partial_t u         \;b_u
350    + v\,                        \partial_t v          \;b_\biggr\}
351    + \frac{1}{2} \sum\limits_{i,j,k} \biggl\{  \frac{u^2}{e_{3u}}\partial_t e_{3u} \;b_u
352    +  \frac{v^2}{e_{3v}}\partial_t e_{3v} \;b_v   \biggr\}      \\
353    = - \sum\limits_{i,j,k} \biggl\{ \frac{1}{e_{3t}}\partial_t (e_{3t} \rho) \, g \, z_t \;b_\biggr\}
354    - \sum\limits_{i,j,k} \biggl\{ \rho \,g\,\partial_t (z_t) \,b_\biggr\}
355  \end{split}
356\end{equation}
357
358Substituting the discrete expression of the time derivative of the velocity either in vector invariant,
359leads to the discrete equivalent of the four equations \autoref{eq:INVARIANTS_E_tot_flux}.
360
361%% =================================================================================================
362\subsection{Vorticity term (coriolis + vorticity part of the advection)}
363\label{subsec:INVARIANTS_vor}
364
365Let $q$, located at $f$-points, be either the relative ($q=\zeta / e_{3f}$),
366or the planetary ($q=f/e_{3f}$), or the total potential vorticity ($q=(\zeta +f) /e_{3f}$).
367Two discretisation of the vorticity term (ENE and EEN) allows the conservation of the kinetic energy.
368%% =================================================================================================
369\subsubsection{Vorticity term with ENE scheme (\protect\np[=.true.]{ln_dynvor_ene}{ln\_dynvor\_ene})}
370\label{subsec:INVARIANTS_vorENE}
371
372For the ENE scheme, the two components of the vorticity term are given by:
373\[
374  - e_3 \, q \;{\textbf{k}}\times {\textbf {U}}_h    \equiv
375  \left( {{
376        \begin{array} {*{20}c}
377          + \frac{1} {e_{1u}} \;
378          \overline {\, q \ \overline {\left( e_{1v}\,e_{3v}\,v \right)}^{\,i+1/2}} ^{\,j}        \hfill \\
379          - \frac{1} {e_{2v}} \;
380          \overline {\, q \ \overline {\left( e_{2u}\,e_{3u}\,u \right)}^{\,j+1/2}} ^{\,i}       \hfill
381        \end{array}
382      } }    \right)
383\]
384
385This formulation does not conserve the enstrophy but it does conserve the total kinetic energy.
386Indeed, the kinetic energy tendency associated to the vorticity term and
387averaged over the ocean domain can be transformed as follows:
388\begin{flalign*}
389  &\int\limits_D -  \left(  e_3 \, q \;\textbf{k} \times \textbf{U}_\right) \cdot \textbf{U}_\;  dv &&  \\
390  & \qquad \qquad
391  {
392    \begin{array}{*{20}l}
393      &\equiv \sum\limits_{i,j,k}   \biggl\{
394        \frac{1} {e_{1u}} \overline { \,q\ \overline{ V }^{\,i+1/2}} ^{\,j} \, u \; b_u
395        - \frac{1} {e_{2v}}\overline { \, q\ \overline{ U }^{\,j+1/2}} ^{\,i} \, v \; b_v \; \biggr\}    \\
396      &\equiv  \sum\limits_{i,j,k}  \biggl\{
397        \overline { \,q\ \overline{ V }^{\,i+1/2}}^{\,j} \; U
398        - \overline { \,q\ \overline{ U }^{\,j+1/2}}^{\,i} \; V  \; \biggr\}     \\
399      &\equiv \sum\limits_{i,j,k} q \  \biggl\{  \overline{ V }^{\,i+1/2}\; \overline{ U }^{\,j+1/2}
400        - \overline{ U }^{\,j+1/2}\; \overline{ V }^{\,i+1/2}         \biggr\}  \quad  \equiv 0
401    \end{array}
402  }
403\end{flalign*}
404In other words, the domain averaged kinetic energy does not change due to the vorticity term.
405
406%% =================================================================================================
407\subsubsection{Vorticity term with EEN scheme (\protect\np[=.true.]{ln_dynvor_een}{ln\_dynvor\_een})}
408\label{subsec:INVARIANTS_vorEEN_vect}
409
410With the EEN scheme, the vorticity terms are represented as:
411\begin{equation}
412  \label{eq:INVARIANTS_dynvor_een1}
413  \left\{ {
414      \begin{aligned}
415        +q\,e_3 \, v    &\equiv +\frac{1}{e_{1u} }   \sum_{\substack{i_p,\,k_p}}
416        {^{i+1/2-i_p}_j}  \mathbb{Q}^{i_p}_{j_p}  \left( e_{1v} e_{3v} \ \right)^{i+i_p-1/2}_{j+j_p}   \\
417        - q\,e_3 \, u     &\equiv -\frac{1}{e_{2v} }    \sum_{\substack{i_p,\,k_p}}
418        {^i_{j+1/2-j_p}}  \mathbb{Q}^{i_p}_{j_p}  \left( e_{2u} e_{3u} \ \right)^{i+i_p}_{j+j_p-1/2}
419      \end{aligned}
420    } \right.
421\end{equation}
422where the indices $i_p$ and $j_p$ take the following value: $i_p = -1/2$ or $1/2$ and $j_p = -1/2$ or $1/2$,
423and the vorticity triads, ${^i_j}\mathbb{Q}^{i_p}_{j_p}$, defined at $T$-point, are given by:
424\begin{equation}
425  \label{eq:INVARIANTS_Q_triads}
426  _i^j \mathbb{Q}^{i_p}_{j_p}
427  = \frac{1}{12} \ \left(   q^{i-i_p}_{j+j_p} + q^{i+j_p}_{j+i_p} + q^{i+i_p}_{j-j_p}  \right)
428\end{equation}
429
430This formulation does conserve the total kinetic energy.
431Indeed,
432\begin{flalign*}
433  &\int\limits_D - \textbf{U}_h \cdot   \left\zeta \;\textbf{k} \times \textbf{U}_\right\;  dv &&  \\
434  \equiv \sum\limits_{i,j,k} &   \biggl\{
435  \left\sum_{\substack{i_p,\,k_p}}
436    {^{i+1/2-i_p}_j}\mathbb{Q}^{i_p}_{j_p} \; V^{i+1/2-i_p}_{j+j_p} \right] U^{i+1/2}_{j}    %   &&\\
437  - \left\sum_{\substack{i_p,\,k_p}}
438    {^i_{j+1/2-j_p}}\mathbb{Q}^{i_p}_{j_p} \; U^{i+i_p}_{j+1/2-j_p}  \right] V^{i}_{j+1/2}    \biggr\}     && \\ \\
439  \equiv \sum\limits_{i,j,k} &  \sum_{\substack{i_p,\,k_p}} \biggl\{  \ \
440  {^{i+1/2-i_p}_j}\mathbb{Q}^{i_p}_{j_p} \; V^{i+1/2-i_p}_{j+j_p}  \, U^{i+1/2}_{j}     %  &&\\
441  - {^i_{j+1/2-j_p}}\mathbb{Q}^{i_p}_{j_p} \; U^{i+i_p}_{j+1/2-j_p} \, V^{i}_{j+1/2}     \ \;     \biggr\}     &&  \\
442  %
443  \allowdisplaybreaks
444  \intertext{ Expending the summation on $i_p$ and $k_p$, it becomes:}
445  %
446  \equiv \sum\limits_{i,j,k} & \biggl\{  \ \
447  {^{i+1}_j     }\mathbb{Q}^{-1/2}_{+1/2} \;V^{i+1}_{j+1/2} \; U^{\,i+1/2}_{j}
448  -  {^i_{j}\quad}\mathbb{Q}^{-1/2}_{+1/2} \; U^{i-1/2}_{j}    \; V^{\,i}_{j+1/2}         &&  \\
449  &       + {^{i+1}_j     }\mathbb{Q}^{-1/2}_{-1/2} \; V^{i+1}_{j-1/2} \; U^{\,i+1/2}_{j}
450  - {^i_{j+1}     }\mathbb{Q}^{-1/2}_{-1/2} \; U^{i-1/2}_{j+1} \; V^{\,i}_{j+1/2}        \biggr.     &&  \\
451  &       + {^{i}_j\quad}\mathbb{Q}^{+1/2}_{+1/2} \; V^{i}_{j+1/2}   \; U^{\,i+1/2}_{j}
452  - {^i_{j}\quad}\mathbb{Q}^{+1/2}_{+1/2} \; U^{i+1/2}_{j}   \; V^{\,i}_{j+1/2}          \biggr.        &&  \\
453  &       + {^{i}_j\quad}\mathbb{Q}^{+1/2}_{-1/2} \; V^{i}_{j-1/2}     \; U^{\,i+1/2}_{j}
454  -  {^i_{j+1}     }\mathbb{Q}^{+1/2}_{-1/2} \; U^{i+1/2}_{j+1}\; V^{\,i}_{j+1/2}  \ \;     \biggr\}     &&  \\
455  %
456  \allowdisplaybreaks
457  \intertext{The summation is done over all $i$ and $j$ indices, it is therefore possible to introduce
458    a shift of $-1$ either in $i$ or $j$ direction in some of the term of the summation (first term of the
459    first and second lines, second term of the second and fourth lines). By doning so, we can regroup
460    all the terms of the summation by triad at a ($i$,$j$) point. In other words, we regroup all the terms
461    in the neighbourhood  that contain a triad at the same ($i$,$j$) indices. It becomes: }
462  \allowdisplaybreaks
463  %
464  \equiv \sum\limits_{i,j,k} & \biggl\{  \ \
465  {^{i}_j}\mathbb{Q}^{-1/2}_{+1/2}  \left[  V^{i}_{j+1/2}\, U^{\,i-1/2}_{j}
466    -  U^{i-1/2}_{j} \, V^{\,i}_{j+1/2}      \right]    &&  \\
467  &       + {^{i}_j}\mathbb{Q}^{-1/2}_{-1/2}  \left[  V^{i}_{j-1/2} \, U^{\,i-1/2}_{j}
468    -    U^{i-1/2}_{j} \, V^{\,i}_{j-1/2}      \right]    \biggr.   &&  \\
469  &      + {^{i}_j}\mathbb{Q}^{+1/2}_{+1/2}  \left[  V^{i}_{j+1/2} \, U^{\,i+1/2}_{j}
470    -    U^{i+1/2}_{j} \, V^{\,i}_{j+1/2}     \right\biggr&&  \\
471  &     + {^{i}_j}\mathbb{Q}^{+1/2}_{-1/2}  \left[   V^{i}_{j-1/2} \, U^{\,i+1/2}_{j}
472    -    U^{i+1/2}_{j-1} \, V^{\,i}_{j-1/2}  \right\ \;   \biggr\}   \qquad
473  \equiv \ 0   &&
474\end{flalign*}
475
476%% =================================================================================================
477\subsubsection{Gradient of kinetic energy / Vertical advection}
478\label{subsec:INVARIANTS_zad}
479
480The change of Kinetic Energy (KE) due to the vertical advection is exactly balanced by the change of KE due to the horizontal gradient of KE~:
481\[
482  \int_D \textbf{U}_h \cdot \frac{1}{e_3 } \omega \partial_k \textbf{U}_h \;dv
483  =  -   \int_D \textbf{U}_h \cdot \nabla_h \left( \frac{1}{2}\;{\textbf{U}_h}^2 \right)\;dv
484  +   \frac{1}{2} \int_D {  \frac{{\textbf{U}_h}^2}{e_3} \partial_t ( e_3) \;dv }
485\]
486Indeed, using successively \autoref{eq:DOM_di_adj} (\ie\ the skew symmetry property of the $\delta$ operator)
487and the continuity equation, then \autoref{eq:DOM_di_adj} again,
488then the commutativity of operators $\overline {\,\cdot \,}$ and $\delta$, and finally \autoref{eq:DOM_mi_adj}
489(\ie\ the symmetry property of the $\overline {\,\cdot \,}$ operator)
490applied in the horizontal and vertical directions, it becomes:
491\begin{flalign*}
492  & - \int_D \textbf{U}_h \cdot \text{KEG}\;dv
493  = - \int_D \textbf{U}_h \cdot \nabla_h \left( \frac{1}{2}\;{\textbf{U}_h}^2 \right)\;dv    &&&\\
494  %
495  \equiv  & -  \sum\limits_{i,j,k} \frac{1}{2}  \biggl\{
496  \frac{1} {e_{1u}}  \delta_{i+1/2}   \left[   \overline {u^2}^{\,i} + \overline {v^2}^{\,j}   \right]  u \ b_u
497  + \frac{1} {e_{2v}}  \delta_{j+1/2}   \left[   \overline {u^2}^{\,i} + \overline {v^2}^{\,j}   \right]  v \ b_v   \biggr\}     &&&  \\
498  %
499  \equiv & + \sum\limits_{i,j,k} \frac{1}{2}  \left(   \overline {u^2}^{\,i} + \overline {v^2}^{\,j}   \right)\;
500  \biggl\{ \delta_{i} \left[  U   \right] +  \delta_{j} \left[  V  \right]    \biggr\}       &&&  \\
501  \allowdisplaybreaks
502  %
503  \equiv   & - \sum\limits_{i,j,k}  \frac{1}{2}
504  \left(       \overline {u^2}^{\,i} + \overline {v^2}^{\,j}   \right\;
505  \biggl\{   \frac{b_t}{e_{3t}} \partial_t (e_{3t})  +  \delta_k \left[  W   \right]    \biggr\}    &&&\\
506  \allowdisplaybreaks
507  %
508  \equiv & +  \sum\limits_{i,j,k} \frac{1}{2} \delta_{k+1/2}   \left[ \overline{ u^2}^{\,i} + \overline{ v^2}^{\,j}   \right] \;  W
509  -  \sum\limits_{i,j,k} \frac{1}{2} \left(   \overline {u^2}^{\,i} + \overline {v^2}^{\,j}   \right) \;\partial_t b_t   &&& \\
510  \allowdisplaybreaks
511  %
512  \equiv   & + \sum\limits_{i,j,k} \frac{1} {2} \left(    \overline{\delta_{k+1/2} \left[ u^2 \right]}^{\,i}
513    + \overline{\delta_{k+1/2} \left[ v^2 \right]}^{\,j}    \right) \; W
514  -  \sum\limits_{i,j,k}  \left\frac{u^2}{2}\,\partial_t \overline{b_t}^{\,{i+1/2}}
515    + \frac{v^2}{2}\,\partial_t \overline{b_t}^{\,{j+1/2}}   \right)    &&& \\
516  \allowdisplaybreaks
517  \intertext{Assuming that $b_u= \overline{b_t}^{\,i+1/2}$ and $b_v= \overline{b_t}^{\,j+1/2}$, or at least that the time
518    derivative of these two equations is satisfied, it becomes:}
519  %
520  \equiv &     \sum\limits_{i,j,k} \frac{1} {2}
521  \biggl\{ \; \overline{W}^{\,i+1/2}\;\delta_{k+1/2} \left[ u^2 \right]
522  + \overline{W}^{\,j+1/2}\;\delta_{k+1/2} \left[ v^2 \right]  \;  \biggr\}
523  -  \sum\limits_{i,j,k}  \left\frac{u^2}{2}\,\partial_t b_u
524    + \frac{v^2}{2}\,\partial_t b_v   \right)    &&& \\
525  \allowdisplaybreaks
526  %
527  \equiv &     \sum\limits_{i,j,k}
528  \biggl\{ \; \overline{W}^{\,i+1/2}\; \overline {u}^{\,k+1/2}\; \delta_{k+1/2}[ u ]
529  + \overline{W}^{\,j+1/2}\; \overline {v}^{\,k+1/2}\; \delta_{k+1/2}[ v ]  \;  \biggr\}
530  -  \sum\limits_{i,j,k}  \left\frac{u^2}{2}\,\partial_t b_u
531    + \frac{v^2}{2}\,\partial_t b_v   \right)    &&& \\
532  %
533  \allowdisplaybreaks
534  \equiv  &  \sum\limits_{i,j,k}
535  \biggl\{ \; \frac{1} {b_u } \; \overline { \overline{W}^{\,i+1/2}\,\delta_{k+1/2}  \left[ u \right] }^{\,k} \;u\;b_u
536  + \frac{1} {b_v } \; \overline { \overline{W}^{\,j+1/2} \delta_{k+1/2}  \left[ v \right]  }^{\,k} \;v\;b_\; \biggr\}
537  -  \sum\limits_{i,j,k}  \left\frac{u^2}{2}\,\partial_t b_u
538    + \frac{v^2}{2}\,\partial_t b_v   \right)    &&& \\
539  %
540  \intertext{The first term provides the discrete expression for the vertical advection of momentum (ZAD),
541    while the second term corresponds exactly to \autoref{eq:INVARIANTS_KE+PE_vect_discrete}, therefore:}
542  \equiv&                   \int\limits_D \textbf{U}_h \cdot \text{ZAD} \;dv
543  + \frac{1}{2} \int_D { {\textbf{U}_h}^2 \frac{1}{e_3} \partial_t  (e_3)  \;dv }    &&&\\
544  \equiv&                   \int\limits_D \textbf{U}_h \cdot w \partial_k \textbf{U}_h \;dv
545  + \frac{1}{2} \int_D { {\textbf{U}_h}^2 \frac{1}{e_3} \partial_t  (e_3)  \;dv }    &&&\\
546\end{flalign*}
547
548There is two main points here.
549First, the satisfaction of this property links the choice of the discrete formulation of the vertical advection and
550of the horizontal gradient of KE.
551Choosing one imposes the other.
552For example KE can also be discretized as $1/2\,({\overline u^{\,i}}^2 + {\overline v^{\,j}}^2)$.
553This leads to the following expression for the vertical advection:
554\[
555  \frac{1} {e_3 }\; \omega\; \partial_k \textbf{U}_h
556  \equiv \left( {{
557        \begin{array} {*{20}c}
558          \frac{1} {e_{1u}\,e_{2u}\,e_{3u}} \;  \overline{\overline {e_{1t}\,e_{2t} \,\omega\;\delta_{k+1/2}
559          \left[ \overline u^{\,i+1/2} \right]}}^{\,i+1/2,k}  \hfill \\
560          \frac{1} {e_{1v}\,e_{2v}\,e_{3v}} \;   \overline{\overline {e_{1t}\,e_{2t} \,\omega \;\delta_{k+1/2}
561          \left[ \overline v^{\,j+1/2} \right]}}^{\,j+1/2,k} \hfill
562        \end{array}
563      } } \right)
564\]
565a formulation that requires an additional horizontal mean in contrast with the one used in \NEMO.
566Nine velocity points have to be used instead of 3.
567This is the reason why it has not been chosen.
568
569Second, as soon as the chosen $s$-coordinate depends on time,
570an extra constraint arises on the time derivative of the volume at $u$- and $v$-points:
571\begin{flalign*}
572  e_{1u}\,e_{2u}\,\partial_t (e_{3u}) =\overline{ e_{1t}\,e_{2t}\;\partial_t (e_{3t}) }^{\,i+1/2}    \\
573  e_{1v}\,e_{2v}\,\partial_t (e_{3v})  =\overline{ e_{1t}\,e_{2t}\;\partial_t (e_{3t}) }^{\,j+1/2}
574\end{flalign*}
575which is (over-)satified by defining the vertical scale factor as follows:
576\begin{flalign*}
577  % \label{eq:INVARIANTS_e3u-e3v}
578  e_{3u} = \frac{1}{e_{1u}\,e_{2u}}\;\overline{ e_{1t}^{ }\,e_{2t}^{ }\,e_{3t}^{ } }^{\,i+1/2}    \\
579  e_{3v} = \frac{1}{e_{1v}\,e_{2v}}\;\overline{ e_{1t}^{ }\,e_{2t}^{ }\,e_{3t}^{ } }^{\,j+1/2}
580\end{flalign*}
581
582Blah blah required on the the step representation of bottom topography.....
583
584%% =================================================================================================
585\subsection{Pressure gradient term}
586\label{subsec:INVARIANTS_2.6}
587
588\gmcomment{
589  A pressure gradient has no contribution to the evolution of the vorticity as the curl of a gradient is zero.
590  In the $z$-coordinate, this property is satisfied locally on a C-grid with 2nd order finite differences
591  (property \autoref{eq:DOM_curl_grad}).
592}
593
594When the equation of state is linear
595(\ie\ when an advection-diffusion equation for density can be derived from those of temperature and salinity)
596the change of KE due to the work of pressure forces is balanced by
597the change of potential energy due to buoyancy forces:
598\[
599  - \int_D  \left. \nabla p \right|_z \cdot \textbf{U}_h \;dv
600  = - \int_D \nabla \cdot \left( \rho \,\textbf {U} \right) \,g\,z \;dv
601  + \int_D g\, \rho \; \partial_t (z)  \;dv
602\]
603
604This property can be satisfied in a discrete sense for both $z$- and $s$-coordinates.
605Indeed, defining the depth of a $T$-point, $z_t$,
606as the sum of the vertical scale factors at $w$-points starting from the surface,
607the work of pressure forces can be written as:
608\begin{flalign*}
609  &- \int_\left. \nabla p \right|_z \cdot \textbf{U}_h \;dv
610  \equiv \sum\limits_{i,j,k} \biggl\{ \;  - \frac{1} {e_{1u}}   \Bigl(
611  \delta_{i+1/2} [p_t] - g\;\overline \rho^{\,i+1/2}\;\delta_{i+1/2} [z_t]     \Bigr\; u\;b_u && \\
612  & \qquad \qquad  \qquad \qquad  \qquad \quad \ \,
613  - \frac{1} {e_{2v}}    \Bigl(
614  \delta_{j+1/2} [p_t] - g\;\overline \rho^{\,j+1/2}\delta_{j+1/2} [z_t]      \Bigr\; v\;b_v \;  \biggr\}   && \\
615  %
616  \allowdisplaybreaks
617  \intertext{Using successively \autoref{eq:DOM_di_adj}, \ie\ the skew symmetry property of
618    the $\delta$ operator, \autoref{eq:DYN_wzv}, the continuity equation, \autoref{eq:DYN_hpg_sco},
619    the hydrostatic equation in the $s$-coordinate, and $\delta_{k+1/2} \left[ z_t \right] \equiv e_{3w} $,
620    which comes from the definition of $z_t$, it becomes: }
621  \allowdisplaybreaks
622  %
623  \equiv& +  \sum\limits_{i,j,k}   g  \biggl\{
624  \overline\rho^{\,i+1/2}\,U\,\delta_{i+1/2}[z_t]
625  +   \overline\rho^{\,j+1/2}\,V\,\delta_{j+1/2}[z_t]
626  +\Bigl\delta_i[U] + \delta_j [V]  \Bigr)\;\frac{p_t}{g} \biggr\}  &&\\
627  %
628  \equiv& +  \sum\limits_{i,j,k}   g   \biggl\{
629  \overline\rho^{\,i+1/2}\,U\,\delta_{i+1/2}[z_t]
630  +   \overline\rho^{\,j+1/2}\,V\,\delta_{j+1/2}[z_t]
631  -       \left(   \frac{b_t}{e_{3t}} \partial_t (e_{3t})  +  \delta_k \left[ W \right]    \right) \frac{p_t}{g}    \biggr\}   &&&\\
632  %
633  \equiv& +  \sum\limits_{i,j,k}  g   \biggl\{
634  \overline\rho^{\,i+1/2}\,U\,\delta_{i+1/2}[z_t]
635  +   \overline\rho^{\,j+1/2}\,V\,\delta_{j+1/2}[z_t]
636  +   \frac{W}{g}\;\delta_{k+1/2} [p_t]
637  -        \frac{p_t}{g}\,\partial_t b_t    \biggr\}    &&&\\
638  %
639  \equiv& +  \sum\limits_{i,j,k}  g   \biggl\{
640  \overline\rho^{\,i+1/2}\,U\,\delta_{i+1/2}[z_t]
641  +   \overline\rho^{\,j+1/2}\,V\,\delta_{j+1/2}[z_t]
642  -   W\;e_{3w} \overline \rho^{\,k+1/2}
643  -        \frac{p_t}{g}\,\partial_t b_t    \biggr\}    &&&\\
644  %
645  \equiv& +  \sum\limits_{i,j,k}    g   \biggl\{
646  \overline\rho^{\,i+1/2}\,U\,\delta_{i+1/2}[z_t]
647  +   \overline\rho^{\,j+1/2}\,V\,\delta_{j+1/2}[z_t]
648  +   W\; \overline \rho^{\,k+1/2}\;\delta_{k+1/2} [z_t]
649  -        \frac{p_t}{g}\,\partial_t b_t    \biggr\}    &&&\\
650  %
651  \allowdisplaybreaks
652  %
653  \equiv& - \sum\limits_{i,j,k}   g \; z_t      \biggl\{
654  \delta_\left[ U\;  \overline \rho^{\,i+1/2}   \right]
655  +   \delta_j    \left[ V\;  \overline \rho^{\,j+1/2}   \right]
656  +   \delta_k    \left[ W\;  \overline \rho^{\,k+1/2}   \right]       \biggr\}
657  - \sum\limits_{i,j,k}       \biggl\{ p_t\;\partial_t b_t    \biggr\}   &&&\\
658  %
659  \equiv& + \sum\limits_{i,j,k}   g \; z_t    \biggl\{      \partial_t ( e_{3t} \,\rho)    \biggr\}  \; b_t
660  -  \sum\limits_{i,j,k}                 \biggl\{  p_t\;\partial_t b_t                     \biggr\}              &&&\\
661  %
662\end{flalign*}
663The first term is exactly the first term of the right-hand-side of \autoref{eq:INVARIANTS_KE+PE_vect_discrete}.
664It remains to demonstrate that the last term,
665which is obviously a discrete analogue of $\int_D \frac{p}{e_3} \partial_t (e_3)\;dv$ is equal to
666the last term of \autoref{eq:INVARIANTS_KE+PE_vect_discrete}.
667In other words, the following property must be satisfied:
668\begin{flalign*}
669  \sum\limits_{i,j,k}  \biggl\{  p_t\;\partial_t b_t                  \biggr\}
670  \equiv  \sum\limits_{i,j,k}  \biggl\{ \rho \,g\,\partial_t (z_t) \,b_\biggr\}
671\end{flalign*}
672
673Let introduce $p_w$ the pressure at $w$-point such that $\delta_k [p_w] = - \rho \,g\,e_{3t}$.
674The right-hand-side of the above equation can be transformed as follows:
675
676\begin{flalign*}
677  \sum\limits_{i,j,k}  \biggl\{ \rho \,g\,\partial_t (z_t) \,b_\biggr\}
678  &\equiv   - \sum\limits_{i,j,k}  \biggl\{ \delta_k [p_w]\,\partial_t (z_t) \,e_{1t}\,e_{2t}  \biggr\}        &&&\\
679  %
680  &\equiv  + \sum\limits_{i,j,k}  \biggl\{  p_w\, \delta_{k+1/2} [\partial_t (z_t)] \,e_{1t}\,e_{2t}  \biggr\}
681  \equiv  + \sum\limits_{i,j,k}  \biggl\{  p_w\, \partial_t (e_{3w}) \,e_{1t}\,e_{2t}  \biggr\}        &&&\\
682  &\equiv  + \sum\limits_{i,j,k}  \biggl\{  p_w\, \partial_t (b_w) \biggr\}
683  %
684  % & \equiv     \sum\limits_{i,j,k} \biggl\{  \frac{1}{e_{3t}} \delta_k [p_w]\;\partial_t (z_t) \,b_w   \right)   \biggr\}           &&&\\
685  % & \equiv     \sum\limits_{i,j,k} \biggl\{   p_w\;\partial_t \left(    \delta_k [z_t]   \right)  e_{1w}\,e_{2w}   \biggr\}           &&&\\
686  % & \equiv     \sum\limits_{i,j,k} \biggl\{   p_w\;\partial_t b_w   \biggr\}
687\end{flalign*}
688therefore, the balance to be satisfied is:
689\begin{flalign*}
690  \sum\limits_{i,j,k}  \biggl\{  p_t\;\partial_t (b_t) \biggr\}  \equiv  \sum\limits_{i,j,k}  \biggl\{  p_w\, \partial_t (b_w) \biggr\}
691\end{flalign*}
692which is a purely vertical balance:
693\begin{flalign*}
694  \sum\limits_{k}  \biggl\{  p_t\;\partial_t (e_{3t}) \biggr\}  \equiv  \sum\limits_{k}  \biggl\{  p_w\, \partial_t (e_{3w}) \biggr\}
695\end{flalign*}
696Defining $p_w = \overline{p_t}^{\,k+1/2}$
697
698%gm comment
699\gmcomment{
700  \begin{flalign*}
701    \sum\limits_{i,j,k} \biggl\{   p_t\;\partial_t b_t   \biggr\}                                &&&\\
702    %
703    & \equiv     \sum\limits_{i,j,k} \biggl\{  \frac{1}{e_{3t}} \delta_k [p_w]\;\partial_t (z_t) \,b_w    \biggr\}           &&&\\
704    & \equiv     \sum\limits_{i,j,k} \biggl\{   p_w\;\partial_t \left(    \delta_{k+1/2} [z_t]   \right)  e_{1w}\,e_{2w}   \biggr\}           &&&\\
705    & \equiv     \sum\limits_{i,j,k} \biggl\{   p_w\;\partial_t b_w   \biggr\}
706  \end{flalign*}
707
708  \begin{flalign*}
709    \int\limits_D   \rho \, g \, \frac{\partial z }{\partial t} \;dv
710    \equiv&  \sum\limits_{i,j,k}   \biggl\{  \frac{1}{e_{3t}} \frac{\partial e_{3t}}{\partial t} p   \biggr\} \; b_t   &&&\\
711    \equiv&  \sum\limits_{i,j,k}   \biggl\{      \biggr\} \; b_t   &&&\\
712  \end{flalign*}
713
714  %
715  \begin{flalign*}
716    \equiv& - \int_D \nabla \cdot \left( \rho \,\textbf {U} \right)\;g\;z\;\;dv
717    + \int\limits_D g\, \rho \; \frac{\partial z}{\partial t}  \;dv     &&& \\
718  \end{flalign*}
719  %
720}
721%end gm comment
722
723Note that this property strongly constrains the discrete expression of both the depth of $T-$points and
724of the term added to the pressure gradient in the $s$-coordinate.
725Nevertheless, it is almost never satisfied since a linear equation of state is rarely used.
726
727%% =================================================================================================
728\section{Discrete total energy conservation: flux form}
729\label{sec:INVARIANTS_3}
730
731%% =================================================================================================
732\subsection{Total energy conservation}
733\label{subsec:INVARIANTS_KE+PE_flux}
734
735The discrete form of the total energy conservation, \autoref{eq:INVARIANTS_Tot_Energy}, is given by:
736\begin{flalign*}
737  \partial_t \left\sum\limits_{i,j,k} \biggl\{ \frac{u^2}{2} \,b_u + \frac{v^2}{2}\, b_v +  \rho \, g \, z_t \,b_\biggr\} \right) &=0  \\
738\end{flalign*}
739which in flux form, it leads to:
740\begin{flalign*}
741  \sum\limits_{i,j,k} \biggl\{  \frac{u    }{e_{3u}}\,\frac{\partial (e_{3u}u)}{\partial t} \,b_u
742  +  \frac{v    }{e_{3v}}\,\frac{\partial (e_{3v}v)}{\partial t} \,b_\biggr\}
743  &  -  \frac{1}{2} \sum\limits_{i,j,k} \biggl\{  \frac{u^2}{e_{3u}}\frac{\partial    e_{3u}    }{\partial t} \,b_u
744  +  \frac{v^2}{e_{3v}}\frac{\partial    e_{3v}    }{\partial t} \,b_v   \biggr\} \\
745  &= - \sum\limits_{i,j,k} \biggl\{ \frac{1}{e_3t}\frac{\partial e_{3t} \rho}{\partial t} \, g \, z_t \,b_\biggr\}
746  - \sum\limits_{i,j,k} \biggl\{ \rho \,g\,\frac{\partial z_t}{\partial t} \,b_\biggr\} \\
747\end{flalign*}
748
749Substituting the discrete expression of the time derivative of the velocity either in
750vector invariant or in flux form, leads to the discrete equivalent of the ????
751
752%% =================================================================================================
753\subsection{Coriolis and advection terms: flux form}
754\label{subsec:INVARIANTS_3.2}
755
756%% =================================================================================================
757\subsubsection{Coriolis plus ``metric'' term}
758\label{subsec:INVARIANTS_3.3}
759
760In flux from the vorticity term reduces to a Coriolis term in which
761the Coriolis parameter has been modified to account for the ``metric'' term.
762This altered Coriolis parameter is discretised at an f-point.
763It is given by:
764\[
765  f+\frac{1} {e_1 e_2 } \left( v \frac{\partial e_2 } {\partial i} - u \frac{\partial e_1 } {\partial j}\right)\;
766  \equiv \;
767  f+\frac{1} {e_{1f}\,e_{2f}} \left( \overline v^{\,i+1/2} \delta_{i+1/2} \left[ e_{2u} \right]
768    -\overline u^{\,j+1/2} \delta_{j+1/2} \left[ e_{1u}  \right] \right)
769\]
770
771Either the ENE or EEN scheme is then applied to obtain the vorticity term in flux form.
772It therefore conserves the total KE.
773The derivation is the same as for the vorticity term in the vector invariant form (\autoref{subsec:INVARIANTS_vor}).
774
775%% =================================================================================================
776\subsubsection{Flux form advection}
777\label{subsec:INVARIANTS_3.4}
778
779The flux form operator of the momentum advection is evaluated using
780a centered second order finite difference scheme.
781Because of the flux form, the discrete operator does not contribute to the global budget of linear momentum.
782Because of the centered second order scheme, it conserves the horizontal kinetic energy, that is:
783
784\begin{equation}
785  \label{eq:INVARIANTS_ADV_KE_flux}
786  -  \int_D \textbf{U}_h \cdot     \left(                 {{
787        \begin{array} {*{20}c}
788          \nabla \cdot \left( \textbf{U}\,u \right) \hfill \\
789          \nabla \cdot \left( \textbf{U}\,v \right) \hfill \\
790        \end{array}
791      } }           \right)   \;dv
792  -   \frac{1}{2} \int_D {  {\textbf{U}_h}^2 \frac{1}{e_3} \frac{\partial  e_3 }{\partial t} \;dv } =\;0
793\end{equation}
794
795Let us first consider the first term of the scalar product
796(\ie\ just the the terms associated with the i-component of the advection):
797\begin{flalign*}
798  &  - \int_D u \cdot \nabla \cdot \left(   \textbf{U}\,u   \right) \; dv   \\
799  %
800  \equiv& - \sum\limits_{i,j,k} \biggl\{    \frac{1} {b_u}    \biggl(
801  \delta_{i+1/2}  \left[   \overline {U}^{\,i}      \;\overline u^{\,i}          \right]
802  + \delta_j           \left[   \overline {V}^{\,i+1/2}\;\overline u^{\,j+1/2}   \right]
803  + \delta_k          \left[   \overline {W}^{\,i+1/2}\;\overline u^{\,k+1/2} \right]  \biggr)   \;   \biggr\} \, b_u \;u &&&  \\
804  %
805  \equiv& - \sum\limits_{i,j,k}
806  \biggl\{
807  \delta_{i+1/2} \left[   \overline {U}^{\,i}\;  \overline u^{\,i}  \right]
808  + \delta_j          \left[   \overline {V}^{\,i+1/2}\;\overline u^{\,j+1/2}   \right]
809  + \delta_k         \left[   \overline {W}^{\,i+12}\;\overline u^{\,k+1/2}  \right]
810  \; \biggr\} \; u     \\
811  %
812  \equiv& + \sum\limits_{i,j,k}
813  \biggl\{
814  \overline {U}^{\,i}\; \overline u^{\,i}    \delta_i \left[ u \right]
815  + \overline {V}^{\,i+1/2}\; \overline u^{\,j+1/2}   \delta_{j+1/2} \left[ u \right]
816  + \overline {W}^{\,i+1/2}\; \overline u^{\,k+1/2}   \delta_{k+1/2}    \left[ u \right]     \biggr\}     && \\
817  %
818  \equiv& + \frac{1}{2} \sum\limits_{i,j,k}    \biggl\{
819  \overline{U}^{\,i}       \delta_i       \left[ u^2 \right]
820  + \overline{V}^{\,i+1/2}    \delta_{j+/2}  \left[ u^2 \right]
821  + \overline{W}^{\,i+1/2}    \delta_{k+1/2}    \left[ u^2 \right]      \biggr\} && \\
822  %
823  \equiv& -  \sum\limits_{i,j,k}    \frac{1}{2}   \bigg\{
824  U  \; \delta_{i+1/2}    \left[ \overline {u^2}^{\,i} \right]
825  + V  \; \delta_{j+1/2}    \left[ \overline {u^2}^{\,i} \right]
826  + W \; \delta_{k+1/2}   \left[ \overline {u^2}^{\,i} \right]     \biggr\}    &&& \\
827  %
828  \equiv& - \sum\limits_{i,j,k}  \frac{1}{2}  \overline {u^2}^{\,i}     \biggl\{
829  \delta_{i+1/2}  \left[ U  \right]
830  + \delta_{j+1/2}   \left[ V  \right]
831  + \delta_{k+1/2}   \left[ W \right]     \biggr\}    &&& \\
832  %
833  \equiv& + \sum\limits_{i,j,k}  \frac{1}{2}  \overline {u^2}^{\,i}
834  \biggl\{     \left(   \frac{1}{e_{3t}} \frac{\partial e_{3t}}{\partial t}   \right) \; b_t     \biggr\}    &&& \\
835\end{flalign*}
836Applying similar manipulation applied to the second term of the scalar product leads to:
837\[
838  -  \int_D \textbf{U}_h \cdot     \left(                 {{
839        \begin{array} {*{20}c}
840          \nabla \cdot \left( \textbf{U}\,u \right) \hfill \\
841          \nabla \cdot \left( \textbf{U}\,v \right) \hfill \\
842        \end{array}
843      } }           \right)   \;dv
844  \equiv + \sum\limits_{i,j,k}  \frac{1}{2\left( \overline {u^2}^{\,i} + \overline {v^2}^{\,j} \right)
845  \biggl\{     \left(   \frac{1}{e_{3t}} \frac{\partial e_{3t}}{\partial t}   \right) \; b_t     \biggr\}
846\]
847which is the discrete form of $ \frac{1}{2} \int_D u \cdot \nabla \cdot \left(   \textbf{U}\,u   \right) \; dv $.
848\autoref{eq:INVARIANTS_ADV_KE_flux} is thus satisfied.
849
850When the UBS scheme is used to evaluate the flux form momentum advection,
851the discrete operator does not contribute to the global budget of linear momentum (flux form).
852The horizontal kinetic energy is not conserved, but forced to decay (\ie\ the scheme is diffusive).
853
854%% =================================================================================================
855\section{Discrete enstrophy conservation}
856\label{sec:INVARIANTS_4}
857
858%% =================================================================================================
859\subsubsection{Vorticity term with ENS scheme  (\protect\np[=.true.]{ln_dynvor_ens}{ln\_dynvor\_ens})}
860\label{subsec:INVARIANTS_vorENS}
861
862In the ENS scheme, the vorticity term is descretized as follows:
863\begin{equation}
864  \label{eq:INVARIANTS_dynvor_ens}
865  \left\{
866    \begin{aligned}
867      +\frac{1}{e_{1u}} & \overline{q}^{\,i}  & {\overline{ \overline{\left( e_{1v}\,e_{3v}\;  v \right) } } }^{\,i, j+1/2}    \\
868      - \frac{1}{e_{2v}} & \overline{q}^{\,j}  & {\overline{ \overline{\left( e_{2u}\,e_{3u}\; u \right) } } }^{\,i+1/2, j}
869    \end{aligned}
870  \right.
871\end{equation}
872
873The scheme does not allow but the conservation of the total kinetic energy but the conservation of $q^2$,
874the potential enstrophy for a horizontally non-divergent flow (\ie\ when $\chi$=$0$).
875Indeed, using the symmetry or skew symmetry properties of the operators
876( \autoref{eq:DOM_mi_adj} and \autoref{eq:DOM_di_adj}),
877it can be shown that:
878\begin{equation}
879  \label{eq:INVARIANTS_1.1}
880  \int_D {q\,\;{\textbf{k}}\cdot \frac{1} {e_3} \nabla \times \left( {e_3 \, q \;{\textbf{k}}\times {\textbf{U}}_h } \right)\;dv} \equiv 0
881\end{equation}
882where $dv=e_1\,e_2\,e_3 \; di\,dj\,dk$ is the volume element.
883Indeed, using \autoref{eq:DYN_vor_ens},
884the discrete form of the right hand side of \autoref{eq:INVARIANTS_1.1} can be transformed as follow:
885\begin{flalign*}
886  &\int_D q \,\; \textbf{k} \cdot \frac{1} {e_3 } \nabla \times
887  \left(  e_3 \, q \; \textbf{k} \times  \textbf{U}_h   \right)\;   dv \\
888  %
889  & \qquad
890  {
891    \begin{array}{*{20}l}
892      &\equiv \sum\limits_{i,j,k}
893        q \ \left\{  \delta_{i+1/2}  \left[ - \,\overline {q}^{\,i}\;  \overline{\overline  U }^{\,i,j+1/ 2} \right]
894        - \delta_{j+1/2} \left[   \overline {q}^{\,j}\;  \overline{\overline  V }^{\,i+1/2, j} \right]     \right\}    \\
895      %
896      &\equiv \sum\limits_{i,j,k}
897        \left\{   \delta_i [q] \; \overline{q}^{\,i} \; \overline{  \overline U  }^{\,i,j+1/2}
898        + \delta_j [q] \; \overline{q}^{\,j} \; \overline{\overline V }^{\,i+1/2,j}        \right\}       &&  \\
899      %
900      &\equiv \,\frac{1} {2} \sum\limits_{i,j,k}
901        \left\{         \delta_\left[ q^2 \right] \; \overline{\overline U }^{\,i,j+1/2}
902        + \delta_\left[ q^2 \right] \; \overline{\overline V }^{\,i+1/2,j}      \right\}    &&  \\
903      %
904      &\equiv - \frac{1} {2} \sum\limits_{i,j,k}   q^2 \;
905        \left\{    \delta_{i+1/2}   \left[   \overline{\overline{ U }}^{\,i,j+1/2}    \right]
906        + \delta_{j+1/2}  \left[   \overline{\overline{ V }}^{\,i+1/2,j}     \right]    \right\}    && \\
907    \end{array}
908  }
909  %
910  \allowdisplaybreaks
911  \intertext{ Since $\overline {\;\cdot \;} $ and $\delta $ operators commute: $\delta_{i+1/2}
912    \left[ {\overline a^{\,i}} \right] = \overline {\delta_i \left[ a \right]}^{\,i+1/2}$,
913    and introducing the horizontal divergence $\chi $, it becomes: }
914  \allowdisplaybreaks
915  %
916  & \qquad {
917    \begin{array}{*{20}l}
918      &\equiv \sum\limits_{i,j,k} - \frac{1} {2} q^2 \; \overline{\overline{ e_{1t}\,e_{2t}\,e_{3t}^{}\, \chi}}^{\,i+1/2,j+1/2}
919        \quad \equiv 0 &&
920    \end{array}
921  }
922\end{flalign*}
923The later equality is obtain only when the flow is horizontally non-divergent, \ie\ $\chi$=$0$.
924
925%% =================================================================================================
926\subsubsection{Vorticity Term with EEN scheme (\protect\np[=.true.]{ln_dynvor_een}{ln\_dynvor\_een})}
927\label{subsec:INVARIANTS_vorEEN}
928
929With the EEN scheme, the vorticity terms are represented as:
930\begin{equation}
931  \label{eq:INVARIANTS_dynvor_een2}
932  \left\{ {
933      \begin{aligned}
934        +q\,e_3 \, v    &\equiv +\frac{1}{e_{1u} }   \sum_{\substack{i_p,\,k_p}}
935        {^{i+1/2-i_p}_j}  \mathbb{Q}^{i_p}_{j_p}  \left( e_{1v} e_{3v} \ \right)^{i+i_p-1/2}_{j+j_p}   \\
936        - q\,e_3 \, u     &\equiv -\frac{1}{e_{2v} }    \sum_{\substack{i_p,\,k_p}}
937        {^i_{j+1/2-j_p}}  \mathbb{Q}^{i_p}_{j_p}  \left( e_{2u} e_{3u} \ \right)^{i+i_p}_{j+j_p-1/2}   \\
938      \end{aligned}
939    } \right.
940\end{equation}
941where the indices $i_p$ and $k_p$ take the following values:
942$i_p = -1/2$ or $1/2$ and $j_p = -1/2$ or $1/2$,
943and the vorticity triads, ${^i_j}\mathbb{Q}^{i_p}_{j_p}$, defined at $T$-point, are given by:
944\begin{equation}
945  \tag{\ref{eq:INVARIANTS_Q_triads}}
946  _i^j \mathbb{Q}^{i_p}_{j_p}
947  = \frac{1}{12} \ \left(   q^{i-i_p}_{j+j_p} + q^{i+j_p}_{j+i_p} + q^{i+i_p}_{j-j_p}  \right)
948\end{equation}
949
950This formulation does conserve the potential enstrophy for a horizontally non-divergent flow (\ie\ $\chi=0$).
951
952Let consider one of the vorticity triad, for example ${^{i}_j}\mathbb{Q}^{+1/2}_{+1/2} $,
953similar manipulation can be done for the 3 others.
954The discrete form of the right hand side of \autoref{eq:INVARIANTS_1.1} applied to
955this triad only can be transformed as follow:
956
957\begin{flalign*}
958  &\int_D {q\,\;{\textbf{k}}\cdot \frac{1} {e_3} \nabla \times \left( {e_3 \, q \;{\textbf{k}}\times {\textbf{U}}_h } \right)\;dv} \\
959  %
960  \equiv& \sum\limits_{i,j,k}
961  {q} \    \biggl\{ \;\;
962  \delta_{i+1/2} \left[   -\, {{^i_j}\mathbb{Q}^{+1/2}_{+1/2}  \; U^{i+1/2}_{j}}    \right]
963  - \delta_{j+1/2} \left[       {{^i_j}\mathbb{Q}^{+1/2}_{+1/2}  \; V^{i}_{j+1/2}}    \right]
964  \;\;\biggr\}        &&  \\
965  %
966  \equiv& \sum\limits_{i,j,k}
967  \biggl\{   \delta_i [q] \  {{^i_j}\mathbb{Q}^{+1/2}_{+1/2}  \; U^{i+1/2}_{j}}
968  + \delta_j [q] \  {{^i_j}\mathbb{Q}^{+1/2}_{+1/2}  \; V^{i}_{j+1/2}}   \biggr\}
969  && \\
970  %
971  ... & &&\\
972  &Demonstation \ to \ be \ done... &&\\
973  ... & &&\\
974  %
975  \equiv& \frac{1} {2} \sum\limits_{i,j,k}
976  \biggl\{  \delta_i    \Bigl[    \left(  {{^i_j}\mathbb{Q}^{+1/2}_{+1/2}} \right)^2   \Bigr]\;
977  \overline{\overline {U}}^{\,i,j+1/2}
978  + \delta_j   \Bigl[    \left( {{^i_j}\mathbb{Q}^{+1/2}_{+1/2}} \right)^2     \Bigr]\;
979  \overline{\overline {V}}^{\,i+1/2,j}
980  \biggr\}
981  &&  \\
982  %
983  \equiv& - \frac{1} {2} \sum\limits_{i,j,k}    \left( {{^i_j}\mathbb{Q}^{+1/2}_{+1/2}} \right)^2\;
984  \biggl\{    \delta_{i+1/2}
985  \left[   \overline{\overline {U}}^{\,i,j+1/2}    \right]
986  + \delta_{j+1/2}
987  \left[   \overline{\overline {V}}^{\,i+1/2,j}     \right]
988  \biggr\}    && \\
989  %
990  \equiv& \sum\limits_{i,j,k} - \frac{1} {2} \left( {{^i_j}\mathbb{Q}^{+1/2}_{+1/2}} \right)^2
991  \; \overline{\overline{ b_t^{}\, \chi}}^{\,i+1/2,\,j+1/2}  &&\\
992  %
993  \ \ \equiv& \ 0     &&\\
994\end{flalign*}
995
996%% =================================================================================================
997\section{Conservation properties on tracers}
998\label{sec:INVARIANTS_5}
999
1000All the numerical schemes used in \NEMO\ are written such that the tracer content is conserved by
1001the internal dynamics and physics (equations in flux form).
1002For advection,
1003only the CEN2 scheme (\ie\ $2^{nd}$ order finite different scheme) conserves the global variance of tracer.
1004Nevertheless the other schemes ensure that the global variance decreases
1005(\ie\ they are at least slightly diffusive).
1006For diffusion, all the schemes ensure the decrease of the total tracer variance, except the iso-neutral operator.
1007There is generally no strict conservation of mass,
1008as the equation of state is non linear with respect to $T$ and $S$.
1009In practice, the mass is conserved to a very high accuracy.
1010%% =================================================================================================
1011\subsection{Advection term}
1012\label{subsec:INVARIANTS_5.1}
1013
1014conservation of a tracer, $T$:
1015\[
1016  \frac{\partial }{\partial t} \left(   \int_D {T\;dv}   \right)
1017  =  \int_D { \frac{1}{e_3}\frac{\partial \left( e_3 \, T \right)}{\partial t} \;dv }=0
1018\]
1019
1020conservation of its variance:
1021\begin{flalign*}
1022  \frac{\partial }{\partial t} \left( \int_D {\frac{1}{2} T^2\;dv} \right)
1023  =&  \int_D { \frac{1}{e_3} Q      \frac{\partial \left( e_3 \, T \right) }{\partial t} \;dv }
1024  -   \frac{1}{2} \int_D {  T^2 \frac{1}{e_3} \frac{\partial  e_3 }{\partial t} \;dv }
1025\end{flalign*}
1026
1027Whatever the advection scheme considered it conserves of the tracer content as
1028all the scheme are written in flux form.
1029Indeed, let $T$ be the tracer and its $\tau_u$, $\tau_v$, and $\tau_w$ interpolated values at velocity point
1030(whatever the interpolation is),
1031the conservation of the tracer content due to the advection tendency is obtained as follows:
1032\begin{flalign*}
1033  &\int_D { \frac{1}{e_3}\frac{\partial \left( e_3 \, T \right)}{\partial t} \;dv } = - \int_D \nabla \cdot \left( T \textbf{U} \right)\;dv    &&&\\
1034  &\equiv - \sum\limits_{i,j,k}    \biggl\{
1035  \frac{1} {b_t}  \left\delta_i    \left[   U \;\tau_u   \right]
1036    + \delta_j    \left[   V  \;\tau_v   \right] \right)
1037  + \frac{1} {e_{3t}} \delta_k \left[ w\;\tau_w \right]    \biggl\}  b_t   &&&\\
1038  %
1039  &\equiv - \sum\limits_{i,j,k}     \left\{
1040    \delta_\left[   U \;\tau_u   \right]
1041    + \delta_\left[   V  \;\tau_v   \right]
1042    + \delta_k \left[ W \;\tau_w \right] \right\}   && \\
1043  &\equiv 0 &&&
1044\end{flalign*}
1045
1046The conservation of the variance of tracer due to the advection tendency can be achieved only with the CEN2 scheme,
1047\ie\ when $\tau_u= \overline T^{\,i+1/2}$, $\tau_v= \overline T^{\,j+1/2}$, and $\tau_w= \overline T^{\,k+1/2}$.
1048It can be demonstarted as follows:
1049\begin{flalign*}
1050  &\int_D { \frac{1}{e_3} Q      \frac{\partial \left( e_3 \, T \right) }{\partial t} \;dv }
1051  = - \int\limits_D \tau\;\nabla \cdot \left( T\; \textbf{U} \right)\;dv &&&\\
1052  \equiv& - \sum\limits_{i,j,k} T\;
1053  \left\{
1054    \delta_\left[ U  \overline T^{\,i+1/2}  \right]
1055    + \delta_\left[ V  \overline T^{\,j+1/2}  \right]
1056    + \delta_k \left[ W \overline T^{\,k+1/2} \right]          \right\} && \\
1057  \equiv& + \sum\limits_{i,j,k}
1058  \left\{     U  \overline T^{\,i+1/2} \,\delta_{i+1/2}  \left[ T \right]
1059    +  V  \overline T^{\,j+1/2} \;\delta_{j+1/2}  \left[ T \right]
1060    +  W \overline T^{\,k+1/2}\;\delta_{k+1/2} \left[ T \right]     \right\}      &&\\
1061  \equiv&  + \frac{1} {2}  \sum\limits_{i,j,k}
1062  \Bigl\{   U  \;\delta_{i+1/2} \left[ T^2 \right]
1063  + V  \;\delta_{j+1/2}  \left[ T^2 \right]
1064  + W \;\delta_{k+1/2} \left[ T^2 \right]   \Bigr\}     && \\
1065  \equiv& - \frac{1} {2}  \sum\limits_{i,j,k} T^2
1066  \Bigl\{    \delta_\left[ U  \right]
1067  + \delta_\left[ V  \right]
1068  + \delta_k \left[ W \right]     \Bigr\}      &&&  \\
1069  \equiv& + \frac{1} {2}  \sum\limits_{i,j,k} T^2
1070  \Bigl\{   \frac{1}{e_{3t}} \frac{\partial e_{3t}\,T }{\partial t}     \Bigr\}      &&& \\
1071\end{flalign*}
1072which is the discrete form of $ \frac{1}{2} \int_D {  T^2 \frac{1}{e_3} \frac{\partial  e_3 }{\partial t} \;dv }$.
1073
1074%% =================================================================================================
1075\section{Conservation properties on lateral momentum physics}
1076\label{sec:INVARIANTS_dynldf_properties}
1077
1078The discrete formulation of the horizontal diffusion of momentum ensures
1079the conservation of potential vorticity and the horizontal divergence,
1080and the dissipation of the square of these quantities
1081(\ie\ enstrophy and the variance of the horizontal divergence) as well as
1082the dissipation of the horizontal kinetic energy.
1083In particular, when the eddy coefficients are horizontally uniform,
1084it ensures a complete separation of vorticity and horizontal divergence fields,
1085so that diffusion (dissipation) of vorticity (enstrophy) does not generate horizontal divergence
1086(variance of the horizontal divergence) and \textit{vice versa}.
1087
1088These properties of the horizontal diffusion operator are a direct consequence of
1089properties \autoref{eq:DOM_curl_grad} and \autoref{eq:DOM_div_curl}.
1090When the vertical curl of the horizontal diffusion of momentum (discrete sense) is taken,
1091the term associated with the horizontal gradient of the divergence is locally zero.
1092
1093%% =================================================================================================
1094\subsection{Conservation of potential vorticity}
1095\label{subsec:INVARIANTS_6.1}
1096
1097The lateral momentum diffusion term conserves the potential vorticity:
1098\begin{flalign*}
1099  &\int \limits_D \frac{1} {e_3 } \textbf{k} \cdot \nabla \times
1100  \Bigl[    \nabla_\left( A^{\,lm}\;\chi  \right)
1101  - \nabla_h \times \left( A^{\,lm}\;\zeta \; \textbf{k} \right)    \Bigr]\;dv   \\
1102  % \end{flalign*}
1103  %%%%%%%%%% recheck here....  (gm)
1104  % \begin{flalign*}
1105  =& \int \limits_D  -\frac{1} {e_3 } \textbf{k} \cdot \nabla \times
1106  \Bigl[ \nabla_h \times \left( A^{\,lm}\;\zeta \; \textbf{k} \right)  \Bigr]\;dv  \\
1107  % \end{flalign*}
1108  % \begin{flalign*}
1109  \equiv& \sum\limits_{i,j}
1110  \left\{
1111    \delta_{i+1/2} \left[  \frac {e_{2v}} {e_{1v}\,e_{3v}}  \delta_i \left[ A_f^{\,lm} e_{3f} \zeta  \right]  \right]
1112    + \delta_{j+1/2} \left[  \frac {e_{1u}} {e_{2u}\,e_{3u}}  \delta_j \left[ A_f^{\,lm} e_{3f} \zeta  \right]  \right]
1113  \right\}   \\
1114  %
1115  \intertext{Using \autoref{eq:DOM_di_adj}, it follows:}
1116  %
1117  \equiv& \sum\limits_{i,j,k}
1118  -\,\left\{
1119    \frac{e_{2v}} {e_{1v}\,e_{3v}}  \delta_i \left[ A_f^{\,lm} e_{3f} \zeta  \right]\;\delta_i \left[ 1\right]
1120    + \frac{e_{1u}} {e_{2u}\,e_{3u}}  \delta_\left[ A_f^{\,lm} e_{3f} \zeta  \right]\;\delta_j \left[ 1\right]
1121  \right\} \quad \equiv 0
1122  \\
1123\end{flalign*}
1124
1125%% =================================================================================================
1126\subsection{Dissipation of horizontal kinetic energy}
1127\label{subsec:INVARIANTS_6.2}
1128
1129The lateral momentum diffusion term dissipates the horizontal kinetic energy:
1130%\begin{flalign*}
1131\[
1132  \begin{split}
1133    \int_D \textbf{U}_h \cdot
1134    \left[ \nabla_h     \right.   &     \left.       \left( A^{\,lm}\;\chi \right)
1135      - \nabla_h \times  \left( A^{\,lm}\;\zeta \;\textbf{k} \right)     \right] \; dv    \\
1136    \\  %%%
1137    \equiv& \sum\limits_{i,j,k}
1138    \left\{
1139      \frac{1} {e_{1u}}               \delta_{i+1/2} \left[  A_T^{\,lm}          \chi     \right]
1140      - \frac{1} {e_{2u}\,e_{3u}}  \delta_j           \left[ A_f^{\,lm} e_{3f} \zeta   \right]
1141    \right\} \; e_{1u}\,e_{2u}\,e_{3u} \;u     \\
1142    &\;\; +    \left\{
1143      \frac{1} {e_{2u}}             \delta_{j+1/2} \left[ A_T^{\,lm}          \chi    \right]
1144      + \frac{1} {e_{1v}\,e_{3v}} \delta_i            \left[ A_f^{\,lm} e_{3f} \zeta  \right]
1145    \right\} \; e_{1v}\,e_{2u}\,e_{3v} \;v     \qquad \\
1146    \\  %%%
1147    \equiv& \sum\limits_{i,j,k}
1148    \Bigl\{
1149    e_{2u}\,e_{3u} \;u\;  \delta_{i+1/2} \left[ A_T^{\,lm}           \chi    \right]
1150    - e_{1u}             \;u\;  \delta_j           \left[ A_f^{\,lm} e_{3f} \zeta  \right]
1151    \Bigl\}
1152    \\
1153    &\;\; + \Bigl\{
1154    e_{1v}\,e_{3v} \;v\;  \delta_{j+1/2\left[ A_T^{\,lm}           \chi    \right]
1155    + e_{2v}             \;v\;  \delta_i            \left[ A_f^{\,lm} e_{3f} \zeta  \right]
1156    \Bigl\}      \\
1157    \\  %%%
1158    \equiv& \sum\limits_{i,j,k}
1159    - \Bigl(
1160    \delta_i   \left[  e_{2u}\,e_{3u} \;\right]
1161    + \delta_j  \left[  e_{1v}\,e_{3v}  \;\right]
1162    \Bigr) \;  A_T^{\,lm} \chi   \\
1163    &\;\; - \Bigl(
1164    \delta_{i+1/2\left[  e_{2v}  \;\right]
1165    - \delta_{j+1/2\left[  e_{1u} \;\right]
1166    \Bigr)\;  A_f^{\,lm} e_{3f} \zeta      \\
1167    \\  %%%
1168    \equiv& \sum\limits_{i,j,k}
1169    - A_T^{\,lm}  \,\chi^2   \;e_{1t}\,e_{2t}\,e_{3t}
1170    - A_f ^{\,lm}  \,\zeta^2 \;e_{1f }\,e_{2f }\,e_{3f}
1171    \quad \leq 0       \\
1172  \end{split}
1173\]
1174
1175%% =================================================================================================
1176\subsection{Dissipation of enstrophy}
1177\label{subsec:INVARIANTS_6.3}
1178
1179The lateral momentum diffusion term dissipates the enstrophy when the eddy coefficients are horizontally uniform:
1180\begin{flalign*}
1181  &\int\limits_\zeta \; \textbf{k} \cdot \nabla \times
1182  \left[   \nabla_h \left( A^{\,lm}\;\chi  \right)
1183    - \nabla_h \times \left( A^{\,lm}\;\zeta \; \textbf{k} \right)   \right]\;dv &&&\\
1184  &\quad = A^{\,lm} \int \limits_D \zeta \textbf{k} \cdot \nabla \times
1185  \left[    \nabla_h \times \left( \zeta \; \textbf{k} \right)   \right]\;dv &&&\\
1186  &\quad \equiv A^{\,lm} \sum\limits_{i,j,k}  \zeta \;e_{3f}
1187  \left\{     \delta_{i+1/2} \left[  \frac{e_{2v}} {e_{1v}\,e_{3v}} \delta_i \left[ e_{3f} \zeta  \right]   \right]
1188    + \delta_{j+1/2} \left[  \frac{e_{1u}} {e_{2u}\,e_{3u}} \delta_j \left[ e_{3f} \zeta  \right]   \right]      \right\}   &&&\\
1189  %
1190  \intertext{Using \autoref{eq:DOM_di_adj}, it follows:}
1191  %
1192  &\quad \equiv  - A^{\,lm} \sum\limits_{i,j,k}
1193  \left\{    \left\frac{1} {e_{1v}\,e_{3v}}  \delta_i \left[ e_{3f} \zeta  \right]  \right)^2   b_v
1194    + \left\frac{1} {e_{2u}\,e_{3u}}  \delta_j \left[ e_{3f} \zeta  \right] \right)^2   b_\right\}  \quad \leq \;0    &&&\\
1195\end{flalign*}
1196
1197%% =================================================================================================
1198\subsection{Conservation of horizontal divergence}
1199\label{subsec:INVARIANTS_6.4}
1200
1201When the horizontal divergence of the horizontal diffusion of momentum (discrete sense) is taken,
1202the term associated with the vertical curl of the vorticity is zero locally, due to \autoref{eq:DOM_div_curl}.
1203The resulting term conserves the $\chi$ and dissipates $\chi^2$ when the eddy coefficients are horizontally uniform.
1204\begin{flalign*}
1205  & \int\limits_\nabla_h \cdot
1206  \Bigl[     \nabla_h \left( A^{\,lm}\;\chi \right)
1207  - \nabla_h \times \left( A^{\,lm}\;\zeta \;\textbf{k} \right)    \Bigr]  dv
1208  = \int\limits_\nabla_h \cdot \nabla_h \left( A^{\,lm}\;\chi  \right)   dv   \\
1209  %
1210  &\equiv \sum\limits_{i,j,k}
1211  \left\{   \delta_i \left[ A_u^{\,lm} \frac{e_{2u}\,e_{3u}} {e_{1u}}  \delta_{i+1/2} \left[ \chi \right]  \right]
1212    + \delta_j \left[ A_v^{\,lm} \frac{e_{1v}\,e_{3v}} {e_{2v}}  \delta_{j+1/2} \left[ \chi \right]  \right]    \right\}    \\
1213  %
1214  \intertext{Using \autoref{eq:DOM_di_adj}, it follows:}
1215  %
1216  &\equiv \sum\limits_{i,j,k}
1217  - \left\{   \frac{e_{2u}\,e_{3u}} {e_{1u}}  A_u^{\,lm} \delta_{i+1/2} \left[ \chi \right] \delta_{i+1/2} \left[ 1 \right]
1218    + \frac{e_{1v}\,e_{3v}} {e_{2v}}  A_v^{\,lm} \delta_{j+1/2} \left[ \chi \right] \delta_{j+1/2} \left[ 1 \right]    \right\}
1219  \quad \equiv 0
1220\end{flalign*}
1221
1222%% =================================================================================================
1223\subsection{Dissipation of horizontal divergence variance}
1224\label{subsec:INVARIANTS_6.5}
1225
1226\begin{flalign*}
1227  &\int\limits_D \chi \;\nabla_h \cdot
1228  \left[    \nabla_h              \left( A^{\,lm}\;\chi                    \right)
1229    - \nabla_h   \times  \left( A^{\,lm}\;\zeta \;\textbf{k} \right)    \right]\;  dv
1230  = A^{\,lm}   \int\limits_D \chi \;\nabla_h \cdot \nabla_h \left( \chi \right)\;  dv    \\
1231  %
1232  &\equiv A^{\,lm}  \sum\limits_{i,j,k}  \frac{1} {e_{1t}\,e_{2t}\,e_{3t}}  \chi
1233  \left\{
1234    \delta_\left[   \frac{e_{2u}\,e_{3u}} {e_{1u}}  \delta_{i+1/2} \left[ \chi \right]   \right]
1235    + \delta_\left[   \frac{e_{1v}\,e_{3v}} {e_{2v}}   \delta_{j+1/2} \left[ \chi \right]   \right]
1236  \right\} \;   e_{1t}\,e_{2t}\,e_{3t}    \\
1237  %
1238  \intertext{Using \autoref{eq:DOM_di_adj}, it turns out to be:}
1239  %
1240  &\equiv - A^{\,lm} \sum\limits_{i,j,k}
1241  \left\{    \left\frac{1} {e_{1u}}  \delta_{i+1/2}  \left[ \chi \right]  \right)^2  b_u
1242    + \left\frac{1} {e_{2v}}  \delta_{j+1/2}  \left[ \chi \right]  \right)^2  b_v    \right\}
1243  \quad \leq 0
1244\end{flalign*}
1245
1246%% =================================================================================================
1247\section{Conservation properties on vertical momentum physics}
1248\label{sec:INVARIANTS_7}
1249
1250As for the lateral momentum physics,
1251the continuous form of the vertical diffusion of momentum satisfies several integral constraints.
1252The first two are associated with the conservation of momentum and the dissipation of horizontal kinetic energy:
1253\begin{align*}
1254  \int\limits_D   \frac{1} {e_3 }\; \frac{\partial } {\partial k}
1255  \left(   \frac{A^{\,vm}} {e_3 }\; \frac{\partial \textbf{U}_h } {\partial k}   \right)\;  dv
1256  \qquad \quad &= \vec{\textbf{0}}
1257  %
1258  \intertext{and}
1259  %
1260                 \int\limits_D
1261                 \textbf{U}_h \cdot   \frac{1} {e_3 }\; \frac{\partial } {\partial k}
1262                 \left(   \frac{A^{\,vm}} {e_3 }\; \frac{\partial \textbf{U}_h } {\partial k}   \right)\; dv    \quad &\leq 0
1263\end{align*}
1264
1265The first property is obvious.
1266The second results from:
1267\begin{flalign*}
1268  \int\limits_D
1269  \textbf{U}_h \cdot   \frac{1} {e_3 }\; \frac{\partial } {\partial k}
1270  \left( \frac{A^{\,vm}} {e_3 }\; \frac{\partial \textbf{U}_h } {\partial k}   \right)\;dv    &&&\\
1271\end{flalign*}
1272\begin{flalign*}
1273  &\equiv \sum\limits_{i,j,k}
1274  \left(
1275    u\; \delta_k \left[ \frac{A_u^{\,vm}} {e_{3uw}} \delta_{k+1/2}  \left[ u \right]  \right]\;  e_{1u}\,e_{2u}
1276    + v\; \delta_k \left[ \frac{A_v^{\,vm}} {e_{3vw}} \delta_{k+1/2}   \left[ v \right]  \right]\;  e_{1v}\,e_{2v} \right)   &&&
1277  %
1278  \intertext{since the horizontal scale factor does not depend on $k$, it follows:}
1279  %
1280  &\equiv - \sum\limits_{i,j,k}
1281  \left\frac{A_u^{\,vm}} {e_{3uw}} \left( \delta_{k+1/2} \left[ u \right] \right)^2\; e_{1u}\,e_{2u}
1282    + \frac{A_v^{\,vm}} {e_{3vw}}  \left( \delta_{k+1/2} \left[ v \right] \right)^2\; e_{1v}\,e_{2v}  \right)
1283  \quad \leq 0   &&&
1284\end{flalign*}
1285
1286The vorticity is also conserved.
1287Indeed:
1288\begin{flalign*}
1289  \int \limits_D
1290  \frac{1} {e_3 } \textbf{k} \cdot \nabla \times
1291  \left( \frac{1} {e_3 }\; \frac{\partial } {\partial k}  \left(
1292      \frac{A^{\,vm}} {e_3}\; \frac{\partial \textbf{U}_h } {\partial k}
1293    \right\right)\; dv   &&&
1294\end{flalign*}
1295\begin{flalign*}
1296  \equiv \sum\limits_{i,j,k}  \frac{1} {e_{3f}}\; \frac{1} {e_{1f}\,e_{2f}}
1297  \bigg\{    \biggr.   \quad
1298  \delta_{i+1/2}
1299  &\left(   \frac{e_{2v}} {e_{3v}} \delta_\left[  \frac{1} {e_{3vw}} \delta_{k+1/2} \left[ v \right]  \right\right)   &&\\
1300  \biggl.
1301  - \delta_{j+1/2}
1302  &\left(   \frac{e_{1u}} {e_{3u}} \delta_k \left[  \frac{1} {e_{3uw}}\delta_{k+1/2} \left[ u \right]  \right]   \right)
1303  \biggr\} \;
1304  e_{1f}\,e_{2f}\,e_{3f} \; \equiv 0   &&
1305\end{flalign*}
1306
1307If the vertical diffusion coefficient is uniform over the whole domain, the enstrophy is dissipated, \ie
1308\begin{flalign*}
1309  \int\limits_D \zeta \, \textbf{k} \cdot \nabla \times
1310  \left(   \frac{1} {e_3}\; \frac{\partial } {\partial k}
1311    \left( \frac{A^{\,vm}} {e_3 }\; \frac{\partial \textbf{U}_h } {\partial k}   \right)   \right)\; dv = 0   &&&
1312\end{flalign*}
1313
1314This property is only satisfied in $z$-coordinates:
1315\begin{flalign*}
1316  \int\limits_D \zeta \, \textbf{k} \cdot \nabla \times
1317  \left\frac{1} {e_3}\; \frac{\partial } {\partial k}
1318    \left( \frac{A^{\,vm}} {e_3 }\; \frac{\partial \textbf{U}_h } {\partial k}  \right)   \right)\; dv   &&&
1319\end{flalign*}
1320\begin{flalign*}
1321  \equiv \sum\limits_{i,j,k} \zeta \;e_{3f} \;
1322  \biggl\{  \biggr\quad
1323  \delta_{i+1/2}
1324  &\left(   \frac{e_{2v}} {e_{3v}} \delta_k \left[ \frac{A_v^{\,vm}} {e_{3vw}} \delta_{k+1/2}[v]  \right]   \right)   &&\\
1325  - \delta_{j+1/2}
1326  &\biggl.
1327  \left(   \frac{e_{1u}} {e_{3u}} \delta_k \left[ \frac{A_u^{\,vm}} {e_{3uw}} \delta_{k+1/2} [u]  \right]    \right) \biggr\}   &&
1328\end{flalign*}
1329\begin{flalign*}
1330  \equiv \sum\limits_{i,j,k} \zeta \;e_{3f}
1331  \biggl\{     \biggr\quad
1332  \frac{1} {e_{3v}} \delta_k
1333  &\left[ \frac{A_v^{\,vm}} {e_{3vw}} \delta_{k+1/2} \left[ \delta_{i+1/2} \left[ e_{2v}\,v \right] \right]   \right]    &&\\
1334  \biggl.
1335  - \frac{1} {e_{3u}} \delta_k
1336  &\left[  \frac{A_u^{\,vm}} {e_{3uw}} \delta_{k+1/2} \left[ \delta_{j+1/2} \left[ e_{1u}\,u \right] \right\right\biggr\}  &&
1337\end{flalign*}
1338Using the fact that the vertical diffusion coefficients are uniform,
1339and that in $z$-coordinate, the vertical scale factors do not depend on $i$ and $j$ so that:
1340$e_{3f} =e_{3u} =e_{3v} =e_{3t} $ and $e_{3w} =e_{3uw} =e_{3vw} $, it follows:
1341\begin{flalign*}
1342  \equiv A^{\,vm} \sum\limits_{i,j,k} \zeta \;\delta_k
1343  \left[   \frac{1} {e_{3w}} \delta_{k+1/2} \Bigl[   \delta_{i+1/2} \left[ e_{2v}\,v \right]
1344    - \delta_{j+1/ 2} \left[ e_{1u}\,u \right]   \Bigr]    \right]    &&&
1345\end{flalign*}
1346\begin{flalign*}
1347  \equiv - A^{\,vm} \sum\limits_{i,j,k} \frac{1} {e_{3w}}
1348  \left( \delta_{k+1/2} \left[ \zeta  \right] \right)^2 \; e_{1f}\,e_{2f}  \; \leq 0    &&&
1349\end{flalign*}
1350Similarly, the horizontal divergence is obviously conserved:
1351
1352\begin{flalign*}
1353  \int\limits_D \nabla \cdot
1354  \left( \frac{1} {e_3 }\; \frac{\partial } {\partial k}
1355    \left( \frac{A^{\,vm}} {e_3 }\; \frac{\partial \textbf{U}_h } {\partial k} \right) \right)\; dv = 0    &&&
1356\end{flalign*}
1357and the square of the horizontal divergence decreases (\ie\ the horizontal divergence is dissipated) if
1358the vertical diffusion coefficient is uniform over the whole domain:
1359
1360\begin{flalign*}
1361  \int\limits_D \chi \;\nabla \cdot
1362  \left( \frac{1} {e_3 }\; \frac{\partial } {\partial k}
1363    \left( \frac{A^{\,vm}} {e_3 }\; \frac{\partial \textbf{U}_h } {\partial k}  \right) \right)\;  dv = 0  &&&
1364\end{flalign*}
1365This property is only satisfied in the $z$-coordinate:
1366\begin{flalign*}
1367  \int\limits_D \chi \;\nabla \cdot
1368  \left( \frac{1} {e_3 }\; \frac{\partial } {\partial k}
1369    \left( \frac{A^{\,vm}} {e_3 }\; \frac{\partial \textbf{U}_h } {\partial k} \right\right)\; dv    &&&
1370\end{flalign*}
1371\begin{flalign*}
1372  \equiv \sum\limits_{i,j,k} \frac{\chi } {e_{1t}\,e_{2t}}
1373  \biggl\{  \Biggr\quad
1374  \delta_{i+1/2}
1375  &\left(   \frac{e_{2u}} {e_{3u}} \delta_k
1376    \left[ \frac{A_u^{\,vm}} {e_{3uw}} \delta_{k+1/2} [u] \right] \right)    &&\\
1377  \Biggl.
1378  + \delta_{j+1/2}
1379  &\left( \frac{e_{1v}} {e_{3v}} \delta_k
1380    \left[ \frac{A_v^{\,vm}} {e_{3vw}} \delta_{k+1/2} [v] \right]   \right)
1381  \Biggr\} \;  e_{1t}\,e_{2t}\,e_{3t}   &&
1382\end{flalign*}
1383
1384\begin{flalign*}
1385  \equiv A^{\,vm} \sum\limits_{i,j,k}  \chi \,
1386  \biggl\{  \biggr\quad
1387  \delta_{i+1/2}
1388  &\left(
1389    \delta_k \left[
1390      \frac{1} {e_{3uw}} \delta_{k+1/2} \left[ e_{2u}\,u \right] \right]   \right)    && \\
1391  \biggl.
1392  + \delta_{j+1/2}
1393  &\left(    \delta_k \left[
1394      \frac{1} {e_{3vw}} \delta_{k+1/2} \left[ e_{1v}\,v \right] \right]   \right)   \biggr\}    &&
1395\end{flalign*}
1396
1397\begin{flalign*}
1398  \equiv -A^{\,vm} \sum\limits_{i,j,k}
1399  \frac{\delta_{k+1/2} \left[ \chi \right]} {e_{3w}}\; \biggl\{
1400  \delta_{k+1/2} \Bigl[
1401  \delta_{i+1/2} \left[ e_{2u}\,u \right]
1402  + \delta_{j+1/2} \left[ e_{1v}\,v \right]  \Bigr]    \biggr\}    &&&
1403\end{flalign*}
1404
1405\begin{flalign*}
1406  \equiv -A^{\,vm} \sum\limits_{i,j,k}
1407  \frac{1} {e_{3w}} \delta_{k+1/2} \left[ \chi \right]\; \delta_{k+1/2} \left[ e_{1t}\,e_{2t} \;\chi \right]   &&&
1408\end{flalign*}
1409
1410\begin{flalign*}
1411  \equiv -A^{\,vm} \sum\limits_{i,j,k}
1412  \frac{e_{1t}\,e_{2t}} {e_{3w}}\; \left( \delta_{k+1/2} \left[ \chi \right]  \right)^2     \quad  \equiv 0    &&&
1413\end{flalign*}
1414
1415%% =================================================================================================
1416\section{Conservation properties on tracer physics}
1417\label{sec:INVARIANTS_8}
1418
1419The numerical schemes used for tracer subgridscale physics are written such that
1420the heat and salt contents are conserved (equations in flux form).
1421Since a flux form is used to compute the temperature and salinity,
1422the quadratic form of these quantities (\ie\ their variance) globally tends to diminish.
1423As for the advection term, there is conservation of mass only if the Equation Of Seawater is linear.
1424
1425%% =================================================================================================
1426\subsection{Conservation of tracers}
1427\label{subsec:INVARIANTS_8.1}
1428
1429constraint of conservation of tracers:
1430\begin{flalign*}
1431  &\int\limits_\nabla  \cdot \left( A\;\nabla T \right)\;dv  &&& \\ \\
1432  &\equiv \sum\limits_{i,j,k}
1433  \biggl\{  \biggr.
1434  \delta_i
1435  \left[
1436    A_u^{\,lT} \frac{e_{2u}\,e_{3u}} {e_{1u}} \delta_{i+1/2}
1437    \left[ T \right]
1438  \right]
1439  + \delta_j
1440  \left[
1441    A_v^{\,lT} \frac{e_{1v}\,e_{3v}} {e_{2v}} \delta_{j+1/2}
1442    \left[ T \right]
1443  \right] && \\
1444  & \qquad \qquad \qquad \qquad \qquad \qquad \quad \;\;\;
1445  + \delta_k
1446  \left[
1447    A_w^{\,vT} \frac{e_{1t}\,e_{2t}} {e_{3t}} \delta_{k+1/2}
1448    \left[ T \right]
1449  \right]
1450  \biggr\}   \quad  \equiv 0
1451  &&
1452\end{flalign*}
1453
1454In fact, this property simply results from the flux form of the operator.
1455
1456%% =================================================================================================
1457\subsection{Dissipation of tracer variance}
1458\label{subsec:INVARIANTS_8.2}
1459
1460constraint on the dissipation of tracer variance:
1461\begin{flalign*}
1462  \int\limits_D T\;\nabla & \cdot \left( A\;\nabla T \right)\;dv  &&&\\
1463  &\equiv   \sum\limits_{i,j,k} \; T
1464  \biggl\{  \biggr.
1465  \delta_i \left[ A_u^{\,lT} \frac{e_{2u}\,e_{3u}} {e_{1u}} \delta_{i+1/2} \left[T\right] \right]
1466  & + \delta_j \left[ A_v^{\,lT} \frac{e_{1v} \,e_{3v}} {e_{2v}} \delta_{j+1/2} \left[T\right] \right]
1467  \quad&& \\
1468  \biggl.
1469  &&+ \delta_k \left[A_w^{\,vT}\frac{e_{1t}\,e_{2t}} {e_{3t}}\delta_{k+1/2}\left[T\right]\right]
1470  \biggr\} &&
1471\end{flalign*}
1472\begin{flalign*}
1473  \equiv - \sum\limits_{i,j,k}
1474  \biggl\{  \biggr\quad
1475  &    A_u^{\,lT} \left( \frac{1} {e_{1u}} \delta_{i+1/2} \left[ T \right]  \right)^2   e_{1u}\,e_{2u}\,e_{3u}    && \\
1476  & + A_v^{\,lT} \left( \frac{1} {e_{2v}} \delta_{j+1/2} \left[ T \right]  \right)^2   e_{1v}\,e_{2v}\,e_{3v}     && \\ \biggl.
1477  & + A_w^{\,vT} \left( \frac{1} {e_{3w}} \delta_{k+1/2} \left[ T \right]   \right)^2    e_{1w}\,e_{2w}\,e_{3w}   \biggr\}
1478  \quad      \leq 0      &&
1479\end{flalign*}
1480
1481%%%%  end of appendix in gm comment
1482%}
1483
1484\onlyinsubfile{\input{../../global/epilogue}}
1485
1486\end{document}
Note: See TracBrowser for help on using the repository browser.