# Changeset 10414 for NEMO/trunk/doc/latex

Ignore:
Timestamp:
2018-12-19T00:02:00+01:00 (2 years ago)
Message:
• Comment \label commands on maths environments for unreferenced equations and adapt the unnumbered math container accordingly (mainly switch to shortanded LateX syntax with $...$)
• Add a code trick to build subfile with its own bibliography
• Fix right path for main LaTeX document in first line of subfiles (\documentclass[...]{subfiles})
• Rename abstract_foreword.tex to foreword.tex
• ## NEMO/trunk/doc/latex/NEMO/subfiles/annex_B.tex

 r10406 \documentclass[../tex_main/NEMO_manual]{subfiles} \documentclass[../main/NEMO_manual]{subfiles} \begin{document} % ================================================================ % Chapter Ñ Appendix B : Diffusive Operators % Chapter Appendix B : Diffusive Operators % ================================================================ \chapter{Appendix B : Diffusive Operators} \label{apdx:B} \minitoc \newpage $\$\newline    % force a new ligne % ================================================================ \subsubsection*{In z-coordinates} In $z$-coordinates, the horizontal/vertical second order tracer diffusion operator is given by: \begin{align} \label{apdx:B1} &D^T = \frac{1}{e_1 \, e_2}      \left[ \left. \frac{\partial}{\partial i} \left(  \frac{e_2}{e_1}A^{lT} \;\left. \frac{\partial T}{\partial i} \right|_z   \right)   \right|_z      \right. \left. + \left. \frac{\partial}{\partial j} \left(  \frac{e_1}{e_2}A^{lT} \;\left. \frac{\partial T}{\partial j} \right|_z   \right)   \right|_z      \right] + \frac{\partial }{\partial z}\left( {A^{vT} \;\frac{\partial T}{\partial z}} \right) \begin{align} \label{apdx:B1} &D^T = \frac{1}{e_1 \, e_2}      \left[ \left. \frac{\partial}{\partial i} \left(   \frac{e_2}{e_1}A^{lT} \;\left. \frac{\partial T}{\partial i} \right|_z   \right)   \right|_z      \right. \left. + \left. \frac{\partial}{\partial j} \left(  \frac{e_1}{e_2}A^{lT} \;\left. \frac{\partial T}{\partial j} \right|_z   \right)   \right|_z      \right] + \frac{\partial }{\partial z}\left( {A^{vT} \;\frac{\partial T}{\partial z}} \right) \end{align} \subsubsection*{In generalized vertical coordinates} In $s$-coordinates, we defined the slopes of $s$-surfaces, $\sigma_1$ and $\sigma_2$ by \autoref{apdx:A_s_slope} and the vertical/horizontal ratio of diffusion coefficient by $\epsilon = A^{vT} / A^{lT}$. The diffusion operator is given by: \label{apdx:B2} D^T = \left. \nabla \right|_s \cdot \left[ A^{lT} \;\Re \cdot \left. \nabla \right|_s T  \right] \\ \;\;\text{where} \;\Re =\left( {{\begin{array}{*{20}c} 1 \hfill & 0 \hfill & {-\sigma _1 } \hfill \\ 0 \hfill & 1 \hfill & {-\sigma _2 } \hfill \\ {-\sigma _1 } \hfill & {-\sigma _2 } \hfill & {\varepsilon +\sigma _1 ^2+\sigma _2 ^2} \hfill \\ \end{array} }} \right) \label{apdx:B2} D^T = \left. \nabla \right|_s \cdot \left[ A^{lT} \;\Re \cdot \left. \nabla \right|_s T  \right] \\ \;\;\text{where} \;\Re =\left( {{ \begin{array}{*{20}c} 1 \hfill & 0 \hfill & {-\sigma_1 } \hfill \\ 0 \hfill & 1 \hfill & {-\sigma_2 } \hfill \\ {-\sigma_1 } \hfill & {-\sigma_2 } \hfill & {\varepsilon +\sigma_1 ^2+\sigma_2 ^2} \hfill \\ \end{array} }} \right) or in expanded form: \begin{subequations} \begin{align*} {\begin{array}{*{20}l} D^T=& \frac{1}{e_1\,e_2\,e_3 }\;\left[ {\ \ \ \ e_2\,e_3\,A^{lT} \;\left. {\frac{\partial }{\partial i}\left( {\frac{1}{e_1}\;\left. {\frac{\partial T}{\partial i}} \right|_s -\frac{\sigma _1 }{e_3 }\;\frac{\partial T}{\partial s}} \right)} \right|_s } \right.  \\ &\qquad \quad \ \ \ +e_1\,e_3\,A^{lT} \;\left. {\frac{\partial }{\partial j}\left( {\frac{1}{e_2 }\;\left. {\frac{\partial T}{\partial j}} \right|_s -\frac{\sigma _2 }{e_3 }\;\frac{\partial T}{\partial s}} \right)} \right|_s \\ &\qquad \quad \ \ \ + e_1\,e_2\,A^{lT} \;\frac{\partial }{\partial s}\left( {-\frac{\sigma _1 }{e_1 }\;\left. {\frac{\partial T}{\partial i}} \right|_s -\frac{\sigma _2 }{e_2 }\;\left. {\frac{\partial T}{\partial j}} \right|_s } \right. \left. {\left. {+\left( {\varepsilon +\sigma _1^2+\sigma _2 ^2} \right)\;\frac{1}{e_3 }\;\frac{\partial T}{\partial s}} \right)\;\;} \right] \end{array} } \begin{align*} { \begin{array}{*{20}l} D^T=& \frac{1}{e_1\,e_2\,e_3 }\;\left[ {\ \ \ \ e_2\,e_3\,A^{lT} \;\left. {\frac{\partial }{\partial i}\left( {\frac{1}{e_1}\;\left. {\frac{\partial T}{\partial i}} \right|_s -\frac{\sigma_1 }{e_3 }\;\frac{\partial T}{\partial s}} \right)} \right|_s } \right.  \\ &\qquad \quad \ \ \ +e_1\,e_3\,A^{lT} \;\left. {\frac{\partial }{\partial j}\left( {\frac{1}{e_2 }\;\left. {\frac{\partial T}{\partial j}} \right|_s -\frac{\sigma_2 }{e_3 }\;\frac{\partial T}{\partial s}} \right)} \right|_s \\ &\qquad \quad \ \ \ + e_1\,e_2\,A^{lT} \;\frac{\partial }{\partial s}\left( {-\frac{\sigma_1 }{e_1 }\;\left. {\frac{\partial T}{\partial i}} \right|_s -\frac{\sigma_2 }{e_2 }\;\left. {\frac{\partial T}{\partial j}} \right|_s } \right. \left. {\left. {+\left( {\varepsilon +\sigma_1^2+\sigma_2 ^2} \right)\;\frac{1}{e_3 }\;\frac{\partial T}{\partial s}} \right)\;\;} \right] \end{array} } \end{align*} \end{subequations} Equation \autoref{apdx:B2} is obtained from \autoref{apdx:B1} without any additional assumption. any loss of generality: \begin{subequations} \begin{align*} {\begin{array}{*{20}l} D^T&=\frac{1}{e_1\,e_2} \left. {\frac{\partial }{\partial i}\left( {\frac{e_2}{e_1}A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right|_z } \right)} \right|_z +\frac{\partial }{\partial z}\left( {A^{vT}\;\frac{\partial T}{\partial z}} \right)     \\ \\ % &=\frac{1}{e_1\,e_2 }\left[ {\left. {\;\frac{\partial }{\partial i}\left( {\frac{e_2}{e_1}A^{lT}\;\left( {\left. {\frac{\partial T}{\partial i}} \right|_s -\frac{e_1\,\sigma _1 }{e_3 }\frac{\partial T}{\partial s}} \right)} \right)} \right|_s } \right. \\ & \qquad \qquad \left. { -\frac{e_1\,\sigma _1 }{e_3 }\frac{\partial }{\partial s}\left( {\frac{e_2 }{e_1 }A^{lT}\;\left. {\left( {\left. {\frac{\partial T}{\partial i}} \right|_s -\frac{e_1 \,\sigma _1 }{e_3 }\frac{\partial T}{\partial s}} \right)} \right|_s } \right)\;} \right] \shoveright{ +\frac{1}{e_3 }\frac{\partial }{\partial s}\left[ {\frac{A^{vT}}{e_3 }\;\frac{\partial T}{\partial s}} \right]}  \qquad \qquad \qquad \\ \\ % &=\frac{1}{e_1 \,e_2 \,e_3 }\left[ {\left. {\;\;\frac{\partial }{\partial i}\left( {\frac{e_2 \,e_3 }{e_1 }A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right|_s } \right)} \right|_s -\left. {\frac{e_2 }{e_1}A^{lT}\;\frac{\partial e_3 }{\partial i}} \right|_s \left. {\frac{\partial T}{\partial i}} \right|_s } \right. \\ &  \qquad \qquad \quad \left. {-e_3 \frac{\partial }{\partial i}\left( {\frac{e_2 \,\sigma _1 }{e_3 }A^{lT}\;\frac{\partial T}{\partial s}} \right)} \right|_s -e_1 \,\sigma _1 \frac{\partial }{\partial s}\left( {\frac{e_2 }{e_1 }A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right|_s } \right) \\ &  \qquad \qquad \quad \shoveright{ -e_1 \,\sigma _1 \frac{\partial }{\partial s}\left( {-\frac{e_2 \,\sigma _1 }{e_3 }A^{lT}\;\frac{\partial T}{\partial s}} \right)\;\,\left. {+\frac{\partial }{\partial s}\left( {\frac{e_1 \,e_2 }{e_3 }A^{vT}\;\frac{\partial T}{\partial s}} \right)\quad} \right] }\\ \end{array} }     \\ % {\begin{array}{*{20}l} \intertext{Noting that $\frac{1}{e_1} \left. \frac{\partial e_3 }{\partial i} \right|_s = \frac{\partial \sigma _1 }{\partial s}$, it becomes:} % & =\frac{1}{e_1\,e_2\,e_3 }\left[ {\left. {\;\;\;\frac{\partial }{\partial i}\left( {\frac{e_2\,e_3 }{e_1}\,A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right|_s } \right)} \right|_s \left. -\, {e_3 \frac{\partial }{\partial i}\left( {\frac{e_2 \,\sigma _1 }{e_3 }A^{lT}\;\frac{\partial T}{\partial s}} \right)} \right|_s } \right. \\ & \qquad \qquad \quad -e_2 A^{lT}\;\frac{\partial \sigma _1 }{\partial s}\left. {\frac{\partial T}{\partial i}} \right|_s -e_1 \,\sigma_1 \frac{\partial }{\partial s}\left( {\frac{e_2 }{e_1 }A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right|_s } \right) \\ & \qquad \qquad \quad\shoveright{ \left. { +e_1 \,\sigma _1 \frac{\partial }{\partial s}\left( {\frac{e_2 \,\sigma _1 }{e_3 }A^{lT}\;\frac{\partial T}{\partial s}} \right)+\frac{\partial }{\partial s}\left( {\frac{e_1 \,e_2 }{e_3 }A^{vT}\;\frac{\partial T}{\partial z}} \right)\;\;\;} \right] }\\ \\ &=\frac{1}{e_1 \,e_2 \,e_3 } \left[ {\left. {\;\;\;\frac{\partial }{\partial i} \left( {\frac{e_2 \,e_3 }{e_1 }A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right|_s } \right)} \right|_s \left. {-\frac{\partial }{\partial i}\left( {e_2 \,\sigma _1 A^{lT}\;\frac{\partial T}{\partial s}} \right)} \right|_s } \right. \\ & \qquad \qquad \quad \left. {+\frac{e_2 \,\sigma _1 }{e_3}A^{lT}\;\frac{\partial T}{\partial s} \;\frac{\partial e_3 }{\partial i}}  \right|_s -e_2 A^{lT}\;\frac{\partial \sigma _1 }{\partial s}\left. {\frac{\partial T}{\partial i}} \right|_s \\ & \qquad \qquad \quad-e_2 \,\sigma _1 \frac{\partial}{\partial s}\left( {A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right|_s } \right)+\frac{\partial }{\partial s}\left( {\frac{e_1 \,e_2 \,\sigma _1 ^2}{e_3 }A^{lT}\;\frac{\partial T}{\partial s}} \right) \\ & \qquad \qquad \quad\shoveright{ \left. {-\frac{\partial \left( {e_1 \,e_2 \,\sigma _1 } \right)}{\partial s} \left( {\frac{\sigma _1 }{e_3}A^{lT}\;\frac{\partial T}{\partial s}} \right) + \frac{\partial }{\partial s}\left( {\frac{e_1 \,e_2 }{e_3 }A^{vT}\;\frac{\partial T}{\partial s}} \right)\;\;\;} \right]} \end{array} } \\ {\begin{array}{*{20}l} % \intertext{using the same remark as just above, it becomes:} % &= \frac{1}{e_1 \,e_2 \,e_3 } \left[ {\left. {\;\;\;\frac{\partial }{\partial i} \left( {\frac{e_2 \,e_3 }{e_1 }A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right|_s -e_2 \,\sigma _1 A^{lT}\;\frac{\partial T}{\partial s}} \right)} \right|_s } \right.\;\;\; \\ & \qquad \qquad \quad+\frac{e_1 \,e_2 \,\sigma _1 }{e_3 }A^{lT}\;\frac{\partial T}{\partial s}\;\frac{\partial \sigma _1 }{\partial s} - \frac {\sigma _1 }{e_3} A^{lT} \;\frac{\partial \left( {e_1 \,e_2 \,\sigma _1 } \right)}{\partial s}\;\frac{\partial T}{\partial s} \\ & \qquad \qquad \quad-e_2 \left( {A^{lT}\;\frac{\partial \sigma _1 }{\partial s}\left. {\frac{\partial T}{\partial i}} \right|_s +\frac{\partial }{\partial s}\left( {\sigma _1 A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right|_s } \right)-\frac{\partial \sigma _1 }{\partial s}\;A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right|_s } \right) \\ & \qquad \qquad \quad\shoveright{\left. {+\frac{\partial }{\partial s}\left( {\frac{e_1 \,e_2 \,\sigma _1 ^2}{e_3 }A^{lT}\;\frac{\partial T}{\partial s}+\frac{e_1 \,e_2}{e_3 }A^{vT}\;\frac{\partial T}{\partial s}} \right)\;\;\;} \right] } \end{array} } \\ {\begin{array}{*{20}l} % \intertext{Since the horizontal scale factors do not depend on the vertical coordinate, the last term of the first line and the first term of the last line cancel, while the second line reduces to a single vertical derivative, so it becomes:} % & =\frac{1}{e_1 \,e_2 \,e_3 }\left[ {\left. {\;\;\;\frac{\partial }{\partial i}\left( {\frac{e_2 \,e_3 }{e_1 }A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right|_s -e_2 \,\sigma _1 \,A^{lT}\;\frac{\partial T}{\partial s}} \right)} \right|_s } \right. \\ & \qquad \qquad \quad \shoveright{ \left. {+\frac{\partial }{\partial s}\left( {-e_2 \,\sigma _1 \,A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right|_s +A^{lT}\frac{e_1 \,e_2 }{e_3 }\;\left( {\varepsilon +\sigma _1 ^2} \right)\frac{\partial T}{\partial s}} \right)\;\;\;} \right]} \\ % \intertext{in other words, the horizontal/vertical Laplacian operator in the ($i$,$s$) plane takes the following form:} \end{array} } \\ % {\frac{1}{e_1\,e_2\,e_3}} \left( {{\begin{array}{*{30}c} {\left. {\frac{\partial \left( {e_2 e_3 \bullet } \right)}{\partial i}} \right|_s } \hfill \\ {\frac{\partial \left( {e_1 e_2 \bullet } \right)}{\partial s}} \hfill \\ \end{array}}}\right) \cdot \left[ {A^{lT} \left( {{\begin{array}{*{30}c} {1} \hfill & {-\sigma_1 } \hfill \\ {-\sigma_1} \hfill & {\varepsilon + \sigma_1^2} \hfill \\ \end{array} }} \right) \cdot \left( {{\begin{array}{*{30}c} {\frac{1}{e_1 }\;\left. {\frac{\partial \bullet }{\partial i}} \right|_s } \hfill \\ {\frac{1}{e_3 }\;\frac{\partial \bullet }{\partial s}} \hfill \\ \end{array}}}       \right) \left( T \right)} \right] \begin{align*} { \begin{array}{*{20}l} D^T&=\frac{1}{e_1\,e_2} \left. {\frac{\partial }{\partial i}\left( {\frac{e_2}{e_1}A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right|_z } \right)} \right|_z +\frac{\partial }{\partial z}\left( {A^{vT}\;\frac{\partial T}{\partial z}} \right) \\ \\ % &=\frac{1}{e_1\,e_2 }\left[ {\left. {\;\frac{\partial }{\partial i}\left( {\frac{e_2}{e_1}A^{lT}\;\left( {\left. {\frac{\partial T}{\partial i}} \right|_s -\frac{e_1\,\sigma_1 }{e_3 }\frac{\partial T}{\partial s}} \right)} \right)} \right|_s } \right. \\ & \qquad \qquad \left. { -\frac{e_1\,\sigma_1 }{e_3 }\frac{\partial }{\partial s}\left( {\frac{e_2 }{e_1 }A^{lT}\;\left. {\left( {\left. {\frac{\partial T}{\partial i}} \right|_s -\frac{e_1 \,\sigma_1 }{e_3 }\frac{\partial T}{\partial s}} \right)} \right|_s } \right)\;} \right] \shoveright{ +\frac{1}{e_3 }\frac{\partial }{\partial s}\left[ {\frac{A^{vT}}{e_3 }\;\frac{\partial T}{\partial s}} \right]}  \qquad \qquad \qquad \\ \\ % &=\frac{1}{e_1 \,e_2 \,e_3 }\left[ {\left. {\;\;\frac{\partial }{\partial i}\left( {\frac{e_2 \,e_3 }{e_1 }A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right|_s } \right)} \right|_s -\left. {\frac{e_2 }{e_1}A^{lT}\;\frac{\partial e_3 }{\partial i}} \right|_s \left. {\frac{\partial T}{\partial i}} \right|_s } \right. \\ &  \qquad \qquad \quad \left. {-e_3 \frac{\partial }{\partial i}\left( {\frac{e_2 \,\sigma_1 }{e_3 }A^{lT}\;\frac{\partial T}{\partial s}} \right)} \right|_s -e_1 \,\sigma_1 \frac{\partial }{\partial s}\left( {\frac{e_2 }{e_1 }A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right|_s } \right) \\ &  \qquad \qquad \quad \shoveright{ -e_1 \,\sigma_1 \frac{\partial }{\partial s}\left( {-\frac{e_2 \,\sigma_1 }{e_3 }A^{lT}\;\frac{\partial T}{\partial s}} \right)\;\,\left. {+\frac{\partial }{\partial s}\left( {\frac{e_1 \,e_2 }{e_3 }A^{vT}\;\frac{\partial T}{\partial s}} \right)\quad} \right] }\\ \end{array} }      \\ % { \begin{array}{*{20}l} \intertext{Noting that $\frac{1}{e_1} \left. \frac{\partial e_3 }{\partial i} \right|_s = \frac{\partial \sigma_1 }{\partial s}$, it becomes:} % & =\frac{1}{e_1\,e_2\,e_3 }\left[ {\left. {\;\;\;\frac{\partial }{\partial i}\left( {\frac{e_2\,e_3 }{e_1}\,A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right|_s } \right)} \right|_s \left. -\, {e_3 \frac{\partial }{\partial i}\left( {\frac{e_2 \,\sigma_1 }{e_3 }A^{lT}\;\frac{\partial T}{\partial s}} \right)} \right|_s } \right. \\ & \qquad \qquad \quad -e_2 A^{lT}\;\frac{\partial \sigma_1 }{\partial s}\left. {\frac{\partial T}{\partial i}} \right|_s -e_1 \,\sigma_1 \frac{\partial }{\partial s}\left( {\frac{e_2 }{e_1 }A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right|_s } \right) \\ & \qquad \qquad \quad\shoveright{ \left. { +e_1 \,\sigma_1 \frac{\partial }{\partial s}\left( {\frac{e_2 \,\sigma_1 }{e_3 }A^{lT}\;\frac{\partial T}{\partial s}} \right)+\frac{\partial }{\partial s}\left( {\frac{e_1 \,e_2 }{e_3 }A^{vT}\;\frac{\partial T}{\partial z}} \right)\;\;\;} \right] }\\ \\ &=\frac{1}{e_1 \,e_2 \,e_3 } \left[ {\left. {\;\;\;\frac{\partial }{\partial i} \left( {\frac{e_2 \,e_3 }{e_1 }A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right|_s } \right)} \right|_s \left. {-\frac{\partial }{\partial i}\left( {e_2 \,\sigma_1 A^{lT}\;\frac{\partial T}{\partial s}} \right)} \right|_s } \right. \\ & \qquad \qquad \quad \left. {+\frac{e_2 \,\sigma_1 }{e_3}A^{lT}\;\frac{\partial T}{\partial s} \;\frac{\partial e_3 }{\partial i}}  \right|_s -e_2 A^{lT}\;\frac{\partial \sigma_1 }{\partial s}\left. {\frac{\partial T}{\partial i}} \right|_s \\ & \qquad \qquad \quad-e_2 \,\sigma_1 \frac{\partial}{\partial s}\left( {A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right|_s } \right)+\frac{\partial }{\partial s}\left( {\frac{e_1 \,e_2 \,\sigma_1 ^2}{e_3 }A^{lT}\;\frac{\partial T}{\partial s}} \right) \\ & \qquad \qquad \quad\shoveright{ \left. {-\frac{\partial \left( {e_1 \,e_2 \,\sigma_1 } \right)}{\partial s} \left( {\frac{\sigma_1 }{e_3}A^{lT}\;\frac{\partial T}{\partial s}} \right) + \frac{\partial }{\partial s}\left( {\frac{e_1 \,e_2 }{e_3 }A^{vT}\;\frac{\partial T}{\partial s}} \right)\;\;\;} \right]} \end{array} } \\ { \begin{array}{*{20}l} % \intertext{using the same remark as just above, it becomes:} % &= \frac{1}{e_1 \,e_2 \,e_3 } \left[ {\left. {\;\;\;\frac{\partial }{\partial i} \left( {\frac{e_2 \,e_3 }{e_1 }A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right|_s -e_2 \,\sigma_1 A^{lT}\;\frac{\partial T}{\partial s}} \right)} \right|_s } \right.\;\;\; \\ & \qquad \qquad \quad+\frac{e_1 \,e_2 \,\sigma_1 }{e_3 }A^{lT}\;\frac{\partial T}{\partial s}\;\frac{\partial \sigma_1 }{\partial s} - \frac {\sigma_1 }{e_3} A^{lT} \;\frac{\partial \left( {e_1 \,e_2 \,\sigma_1 } \right)}{\partial s}\;\frac{\partial T}{\partial s} \\ & \qquad \qquad \quad-e_2 \left( {A^{lT}\;\frac{\partial \sigma_1 }{\partial s}\left. {\frac{\partial T}{\partial i}} \right|_s +\frac{\partial }{\partial s}\left( {\sigma_1 A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right|_s } \right)-\frac{\partial \sigma_1 }{\partial s}\;A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right|_s } \right) \\ & \qquad \qquad \quad\shoveright{\left. {+\frac{\partial }{\partial s}\left( {\frac{e_1 \,e_2 \,\sigma_1 ^2}{e_3 }A^{lT}\;\frac{\partial T}{\partial s}+\frac{e_1 \,e_2}{e_3 }A^{vT}\;\frac{\partial T}{\partial s}} \right)\;\;\;} \right] } \end{array} } \\ { \begin{array}{*{20}l} % \intertext{Since the horizontal scale factors do not depend on the vertical coordinate, the last term of the first line and the first term of the last line cancel, while the second line reduces to a single vertical derivative, so it becomes:} % & =\frac{1}{e_1 \,e_2 \,e_3 }\left[ {\left. {\;\;\;\frac{\partial }{\partial i}\left( {\frac{e_2 \,e_3 }{e_1 }A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right|_s -e_2 \,\sigma_1 \,A^{lT}\;\frac{\partial T}{\partial s}} \right)} \right|_s } \right. \\ & \qquad \qquad \quad \shoveright{ \left. {+\frac{\partial }{\partial s}\left( {-e_2 \,\sigma_1 \,A^{lT}\;\left. {\frac{\partial T}{\partial i}} \right|_s +A^{lT}\frac{e_1 \,e_2 }{e_3 }\;\left( {\varepsilon +\sigma_1 ^2} \right)\frac{\partial T}{\partial s}} \right)\;\;\;} \right]} \\ % \intertext{in other words, the horizontal/vertical Laplacian operator in the ($i$,$s$) plane takes the following form:} \end{array} } \\ % {\frac{1}{e_1\,e_2\,e_3}} \left( {{ \begin{array}{*{30}c} {\left. {\frac{\partial \left( {e_2 e_3 \bullet } \right)}{\partial i}} \right|_s } \hfill \\ {\frac{\partial \left( {e_1 e_2 \bullet } \right)}{\partial s}} \hfill \\ \end{array}}} \right) \cdot \left[ {A^{lT} \left( {{ \begin{array}{*{30}c} {1} \hfill & {-\sigma_1 } \hfill \\ {-\sigma_1} \hfill & {\varepsilon + \sigma_1^2} \hfill \\ \end{array} }} \right) \cdot \left( {{ \begin{array}{*{30}c} {\frac{1}{e_1 }\;\left. {\frac{\partial \bullet }{\partial i}} \right|_s } \hfill \\ {\frac{1}{e_3 }\;\frac{\partial \bullet }{\partial s}} \hfill \\ \end{array} }}       \right) \left( T \right)} \right] \end{align*} \end{subequations} \addtocounter{equation}{-2} %\addtocounter{equation}{-2} % ================================================================ takes the following form \citep{Redi_JPO82}: \label{apdx:B3} \textbf {A}_{\textbf I} = \frac{A^{lT}}{\left( {1+a_1 ^2+a_2 ^2} \right)} \left[ {{\begin{array}{*{20}c} {1+a_1 ^2} \hfill & {-a_1 a_2 } \hfill & {-a_1 } \hfill \\ {-a_1 a_2 } \hfill & {1+a_2 ^2} \hfill & {-a_2 } \hfill \\ {-a_1 } \hfill & {-a_2 } \hfill & {\varepsilon +a_1 ^2+a_2 ^2} \hfill \\ \end{array} }} \right] \label{apdx:B3} \textbf {A}_{\textbf I} = \frac{A^{lT}}{\left( {1+a_1 ^2+a_2 ^2} \right)} \left[ {{ \begin{array}{*{20}c} {1+a_1 ^2} \hfill & {-a_1 a_2 } \hfill & {-a_1 } \hfill \\ {-a_1 a_2 } \hfill & {1+a_2 ^2} \hfill & {-a_2 } \hfill \\ {-a_1 } \hfill & {-a_2 } \hfill & {\varepsilon +a_1 ^2+a_2 ^2} \hfill \\ \end{array} }} \right] where ($a_1$, $a_2$) are the isopycnal slopes in ($\textbf{i}$, $\textbf{j}$) directions, relative to geopotentials: $a_1 =\frac{e_3 }{e_1 }\left( {\frac{\partial \rho }{\partial i}} \right)\left( {\frac{\partial \rho }{\partial k}} \right)^{-1} \qquad , \qquad a_2 =\frac{e_3 }{e_2 }\left( {\frac{\partial \rho }{\partial j}} \right)\left( {\frac{\partial \rho }{\partial k}} \right)^{-1} a_1 =\frac{e_3 }{e_1 }\left( {\frac{\partial \rho }{\partial i}} \right)\left( {\frac{\partial \rho }{\partial k}} \right)^{-1} \qquad , \qquad a_2 =\frac{e_3 }{e_2 }\left( {\frac{\partial \rho }{\partial j}} \right)\left( {\frac{\partial \rho }{\partial k}} \right)^{-1}$ In practice, isopycnal slopes are generally less than $10^{-2}$ in the ocean, so $\textbf {A}_{\textbf I}$ can be simplified appreciably \citep{Cox1987}: \begin{subequations} \label{apdx:B4} \label{apdx:B4a} {\textbf{A}_{\textbf{I}}} \approx A^{lT}\;\Re\;\text{where} \;\Re = \left[ {{\begin{array}{*{20}c} 1 \hfill & 0 \hfill & {-a_1 } \hfill \\ 0 \hfill & 1 \hfill & {-a_2 } \hfill \\ {-a_1 } \hfill & {-a_2 } \hfill & {\varepsilon +a_1 ^2+a_2 ^2} \hfill \\ \end{array} }} \right], and the iso/dianeutral diffusive operator in $z$-coordinates is then \label{apdx:B4b} D^T = \left. \nabla \right|_z \cdot \left[ A^{lT} \;\Re \cdot \left. \nabla \right|_z T  \right]. \\ \begin{subequations} \label{apdx:B4} \label{apdx:B4a} {\textbf{A}_{\textbf{I}}} \approx A^{lT}\;\Re\;\text{where} \;\Re = \left[ {{ \begin{array}{*{20}c} 1 \hfill & 0 \hfill & {-a_1 } \hfill \\ 0 \hfill & 1 \hfill & {-a_2 } \hfill \\ {-a_1 } \hfill & {-a_2 } \hfill & {\varepsilon +a_1 ^2+a_2 ^2} \hfill \\ \end{array} }} \right], and the iso/dianeutral diffusive operator in $z$-coordinates is then \label{apdx:B4b} D^T = \left. \nabla \right|_z \cdot \left[ A^{lT} \;\Re \cdot \left. \nabla \right|_z T  \right]. \\ \end{subequations} Physically, the full tensor \autoref{apdx:B3} represents strong isoneutral diffusion on a plane parallel to Written out explicitly, \begin{multline} \label{apdx:B_ldfiso} D^T=\frac{1}{e_1 e_2 }\left\{ {\;\frac{\partial }{\partial i}\left[ {A_h \left( {\frac{e_2}{e_1}\frac{\partial T}{\partial i}-a_1 \frac{e_2}{e_3}\frac{\partial T}{\partial k}} \right)} \right]} {+\frac{\partial}{\partial j}\left[ {A_h \left( {\frac{e_1}{e_2}\frac{\partial T}{\partial j}-a_2 \frac{e_1}{e_3}\frac{\partial T}{\partial k}} \right)} \right]\;} \right\} \\ \shoveright{+\frac{1}{e_3 }\frac{\partial }{\partial k}\left[ {A_h \left( {-\frac{a_1 }{e_1 }\frac{\partial T}{\partial i}-\frac{a_2 }{e_2 }\frac{\partial T}{\partial j}+\frac{\left( {a_1 ^2+a_2 ^2+\varepsilon} \right)}{e_3 }\frac{\partial T}{\partial k}} \right)} \right]}. \\ \begin{multline} \label{apdx:B_ldfiso} D^T=\frac{1}{e_1 e_2 }\left\{ {\;\frac{\partial }{\partial i}\left[ {A_h \left( {\frac{e_2}{e_1}\frac{\partial T}{\partial i}-a_1 \frac{e_2}{e_3}\frac{\partial T}{\partial k}} \right)} \right]} {+\frac{\partial}{\partial j}\left[ {A_h \left( {\frac{e_1}{e_2}\frac{\partial T}{\partial j}-a_2 \frac{e_1}{e_3}\frac{\partial T}{\partial k}} \right)} \right]\;} \right\} \\ \shoveright{+\frac{1}{e_3 }\frac{\partial }{\partial k}\left[ {A_h \left( {-\frac{a_1 }{e_1 }\frac{\partial T}{\partial i}-\frac{a_2 }{e_2 }\frac{\partial T}{\partial j}+\frac{\left( {a_1 ^2+a_2 ^2+\varepsilon} \right)}{e_3 }\frac{\partial T}{\partial k}} \right)} \right]}. \\ \end{multline} The isopycnal diffusion operator \autoref{apdx:B4}, Let us demonstrate the second one: $\iiint\limits_D T\;\nabla .\left( {\textbf{A}}_{\textbf{I}} \nabla T \right)\,dv = -\iiint\limits_D \nabla T\;.\left( {\textbf{A}}_{\textbf{I}} \nabla T \right)\,dv, \iiint\limits_D T\;\nabla .\left( {\textbf{A}}_{\textbf{I}} \nabla T \right)\,dv = -\iiint\limits_D \nabla T\;.\left( {\textbf{A}}_{\textbf{I}} \nabla T \right)\,dv,$ and since \begin{subequations} \begin{align*} {\begin{array}{*{20}l} \nabla T\;.\left( {{\rm {\bf A}}_{\rm {\bf I}} \nabla T} \right)&=A^{lT}\left[ {\left( {\frac{\partial T}{\partial i}} \right)^2-2a_1 \frac{\partial T}{\partial i}\frac{\partial T}{\partial k}+\left( {\frac{\partial T}{\partial j}} \right)^2} \right. \\ &\qquad \qquad \qquad { \left. -\,{2a_2 \frac{\partial T}{\partial j}\frac{\partial T}{\partial k}+\left( {a_1 ^2+a_2 ^2+\varepsilon} \right)\left( {\frac{\partial T}{\partial k}} \right)^2} \right]} \\ &=A_h \left[ {\left( {\frac{\partial T}{\partial i}-a_1 \frac{\partial T}{\partial k}} \right)^2+\left( {\frac{\partial T}{\partial j}-a_2 \frac{\partial T}{\partial k}} \right)^2} +\varepsilon \left(\frac{\partial T}{\partial k}\right) ^2\right]      \\ & \geq 0 \end{array} } \begin{align*} { \begin{array}{*{20}l} \nabla T\;.\left( {{\rm {\bf A}}_{\rm {\bf I}} \nabla T} \right)&=A^{lT}\left[ {\left( {\frac{\partial T}{\partial i}} \right)^2-2a_1 \frac{\partial T}{\partial i}\frac{\partial T}{\partial k}+\left( {\frac{\partial T}{\partial j}} \right)^2} \right. \\ &\qquad \qquad \qquad { \left. -\,{2a_2 \frac{\partial T}{\partial j}\frac{\partial T}{\partial k}+\left( {a_1 ^2+a_2 ^2+\varepsilon} \right)\left( {\frac{\partial T}{\partial k}} \right)^2} \right]} \\ &=A_h \left[ {\left( {\frac{\partial T}{\partial i}-a_1 \frac{\partial T}{\partial k}} \right)^2+\left( {\frac{\partial T}{\partial j}-a_2 \frac{\partial T}{\partial k}} \right)^2} +\varepsilon \left(\frac{\partial T}{\partial k}\right) ^2\right]      \\ & \geq 0 \end{array} } \end{align*} \end{subequations} \addtocounter{equation}{-1} %\addtocounter{equation}{-1} the property becomes obvious. The resulting operator then takes the simple form \label{apdx:B_ldfiso_s} D^T = \left. \nabla \right|_s \cdot \left[ A^{lT} \;\Re \cdot \left. \nabla \right|_s T  \right] \\ \;\;\text{where} \;\Re =\left( {{\begin{array}{*{20}c} 1 \hfill & 0 \hfill & {-r _1 } \hfill \\ 0 \hfill & 1 \hfill & {-r _2 } \hfill \\ {-r _1 } \hfill & {-r _2 } \hfill & {\varepsilon +r _1 ^2+r _2 ^2} \hfill \\ \end{array} }} \right), \label{apdx:B_ldfiso_s} D^T = \left. \nabla \right|_s \cdot \left[ A^{lT} \;\Re \cdot \left. \nabla \right|_s T  \right] \\ \;\;\text{where} \;\Re =\left( {{ \begin{array}{*{20}c} 1 \hfill & 0 \hfill & {-r _1 } \hfill \\ 0 \hfill & 1 \hfill & {-r _2 } \hfill \\ {-r _1 } \hfill & {-r _2 } \hfill & {\varepsilon +r _1 ^2+r _2 ^2} \hfill \\ \end{array} }} \right), relative to $s$-coordinate surfaces: $r_1 =\frac{e_3 }{e_1 }\left( {\frac{\partial \rho }{\partial i}} \right)\left( {\frac{\partial \rho }{\partial s}} \right)^{-1} \qquad , \qquad r_2 =\frac{e_3 }{e_2 }\left( {\frac{\partial \rho }{\partial j}} \right)\left( {\frac{\partial \rho }{\partial s}} \right)^{-1}. r_1 =\frac{e_3 }{e_1 }\left( {\frac{\partial \rho }{\partial i}} \right)\left( {\frac{\partial \rho }{\partial s}} \right)^{-1} \qquad , \qquad r_2 =\frac{e_3 }{e_2 }\left( {\frac{\partial \rho }{\partial j}} \right)\left( {\frac{\partial \rho }{\partial s}} \right)^{-1}.$ the weak-slope operator may be \emph{exactly} reexpressed in non-orthogonal $i,j,\rho$-coordinates as \label{apdx:B5} D^T = \left. \nabla \right|_\rho \cdot \left[ A^{lT} \;\Re \cdot \left. \nabla \right|_\rho T  \right] \\ \;\;\text{where} \;\Re =\left( {{\begin{array}{*{20}c} 1 \hfill & 0 \hfill &0 \hfill \\ 0 \hfill & 1 \hfill & 0 \hfill \\ 0 \hfill & 0 \hfill & \varepsilon \hfill \\ \end{array} }} \right). \label{apdx:B5} D^T = \left. \nabla \right|_\rho \cdot \left[ A^{lT} \;\Re \cdot \left. \nabla \right|_\rho T  \right] \\ \;\;\text{where} \;\Re =\left( {{ \begin{array}{*{20}c} 1 \hfill & 0 \hfill &0 \hfill \\ 0 \hfill & 1 \hfill & 0 \hfill \\ 0 \hfill & 0 \hfill & \varepsilon \hfill \\ \end{array} }} \right). Then direct transformation from $i,j,\rho$-coordinates to $i,j,s$-coordinates gives to the horizontal velocity vector: \begin{align*} \Delta {\textbf{U}}_h &=\nabla \left( {\nabla \cdot {\textbf{U}}_h } \right)- \nabla \times \left( {\nabla \times {\textbf{U}}_h } \right)    \\ \\ &=\left( {{\begin{array}{*{20}c} {\frac{1}{e_1 }\frac{\partial \chi }{\partial i}} \hfill \\ {\frac{1}{e_2 }\frac{\partial \chi }{\partial j}} \hfill \\ {\frac{1}{e_3 }\frac{\partial \chi }{\partial k}} \hfill \\ \end{array} }} \right)-\left( {{\begin{array}{*{20}c} {\frac{1}{e_2 }\frac{\partial \zeta }{\partial j}-\frac{1}{e_3 }\frac{\partial }{\partial k}\left( {\frac{1}{e_3 }\frac{\partial u}{\partial k}} \right)} \hfill \\ {\frac{1}{e_3 }\frac{\partial }{\partial k}\left( {-\frac{1}{e_3 }\frac{\partial v}{\partial k}} \right)-\frac{1}{e_1 }\frac{\partial \zeta }{\partial i}} \hfill \\ {\frac{1}{e_1 e_2 }\left[ {\frac{\partial }{\partial i}\left( {\frac{e_2 }{e_3 }\frac{\partial u}{\partial k}} \right)-\frac{\partial }{\partial j}\left( {-\frac{e_1 }{e_3 }\frac{\partial v}{\partial k}} \right)} \right]} \hfill \\ \end{array} }} \right) \\ \\ &=\left( {{\begin{array}{*{20}c} {\frac{1}{e_1 }\frac{\partial \chi }{\partial i}-\frac{1}{e_2 }\frac{\partial \zeta }{\partial j}} \\ {\frac{1}{e_2 }\frac{\partial \chi }{\partial j}+\frac{1}{e_1 }\frac{\partial \zeta }{\partial i}} \\ 0 \\ \end{array} }} \right) +\frac{1}{e_3 } \left( {{\begin{array}{*{20}c} {\frac{\partial }{\partial k}\left( {\frac{1}{e_3 }\frac{\partial u}{\partial k}} \right)} \\ {\frac{\partial }{\partial k}\left( {\frac{1}{e_3 }\frac{\partial v}{\partial k}} \right)} \\ {\frac{\partial \chi }{\partial k}-\frac{1}{e_1 e_2 }\left( {\frac{\partial ^2\left( {e_2 \,u} \right)}{\partial i\partial k}+\frac{\partial ^2\left( {e_1 \,v} \right)}{\partial j\partial k}} \right)} \\ \end{array} }} \right) \Delta {\textbf{U}}_h &=\nabla \left( {\nabla \cdot {\textbf{U}}_h } \right)- \nabla \times \left( {\nabla \times {\textbf{U}}_h } \right) \\ \\ &=\left( {{ \begin{array}{*{20}c} {\frac{1}{e_1 }\frac{\partial \chi }{\partial i}} \hfill \\ {\frac{1}{e_2 }\frac{\partial \chi }{\partial j}} \hfill \\ {\frac{1}{e_3 }\frac{\partial \chi }{\partial k}} \hfill \\ \end{array} }} \right) -\left( {{ \begin{array}{*{20}c} {\frac{1}{e_2 }\frac{\partial \zeta }{\partial j}-\frac{1}{e_3 }\frac{\partial }{\partial k}\left( {\frac{1}{e_3 }\frac{\partial u}{\partial k}} \right)} \hfill \\ {\frac{1}{e_3 }\frac{\partial }{\partial k}\left( {-\frac{1}{e_3 }\frac{\partial v}{\partial k}} \right)-\frac{1}{e_1 }\frac{\partial \zeta }{\partial i}} \hfill \\ {\frac{1}{e_1 e_2 }\left[ {\frac{\partial }{\partial i}\left( {\frac{e_2 }{e_3 }\frac{\partial u}{\partial k}} \right)-\frac{\partial }{\partial j}\left( {-\frac{e_1 }{e_3 }\frac{\partial v}{\partial k}} \right)} \right]} \hfill \\ \end{array} }} \right) \\ \\ &=\left( {{ \begin{array}{*{20}c} {\frac{1}{e_1 }\frac{\partial \chi }{\partial i}-\frac{1}{e_2 }\frac{\partial \zeta }{\partial j}} \\ {\frac{1}{e_2 }\frac{\partial \chi }{\partial j}+\frac{1}{e_1 }\frac{\partial \zeta }{\partial i}} \\ 0 \\ \end{array} }} \right) +\frac{1}{e_3 } \left( {{ \begin{array}{*{20}c} {\frac{\partial }{\partial k}\left( {\frac{1}{e_3 }\frac{\partial u}{\partial k}} \right)} \\ {\frac{\partial }{\partial k}\left( {\frac{1}{e_3 }\frac{\partial v}{\partial k}} \right)} \\ {\frac{\partial \chi }{\partial k}-\frac{1}{e_1 e_2 }\left( {\frac{\partial ^2\left( {e_2 \,u} \right)}{\partial i\partial k}+\frac{\partial ^2\left( {e_1 \,v} \right)}{\partial j\partial k}} \right)} \\ \end{array} }} \right) \end{align*} Using \autoref{eq:PE_div}, the definition of the horizontal divergence, the third componant of the second vector is obviously zero and thus : $\Delta {\textbf{U}}_h = \nabla _h \left( \chi \right) - \nabla _h \times \left( \zeta \right) + \frac {1}{e_3 } \frac {\partial }{\partial k} \left( {\frac {1}{e_3 } \frac{\partial {\textbf{ U}}_h }{\partial k}} \right) \Delta {\textbf{U}}_h = \nabla _h \left( \chi \right) - \nabla _h \times \left( \zeta \right) + \frac {1}{e_3 } \frac {\partial }{\partial k} \left( {\frac {1}{e_3 } \frac{\partial {\textbf{ U}}_h }{\partial k}} \right)$ The horizontal/vertical second order (Laplacian type) operator used to diffuse horizontal momentum in the $z$-coordinate therefore takes the following form: \label{apdx:B_Lap_U} {\textbf{D}}^{\textbf{U}} = \nabla _h \left( {A^{lm}\;\chi } \right) - \nabla _h \times \left( {A^{lm}\;\zeta \;{\textbf{k}}} \right) + \frac{1}{e_3 }\frac{\partial }{\partial k}\left( {\frac{A^{vm}\;}{e_3 } \frac{\partial {\rm {\bf U}}_h }{\partial k}} \right) \\ \label{apdx:B_Lap_U} { \textbf{D}}^{\textbf{U}} = \nabla _h \left( {A^{lm}\;\chi } \right) - \nabla _h \times \left( {A^{lm}\;\zeta \;{\textbf{k}}} \right) + \frac{1}{e_3 }\frac{\partial }{\partial k}\left( {\frac{A^{vm}\;}{e_3 } \frac{\partial {\rm {\bf U}}_h }{\partial k}} \right) \\ that is, in expanded form: \begin{align*} D^{\textbf{U}}_u & = \frac{1}{e_1} \frac{\partial \left( {A^{lm}\chi   } \right)}{\partial i} -\frac{1}{e_2} \frac{\partial \left( {A^{lm}\zeta } \right)}{\partial j} +\frac{1}{e_3} \frac{\partial u}{\partial k}      \\ D^{\textbf{U}}_v & = \frac{1}{e_2 }\frac{\partial \left( {A^{lm}\chi   } \right)}{\partial j} +\frac{1}{e_1 }\frac{\partial \left( {A^{lm}\zeta } \right)}{\partial i} +\frac{1}{e_3} \frac{\partial v}{\partial k} D^{\textbf{U}}_u & = \frac{1}{e_1} \frac{\partial \left( {A^{lm}\chi   } \right)}{\partial i} -\frac{1}{e_2} \frac{\partial \left( {A^{lm}\zeta } \right)}{\partial j} +\frac{1}{e_3} \frac{\partial u}{\partial k}      \\ D^{\textbf{U}}_v & = \frac{1}{e_2 }\frac{\partial \left( {A^{lm}\chi   } \right)}{\partial j} +\frac{1}{e_1 }\frac{\partial \left( {A^{lm}\zeta } \right)}{\partial i} +\frac{1}{e_3} \frac{\partial v}{\partial k} \end{align*} Generally, \autoref{apdx:B_Lap_U} is used in both $z$- and $s$-coordinate systems, that is a Laplacian diffusion is applied on momentum along the coordinate directions. \biblio \end{document}
• ## NEMO/trunk/doc/latex/NEMO/subfiles/annex_C.tex

 r10406 \documentclass[../tex_main/NEMO_manual]{subfiles} \documentclass[../main/NEMO_manual]{subfiles} \begin{document} % ================================================================ \chapter{Discrete Invariants of the Equations} \label{apdx:C} \minitoc \newpage $\$\newline    % force a new ligne % ================================================================ fluxes at the faces of a $T$-box: $U = e_{2u}\,e_{3u}\; u \qquad V = e_{1v}\,e_{3v}\; v \qquad W = e_{1w}\,e_{2w}\; \omega \\ U = e_{2u}\,e_{3u}\; u \qquad V = e_{1v}\,e_{3v}\; v \qquad W = e_{1w}\,e_{2w}\; \omega$ volume of cells at $u$-, $v$-, and $T$-points: $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} \\ 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}$ ($i.e.$ $s(k_s) = \eta$ and $s(k_b)=-H$, where $H$ is the bottom depth). \begin{flalign*} z(k) = \eta - \int\limits_{\tilde{k}=k}^{\tilde{k}=k_s}  e_3(\tilde{k}) \;d\tilde{k} = \eta - \int\limits_k^{k_s}  e_3 \;d\tilde{k} z(k) = \eta - \int\limits_{\tilde{k}=k}^{\tilde{k}=k_s}  e_3(\tilde{k}) \;d\tilde{k} = \eta - \int\limits_k^{k_s}  e_3 \;d\tilde{k} \end{flalign*} Continuity equation with the above notation: $\frac{1}{e_{3t}} \partial_t (e_{3t})+ \frac{1}{b_t} \biggl\{ \delta_i [U] + \delta_j [V] + \delta_k [W] \biggr\} = 0 \frac{1}{e_{3t}} \partial_t (e_{3t})+ \frac{1}{b_t} \biggl\{ \delta_i [U] + \delta_j [V] + \delta_k [W] \biggr\} = 0$ A quantity, $Q$ is conserved when its domain averaged time change is zero, that is when: $\partial_t \left( \int_D{ Q\;dv } \right) =0 \partial_t \left( \int_D{ Q\;dv } \right) =0$ Noting that the coordinate system used ....  blah blah $\partial_t \left( \int_D {Q\;dv} \right) = \int_D { \partial_t \left( e_3 \, Q \right) e_1e_2\;di\,dj\,dk } = \int_D { \frac{1}{e_3} \partial_t \left( e_3 \, Q \right) dv } =0 \partial_t \left( \int_D {Q\;dv} \right) = \int_D { \partial_t \left( e_3 \, Q \right) e_1e_2\;di\,dj\,dk } = \int_D { \frac{1}{e_3} \partial_t \left( e_3 \, Q \right) dv } =0$ equation of evolution of $Q$ written as the quadratic quantity $\frac{1}{2}Q^2$ is conserved when: \begin{flalign*} \partial_t \left(   \int_D{ \frac{1}{2} \,Q^2\;dv }   \right) =&  \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 } \\ =&  \int_D {         Q   \;\partial_t\left( e_3 \, Q \right) e_1e_2\;di\,dj\,dk } -  \int_D { \frac{1}{2} Q^2 \,\partial_t  (e_3) \;e_1e_2\;di\,dj\,dk } \\ \partial_t \left(   \int_D{ \frac{1}{2} \,Q^2\;dv }   \right) =&  \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 } \\ =&  \int_D {         Q   \;\partial_t\left( e_3 \, Q \right) e_1e_2\;di\,dj\,dk } -  \int_D { \frac{1}{2} Q^2 \,\partial_t  (e_3) \;e_1e_2\;di\,dj\,dk } \\ \end{flalign*} that is in a more compact form : \begin{flalign} \label{eq:Q2_flux} \partial_t \left( \int_D {\frac{1}{2} Q^2\;dv} \right) =&                   \int_D { \frac{Q}{e_3}  \partial_t \left( e_3 \, Q \right) dv } \begin{flalign} \label{eq:Q2_flux} \partial_t \left( \int_D {\frac{1}{2} Q^2\;dv} \right) =&                   \int_D { \frac{Q}{e_3}  \partial_t \left( e_3 \, Q \right) dv } -   \frac{1}{2} \int_D {  \frac{Q^2}{e_3} \partial_t (e_3) \;dv } \end{flalign} the quadratic quantity $\frac{1}{2}Q^2$ is conserved when: \begin{flalign*} \partial_t \left( \int_D {\frac{1}{2} Q^2\;dv} \right) =&  \int_D { \frac{1}{2} \partial_t \left( e_3 \, Q^2 \right) \;e_1e_2\;di\,dj\,dk } \\ =& \int_D {         Q      \partial_t Q  \;e_1e_2e_3\;di\,dj\,dk } +  \int_D { \frac{1}{2} Q^2 \, \partial_t e_3  \;e_1e_2\;di\,dj\,dk } \\ \partial_t \left( \int_D {\frac{1}{2} Q^2\;dv} \right) =&  \int_D { \frac{1}{2} \partial_t \left( e_3 \, Q^2 \right) \;e_1e_2\;di\,dj\,dk } \\ =& \int_D {         Q      \partial_t Q  \;e_1e_2e_3\;di\,dj\,dk } +  \int_D { \frac{1}{2} Q^2 \, \partial_t e_3  \;e_1e_2\;di\,dj\,dk } \\ \end{flalign*} that is in a more compact form: \begin{flalign} \label{eq:Q2_vect} \partial_t \left( \int_D {\frac{1}{2} Q^2\;dv} \right) =& \int_D {         Q   \,\partial_t Q  \;dv } +   \frac{1}{2} \int_D { \frac{1}{e_3} Q^2 \partial_t e_3 \;dv } \begin{flalign} \label{eq:Q2_vect} \partial_t \left( \int_D {\frac{1}{2} Q^2\;dv} \right) =& \int_D {         Q   \,\partial_t Q  \;dv } +   \frac{1}{2} \int_D { \frac{1}{e_3} Q^2 \partial_t e_3 \;dv } \end{flalign} % ================================================================ \label{sec:C.1} The discretization of pimitive equation in $s$-coordinate ($i.e.$ time and space varying vertical coordinate) must be chosen so that the discrete equation of the model satisfy integral constrains on energy and enstrophy. Let us first establish those constraint in the continuous world. The total energy ($i.e.$ kinetic plus potential energies) is conserved: \begin{flalign} \label{eq:Tot_Energy} \begin{flalign} \label{eq:Tot_Energy} \partial_t \left( \int_D \left( \frac{1}{2} {\textbf{U}_h}^2 +  \rho \, g \, z \right) \;dv \right)  = & 0 \end{flalign} \autoref{eq:Tot_Energy} for the latter form leads to: \begin{subequations} \label{eq:E_tot} % \label{eq:E_tot} advection term (vector invariant form): \label{eq:E_tot_vect_vor_1} \int\limits_D  \zeta \; \left( \textbf{k} \times \textbf{U}_h  \right) \cdot \textbf{U}_h  \;  dv   = 0   \\ $% \label{eq:E_tot_vect_vor_1} \int\limits_D \zeta \; \left( \textbf{k} \times \textbf{U}_h \right) \cdot \textbf{U}_h \; dv = 0 \\$ % \begin{equation} \label{eq:E_tot_vect_adv_1} \int\limits_D  \textbf{U}_h \cdot \nabla_h \left( \frac{{\textbf{U}_h}^2}{2} \right)     dv + \int\limits_D  \textbf{U}_h \cdot \nabla_z \textbf{U}_h  \;dv -  \int\limits_D { \frac{{\textbf{U}_h}^2}{2} \frac{1}{e_3} \partial_t e_3 \;dv }   = 0   \\ $% \label{eq:E_tot_vect_adv_1} \int\limits_D \textbf{U}_h \cdot \nabla_h \left( \frac{{\textbf{U}_h}^2}{2} \right) dv + \int\limits_D \textbf{U}_h \cdot \nabla_z \textbf{U}_h \;dv - \int\limits_D { \frac{{\textbf{U}_h}^2}{2} \frac{1}{e_3} \partial_t e_3 \;dv } = 0$ advection term (flux form): \label{eq:E_tot_flux_metric} \int\limits_D  \frac{1} {e_1 e_2 } \left( v \,\partial_i e_2 - u \,\partial_j e_1  \right)\; \left(  \textbf{k} \times \textbf{U}_h  \right) \cdot \textbf{U}_h  \;  dv   = 0   \\ \label{eq:E_tot_flux_adv} \int\limits_D \textbf{U}_h \cdot     \left(                 {{\begin{array} {*{20}c} \nabla \cdot \left( \textbf{U}\,u \right) \hfill \\ \nabla \cdot \left( \textbf{U}\,v \right) \hfill \\       \end{array}} }           \right)   \;dv +   \frac{1}{2} \int\limits_D {  {\textbf{U}_h}^2 \frac{1}{e_3} \partial_t e_3 \;dv } =\;0  \\ $% \label{eq:E_tot_flux_metric} \int\limits_D \frac{1} {e_1 e_2 } \left( v \,\partial_i e_2 - u \,\partial_j e_1 \right)\; \left( \textbf{k} \times \textbf{U}_h \right) \cdot \textbf{U}_h \; dv = 0$ $% \label{eq:E_tot_flux_adv} \int\limits_D \textbf{U}_h \cdot \left( {{ \begin{array} {*{20}c} \nabla \cdot \left( \textbf{U}\,u \right) \hfill \\ \nabla \cdot \left( \textbf{U}\,v \right) \hfill \end{array}} } \right) \;dv + \frac{1}{2} \int\limits_D { {\textbf{U}_h}^2 \frac{1}{e_3} \partial_t e_3 \;dv } =\;0$ coriolis term \begin{equation} \label{eq:E_tot_cor} \int\limits_D  f   \; \left( \textbf{k} \times \textbf{U}_h  \right) \cdot \textbf{U}_h  \;  dv   = 0   \\ $% \label{eq:E_tot_cor} \int\limits_D f \; \left( \textbf{k} \times \textbf{U}_h \right) \cdot \textbf{U}_h \; dv = 0$ pressure gradient: \label{eq:E_tot_pg_1} - \int\limits_D  \left. \nabla p \right|_z \cdot \textbf{U}_h \;dv = - \int\limits_D \nabla \cdot \left( \rho \,\textbf {U} \right)\;g\;z\;\;dv + \int\limits_D g\, \rho \; \partial_t z  \;dv   \\ $% \label{eq:E_tot_pg_1} - \int\limits_D \left. \nabla p \right|_z \cdot \textbf{U}_h \;dv = - \int\limits_D \nabla \cdot \left( \rho \,\textbf {U} \right)\;g\;z\;\;dv + \int\limits_D g\, \rho \; \partial_t z \;dv$ where $\nabla_h = \left. \nabla \right|_k$ is the gradient along the $s$-surfaces. blah blah.... The prognostic ocean dynamics equation can be summarized as follows: $\text{NXT} = \dbinom {\text{VOR} + \text{KEG} + \text {ZAD} } {\text{COR} + \text{ADV} } + \text{HPG} + \text{SPG} + \text{LDF} + \text{ZDF}$ Vector invariant form: % \label{eq:E_tot_vect} $% \label{eq:E_tot_vect_vor_2} \int\limits_D \textbf{U}_h \cdot \text{VOR} \;dv = 0$ $% \label{eq:E_tot_vect_adv_2} \int\limits_D \textbf{U}_h \cdot \text{KEG} \;dv + \int\limits_D \textbf{U}_h \cdot \text{ZAD} \;dv - \int\limits_D { \frac{{\textbf{U}_h}^2}{2} \frac{1}{e_3} \partial_t e_3 \;dv } = 0$ $% \label{eq:E_tot_pg_2} - \int\limits_D \textbf{U}_h \cdot (\text{HPG}+ \text{SPG}) \;dv = - \int\limits_D \nabla \cdot \left( \rho \,\textbf {U} \right)\;g\;z\;\;dv + \int\limits_D g\, \rho \; \partial_t z \;dv$ Flux form: \begin{subequations} \label{eq:E_tot_flux} $% \label{eq:E_tot_flux_metric_2} \int\limits_D \textbf{U}_h \cdot \text {COR} \; dv = 0$ $% \label{eq:E_tot_flux_adv_2} \int\limits_D \textbf{U}_h \cdot \text{ADV} \;dv + \frac{1}{2} \int\limits_D { {\textbf{U}_h}^2 \frac{1}{e_3} \partial_t e_3 \;dv } =\;0$ \label{eq:E_tot_pg_3} - \int\limits_D  \textbf{U}_h \cdot (\text{HPG}+ \text{SPG}) \;dv = - \int\limits_D \nabla \cdot \left( \rho \,\textbf {U} \right)\;g\;z\;\;dv + \int\limits_D g\, \rho \; \partial_t  z  \;dv \end{subequations} where $\nabla_h = \left. \nabla \right|_k$ is the gradient along the $s$-surfaces. blah blah.... $\$\newline    % force a new ligne The prognostic ocean dynamics equation can be summarized as follows: $\text{NXT} = \dbinom {\text{VOR} + \text{KEG} + \text {ZAD} } {\text{COR} + \text{ADV} } + \text{HPG} + \text{SPG} + \text{LDF} + \text{ZDF}$ $\$\newline    % force a new ligne Vector invariant form: \begin{subequations} \label{eq:E_tot_vect} \label{eq:E_tot_vect_vor_2} \int\limits_D   \textbf{U}_h \cdot \text{VOR} \;dv   = 0   \\ \label{eq:E_tot_vect_adv_2} \int\limits_D  \textbf{U}_h \cdot \text{KEG}  \;dv + \int\limits_D  \textbf{U}_h \cdot \text{ZAD}  \;dv -  \int\limits_D { \frac{{\textbf{U}_h}^2}{2} \frac{1}{e_3} \partial_t e_3 \;dv }   = 0   \\ \label{eq:E_tot_pg_2} - \int\limits_D  \textbf{U}_h \cdot (\text{HPG}+ \text{SPG}) \;dv = - \int\limits_D \nabla \cdot \left( \rho \,\textbf {U} \right)\;g\;z\;\;dv + \int\limits_D g\, \rho \; \partial_t z  \;dv   \\ \end{subequations} Flux form: \begin{subequations} \label{eq:E_tot_flux} \label{eq:E_tot_flux_metric_2} \int\limits_D  \textbf{U}_h \cdot \text {COR} \;  dv   = 0   \\ \label{eq:E_tot_flux_adv_2} \int\limits_D \textbf{U}_h \cdot \text{ADV}   \;dv +   \frac{1}{2} \int\limits_D {  {\textbf{U}_h}^2 \frac{1}{e_3} \partial_t e_3  \;dv } =\;0  \\ \label{eq:E_tot_pg_3} - \int\limits_D  \textbf{U}_h \cdot (\text{HPG}+ \text{SPG}) \;dv = - \int\limits_D \nabla \cdot \left( \rho \,\textbf {U} \right)\;g\;z\;\;dv + \int\limits_D g\, \rho \; \partial_t  z  \;dv   \\ \end{subequations} $\$\newline    % force a new ligne \autoref{eq:E_tot_pg_3} is the balance between the conversion KE to PE and PE to KE. Indeed the left hand side of \autoref{eq:E_tot_pg_3} can be transformed as follows: \begin{flalign*} \partial_t  \left( \int\limits_D { \rho \, g \, z  \;dv} \right) &= + \int\limits_D \frac{1}{e_3} \partial_t (e_3\,\rho) \;g\;z\;\;dv +  \int\limits_D g\, \rho \; \partial_t z  \;dv   &&&\\ &= - \int\limits_D \nabla \cdot \left( \rho \,\textbf {U} \right)\;g\;z\;\;dv + \int\limits_D g\, \rho \; \partial_t z \;dv   &&&\\ &= + \int\limits_D  \rho \,g \left( \textbf {U}_h \cdot \nabla_h z + \omega \frac{1}{e_3} \partial_k z \right)  \;dv + \int\limits_D g\, \rho \; \partial_t z \;dv   &&&\\ &= + \int\limits_D  \rho \,g \left( \omega + \partial_t z + \textbf {U}_h \cdot \nabla_h z  \right)  \;dv  &&&\\ &=+  \int\limits_D g\, \rho \; w \; dv   &&&\\ \partial_t  \left( \int\limits_D { \rho \, g \, z  \;dv} \right) &= + \int\limits_D \frac{1}{e_3} \partial_t (e_3\,\rho) \;g\;z\;\;dv +  \int\limits_D g\, \rho \; \partial_t z  \;dv   &&&\\ &= - \int\limits_D \nabla \cdot \left( \rho \,\textbf {U} \right)\;g\;z\;\;dv + \int\limits_D g\, \rho \; \partial_t z \;dv   &&&\\ &= + \int\limits_D  \rho \,g \left( \textbf {U}_h \cdot \nabla_h z + \omega \frac{1}{e_3} \partial_k z \right)  \;dv + \int\limits_D g\, \rho \; \partial_t z \;dv   &&&\\ &= + \int\limits_D  \rho \,g \left( \omega + \partial_t z + \textbf {U}_h \cdot \nabla_h z  \right)  \;dv  &&&\\ &=+  \int\limits_D g\, \rho \; w \; dv   &&&\\ \end{flalign*} where the last equality is obtained by noting that the brackets is exactly the expression of $w$, The left hand side of \autoref{eq:E_tot_pg_3} can be transformed as follows: \begin{flalign*} - \int\limits_D  \left. \nabla p \right|_z & \cdot \textbf{U}_h \;dv = - \int\limits_D  \left( \nabla_h p + \rho \, g \nabla_h z \right) \cdot \textbf{U}_h \;dv   &&&\\ \allowdisplaybreaks &= - \int\limits_D  \nabla_h  p \cdot \textbf{U}_h \;dv   - \int\limits_D  \rho \, g \, \nabla_h z \cdot \textbf{U}_h \;dv   &&&\\ \allowdisplaybreaks &= +\int\limits_D p \,\nabla_h \cdot \textbf{U}_h \;dv   + \int\limits_D  \rho \, g \left( \omega - w + \partial_t z \right) \;dv   &&&\\ \allowdisplaybreaks &= -\int\limits_D p \left( \frac{1}{e_3} \partial_t e_3 + \frac{1}{e_3} \partial_k \omega  \right) \;dv +\int\limits_D  \rho \, g \left( \omega - w + \partial_t z \right) \;dv   &&&\\ \allowdisplaybreaks &= -\int\limits_D \frac{p}{e_3} \partial_t e_3  \;dv +\int\limits_D \frac{1}{e_3} \partial_k p\; \omega \;dv +\int\limits_D  \rho \, g \left( \omega - w + \partial_t z \right) \;dv   &&&\\ &= -\int\limits_D \frac{p}{e_3} \partial_t e_3  \;dv -\int\limits_D \rho \, g \, \omega \;dv +\int\limits_D  \rho \, g \left( \omega - w + \partial_t z \right) \;dv   &&&\\ &= - \int\limits_D \frac{p}{e_3} \partial_t e_3 \; \;dv - \int\limits_D  \rho \, g \, w \;dv + \int\limits_D   \rho \, g \, \partial_t z \;dv   &&&\\ \allowdisplaybreaks \intertext{introducing the hydrostatic balance $\partial_k p=-\rho \,g\,e_3$ in the last term, it becomes:} &= - \int\limits_D \frac{p}{e_3} \partial_t e_3 \;dv - \int\limits_D  \rho \, g \, w \;dv - \int\limits_D  \frac{1}{e_3} \partial_k p\, \partial_t z \;dv   &&&\\ &= - \int\limits_D \frac{p}{e_3} \partial_t e_3 \;dv - \int\limits_D  \rho \, g \, w \;dv + \int\limits_D \,\frac{p}{e_3}\partial_t ( \partial_k z )  dv   &&&\\ % &= - \int\limits_D  \rho \, g \, w \;dv   &&&\\ \end{flalign*} - \int\limits_D  \left. \nabla p \right|_z & \cdot \textbf{U}_h \;dv = - \int\limits_D  \left( \nabla_h p + \rho \, g \nabla_h z \right) \cdot \textbf{U}_h \;dv   &&&\\ \allowdisplaybreaks &= - \int\limits_D  \nabla_h  p \cdot \textbf{U}_h \;dv   - \int\limits_D  \rho \, g \, \nabla_h z \cdot \textbf{U}_h \;dv   &&&\\ \allowdisplaybreaks &= +\int\limits_D p \,\nabla_h \cdot \textbf{U}_h \;dv   + \int\limits_D  \rho \, g \left( \omega - w + \partial_t z \right) \;dv   &&&\\ \allowdisplaybreaks &= -\int\limits_D p \left( \frac{1}{e_3} \partial_t e_3 + \frac{1}{e_3} \partial_k \omega  \right) \;dv +\int\limits_D  \rho \, g \left( \omega - w + \partial_t z \right) \;dv   &&&\\ \allowdisplaybreaks &= -\int\limits_D \frac{p}{e_3} \partial_t e_3  \;dv +\int\limits_D \frac{1}{e_3} \partial_k p\; \omega \;dv +\int\limits_D  \rho \, g \left( \omega - w + \partial_t z \right) \;dv   &&&\\ &= -\int\limits_D \frac{p}{e_3} \partial_t e_3  \;dv -\int\limits_D \rho \, g \, \omega \;dv +\int\limits_D  \rho \, g \left( \omega - w + \partial_t z \right) \;dv   &&&\\ &= - \int\limits_D \frac{p}{e_3} \partial_t e_3 \; \;dv - \int\limits_D  \rho \, g \, w \;dv + \int\limits_D   \rho \, g \, \partial_t z \;dv   &&&\\ \allowdisplaybreaks \intertext{introducing the hydrostatic balance $\partial_k p=-\rho \,g\,e_3$ in the last term, it becomes:} &= - \int\limits_D \frac{p}{e_3} \partial_t e_3 \;dv - \int\limits_D  \rho \, g \, w \;dv - \int\limits_D  \frac{1}{e_3} \partial_k p\, \partial_t z \;dv   &&&\\ &= - \int\limits_D \frac{p}{e_3} \partial_t e_3 \;dv - \int\limits_D  \rho \, g \, w \;dv + \int\limits_D \,\frac{p}{e_3}\partial_t ( \partial_k z )  dv   &&&\\ % &= - \int\limits_D  \rho \, g \, w \;dv   &&&\\ \end{flalign*} %gm comment The last equality comes from the following equation, \begin{flalign*} \int\limits_D p \frac{1}{e_3} \frac{\partial e_3}{\partial t}\; \;dv = \int\limits_D   \rho \, g \, \frac{\partial z }{\partial t} \;dv \quad,  \\ \int\limits_D p \frac{1}{e_3} \frac{\partial e_3}{\partial t}\; \;dv = \int\limits_D   \rho \, g \, \frac{\partial z }{\partial t} \;dv \quad, \end{flalign*} that can be demonstrated as follows: \begin{flalign*} \int\limits_D   \rho \, g \, \frac{\partial z }{\partial t} \;dv &= \int\limits_D    \rho \, g \, \frac{\partial \eta}{\partial t} \;dv \int\limits_D   \rho \, g \, \frac{\partial z }{\partial t} \;dv &= \int\limits_D    \rho \, g \, \frac{\partial \eta}{\partial t} \;dv -  \int\limits_D    \rho \, g \, \frac{\partial}{\partial t} \left(  \int\limits_k^{k_s}  e_3 \;d\tilde{k} \right) \;dv   &&&\\ &= \int\limits_D    \rho \, g \, \frac{\partial \eta}{\partial t} \;dv &= \int\limits_D    \rho \, g \, \frac{\partial \eta}{\partial t} \;dv -  \int\limits_D    \rho \, g    \left(  \int\limits_k^{k_s}  \frac{\partial e_3}{\partial t} \;d\tilde{k} \right) \;dv   &&&\\ % \allowdisplaybreaks \intertext{The second term of the right hand side can be transformed by applying the integration by part rule: $\left[ a\,b \right]_{k_b}^{k_s} = \int_{k_b}^{k_s} a\,\frac{\partial b}{\partial k} \;dk + \int_{k_b}^{k_s} \frac{\partial a}{\partial k} \,b \;dk$ to the following function: $a= \int_k^{k_s} \frac{\partial e_3}{\partial t} \;d\tilde{k}$ and $b= \int_k^{k_s} \rho \, e_3 \;d\tilde{k}$ (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). This leads to:  } \end{flalign*} \begin{flalign*} &\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} =-\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 -\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 &&&\\ \allowdisplaybreaks \intertext{Noting that $\frac{\partial \eta}{\partial t} = \frac{\partial}{\partial t} \left( \int_{k_b}^{k_s} e_3 \;d\tilde{k} \right) = \int_{k_b}^{k_s} \frac{\partial e_3}{\partial t} \;d\tilde{k}$ and $p(k) = \int_k^{k_s} \rho \,g \, e_3 \;d\tilde{k}$, but also that $\frac{\partial \eta}{\partial t}$ does not depends on $k$, it comes: } & - \int\limits_{k_b}^{k_s}  \rho \, \frac{\partial \eta}{\partial t} \, e_3 \;dk = - \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 - \int\limits_{k_b}^{k_s}  \frac{\partial e_3}{\partial t} \frac{p}{g}         \;dk       &&&\\ % \allowdisplaybreaks \intertext{The second term of the right hand side can be transformed by applying the integration by part rule: $\left[ a\,b \right]_{k_b}^{k_s} = \int_{k_b}^{k_s} a\,\frac{\partial b}{\partial k} \;dk + \int_{k_b}^{k_s} \frac{\partial a}{\partial k} \,b \;dk$ to the following function: $a= \int_k^{k_s} \frac{\partial e_3}{\partial t} \;d\tilde{k}$ and $b= \int_k^{k_s} \rho \, e_3 \;d\tilde{k}$ (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). This leads to:  } \end{flalign*} \begin{flalign*} &\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} =-\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 -\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  &&&\\ \allowdisplaybreaks \intertext{Noting that $\frac{\partial \eta}{\partial t} = \frac{\partial}{\partial t} \left( \int_{k_b}^{k_s} e_3 \;d\tilde{k} \right) = \int_{k_b}^{k_s} \frac{\partial e_3}{\partial t} \;d\tilde{k}$ and $p(k) = \int_k^{k_s} \rho \,g \, e_3 \;d\tilde{k}$, but also that $\frac{\partial \eta}{\partial t}$ does not depends on $k$, it comes: } & - \int\limits_{k_b}^{k_s}  \rho \, \frac{\partial \eta}{\partial t} \, e_3 \;dk = - \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 - \int\limits_{k_b}^{k_s}  \frac{\partial e_3}{\partial t} \frac{p}{g}         \;dk       &&&\\ \end{flalign*} Mutliplying by $g$ and integrating over the $(i,j)$ domain it becomes: \begin{flalign*} \int\limits_D  \rho \, g \, \left(  \int\limits_k^{k_s}  \frac{\partial e_3}{\partial t} \;d\tilde{k} \right)    \;dv =  \int\limits_D  \rho \, g \, \frac{\partial \eta}{\partial t} dv \int\limits_D  \rho \, g \, \left(  \int\limits_k^{k_s}  \frac{\partial e_3}{\partial t} \;d\tilde{k} \right)    \;dv =  \int\limits_D  \rho \, g \, \frac{\partial \eta}{\partial t} dv - \int\limits_D  \frac{p}{e_3}\frac{\partial e_3}{\partial t}         \;dv \end{flalign*} Using this property, we therefore have: \begin{flalign*} \int\limits_D   \rho \, g \, \frac{\partial z }{\partial t} \;dv &= \int\limits_D    \rho \, g \, \frac{\partial \eta}{\partial t}   \;dv \int\limits_D   \rho \, g \, \frac{\partial z }{\partial t} \;dv &= \int\limits_D    \rho \, g \, \frac{\partial \eta}{\partial t}   \;dv - \left(  \int\limits_D  \rho \, g \, \frac{\partial \eta}{\partial t} dv - \int\limits_D  \frac{p}{e_3}\frac{\partial e_3}{\partial t}   \;dv  \right)    &&&\\ % &=\int\limits_D \frac{p}{e_3} \frac{\partial (e_3\,\rho)}{\partial t}\; \;dv - \int\limits_D  \frac{p}{e_3}\frac{\partial e_3}{\partial t}   \;dv  \right)    &&&\\ % &=\int\limits_D \frac{p}{e_3} \frac{\partial (e_3\,\rho)}{\partial t}\; \;dv \end{flalign*} % end gm comment % % ================================================================ % Discrete Total energy Conservation : vector invariant form The discrete form of the total energy conservation, \autoref{eq:Tot_Energy}, is given by: \begin{flalign*} \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_t  \biggr\} \right) &=0  \\ \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_t  \biggr\} \right) &=0 \end{flalign*} which in vector invariant forms, it leads to: \label{eq:KE+PE_vect_discrete}   \begin{split} \sum\limits_{i,j,k} \biggl\{   u\,                        \partial_t u         \;b_u + v\,                        \partial_t v          \;b_v  \biggr\} + \frac{1}{2} \sum\limits_{i,j,k} \biggl\{  \frac{u^2}{e_{3u}}\partial_t e_{3u} \;b_u +  \frac{v^2}{e_{3v}}\partial_t e_{3v} \;b_v   \biggr\}      \\ = - \sum\limits_{i,j,k} \biggl\{ \frac{1}{e_{3t}}\partial_t (e_{3t} \rho) \, g \, z_t \;b_t  \biggr\} - \sum\limits_{i,j,k} \biggl\{ \rho \,g\,\partial_t (z_t) \,b_t  \biggr\} \end{split} \label{eq:KE+PE_vect_discrete} \begin{split} \sum\limits_{i,j,k} \biggl\{   u\,                        \partial_t u         \;b_u + v\,                        \partial_t v          \;b_v  \biggr\} + \frac{1}{2} \sum\limits_{i,j,k} \biggl\{  \frac{u^2}{e_{3u}}\partial_t e_{3u} \;b_u +  \frac{v^2}{e_{3v}}\partial_t e_{3v} \;b_v   \biggr\}      \\ = - \sum\limits_{i,j,k} \biggl\{ \frac{1}{e_{3t}}\partial_t (e_{3t} \rho) \, g \, z_t \;b_t  \biggr\} - \sum\limits_{i,j,k} \biggl\{ \rho \,g\,\partial_t (z_t) \,b_t  \biggr\} \end{split} Substituting the discrete expression of the time derivative of the velocity either in vector invariant, For the ENE scheme, the two components of the vorticity term are given by: $- e_3 \, q \;{\textbf{k}}\times {\textbf {U}}_h \equiv \left( {{ \begin{array} {*{20}c} + \frac{1} {e_{1u}} \; \overline {\, q \ \overline {\left( e_{1v}\,e_{3v}\,v \right)}^{\,i+1/2}} ^{\,j} \hfill \\ - \frac{1} {e_{2v}} \; \overline {\, q \ \overline {\left( e_{2u}\,e_{3u}\,u \right)}^{\,j+1/2}} ^{\,i} \hfill \\ \end{array}} } \right) - e_3 \, q \;{\textbf{k}}\times {\textbf {U}}_h \equiv \left( {{ \begin{array} {*{20}c} + \frac{1} {e_{1u}} \; \overline {\, q \ \overline {\left( e_{1v}\,e_{3v}\,v \right)}^{\,i+1/2}} ^{\,j} \hfill \\ - \frac{1} {e_{2v}} \; \overline {\, q \ \overline {\left( e_{2u}\,e_{3u}\,u \right)}^{\,j+1/2}} ^{\,i} \hfill \end{array} } } \right)$ averaged over the ocean domain can be transformed as follows: \begin{flalign*} &\int\limits_D -  \left(  e_3 \, q \;\textbf{k} \times \textbf{U}_h  \right) \cdot \textbf{U}_h  \;  dv &&  \\ & \qquad \qquad {\begin{array}{*{20}l} &\equiv \sum\limits_{i,j,k}   \biggl\{ \frac{1} {e_{1u}} \overline { \,q\ \overline{ V }^{\,i+1/2}} ^{\,j} \, u \; b_u - \frac{1} {e_{2v}}\overline { \, q\ \overline{ U }^{\,j+1/2}} ^{\,i} \, v \; b_v \; \biggr\}    \\ &\equiv  \sum\limits_{i,j,k}  \biggl\{ \overline { \,q\ \overline{ V }^{\,i+1/2}}^{\,j} \; U - \overline { \,q\ \overline{ U }^{\,j+1/2}}^{\,i} \; V  \; \biggr\}     \\ &\equiv \sum\limits_{i,j,k} q \  \biggl\{  \overline{ V }^{\,i+1/2}\; \overline{ U }^{\,j+1/2} - \overline{ U }^{\,j+1/2}\; \overline{ V }^{\,i+1/2}         \biggr\}  \quad  \equiv 0 \end{array} } &\int\limits_D -  \left(  e_3 \, q \;\textbf{k} \times \textbf{U}_h  \right) \cdot \textbf{U}_h  \;  dv &&  \\ & \qquad \qquad { \begin{array}{*{20}l} &\equiv \sum\limits_{i,j,k}   \biggl\{ \frac{1} {e_{1u}} \overline { \,q\ \overline{ V }^{\,i+1/2}} ^{\,j} \, u \; b_u - \frac{1} {e_{2v}}\overline { \, q\ \overline{ U }^{\,j+1/2}} ^{\,i} \, v \; b_v \; \biggr\}    \\ &\equiv  \sum\limits_{i,j,k}  \biggl\{ \overline { \,q\ \overline{ V }^{\,i+1/2}}^{\,j} \; U - \overline { \,q\ \overline{ U }^{\,j+1/2}}^{\,i} \; V  \; \biggr\}     \\ &\equiv \sum\limits_{i,j,k} q \  \biggl\{  \overline{ V }^{\,i+1/2}\; \overline{ U }^{\,j+1/2} - \overline{ U }^{\,j+1/2}\; \overline{ V }^{\,i+1/2}         \biggr\}  \quad  \equiv 0 \end{array} } \end{flalign*} In other words, the domain averaged kinetic energy does not change due to the vorticity term. % ------------------------------------------------------------------------------------------------------------- With the EEN scheme, the vorticity terms are represented as: \tag{\ref{eq:dynvor_een}} \left\{ {    \begin{aligned} +q\,e_3 \, v  &\equiv +\frac{1}{e_{1u} }   \sum_{\substack{i_p,\,k_p}} {^{i+1/2-i_p}_j}  \mathbb{Q}^{i_p}_{j_p}  \left( e_{1v} e_{3v} \ v  \right)^{i+i_p-1/2}_{j+j_p}   \\ - q\,e_3 \, u     &\equiv -\frac{1}{e_{2v} }    \sum_{\substack{i_p,\,k_p}} {^i_{j+1/2-j_p}}  \mathbb{Q}^{i_p}_{j_p}  \left( e_{2u} e_{3u} \ u  \right)^{i+i_p}_{j+j_p-1/2}   \\ \end{aligned}   } \right. \tag{\ref{eq:dynvor_een}} \left\{ { \begin{aligned} +q\,e_3 \, v    &\equiv +\frac{1}{e_{1u} }   \sum_{\substack{i_p,\,k_p}} {^{i+1/2-i_p}_j}  \mathbb{Q}^{i_p}_{j_p}  \left( e_{1v} e_{3v} \ v  \right)^{i+i_p-1/2}_{j+j_p}   \\ - q\,e_3 \, u     &\equiv -\frac{1}{e_{2v} }    \sum_{\substack{i_p,\,k_p}} {^i_{j+1/2-j_p}}  \mathbb{Q}^{i_p}_{j_p}  \left( e_{2u} e_{3u} \ u  \right)^{i+i_p}_{j+j_p-1/2} \end{aligned} } \right. where 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$, and the vorticity triads, ${^i_j}\mathbb{Q}^{i_p}_{j_p}$, defined at $T$-point, are given by: \tag{\ref{eq:Q_triads}} _i^j \mathbb{Q}^{i_p}_{j_p} = \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) \tag{\ref{eq:Q_triads}} _i^j \mathbb{Q}^{i_p}_{j_p} = \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) Indeed, \begin{flalign*} &\int\limits_D - \textbf{U}_h \cdot   \left(  \zeta \;\textbf{k} \times \textbf{U}_h  \right)  \;  dv &&  \\ \equiv \sum\limits_{i,j,k} &  \biggl\{ \left[  \sum_{\substack{i_p,\,k_p}} {^{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}    %   &&\\ - \left[  \sum_{\substack{i_p,\,k_p}} {^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\}     && \\ \\ \equiv \sum\limits_{i,j,k} &  \sum_{\substack{i_p,\,k_p}} \biggl\{  \ \ {^{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}     %  &&\\ - {^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\}     &&  \\ % \allowdisplaybreaks \intertext{ Expending the summation on $i_p$ and $k_p$, it becomes:} % \equiv \sum\limits_{i,j,k} & \biggl\{  \ \ {^{i+1}_j     }\mathbb{Q}^{-1/2}_{+1/2} \;V^{i+1}_{j+1/2} \; U^{\,i+1/2}_{j} -  {^i_{j}\quad}\mathbb{Q}^{-1/2}_{+1/2} \; U^{i-1/2}_{j}    \; V^{\,i}_{j+1/2}         &&  \\ &       + {^{i+1}_j     }\mathbb{Q}^{-1/2}_{-1/2} \; V^{i+1}_{j-1/2} \; U^{\,i+1/2}_{j} - {^i_{j+1}     }\mathbb{Q}^{-1/2}_{-1/2} \; U^{i-1/2}_{j+1} \; V^{\,i}_{j+1/2}        \biggr.     &&  \\ &       + {^{i}_j\quad}\mathbb{Q}^{+1/2}_{+1/2} \; V^{i}_{j+1/2}   \; U^{\,i+1/2}_{j} - {^i_{j}\quad}\mathbb{Q}^{+1/2}_{+1/2} \; U^{i+1/2}_{j}   \; V^{\,i}_{j+1/2}          \biggr.        &&  \\ &       + {^{i}_j\quad}\mathbb{Q}^{+1/2}_{-1/2} \; V^{i}_{j-1/2}     \; U^{\,i+1/2}_{j} -  {^i_{j+1}     }\mathbb{Q}^{+1/2}_{-1/2} \; U^{i+1/2}_{j+1}\; V^{\,i}_{j+1/2}  \ \;     \biggr\}     &&  \\ % \allowdisplaybreaks \intertext{The summation is done over all $i$ and $j$ indices, it is therefore possible to introduce a shift of $-1$ either in $i$ or $j$ direction in some of the term of the summation (first term of the first and second lines, second term of the second and fourth lines). By doning so, we can regroup all the terms of the summation by triad at a ($i$,$j$) point. In other words, we regroup all the terms in the neighbourhood  that contain a triad at the same ($i$,$j$) indices. It becomes: } \allowdisplaybreaks % \equiv \sum\limits_{i,j,k} & \biggl\{  \ \ {^{i}_j}\mathbb{Q}^{-1/2}_{+1/2}  \left[  V^{i}_{j+1/2}\, U^{\,i-1/2}_{j} -  U^{i-1/2}_{j} \, V^{\,i}_{j+1/2}      \right]    &&  \\ &       + {^{i}_j}\mathbb{Q}^{-1/2}_{-1/2}  \left[  V^{i}_{j-1/2} \, U^{\,i-1/2}_{j} -    U^{i-1/2}_{j} \, V^{\,i}_{j-1/2}      \right]    \biggr.   &&  \\ &      + {^{i}_j}\mathbb{Q}^{+1/2}_{+1/2}  \left[  V^{i}_{j+1/2} \, U^{\,i+1/2}_{j} -    U^{i+1/2}_{j} \, V^{\,i}_{j+1/2}     \right]  \biggr.  &&  \\ &     + {^{i}_j}\mathbb{Q}^{+1/2}_{-1/2}  \left[   V^{i}_{j-1/2} \, U^{\,i+1/2}_{j} -    U^{i+1/2}_{j-1} \, V^{\,i}_{j-1/2}  \right]  \ \;   \biggr\}   \qquad \equiv \ 0   && \end{flalign*} &\int\limits_D - \textbf{U}_h \cdot   \left(  \zeta \;\textbf{k} \times \textbf{U}_h  \right)  \;  dv &&  \\ \equiv \sum\limits_{i,j,k} &   \biggl\{ \left[  \sum_{\substack{i_p,\,k_p}} {^{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}    %   &&\\ - \left[  \sum_{\substack{i_p,\,k_p}} {^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\}     && \\ \\ \equiv \sum\limits_{i,j,k} &  \sum_{\substack{i_p,\,k_p}} \biggl\{  \ \ {^{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}     %  &&\\ - {^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\}     &&  \\ % \allowdisplaybreaks \intertext{ Expending the summation on $i_p$ and $k_p$, it becomes:} % \equiv \sum\limits_{i,j,k} & \biggl\{  \ \ {^{i+1}_j     }\mathbb{Q}^{-1/2}_{+1/2} \;V^{i+1}_{j+1/2} \; U^{\,i+1/2}_{j} -  {^i_{j}\quad}\mathbb{Q}^{-1/2}_{+1/2} \; U^{i-1/2}_{j}    \; V^{\,i}_{j+1/2}         &&  \\ &       + {^{i+1}_j     }\mathbb{Q}^{-1/2}_{-1/2} \; V^{i+1}_{j-1/2} \; U^{\,i+1/2}_{j} - {^i_{j+1}     }\mathbb{Q}^{-1/2}_{-1/2} \; U^{i-1/2}_{j+1} \; V^{\,i}_{j+1/2}        \biggr.     &&  \\ &       + {^{i}_j\quad}\mathbb{Q}^{+1/2}_{+1/2} \; V^{i}_{j+1/2}   \; U^{\,i+1/2}_{j} - {^i_{j}\quad}\mathbb{Q}^{+1/2}_{+1/2} \; U^{i+1/2}_{j}   \; V^{\,i}_{j+1/2}          \biggr.        &&  \\ &       + {^{i}_j\quad}\mathbb{Q}^{+1/2}_{-1/2} \; V^{i}_{j-1/2}     \; U^{\,i+1/2}_{j} -  {^i_{j+1}     }\mathbb{Q}^{+1/2}_{-1/2} \; U^{i+1/2}_{j+1}\; V^{\,i}_{j+1/2}  \ \;     \biggr\}     &&  \\ % \allowdisplaybreaks \intertext{The summation is done over all $i$ and $j$ indices, it is therefore possible to introduce a shift of $-1$ either in $i$ or $j$ direction in some of the term of the summation (first term of the first and second lines, second term of the second and fourth lines). By doning so, we can regroup all the terms of the summation by triad at a ($i$,$j$) point. In other words, we regroup all the terms in the neighbourhood  that contain a triad at the same ($i$,$j$) indices. It becomes: } \allowdisplaybreaks % \equiv \sum\limits_{i,j,k} & \biggl\{  \ \ {^{i}_j}\mathbb{Q}^{-1/2}_{+1/2}  \left[  V^{i}_{j+1/2}\, U^{\,i-1/2}_{j} -  U^{i-1/2}_{j} \, V^{\,i}_{j+1/2}      \right]    &&  \\ &       + {^{i}_j}\mathbb{Q}^{-1/2}_{-1/2}  \left[  V^{i}_{j-1/2} \, U^{\,i-1/2}_{j} -    U^{i-1/2}_{j} \, V^{\,i}_{j-1/2}      \right]    \biggr.   &&  \\ &      + {^{i}_j}\mathbb{Q}^{+1/2}_{+1/2}  \left[  V^{i}_{j+1/2} \, U^{\,i+1/2}_{j} -    U^{i+1/2}_{j} \, V^{\,i}_{j+1/2}     \right]  \biggr.  &&  \\ &     + {^{i}_j}\mathbb{Q}^{+1/2}_{-1/2}  \left[   V^{i}_{j-1/2} \, U^{\,i+1/2}_{j} -    U^{i+1/2}_{j-1} \, V^{\,i}_{j-1/2}  \right]  \ \;   \biggr\}   \qquad \equiv \ 0   && \end{flalign*} % ------------------------------------------------------------------------------------------------------------- The 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~: $\int_D \textbf{U}_h \cdot \frac{1}{e_3 } \omega \partial_k \textbf{U}_h \;dv = - \int_D \textbf{U}_h \cdot \nabla_h \left( \frac{1}{2}\;{\textbf{U}_h}^2 \right)\;dv + \frac{1}{2} \int_D { \frac{{\textbf{U}_h}^2}{e_3} \partial_t ( e_3) \;dv } \\ \int_D \textbf{U}_h \cdot \frac{1}{e_3 } \omega \partial_k \textbf{U}_h \;dv = - \int_D \textbf{U}_h \cdot \nabla_h \left( \frac{1}{2}\;{\textbf{U}_h}^2 \right)\;dv + \frac{1}{2} \int_D { \frac{{\textbf{U}_h}^2}{e_3} \partial_t ( e_3) \;dv }$ Indeed, using successively \autoref{eq:DOM_di_adj} ($i.e.$ the skew symmetry property of the $\delta$ operator) applied in the horizontal and vertical directions, it becomes: \begin{flalign*} & - \int_D \textbf{U}_h \cdot \text{KEG}\;dv = - \int_D \textbf{U}_h \cdot \nabla_h \left( \frac{1}{2}\;{\textbf{U}_h}^2 \right)\;dv    &&&\\ % \equiv  & -  \sum\limits_{i,j,k} \frac{1}{2}  \biggl\{ \frac{1} {e_{1u}}  \delta_{i+1/2}   \left[   \overline {u^2}^{\,i} + \overline {v^2}^{\,j}   \right]  u \ b_u + \frac{1} {e_{2v}}  \delta_{j+1/2}   \left[   \overline {u^2}^{\,i} + \overline {v^2}^{\,j}   \right]  v \ b_v   \biggr\}     &&&  \\ % \equiv & + \sum\limits_{i,j,k} \frac{1}{2}  \left(   \overline {u^2}^{\,i} + \overline {v^2}^{\,j}   \right)\; \biggl\{ \delta_{i} \left[  U   \right] +  \delta_{j} \left[  V  \right]    \biggr\}       &&&  \\ \allowdisplaybreaks % \equiv   & - \sum\limits_{i,j,k}  \frac{1}{2} \left(       \overline {u^2}^{\,i} + \overline {v^2}^{\,j}   \right)  \; \biggl\{   \frac{b_t}{e_{3t}} \partial_t (e_{3t})  +  \delta_k \left[  W   \right]    \biggr\}    &&&\\ \allowdisplaybreaks % \equiv & +  \sum\limits_{i,j,k} \frac{1}{2} \delta_{k+1/2}   \left[ \overline{ u^2}^{\,i} + \overline{ v^2}^{\,j}   \right] \;  W -  \sum\limits_{i,j,k} \frac{1}{2} \left(   \overline {u^2}^{\,i} + \overline {v^2}^{\,j}   \right) \;\partial_t b_t   &&& \\ \allowdisplaybreaks % \equiv   & + \sum\limits_{i,j,k} \frac{1} {2} \left(    \overline{\delta_{k+1/2} \left[ u^2 \right]}^{\,i} + \overline{\delta_{k+1/2} \left[ v^2 \right]}^{\,j}    \right) \; W -  \sum\limits_{i,j,k}  \left(  \frac{u^2}{2}\,\partial_t \overline{b_t}^{\,{i+1/2}} + \frac{v^2}{2}\,\partial_t \overline{b_t}^{\,{j+1/2}}   \right)    &&& \\ \allowdisplaybreaks \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 derivative of these two equations is satisfied, it becomes:} % \equiv &     \sum\limits_{i,j,k} \frac{1} {2} \biggl\{ \; \overline{W}^{\,i+1/2}\;\delta_{k+1/2} \left[ u^2 \right] + \overline{W}^{\,j+1/2}\;\delta_{k+1/2} \left[ v^2 \right]  \;  \biggr\} -  \sum\limits_{i,j,k}  \left(  \frac{u^2}{2}\,\partial_t b_u + \frac{v^2}{2}\,\partial_t b_v   \right)    &&& \\ \allowdisplaybreaks % \equiv &     \sum\limits_{i,j,k} \biggl\{ \; \overline{W}^{\,i+1/2}\; \overline {u}^{\,k+1/2}\; \delta_{k+1/2}[ u ] + \overline{W}^{\,j+1/2}\; \overline {v}^{\,k+1/2}\; \delta_{k+1/2}[ v ]  \;  \biggr\} -  \sum\limits_{i,j,k}  \left(  \frac{u^2}{2}\,\partial_t b_u + \frac{v^2}{2}\,\partial_t b_v   \right)    &&& \\ % \allowdisplaybreaks \equiv  &  \sum\limits_{i,j,k} \biggl\{ \; \frac{1} {b_u } \; \overline { \overline{W}^{\,i+1/2}\,\delta_{k+1/2}  \left[ u \right] }^{\,k} \;u\;b_u + \frac{1} {b_v } \; \overline { \overline{W}^{\,j+1/2} \delta_{k+1/2}  \left[ v \right]  }^{\,k} \;v\;b_v  \; \biggr\} -  \sum\limits_{i,j,k}  \left(  \frac{u^2}{2}\,\partial_t b_u + \frac{v^2}{2}\,\partial_t b_v   \right)    &&& \\ % \intertext{The first term provides the discrete expression for the vertical advection of momentum (ZAD), while the second term corresponds exactly to \autoref{eq:KE+PE_vect_discrete}, therefore:} \equiv&                   \int\limits_D \textbf{U}_h \cdot \text{ZAD} \;dv + \frac{1}{2} \int_D { {\textbf{U}_h}^2 \frac{1}{e_3} \partial_t  (e_3)  \;dv }    &&&\\ \equiv&                   \int\limits_D \textbf{U}_h \cdot w \partial_k \textbf{U}_h \;dv + \frac{1}{2} \int_D { {\textbf{U}_h}^2 \frac{1}{e_3} \partial_t  (e_3)  \;dv }    &&&\\ & - \int_D \textbf{U}_h \cdot \text{KEG}\;dv = - \int_D \textbf{U}_h \cdot \nabla_h \left( \frac{1}{2}\;{\textbf{U}_h}^2 \right)\;dv    &&&\\ % \equiv  & -  \sum\limits_{i,j,k} \frac{1}{2}  \biggl\{ \frac{1} {e_{1u}}  \delta_{i+1/2}   \left[   \overline {u^2}^{\,i} + \overline {v^2}^{\,j}   \right]  u \ b_u + \frac{1} {e_{2v}}  \delta_{j+1/2}   \left[   \overline {u^2}^{\,i} + \overline {v^2}^{\,j}   \right]  v \ b_v   \biggr\}     &&&  \\ % \equiv & + \sum\limits_{i,j,k} \frac{1}{2}  \left(   \overline {u^2}^{\,i} + \overline {v^2}^{\,j}   \right)\; \biggl\{ \delta_{i} \left[  U   \right] +  \delta_{j} \left[  V  \right]    \biggr\}       &&&  \\ \allowdisplaybreaks % \equiv   & - \sum\limits_{i,j,k}  \frac{1}{2} \left(       \overline {u^2}^{\,i} + \overline {v^2}^{\,j}   \right)  \; \biggl\{   \frac{b_t}{e_{3t}} \partial_t (e_{3t})  +  \delta_k \left[  W   \right]    \biggr\}    &&&\\ \allowdisplaybreaks % \equiv & +  \sum\limits_{i,j,k} \frac{1}{2} \delta_{k+1/2}   \left[ \overline{ u^2}^{\,i} + \overline{ v^2}^{\,j}   \right] \;  W -  \sum\limits_{i,j,k} \frac{1}{2} \left(   \overline {u^2}^{\,i} + \overline {v^2}^{\,j}   \right) \;\partial_t b_t   &&& \\ \allowdisplaybreaks % \equiv   & + \sum\limits_{i,j,k} \frac{1} {2} \left(    \overline{\delta_{k+1/2} \left[ u^2 \right]}^{\,i} + \overline{\delta_{k+1/2} \left[ v^2 \right]}^{\,j}    \right) \; W -  \sum\limits_{i,j,k}  \left(  \frac{u^2}{2}\,\partial_t \overline{b_t}^{\,{i+1/2}} + \frac{v^2}{2}\,\partial_t \overline{b_t}^{\,{j+1/2}}   \right)    &&& \\ \allowdisplaybreaks \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 derivative of these two equations is satisfied, it becomes:} % \equiv &     \sum\limits_{i,j,k} \frac{1} {2} \biggl\{ \; \overline{W}^{\,i+1/2}\;\delta_{k+1/2} \left[ u^2 \right] + \overline{W}^{\,j+1/2}\;\delta_{k+1/2} \left[ v^2 \right]  \;  \biggr\} -  \sum\limits_{i,j,k}  \left(  \frac{u^2}{2}\,\partial_t b_u + \frac{v^2}{2}\,\partial_t b_v   \right)    &&& \\ \allowdisplaybreaks % \equiv &     \sum\limits_{i,j,k} \biggl\{ \; \overline{W}^{\,i+1/2}\; \overline {u}^{\,k+1/2}\; \delta_{k+1/2}[ u ] + \overline{W}^{\,j+1/2}\; \overline {v}^{\,k+1/2}\; \delta_{k+1/2}[ v ]  \;  \biggr\} -  \sum\limits_{i,j,k}  \left(  \frac{u^2}{2}\,\partial_t b_u + \frac{v^2}{2}\,\partial_t b_v   \right)    &&& \\ % \allowdisplaybreaks \equiv  &  \sum\limits_{i,j,k} \biggl\{ \; \frac{1} {b_u } \; \overline { \overline{W}^{\,i+1/2}\,\delta_{k+1/2}  \left[ u \right] }^{\,k} \;u\;b_u + \frac{1} {b_v } \; \overline { \overline{W}^{\,j+1/2} \delta_{k+1/2}  \left[ v \right]  }^{\,k} \;v\;b_v  \; \biggr\} -  \sum\limits_{i,j,k}  \left(  \frac{u^2}{2}\,\partial_t b_u + \frac{v^2}{2}\,\partial_t b_v   \right)    &&& \\ % \intertext{The first term provides the discrete expression for the vertical advection of momentum (ZAD), while the second term corresponds exactly to \autoref{eq:KE+PE_vect_discrete}, therefore:} \equiv&                   \int\limits_D \textbf{U}_h \cdot \text{ZAD} \;dv + \frac{1}{2} \int_D { {\textbf{U}_h}^2 \frac{1}{e_3} \partial_t  (e_3)  \;dv }    &&&\\ \equiv&                   \int\limits_D \textbf{U}_h \cdot w \partial_k \textbf{U}_h \;dv + \frac{1}{2} \int_D { {\textbf{U}_h}^2 \frac{1}{e_3} \partial_t  (e_3)  \;dv }    &&&\\ \end{flalign*} This leads to the following expression for the vertical advection: $\frac{1} {e_3 }\; \omega\; \partial_k \textbf{U}_h \equiv \left( {{\begin{array} {*{20}c} \frac{1} {e_{1u}\,e_{2u}\,e_{3u}} \; \overline{\overline {e_{1t}\,e_{2t} \,\omega\;\delta_{k+1/2} \left[ \overline u^{\,i+1/2} \right]}}^{\,i+1/2,k} \hfill \\ \frac{1} {e_{1v}\,e_{2v}\,e_{3v}} \; \overline{\overline {e_{1t}\,e_{2t} \,\omega \;\delta_{k+1/2} \left[ \overline v^{\,j+1/2} \right]}}^{\,j+1/2,k} \hfill \\ \end{array}} } \right) \frac{1} {e_3 }\; \omega\; \partial_k \textbf{U}_h \equiv \left( {{ \begin{array} {*{20}c} \frac{1} {e_{1u}\,e_{2u}\,e_{3u}} \; \overline{\overline {e_{1t}\,e_{2t} \,\omega\;\delta_{k+1/2} \left[ \overline u^{\,i+1/2} \right]}}^{\,i+1/2,k} \hfill \\ \frac{1} {e_{1v}\,e_{2v}\,e_{3v}} \; \overline{\overline {e_{1t}\,e_{2t} \,\omega \;\delta_{k+1/2} \left[ \overline v^{\,j+1/2} \right]}}^{\,j+1/2,k} \hfill \end{array} } } \right)$ a formulation that requires an additional horizontal mean in contrast with the one used in NEMO. an extra constraint arises on the time derivative of the volume at $u$- and $v$-points: \begin{flalign*} e_{1u}\,e_{2u}\,\partial_t (e_{3u}) =\overline{ e_{1t}\,e_{2t}\;\partial_t (e_{3t}) }^{\,i+1/2}    \\ e_{1v}\,e_{2v}\,\partial_t (e_{3v})  =\overline{ e_{1t}\,e_{2t}\;\partial_t (e_{3t}) }^{\,j+1/2} e_{1u}\,e_{2u}\,\partial_t (e_{3u}) =\overline{ e_{1t}\,e_{2t}\;\partial_t (e_{3t}) }^{\,i+1/2}    \\ e_{1v}\,e_{2v}\,\partial_t (e_{3v})  =\overline{ e_{1t}\,e_{2t}\;\partial_t (e_{3t}) }^{\,j+1/2} \end{flalign*} which is (over-)satified by defining the vertical scale factor as follows: \begin{flalign} \label{eq:e3u-e3v} e_{3u} = \frac{1}{e_{1u}\,e_{2u}}\;\overline{ e_{1t}^{ }\,e_{2t}^{ }\,e_{3t}^{ } }^{\,i+1/2}    \\ e_{3v} = \frac{1}{e_{1v}\,e_{2v}}\;\overline{ e_{1t}^{ }\,e_{2t}^{ }\,e_{3t}^{ } }^{\,j+1/2} \end{flalign} \begin{flalign*} % \label{eq:e3u-e3v} e_{3u} = \frac{1}{e_{1u}\,e_{2u}}\;\overline{ e_{1t}^{ }\,e_{2t}^{ }\,e_{3t}^{ } }^{\,i+1/2}    \\ e_{3v} = \frac{1}{e_{1v}\,e_{2v}}\;\overline{ e_{1t}^{ }\,e_{2t}^{ }\,e_{3t}^{ } }^{\,j+1/2} \end{flalign*} Blah blah required on the the step representation of bottom topography..... the change of potential energy due to buoyancy forces: $- \int_D \left. \nabla p \right|_z \cdot \textbf{U}_h \;dv = - \int_D \nabla \cdot \left( \rho \,\textbf {U} \right) \,g\,z \;dv - \int_D \left. \nabla p \right|_z \cdot \textbf{U}_h \;dv = - \int_D \nabla \cdot \left( \rho \,\textbf {U} \right) \,g\,z \;dv + \int_D g\, \rho \; \partial_t (z) \;dv$ the work of pressure forces can be written as: \begin{flalign*} &- \int_D  \left. \nabla p \right|_z \cdot \textbf{U}_h \;dv \equiv \sum\limits_{i,j,k} \biggl\{ \;  - \frac{1} {e_{1u}}   \Bigl( \delta_{i+1/2} [p_t] - g\;\overline \rho^{\,i+1/2}\;\delta_{i+1/2} [z_t]     \Bigr)  \; u\;b_u &&  \\ & \qquad \qquad  \qquad \qquad  \qquad \quad \ \, - \frac{1} {e_{2v}}    \Bigl( \delta_{j+1/2} [p_t] - g\;\overline \rho^{\,j+1/2}\delta_{j+1/2} [z_t]      \Bigr)  \; v\;b_v \;  \biggr\}   && \\ % \allowdisplaybreaks \intertext{Using successively \autoref{eq:DOM_di_adj}, $i.e.$ the skew symmetry property of the $\delta$ operator, \autoref{eq:wzv}, the continuity equation, \autoref{eq:dynhpg_sco}, the hydrostatic equation in the $s$-coordinate, and $\delta_{k+1/2} \left[ z_t \right] \equiv e_{3w}$, which comes from the definition of $z_t$, it becomes: } \allowdisplaybreaks % \equiv& +  \sum\limits_{i,j,k}   g  \biggl\{ \overline\rho^{\,i+1/2}\,U\,\delta_{i+1/2}[z_t] +     \overline\rho^{\,j+1/2}\,V\,\delta_{j+1/2}[z_t] +\Bigl(  \delta_i[U] + \delta_j [V]  \Bigr)\;\frac{p_t}{g} \biggr\}  &&\\ % \equiv& +  \sum\limits_{i,j,k}   g   \biggl\{ \overline\rho^{\,i+1/2}\,U\,\delta_{i+1/2}[z_t] +     \overline\rho^{\,j+1/2}\,V\,\delta_{j+1/2}[z_t] -       \left(   \frac{b_t}{e_{3t}} \partial_t (e_{3t})  +  \delta_k \left[ W \right]    \right) \frac{p_t}{g}    \biggr\}   &&&\\ % \equiv& +  \sum\limits_{i,j,k}  g   \biggl\{ \overline\rho^{\,i+1/2}\,U\,\delta_{i+1/2}[z_t] +     \overline\rho^{\,j+1/2}\,V\,\delta_{j+1/2}[z_t] +  \frac{W}{g}\;\delta_{k+1/2} [p_t] -        \frac{p_t}{g}\,\partial_t b_t    \biggr\}    &&&\\ % \equiv& +  \sum\limits_{i,j,k}  g   \biggl\{ \overline\rho^{\,i+1/2}\,U\,\delta_{i+1/2}[z_t] +     \overline\rho^{\,j+1/2}\,V\,\delta_{j+1/2}[z_t] -  W\;e_{3w} \overline \rho^{\,k+1/2} -        \frac{p_t}{g}\,\partial_t b_t    \biggr\}    &&&\\ % \equiv& +  \sum\limits_{i,j,k}    g   \biggl\{ \overline\rho^{\,i+1/2}\,U\,\delta_{i+1/2}[z_t] +     \overline\rho^{\,j+1/2}\,V\,\delta_{j+1/2}[z_t] +  W\; \overline \rho^{\,k+1/2}\;\delta_{k+1/2} [z_t] -        \frac{p_t}{g}\,\partial_t b_t    \biggr\}    &&&\\ % \allowdisplaybreaks % \equiv& - \sum\limits_{i,j,k}   g \; z_t      \biggl\{ \delta_i    \left[ U\;  \overline \rho^{\,i+1/2}   \right] +  \delta_j    \left[ V\;  \overline \rho^{\,j+1/2}   \right] +  \delta_k    \left[ W\;  \overline \rho^{\,k+1/2}   \right]       \biggr\} - \sum\limits_{i,j,k}       \biggl\{ p_t\;\partial_t b_t    \biggr\}   &&&\\ % \equiv& + \sum\limits_{i,j,k}   g \; z_t    \biggl\{      \partial_t ( e_{3t} \,\rho)    \biggr\}  \; b_t -  \sum\limits_{i,j,k}                 \biggl\{  p_t\;\partial_t b_t                     \biggr\}              &&&\\ % &- \int_D  \left. \nabla p \right|_z \cdot \textbf{U}_h \;dv \equiv \sum\limits_{i,j,k} \biggl\{ \;  - \frac{1} {e_{1u}}   \Bigl( \delta_{i+1/2} [p_t] - g\;\overline \rho^{\,i+1/2}\;\delta_{i+1/2} [z_t]     \Bigr)  \; u\;b_u && \\ & \qquad \qquad  \qquad \qquad  \qquad \quad \ \, - \frac{1} {e_{2v}}    \Bigl( \delta_{j+1/2} [p_t] - g\;\overline \rho^{\,j+1/2}\delta_{j+1/2} [z_t]      \Bigr)  \; v\;b_v \;  \biggr\}   && \\ % \allowdisplaybreaks \intertext{Using successively \autoref{eq:DOM_di_adj}, $i.e.$ the skew symmetry property of the $\delta$ operator, \autoref{eq:wzv}, the continuity equation, \autoref{eq:dynhpg_sco}, the hydrostatic equation in the $s$-coordinate, and $\delta_{k+1/2} \left[ z_t \right] \equiv e_{3w}$, which comes from the definition of $z_t$, it becomes: } \allowdisplaybreaks % \equiv& +  \sum\limits_{i,j,k}   g  \biggl\{ \overline\rho^{\,i+1/2}\,U\,\delta_{i+1/2}[z_t] +   \overline\rho^{\,j+1/2}\,V\,\delta_{j+1/2}[z_t] +\Bigl(  \delta_i[U] + \delta_j [V]  \Bigr)\;\frac{p_t}{g} \biggr\}  &&\\ % \equiv& +  \sum\limits_{i,j,k}   g   \biggl\{ \overline\rho^{\,i+1/2}\,U\,\delta_{i+1/2}[z_t] +   \overline\rho^{\,j+1/2}\,V\,\delta_{j+1/2}[z_t] -       \left(   \frac{b_t}{e_{3t}} \partial_t (e_{3t})  +  \delta_k \left[ W \right]    \right) \frac{p_t}{g}    \biggr\}   &&&\\ % \equiv& +  \sum\limits_{i,j,k}  g   \biggl\{ \overline\rho^{\,i+1/2}\,U\,\delta_{i+1/2}[z_t] +   \overline\rho^{\,j+1/2}\,V\,\delta_{j+1/2}[z_t] +   \frac{W}{g}\;\delta_{k+1/2} [p_t] -        \frac{p_t}{g}\,\partial_t b_t    \biggr\}    &&&\\ % \equiv& +  \sum\limits_{i,j,k}  g   \biggl\{ \overline\rho^{\,i+1/2}\,U\,\delta_{i+1/2}[z_t] +   \overline\rho^{\,j+1/2}\,V\,\delta_{j+1/2}[z_t] -   W\;e_{3w} \overline \rho^{\,k+1/2} -        \frac{p_t}{g}\,\partial_t b_t    \biggr\}    &&&\\ % \equiv& +  \sum\limits_{i,j,k}    g   \biggl\{ \overline\rho^{\,i+1/2}\,U\,\delta_{i+1/2}[z_t] +   \overline\rho^{\,j+1/2}\,V\,\delta_{j+1/2}[z_t] +   W\; \overline \rho^{\,k+1/2}\;\delta_{k+1/2} [z_t] -        \frac{p_t}{g}\,\partial_t b_t    \biggr\}    &&&\\ % \allowdisplaybreaks % \equiv& - \sum\limits_{i,j,k}   g \; z_t      \biggl\{ \delta_i  \left[ U\;  \overline \rho^{\,i+1/2}   \right] +   \delta_j    \left[ V\;  \overline \rho^{\,j+1/2}   \right] +   \delta_k    \left[ W\;  \overline \rho^{\,k+1/2}   \right]       \biggr\} - \sum\limits_{i,j,k}       \biggl\{ p_t\;\partial_t b_t    \biggr\}   &&&\\ % \equiv& + \sum\limits_{i,j,k}   g \; z_t    \biggl\{      \partial_t ( e_{3t} \,\rho)    \biggr\}  \; b_t -  \sum\limits_{i,j,k}                 \biggl\{  p_t\;\partial_t b_t                     \biggr\}              &&&\\ % \end{flalign*} The first term is exactly the first term of the right-hand-side of \autoref{eq:KE+PE_vect_discrete}. In other words, the following property must be satisfied: \begin{flalign*} \sum\limits_{i,j,k}  \biggl\{  p_t\;\partial_t b_t                  \biggr\} \equiv  \sum\limits_{i,j,k}  \biggl\{ \rho \,g\,\partial_t (z_t) \,b_t  \biggr\} \sum\limits_{i,j,k}  \biggl\{  p_t\;\partial_t b_t                  \biggr\} \equiv  \sum\limits_{i,j,k}  \biggl\{ \rho \,g\,\partial_t (z_t) \,b_t  \biggr\} \end{flalign*} \begin{flalign*} \sum\limits_{i,j,k}  \biggl\{ \rho \,g\,\partial_t (z_t) \,b_t  \biggr\} &\equiv   - \sum\limits_{i,j,k}  \biggl\{ \delta_k [p_w]\,\partial_t (z_t) \,e_{1t}\,e_{2t}  \biggr\}        &&&\\ % &\equiv  + \sum\limits_{i,j,k}  \biggl\{  p_w\, \delta_{k+1/2} [\partial_t (z_t)] \,e_{1t}\,e_{2t}  \biggr\} \sum\limits_{i,j,k}  \biggl\{ \rho \,g\,\partial_t (z_t) \,b_t  \biggr\} &\equiv   - \sum\limits_{i,j,k}  \biggl\{ \delta_k [p_w]\,\partial_t (z_t) \,e_{1t}\,e_{2t}  \biggr\}        &&&\\ % &\equiv  + \sum\limits_{i,j,k}  \biggl\{  p_w\, \delta_{k+1/2} [\partial_t (z_t)] \,e_{1t}\,e_{2t}  \biggr\} \equiv  + \sum\limits_{i,j,k}  \biggl\{  p_w\, \partial_t (e_{3w}) \,e_{1t}\,e_{2t}  \biggr\}        &&&\\ &\equiv  + \sum\limits_{i,j,k}  \biggl\{  p_w\, \partial_t (b_w) \biggr\} % % & \equiv     \sum\limits_{i,j,k} \biggl\{  \frac{1}{e_{3t}} \delta_k [p_w]\;\partial_t (z_t) \,b_w   \right)   \biggr\}           &&&\\ % & \equiv     \sum\limits_{i,j,k} \biggl\{   p_w\;\partial_t \left(    \delta_k [z_t]   \right)  e_{1w}\,e_{2w}   \biggr\}           &&&\\ % & \equiv     \sum\limits_{i,j,k} \biggl\{   p_w\;\partial_t b_w   \biggr\} &\equiv  + \sum\limits_{i,j,k}  \biggl\{  p_w\, \partial_t (b_w) \biggr\} % % & \equiv     \sum\limits_{i,j,k} \biggl\{  \frac{1}{e_{3t}} \delta_k [p_w]\;\partial_t (z_t) \,b_w   \right)   \biggr\}           &&&\\ % & \equiv     \sum\limits_{i,j,k} \biggl\{   p_w\;\partial_t \left(    \delta_k [z_t]   \right)  e_{1w}\,e_{2w}   \biggr\}           &&&\\ % & \equiv     \sum\limits_{i,j,k} \biggl\{   p_w\;\partial_t b_w   \biggr\} \end{flalign*} therefore, the balance to be satisfied is: \begin{flalign*} \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\} \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\} \end{flalign*} which is a purely vertical balance: \begin{flalign*} \sum\limits_{k}  \biggl\{  p_t\;\partial_t (e_{3t}) \biggr\}  \equiv  \sum\limits_{k}  \biggl\{  p_w\, \partial_t (e_{3w}) \biggr\} \sum\limits_{k}  \biggl\{  p_t\;\partial_t (e_{3t}) \biggr\}  \equiv  \sum\limits_{k}  \biggl\{  p_w\, \partial_t (e_{3w}) \biggr\} \end{flalign*} Defining $p_w = \overline{p_t}^{\,k+1/2}$ %gm comment \gmcomment{ \begin{flalign*} \sum\limits_{i,j,k} \biggl\{   p_t\;\partial_t b_t   \biggr\}                                &&&\\ % & \equiv     \sum\limits_{i,j,k} \biggl\{  \frac{1}{e_{3t}} \delta_k [p_w]\;\partial_t (z_t) \,b_w    \biggr\}           &&&\\ & \equiv     \sum\limits_{i,j,k} \biggl\{   p_w\;\partial_t \left(    \delta_{k+1/2} [z_t]   \right)  e_{1w}\,e_{2w}   \biggr\}           &&&\\ & \equiv     \sum\limits_{i,j,k} \biggl\{   p_w\;\partial_t b_w   \biggr\} \end{flalign*} \begin{flalign*} \int\limits_D   \rho \, g \, \frac{\partial z }{\partial t} \;dv \equiv&  \sum\limits_{i,j,k}   \biggl\{  \frac{1}{e_{3t}} \frac{\partial e_{3t}}{\partial t} p   \biggr\} \; b_t   &&&\\ \equiv&  \sum\limits_{i,j,k}   \biggl\{      \biggr\} \; b_t   &&&\\ \end{flalign*} % \begin{flalign*} \equiv& - \int_D \nabla \cdot \left( \rho \,\textbf {U} \right)\;g\;z\;\;dv + \int\limits_D g\, \rho \; \frac{\partial z}{\partial t}  \;dv     &&& \\ \end{flalign*} % \begin{flalign*} \sum\limits_{i,j,k} \biggl\{   p_t\;\partial_t b_t   \biggr\}                                &&&\\ % & \equiv     \sum\limits_{i,j,k} \biggl\{  \frac{1}{e_{3t}} \delta_k [p_w]\;\partial_t (z_t) \,b_w    \biggr\}           &&&\\ & \equiv     \sum\limits_{i,j,k} \biggl\{   p_w\;\partial_t \left(    \delta_{k+1/2} [z_t]   \right)  e_{1w}\,e_{2w}   \biggr\}           &&&\\ & \equiv     \sum\limits_{i,j,k} \biggl\{   p_w\;\partial_t b_w   \biggr\} \end{flalign*} \begin{flalign*} \int\limits_D   \rho \, g \, \frac{\partial z }{\partial t} \;dv \equiv&  \sum\limits_{i,j,k}   \biggl\{  \frac{1}{e_{3t}} \frac{\partial e_{3t}}{\partial t} p   \biggr\} \; b_t   &&&\\ \equiv&  \sum\limits_{i,j,k}   \biggl\{      \biggr\} \; b_t   &&&\\ \end{flalign*} % \begin{flalign*} \equiv& - \int_D \nabla \cdot \left( \rho \,\textbf {U} \right)\;g\;z\;\;dv + \int\limits_D g\, \rho \; \frac{\partial z}{\partial t}  \;dv     &&& \\ \end{flalign*} % } %end gm comment Note that this property strongly constrains the discrete expression of both the depth of $T-$points and Nevertheless, it is almost never satisfied since a linear equation of state is rarely used. % ================================================================ % Discrete Total energy Conservation : flux form The discrete form of the total energy conservation, \autoref{eq:Tot_Energy}, is given by: \begin{flalign*} \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_t  \biggr\} \right) &=0  \\ \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_t  \biggr\} \right) &=0  \\ \end{flalign*} which in flux form, it leads to: \begin{flalign*} \sum\limits_{i,j,k} \biggl\{  \frac{u    }{e_{3u}}\,\frac{\partial (e_{3u}u)}{\partial t} \,b_u +  \frac{v    }{e_{3v}}\,\frac{\partial (e_{3v}v)}{\partial t} \,b_v  \biggr\} &  -  \frac{1}{2} \sum\limits_{i,j,k} \biggl\{  \frac{u^2}{e_{3u}}\frac{\partial    e_{3u}    }{\partial t} \,b_u +  \frac{v^2}{e_{3v}}\frac{\partial    e_{3v}    }{\partial t} \,b_v   \biggr\}      \\ &= - \sum\limits_{i,j,k} \biggl\{ \frac{1}{e_3t}\frac{\partial e_{3t} \rho}{\partial t} \, g \, z_t \,b_t  \biggr\} - \sum\limits_{i,j,k} \biggl\{ \rho \,g\,\frac{\partial z_t}{\partial t} \,b_t  \biggr\}                                    \\ \sum\limits_{i,j,k} \biggl\{  \frac{u    }{e_{3u}}\,\frac{\partial (e_{3u}u)}{\partial t} \,b_u +  \frac{v    }{e_{3v}}\,\frac{\partial (e_{3v}v)}{\partial t} \,b_v  \biggr\} &  -  \frac{1}{2} \sum\limits_{i,j,k} \biggl\{  \frac{u^2}{e_{3u}}\frac{\partial    e_{3u}    }{\partial t} \,b_u +  \frac{v^2}{e_{3v}}\frac{\partial    e_{3v}    }{\partial t} \,b_v   \biggr\} \\ &= - \sum\limits_{i,j,k} \biggl\{ \frac{1}{e_3t}\frac{\partial e_{3t} \rho}{\partial t} \, g \, z_t \,b_t  \biggr\} - \sum\limits_{i,j,k} \biggl\{ \rho \,g\,\frac{\partial z_t}{\partial t} \,b_t  \biggr\} \\ \end{flalign*} It is given by: $f+\frac{1} {e_1 e_2 } \left( v \frac{\partial e_2 } {\partial i} - u \frac{\partial e_1 } {\partial j}\right)\; \equiv \; f+\frac{1} {e_{1f}\,e_{2f}} \left( \overline v^{\,i+1/2} \delta_{i+1/2} \left[ e_{2u} \right] -\overline u^{\,j+1/2} \delta_{j+1/2} \left[ e_{1u} \right] \right) f+\frac{1} {e_1 e_2 } \left( v \frac{\partial e_2 } {\partial i} - u \frac{\partial e_1 } {\partial j}\right)\; \equiv \; f+\frac{1} {e_{1f}\,e_{2f}} \left( \overline v^{\,i+1/2} \delta_{i+1/2} \left[ e_{2u} \right] -\overline u^{\,j+1/2} \delta_{j+1/2} \left[ e_{1u} \right] \right)$ Because of the centered second order scheme, it conserves the horizontal kinetic energy, that is: \label{eq:C_ADV_KE_flux} -  \int_D \textbf{U}_h \cdot     \left(                 {{\begin{array} {*{20}c} \nabla \cdot \left( \textbf{U}\,u \right) \hfill \\ \nabla \cdot \left( \textbf{U}\,v \right) \hfill \\       \end{array}} }           \right)   \;dv -   \frac{1}{2} \int_D {  {\textbf{U}_h}^2 \frac{1}{e_3} \frac{\partial  e_3 }{\partial t} \;dv } =\;0 \label{eq:C_ADV_KE_flux} -  \int_D \textbf{U}_h \cdot     \left(                 {{ \begin{array} {*{20}c} \nabla \cdot \left( \textbf{U}\,u \right) \hfill \\ \nabla \cdot \left( \textbf{U}\,v \right) \hfill \\ \end{array} } }           \right)   \;dv -   \frac{1}{2} \int_D {  {\textbf{U}_h}^2 \frac{1}{e_3} \frac{\partial  e_3 }{\partial t} \;dv } =\;0 ($i.e.$ just the the terms associated with the i-component of the advection): \begin{flalign*} &  - \int_D u \cdot \nabla \cdot \left(   \textbf{U}\,u   \right) \; dv   \\ % \equiv& - \sum\limits_{i,j,k} \biggl\{    \frac{1} {b_u}    \biggl( \delta_{i+1/2}  \left[   \overline {U}^{\,i}      \;\overline u^{\,i}          \right] + \delta_j           \left[   \overline {V}^{\,i+1/2}\;\overline u^{\,j+1/2}   \right] + \delta_k          \left[   \overline {W}^{\,i+1/2}\;\overline u^{\,k+1/2} \right]  \biggr)   \;   \biggr\} \, b_u \;u &&&  \\ % \equiv& - \sum\limits_{i,j,k} \biggl\{ \delta_{i+1/2} \left[   \overline {U}^{\,i}\;  \overline u^{\,i}  \right] + \delta_j          \left[   \overline {V}^{\,i+1/2}\;\overline u^{\,j+1/2}   \right] + \delta_k         \left[   \overline {W}^{\,i+12}\;\overline u^{\,k+1/2}  \right] \; \biggr\} \; u     \\ % \equiv& + \sum\limits_{i,j,k} \biggl\{ \overline {U}^{\,i}\;   \overline u^{\,i}    \delta_i \left[ u \right] + \overline {V}^{\,i+1/2}\; \overline u^{\,j+1/2}   \delta_{j+1/2} \left[ u \right] + \overline {W}^{\,i+1/2}\; \overline u^{\,k+1/2}   \delta_{k+1/2}    \left[ u \right]     \biggr\}     && \\ % \equiv& + \frac{1}{2} \sum\limits_{i,j,k}    \biggl\{ \overline{U}^{\,i}     \delta_i       \left[ u^2 \right] + \overline{V}^{\,i+1/2}  \delta_{j+/2}  \left[ u^2 \right] + \overline{W}^{\,i+1/2}  \delta_{k+1/2}    \left[ u^2 \right]      \biggr\} && \\ % \equiv& -  \sum\limits_{i,j,k}    \frac{1}{2}   \bigg\{ U  \; \delta_{i+1/2}    \left[ \overline {u^2}^{\,i} \right] + V  \; \delta_{j+1/2}    \left[ \overline {u^2}^{\,i} \right] + W \; \delta_{k+1/2}   \left[ \overline {u^2}^{\,i} \right]     \biggr\}    &&& \\ % \equiv& - \sum\limits_{i,j,k}  \frac{1}{2}  \overline {u^2}^{\,i}     \biggl\{ \delta_{i+1/2}    \left[ U  \right] + \delta_{j+1/2}  \left[ V  \right] + \delta_{k+1/2}  \left[ W \right]     \biggr\}    &&& \\ % \equiv& + \sum\limits_{i,j,k}  \frac{1}{2}  \overline {u^2}^{\,i} \biggl\{     \left(   \frac{1}{e_{3t}} \frac{\partial e_{3t}}{\partial t}   \right) \; b_t     \biggr\}    &&& \\ &  - \int_D u \cdot \nabla \cdot \left(   \textbf{U}\,u   \right) \; dv   \\ % \equiv& - \sum\limits_{i,j,k} \biggl\{    \frac{1} {b_u}    \biggl( \delta_{i+1/2}  \left[   \overline {U}^{\,i}      \;\overline u^{\,i}          \right] + \delta_j           \left[   \overline {V}^{\,i+1/2}\;\overline u^{\,j+1/2}   \right] + \delta_k          \left[   \overline {W}^{\,i+1/2}\;\overline u^{\,k+1/2} \right]  \biggr)   \;   \biggr\} \, b_u \;u &&&  \\ % \equiv& - \sum\limits_{i,j,k} \biggl\{ \delta_{i+1/2} \left[   \overline {U}^{\,i}\;  \overline u^{\,i}  \right] + \delta_j          \left[   \overline {V}^{\,i+1/2}\;\overline u^{\,j+1/2}   \right] + \delta_k         \left[   \overline {W}^{\,i+12}\;\overline u^{\,k+1/2}  \right] \; \biggr\} \; u     \\ % \equiv& + \sum\limits_{i,j,k} \biggl\{ \overline {U}^{\,i}\; \overline u^{\,i}    \delta_i \left[ u \right] + \overline {V}^{\,i+1/2}\; \overline u^{\,j+1/2}   \delta_{j+1/2} \left[ u \right] + \overline {W}^{\,i+1/2}\; \overline u^{\,k+1/2}   \delta_{k+1/2}    \left[ u \right]     \biggr\}     && \\ % \equiv& + \frac{1}{2} \sum\limits_{i,j,k}    \biggl\{ \overline{U}^{\,i}       \delta_i       \left[ u^2 \right] + \overline{V}^{\,i+1/2}    \delta_{j+/2}  \left[ u^2 \right] + \overline{W}^{\,i+1/2}    \delta_{k+1/2}    \left[ u^2 \right]      \biggr\} && \\ % \equiv& -  \sum\limits_{i,j,k}    \frac{1}{2}   \bigg\{ U  \; \delta_{i+1/2}    \left[ \overline {u^2}^{\,i} \right] + V  \; \delta_{j+1/2}    \left[ \overline {u^2}^{\,i} \right] + W \; \delta_{k+1/2}   \left[ \overline {u^2}^{\,i} \right]     \biggr\}    &&& \\ % \equiv& - \sum\limits_{i,j,k}  \frac{1}{2}  \overline {u^2}^{\,i}     \biggl\{ \delta_{i+1/2}  \left[ U  \right] + \delta_{j+1/2}   \left[ V  \right] + \delta_{k+1/2}   \left[ W \right]     \biggr\}    &&& \\ % \equiv& + \sum\limits_{i,j,k}  \frac{1}{2}  \overline {u^2}^{\,i} \biggl\{     \left(   \frac{1}{e_{3t}} \frac{\partial e_{3t}}{\partial t}   \right) \; b_t     \biggr\}    &&& \\ \end{flalign*} Applying similar manipulation applied to the second term of the scalar product leads to: $- \int_D \textbf{U}_h \cdot \left( {{\begin{array} {*{20}c} \nabla \cdot \left( \textbf{U}\,u \right) \hfill \\ \nabla \cdot \left( \textbf{U}\,v \right) \hfill \\ \end{array}} } \right) \;dv \equiv + \sum\limits_{i,j,k} \frac{1}{2} \left( \overline {u^2}^{\,i} + \overline {v^2}^{\,j} \right) \biggl\{ \left( \frac{1}{e_{3t}} \frac{\partial e_{3t}}{\partial t} \right) \; b_t \biggr\} - \int_D \textbf{U}_h \cdot \left( {{ \begin{array} {*{20}c} \nabla \cdot \left( \textbf{U}\,u \right) \hfill \\ \nabla \cdot \left( \textbf{U}\,v \right) \hfill \\ \end{array} } } \right) \;dv \equiv + \sum\limits_{i,j,k} \frac{1}{2} \left( \overline {u^2}^{\,i} + \overline {v^2}^{\,j} \right) \biggl\{ \left( \frac{1}{e_{3t}} \frac{\partial e_{3t}}{\partial t} \right) \; b_t \biggr\}$ which is the discrete form of $\frac{1}{2} \int_D u \cdot \nabla \cdot \left( \textbf{U}\,u \right) \; dv$. \autoref{eq:C_ADV_KE_flux} is thus satisfied. When the UBS scheme is used to evaluate the flux form momentum advection, The horizontal kinetic energy is not conserved, but forced to decay ($i.e.$ the scheme is diffusive). % ================================================================ % Discrete Enstrophy Conservation \label{sec:C.4} % ------------------------------------------------------------------------------------------------------------- %       Vorticity Term with ENS scheme In the ENS scheme, the vorticity term is descretized as follows: \tag{\ref{eq:dynvor_ens}} \left\{   \begin{aligned} +\frac{1}{e_{1u}} & \overline{q}^{\,i}  & {\overline{ \overline{\left( e_{1v}\,e_{3v}\;  v \right) } } }^{\,i, j+1/2}    \\ - \frac{1}{e_{2v}} & \overline{q}^{\,j}  & {\overline{ \overline{\left( e_{2u}\,e_{3u}\; u \right) } } }^{\,i+1/2, j} \end{aligned}  \right. \tag{\ref{eq:dynvor_ens}} \left\{ \begin{aligned} +\frac{1}{e_{1u}} & \overline{q}^{\,i}  & {\overline{ \overline{\left( e_{1v}\,e_{3v}\;  v \right) } } }^{\,i, j+1/2}    \\ - \frac{1}{e_{2v}} & \overline{q}^{\,j}  & {\overline{ \overline{\left( e_{2u}\,e_{3u}\; u \right) } } }^{\,i+1/2, j} \end{aligned} \right. ( \autoref{eq:DOM_mi_adj} and \autoref{eq:DOM_di_adj}), it can be shown that: \label{eq:C_1.1} \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 \label{eq:C_1.1} \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 where $dv=e_1\,e_2\,e_3 \; di\,dj\,dk$ is the volume element. Indeed, using \autoref{eq:dynvor_ens}, the discrete form of the right hand side of \autoref{eq:C_1.1} can be transformed as follow: \begin{flalign*} &\int_D q \,\; \textbf{k} \cdot \frac{1} {e_3 } \nabla \times \left(  e_3 \, q \; \textbf{k} \times  \textbf{U}_h   \right)\;   dv       \\ % & \qquad {\begin{array}{*{20}l} &\equiv \sum\limits_{i,j,k} q \ \left\{  \delta_{i+1/2}  \left[ - \,\overline {q}^{\,i}\;  \overline{\overline  U }^{\,i,j+1/ 2} \right] - \delta_{j+1/2} \left[    \overline {q}^{\,j}\;  \overline{\overline  V }^{\,i+1/2, j} \right]     \right\}    \\ % &\equiv \sum\limits_{i,j,k} \left\{   \delta_i [q] \; \overline{q}^{\,i} \; \overline{  \overline U  }^{\,i,j+1/2} + \delta_j [q] \; \overline{q}^{\,j} \; \overline{\overline V }^{\,i+1/2,j}        \right\}       &&  \\ % &\equiv \,\frac{1} {2} \sum\limits_{i,j,k} \left\{         \delta_i  \left[ q^2 \right] \; \overline{\overline U }^{\,i,j+1/2} + \delta_j  \left[ q^2 \right] \; \overline{\overline V }^{\,i+1/2,j}      \right\}    &&  \\ % &\equiv - \frac{1} {2} \sum\limits_{i,j,k}   q^2 \; \left\{    \delta_{i+1/2}   \left[   \overline{\overline{ U }}^{\,i,j+1/2}    \right] + \delta_{j+1/2}  \left[   \overline{\overline{ V }}^{\,i+1/2,j}     \right]    \right\}    && \\ \end{array} } % \allowdisplaybreaks \intertext{ Since $\overline {\;\cdot \;}$ and $\delta$ operators commute: $\delta_{i+1/2} \left[ {\overline a^{\,i}} \right] = \overline {\delta_i \left[ a \right]}^{\,i+1/2}$, and introducing the horizontal divergence $\chi$, it becomes: } \allowdisplaybreaks % & \qquad {\begin{array}{*{20}l} &\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} \quad \equiv 0 && \end{array} } \begin{flalign*} &\int_D q \,\; \textbf{k} \cdot \frac{1} {e_3 } \nabla \times \left(  e_3 \, q \; \textbf{k} \times  \textbf{U}_h   \right)\;   dv \\ % & \qquad { \begin{array}{*{20}l} &\equiv \sum\limits_{i,j,k} q \ \left\{  \delta_{i+1/2}  \left[ - \,\overline {q}^{\,i}\;  \overline{\overline  U }^{\,i,j+1/ 2} \right] - \delta_{j+1/2} \left[   \overline {q}^{\,j}\;  \overline{\overline  V }^{\,i+1/2, j} \right]     \right\}    \\ % &\equiv \sum\limits_{i,j,k} \left\{   \delta_i [q] \; \overline{q}^{\,i} \; \overline{  \overline U  }^{\,i,j+1/2} + \delta_j [q] \; \overline{q}^{\,j} \; \overline{\overline V }^{\,i+1/2,j}        \right\}       &&  \\ % &\equiv \,\frac{1} {2} \sum\limits_{i,j,k} \left\{         \delta_i  \left[ q^2 \right] \; \overline{\overline U }^{\,i,j+1/2} + \delta_j  \left[ q^2 \right] \; \overline{\overline V }^{\,i+1/2,j}      \right\}    &&  \\ % &\equiv - \frac{1} {2} \sum\limits_{i,j,k}   q^2 \; \left\{    \delta_{i+1/2}   \left[   \overline{\overline{ U }}^{\,i,j+1/2}    \right] + \delta_{j+1/2}  \left[   \overline{\overline{ V }}^{\,i+1/2,j}     \right]    \right\}    && \\ \end{array} } % \allowdisplaybreaks \intertext{ Since $\overline {\;\cdot \;}$ and $\delta$ operators commute: $\delta_{i+1/2} \left[ {\overline a^{\,i}} \right] = \overline {\delta_i \left[ a \right]}^{\,i+1/2}$, and introducing the horizontal divergence $\chi$, it becomes: } \allowdisplaybreaks % & \qquad { \begin{array}{*{20}l} &\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} \quad \equiv 0 && \end{array} } \end{flalign*} The later equality is obtain only when the flow is horizontally non-divergent, $i.e.$ $\chi$=$0$. % ------------------------------------------------------------------------------------------------------------- With the EEN scheme, the vorticity terms are represented as: \tag{\ref{eq:dynvor_een}} \left\{ {    \begin{aligned} +q\,e_3 \, v  &\equiv +\frac{1}{e_{1u} }   \sum_{\substack{i_p,\,k_p}} {^{i+1/2-i_p}_j}  \mathbb{Q}^{i_p}_{j_p}  \left( e_{1v} e_{3v} \ v  \right)^{i+i_p-1/2}_{j+j_p}   \\ - q\,e_3 \, u     &\equiv -\frac{1}{e_{2v} }    \sum_{\substack{i_p,\,k_p}} {^i_{j+1/2-j_p}}  \mathbb{Q}^{i_p}_{j_p}  \left( e_{2u} e_{3u} \ u  \right)^{i+i_p}_{j+j_p-1/2}   \\ \end{aligned}   } \right. \tag{\ref{eq:dynvor_een}} \left\{ { \begin{aligned} +q\,e_3 \, v    &\equiv +\frac{1}{e_{1u} }   \sum_{\substack{i_p,\,k_p}} {^{i+1/2-i_p}_j}  \mathbb{Q}^{i_p}_{j_p}  \left( e_{1v} e_{3v} \ v  \right)^{i+i_p-1/2}_{j+j_p}   \\ - q\,e_3 \, u     &\equiv -\frac{1}{e_{2v} }    \sum_{\substack{i_p,\,k_p}} {^i_{j+1/2-j_p}}  \mathbb{Q}^{i_p}_{j_p}  \left( e_{2u} e_{3u} \ u  \right)^{i+i_p}_{j+j_p-1/2}   \\ \end{aligned} } \right. where the indices $i_p$ and $k_p$ take the following values: $i_p = -1/2$ or $1/2$ and $j_p = -1/2$ or $1/2$, and the vorticity triads, ${^i_j}\mathbb{Q}^{i_p}_{j_p}$, defined at $T$-point, are given by: \tag{\ref{eq:Q_triads}} _i^j \mathbb{Q}^{i_p}_{j_p} = \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) \tag{\ref{eq:Q_triads}} _i^j \mathbb{Q}^{i_p}_{j_p} = \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) This formulation does conserve the potential enstrophy for a horizontally non-divergent flow ($i.e.$ $\chi=0$). this triad only can be transformed as follow: \begin{flalign*} &\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& \sum\limits_{i,j,k} {q} \    \biggl\{ \;\; \delta_{i+1/2} \left[   -\, {{^i_j}\mathbb{Q}^{+1/2}_{+1/2}  \; U^{i+1/2}_{j}}    \right] - \delta_{j+1/2} \left[       {{^i_j}\mathbb{Q}^{+1/2}_{+1/2}  \; V^{i}_{j+1/2}}    \right] \;\;\biggr\}        &&  \\ % \equiv& \sum\limits_{i,j,k} \biggl\{   \delta_i [q] \  {{^i_j}\mathbb{Q}^{+1/2}_{+1/2}  \; U^{i+1/2}_{j}} + \delta_j [q] \  {{^i_j}\mathbb{Q}^{+1/2}_{+1/2}  \; V^{i}_{j+1/2}}   \biggr\} && \\ % ... & &&\\ &Demonstation \ to \ be \ done... &&\\ ... & &&\\ % \equiv& \frac{1} {2} \sum\limits_{i,j,k} \biggl\{ \delta_i    \Bigl[    \left(  {{^i_j}\mathbb{Q}^{+1/2}_{+1/2}} \right)^2   \Bigr]\; \overline{\overline {U}}^{\,i,j+1/2} + \delta_j  \Bigl[    \left( {{^i_j}\mathbb{Q}^{+1/2}_{+1/2}} \right)^2     \Bigr]\; \overline{\overline {V}}^{\,i+1/2,j} \biggr\} &&  \\ % \equiv& - \frac{1} {2} \sum\limits_{i,j,k}   \left( {{^i_j}\mathbb{Q}^{+1/2}_{+1/2}} \right)^2\; \biggl\{    \delta_{i+1/2} \left[   \overline{\overline {U}}^{\,i,j+1/2}    \right] + \delta_{j+1/2} \left[   \overline{\overline {V}}^{\,i+1/2,j}     \right] \biggr\}    && \\ % \equiv& \sum\limits_{i,j,k} - \frac{1} {2} \left( {{^i_j}\mathbb{Q}^{+1/2}_{+1/2}} \right)^2 \; \overline{\overline{ b_t^{}\, \chi}}^{\,i+1/2,\,j+1/2}  &&\\ % \ \ \equiv& \ 0     &&\\ \end{flalign*} \begin{flalign*} &\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& \sum\limits_{i,j,k} {q} \    \biggl\{ \;\; \delta_{i+1/2} \left[   -\, {{^i_j}\mathbb{Q}^{+1/2}_{+1/2}  \; U^{i+1/2}_{j}}    \right] - \delta_{j+1/2} \left[       {{^i_j}\mathbb{Q}^{+1/2}_{+1/2}  \; V^{i}_{j+1/2}}    \right] \;\;\biggr\}        &&  \\ % \equiv& \sum\limits_{i,j,k} \biggl\{   \delta_i [q] \  {{^i_j}\mathbb{Q}^{+1/2}_{+1/2}  \; U^{i+1/2}_{j}} + \delta_j [q] \  {{^i_j}\mathbb{Q}^{+1/2}_{+1/2}  \; V^{i}_{j+1/2}}   \biggr\} && \\ % ... & &&\\ &Demonstation \ to \ be \ done... &&\\ ... & &&\\ % \equiv& \frac{1} {2} \sum\limits_{i,j,k} \biggl\{  \delta_i    \Bigl[    \left(  {{^i_j}\mathbb{Q}^{+1/2}_{+1/2}} \right)^2   \Bigr]\; \overline{\overline {U}}^{\,i,j+1/2} + \delta_j   \Bigl[    \left( {{^i_j}\mathbb{Q}^{+1/2}_{+1/2}} \right)^2     \Bigr]\; \overline{\overline {V}}^{\,i+1/2,j} \biggr\} &&  \\ % \equiv& - \frac{1} {2} \sum\limits_{i,j,k}    \left( {{^i_j}\mathbb{Q}^{+1/2}_{+1/2}} \right)^2\; \biggl\{    \delta_{i+1/2} \left[   \overline{\overline {U}}^{\,i,j+1/2}    \right] + \delta_{j+1/2} \left[   \overline{\overline {V}}^{\,i+1/2,j}     \right] \biggr\}    && \\ % \equiv& \sum\limits_{i,j,k} - \frac{1} {2} \left( {{^i_j}\mathbb{Q}^{+1/2}_{+1/2}} \right)^2 \; \overline{\overline{ b_t^{}\, \chi}}^{\,i+1/2,\,j+1/2}  &&\\ % \ \ \equiv& \ 0     &&\\ \end{flalign*} % ================================================================ \section{Conservation properties on tracers} \label{sec:C.5} All the numerical schemes used in NEMO are written such that the tracer content is conserved by conservation of a tracer, $T$: $\frac{\partial }{\partial t} \left( \int_D {T\;dv} \right) = \int_D { \frac{1}{e_3}\frac{\partial \left( e_3 \, T \right)}{\partial t} \;dv }=0 \frac{\partial }{\partial t} \left( \int_D {T\;dv} \right) = \int_D { \frac{1}{e_3}\frac{\partial \left( e_3 \, T \right)}{\partial t} \;dv }=0$ conservation of its variance: \begin{flalign*} \frac{\partial }{\partial t} \left( \int_D {\frac{1}{2} T^2\;dv} \right) =&  \int_D { \frac{1}{e_3} Q      \frac{\partial \left( e_3 \, T \right) }{\partial t} \;dv } -   \frac{1}{2} \int_D {  T^2 \frac{1}{e_3} \frac{\partial  e_3 }{\partial t} \;dv } \end{flalign*} \begin{flalign*} \frac{\partial }{\partial t} \left( \int_D {\frac{1}{2} T^2\;dv} \right) =&  \int_D { \frac{1}{e_3} Q      \frac{\partial \left( e_3 \, T \right) }{\partial t} \;dv } -   \frac{1}{2} \int_D {  T^2 \frac{1}{e_3} \frac{\partial  e_3 }{\partial t} \;dv } \end{flalign*} Whatever the advection scheme considered it conserves of the tracer content as the conservation of the tracer content due to the advection tendency is obtained as follows: \begin{flalign*} &\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    &&&\\ &\equiv - \sum\limits_{i,j,k}    \biggl\{ \frac{1} {b_t}  \left(  \delta_i    \left[   U \;\tau_u   \right] + \delta_j    \left[   V  \;\tau_v   \right] \right) + \frac{1} {e_{3t}} \delta_k \left[ w\;\tau_w \right]    \biggl\}  b_t   &&&\\ % &\equiv - \sum\limits_{i,j,k}     \left\{ \delta_i  \left[   U \;\tau_u   \right] + \delta_j  \left[   V  \;\tau_v   \right] &\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    &&&\\ &\equiv - \sum\limits_{i,j,k}    \biggl\{ \frac{1} {b_t}  \left(  \delta_i    \left[   U \;\tau_u   \right] + \delta_j    \left[   V  \;\tau_v   \right] \right) + \frac{1} {e_{3t}} \delta_k \left[ w\;\tau_w \right]    \biggl\}  b_t   &&&\\ % &\equiv - \sum\limits_{i,j,k}     \left\{ \delta_i  \left[   U \;\tau_u   \right] + \delta_j  \left[   V  \;\tau_v   \right] + \delta_k \left[ W \;\tau_w \right] \right\}   && \\ &\equiv 0 &&& &\equiv 0 &&& \end{flalign*} It can be demonstarted as follows: \begin{flalign*} &\int_D { \frac{1}{e_3} Q      \frac{\partial \left( e_3 \, T \right) }{\partial t} \;dv } = - \int\limits_D \tau\;\nabla \cdot \left( T\; \textbf{U} \right)\;dv &&&\\ \equiv& - \sum\limits_{i,j,k} T\; \left\{ \delta_i  \left[ U  \overline T^{\,i+1/2}  \right] + \delta_j  \left[ V  \overline T^{\,j+1/2}  \right] + \delta_k \left[ W \overline T^{\,k+1/2} \right]          \right\} && \\ \equiv& + \sum\limits_{i,j,k} \left\{     U  \overline T^{\,i+1/2} \,\delta_{i+1/2}  \left[ T \right] +  V  \overline T^{\,j+1/2} \;\delta_{j+1/2}  \left[ T \right] +  W \overline T^{\,k+1/2}\;\delta_{k+1/2} \left[ T \right]     \right\}      &&\\ \equiv&  + \frac{1} {2}  \sum\limits_{i,j,k} \Bigl\{   U  \;\delta_{i+1/2} \left[ T^2 \right] + V  \;\delta_{j+1/2}  \left[ T^2 \right] + W \;\delta_{k+1/2} \left[ T^2 \right]   \Bigr\}     && \\ \equiv& - \frac{1} {2}  \sum\limits_{i,j,k} T^2 \Bigl\{    \delta_i  \left[ U  \right] + \delta_j  \left[ V  \right] + \delta_k \left[ W \right]     \Bigr\}      &&&  \\ \equiv& + \frac{1} {2}  \sum\limits_{i,j,k} T^2 \Bigl\{   \frac{1}{e_{3t}} \frac{\partial e_{3t}\,T }{\partial t}     \Bigr\}      &&& \\ &\int_D { \frac{1}{e_3} Q      \frac{\partial \left( e_3 \, T \right) }{\partial t} \;dv } = - \int\limits_D \tau\;\nabla \cdot \left( T\; \textbf{U} \right)\;dv &&&\\ \equiv& - \sum\limits_{i,j,k} T\; \left\{ \delta_i  \left[ U  \overline T^{\,i+1/2}  \right] + \delta_j  \left[ V  \overline T^{\,j+1/2}  \right] + \delta_k \left[ W \overline T^{\,k+1/2} \right]          \right\} && \\ \equiv& + \sum\limits_{i,j,k} \left\{     U  \overline T^{\,i+1/2} \,\delta_{i+1/2}  \left[ T \right] +  V  \overline T^{\,j+1/2} \;\delta_{j+1/2}  \left[ T \right] +  W \overline T^{\,k+1/2}\;\delta_{k+1/2} \left[ T \right]     \right\}      &&\\ \equiv&  + \frac{1} {2}  \sum\limits_{i,j,k} \Bigl\{   U  \;\delta_{i+1/2} \left[ T^2 \right] + V  \;\delta_{j+1/2}  \left[ T^2 \right] + W \;\delta_{k+1/2} \left[ T^2 \right]   \Bigr\}     && \\ \equiv& - \frac{1} {2}  \sum\limits_{i,j,k} T^2 \Bigl\{    \delta_i  \left[ U  \right] + \delta_j  \left[ V  \right] + \delta_k \left[ W \right]     \Bigr\}      &&&  \\ \equiv& + \frac{1} {2}  \sum\limits_{i,j,k} T^2 \Bigl\{   \frac{1}{e_{3t}} \frac{\partial e_{3t}\,T }{\partial t}     \Bigr\}      &&& \\ \end{flalign*} which is the discrete form of $\frac{1}{2} \int_D { T^2 \frac{1}{e_3} \frac{\partial e_3 }{\partial t} \;dv }$. \section{Conservation properties on lateral momentum physics} \label{sec:dynldf_properties} The discrete formulation of the horizontal diffusion of momentum ensures The lateral momentum diffusion term conserves the potential vorticity: \begin{flalign*} &\int \limits_D \frac{1} {e_3 } \textbf{k} \cdot \nabla \times \Bigl[    \nabla_h  \left( A^{\,lm}\;\chi  \right) - \nabla_h \times \left( A^{\,lm}\;\zeta \; \textbf{k} \right)    \Bigr]\;dv   \\ %\end{flalign*} %%%%%%%%%% recheck here....  (gm) %\begin{flalign*} =& \int \limits_D  -\frac{1} {e_3 } \textbf{k} \cdot \nabla \times \Bigl[ \nabla_h \times \left( A^{\,lm}\;\zeta \; \textbf{k} \right)  \Bigr]\;dv  \\ %\end{flalign*} %\begin{flalign*} \equiv& \sum\limits_{i,j} \left\{ \delta_{i+1/2} \left[  \frac {e_{2v}} {e_{1v}\,e_{3v}}  \delta_i \left[ A_f^{\,lm} e_{3f} \zeta  \right]  \right] + \delta_{j+1/2} \left[  \frac {e_{1u}} {e_{2u}\,e_{3u}}  \delta_j \left[ A_f^{\,lm} e_{3f} \zeta  \right]  \right] \right\}     \\ % \intertext{Using \autoref{eq:DOM_di_adj}, it follows:} % \equiv& \sum\limits_{i,j,k} -\,\left\{ \frac{e_{2v}} {e_{1v}\,e_{3v}}  \delta_i  \left[ A_f^{\,lm} e_{3f} \zeta  \right]\;\delta_i \left[ 1\right] &\int \limits_D \frac{1} {e_3 } \textbf{k} \cdot \nabla \times \Bigl[    \nabla_h  \left( A^{\,lm}\;\chi  \right) - \nabla_h \times \left( A^{\,lm}\;\zeta \; \textbf{k} \right)    \Bigr]\;dv   \\ % \end{flalign*} %%%%%%%%%% recheck here....  (gm) % \begin{flalign*} =& \int \limits_D  -\frac{1} {e_3 } \textbf{k} \cdot \nabla \times \Bigl[ \nabla_h \times \left( A^{\,lm}\;\zeta \; \textbf{k} \right)  \Bigr]\;dv  \\ % \end{flalign*} % \begin{flalign*} \equiv& \sum\limits_{i,j} \left\{ \delta_{i+1/2} \left[  \frac {e_{2v}} {e_{1v}\,e_{3v}}  \delta_i \left[ A_f^{\,lm} e_{3f} \zeta  \right]  \right] + \delta_{j+1/2} \left[  \frac {e_{1u}} {e_{2u}\,e_{3u}}  \delta_j \left[ A_f^{\,lm} e_{3f} \zeta  \right]  \right] \right\}   \\ % \intertext{Using \autoref{eq:DOM_di_adj}, it follows:} % \equiv& \sum\limits_{i,j,k} -\,\left\{ \frac{e_{2v}} {e_{1v}\,e_{3v}}  \delta_i \left[ A_f^{\,lm} e_{3f} \zeta  \right]\;\delta_i \left[ 1\right] + \frac{e_{1u}} {e_{2u}\,e_{3u}}  \delta_j  \left[ A_f^{\,lm} e_{3f} \zeta  \right]\;\delta_j \left[ 1\right] \right\} \quad \equiv 0 \\ \right\} \quad \equiv 0 \\ \end{flalign*} %\begin{flalign*} $\begin{split} \int_D \textbf{U}_h \cdot \left[ \nabla_h \right. & \left. \left( A^{\,lm}\;\chi \right) - \nabla_h \times \left( A^{\,lm}\;\zeta \;\textbf{k} \right) \right] \; dv \\ \\ %%% \equiv& \sum\limits_{i,j,k} \left\{ \frac{1} {e_{1u}} \delta_{i+1/2} \left[ A_T^{\,lm} \chi \right] - \frac{1} {e_{2u}\,e_{3u}} \delta_j \left[ A_f^{\,lm} e_{3f} \zeta \right] \right\} \; e_{1u}\,e_{2u}\,e_{3u} \;u \\ &\;\; + \left\{ \frac{1} {e_{2u}} \delta_{j+1/2} \left[ A_T^{\,lm} \chi \right] + \frac{1} {e_{1v}\,e_{3v}} \delta_i \left[ A_f^{\,lm} e_{3f} \zeta \right] \right\} \; e_{1v}\,e_{2u}\,e_{3v} \;v \qquad \\ \\ %%% \equiv& \sum\limits_{i,j,k} \Bigl\{ e_{2u}\,e_{3u} \;u\; \delta_{i+1/2} \left[ A_T^{\,lm} \chi \right] - e_{1u} \;u\; \delta_j \left[ A_f^{\,lm} e_{3f} \zeta \right] \Bigl\} \\ &\;\; + \Bigl\{ e_{1v}\,e_{3v} \;v\; \delta_{j+1/2} \left[ A_T^{\,lm} \chi \right] + e_{2v} \;v\; \delta_i \left[ A_f^{\,lm} e_{3f} \zeta \right] \Bigl\} \\ \\ %%% \equiv& \sum\limits_{i,j,k} - \Bigl( \delta_i \left[ e_{2u}\,e_{3u} \;u \right] + \delta_j \left[ e_{1v}\,e_{3v} \;v \right] \Bigr) \; A_T^{\,lm} \chi \\ &\;\; - \Bigl( \delta_{i+1/2} \left[ e_{2v} \;v \right] - \delta_{j+1/2} \left[ e_{1u} \;u \right] \Bigr)\; A_f^{\,lm} e_{3f} \zeta \\ \\ %%% \equiv& \sum\limits_{i,j,k} - A_T^{\,lm} \,\chi^2 \;e_{1t}\,e_{2t}\,e_{3t} - A_f ^{\,lm} \,\zeta^2 \;e_{1f }\,e_{2f }\,e_{3f} \quad \leq 0 \\ \end{split} \begin{split} \int_D \textbf{U}_h \cdot \left[ \nabla_h \right. & \left. \left( A^{\,lm}\;\chi \right) - \nabla_h \times \left( A^{\,lm}\;\zeta \;\textbf{k} \right) \right] \; dv \\ \\ %%% \equiv& \sum\limits_{i,j,k} \left\{ \frac{1} {e_{1u}} \delta_{i+1/2} \left[ A_T^{\,lm} \chi \right] - \frac{1} {e_{2u}\,e_{3u}} \delta_j \left[ A_f^{\,lm} e_{3f} \zeta \right] \right\} \; e_{1u}\,e_{2u}\,e_{3u} \;u \\ &\;\; + \left\{ \frac{1} {e_{2u}} \delta_{j+1/2} \left[ A_T^{\,lm} \chi \right] + \frac{1} {e_{1v}\,e_{3v}} \delta_i \left[ A_f^{\,lm} e_{3f} \zeta \right] \right\} \; e_{1v}\,e_{2u}\,e_{3v} \;v \qquad \\ \\ %%% \equiv& \sum\limits_{i,j,k} \Bigl\{ e_{2u}\,e_{3u} \;u\; \delta_{i+1/2} \left[ A_T^{\,lm} \chi \right] - e_{1u} \;u\; \delta_j \left[ A_f^{\,lm} e_{3f} \zeta \right] \Bigl\} \\ &\;\; + \Bigl\{ e_{1v}\,e_{3v} \;v\; \delta_{j+1/2} \left[ A_T^{\,lm} \chi \right] + e_{2v} \;v\; \delta_i \left[ A_f^{\,lm} e_{3f} \zeta \right] \Bigl\} \\ \\ %%% \equiv& \sum\limits_{i,j,k} - \Bigl( \delta_i \left[ e_{2u}\,e_{3u} \;u \right] + \delta_j \left[ e_{1v}\,e_{3v} \;v \right] \Bigr) \; A_T^{\,lm} \chi \\ &\;\; - \Bigl( \delta_{i+1/2} \left[ e_{2v} \;v \right] - \delta_{j+1/2} \left[ e_{1u} \;u \right] \Bigr)\; A_f^{\,lm} e_{3f} \zeta \\ \\ %%% \equiv& \sum\limits_{i,j,k} - A_T^{\,lm} \,\chi^2 \;e_{1t}\,e_{2t}\,e_{3t} - A_f ^{\,lm} \,\zeta^2 \;e_{1f }\,e_{2f }\,e_{3f} \quad \leq 0 \\ \end{split}$ The lateral momentum diffusion term dissipates the enstrophy when the eddy coefficients are horizontally uniform: \begin{flalign*} &\int\limits_D  \zeta \; \textbf{k} \cdot \nabla \times \left[   \nabla_h \left( A^{\,lm}\;\chi  \right) - \nabla_h \times \left( A^{\,lm}\;\zeta \; \textbf{k} \right)   \right]\;dv &&&\\ &\quad = A^{\,lm} \int \limits_D \zeta \textbf{k} \cdot \nabla \times \left[    \nabla_h \times \left( \zeta \; \textbf{k} \right)   \right]\;dv &&&\\ &\quad \equiv A^{\,lm} \sum\limits_{i,j,k}  \zeta \;e_{3f} \left\{     \delta_{i+1/2} \left[  \frac{e_{2v}} {e_{1v}\,e_{3v}} \delta_i \left[ e_{3f} \zeta  \right]   \right] + \delta_{j+1/2} \left[  \frac{e_{1u}} {e_{2u}\,e_{3u}} \delta_j \left[ e_{3f} \zeta  \right]   \right]      \right\}   &&&\\ % \intertext{Using \autoref{eq:DOM_di_adj}, it follows:} % &\quad \equiv  - A^{\,lm} \sum\limits_{i,j,k} \left\{    \left(  \frac{1} {e_{1v}\,e_{3v}}  \delta_i \left[ e_{3f} \zeta  \right]  \right)^2   b_v + \left(  \frac{1} {e_{2u}\,e_{3u}}  \delta_j \left[ e_{3f} \zeta  \right] \right)^2   b_u  \right\}  \quad \leq \;0    &&&\\ &\int\limits_D  \zeta \; \textbf{k} \cdot \nabla \times \left[   \nabla_h \left( A^{\,lm}\;\chi  \right) - \nabla_h \times \left( A^{\,lm}\;\zeta \; \textbf{k} \right)   \right]\;dv &&&\\ &\quad = A^{\,lm} \int \limits_D \zeta \textbf{k} \cdot \nabla \times \left[    \nabla_h \times \left( \zeta \; \textbf{k} \right)   \right]\;dv &&&\\ &\quad \equiv A^{\,lm} \sum\limits_{i,j,k}  \zeta \;e_{3f} \left\{     \delta_{i+1/2} \left[  \frac{e_{2v}} {e_{1v}\,e_{3v}} \delta_i \left[ e_{3f} \zeta  \right]   \right] + \delta_{j+1/2} \left[  \frac{e_{1u}} {e_{2u}\,e_{3u}} \delta_j \left[ e_{3f} \zeta  \right]   \right]      \right\}   &&&\\ % \intertext{Using \autoref{eq:DOM_di_adj}, it follows:} % &\quad \equiv  - A^{\,lm} \sum\limits_{i,j,k} \left\{    \left(  \frac{1} {e_{1v}\,e_{3v}}  \delta_i \left[ e_{3f} \zeta  \right]  \right)^2   b_v + \left(  \frac{1} {e_{2u}\,e_{3u}}  \delta_j \left[ e_{3f} \zeta  \right] \right)^2   b_u  \right\}  \quad \leq \;0    &&&\\ \end{flalign*} The resulting term conserves the $\chi$ and dissipates $\chi^2$ when the eddy coefficients are horizontally uniform. \begin{flalign*} & \int\limits_D  \nabla_h \cdot \Bigl[     \nabla_h \left( A^{\,lm}\;\chi \right) - \nabla_h \times \left( A^{\,lm}\;\zeta \;\textbf{k} \right)    \Bigr]  dv = \int\limits_D  \nabla_h \cdot \nabla_h \left( A^{\,lm}\;\chi  \right)   dv   \\ % &\equiv \sum\limits_{i,j,k} \left\{   \delta_i \left[ A_u^{\,lm} \frac{e_{2u}\,e_{3u}} {e_{1u}}  \delta_{i+1/2} \left[ \chi \right]  \right] + \delta_j \left[ A_v^{\,lm} \frac{e_{1v}\,e_{3v}} {e_{2v}}  \delta_{j+1/2} \left[ \chi \right]  \right]    \right\}    \\ % \intertext{Using \autoref{eq:DOM_di_adj}, it follows:} % &\equiv \sum\limits_{i,j,k} - \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] + \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\} \quad \equiv 0      \\ & \int\limits_D  \nabla_h \cdot \Bigl[     \nabla_h \left( A^{\,lm}\;\chi \right) - \nabla_h \times \left( A^{\,lm}\;\zeta \;\textbf{k} \right)    \Bigr]  dv = \int\limits_D  \nabla_h \cdot \nabla_h \left( A^{\,lm}\;\chi  \right)   dv   \\ % &\equiv \sum\limits_{i,j,k} \left\{   \delta_i \left[ A_u^{\,lm} \frac{e_{2u}\,e_{3u}} {e_{1u}}  \delta_{i+1/2} \left[ \chi \right]  \right] + \delta_j \left[ A_v^{\,lm} \frac{e_{1v}\,e_{3v}} {e_{2v}}  \delta_{j+1/2} \left[ \chi \right]  \right]    \right\}    \\ % \intertext{Using \autoref{eq:DOM_di_adj}, it follows:} % &\equiv \sum\limits_{i,j,k} - \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] + \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\} \quad \equiv 0 \end{flalign*} \begin{flalign*} &\int\limits_D \chi \;\nabla_h \cdot \left[    \nabla_h              \left( A^{\,lm}\;\chi                    \right) - \nabla_h   \times  \left( A^{\,lm}\;\zeta \;\textbf{k} \right)    \right]\;  dv = A^{\,lm}   \int\limits_D \chi \;\nabla_h \cdot \nabla_h \left( \chi \right)\;  dv    \\ % &\equiv A^{\,lm}  \sum\limits_{i,j,k}  \frac{1} {e_{1t}\,e_{2t}\,e_{3t}}  \chi \left\{ \delta_i  \left[   \frac{e_{2u}\,e_{3u}} {e_{1u}}  \delta_{i+1/2} \left[ \chi \right]   \right] + \delta_j  \left[   \frac{e_{1v}\,e_{3v}} {e_{2v}}   \delta_{j+1/2} \left[ \chi \right]   \right] \right\} \;   e_{1t}\,e_{2t}\,e_{3t}    \\ % \intertext{Using \autoref{eq:DOM_di_adj}, it turns out to be:} % &\equiv - A^{\,lm} \sum\limits_{i,j,k} \left\{    \left(  \frac{1} {e_{1u}}  \delta_{i+1/2}  \left[ \chi \right]  \right)^2  b_u + \left(  \frac{1} {e_{2v}}  \delta_{j+1/2}  \left[ \chi \right]  \right)^2  b_v    \right\} \quad \leq 0             \\ &\int\limits_D \chi \;\nabla_h \cdot \left[    \nabla_h              \left( A^{\,lm}\;\chi                    \right) - \nabla_h   \times  \left( A^{\,lm}\;\zeta \;\textbf{k} \right)    \right]\;  dv = A^{\,lm}   \int\limits_D \chi \;\nabla_h \cdot \nabla_h \left( \chi \right)\;  dv    \\ % &\equiv A^{\,lm}  \sum\limits_{i,j,k}  \frac{1} {e_{1t}\,e_{2t}\,e_{3t}}  \chi \left\{ \delta_i  \left[   \frac{e_{2u}\,e_{3u}} {e_{1u}}  \delta_{i+1/2} \left[ \chi \right]   \right] + \delta_j  \left[   \frac{e_{1v}\,e_{3v}} {e_{2v}}   \delta_{j+1/2} \left[ \chi \right]   \right] \right\} \;   e_{1t}\,e_{2t}\,e_{3t}    \\ % \intertext{Using \autoref{eq:DOM_di_adj}, it turns out to be:} % &\equiv - A^{\,lm} \sum\limits_{i,j,k} \left\{    \left(  \frac{1} {e_{1u}}  \delta_{i+1/2}  \left[ \chi \right]  \right)^2  b_u + \left(  \frac{1} {e_{2v}}  \delta_{j+1/2}  \left[ \chi \right]  \right)^2  b_v    \right\} \quad \leq 0 \end{flalign*} The first two are associated with the conservation of momentum and the dissipation of horizontal kinetic energy: \begin{align*} \int\limits_D   \frac{1} {e_3 }\; \frac{\partial } {\partial k} \left(   \frac{A^{\,vm}} {e_3 }\; \frac{\partial \textbf{U}_h } {\partial k}   \right)\;  dv \qquad \quad &= \vec{\textbf{0}}    \\ % \intertext{and} % \int\limits_D \textbf{U}_h \cdot   \frac{1} {e_3 }\; \frac{\partial } {\partial k} \left(   \frac{A^{\,vm}} {e_3 }\; \frac{\partial \textbf{U}_h } {\partial k}   \right)\; dv    \quad &\leq 0     \\ \int\limits_D   \frac{1} {e_3 }\; \frac{\partial } {\partial k} \left(   \frac{A^{\,vm}} {e_3 }\; \frac{\partial \textbf{U}_h } {\partial k}   \right)\;  dv \qquad \quad &= \vec{\textbf{0}} % \intertext{and} % \int\limits_D \textbf{U}_h \cdot   \frac{1} {e_3 }\; \frac{\partial } {\partial k} \left(   \frac{A^{\,vm}} {e_3 }\; \frac{\partial \textbf{U}_h } {\partial k}   \right)\; dv    \quad &\leq 0 \end{align*} The second results from: \begin{flalign*} \int\limits_D \textbf{U}_h \cdot   \frac{1} {e_3 }\; \frac{\partial } {\partial k} \left( \frac{A^{\,vm}} {e_3 }\; \frac{\partial \textbf{U}_h } {\partial k}   \right)\;dv    &&&\\ \end{flalign*} \begin{flalign*} &\equiv \sum\limits_{i,j,k} \left( u\; \delta_k \left[ \frac{A_u^{\,vm}} {e_{3uw}} \delta_{k+1/2}  \left[ u \right]  \right]\;  e_{1u}\,e_{2u} + v\; \delta_k \left[ \frac{A_v^{\,vm}} {e_{3vw}} \delta_{k+1/2}   \left[ v \right]  \right]\;  e_{1v}\,e_{2v} \right)   &&&\\ % \intertext{since the horizontal scale factor does not depend on $k$, it follows:} % &\equiv - \sum\limits_{i,j,k} \left(  \frac{A_u^{\,vm}} {e_{3uw}} \left( \delta_{k+1/2} \left[ u \right] \right)^2\; e_{1u}\,e_{2u} + \frac{A_v^{\,vm}} {e_{3vw}}  \left( \delta_{k+1/2} \left[ v \right] \right)^2\; e_{1v}\,e_{2v}  \right) \quad \leq 0   &&&\\ \int\limits_D \textbf{U}_h \cdot   \frac{1} {e_3 }\; \frac{\partial } {\partial k} \left( \frac{A^{\,vm}} {e_3 }\; \frac{\partial \textbf{U}_h } {\partial k}   \right)\;dv    &&&\\ \end{flalign*} \begin{flalign*} &\equiv \sum\limits_{i,j,k} \left( u\; \delta_k \left[ \frac{A_u^{\,vm}} {e_{3uw}} \delta_{k+1/2}  \left[ u \right]  \right]\;  e_{1u}\,e_{2u} + v\; \delta_k \left[ \frac{A_v^{\,vm}} {e_{3vw}} \delta_{k+1/2}   \left[ v \right]  \right]\;  e_{1v}\,e_{2v} \right)   &&& % \intertext{since the horizontal scale factor does not depend on $k$, it follows:} % &\equiv - \sum\limits_{i,j,k} \left(  \frac{A_u^{\,vm}} {e_{3uw}} \left( \delta_{k+1/2} \left[ u \right] \right)^2\; e_{1u}\,e_{2u} + \frac{A_v^{\,vm}} {e_{3vw}}  \left( \delta_{k+1/2} \left[ v \right] \right)^2\; e_{1v}\,e_{2v}  \right) \quad \leq 0   &&& \end{flalign*} Indeed: \begin{flalign*} \int \limits_D \frac{1} {e_3 } \textbf{k} \cdot \nabla \times \left( \frac{1} {e_3 }\; \frac{\partial } {\partial k}  \left( \frac{A^{\,vm}} {e_3}\; \frac{\partial \textbf{U}_h } {\partial k} \right)  \right)\; dv   &&&\\ \end{flalign*} \begin{flalign*} \equiv \sum\limits_{i,j,k}  \frac{1} {e_{3f}}\; \frac{1} {e_{1f}\,e_{2f}} \bigg\{    \biggr.   \quad \delta_{i+1/2} &\left(   \frac{e_{2v}} {e_{3v}} \delta_k  \left[  \frac{1} {e_{3vw}} \delta_{k+1/2} \left[ v \right]  \right]  \right)   &&\\ \biggl. - \delta_{j+1/2} &\left(   \frac{e_{1u}} {e_{3u}} \delta_k \left[  \frac{1} {e_{3uw}}\delta_{k+1/2} \left[ u \right]  \right]   \right) \biggr\} \; e_{1f}\,e_{2f}\,e_{3f} \; \equiv 0   && \\ \int \limits_D \frac{1} {e_3 } \textbf{k} \cdot \nabla \times \left( \frac{1} {e_3 }\; \frac{\partial } {\partial k}  \left( \frac{A^{\,vm}} {e_3}\; \frac{\partial \textbf{U}_h } {\partial k} \right)  \right)\; dv   &&& \end{flalign*} \begin{flalign*} \equiv \sum\limits_{i,j,k}  \frac{1} {e_{3f}}\; \frac{1} {e_{1f}\,e_{2f}} \bigg\{    \biggr.   \quad \delta_{i+1/2} &\left(   \frac{e_{2v}} {e_{3v}} \delta_k  \left[  \frac{1} {e_{3vw}} \delta_{k+1/2} \left[ v \right]  \right]  \right)   &&\\ \biggl. - \delta_{j+1/2} &\left(   \frac{e_{1u}} {e_{3u}} \delta_k \left[  \frac{1} {e_{3uw}}\delta_{k+1/2} \left[ u \right]  \right]   \right) \biggr\} \; e_{1f}\,e_{2f}\,e_{3f} \; \equiv 0   && \end{flalign*} If the vertical diffusion coefficient is uniform over the whole domain, the enstrophy is dissipated, $i.e.$ \begin{flalign*} \int\limits_D \zeta \, \textbf{k} \cdot \nabla \times \left(   \frac{1} {e_3}\; \frac{\partial } {\partial k} \left( \frac{A^{\,vm}} {e_3 }\; \frac{\partial \textbf{U}_h } {\partial k}   \right)   \right)\; dv = 0   &&&\\ \int\limits_D \zeta \, \textbf{k} \cdot \nabla \times \left(   \frac{1} {e_3}\; \frac{\partial } {\partial k} \left( \frac{A^{\,vm}} {e_3 }\; \frac{\partial \textbf{U}_h } {\partial k}   \right)   \right)\; dv = 0   &&& \end{flalign*} This property is only satisfied in $z$-coordinates: \begin{flalign*} \int\limits_D \zeta \, \textbf{k} \cdot \nabla \times \left(  \frac{1} {e_3}\; \frac{\partial } {\partial k} \left( \frac{A^{\,vm}} {e_3 }\; \frac{\partial \textbf{U}_h } {\partial k}  \right)   \right)\; dv   &&& \\ \end{flalign*} \begin{flalign*} \equiv \sum\limits_{i,j,k} \zeta \;e_{3f} \; \biggl\{    \biggr.  \quad \delta_{i+1/2} &\left(   \frac{e_{2v}} {e_{3v}} \delta_k \left[ \frac{A_v^{\,vm}} {e_{3vw}} \delta_{k+1/2}[v]  \right]   \right)   &&\\ - \delta_{j+1/2} &\biggl. \left(   \frac{e_{1u}} {e_{3u}} \delta_k \left[ \frac{A_u^{\,vm}} {e_{3uw}} \delta_{k+1/2} [u]  \right]    \right) \biggr\}   &&\\ \end{flalign*} \begin{flalign*} \equiv \sum\limits_{i,j,k} \zeta \;e_{3f} \biggl\{    \biggr.  \quad \frac{1} {e_{3v}} \delta_k &\left[ \frac{A_v^{\,vm}} {e_{3vw}} \delta_{k+1/2} \left[ \delta_{i+1/2} \left[ e_{2v}\,v \right] \right]   \right]    &&\\ \biggl. - \frac{1} {e_{3u}} \delta_k &\left[  \frac{A_u^{\,vm}} {e_{3uw}} \delta_{k+1/2} \left[ \delta_{j+1/2} \left[ e_{1u}\,u \right] \right]  \right]  \biggr\}  &&\\ \int\limits_D \zeta \, \textbf{k} \cdot \nabla \times \left(  \frac{1} {e_3}\; \frac{\partial } {\partial k} \left( \frac{A^{\,vm}} {e_3 }\; \frac{\partial \textbf{U}_h } {\partial k}  \right)   \right)\; dv   &&& \end{flalign*} \begin{flalign*} \equiv \sum\limits_{i,j,k} \zeta \;e_{3f} \; \biggl\{  \biggr.  \quad \delta_{i+1/2} &\left(   \frac{e_{2v}} {e_{3v}} \delta_k \left[ \frac{A_v^{\,vm}} {e_{3vw}} \delta_{k+1/2}[v]  \right]   \right)   &&\\ - \delta_{j+1/2} &\biggl. \left(   \frac{e_{1u}} {e_{3u}} \delta_k \left[ \frac{A_u^{\,vm}} {e_{3uw}} \delta_{k+1/2} [u]  \right]    \right) \biggr\}   && \end{flalign*} \begin{flalign*} \equiv \sum\limits_{i,j,k} \zeta \;e_{3f} \biggl\{     \biggr.  \quad \frac{1} {e_{3v}} \delta_k &\left[ \frac{A_v^{\,vm}} {e_{3vw}} \delta_{k+1/2} \left[ \delta_{i+1/2} \left[ e_{2v}\,v \right] \right]   \right]    &&\\ \biggl. - \frac{1} {e_{3u}} \delta_k &\left[  \frac{A_u^{\,vm}} {e_{3uw}} \delta_{k+1/2} \left[ \delta_{j+1/2} \left[ e_{1u}\,u \right] \right]  \right]  \biggr\}  && \end{flalign*} Using the fact that the vertical diffusion coefficients are uniform, $e_{3f} =e_{3u} =e_{3v} =e_{3t}$ and $e_{3w} =e_{3uw} =e_{3vw}$, it follows: \begin{flalign*} \equiv A^{\,vm} \sum\limits_{i,j,k} \zeta \;\delta_k \left[   \frac{1} {e_{3w}} \delta_{k+1/2} \Bigl[   \delta_{i+1/2} \left[ e_{2v}\,v \right] - \delta_{j+1/ 2} \left[ e_{1u}\,u \right]   \Bigr]    \right]    &&&\\ \end{flalign*} \begin{flalign*} \equiv - A^{\,vm} \sum\limits_{i,j,k} \frac{1} {e_{3w}} \left( \delta_{k+1/2} \left[ \zeta  \right] \right)^2 \; e_{1f}\,e_{2f}  \; \leq 0    &&&\\ \equiv A^{\,vm} \sum\limits_{i,j,k} \zeta \;\delta_k \left[   \frac{1} {e_{3w}} \delta_{k+1/2} \Bigl[   \delta_{i+1/2} \left[ e_{2v}\,v \right] - \delta_{j+1/ 2} \left[ e_{1u}\,u \right]   \Bigr]    \right]    &&& \end{flalign*} \begin{flalign*} \equiv - A^{\,vm} \sum\limits_{i,j,k} \frac{1} {e_{3w}} \left( \delta_{k+1/2} \left[ \zeta  \right] \right)^2 \; e_{1f}\,e_{2f}  \; \leq 0    &&& \end{flalign*} Similarly, the horizontal divergence is obviously conserved: \begin{flalign*} \int\limits_D \nabla \cdot \left( \frac{1} {e_3 }\; \frac{\partial } {\partial k} \left( \frac{A^{\,vm}} {e_3 }\; \frac{\partial \textbf{U}_h } {\partial k} \right) \right)\; dv = 0    &&&\\ \int\limits_D \nabla \cdot \left( \frac{1} {e_3 }\; \frac{\partial } {\partial k} \left( \frac{A^{\,vm}} {e_3 }\; \frac{\partial \textbf{U}_h } {\partial k} \right) \right)\; dv = 0    &&& \end{flalign*} and the square of the horizontal divergence decreases ($i.e.$ the horizontal divergence is dissipated) if \begin{flalign*} \int\limits_D \chi \;\nabla \cdot \left( \frac{1} {e_3 }\; \frac{\partial } {\partial k} \left( \frac{A^{\,vm}} {e_3 }\; \frac{\partial \textbf{U}_h } {\partial k}  \right) \right)\;  dv = 0  &&&\\ \int\limits_D \chi \;\nabla \cdot \left( \frac{1} {e_3 }\; \frac{\partial } {\partial k} \left( \frac{A^{\,vm}} {e_3 }\; \frac{\partial \textbf{U}_h } {\partial k}  \right) \right)\;  dv = 0  &&& \end{flalign*} This property is only satisfied in the $z$-coordinate: \begin{flalign*} \int\limits_D \chi \;\nabla \cdot \left( \frac{1} {e_3 }\; \frac{\partial } {\partial k} \left( \frac{A^{\,vm}} {e_3 }\; \frac{\partial \textbf{U}_h } {\partial k} \right)  \right)\; dv    &&&\\ \end{flalign*} \begin{flalign*} \equiv \sum\limits_{i,j,k} \frac{\chi } {e_{1t}\,e_{2t}} \biggl\{    \Biggr.  \quad \delta_{i+1/2} &\left(   \frac{e_{2u}} {e_{3u}} \delta_k \left[ \frac{A_u^{\,vm}} {e_{3uw}} \delta_{k+1/2} [u] \right] \right)    &&\\ \Biggl. + \delta_{j+1/2} &\left( \frac{e_{1v}} {e_{3v}} \delta_k \left[ \frac{A_v^{\,vm}} {e_{3vw}} \delta_{k+1/2} [v] \right]   \right) \Biggr\} \;  e_{1t}\,e_{2t}\,e_{3t}   &&\\ \end{flalign*} \begin{flalign*} \equiv A^{\,vm} \sum\limits_{i,j,k}  \chi \, \biggl\{ \biggr.  \quad \delta_{i+1/2} &\left( \delta_k \left[ \frac{1} {e_{3uw}} \delta_{k+1/2} \left[ e_{2u}\,u \right] \right]   \right)    && \\ \biggl. + \delta_{j+1/2} &\left(    \delta_k \left[ \frac{1} {e_{3vw}} \delta_{k+1/2} \left[ e_{1v}\,v \right] \right]   \right)   \biggr\}    && \\ \end{flalign*} \begin{flalign*} \equiv -A^{\,vm} \sum\limits_{i,j,k} \frac{\delta_{k+1/2} \left[ \chi \right]} {e_{3w}}\; \biggl\{ \delta_{k+1/2} \Bigl[ \delta_{i+1/2} \left[ e_{2u}\,u \right] + \delta_{j+1/2} \left[ e_{1v}\,v \right]  \Bigr]    \biggr\}    &&&\\ \end{flalign*} \begin{flalign*} \equiv -A^{\,vm} \sum\limits_{i,j,k} \frac{1} {e_{3w}} \delta_{k+1/2} \left[ \chi \right]\; \delta_{k+1/2} \left[ e_{1t}\,e_{2t} \;\chi \right]   &&&\\ \end{flalign*} \begin{flalign*} \equiv -A^{\,vm} \sum\limits_{i,j,k} \frac{e_{1t}\,e_{2t}} {e_{3w}}\; \left( \delta_{k+1/2} \left[ \chi \right]  \right)^2     \quad  \equiv 0    &&&\\ \int\limits_D \chi \;\nabla \cdot \left( \frac{1} {e_3 }\; \frac{\partial } {\partial k} \left( \frac{A^{\,vm}} {e_3 }\; \frac{\partial \textbf{U}_h } {\partial k} \right)  \right)\; dv    &&& \end{flalign*} \begin{flalign*} \equiv \sum\limits_{i,j,k} \frac{\chi } {e_{1t}\,e_{2t}} \biggl\{  \Biggr.  \quad \delta_{i+1/2} &\left(   \frac{e_{2u}} {e_{3u}} \delta_k \left[ \frac{A_u^{\,vm}} {e_{3uw}} \delta_{k+1/2} [u] \right] \right)    &&\\ \Biggl. + \delta_{j+1/2} &\left( \frac{e_{1v}} {e_{3v}} \delta_k \left[ \frac{A_v^{\,vm}} {e_{3vw}} \delta_{k+1/2} [v] \right]   \right) \Biggr\} \;  e_{1t}\,e_{2t}\,e_{3t}   && \end{flalign*} \begin{flalign*} \equiv A^{\,vm} \sum\limits_{i,j,k}  \chi \, \biggl\{  \biggr.  \quad \delta_{i+1/2} &\left( \delta_k \left[ \frac{1} {e_{3uw}} \delta_{k+1/2} \left[ e_{2u}\,u \right] \right]   \right)    && \\ \biggl. + \delta_{j+1/2} &\left(    \delta_k \left[ \frac{1} {e_{3vw}} \delta_{k+1/2} \left[ e_{1v}\,v \right] \right]   \right)   \biggr\}    && \end{flalign*} \begin{flalign*} \equiv -A^{\,vm} \sum\limits_{i,j,k} \frac{\delta_{k+1/2} \left[ \chi \right]} {e_{3w}}\; \biggl\{ \delta_{k+1/2} \Bigl[ \delta_{i+1/2} \left[ e_{2u}\,u \right] + \delta_{j+1/2} \left[ e_{1v}\,v \right]  \Bigr]    \biggr\}    &&& \end{flalign*} \begin{flalign*} \equiv -A^{\,vm} \sum\limits_{i,j,k} \frac{1} {e_{3w}} \delta_{k+1/2} \left[ \chi \right]\; \delta_{k+1/2} \left[ e_{1t}\,e_{2t} \;\chi \right]   &&& \end{flalign*} \begin{flalign*} \equiv -A^{\,vm} \sum\limits_{i,j,k} \frac{e_{1t}\,e_{2t}} {e_{3w}}\; \left( \delta_{k+1/2} \left[ \chi \right]  \right)^2     \quad  \equiv 0    &&& \end{flalign*} constraint of conservation of tracers: \begin{flalign*} &\int\limits_D  \nabla  \cdot \left( A\;\nabla T \right)\;dv  &&&\\ \\ &\equiv \sum\limits_{i,j,k} \biggl\{    \biggr. \delta_i \left[ A_u^{\,lT} \frac{e_{2u}\,e_{3u}} {e_{1u}} \delta_{i+1/2} \left[ T \right] \right] + \delta_j \left[ A_v^{\,lT} \frac{e_{1v}\,e_{3v}} {e_{2v}} \delta_{j+1/2} \left[ T \right] \right] &&\\  & \qquad \qquad \qquad \qquad \qquad \qquad \quad \;\;\; + \delta_k \left[ A_w^{\,vT} \frac{e_{1t}\,e_{2t}} {e_{3t}} \delta_{k+1/2} \left[ T \right] \right] \biggr\}   \quad  \equiv 0 &&\\ &\int\limits_D  \nabla  \cdot \left( A\;\nabla T \right)\;dv  &&& \\ \\ &\equiv \sum\limits_{i,j,k} \biggl\{  \biggr. \delta_i \left[ A_u^{\,lT} \frac{e_{2u}\,e_{3u}} {e_{1u}} \delta_{i+1/2} \left[ T \right] \right] + \delta_j \left[ A_v^{\,lT} \frac{e_{1v}\,e_{3v}} {e_{2v}} \delta_{j+1/2} \left[ T \right] \right] && \\ & \qquad \qquad \qquad \qquad \qquad \qquad \quad \;\;\; + \delta_k \left[ A_w^{\,vT} \frac{e_{1t}\,e_{2t}} {e_{3t}} \delta_{k+1/2} \left[ T \right] \right] \biggr\}   \quad  \equiv 0 && \end{flalign*} constraint on the dissipation of tracer variance: \begin{flalign*} \int\limits_D T\;\nabla & \cdot \left( A\;\nabla T \right)\;dv &&&\\ &\equiv   \sum\limits_{i,j,k} \; T \biggl\{  \biggr. \delta_i \left[ A_u^{\,lT} \frac{e_{2u}\,e_{3u}} {e_{1u}} \delta_{i+1/2} \left[T\right] \right] & + \delta_j \left[ A_v^{\,lT} \frac{e_{1v} \,e_{3v}} {e_{2v}} \delta_{j+1/2} \left[T\right] \right] \quad&& \\ \biggl. &&+ \delta_k \left[A_w^{\,vT}\frac{e_{1t}\,e_{2t}} {e_{3t}}\delta_{k+1/2}\left[T\right]\right] \biggr\} && \end{flalign*} \begin{flalign*} \equiv - \sum\limits_{i,j,k} \biggl\{    \biggr.  \quad &    A_u^{\,lT} \left( \frac{1} {e_{1u}} \delta_{i+1/2} \left[ T \right]  \right)^2   e_{1u}\,e_{2u}\,e_{3u}    && \\ & + A_v^{\,lT} \left( \frac{1} {e_{2v}} \delta_{j+1/2} \left[ T \right]  \right)^2   e_{1v}\,e_{2v}\,e_{3v}     && \\ \biggl. & + A_w^{\,vT} \left( \frac{1} {e_{3w}} \delta_{k+1/2} \left[ T \right]   \right)^2    e_{1w}\,e_{2w}\,e_{3w}   \biggr\} \quad      \leq 0      && \\ \end{flalign*} \int\limits_D T\;\nabla & \cdot \left( A\;\nabla T \right)\;dv  &&&\\ &\equiv   \sum\limits_{i,j,k} \; T \biggl\{  \biggr. \delta_i \left[ A_u^{\,lT} \frac{e_{2u}\,e_{3u}} {e_{1u}} \delta_{i+1/2} \left[T\right] \right] & + \delta_j \left[ A_v^{\,lT} \frac{e_{1v} \,e_{3v}} {e_{2v}} \delta_{j+1/2} \left[T\right] \right] \quad&& \\ \biggl. &&+ \delta_k \left[A_w^{\,vT}\frac{e_{1t}\,e_{2t}} {e_{3t}}\delta_{k+1/2}\left[T\right]\right] \biggr\} && \end{flalign*} \begin{flalign*} \equiv - \sum\limits_{i,j,k} \biggl\{  \biggr.  \quad &    A_u^{\,lT} \left( \frac{1} {e_{1u}} \delta_{i+1/2} \left[ T \right]  \right)^2   e_{1u}\,e_{2u}\,e_{3u}    && \\ & + A_v^{\,lT} \left( \frac{1} {e_{2v}} \delta_{j+1/2} \left[ T \right]  \right)^2   e_{1v}\,e_{2v}\,e_{3v}     && \\ \biggl. & + A_w^{\,vT} \left( \frac{1} {e_{3w}} \delta_{k+1/2} \left[ T \right]   \right)^2    e_{1w}\,e_{2w}\,e_{3w}   \biggr\} \quad      \leq 0      && \end{flalign*} %%%%  end of appendix in gm comment %} \biblio \end{document}
• ## NEMO/trunk/doc/latex/NEMO/subfiles/annex_D.tex

 r10354 \documentclass[../tex_main/NEMO_manual]{subfiles} \documentclass[../main/NEMO_manual]{subfiles} \begin{document} % ================================================================ % Appendix D Ñ Coding Rules % Appendix D Coding Rules % ================================================================ \chapter{Coding Rules} \label{apdx:D} \minitoc \newpage $\$\newline    % force a new ligne $\$\newline    % force a new ligne A "model life" is more than ten years. - use call to ctl\_stop routine instead of just a STOP. \newpage % ================================================================ % Naming Conventions %--------------------------------------------------TABLE-------------------------------------------------- \begin{table}[htbp]  \label{tab:VarName} \begin{center} \begin{tabular}{|p{45pt}|p{35pt}|p{45pt}|p{40pt}|p{40pt}|p{40pt}|p{40pt}|p{40pt}|} \hline  Type \par / Status &   integer&   real&   logical &   character  & structure &   double \par precision&   complex \\ \hline public  \par or  \par module variable& \textbf{m n} \par \textit{but not} \par \textbf{nn\_ np\_}& \textbf{a b e f g h o q r} \par \textbf{t} \textit{to} \textbf{x} \par but not \par \textbf{fs rn\_}& \textbf{l} \par \textit{but not} \par \textbf{lp ld} \par \textbf{ ll ln\_}& \textbf{c} \par \textit{but not} \par \textbf{cp cd} \par \textbf{cl cn\_}& \textbf{s} \par \textit{but not} \par \textbf{sd sd} \par \textbf{sl sn\_}& \textbf{d} \par \textit{but not} \par \textbf{dp dd} \par \textbf{dl dn\_}& \textbf{y} \par \textit{but not} \par \textbf{yp yd} \par \textbf{yl yn} \\ \hline dummy \par argument& \textbf{k} \par \textit{but not} \par \textbf{kf}& \textbf{p} \par \textit{but not} \par \textbf{pp pf}& \textbf{ld}& \textbf{cd}& \textbf{sd}& \textbf{dd}& \textbf{yd} \\ \hline local \par variable& \textbf{i}& \textbf{z}& \textbf{ll}& \textbf{cl}& \textbf{sl}& \textbf{dl}& \textbf{yl} \\ \hline loop \par control& \textbf{j} \par \textit{but not} \par \textbf{jp}& & & & & & \\ \hline parameter& \textbf{jp np\_}& \textbf{pp}& \textbf{lp}& \textbf{cp}& \textbf{sp}& \textbf{dp}& \textbf{yp} \\ \hline namelist& \textbf{nn\_}& \textbf{rn\_}& \textbf{ln\_}& \textbf{cn\_}& \textbf{sn\_}& \textbf{dn\_}& \textbf{yn\_} \\ \hline CPP \par macro& \textbf{kf}& \textbf{fs} \par & & & & & \\ \hline \end{tabular} \label{tab:tab1} \end{center} \begin{table}[htbp] \label{tab:VarName} \begin{center} \begin{tabular}{|p{45pt}|p{35pt}|p{45pt}|p{40pt}|p{40pt}|p{40pt}|p{40pt}|p{40pt}|} \hline Type \par / Status & integer & real & logical & character & structure & double \par precision & complex \\ \hline public  \par or  \par module variable & \textbf{m n} \par \textit{but not} \par \textbf{nn\_ np\_} & \textbf{a b e f g h o q r} \par \textbf{t} \textit{to} \textbf{x} \par but not \par \textbf{fs rn\_} & \textbf{l} \par \textit{but not} \par \textbf{lp ld} \par \textbf{ ll ln\_} & \textbf{c} \par \textit{but not} \par \textbf{cp cd} \par \textbf{cl cn\_} & \textbf{s} \par \textit{but not} \par \textbf{sd sd} \par \textbf{sl sn\_} & \textbf{d} \par \textit{but not} \par \textbf{dp dd} \par \textbf{dl dn\_} & \textbf{y} \par \textit{but not} \par \textbf{yp yd} \par \textbf{yl yn} \\ \hline dummy \par argument & \textbf{k} \par \textit{but not} \par \textbf{kf} & \textbf{p} \par \textit{but not} \par \textbf{pp pf} & \textbf{ld} & \textbf{cd} & \textbf{sd} & \textbf{dd} & \textbf{yd} \\ \hline local \par variable & \textbf{i} & \textbf{z} & \textbf{ll} & \textbf{cl} & \textbf{sl} & \textbf{dl} & \textbf{yl} \\ \hline loop \par control & \textbf{j} \par \textit{but not} \par \textbf{jp} &&&&&& \\ \hline parameter & \textbf{jp np\_} & \textbf{pp} & \textbf{lp} & \textbf{cp} & \textbf{sp} & \textbf{dp} & \textbf{yp} \\ \hline namelist & \textbf{nn\_} & \textbf{rn\_} & \textbf{ln\_} & \textbf{cn\_} & \textbf{sn\_} & \textbf{dn\_} & \textbf{yn\_} \\ \hline CPP \par macro & \textbf{kf} & \textbf{fs} \par &&&&& \\ \hline \end{tabular} \label{tab:tab1} \end{center} \end{table} %-------------------------------------------------------------------------------------------------------------- \newpage % ================================================================ % The program structure % ================================================================ %\section{Program structure} %abel{sec:Apdx_D_structure} %\label{sec:Apdx_D_structure} %To be done.... \biblio \end{document}
• ## NEMO/trunk/doc/latex/NEMO/subfiles/annex_E.tex

 r10406 \documentclass[../tex_main/NEMO_manual]{subfiles} \documentclass[../main/NEMO_manual]{subfiles} \begin{document} % ================================================================ \chapter{Note on some algorithms} \label{apdx:E} \minitoc \newpage $\$\newline    % force a new ligne This appendix some on going consideration on algorithms used or planned to be used in \NEMO. $\$\newline    % force a new ligne % ------------------------------------------------------------------------------------------------------------- It is also known as Cell Averaged QUICK scheme (Quadratic Upstream Interpolation for Convective Kinematics). For example, in the $i$-direction: \label{eq:tra_adv_ubs2} \tau_u^{ubs} = \left\{   \begin{aligned} & \tau_u^{cen4} + \frac{1}{12} \,\tau"_i      & \quad \text{if }\ u_{i+1/2} \geqslant 0 \\ & \tau_u^{cen4} - \frac{1}{12} \,\tau"_{i+1} & \quad \text{if }\ u_{i+1/2}       <       0 \end{aligned}    \right. \label{eq:tra_adv_ubs2} \tau_u^{ubs} = \left\{ \begin{aligned} & \tau_u^{cen4} + \frac{1}{12} \,\tau"_i     & \quad \text{if }\ u_{i+1/2} \geqslant 0 \\ & \tau_u^{cen4} - \frac{1}{12} \,\tau"_{i+1} & \quad \text{if }\ u_{i+1/2}       <       0 \end{aligned} \right. or equivalently, the advective flux is \label{eq:tra_adv_ubs2} U_{i+1/2} \ \tau_u^{ubs} =U_{i+1/2} \ \overline{ T_i - \frac{1}{6}\,\tau"_i }^{\,i+1/2} - \frac{1}{2}\, |U|_{i+1/2} \;\frac{1}{6} \;\delta_{i+1/2}[\tau"_i] \label{eq:tra_adv_ubs2} U_{i+1/2} \ \tau_u^{ubs} =U_{i+1/2} \ \overline{ T_i - \frac{1}{6}\,\tau"_i }^{\,i+1/2} - \frac{1}{2}\, |U|_{i+1/2} \;\frac{1}{6} \;\delta_{i+1/2}[\tau"_i] where $U_{i+1/2} = e_{1u}\,e_{3u}\,u_{i+1/2}$ and Alternative choice: introduce the scale factors: $\tau "_i =\frac{e_{1T}}{e_{2T}\,e_{3T}}\delta_i \left[ \frac{e_{2u} e_{3u} }{e_{1u} }\delta_{i+1/2}[\tau] \right]$. This results in a dissipatively dominant (i.e. hyper-diffusive) truncation error NB 3: It is straight forward to rewrite \autoref{eq:tra_adv_ubs} as follows: \label{eq:tra_adv_ubs2} \tau_u^{ubs} = \left\{   \begin{aligned} & \tau_u^{cen4} + \frac{1}{12} \tau"_i    & \quad \text{if }\ u_{i+1/2} \geqslant 0 \\ & \tau_u^{cen4} - \frac{1}{12} \tau"_{i+1}   & \quad \text{if }\ u_{i+1/2}       <       0 \end{aligned}    \right. \label{eq:tra_adv_ubs2} \tau_u^{ubs} = \left\{ \begin{aligned} & \tau_u^{cen4} + \frac{1}{12} \tau"_i    & \quad \text{if }\ u_{i+1/2} \geqslant 0 \\ & \tau_u^{cen4} - \frac{1}{12} \tau"_{i+1}   & \quad \text{if }\ u_{i+1/2}       <       0 \end{aligned} \right. or equivalently \label{eq:tra_adv_ubs2} \begin{split} e_{2u} e_{3u}\,u_{i+1/2} \ \tau_u^{ubs} &= e_{2u} e_{3u}\,u_{i+1/2} \ \overline{ T - \frac{1}{6}\,\tau"_i }^{\,i+1/2} \\ & - \frac{1}{2} e_{2u} e_{3u}\,|u|_{i+1/2} \;\frac{1}{6} \;\delta_{i+1/2}[\tau"_i] \end{split} \label{eq:tra_adv_ubs2} \begin{split} e_{2u} e_{3u}\,u_{i+1/2} \ \tau_u^{ubs} &= e_{2u} e_{3u}\,u_{i+1/2} \ \overline{ T - \frac{1}{6}\,\tau"_i }^{\,i+1/2} \\ & - \frac{1}{2} e_{2u} e_{3u}\,|u|_{i+1/2} \;\frac{1}{6} \;\delta_{i+1/2}[\tau"_i] \end{split} \autoref{eq:tra_adv_ubs2} has several advantages. laplacian diffusion: \label{eq:tra_ldf_lap} \begin{split} D_T^{lT} =\frac{1}{e_{1T} \; e_{2T}\;  e_{3T} } &\left[ {\quad \delta_i \left[ {A_u^{lT} \frac{e_{2u} e_{3u} }{e_{1u} }\;\delta_{i+1/2} \left[ T \right]} \right]} \right. \\ &\ \left. {+\; \delta_j \left[ {A_v^{lT} \left( {\frac{e_{1v} e_{3v} }{e_{2v} }\;\delta_{j+1/2} \left[ T \right]} \right)} \right]\quad } \right] \end{split} \label{eq:tra_ldf_lap} \begin{split} D_T^{lT} =\frac{1}{e_{1T} \; e_{2T}\;  e_{3T} } &\left[ {\quad \delta_i \left[ {A_u^{lT} \frac{e_{2u} e_{3u} }{e_{1u} }\;\delta_{i+1/2} \left[ T \right]} \right]} \right. \\ &\ \left. {+\; \delta_j \left[ {A_v^{lT} \left( {\frac{e_{1v} e_{3v} }{e_{2v} }\;\delta_{j+1/2} \left[ T \right]} \right)} \right]\quad } \right] \end{split} bilaplacian: \label{eq:tra_ldf_lap} \begin{split} D_T^{lT} =&-\frac{1}{e_{1T} \; e_{2T}\;  e_{3T}} \\ & \delta_i \left[  \sqrt{A_u^{lT}}\ \frac{e_{2u}\,e_{3u}}{e_{1u}}\;\delta_{i+1/2} \left[ \frac{1}{e_{1T}\,e_{2T}\, e_{3T}} \delta_i \left[ \sqrt{A_u^{lT}}\ \frac{e_{2u}\,e_{3u}}{e_{1u}}\;\delta_{i+1/2} [T] \right] \right] \right] \end{split} \label{eq:tra_ldf_lap} \begin{split} D_T^{lT} =&-\frac{1}{e_{1T} \; e_{2T}\;  e_{3T}} \\ & \delta_i \left[  \sqrt{A_u^{lT}}\ \frac{e_{2u}\,e_{3u}}{e_{1u}}\;\delta_{i+1/2} \left[ \frac{1}{e_{1T}\,e_{2T}\, e_{3T}} \delta_i \left[ \sqrt{A_u^{lT}}\ \frac{e_{2u}\,e_{3u}}{e_{1u}}\;\delta_{i+1/2} [T] \right] \right] \right] \end{split} with ${A_u^{lT}}^2 = \frac{1}{12} {e_{1u}}^3\ |u|$, $i.e.$ $A_u^{lT} = \frac{1}{\sqrt{12}} \,e_{1u}\ \sqrt{ e_{1u}\,|u|\,}$ it comes: \label{eq:tra_ldf_lap} \begin{split} D_T^{lT} =&-\frac{1}{12}\,\frac{1}{e_{1T} \; e_{2T}\;  e_{3T}} \\ & \delta_i \left[ e_{2u}\,e_{3u}\,\sqrt{ e_{1u}\,|u|\,}\;\delta_{i+1/2} \left[ \frac{1}{e_{1T}\,e_{2T}\, e_{3T}} \delta_i \left[ e_{2u}\,e_{3u}\,\sqrt{ e_{1u}\,|u|\,}\;\delta_{i+1/2} [T] \right] \right] \right] \end{split} \label{eq:tra_ldf_lap} \begin{split} D_T^{lT} =&-\frac{1}{12}\,\frac{1}{e_{1T} \; e_{2T}\;  e_{3T}} \\ & \delta_i \left[ e_{2u}\,e_{3u}\,\sqrt{ e_{1u}\,|u|\,}\;\delta_{i+1/2} \left[ \frac{1}{e_{1T}\,e_{2T}\, e_{3T}} \delta_i \left[ e_{2u}\,e_{3u}\,\sqrt{ e_{1u}\,|u|\,}\;\delta_{i+1/2} [T] \right] \right] \right] \end{split} if the velocity is uniform ($i.e.$ $|u|=cst$) then the diffusive flux is \label{eq:tra_ldf_lap} \begin{split} F_u^{lT} = - \frac{1}{12} e_{2u}\,e_{3u}\,|u| \;\sqrt{ e_{1u}}\,\delta_{i+1/2} \left[ \frac{1}{e_{1T}\,e_{2T}\, e_{3T}} \delta_i \left[ e_{2u}\,e_{3u}\,\sqrt{ e_{1u}}\:\delta_{i+1/2} [T] \right] \right] \end{split} \label{eq:tra_ldf_lap} \begin{split} F_u^{lT} = - \frac{1}{12} e_{2u}\,e_{3u}\,|u| \;\sqrt{ e_{1u}}\,\delta_{i+1/2} \left[ \frac{1}{e_{1T}\,e_{2T}\, e_{3T}} \delta_i \left[ e_{2u}\,e_{3u}\,\sqrt{ e_{1u}}\:\delta_{i+1/2} [T] \right] \right] \end{split} beurk....  reverte the logic: starting from the diffusive part of the advective flux it comes: \label{eq:tra_adv_ubs2} \begin{split} F_u^{lT} &= - \frac{1}{2} e_{2u} e_{3u}\,|u|_{i+1/2} \;\frac{1}{6} \;\delta_{i+1/2}[\tau"_i] \end{split} \label{eq:tra_adv_ubs2} \begin{split} F_u^{lT} &= - \frac{1}{2} e_{2u} e_{3u}\,|u|_{i+1/2} \;\frac{1}{6} \;\delta_{i+1/2}[\tau"_i] \end{split} if the velocity is uniform ($i.e.$ $|u|=cst$) and sol 1 coefficient at T-point ( add $e_{1u}$ and $e_{1T}$ on both side of first $\delta$): \label{eq:tra_adv_ubs2} \begin{split} F_u^{lT} &= - \frac{1}{12} \frac{e_{2u} e_{3u}}{e_{1u}}\;\delta_{i+1/2}\left[ \frac{e_{1T}^3\,|u|}{e_{1T}e_{2T}\,e_{3T}}\,\delta_i \left[ \frac{e_{2u} e_{3u} }{e_{1u} } \delta_{i+1/2}[\tau] \right] \right] \end{split} \label{eq:tra_adv_ubs2} \begin{split} F_u^{lT} &= - \frac{1}{12} \frac{e_{2u} e_{3u}}{e_{1u}}\;\delta_{i+1/2}\left[ \frac{e_{1T}^3\,|u|}{e_{1T}e_{2T}\,e_{3T}}\,\delta_i \left[ \frac{e_{2u} e_{3u} }{e_{1u} } \delta_{i+1/2}[\tau] \right] \right] \end{split} which leads to ${A_T^{lT}}^2 = \frac{1}{12} {e_{1T}}^3\ \overline{|u|}^{\,i+1/2}$ sol 2 coefficient at u-point: split $|u|$ into $\sqrt{|u|}$ and $e_{1T}$ into $\sqrt{e_{1u}}$ \label{eq:tra_adv_ubs2} \begin{split} F_u^{lT} &= - \frac{1}{12} {e_{1u}}^1 \sqrt{e_{1u}|u|} \frac{e_{2u} e_{3u}}{e_{1u}}\;\delta_{i+1/2}\left[ \frac{1}{e_{2T}\,e_{3T}}\,\delta_i \left[ \sqrt{e_{1u}|u|} \frac{e_{2u} e_{3u} }{e_{1u} } \delta_{i+1/2}[\tau] \right] \right] \\ &= - \frac{1}{12} e_{1u} \sqrt{e_{1u}|u|\,} \frac{e_{2u} e_{3u}}{e_{1u}}\;\delta_{i+1/2}\left[ \frac{1}{e_{1T}\,e_{2T}\,e_{3T}}\,\delta_i \left[ e_{1u} \sqrt{e_{1u}|u|\,} \frac{e_{2u} e_{3u} }{e_{1u}} \delta_{i+1/2}[\tau] \right] \right] \end{split} \label{eq:tra_adv_ubs2} \begin{split} F_u^{lT} &= - \frac{1}{12} {e_{1u}}^1 \sqrt{e_{1u}|u|} \frac{e_{2u} e_{3u}}{e_{1u}}\;\delta_{i+1/2}\left[ \frac{1}{e_{2T}\,e_{3T}}\,\delta_i \left[ \sqrt{e_{1u}|u|} \frac{e_{2u} e_{3u} }{e_{1u} } \delta_{i+1/2}[\tau] \right] \right] \\ &= - \frac{1}{12} e_{1u} \sqrt{e_{1u}|u|\,} \frac{e_{2u} e_{3u}}{e_{1u}}\;\delta_{i+1/2}\left[ \frac{1}{e_{1T}\,e_{2T}\,e_{3T}}\,\delta_i \left[ e_{1u} \sqrt{e_{1u}|u|\,} \frac{e_{2u} e_{3u} }{e_{1u}} \delta_{i+1/2}[\tau] \right] \right] \end{split} which leads to ${A_u^{lT}} = \frac{1}{12} {e_{1u}}^3\ |u|$ % ------------------------------------------------------------------------------------------------------------- Given the values of a variable $q$ at successive time step, the time derivation and averaging operators at the mid time step are: \begin{subequations} \label{eq:dt_mt} \begin{align} \delta_{t+\rdt/2} [q]     &=  \  \ \,   q^{t+\rdt}  - q^{t}      \\ \overline q^{\,t+\rdt/2} &= \left\{ q^{t+\rdt} + q^{t} \right\} \; / \; 2 \end{align} \end{subequations} $% \label{eq:dt_mt} \begin{split} \delta_{t+\rdt/2} [q] &= \ \ \, q^{t+\rdt} - q^{t} \\ \overline q^{\,t+\rdt/2} &= \left\{ q^{t+\rdt} + q^{t} \right\} \; / \; 2 \end{split}$ As for space operator, the adjoint of the derivation and averaging time operators are $\delta_t^*=\delta_{t+\rdt/2}$ and The Leap-frog time stepping given by \autoref{eq:DOM_nxt} can be defined as: \label{eq:LF} \frac{\partial q}{\partial t} \equiv \frac{1}{\rdt} \overline{ \delta_{t+\rdt/2}[q]}^{\,t} =         \frac{q^{t+\rdt}-q^{t-\rdt}}{2\rdt} $% \label{eq:LF} \frac{\partial q}{\partial t} \equiv \frac{1}{\rdt} \overline{ \delta_{t+\rdt/2}[q]}^{\,t} = \frac{q^{t+\rdt}-q^{t-\rdt}}{2\rdt}$ Note that \autoref{chap:LF} shows that the leapfrog time step is $\rdt$, not $2\rdt$ as it can be found sometimes in literature. The leap-Frog time stepping is a second order centered scheme. As such it respects the quadratic invariant in integral forms, $i.e.$ the following continuous property, \label{eq:Energy} \int_{t_0}^{t_1} {q\, \frac{\partial q}{\partial t} \;dt} =\int_{t_0}^{t_1} {\frac{1}{2}\, \frac{\partial q^2}{\partial t} \;dt} =  \frac{1}{2} \left( {q_{t_1}}^2 - {q_{t_0}}^2 \right) , $% \label{eq:Energy} \int_{t_0}^{t_1} {q\, \frac{\partial q}{\partial t} \;dt} =\int_{t_0}^{t_1} {\frac{1}{2}\, \frac{\partial q^2}{\partial t} \;dt} = \frac{1}{2} \left( {q_{t_1}}^2 - {q_{t_0}}^2 \right) ,$ is satisfied in discrete form. Indeed, \begin{split} \int_{t_0}^{t_1} {q\, \frac{\partial q}{\partial t} \;dt} &\equiv \sum\limits_{0}^{N} {\frac{1}{\rdt} q^t \ \overline{ \delta_{t+\rdt/2}[q]}^{\,t} \ \rdt} \equiv \sum\limits_{0}^{N}  { q^t \ \overline{ \delta_{t+\rdt/2}[q]}^{\,t} } \\ &\equiv \sum\limits_{0}^{N}  { \overline{q}^{\,t+\Delta/2}{ \delta_{t+\rdt/2}[q]}} \equiv \sum\limits_{0}^{N}  { \frac{1}{2} \delta_{t+\rdt/2}[q^2] }\\ &\equiv \sum\limits_{0}^{N}  { \frac{1}{2} \delta_{t+\rdt/2}[q^2] } \equiv \frac{1}{2} \left( {q_{t_1}}^2 - {q_{t_0}}^2 \right) \end{split} $\begin{split} \int_{t_0}^{t_1} {q\, \frac{\partial q}{\partial t} \;dt} &\equiv \sum\limits_{0}^{N} {\frac{1}{\rdt} q^t \ \overline{ \delta_{t+\rdt/2}[q]}^{\,t} \ \rdt} \equiv \sum\limits_{0}^{N} { q^t \ \overline{ \delta_{t+\rdt/2}[q]}^{\,t} } \\ &\equiv \sum\limits_{0}^{N} { \overline{q}^{\,t+\Delta/2}{ \delta_{t+\rdt/2}[q]}} \equiv \sum\limits_{0}^{N} { \frac{1}{2} \delta_{t+\rdt/2}[q^2] }\\ &\equiv \sum\limits_{0}^{N} { \frac{1}{2} \delta_{t+\rdt/2}[q^2] } \equiv \frac{1}{2} \left( {q_{t_1}}^2 - {q_{t_0}}^2 \right) \end{split}$ NB here pb of boundary condition when applying the adjoint! In space, setting to 0 the quantity in land area is sufficient to get rid of the boundary condition (equivalently of the boundary value of the integration by part). In time this boundary condition is not physical and \textbf{add something here!!!} % ================================================================ a derivative in the same direction by considering triads. For example in the (\textbf{i},\textbf{k}) plane, the four triads are defined at the $(i,k)$ $T$-point as follows: \label{eq:Gf_triads} _i^k \mathbb{T}_{i_p}^{k_p} (T) = \frac{1}{4} \ {b_u}_{\,i+i_p}^{\,k}  \  A_i^k    \left( \frac{ \delta_{i + i_p}[T^k] }{ {e_{1u}}_{\,i + i_p}^{\,k} } -\ {_i^k \mathbb{R}_{i_p}^{k_p}} \ \frac{ \delta_{k+k_p} [T^i] }{ {e_{3w}}_{\,i}^{\,k+k_p} } \right) \label{eq:Gf_triads} _i^k \mathbb{T}_{i_p}^{k_p} (T) = \frac{1}{4} \ {b_u}_{\,i+i_p}^{\,k}  \  A_i^k     \left( \frac{ \delta_{i + i_p}[T^k] }{ {e_{1u}}_{\,i + i_p}^{\,k} } -\ {_i^k \mathbb{R}_{i_p}^{k_p}} \ \frac{ \delta_{k+k_p} [T^i] }{ {e_{3w}}_{\,i}^{\,k+k_p} } \right) where the indices $i_p$ and $k_p$ define the four triads and take the following value: $A_i^k$ is the lateral eddy diffusivity coefficient defined at $T$-point, and $_i^k \mathbb{R}_{i_p}^{k_p}$ is the slope associated with each triad: \label{eq:Gf_slopes} _i^k \mathbb{R}_{i_p}^{k_p} =\frac{ {e_{3w}}_{\,i}^{\,k+k_p}} { {e_{1u}}_{\,i+i_p}^{\,k}} \ \frac {\left(\alpha / \beta \right)_i^k  \ \delta_{i + i_p}[T^k] - \delta_{i + i_p}[S^k] } {\left(\alpha / \beta \right)_i^k  \ \delta_{k+k_p}[T^i ] - \delta_{k+k_p}[S^i ] } \label{eq:Gf_slopes} _i^k \mathbb{R}_{i_p}^{k_p} =\frac{ {e_{3w}}_{\,i}^{\,k+k_p}} { {e_{1u}}_{\,i+i_p}^{\,k}} \ \frac {\left(\alpha / \beta \right)_i^k  \ \delta_{i + i_p}[T^k] - \delta_{i + i_p}[S^k] } {\left(\alpha / \beta \right)_i^k  \ \delta_{k+k_p}[T^i ] - \delta_{k+k_p}[S^i ] } Note that in \autoref{eq:Gf_slopes} we use the ratio $\alpha / \beta$ instead of %>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> \begin{figure}[!ht] \begin{center} \includegraphics[width=0.70\textwidth]{Fig_ISO_triad} \caption{  \protect\label{fig:ISO_triad} Triads used in the Griffies's like iso-neutral diffision scheme for $u$-component (upper panel) and $w$-component (lower panel).} \end{center} \begin{figure}[!ht] \begin{center} \includegraphics[width=0.70\textwidth]{Fig_ISO_triad} \caption{ \protect\label{fig:ISO_triad} Triads used in the Griffies's like iso-neutral diffision scheme for $u$-component (upper panel) and $w$-component (lower panel). } \end{center} \end{figure} %>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> The four iso-neutral fluxes associated with the triads are defined at $T$-point. They take the following expression: \begin{flalign} \label{eq:Gf_fluxes} \begin{split} {_i^k {\mathbb{F}_u}_{i_p}^{k_p} } (T) &= \ \; \qquad  \quad    { _i^k \mathbb{T}_{i_p}^{k_p} }(T) \;\ / \ { {e_{1u}}_{\,i+i_p}^{\,k}}    \\ {_i^k {\mathbb{F}_w}_{i_p}^{k_p} } (T) &=  -\; { _i^k \mathbb{R}_{i_p}^{k_p} } \ \; { _i^k \mathbb{T}_{i_p}^{k_p} }(T) \;\ / \ { {e_{3w}}_{\,i}^{\,k+k_p}} \end{split} \end{flalign} \begin{flalign*} % \label{eq:Gf_fluxes} \begin{split} {_i^k {\mathbb{F}_u}_{i_p}^{k_p} } (T) &= \ \; \qquad  \quad    { _i^k \mathbb{T}_{i_p}^{k_p} }(T) \;\ / \ { {e_{1u}}_{\,i+i_p}^{\,k}}    \\ {_i^k {\mathbb{F}_w}_{i_p}^{k_p} } (T) &=  -\; { _i^k \mathbb{R}_{i_p}^{k_p} } \ \; { _i^k \mathbb{T}_{i_p}^{k_p} }(T) \;\ / \ { {e_{3w}}_{\,i}^{\,k+k_p}} \end{split} \end{flalign*} The resulting iso-neutral fluxes at $u$- and $w$-points are then given by the sum of the fluxes that cross the $u$- and $w$-face (\autoref{fig:ISO_triad}): \begin{flalign} \label{eq:iso_flux} \textbf{F}_{iso}(T) &\equiv  \sum_{\substack{i_p,\,k_p}} \begin{pmatrix} {_{i+1/2-i_p}^k {\mathbb{F}_u}_{i_p}^{k_p} } (T)      \\ \\ {_i^{k+1/2-k_p} {\mathbb{F}_w}_{i_p}^{k_p} } (T)      \\ \end{pmatrix}    \notag \\ &  \notag \\ &\equiv  \sum_{\substack{i_p,\,k_p}} \begin{pmatrix} && { _{i+1/2-i_p}^k \mathbb{T}_{i_p}^{k_p} }(T) \;\ / \ { {e_{1u}}_{\,i+1/2}^{\,k} }    \\ \\ & -\; { _i^{k+1/2-k_p} \mathbb{R}_{i_p}^{k_p} } & {_i^{k+1/2-k_p} \mathbb{T}_{i_p}^{k_p} }(T) \;\ / \ { {e_{3w}}_{\,i}^{\,k+1/2} }   \\ \end{pmatrix}      % \\ % &\\ % &\equiv  \sum_{\substack{i_p,\,k_p}} %    \begin{pmatrix} %       \qquad  \qquad  \qquad %       \frac{1}{ {e_{1u}}_{\,i+1/2}^{\,k} }  \ \; %        { _{i+1/2-i_p}^k \mathbb{T}_{i_p}^{k_p} }(T)\\ %       \\ %       -\frac{1}{ {e_{3w}}_{\,i}^{\,k+1/2} }  \ \; %        { _i^{k+1/2-k_p} \mathbb{R}_{i_p}^{k_p} } \ \; %                  {_i^{k+1/2-k_p} \mathbb{T}_{i_p}^{k_p} }(T)\\ %    \end{pmatrix} \begin{flalign} \label{eq:iso_flux} \textbf{F}_{iso}(T) &\equiv  \sum_{\substack{i_p,\,k_p}} \begin{pmatrix} {_{i+1/2-i_p}^k {\mathbb{F}_u}_{i_p}^{k_p} } (T) \\ \\ {_i^{k+1/2-k_p} {\mathbb{F}_w}_{i_p}^{k_p} } (T) \end{pmatrix} \notag \\ &  \notag \\ &\equiv  \sum_{\substack{i_p,\,k_p}} \begin{pmatrix} && { _{i+1/2-i_p}^k \mathbb{T}_{i_p}^{k_p} }(T) \;\ / \ { {e_{1u}}_{\,i+1/2}^{\,k} } \\ \\ & -\; { _i^{k+1/2-k_p} \mathbb{R}_{i_p}^{k_p} } & {_i^{k+1/2-k_p} \mathbb{T}_{i_p}^{k_p} }(T) \;\ / \ { {e_{3w}}_{\,i}^{\,k+1/2} } \end{pmatrix}      % \\ % &\\ % &\equiv  \sum_{\substack{i_p,\,k_p}} % \begin{pmatrix} %   \qquad  \qquad  \qquad %   \frac{1}{ {e_{1u}}_{\,i+1/2}^{\,k} }  \ \; %   { _{i+1/2-i_p}^k \mathbb{T}_{i_p}^{k_p} }(T)\\ %   \\ %   -\frac{1}{ {e_{3w}}_{\,i}^{\,k+1/2} }  \ \; %   { _i^{k+1/2-k_p} \mathbb{R}_{i_p}^{k_p} } \ \; %   {_i^{k+1/2-k_p} \mathbb{T}_{i_p}^{k_p} }(T)\\ % \end{pmatrix} \end{flalign} resulting in a iso-neutral diffusion tendency on temperature given by the divergence of the sum of all the four triad fluxes: \label{eq:Gf_operator} D_l^T = \frac{1}{b_T}  \sum_{\substack{i_p,\,k_p}} \left\{ \delta_{i} \left[{_{i+1/2-i_p}^k {\mathbb{F}_u }_{i_p}^{k_p}} \right] + \delta_{k} \left[ {_i^{k+1/2-k_p} {\mathbb{F}_w}_{i_p}^{k_p}} \right]   \right\} \label{eq:Gf_operator} D_l^T = \frac{1}{b_T}  \sum_{\substack{i_p,\,k_p}} \left\{ \delta_{i} \left[{_{i+1/2-i_p}^k {\mathbb{F}_u }_{i_p}^{k_p}} \right] + \delta_{k} \left[ {_i^{k+1/2-k_p} {\mathbb{F}_w}_{i_p}^{k_p}} \right]   \right\} where $b_T= e_{1T}\,e_{2T}\,e_{3T}$ is the volume of $T$-cells. The discretization of the diffusion operator recovers the traditional five-point Laplacian in the limit of flat iso-neutral direction: \label{eq:Gf_property1a} D_l^T = \frac{1}{b_T}  \ \delta_{i} \left[ \frac{e_{2u}\,e_{3u}}{e_{1u}} \; \overline{A}^{\,i} \; \delta_{i+1/2}[T] \right] \qquad  \text{when} \quad { _i^k \mathbb{R}_{i_p}^{k_p} }=0 $% \label{eq:Gf_property1a} D_l^T = \frac{1}{b_T} \ \delta_{i} \left[ \frac{e_{2u}\,e_{3u}}{e_{1u}} \; \overline{A}^{\,i} \; \delta_{i+1/2}[T] \right] \qquad \text{when} \quad { _i^k \mathbb{R}_{i_p}^{k_p} }=0$ \item[$\bullet$ implicit treatment in the vertical] This is of paramount importance since it means that the implicit in time algorithm for solving the vertical diffusion equation can be used to evaluate this term. It is a necessity since the vertical eddy diffusivity associated with this term, \sum_{\substack{i_p, \,k_p}} \left\{ It is a necessity since the vertical eddy diffusivity associated with this term, $\sum_{\substack{i_p, \,k_p}} \left\{ A_i^k \; \left(_i^k \mathbb{R}_{i_p}^{k_p}\right)^2 \right\} can be quite large. \right\}$ can be quite large. \item[$\bullet$ pure iso-neutral operator] The iso-neutral flux of locally referenced potential density is zero, $i.e.$ \begin{align} \label{eq:Gf_property2} \begin{matrix} &{_i^k {\mathbb{F}_u}_{i_p}^{k_p} (\rho)} &=    &\alpha_i^k   &{_i^k {\mathbb{F}_u}_{i_p}^{k_p} } (T) &- \ \;  \beta _i^k    &{_i^k {\mathbb{F}_u}_{i_p}^{k_p} } (S) & = \ 0   \\ &{_i^k {\mathbb{F}_w}_{i_p}^{k_p} (\rho)} &=    &\alpha_i^k   &{_i^k {\mathbb{F}_w}_{i_p}^{k_p} } (T) &- \  \; \beta _i^k    &{_i^k {\mathbb{F}_w}_{i_p}^{k_p} } (S)  &= \ 0 \end{matrix} \end{align} This result is trivially obtained using the \autoref{eq:Gf_triads} applied to $T$ and $S$ and the definition of the triads' slopes \autoref{eq:Gf_slopes}. \begin{align*} % \label{eq:Gf_property2} \begin{matrix} &{_i^k {\mathbb{F}_u}_{i_p}^{k_p} (\rho)} &=    &\alpha_i^k   &{_i^k {\mathbb{F}_u}_{i_p}^{k_p} } (T) &- \ \;  \beta _i^k    &{_i^k {\mathbb{F}_u}_{i_p}^{k_p} } (S) & = \ 0   \\ &{_i^k {\mathbb{F}_w}_{i_p}^{k_p} (\rho)} &=    &\alpha_i^k   &{_i^k {\mathbb{F}_w}_{i_p}^{k_p} } (T) &- \  \; \beta _i^k    &{_i^k {\mathbb{F}_w}_{i_p}^{k_p} } (S)  &= \ 0 \end{matrix} \end{align*} This result is trivially obtained using the \autoref{eq:Gf_triads} applied to $T$ and $S$ and the definition of the triads' slopes \autoref{eq:Gf_slopes}. \item[$\bullet$ conservation of tracer] The iso-neutral diffusion term conserve the total tracer content, $i.e.$ \label{eq:Gf_property1} \sum_{i,j,k} \left\{ D_l^T \ b_T \right\} = 0 $% \label{eq:Gf_property1} \sum_{i,j,k} \left\{ D_l^T \ b_T \right\} = 0$ This property is trivially satisfied since the iso-neutral diffusive operator is written in flux form. \item[$\bullet$ decrease of tracer variance] The iso-neutral diffusion term does not increase the total tracer variance, $i.e.$ \label{eq:Gf_property1} \sum_{i,j,k} \left\{ T \ D_l^T \ b_T \right\} \leq 0 $% \label{eq:Gf_property1} \sum_{i,j,k} \left\{ T \ D_l^T \ b_T \right\} \leq 0$ The property is demonstrated in the \autoref{apdx:Gf_operator}. It is a key property for a diffusion term. \item[$\bullet$ self-adjoint operator] The iso-neutral diffusion operator is self-adjoint, $i.e.$ \label{eq:Gf_property1} \sum_{i,j,k} \left\{ S \ D_l^T \ b_T \right\} = \sum_{i,j,k} \left\{ D_l^S \ T \ b_T \right\} $% \label{eq:Gf_property1} \sum_{i,j,k} \left\{ S \ D_l^T \ b_T \right\} = \sum_{i,j,k} \left\{ D_l^S \ T \ b_T \right\}$ In other word, there is no needs to develop a specific routine from the adjoint of this operator. We just have to apply the same routine. \end{description} $\$\newline      %force an empty line % ================================================================ % Skew flux formulation for Eddy Induced Velocity : The eddy induced velocity is given by: \label{eq:eiv_v} \begin{split} u^* & = - \frac{1}{e_2\,e_{3}}          \;\partial_k \left( e_2 \, A_e \; r_i  \right) = - \frac{1}{e_3}                     \;\partial_k \left(           A_e \; r_i  \right)            \\ v^* & = - \frac{1}{e_1\,e_3}\;             \partial_k \left( e_1 \, A_e \; r_j  \right) = - \frac{1}{e_3}                     \;\partial_k \left(           A_e \; r_j  \right)             \\ w^* & =    \frac{1}{e_1\,e_2}\; \left\{   \partial_i  \left( e_2 \, A_e \; r_i  \right) + \partial_j  \left( e_1 \, A_e \;r_j   \right) \right\}   \\ \end{split} \label{eq:eiv_v} \begin{split} u^* & = - \frac{1}{e_2\,e_{3}}          \;\partial_k \left( e_2 \, A_e \; r_i  \right) = - \frac{1}{e_3}                     \;\partial_k \left(           A_e \; r_i  \right)            \\ v^* & = - \frac{1}{e_1\,e_3}\;             \partial_k \left( e_1 \, A_e \; r_j  \right) = - \frac{1}{e_3}                     \;\partial_k \left(           A_e \; r_j  \right)             \\ w^* & =    \frac{1}{e_1\,e_2}\; \left\{   \partial_i  \left( e_2 \, A_e \; r_i  \right) + \partial_j  \left( e_1 \, A_e \;r_j   \right) \right\} \end{split} where $A_{e}$ is the eddy induced velocity coefficient, %\end{split} % \label{eq:eiv_vd} \textbf{F}_{eiv}^T   \equiv   \left( \begin{aligned} \sum_{\substack{i_p,\,k_p}} & +{e_{2u}}_{i+1/2-i_p}^{k}                                  \ \ {A_{e}}_{i+1/2-i_p}^{k} \ \ \ { _{i+1/2-i_p}^k \mathbb{R}_{i_p}^{k_p} }    \ \ \delta_{k+k_p}[T_{i+1/2-i_p}]      \\ \\ \sum_{\substack{i_p,\,k_p}} & - {e_{2u}}_i^{k+1/2-k_p}                                      \ {A_{e}}_i^{k+1/2-k_p} \ \ { _i^{k+1/2-k_p} \mathbb{R}_{i_p}^{k_p} }    \ \delta_{i+i_p}[T^{k+1/2-k_p}]    \\ \end{aligned}   \right) % \label{eq:eiv_vd} \textbf{F}_{eiv}^T \equiv \left( \begin{aligned} \sum_{\substack{i_p,\,k_p}} & +{e_{2u}}_{i+1/2-i_p}^{k} \ \ {A_{e}}_{i+1/2-i_p}^{k} \ \ \ { _{i+1/2-i_p}^k \mathbb{R}_{i_p}^{k_p} } \ \ \delta_{k+k_p}[T_{i+1/2-i_p}] \\ \\ \sum_{\substack{i_p,\,k_p}} & - {e_{2u}}_i^{k+1/2-k_p} \ {A_{e}}_i^{k+1/2-k_p} \ \ { _i^{k+1/2-k_p} \mathbb{R}_{i_p}^{k_p} } \ \delta_{i+i_p}[T^{k+1/2-k_p}] \end{aligned} \right) \citep{Griffies_JPO98} introduces another way to implement the eddy induced advection, the so-called skew form. For example in the (\textbf{i},\textbf{k}) plane, the tracer advective fluxes can be transformed as follows: \begin{flalign*} \begin{split} \textbf{F}_{eiv}^T = \begin{pmatrix} {e_{2}\,e_{3}\;  u^*}       \\ {e_{1}\,e_{2}\; w^*}  \\ \end{pmatrix}   \;   T &= \begin{pmatrix} { - \partial_k \left( e_{2} \, A_{e} \; r_i \right) \; T \;}       \\ {+ \partial_i  \left( e_{2} \, A_{e} \; r_i \right) \; T \;}    \\ \end{pmatrix}        \\ &= \begin{pmatrix} { - \partial_k \left( e_{2} \, A_{e} \; r_i  \; T \right) \;}  \\ {+ \partial_i  \left( e_{2} \, A_{e} \; r_i  \; T \right) \;}   \\ \end{pmatrix} + \begin{pmatrix} {+ e_{2} \, A_{e} \; r_i  \; \partial_k T}  \\ { - e_{2} \, A_{e} \; r_i  \; \partial_i  T}  \\ \end{pmatrix} \end{split} \begin{split} \textbf{F}_{eiv}^T = \begin{pmatrix} {e_{2}\,e_{3}\;  u^*}      \\ {e_{1}\,e_{2}\; w^*} \end{pmatrix} \;   T &= \begin{pmatrix} { - \partial_k \left( e_{2} \, A_{e} \; r_i \right) \; T \;}      \\ {+ \partial_i  \left( e_{2} \, A_{e} \; r_i \right) \; T \;} \end{pmatrix} \\ &= \begin{pmatrix} { - \partial_k \left( e_{2} \, A_{e} \; r_i  \; T \right) \;}  \\ {+ \partial_i  \left( e_{2} \, A_{e} \; r_i  \; T \right) \;} \end{pmatrix} + \begin{pmatrix} {+ e_{2} \, A_{e} \; r_i  \; \partial_k T}  \\ { - e_{2} \, A_{e} \; r_i  \; \partial_i  T} \end{pmatrix} \end{split} \end{flalign*} and since the eddy induces velocity field is no-divergent, we end up with the skew form of the eddy induced advective fluxes: \label{eq:eiv_skew_continuous} \textbf{F}_{eiv}^T = \begin{pmatrix} {+ e_{2} \, A_{e} \; r_i  \; \partial_k T}   \\ { - e_{2} \, A_{e} \; r_i  \; \partial_i  T}  \\ \end{pmatrix} \label{eq:eiv_skew_continuous} \textbf{F}_{eiv}^T = \begin{pmatrix} {+ e_{2} \, A_{e} \; r_i  \; \partial_k T}   \\ { - e_{2} \, A_{e} \; r_i  \; \partial_i  T} \end{pmatrix} The tendency associated with eddy induced velocity is then simply the divergence of Another interesting property of \autoref{eq:eiv_skew_continuous} form is that when $A=A_e$, a simplification occurs in the sum of the iso-neutral diffusion and eddy induced velocity terms: \begin{flalign} \label{eq:eiv_skew+eiv_continuous} \textbf{F}_{iso}^T + \textbf{F}_{eiv}^T &= \begin{pmatrix} + \frac{e_2\,e_3\,}{e_1} A \;\partial_i T -  e_2 \, A \; r_i                              \;\partial_k T   \\ -  e_2 \, A_{e} \; r_i           \;\partial_i T + \frac{e_1\,e_2}{e_3} \, A \; r_i^2 \;\partial_k T   \\ \end{pmatrix} + \begin{pmatrix} {+ e_{2} \, A_{e} \; r_i  \; \partial_k T}   \\ { - e_{2} \, A_{e} \; r_i  \; \partial_i  T}  \\ \end{pmatrix}      \\ &= \begin{pmatrix} + \frac{e_2\,e_3\,}{e_1} A \;\partial_i T    \\ -  2\; e_2 \, A_{e} \; r_i      \;\partial_i T + \frac{e_1\,e_2}{e_3} \, A \; r_i^2 \;\partial_k T   \\ \end{pmatrix} \end{flalign} \begin{flalign*} % \label{eq:eiv_skew+eiv_continuous} \textbf{F}_{iso}^T + \textbf{F}_{eiv}^T &= \begin{pmatrix} + \frac{e_2\,e_3\,}{e_1} A \;\partial_i T -  e_2 \, A \; r_i                              \;\partial_k T   \\ -  e_2 \, A_{e} \; r_i           \;\partial_i T + \frac{e_1\,e_2}{e_3} \, A \; r_i^2 \;\partial_k T \end{pmatrix} + \begin{pmatrix} {+ e_{2} \, A_{e} \; r_i  \; \partial_k T}   \\ { - e_{2} \, A_{e} \; r_i  \; \partial_i  T} \end{pmatrix} \\ &= \begin{pmatrix} + \frac{e_2\,e_3\,}{e_1} A \;\partial_i T    \\ -  2\; e_2 \, A_{e} \; r_i      \;\partial_i T + \frac{e_1\,e_2}{e_3} \, A \; r_i^2 \;\partial_k T \end{pmatrix} \end{flalign*} The horizontal component reduces to the one use for an horizontal laplacian operator and the vertical one keeps the same complexity, but not more. Using the slopes \autoref{eq:Gf_slopes} and defining $A_e$ at $T$-point($i.e.$ as $A$, the eddy diffusivity coefficient), the resulting discret form is given by: \label{eq:eiv_skew} \textbf{F}_{eiv}^T   \equiv   \frac{1}{4} \left( \begin{aligned} \sum_{\substack{i_p,\,k_p}} & +{e_{2u}}_{i+1/2-i_p}^{k}                                  \ \ {A_{e}}_{i+1/2-i_p}^{k} \ \ \ { _{i+1/2-i_p}^k \mathbb{R}_{i_p}^{k_p} }    \ \ \delta_{k+k_p}[T_{i+1/2-i_p}]      \\ \\ \sum_{\substack{i_p,\,k_p}} & - {e_{2u}}_i^{k+1/2-k_p}                                      \ {A_{e}}_i^{k+1/2-k_p} \ \ { _i^{k+1/2-k_p} \mathbb{R}_{i_p}^{k_p} }    \ \delta_{i+i_p}[T^{k+1/2-k_p}]    \\ \end{aligned}   \right) \label{eq:eiv_skew} \textbf{F}_{eiv}^T   \equiv   \frac{1}{4} \left( \begin{aligned} \sum_{\substack{i_p,\,k_p}} & +{e_{2u}}_{i+1/2-i_p}^{k}                                  \ \ {A_{e}}_{i+1/2-i_p}^{k} \ \ \ { _{i+1/2-i_p}^k \mathbb{R}_{i_p}^{k_p} }    \ \ \delta_{k+k_p}[T_{i+1/2-i_p}] \\ \\ \sum_{\substack{i_p,\,k_p}} & - {e_{2u}}_i^{k+1/2-k_p}                                      \ {A_{e}}_i^{k+1/2-k_p} \ \ { _i^{k+1/2-k_p} \mathbb{R}_{i_p}^{k_p} }    \ \delta_{i+i_p}[T^{k+1/2-k_p}] \end{aligned} \right) Note that \autoref{eq:eiv_skew} is valid in $z$-coordinate with or without partial cells. $i.e.$ it does not include a diffusive component but is a "pure" advection term. $\$\newpage      %force an empty line % ================================================================ The continuous property to be demonstrated is: $\int_D D_l^T \; T \;dv \leq 0$ The discrete form of its left hand side is obtained using \autoref{eq:iso_flux} \begin{align*} \int_D  D_l^T \; T \;dv   \leq 0 \end{align*} The discrete form of its left hand side is obtained using \autoref{eq:iso_flux} \begin{align*} &\int_D  D_l^T \; T \;dv \equiv  \sum_{i,k} \left\{ T \ D_l^T \ b_T \right\}    \\ &\equiv + \sum_{i,k} \sum_{\substack{i_p,\,k_p}} \left\{ \delta_{i} \left[{_{i+1/2-i_p}^k {\mathbb{F}_u }_{i_p}^{k_p}} \right] + \delta_{k} \left[ {_i^{k+1/2-k_p} {\mathbb{F}_w}_{i_p}^{k_p}} \right]  \ T \right\}    \\ &\equiv  - \sum_{i,k} \sum_{\substack{i_p,\,k_p}} \left\{ {_{i+1/2-i_p}^k {\mathbb{F}_u }_{i_p}^{k_p}} \ \delta_{i+1/2} [T] + {_i^{k+1/2-k_p} {\mathbb{F}_w}_{i_p}^{k_p}}  \ \delta_{k+1/2} [T]   \right\}      \\ &\equiv -\sum_{i,k} \sum_{\substack{i_p,\,k_p}} \left\{ \frac{ _{i+1/2-i_p}^k \mathbb{T}_{i_p}^{k_p} (T) }{ {e_{1u}}_{\,i+1/2}^{\,k} }  \ \delta_{i+1/2} [T] - { _i^{k+1/2-k_p} \mathbb{R}_{i_p}^{k_p} } \ \; \frac{ _i^{k+1/2-k_p} \mathbb{T}_{i_p}^{k_p} (T) }{ {e_{3w}}_{\,i}^{\,k+1/2}  } \ \delta_{k+1/2} [T] \right\}      \\ % \allowdisplaybreaks \intertext{ Expending the summation on $i_p$ and $k_p$, it becomes:} % &\equiv -\sum_{i,k} \begin{Bmatrix} &\ \ \Bigl(  { _{i+1}^{k} \mathbb{T}_{-1/2}^{-1/2} (T) } &\frac{ \delta_{i +1/2} [T] }{{e_{1u} }_{\,i+1/2}^{\,k}} & -\ \ {_{i}^{k+1} \mathbb{R}_{-1/2}^{-1/2}} &      {_{i}^{k+1} \mathbb{T}_{-1/2}^{-1/2} (T) } &\frac{ \delta_{k+1/2} [T] }{{e_{3w}}_{\,i}^{\,k+1/2}}     \Bigr) & \\ &+\Bigl( \ \;\; { _i^k \mathbb{T}_{+1/2}^{-1/2} (T) } &\frac{ \delta_{i +1/2} [T] }{{e_{1u} }_{\,i+1/2}^{\,k}} & -\ \ {_i^{k+1} \mathbb{R}_{+1/2}^{-1/2}} & { _i^{k+1} \mathbb{T}_{+1/2}^{-1/2} (T) } &\frac{ \delta_{k+1/2} [T] }{{e_{3w}}_{\,i}^{\,k+1/2}}      \Bigr) & \\ &+\Bigl(  { _{i+1}^{k} \mathbb{T}_{-1/2}^{+1/2} (T) } &\frac{ \delta_{i +1/2} [T] }{{e_{1u} }_{\,i+1/2}^{\,k}} & -\ \ \ \;\;{_{i}^{k} \mathbb{R}_{-1/2}^{+1/2}} &      \ \;\;{_{i}^{k} \mathbb{T}_{-1/2}^{+1/2} (T) } &\frac{ \delta_{k+1/2} [T] }{{e_{3w}}_{\,i}^{\,k+1/2}}     \Bigr) & \\ &+\Bigl( \ \;\; { _{i}^{k} \mathbb{T}_{+1/2}^{+1/2} (T) } &\frac{ \delta_{i +1/2} [T] }{{e_{1u} }_{\,i+1/2}^{\,k}} & -\ \ \ \;\;{_{i}^{k} \mathbb{R}_{+1/2}^{+1/2}} &      \ \;\;{_{i}^{k} \mathbb{T}_{+1/2}^{+1/2} (T) } &\frac{ \delta_{k+1/2} [T] }{{e_{3w}}_{\,i}^{\,k+1/2}}     \Bigr)   \\ \end{Bmatrix} % \allowdisplaybreaks \intertext{The summation is done over all $i$ and $k$ indices, &\int_D  D_l^T \; T \;dv \equiv  \sum_{i,k} \left\{ T \ D_l^T \ b_T \right\}    \\ &\equiv + \sum_{i,k} \sum_{\substack{i_p,\,k_p}} \left\{ \delta_{i} \left[{_{i+1/2-i_p}^k {\mathbb{F}_u }_{i_p}^{k_p}} \right] + \delta_{k} \left[ {_i^{k+1/2-k_p} {\mathbb{F}_w}_{i_p}^{k_p}} \right]  \ T \right\}    \\ &\equiv  - \sum_{i,k} \sum_{\substack{i_p,\,k_p}} \left\{ {_{i+1/2-i_p}^k {\mathbb{F}_u }_{i_p}^{k_p}} \ \delta_{i+1/2} [T] + {_i^{k+1/2-k_p} {\mathbb{F}_w}_{i_p}^{k_p}}  \ \delta_{k+1/2} [T]   \right\}      \\ &\equiv -\sum_{i,k} \sum_{\substack{i_p,\,k_p}} \left\{ \frac{ _{i+1/2-i_p}^k \mathbb{T}_{i_p}^{k_p} (T) }{ {e_{1u}}_{\,i+1/2}^{\,k} }  \ \delta_{i+1/2} [T] - { _i^{k+1/2-k_p} \mathbb{R}_{i_p}^{k_p} } \ \; \frac{ _i^{k+1/2-k_p} \mathbb{T}_{i_p}^{k_p} (T) }{ {e_{3w}}_{\,i}^{\,k+1/2}  } \ \delta_{k+1/2} [T] \right\}      \\ % \allowdisplaybreaks \intertext{ Expending the summation on $i_p$ and $k_p$, it becomes:} % &\equiv -\sum_{i,k} \begin{Bmatrix} &\ \ \Bigl(  { _{i+1}^{k} \mathbb{T}_{-1/2}^{-1/2} (T) } &\frac{ \delta_{i +1/2} [T] }{{e_{1u} }_{\,i+1/2}^{\,k}} & -\ \ {_{i}^{k+1} \mathbb{R}_{-1/2}^{-1/2}} &      {_{i}^{k+1} \mathbb{T}_{-1/2}^{-1/2} (T) } &\frac{ \delta_{k+1/2} [T] }{{e_{3w}}_{\,i}^{\,k+1/2}}     \Bigr) & \\ &+\Bigl( \ \;\; { _i^k \mathbb{T}_{+1/2}^{-1/2} (T) } &\frac{ \delta_{i +1/2} [T] }{{e_{1u} }_{\,i+1/2}^{\,k}} & -\ \ {_i^{k+1} \mathbb{R}_{+1/2}^{-1/2}} & { _i^{k+1} \mathbb{T}_{+1/2}^{-1/2} (T) } &\frac{ \delta_{k+1/2} [T] }{{e_{3w}}_{\,i}^{\,k+1/2}}      \Bigr) & \\ &+\Bigl(  { _{i+1}^{k} \mathbb{T}_{-1/2}^{+1/2} (T) } &\frac{ \delta_{i +1/2} [T] }{{e_{1u} }_{\,i+1/2}^{\,k}} & -\ \ \ \;\;{_{i}^{k} \mathbb{R}_{-1/2}^{+1/2}} &      \ \;\;{_{i}^{k} \mathbb{T}_{-1/2}^{+1/2} (T) } &\frac{ \delta_{k+1/2} [T] }{{e_{3w}}_{\,i}^{\,k+1/2}}     \Bigr) & \\ &+\Bigl( \ \;\; { _{i}^{k} \mathbb{T}_{+1/2}^{+1/2} (T) } &\frac{ \delta_{i +1/2} [T] }{{e_{1u} }_{\,i+1/2}^{\,k}} & -\ \ \ \;\;{_{i}^{k} \mathbb{R}_{+1/2}^{+1/2}} &      \ \;\;{_{i}^{k} \mathbb{T}_{+1/2}^{+1/2} (T) } &\frac{ \delta_{k+1/2} [T] }{{e_{3w}}_{\,i}^{\,k+1/2}}     \Bigr)   \\ \end{Bmatrix} % \allowdisplaybreaks \intertext{ The summation is done over all $i$ and $k$ indices, it is therefore possible to introduce a shift of $-1$ either in $i$ or $k$ direction in order to regroup all the terms of the summation by triad at a ($i$,$k$) point. In other words, we regroup all the terms in the neighbourhood that contain a triad at the same ($i$,$k$) indices. It becomes: } % &\equiv -\sum_{i,k} \begin{Bmatrix} &\ \ \Bigl(  {_i^k \mathbb{T}_{-1/2}^{-1/2} (T) } &\frac{ \delta_{i -1/2} [T] }{{e_{1u} }_{\,i-1/2}^{\,k}} & -\ \ {_i^k \mathbb{R}_{-1/2}^{-1/2}} &      {_i^k \mathbb{T}_{-1/2}^{-1/2} (T) } &\frac{ \delta_{k-1/2} [T] }{{e_{3w}}_{\,i}^{\,k-1/2}}     \Bigr) & \\ &+\Bigl(  { _i^k \mathbb{T}_{+1/2}^{-1/2} (T) } &\frac{ \delta_{i +1/2} [T] }{{e_{1u} }_{\,i+1/2}^{\,k}} & -\ \ {_i^k \mathbb{R}_{+1/2}^{-1/2}} &      { _i^k \mathbb{T}_{+1/2}^{-1/2} (T) } &\frac{ \delta_{k-1/2} [T] }{{e_{3w}}_{\,i}^{\,k-1/2}}      \Bigr) & \\ &+\Bigl(  {_i^k \mathbb{T}_{-1/2}^{+1/2} (T) } &\frac{ \delta_{i -1/2} [T] }{{e_{1u} }_{\,i-1/2}^{\,k}} & -\ \ {_i^k \mathbb{R}_{-1/2}^{+1/2}} &      {_i^k \mathbb{T}_{-1/2}^{+1/2} (T) } &\frac{ \delta_{k+1/2} [T] }{{e_{3w}}_{\,i}^{\,k+1/2}}     \Bigr) & \\ &+\Bigl( { _i^k \mathbb{T}_{+1/2}^{+1/2} (T) } &\frac{ \delta_{i +1/2} [T] }{{e_{1u} }_{\,i+1/2}^{\,k}} & -\ \ {_i^k \mathbb{R}_{+1/2}^{+1/2}} &      {_i^k \mathbb{T}_{+1/2}^{+1/2} (T) } &\frac{ \delta_{k+1/2} [T] }{{e_{3w}}_{\,i}^{\,k+1/2}}     \Bigr)   \\ \end{Bmatrix}   \\ % \allowdisplaybreaks \intertext{Then outing in factor the triad in each of the four terms of the summation and It becomes: } % &\equiv -\sum_{i,k} \begin{Bmatrix} &\ \ \Bigl(  {_i^k \mathbb{T}_{-1/2}^{-1/2} (T) } &\frac{ \delta_{i -1/2} [T] }{{e_{1u} }_{\,i-1/2}^{\,k}} & -\ \ {_i^k \mathbb{R}_{-1/2}^{-1/2}} &      {_i^k \mathbb{T}_{-1/2}^{-1/2} (T) } &\frac{ \delta_{k-1/2} [T] }{{e_{3w}}_{\,i}^{\,k-1/2}}     \Bigr) & \\ &+\Bigl(  { _i^k \mathbb{T}_{+1/2}^{-1/2} (T) } &\frac{ \delta_{i +1/2} [T] }{{e_{1u} }_{\,i+1/2}^{\,k}} & -\ \ {_i^k \mathbb{R}_{+1/2}^{-1/2}} &      { _i^k \mathbb{T}_{+1/2}^{-1/2} (T) } &\frac{ \delta_{k-1/2} [T] }{{e_{3w}}_{\,i}^{\,k-1/2}}      \Bigr) & \\ &+\Bigl(  {_i^k \mathbb{T}_{-1/2}^{+1/2} (T) } &\frac{ \delta_{i -1/2} [T] }{{e_{1u} }_{\,i-1/2}^{\,k}} & -\ \ {_i^k \mathbb{R}_{-1/2}^{+1/2}} &      {_i^k \mathbb{T}_{-1/2}^{+1/2} (T) } &\frac{ \delta_{k+1/2} [T] }{{e_{3w}}_{\,i}^{\,k+1/2}}     \Bigr) & \\ &+\Bigl( { _i^k \mathbb{T}_{+1/2}^{+1/2} (T) } &\frac{ \delta_{i +1/2} [T] }{{e_{1u} }_{\,i+1/2}^{\,k}} & -\ \ {_i^k \mathbb{R}_{+1/2}^{+1/2}} &      {_i^k \mathbb{T}_{+1/2}^{+1/2} (T) } &\frac{ \delta_{k+1/2} [T] }{{e_{3w}}_{\,i}^{\,k+1/2}}     \Bigr)   \\ \end{Bmatrix}   \\ % \allowdisplaybreaks \intertext{ Then outing in factor the triad in each of the four terms of the summation and substituting the triads by their expression given in \autoref{eq:Gf_triads}. It becomes: } % &\equiv -\sum_{i,k} \begin{Bmatrix} &\ \ \Bigl(  \frac{ \delta_{i -1/2} [T] }{{e_{1u} }_{\,i-1/2}^{\,k}} & -\ \ {_i^k \mathbb{R}_{-1/2}^{-1/2}} &\frac{ \delta_{k-1/2} [T] }{{e_{3w}}_{\,i}^{\,k-1/2}}     \Bigr)^2 & \frac{1}{4} \ {b_u}_{\,i-1/2}^{\,k}  \  A_i^k & \\ &+\Bigl(  \frac{ \delta_{i +1/2} [T] }{{e_{1u} }_{\,i+1/2}^{\,k}} & -\ \ {_i^k \mathbb{R}_{+1/2}^{-1/2}} &\frac{ \delta_{k-1/2} [T] }{{e_{3w}}_{\,i}^{\,k-1/2}}      \Bigr)^2 & \frac{1}{4} \ {b_u}_{\,i+1/2}^{\,k}  \  A_i^k & \\ &+\Bigl(  \frac{ \delta_{i -1/2} [T] }{{e_{1u} }_{\,i-1/2}^{\,k}} & -\ \ {_i^k \mathbb{R}_{-1/2}^{+1/2}} &\frac{ \delta_{k+1/2} [T] }{{e_{3w}}_{\,i}^{\,k+1/2}}     \Bigr)^2 & \frac{1}{4} \ {b_u}_{\,i-1/2}^{\,k}  \  A_i^k & \\ &+\Bigl( \frac{ \delta_{i +1/2} [T] }{{e_{1u} }_{\,i+1/2}^{\,k}} & -\ \ {_i^k \mathbb{R}_{+1/2}^{+1/2}} &\frac{ \delta_{k+1/2} [T] }{{e_{3w}}_{\,i}^{\,k+1/2}}     \Bigr)^2 & \frac{1}{4} \ {b_u}_{\,i+1/2}^{\,k}  \  A_i^k      \\ \end{Bmatrix}   \\ & \\ % &\equiv - \sum_{i,k} \sum_{\substack{i_p,\,k_p}} \left\{ \begin{matrix} &\Bigl( \frac{ \delta_{i +i_p} [T] }{{e_{1u} }_{\,i+i_p}^{\,k}} & -\ \ {_i^k \mathbb{R}_{i_p}^{k_p}} &\frac{ \delta_{k+k_p} [T] }{{e_{3w}}_{\,i}^{\,k+k_p}}     \Bigr)^2 & \frac{1}{4} \ {b_u}_{\,i+i_p}^{\,k}  \  A_i^k   \ \ \end{matrix} \right\} \quad   \leq 0 It becomes: } % &\equiv -\sum_{i,k} \begin{Bmatrix} &\ \ \Bigl(  \frac{ \delta_{i -1/2} [T] }{{e_{1u} }_{\,i-1/2}^{\,k}} & -\ \ {_i^k \mathbb{R}_{-1/2}^{-1/2}} &\frac{ \delta_{k-1/2} [T] }{{e_{3w}}_{\,i}^{\,k-1/2}}     \Bigr)^2 & \frac{1}{4} \ {b_u}_{\,i-1/2}^{\,k}  \  A_i^k & \\ &+\Bigl(  \frac{ \delta_{i +1/2} [T] }{{e_{1u} }_{\,i+1/2}^{\,k}} & -\ \ {_i^k \mathbb{R}_{+1/2}^{-1/2}} &\frac{ \delta_{k-1/2} [T] }{{e_{3w}}_{\,i}^{\,k-1/2}}      \Bigr)^2 & \frac{1}{4} \ {b_u}_{\,i+1/2}^{\,k}  \  A_i^k & \\ &+\Bigl(  \frac{ \delta_{i -1/2} [T] }{{e_{1u} }_{\,i-1/2}^{\,k}} & -\ \ {_i^k \mathbb{R}_{-1/2}^{+1/2}} &\frac{ \delta_{k+1/2} [T] }{{e_{3w}}_{\,i}^{\,k+1/2}}     \Bigr)^2 & \frac{1}{4} \ {b_u}_{\,i-1/2}^{\,k}  \  A_i^k & \\ &+\Bigl( \frac{ \delta_{i +1/2} [T] }{{e_{1u} }_{\,i+1/2}^{\,k}} & -\ \ {_i^k \mathbb{R}_{+1/2}^{+1/2}} &\frac{ \delta_{k+1/2} [T] }{{e_{3w}}_{\,i}^{\,k+1/2}}     \Bigr)^2 & \frac{1}{4} \ {b_u}_{\,i+1/2}^{\,k}  \  A_i^k      \\ \end{Bmatrix} \\ & \\ % &\equiv - \sum_{i,k} \sum_{\substack{i_p,\,k_p}} \left\{ \begin{matrix} &\Bigl( \frac{ \delta_{i +i_p} [T] }{{e_{1u} }_{\,i+i_p}^{\,k}} & -\ \ {_i^k \mathbb{R}_{i_p}^{k_p}} &\frac{ \delta_{k+k_p} [T] }{{e_{3w}}_{\,i}^{\,k+k_p}}     \Bigr)^2 & \frac{1}{4} \ {b_u}_{\,i+i_p}^{\,k}  \  A_i^k   \ \ \end{matrix} \right\} \quad   \leq 0 \end{align*} The last inequality is obviously obtained as we succeed in obtaining a negative summation of square quantities. then the previous demonstration would have let to: \begin{align*} \int_D  S \; D_l^T  \;dv &\equiv  \sum_{i,k} \left\{ S \ D_l^T \ b_T \right\}    \\ &\equiv - \sum_{i,k} \sum_{\substack{i_p,\,k_p}} \left\{ \left( \frac{ \delta_{i +i_p} [S] }{{e_{1u} }_{\,i+i_p}^{\,k}} - {_i^k \mathbb{R}_{i_p}^{k_p}} \frac{ \delta_{k+k_p} [S] }{{e_{3w}}_{\,i}^{\,k+k_p}}     \right)  \right. \\   & \qquad \qquad \qquad \ \left. \left( \frac{ \delta_{i +i_p} [T] }{{e_{1u} }_{\,i+i_p}^{\,k}} - {_i^k \mathbb{R}_{i_p}^{k_p}} \frac{ \delta_{k+k_p} [T] }{{e_{3w}}_{\,i}^{\,k+k_p}}     \right) \frac{1}{4} \ {b_u}_{\,i+i_p}^{\,k}  \  A_i^k   \ \right\} % \allowdisplaybreaks \intertext{which, by applying the same operation as before but in reverse order, leads to: } % &\equiv  \sum_{i,k} \left\{ D_l^S \ T \ b_T \right\} \int_D  S \; D_l^T  \;dv &\equiv  \sum_{i,k} \left\{ S \ D_l^T \ b_T \right\}    \\ &\equiv - \sum_{i,k} \sum_{\substack{i_p,\,k_p}} \left\{ \left( \frac{ \delta_{i +i_p} [S] }{{e_{1u} }_{\,i+i_p}^{\,k}} - {_i^k \mathbb{R}_{i_p}^{k_p}} \frac{ \delta_{k+k_p} [S] }{{e_{3w}}_{\,i}^{\,k+k_p}}     \right)  \right. \\ & \qquad \qquad \qquad \ \left. \left( \frac{ \delta_{i +i_p} [T] }{{e_{1u} }_{\,i+i_p}^{\,k}} - {_i^k \mathbb{R}_{i_p}^{k_p}} \frac{ \delta_{k+k_p} [T] }{{e_{3w}}_{\,i}^{\,k+k_p}}     \right) \frac{1}{4} \ {b_u}_{\,i+i_p}^{\,k}  \  A_i^k   \ \right\} % \allowdisplaybreaks \intertext{ which, by applying the same operation as before but in reverse order, leads to: } % &\equiv  \sum_{i,k} \left\{ D_l^S \ T \ b_T \right\} \end{align*} This means that the iso-neutral operator is self-adjoint. There is no need to develop a specific to obtain it. $\$\newpage      %force an empty line \newpage % ================================================================ % Discrete Invariants of the skew flux formulation \label{subsec:eiv_skew} Demonstration for the conservation of the tracer variance in the (\textbf{i},\textbf{j}) plane. The continuous property to be demonstrated is: \begin{align*} \int_D \nabla \cdot \textbf{F}_{eiv}(T) \; T \;dv  \equiv 0 \int_D \nabla \cdot \textbf{F}_{eiv}(T) \; T \;dv  \equiv 0 \end{align*} The discrete form of its left hand side is obtained using \autoref{eq:eiv_skew} \begin{align*} \sum\limits_{i,k} \sum_{\substack{i_p,\,k_p}}  \Biggl\{   \;\; \delta_i  &\left[ {e_{2u}}_{i+i_p+1/2}^{k}                                  \;\ \ {A_{e}}_{i+i_p+1/2}^{k} \ \ \ { _{i+i_p+1/2}^k \mathbb{R}_{-i_p}^{k_p} }   \quad \delta_{k+k_p}[T_{i+i_p+1/2}] \right] \; T_i^k      \\ - \delta_k &\left[ {e_{2u}}_i^{k+k_p+1/2}                                     \ \ {A_{e}}_i^{k+k_p+1/2} \ \ { _i^{k+k_p+1/2} \mathbb{R}_{i_p}^{-k_p} }   \ \ \delta_{i+i_p}[T^{k+k_p+1/2}] \right] \; T_i^k      \         \Biggr\} \sum\limits_{i,k} \sum_{\substack{i_p,\,k_p}}  \Biggl\{   \;\; \delta_i  &\left[ {e_{2u}}_{i+i_p+1/2}^{k}                                  \;\ \ {A_{e}}_{i+i_p+1/2}^{k} \ \ \ { _{i+i_p+1/2}^k \mathbb{R}_{-i_p}^{k_p} }   \quad \delta_{k+k_p}[T_{i+i_p+1/2}] \right] \; T_i^k      \\ - \delta_k &\left[ {e_{2u}}_i^{k+k_p+1/2}                                     \ \ {A_{e}}_i^{k+k_p+1/2} \ \ { _i^{k+k_p+1/2} \mathbb{R}_{i_p}^{-k_p} }   \ \ \delta_{i+i_p}[T^{k+k_p+1/2}] \right] \; T_i^k      \         \Biggr\} \end{align*} apply the adjoint of delta operator, it becomes \begin{align*} \sum\limits_{i,k} \sum_{\substack{i_p,\,k_p}}  \Biggl\{   \;\; &\left( {e_{2u}}_{i+i_p+1/2}^{k}                                  \;\ \ {A_{e}}_{i+i_p+1/2}^{k} \ \ \ { _{i+i_p+1/2}^k \mathbb{R}_{-i_p}^{k_p} }   \quad \delta_{k+k_p}[T_{i+i_p+1/2}] \right) \; \delta_{i+1/2}[T^{k}]      \\ - &\left( {e_{2u}}_i^{k+k_p+1/2}                                     \ \ {A_{e}}_i^{k+k_p+1/2} \ \ { _i^{k+k_p+1/2} \mathbb{R}_{i_p}^{-k_p} }   \ \ \delta_{i+i_p}[T^{k+k_p+1/2}] \right) \; \delta_{k+1/2}[T_{i}]       \         \Biggr\} \sum\limits_{i,k} \sum_{\substack{i_p,\,k_p}}  \Biggl\{   \;\; &\left( {e_{2u}}_{i+i_p+1/2}^{k}                                  \;\ \ {A_{e}}_{i+i_p+1/2}^{k} \ \ \ { _{i+i_p+1/2}^k \mathbb{R}_{-i_p}^{k_p} }   \quad \delta_{k+k_p}[T_{i+i_p+1/2}] \right) \; \delta_{i+1/2}[T^{k}]      \\ - &\left( {e_{2u}}_i^{k+k_p+1/2}                                     \ \ {A_{e}}_i^{k+k_p+1/2} \ \ { _i^{k+k_p+1/2} \mathbb{R}_{i_p}^{-k_p} }   \ \ \delta_{i+i_p}[T^{k+k_p+1/2}] \right) \; \delta_{k+1/2}[T_{i}]       \         \Biggr\} \end{align*} Expending the summation on $i_p$ and $k_p$, it becomes: \begin{align*} \begin{matrix} &\sum\limits_{i,k}   \Bigl\{ &+{e_{2u}}_{i+1}^{k}                             &{A_{e}}_{i+1    }^{k} &\ {_{i+1}^k \mathbb{R}_{- 1/2}^{-1/2}} &\delta_{k-1/2}[T_{i+1}]    &\delta_{i+1/2}[T^{k}]   &\\ &&+{e_{2u}}_i^{k\ \ \ \:}                            &{A_{e}}_{i}^{k\ \ \ \:} &\ {\ \ \;_i^k \mathbb{R}_{+1/2}^{-1/2}}  &\delta_{k-1/2}[T_{i\ \ \ \;}]  &\delta_{i+1/2}[T^{k}] &\\ &&+{e_{2u}}_{i+1}^{k}                             &{A_{e}}_{i+1    }^{k} &\ {_{i+1}^k \mathbb{R}_{- 1/2}^{+1/2}} &\delta_{k+1/2}[T_{i+1}]     &\delta_{i+1/2}[T^{k}] &\\ &&+{e_{2u}}_i^{k\ \ \ \:}                            &{A_{e}}_{i}^{k\ \ \ \:} \begin{matrix} &\sum\limits_{i,k}   \Bigl\{ &+{e_{2u}}_{i+1}^{k}                             &{A_{e}}_{i+1    }^{k} &\ {_{i+1}^k \mathbb{R}_{- 1/2}^{-1/2}} &\delta_{k-1/2}[T_{i+1}]    &\delta_{i+1/2}[T^{k}]   &\\ &&+{e_{2u}}_i^{k\ \ \ \:}                            &{A_{e}}_{i}^{k\ \ \ \:} &\ {\ \ \;_i^k \mathbb{R}_{+1/2}^{-1/2}}  &\delta_{k-1/2}[T_{i\ \ \ \;}]  &\delta_{i+1/2}[T^{k}] &\\ &&+{e_{2u}}_{i+1}^{k}                             &{A_{e}}_{i+1    }^{k} &\ {_{i+1}^k \mathbb{R}_{- 1/2}^{+1/2}} &\delta_{k+1/2}[T_{i+1}]     &\delta_{i+1/2}[T^{k}] &\\ &&+{e_{2u}}_i^{k\ \ \ \:}                            &{A_{e}}_{i}^{k\ \ \ \:} &\ {\ \ \;_i^k \mathbb{R}_{+1/2}^{+1/2}} &\delta_{k+1/2}[T_{i\ \ \ \;}] &\delta_{i+1/2}[T^{k}] &\\ % &&-{e_{2u}}_i^{k+1}                                &{A_{e}}_i^{k+1} &{_i^{k+1} \mathbb{R}_{-1/2}^{- 1/2}}   &\delta_{i-1/2}[T^{k+1}]      &\delta_{k+1/2}[T_{i}] &\\ &&-{e_{2u}}_i^{k\ \ \ \:}                             &{A_{e}}_i^{k\ \ \ \:} &{\ \ \;_i^k  \mathbb{R}_{-1/2}^{+1/2}}   &\delta_{i-1/2}[T^{k\ \ \ \:}]  &\delta_{k+1/2}[T_{i}] &\\ &&-{e_{2u}}_i^{k+1    }                             &{A_{e}}_i^{k+1} &{_i^{k+1} \mathbb{R}_{+1/2}^{- 1/2}}   &\delta_{i+1/2}[T^{k+1}]      &\delta_{k+1/2}[T_{i}] &\\ &&-{e_{2u}}_i^{k\ \ \ \:}                             &{A_{e}}_i^{k\ \ \ \:} &{\ \ \;_i^k  \mathbb{R}_{+1/2}^{+1/2}}   &\delta_{i+1/2}[T^{k\ \ \ \:}]  &\delta_{k+1/2}[T_{i}] &\Bigr\}  \\ \end{matrix} % &&-{e_{2u}}_i^{k+1}                                &{A_{e}}_i^{k+1} &{_i^{k+1} \mathbb{R}_{-1/2}^{- 1/2}}   &\delta_{i-1/2}[T^{k+1}]      &\delta_{k+1/2}[T_{i}] &\\ &&-{e_{2u}}_i^{k\ \ \ \:}                             &{A_{e}}_i^{k\ \ \ \:} &{\ \ \;_i^k  \mathbb{R}_{-1/2}^{+1/2}}   &\delta_{i-1/2}[T^{k\ \ \ \:}]  &\delta_{k+1/2}[T_{i}] &\\ &&-{e_{2u}}_i^{k+1    }                             &{A_{e}}_i^{k+1} &{_i^{k+1} \mathbb{R}_{+1/2}^{- 1/2}}   &\delta_{i+1/2}[T^{k+1}]      &\delta_{k+1/2}[T_{i}] &\\ &&-{e_{2u}}_i^{k\ \ \ \:}                             &{A_{e}}_i^{k\ \ \ \:} &{\ \ \;_i^k  \mathbb{R}_{+1/2}^{+1/2}}   &\delta_{i+1/2}[T^{k\ \ \ \:}]  &\delta_{k+1/2}[T_{i}] &\Bigr\}  \\ \end{matrix} \end{align*} The two terms associated with the triad ${_i^k \mathbb{R}_{+1/2}^{+1/2}}$ are the same but of opposite signs, $i.e.$ the variance of the tracer is preserved by the discretisation of the skew fluxes. \biblio \end{document}
• ## NEMO/trunk/doc/latex/NEMO/subfiles/annex_iso.tex

 r10406 \documentclass[../tex_main/NEMO_manual]{subfiles} \documentclass[../main/NEMO_manual]{subfiles} \begin{document} % ================================================================ {\texorpdfstring{Iso-Neutral Diffusion and\\ Eddy Advection using Triads}{Iso-Neutral Diffusion and Eddy Advection using Triads}} \label{apdx:triad} \minitoc \pagebreak \newpage \section{Choice of \protect\ngn{namtra\_ldf} namelist parameters} %-----------------------------------------nam_traldf------------------------------------------------------ \section{Triad formulation of iso-neutral diffusion} \label{sec:iso} We have implemented into \NEMO a scheme inspired by \citet{Griffies_al_JPO98}, but formulated within the \NEMO framework, using scale factors rather than grid-sizes. \subsection{Iso-neutral diffusion operator} The iso-neutral second order tracer diffusive operator for small angles between iso-neutral surfaces and geopotentials is given by \autoref{eq:iso_tensor_1}: \begin{subequations} \label{eq:iso_tensor_1} \begin{subequations} \label{eq:iso_tensor_1} D^{lT}=-\Div\vect{f}^{lT}\equiv \mbox{with}\quad \;\;\Re = \begin{pmatrix} 1   &  0   & -r_1           \mystrut \\ 0   &  1   & -r_2           \mystrut \\ 1   &  0   & -r_1           \mystrut \\ 0   &  1   & -r_2           \mystrut \\ -r_1 & -r_2 &  r_1 ^2+r_2 ^2 \mystrut \end{pmatrix} \frac{1}{e_2} \pd[T]{j} \mystrut \\ \frac{1}{e_3} \pd[T]{k} \mystrut \end{pmatrix}. \end{pmatrix} . \end{subequations} \begin{align*} r_1 &=-\frac{e_3 }{e_1 } \left( \frac{\partial \rho }{\partial i} \right) \left( {\frac{\partial \rho }{\partial k}} \right)^{-1} \\ &=-\frac{e_3 }{e_1 } \left( -\alpha\frac{\partial T }{\partial i} + \beta\frac{\partial S }{\partial i} \right) \left( -\alpha\frac{\partial T }{\partial k} + \beta\frac{\partial S }{\partial k} \right)^{-1} \right) \left( {\frac{\partial \rho }{\partial k}} \right)^{-1} \\ &=-\frac{e_3 }{e_1 } \left( -\alpha\frac{\partial T }{\partial i} + \beta\frac{\partial S }{\partial i} \right) \left( -\alpha\frac{\partial T }{\partial k} + \beta\frac{\partial S }{\partial k} \right)^{-1} \end{align*} is the $i$-component of the slope of the iso-neutral surface relative to the computational surface, We will find it useful to consider the fluxes per unit area in $i,j,k$ space; we write \begin{equation} \label{eq:Fijk} $% \label{eq:Fijk} \vect{F}_{\mathrm{iso}}=\left(f_1^{lT}e_2e_3, f_2^{lT}e_1e_3, f_3^{lT}e_1e_2\right). \end{equation}$ Additionally, we will sometimes write the contributions towards the fluxes $\vect{f}$ and $\vect{F}_{\mathrm{iso}}$ from the component $R_{ij}$ of $\Re$ as $f_{ij}$, $F_{\mathrm{iso}\: ij}$, \label{eq:i13c} f_{13}=&+\Alt r_1\frac{1}{e_3}\frac{\partial T}{\partial k},\qquad f_{23}=+\Alt r_2\frac{1}{e_3}\frac{\partial T}{\partial k}\\ \intertext{and in the k-direction resulting from the lateral tracer gradients} \intertext{and in the k-direction resulting from the lateral tracer gradients} \label{eq:i31c} f_{31}+f_{32}=& \Alt r_1\frac{1}{e_1}\frac{\partial T}{\partial i}+\Alt r_2\frac{1}{e_1}\frac{\partial T}{\partial i} f_{31}+f_{32}=& \Alt r_1\frac{1}{e_1}\frac{\partial T}{\partial i}+\Alt r_2\frac{1}{e_1}\frac{\partial T}{\partial i} \end{align} \subsection{Standard discretization} The straightforward approach to discretize the lateral skew flux \autoref{eq:i13c} from tracer cell $i,k$ to $i+1,k$, introduced in 1995 into OPA, $\overline{\overline r_1} ^{\,i,k} = -\frac{{e_{3u}}_{i+1/2}^k}{{e_{1u}}_{i+1/2}^k} r_1} ^{\,i,k} = -\frac{{e_{3u}}_{i+1/2}^k}{{e_{1u}}_{i+1/2}^k} \frac{\delta_{i+1/2} [\rho]}{\overline{\overline{\delta_k \rho}}^{\,i,k}},$ \subsection{Expression of the skew-flux in terms of triad slopes} \citep{Griffies_al_JPO98} introduce a different discretization of the off-diagonal terms that nicely solves the problem. % the mean vertical gradient at the $u$-point, % >>>>>>>>>>>>>>>>>>>>>>>>>>>> \begin{figure}[tb] \begin{center} \begin{figure}[tb] \begin{center} \includegraphics[width=1.05\textwidth]{Fig_GRIFF_triad_fluxes} \caption{ \protect\label{fig:ISO_triad} \caption{ \protect\label{fig:ISO_triad} (a) Arrangement of triads $S_i$ and tracer gradients to give lateral tracer flux from box $i,k$ to $i+1,k$ give lateral tracer flux from box $i,k$ to $i+1,k$ (b) Triads $S'_i$ and tracer gradients to give vertical tracer flux from box $i,k$ to $i,k+1$.} \end{center} \end{figure} box $i,k$ to $i,k+1$. } \end{center} \end{figure} % >>>>>>>>>>>>>>>>>>>>>>>>>>>> They get the skew flux from the products of the vertical gradients at each $w$-point surrounding the $u$-point with _{k+\frac{1}{2}} \left[ T^i \right]/e_{{3w}_{i+1}}^{k+\frac{1}{2}} \\ +\Alts _{i+1}^k a_3 s_3 \delta_{k-\frac{1}{2}} \left[ T^{i+1} +\Alts _{i+1}^k a_3 s_3 \delta_{k-\frac{1}{2}} \left[ T^{i+1} \right]/e_{{3w}_{i+1}}^{k+\frac{1}{2}}  +\Alts _i^k a_4 s_4 \delta _{k-\frac{1}{2}} \left[ T^i \right]/e_{{3w}_{i+1}}^{k+\frac{1}{2}}, \left( F_w^{31} \right) _i ^{k+\frac{1}{2}} =  \Alts_i^{k+1} a_{1}' s_{1}' \delta_{i-\frac{1}{2}} \left[ T^{k+1} \right]/{e_{3u}}_{i-\frac{1}{2}}^{k+1} +\Alts_i^{k+1} a_{2}' s_{2}' \delta_{i+\frac{1}{2}} \left[ T^{k+1} \right]/{e_{3u}}_{i+\frac{1}{2}}^{k+1}\\ +\Alts_i^{k+1} a_{2}' s_{2}' \delta_{i+\frac{1}{2}} \left[ T^{k+1} \right]/{e_{3u}}_{i+\frac{1}{2}}^{k+1} \\ + \Alts_i^k a_{3}' s_{3}' \delta_{i-\frac{1}{2}} \left[ T^k\right]/{e_{3u}}_{i-\frac{1}{2}}^k +\Alts_i^k a_{4}' s_{4}' \delta_{i+\frac{1}{2}} \left[ T^k \right]/{e_{3u}}_{i+\frac{1}{2}}^k. % >>>>>>>>>>>>>>>>>>>>>>>>>>>> \begin{figure}[tb] \begin{center} \begin{figure}[tb] \begin{center} \includegraphics[width=0.80\textwidth]{Fig_GRIFF_qcells} \caption{   \protect\label{fig:qcells} \caption{ \protect\label{fig:qcells} Triad notation for quarter cells. $T$-cells are inside boxes, while the  $i+\half,k$ $u$-cell is shaded in green and the $i,k+\half$ $w$-cell is shaded in pink.} \end{center} \end{figure} the $i,k+\half$ $w$-cell is shaded in pink. } \end{center} \end{figure} % >>>>>>>>>>>>>>>>>>>>>>>>>>>> \subsection{Full triad fluxes} A key property of iso-neutral diffusion is that it should not affect the (locally referenced) density. In particular there should be no lateral or vertical density flux.