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/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles – NEMO

source: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/apdx_invariants.tex @ 14644

Last change on this file since 14644 was 14644, checked in by sparonuz, 3 years ago

Merge trunk -r14642:HEAD

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