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 @ 11596

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

Application of some coding rules

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