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

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

Continuation of coding rules application
Recovery of some sections deleted by the previous commit

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