Index: /NEMO/trunk/doc/latex/NEMO/main/appendices.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/main/appendices.tex	(revision 11542)
+++ /NEMO/trunk/doc/latex/NEMO/main/appendices.tex	(revision 11543)
@@ -1,8 +1,8 @@
 
-\subfile{../subfiles/annex_A}             %% Generalised vertical coordinate
-\subfile{../subfiles/annex_B}             %% Diffusive operator
-\subfile{../subfiles/annex_C}             %% Discrete invariants of the eqs.
-\subfile{../subfiles/annex_iso}	          %% Isoneutral diffusion using triads
-\subfile{../subfiles/annex_DOMAINcfg}     %% Brief notes on DOMAINcfg
+\subfile{../subfiles/apdx_s_coord}      %% Generalised vertical coordinate
+\subfile{../subfiles/apdx_diff_opers}   %% Diffusive operators
+\subfile{../subfiles/apdx_invariants}   %% Discrete invariants of the eqs.
+\subfile{../subfiles/apdx_triads}       %% Isoneutral diffusion using triads
+\subfile{../subfiles/apdx_DOMAINcfg}    %% Brief notes on DOMAINcfg
 
 %% Not included
@@ -10,4 +10,3 @@
 %\subfile{../subfiles/chap_DIU}
 %\subfile{../subfiles/chap_conservation}
-%\subfile{../subfiles/annex_E}				%% Notes on some on going staff
-
+%\subfile{../subfiles/apdx_algos}   %% Notes on some on going staff
Index: /NEMO/trunk/doc/latex/NEMO/main/chapters.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/main/chapters.tex	(revision 11542)
+++ /NEMO/trunk/doc/latex/NEMO/main/chapters.tex	(revision 11543)
@@ -13,5 +13,5 @@
 \subfile{../subfiles/chap_STO}            %% Stochastic param.
 \subfile{../subfiles/chap_misc}           %% Miscellaneous topics
-\subfile{../subfiles/chap_CONFIG}         %% Predefined configurations
+\subfile{../subfiles/chap_cfgs}           %% Predefined configurations
 
 %% Not included
Index: /NEMO/trunk/doc/latex/NEMO/main/introduction.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/main/introduction.tex	(revision 11542)
+++ /NEMO/trunk/doc/latex/NEMO/main/introduction.tex	(revision 11543)
@@ -56,5 +56,5 @@
 
 \begin{description}
-\item [\nameref{chap:PE}] presents the equations and their assumptions, the vertical coordinates used,
+\item [\nameref{chap:MB}] presents the equations and their assumptions, the vertical coordinates used,
 and the subgrid scale physics.
 The equations are written in a curvilinear coordinate system, with a choice of vertical coordinates
@@ -63,5 +63,5 @@
 Dimensional units in the meter, kilogram, second (MKS) international system are used throughout.
 The following chapters deal with the discrete equations.
-\item [\nameref{chap:STP}] presents the model time stepping environment.
+\item [\nameref{chap:TD}] presents the model time stepping environment.
 it is a three level scheme in which the tendency terms of the equations are evaluated either
 centered in time, or forward, or backward depending of the nature of the term.
@@ -123,6 +123,7 @@
 \item [\nameref{chap:ASM}] describes how increments produced by
 data \textbf{A}s\textbf{S}i\textbf{M}ilation may be applied to the model equations.
+\item [\nameref{chap:STO}]
 \item [\nameref{chap:MISC}] (including solvers)
-\item [\nameref{chap:CFG}] provides finally a brief introduction to
+\item [\nameref{chap:CFGS}] provides finally a brief introduction to
 the pre-defined model configurations
 (water column model \texttt{C1D}, ORCA and GYRE families of configurations).
@@ -133,9 +134,9 @@
 
 \begin{description}
-\item [\nameref{apdx:s_coord}]
-\item [\nameref{apdx:diff_oper}]
-\item [\nameref{apdx:invariants}]
-\item [\nameref{apdx:triads}]
-\item [\nameref{apdx:DOMAINcfg}]
-\item [\nameref{apdx:coding}]
+\item [\nameref{apdx:SCOORD}]
+\item [\nameref{apdx:DIFFOPERS}]
+\item [\nameref{apdx:INVARIANTS}]
+\item [\nameref{apdx:TRIADS}]
+\item [\nameref{apdx:DOMCFG}]
+\item [\nameref{apdx:CODING}]
 \end{description}
Index: MO/trunk/doc/latex/NEMO/subfiles/annex_A.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/subfiles/annex_A.tex	(revision 11542)
+++ 	(revision )
@@ -1,600 +1,0 @@
-\documentclass[../main/NEMO_manual]{subfiles}
-
-\begin{document}
-
-% ================================================================
-% Chapter Appendix A : Curvilinear s-Coordinate Equations
-% ================================================================
-\chapter{Curvilinear $s-$Coordinate Equations}
-\label{apdx:A}
-
-\chaptertoc
-
-\vfill
-\begin{figure}[b]
-\subsubsection*{Changes record}
-\begin{tabular}{l||l|m{0.65\linewidth}}
-    Release   & Author        & Modifications \\
-    {\em 4.0} & {\em Mike Bell} & {\em review}  \\
-    {\em 3.x} & {\em Gurvan Madec} & {\em original}  \\
-\end{tabular}
-\end{figure}
-
-
-\newpage
-
-% ================================================================
-% Chain rule
-% ================================================================
-\section{Chain rule for $s-$coordinates}
-\label{sec:A_chain}
-
-In order to establish the set of Primitive Equation in curvilinear $s$-coordinates
-(\ie\ an orthogonal curvilinear coordinate in the horizontal and
-an Arbitrary Lagrangian Eulerian (ALE) coordinate in the vertical),
-we start from the set of equations established in \autoref{subsec:PE_zco_Eq} for
-the special case $k = z$ and thus $e_3 = 1$,
-and we introduce an arbitrary vertical coordinate $a = a(i,j,z,t)$.
-Let us define a new vertical scale factor by $e_3 = \partial z / \partial s$ (which now depends on $(i,j,z,t)$) and
-the horizontal slope of $s-$surfaces by:
-\begin{equation}
-  \label{apdx:A_s_slope}
-  \sigma_1 =\frac{1}{e_1 } \; \left. {\frac{\partial z}{\partial i}} \right|_s
-  \quad \text{and} \quad
-  \sigma_2 =\frac{1}{e_2 } \; \left. {\frac{\partial z}{\partial j}} \right|_s .
-\end{equation}
-
-The model fields (e.g. pressure $p$) can be viewed as functions of $(i,j,z,t)$ (e.g. $p(i,j,z,t)$) or as
-functions of $(i,j,s,t)$ (e.g. $p(i,j,s,t)$). The symbol $\bullet$ will be used to represent any one of 
-these fields.  Any ``infinitesimal'' change in $\bullet$ can be written in two forms: 
-\begin{equation}
-  \label{apdx:A_s_infin_changes}
-  \begin{aligned}
-    & \delta \bullet =  \delta i \left. \frac{ \partial \bullet }{\partial i} \right|_{j,s,t} 
-                + \delta j \left. \frac{ \partial \bullet }{\partial i} \right|_{i,s,t} 
-                + \delta s \left. \frac{ \partial \bullet }{\partial s} \right|_{i,j,t} 
-                + \delta t \left. \frac{ \partial \bullet }{\partial t} \right|_{i,j,s} , \\
-    & \delta \bullet =  \delta i \left. \frac{ \partial \bullet }{\partial i} \right|_{j,z,t} 
-                + \delta j \left. \frac{ \partial \bullet }{\partial i} \right|_{i,z,t} 
-                + \delta z \left. \frac{ \partial \bullet }{\partial z} \right|_{i,j,t} 
-                + \delta t \left. \frac{ \partial \bullet }{\partial t} \right|_{i,j,z} .
-  \end{aligned}
-\end{equation}
-Using the first form and considering a change $\delta i$ with $j, z$ and $t$ held constant, shows that
-\begin{equation}
-  \label{apdx:A_s_chain_rule}
-      \left. {\frac{\partial \bullet }{\partial i}} \right|_{j,z,t}  =
-      \left. {\frac{\partial \bullet }{\partial i}} \right|_{j,s,t}
-    + \left. {\frac{\partial s       }{\partial i}} \right|_{j,z,t} \; 
-      \left. {\frac{\partial \bullet }{\partial s}} \right|_{i,j,t} .    
-\end{equation}
-The term $\left. \partial s / \partial i \right|_{j,z,t}$ can be related to the slope of constant $s$ surfaces, 
-(\autoref{apdx:A_s_slope}), by applying the second of (\autoref{apdx:A_s_infin_changes}) with $\bullet$ set to 
-$s$ and $j, t$ held constant
-\begin{equation}
-\label{apdx:a_delta_s}
-\delta s|_{j,t} = 
-         \delta i \left. \frac{ \partial s }{\partial i} \right|_{j,z,t} 
-       + \delta z \left. \frac{ \partial s }{\partial z} \right|_{i,j,t} .
-\end{equation}
-Choosing to look at a direction in the $(i,z)$ plane in which $\delta s = 0$ and using
-(\autoref{apdx:A_s_slope}) we obtain 
-\begin{equation}
-\left. \frac{ \partial s }{\partial i} \right|_{j,z,t} =  
-         -  \left. \frac{ \partial z }{\partial i} \right|_{j,s,t} \;
-            \left. \frac{ \partial s }{\partial z} \right|_{i,j,t}
-	 = - \frac{e_1 }{e_3 }\sigma_1  .
-\label{apdx:a_ds_di_z}
-\end{equation}
-Another identity, similar in form to (\autoref{apdx:a_ds_di_z}), can be derived
-by choosing $\bullet$ to be $s$ and using the second form of (\autoref{apdx:A_s_infin_changes}) to consider
-changes in which $i , j$ and $s$ are constant. This shows that
-\begin{equation}
-\label{apdx:A_w_in_s}
-w_s = \left. \frac{ \partial z }{\partial t} \right|_{i,j,s} =  
-- \left. \frac{ \partial z }{\partial s} \right|_{i,j,t}
-  \left. \frac{ \partial s }{\partial t} \right|_{i,j,z} 
-  = - e_3 \left. \frac{ \partial s }{\partial t} \right|_{i,j,z} . 
-\end{equation}
-
-In what follows, for brevity, indication of the constancy of the $i, j$ and $t$ indices is 
-usually omitted. Using the arguments outlined above one can show that the chain rules needed to establish 
-the model equations in the curvilinear $s-$coordinate system are:
-\begin{equation}
-  \label{apdx:A_s_chain_rule}
-  \begin{aligned}
-    &\left. {\frac{\partial \bullet }{\partial t}} \right|_z  =
-    \left. {\frac{\partial \bullet }{\partial t}} \right|_s 
-	 + \frac{\partial \bullet }{\partial s}\; \frac{\partial s}{\partial t} , \\
-    &\left. {\frac{\partial \bullet }{\partial i}} \right|_z  =
-    \left. {\frac{\partial \bullet }{\partial i}} \right|_s
-    +\frac{\partial \bullet }{\partial s}\; \frac{\partial s}{\partial i}=
-    \left. {\frac{\partial \bullet }{\partial i}} \right|_s 
-    -\frac{e_1 }{e_3 }\sigma_1 \frac{\partial \bullet }{\partial s} , \\
-    &\left. {\frac{\partial \bullet }{\partial j}} \right|_z  =
-    \left. {\frac{\partial \bullet }{\partial j}} \right|_s 
-    + \frac{\partial \bullet }{\partial s}\;\frac{\partial s}{\partial j}=
-    \left. {\frac{\partial \bullet }{\partial j}} \right|_s 
-    - \frac{e_2 }{e_3 }\sigma_2 \frac{\partial \bullet }{\partial s} , \\
-    &\;\frac{\partial \bullet }{\partial z}  \;\; = \frac{1}{e_3 }\frac{\partial \bullet }{\partial s} .
-  \end{aligned}
-\end{equation}
-
-
-% ================================================================
-% continuity equation
-% ================================================================
-\section{Continuity equation in $s-$coordinates}
-\label{sec:A_continuity}
-
-Using (\autoref{apdx:A_s_chain_rule}) and
-the fact that the horizontal scale factors $e_1$ and $e_2$ do not depend on the vertical coordinate,
-the divergence of the velocity relative to the ($i$,$j$,$z$) coordinate system is transformed as follows in order to
-obtain its expression in the curvilinear $s-$coordinate system:
-
-\begin{subequations}
-  \begin{align*}
-    {
-    \begin{array}{*{20}l}
-      \nabla \cdot {\mathrm {\mathbf U}}
-      &= \frac{1}{e_1 \,e_2 }  \left[ \left. {\frac{\partial (e_2 \,u)}{\partial i}} \right|_z
-        +\left. {\frac{\partial(e_1 \,v)}{\partial j}} \right|_z  \right]
-        + \frac{\partial w}{\partial z} \\ \\
-      &     = \frac{1}{e_1 \,e_2 }  \left[
-		  \left.   \frac{\partial (e_2 \,u)}{\partial i}    \right|_s
-		  - \frac{e_1 }{e_3 } \sigma_1 \frac{\partial (e_2 \,u)}{\partial s}
-        + \left.   \frac{\partial (e_1 \,v)}{\partial j}    \right|_s
-		  - \frac{e_2 }{e_3 } \sigma_2 \frac{\partial (e_1 \,v)}{\partial s}	\right]
-        + \frac{\partial w}{\partial s} \; \frac{\partial s}{\partial z} \\ \\
-      &     = \frac{1}{e_1 \,e_2 }   \left[
-		  \left.   \frac{\partial (e_2 \,u)}{\partial i}    \right|_s
-        + \left.   \frac{\partial (e_1 \,v)}{\partial j}    \right|_s       	\right]
-        + \frac{1}{e_3 }\left[        \frac{\partial w}{\partial s}
-        -  \sigma_1 \frac{\partial u}{\partial s}
-        -  \sigma_2 \frac{\partial v}{\partial s}      \right] \\ \\
-      &     = \frac{1}{e_1 \,e_2 \,e_3 }   \left[
-		  \left.   \frac{\partial (e_2 \,e_3 \,u)}{\partial i}    \right|_s
-		  -\left.    e_2 \,u    \frac{\partial e_3 }{\partial i}     \right|_s
-        + \left.  \frac{\partial (e_1 \,e_3 \,v)}{\partial j}    \right|_s
-		  - \left.    e_1 v      \frac{\partial e_3 }{\partial j}    \right|_s   \right] \\
-      & \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad
-        + \frac{1}{e_3 } \left[        \frac{\partial w}{\partial s}
-        -  \sigma_1 \frac{\partial u}{\partial s}
-        -  \sigma_2 \frac{\partial v}{\partial s}      \right]      \\
-      %
-      \intertext{Noting that $
-      \frac{1}{e_1} \left.{ \frac{\partial e_3}{\partial i}} \right|_s
-      =\frac{1}{e_1} \left.{ \frac{\partial^2 z}{\partial i\,\partial s}} \right|_s
-      =\frac{\partial}{\partial s} \left( {\frac{1}{e_1 } \left.{ \frac{\partial z}{\partial i} }\right|_s } \right)
-      =\frac{\partial \sigma_1}{\partial s}
-      $ and $
-      \frac{1}{e_2 }\left. {\frac{\partial e_3 }{\partial j}} \right|_s
-      =\frac{\partial \sigma_2}{\partial s}
-      $, it becomes:}
-    %
-      \nabla \cdot {\mathrm {\mathbf U}}
-      & = \frac{1}{e_1 \,e_2 \,e_3 }  \left[
-		  \left.  \frac{\partial (e_2 \,e_3 \,u)}{\partial i} \right|_s
-        +\left.  \frac{\partial (e_1 \,e_3 \,v)}{\partial j} \right|_s        \right] \\
-      & \qquad \qquad \qquad \qquad \quad
-        +\frac{1}{e_3 }\left[ {\frac{\partial w}{\partial s}-u\frac{\partial \sigma_1 }{\partial s}-v\frac{\partial \sigma_2 }{\partial s}-\sigma_1 \frac{\partial u}{\partial s}-\sigma_2 \frac{\partial v}{\partial s}} \right] \\
-      \\
-      & = \frac{1}{e_1 \,e_2 \,e_3 }  \left[
-		  \left.  \frac{\partial (e_2 \,e_3 \,u)}{\partial i} \right|_s
-        +\left.  \frac{\partial (e_1 \,e_3 \,v)}{\partial j} \right|_s        \right]
-        + \frac{1}{e_3 } \; \frac{\partial}{\partial s}   \left[  w -  u\;\sigma_1  - v\;\sigma_2  \right]
-    \end{array}
-        }
-  \end{align*}
-\end{subequations}
-
-Here, $w$ is the vertical velocity relative to the $z-$coordinate system. 
-Using the first form of (\autoref{apdx:A_s_infin_changes}) 
-and the definitions (\autoref{apdx:A_s_slope}) and (\autoref{apdx:A_w_in_s}) for $\sigma_1$, $\sigma_2$ and  $w_s$,
-one can show that the vertical velocity, $w_p$ of a point
-moving with the horizontal velocity of the fluid along an $s$ surface is given by 
-\begin{equation}
-\label{apdx:A_w_p}
-\begin{split}
-w_p  = & \left. \frac{ \partial z }{\partial t} \right|_s
-     + \frac{u}{e_1} \left. \frac{ \partial z }{\partial i} \right|_s 
-     + \frac{v}{e_2} \left. \frac{ \partial z }{\partial j} \right|_s \\
-     = & w_s + u \sigma_1 + v \sigma_2 .
-\end{split}     
-\end{equation}
- The vertical velocity across this surface is denoted by
-\begin{equation}
-  \label{apdx:A_w_s}
-  \omega  = w - w_p = w - ( w_s + \sigma_1 \,u + \sigma_2 \,v )  . 
-\end{equation}
-Hence 
-\begin{equation}
-\frac{1}{e_3 } \frac{\partial}{\partial s}   \left[  w -  u\;\sigma_1  - v\;\sigma_2  \right] = 
-\frac{1}{e_3 } \frac{\partial}{\partial s} \left[  \omega + w_s \right] = 
-   \frac{1}{e_3 } \left[ \frac{\partial \omega}{\partial s} 
- + \left. \frac{ \partial }{\partial t} \right|_s \frac{\partial z}{\partial s} \right] = 
-   \frac{1}{e_3 } \frac{\partial \omega}{\partial s} + \frac{1}{e_3 } \left. \frac{ \partial e_3}{\partial t} . \right|_s 
-\end{equation}
-
-Using (\autoref{apdx:A_w_s}) in our expression for $\nabla \cdot {\mathrm {\mathbf U}}$ we obtain 
-our final expression for the divergence of the velocity in the curvilinear $s-$coordinate system:
-\begin{equation}
-      \nabla \cdot {\mathrm {\mathbf U}} =
-         \frac{1}{e_1 \,e_2 \,e_3 }    \left[
-		  \left.  \frac{\partial (e_2 \,e_3 \,u)}{\partial i} \right|_s
-        +\left.  \frac{\partial (e_1 \,e_3 \,v)}{\partial j} \right|_s        \right]
-        + \frac{1}{e_3 } \frac{\partial \omega }{\partial s}
-        + \frac{1}{e_3 } \left. \frac{\partial e_3}{\partial t} \right|_s .
-\end{equation}
-
-As a result, the continuity equation \autoref{eq:PE_continuity} in the $s-$coordinates is:
-\begin{equation}
-  \label{apdx:A_sco_Continuity}
-  \frac{1}{e_3 } \frac{\partial e_3}{\partial t}
-  + \frac{1}{e_1 \,e_2 \,e_3 }\left[
-    {\left. {\frac{\partial (e_2 \,e_3 \,u)}{\partial i}} \right|_s
-      +  \left. {\frac{\partial (e_1 \,e_3 \,v)}{\partial j}} \right|_s } \right]
-  +\frac{1}{e_3 }\frac{\partial \omega }{\partial s} = 0 .
-\end{equation}
-An additional term has appeared that takes into account
-the contribution of the time variation of the vertical coordinate to the volume budget.
-
-
-% ================================================================
-% momentum equation
-% ================================================================
-\section{Momentum equation in $s-$coordinate}
-\label{sec:A_momentum}
-
-Here we only consider the first component of the momentum equation,
-the generalization to the second one being straightforward.
-
-$\bullet$ \textbf{Total derivative in vector invariant form}
-
-Let us consider \autoref{eq:PE_dyn_vect}, the first component of the momentum equation in the vector invariant form.
-Its total $z-$coordinate time derivative,
-$\left. \frac{D u}{D t} \right|_z$ can be transformed as follows in order to obtain
-its expression in the curvilinear $s-$coordinate system:
-
-\begin{subequations}
-  \begin{align*}
-    {
-    \begin{array}{*{20}l}
-      \left. \frac{D u}{D t} \right|_z
-      &= \left. {\frac{\partial u }{\partial t}} \right|_z
-        - \left. \zeta \right|_z v
-        + \frac{1}{2e_1} \left.{ \frac{\partial (u^2+v^2)}{\partial i}} \right|_z
-        + w \;\frac{\partial u}{\partial z} \\ \\
-      &= \left. {\frac{\partial u }{\partial t}} \right|_z
-        -  \frac{1}{e_1 \,e_2 }\left[ { \left.{ \frac{\partial (e_2 \,v)}{\partial i} }\right|_z
-        -\left.{ \frac{\partial (e_1 \,u)}{\partial j} }\right|_z } \right] \; v
-        +  \frac{1}{2e_1} \left.{ \frac{\partial (u^2+v^2)}{\partial i} } \right|_z
-        +  w \;\frac{\partial u}{\partial z}      \\
-        %
-      \intertext{introducing the chain rule (\autoref{apdx:A_s_chain_rule}) }
-      %
-      &= \left. {\frac{\partial u }{\partial t}} \right|_z
-        - \frac{1}{e_1\,e_2}\left[ { \left.{ \frac{\partial (e_2 \,v)}{\partial i} } \right|_s
-        -\left.{ \frac{\partial (e_1 \,u)}{\partial j} } \right|_s } \right.
-        \left. {-\frac{e_1}{e_3}\sigma_1 \frac{\partial (e_2 \,v)}{\partial s}
-        +\frac{e_2}{e_3}\sigma_2 \frac{\partial (e_1 \,u)}{\partial s}} \right] \; v  \\
-      & \qquad \qquad \qquad \qquad
-        {
-        + \frac{1}{2e_1} \left(                                  \left.  \frac{\partial (u^2+v^2)}{\partial i} \right|_s
-        - \frac{e_1}{e_3}\sigma_1 \frac{\partial (u^2+v^2)}{\partial s}               \right)
-        + \frac{w}{e_3 } \;\frac{\partial u}{\partial s}
-        } \\ \\
-      &= \left. {\frac{\partial u }{\partial t}} \right|_z
-        - \left. \zeta \right|_s \;v
-        + \frac{1}{2\,e_1}\left. {\frac{\partial (u^2+v^2)}{\partial i}} \right|_s \\
-      &\qquad \qquad \qquad \quad
-        + \frac{w}{e_3 } \;\frac{\partial u}{\partial s}
-        + \left[   {\frac{\sigma_1 }{e_3 }\frac{\partial v}{\partial s}
-        - \frac{\sigma_2 }{e_3 }\frac{\partial u}{\partial s}}   \right]\;v
-        - \frac{\sigma_1 }{2e_3 }\frac{\partial (u^2+v^2)}{\partial s} \\ \\
-      &= \left. {\frac{\partial u }{\partial t}} \right|_z
-        - \left. \zeta \right|_s \;v
-        + \frac{1}{2\,e_1}\left. {\frac{\partial (u^2+v^2)}{\partial i}} \right|_s \\
-      &\qquad \qquad \qquad \quad
-        + \frac{1}{e_3} \left[    {w\frac{\partial u}{\partial s}
-        +\sigma_1 v\frac{\partial v}{\partial s} - \sigma_2 v\frac{\partial u}{\partial s}
-        - \sigma_1 u\frac{\partial u}{\partial s} - \sigma_1 v\frac{\partial v}{\partial s}} \right] \\ \\
-      &= \left. {\frac{\partial u }{\partial t}} \right|_z
-        - \left. \zeta \right|_s \;v
-        + \frac{1}{2\,e_1}\left. {\frac{\partial (u^2+v^2)}{\partial i}} \right|_s
-        + \frac{1}{e_3} \left[  w - \sigma_2 v - \sigma_1 u  \right]
-        \; \frac{\partial u}{\partial s} .  \\
-        %
-      \intertext{Introducing $\omega$, the dia-s-surface velocity given by (\autoref{apdx:A_w_s}) }
-      %
-      &= \left. {\frac{\partial u }{\partial t}} \right|_z
-        - \left. \zeta \right|_s \;v
-        + \frac{1}{2\,e_1}\left. {\frac{\partial (u^2+v^2)}{\partial i}} \right|_s
-        + \frac{1}{e_3 } \left( \omega + w_s \right) \frac{\partial u}{\partial s}   \\
-    \end{array}
-    }
-  \end{align*}
-\end{subequations}
-%
-Applying the time derivative chain rule (first equation of (\autoref{apdx:A_s_chain_rule})) to $u$ and
-using (\autoref{apdx:A_w_in_s}) provides the expression of the last term of the right hand side,
-\[
-  {
-    \begin{array}{*{20}l}
-      \frac{w_s}{e_3}  \;\frac{\partial u}{\partial s}
-      = - \left. \frac{\partial s}{\partial t} \right|_z \;  \frac{\partial u }{\partial s}
-      = \left. {\frac{\partial u }{\partial t}} \right|_s  - \left. {\frac{\partial u }{\partial t}} \right|_z \ .
-    \end{array}
-  }
-\]
-This leads to the $s-$coordinate formulation of the total $z-$coordinate time derivative,
-\ie\ the total $s-$coordinate time derivative :
-\begin{align}
-  \label{apdx:A_sco_Dt_vect}
-  \left. \frac{D u}{D t} \right|_s
-  = \left. {\frac{\partial u }{\partial t}} \right|_s
-  - \left. \zeta \right|_s \;v
-  + \frac{1}{2\,e_1}\left. {\frac{\partial (u^2+v^2)}{\partial i}} \right|_s
-  + \frac{1}{e_3 } \omega \;\frac{\partial u}{\partial s} . 
-\end{align}
-Therefore, the vector invariant form of the total time derivative has exactly the same mathematical form in
-$z-$ and $s-$coordinates.
-This is not the case for the flux form as shown in next paragraph.
-
-$\bullet$ \textbf{Total derivative in flux form}
-
-Let us start from the total time derivative in the curvilinear $s-$coordinate system we have just establish.
-Following the procedure used to establish (\autoref{eq:PE_flux_form}), it can be transformed into :
-% \begin{subequations}
-\begin{align*}
-  {
-  \begin{array}{*{20}l}
-    \left. \frac{D u}{D t} \right|_s  &= \left. {\frac{\partial u }{\partial t}} \right|_s
-    & -  \zeta \;v
-      + \frac{1}{2\;e_1 } \frac{\partial \left( {u^2+v^2} \right)}{\partial i}
-      + \frac{1}{e_3} \omega \;\frac{\partial u}{\partial s} \\ \\
-                                      &= \left. {\frac{\partial u }{\partial t}} \right|_s
-    &+\frac{1}{e_1\;e_2}  \left(    \frac{\partial \left( {e_2 \,u\,u } \right)}{\partial i}
-      + \frac{\partial \left( {e_1 \,u\,v } \right)}{\partial j}     \right)
-      + \frac{1}{e_3 } \frac{\partial \left( {\omega\,u} \right)}{\partial s} \\ \\
-                                      &&- \,u \left[     \frac{1}{e_1 e_2 } \left(    \frac{\partial(e_2 u)}{\partial i}
-                                         + \frac{\partial(e_1 v)}{\partial j}    \right)
-                                         + \frac{1}{e_3}        \frac{\partial \omega}{\partial s}                       \right] \\ \\
-                                      &&- \frac{v}{e_1 e_2 }\left(    v	\;\frac{\partial e_2 }{\partial i}
-                                         -u	\;\frac{\partial e_1 }{\partial j} 	\right) . \\
-  \end{array}
-  }
-\end{align*}
-%
-Introducing the vertical scale factor inside the horizontal derivative of the first two terms 
-(\ie\ the horizontal divergence), it becomes :
-\begin{align*}
-  {
-  \begin{array}{*{20}l}
-    % \begin{align*} {\begin{array}{*{20}l}
-    %     {\begin{array}{*{20}l} \left. \frac{D u}{D t} \right|_s  
-    &= \left. {\frac{\partial u }{\partial t}} \right|_s
-    &+ \frac{1}{e_1\,e_2\,e_3}  \left(  \frac{\partial( e_2 e_3 \,u^2 )}{\partial i}
-      + \frac{\partial( e_1 e_3 \,u v )}{\partial j}
-      -  e_2 u u \frac{\partial e_3}{\partial i}
-      -  e_1 u v \frac{\partial e_3 }{\partial j}    \right)
-      + \frac{1}{e_3} \frac{\partial \left( {\omega\,u} \right)}{\partial s} \\ \\
-    && - \,u \left[  \frac{1}{e_1 e_2 e_3} \left(   \frac{\partial(e_2 e_3 \, u)}{\partial i}
-       + \frac{\partial(e_1 e_3 \, v)}{\partial j}
-       -  e_2 u \;\frac{\partial e_3 }{\partial i}
-       -  e_1 v \;\frac{\partial e_3 }{\partial j}   \right)
-       + \frac{1}{e_3}        \frac{\partial \omega}{\partial s}                       \right] \\ \\
-    && - \frac{v}{e_1 e_2 }\left( 	v  \;\frac{\partial e_2 }{\partial i}
-       -u  \;\frac{\partial e_1 }{\partial j} 	\right) \\ \\
-    &= \left. {\frac{\partial u }{\partial t}} \right|_s
-    &+ \frac{1}{e_1\,e_2\,e_3}  \left(  \frac{\partial( e_2 e_3 \,u\,u )}{\partial i}
-      + \frac{\partial( e_1 e_3 \,u\,v )}{\partial j}    \right)
-      + \frac{1}{e_3 } \frac{\partial \left( {\omega\,u} \right)}{\partial s} \\ \\
-    && - \,u \left[  \frac{1}{e_1 e_2 e_3} \left(   \frac{\partial(e_2 e_3 \, u)}{\partial i}
-       + \frac{\partial(e_1 e_3 \, v)}{\partial j}  \right)
-       + \frac{1}{e_3}        \frac{\partial \omega}{\partial s}                       \right]
-       - \frac{v}{e_1 e_2 }\left( 	v   \;\frac{\partial e_2 }{\partial i}
-       -u   \;\frac{\partial e_1 }{\partial j} 	\right)     .             \\
-     %
-    \intertext {Introducing a more compact form for the divergence of the momentum fluxes,
-    and using (\autoref{apdx:A_sco_Continuity}), the $s-$coordinate continuity equation,
-    it becomes : }
-  %
-    &= \left. {\frac{\partial u }{\partial t}} \right|_s
-    &+ \left.  \nabla \cdot \left(   {{\mathrm {\mathbf U}}\,u}   \right)    \right|_s
-      + \,u \frac{1}{e_3 } \frac{\partial e_3}{\partial t}
-      - \frac{v}{e_1 e_2 }\left(    v  \;\frac{\partial e_2 }{\partial i}
-      -u  \;\frac{\partial e_1 }{\partial j} 	\right)
-    \\
-  \end{array}
-  }
-\end{align*}
-which leads to the $s-$coordinate flux formulation of the total $s-$coordinate time derivative, 
-\ie\ the total $s-$coordinate time derivative in flux form:
-\begin{flalign}
-  \label{apdx:A_sco_Dt_flux}
-  \left. \frac{D u}{D t} \right|_s   = \frac{1}{e_3}  \left. \frac{\partial ( e_3\,u)}{\partial t} \right|_s
-  + \left.  \nabla \cdot \left(   {{\mathrm {\mathbf U}}\,u}   \right)    \right|_s
-  - \frac{v}{e_1 e_2 }\left(    v  \;\frac{\partial e_2 }{\partial i}
-    -u  \;\frac{\partial e_1 }{\partial j}            \right).
-\end{flalign}
-which is the total time derivative expressed in the curvilinear $s-$coordinate system.
-It has the same form as in the $z-$coordinate but for
-the vertical scale factor that has appeared inside the time derivative which
-comes from the modification of (\autoref{apdx:A_sco_Continuity}),
-the continuity equation.
-
-$\bullet$ \textbf{horizontal pressure gradient}
-
-The horizontal pressure gradient term can be transformed as follows:
-\[
-  \begin{split}
-    -\frac{1}{\rho_o \, e_1 }\left. {\frac{\partial p}{\partial i}} \right|_z
-    & =-\frac{1}{\rho_o e_1 }\left[ {\left. {\frac{\partial p}{\partial i}} \right|_s -\frac{e_1 }{e_3 }\sigma_1 \frac{\partial p}{\partial s}} \right] \\
-    & =-\frac{1}{\rho_o \,e_1 }\left. {\frac{\partial p}{\partial i}} \right|_s +\frac{\sigma_1 }{\rho_o \,e_3 }\left( {-g\;\rho \;e_3 } \right) \\
-    &=-\frac{1}{\rho_o \,e_1 }\left. {\frac{\partial p}{\partial i}} \right|_s -\frac{g\;\rho }{\rho_o }\sigma_1 .
-  \end{split}
-\]
-Applying similar manipulation to the second component and
-replacing $\sigma_1$ and $\sigma_2$ by their expression \autoref{apdx:A_s_slope}, it becomes:
-\begin{equation}
-  \label{apdx:A_grad_p_1}
-  \begin{split}
-    -\frac{1}{\rho_o \, e_1 } \left. {\frac{\partial p}{\partial i}} \right|_z
-    &=-\frac{1}{\rho_o \,e_1 } \left(     \left.              {\frac{\partial p}{\partial i}} \right|_s
-      + g\;\rho  \;\left. {\frac{\partial z}{\partial i}} \right|_s    \right) \\
-             %
-    -\frac{1}{\rho_o \, e_2 }\left. {\frac{\partial p}{\partial j}} \right|_z
-    &=-\frac{1}{\rho_o \,e_2 } \left(    \left.               {\frac{\partial p}{\partial j}} \right|_s
-      + g\;\rho \;\left. {\frac{\partial z}{\partial j}} \right|_s   \right) . \\
-  \end{split}
-\end{equation}
-
-An additional term appears in (\autoref{apdx:A_grad_p_1}) which accounts for
-the tilt of $s-$surfaces with respect to geopotential $z-$surfaces.
-
-As in $z$-coordinate,
-the horizontal pressure gradient can be split in two parts following \citet{marsaleix.auclair.ea_OM08}.
-Let defined a density anomaly, $d$, by $d=(\rho - \rho_o)/ \rho_o$,
-and a hydrostatic pressure anomaly, $p_h'$, by $p_h'= g \; \int_z^\eta d \; e_3 \; dk$.
-The pressure is then given by:
-\[
-  \begin{split}
-    p &= g\; \int_z^\eta \rho \; e_3 \; dk = g\; \int_z^\eta \rho_o \left( d + 1 \right) \; e_3 \; dk   \\
-    &= g \, \rho_o \; \int_z^\eta d \; e_3 \; dk + \rho_o g \, \int_z^\eta e_3 \; dk .
-  \end{split}
-\]
-Therefore, $p$ and $p_h'$ are linked through:
-\begin{equation}
-  \label{apdx:A_pressure}
-  p = \rho_o \; p_h' + \rho_o \, g \, ( \eta - z )
-\end{equation}
-and the hydrostatic pressure balance expressed in terms of $p_h'$ and $d$ is:
-\[
-  \frac{\partial p_h'}{\partial k} = - d \, g \, e_3 .
-\]
-
-Substituing \autoref{apdx:A_pressure} in \autoref{apdx:A_grad_p_1} and
-using the definition of the density anomaly it becomes an expression in two parts:
-\begin{equation}
-  \label{apdx:A_grad_p_2}
-  \begin{split}
-    -\frac{1}{\rho_o \, e_1 } \left. {\frac{\partial p}{\partial i}} \right|_z
-    &=-\frac{1}{e_1 } \left(     \left.              {\frac{\partial p_h'}{\partial i}} \right|_s
-      + g\; d  \;\left. {\frac{\partial z}{\partial i}} \right|_s    \right)  - \frac{g}{e_1 } \frac{\partial \eta}{\partial i} ,  \\
-             %
-    -\frac{1}{\rho_o \, e_2 }\left. {\frac{\partial p}{\partial j}} \right|_z
-    &=-\frac{1}{e_2 } \left(    \left.               {\frac{\partial p_h'}{\partial j}} \right|_s
-      + g\; d \;\left. {\frac{\partial z}{\partial j}} \right|_s   \right)  - \frac{g}{e_2 } \frac{\partial \eta}{\partial j} . \\
-  \end{split}
-\end{equation}
-This formulation of the pressure gradient is characterised by the appearance of
-a term depending on the sea surface height only
-(last term on the right hand side of expression \autoref{apdx:A_grad_p_2}).
-This term will be loosely termed \textit{surface pressure gradient} whereas
-the first term will be termed the \textit{hydrostatic pressure gradient} by analogy to
-the $z$-coordinate formulation.
-In fact, the true surface pressure gradient is $1/\rho_o \nabla (\rho \eta)$,
-and $\eta$ is implicitly included in the computation of $p_h'$ through the upper bound of the vertical integration.
-
-$\bullet$ \textbf{The other terms of the momentum equation}
-
-The coriolis and forcing terms as well as the the vertical physics remain unchanged as
-they involve neither time nor space derivatives.
-The form of the lateral physics is discussed in \autoref{apdx:B}.
-
-$\bullet$ \textbf{Full momentum equation}
-
-To sum up, in a curvilinear $s$-coordinate system,
-the vector invariant momentum equation solved by the model has the same mathematical expression as
-the one in a curvilinear $z-$coordinate, except for the pressure gradient term:
-\begin{subequations}
-  \label{apdx:A_dyn_vect}
-  \begin{multline}
-    \label{apdx:A_PE_dyn_vect_u}
-    \frac{\partial u}{\partial t}=
-    +   \left( {\zeta +f} \right)\,v
-    -   \frac{1}{2\,e_1} \frac{\partial}{\partial i} \left(  u^2+v^2   \right)
-    -   \frac{1}{e_3} \omega \frac{\partial u}{\partial k}       \\
-    -   \frac{1}{e_1 } \left(    \frac{\partial p_h'}{\partial i} + g\; d  \; \frac{\partial z}{\partial i}    \right)
-    -   \frac{g}{e_1 } \frac{\partial \eta}{\partial i}
-    +   D_u^{\vect{U}}  +   F_u^{\vect{U}} ,
-  \end{multline}
-  \begin{multline}
-    \label{apdx:A_dyn_vect_v}
-    \frac{\partial v}{\partial t}=
-    -   \left( {\zeta +f} \right)\,u
-    -   \frac{1}{2\,e_2 }\frac{\partial }{\partial j}\left(  u^2+v^2  \right)
-    -   \frac{1}{e_3 } \omega \frac{\partial v}{\partial k}         \\
-    -   \frac{1}{e_2 } \left(    \frac{\partial p_h'}{\partial j} + g\; d  \; \frac{\partial z}{\partial j}    \right)
-    -   \frac{g}{e_2 } \frac{\partial \eta}{\partial j}
-    +  D_v^{\vect{U}}  +   F_v^{\vect{U}} .
-  \end{multline}
-\end{subequations}
-whereas the flux form momentum equation differs from it by
-the formulation of both the time derivative and the pressure gradient term:
-\begin{subequations}
-  \label{apdx:A_dyn_flux}
-  \begin{multline}
-    \label{apdx:A_PE_dyn_flux_u}
-    \frac{1}{e_3} \frac{\partial \left(  e_3\,u  \right) }{\partial t} =
-    - \nabla \cdot \left(   {{\mathrm {\mathbf U}}\,u}   \right)
-    +   \left\{ {f + \frac{1}{e_1 e_2 }\left(    v  \;\frac{\partial e_2 }{\partial i}
-          -u  \;\frac{\partial e_1 }{\partial j}            \right)} \right\} \,v     \\
-    -   \frac{1}{e_1 } \left(    \frac{\partial p_h'}{\partial i} + g\; d  \; \frac{\partial z}{\partial i}    \right)
-    -   \frac{g}{e_1 } \frac{\partial \eta}{\partial i}
-    +   D_u^{\vect{U}}  +   F_u^{\vect{U}} ,
-  \end{multline}
-  \begin{multline}
-    \label{apdx:A_dyn_flux_v}
-    \frac{1}{e_3}\frac{\partial \left(  e_3\,v  \right) }{\partial t}=
-    -  \nabla \cdot \left(   {{\mathrm {\mathbf U}}\,v}   \right)
-    -   \left\{ {f + \frac{1}{e_1 e_2 }\left(    v  \;\frac{\partial e_2 }{\partial i}
-          -u  \;\frac{\partial e_1 }{\partial j}            \right)} \right\} \,u     \\
-    -   \frac{1}{e_2 } \left(    \frac{\partial p_h'}{\partial j} + g\; d  \; \frac{\partial z}{\partial j}    \right)
-    -   \frac{g}{e_2 } \frac{\partial \eta}{\partial j}
-    +  D_v^{\vect{U}}  +   F_v^{\vect{U}} . 
-  \end{multline}
-\end{subequations}
-Both formulation share the same hydrostatic pressure balance expressed in terms of
-hydrostatic pressure and density anomalies, $p_h'$ and $d=( \frac{\rho}{\rho_o}-1 )$:
-\begin{equation}
-  \label{apdx:A_dyn_zph}
-  \frac{\partial p_h'}{\partial k} = - d \, g \, e_3 .
-\end{equation}
-
-It is important to realize that the change in coordinate system has only concerned the position on the vertical.
-It has not affected (\textbf{i},\textbf{j},\textbf{k}), the orthogonal curvilinear set of unit vectors.
-($u$,$v$) are always horizontal velocities so that their evolution is driven by \emph{horizontal} forces,
-in particular the pressure gradient.
-By contrast, $\omega$ is not $w$, the third component of the velocity, but the dia-surface velocity component,
-\ie\ the volume flux across the moving $s$-surfaces per unit horizontal area. 
-
-
-% ================================================================
-% Tracer equation
-% ================================================================
-\section{Tracer equation}
-\label{sec:A_tracer}
-
-The tracer equation is obtained using the same calculation as for the continuity equation and then
-regrouping the time derivative terms in the left hand side :
-
-\begin{multline}
-  \label{apdx:A_tracer}
-  \frac{1}{e_3} \frac{\partial \left(  e_3 T  \right)}{\partial t}
-  = -\frac{1}{e_1 \,e_2 \,e_3}
-  \left[           \frac{\partial }{\partial i} \left( {e_2 \,e_3 \;Tu} \right)
-    +   \frac{\partial }{\partial j} \left( {e_1 \,e_3 \;Tv} \right)               \right]       \\
-  -  \frac{1}{e_3}  \frac{\partial }{\partial k} \left(                   Tw  \right)
-  +  D^{T} +F^{T}
-\end{multline}
-
-The expression for the advection term is a straight consequence of (\autoref{apdx:A_sco_Continuity}),
-the expression of the 3D divergence in the $s-$coordinates established above. 
-
-\biblio
-
-\pindex
-
-\end{document}
Index: MO/trunk/doc/latex/NEMO/subfiles/annex_B.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/subfiles/annex_B.tex	(revision 11542)
+++ 	(revision )
@@ -1,417 +1,0 @@
-\documentclass[../main/NEMO_manual]{subfiles}
-
-\begin{document}
-% ================================================================
-% Chapter Appendix B : Diffusive Operators
-% ================================================================
-\chapter{Appendix B : Diffusive Operators}
-\label{apdx:B}
-
-\chaptertoc
-
-\newpage
-
-% ================================================================
-% Horizontal/Vertical 2nd Order Tracer Diffusive Operators
-% ================================================================
-\section{Horizontal/Vertical $2^{nd}$ order tracer diffusive operators}
-\label{sec:B_1}
-
-\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)
-\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:
-
-\begin{equation}
-  \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)
-\end{equation}
-or in expanded form:
-\begin{align*}
-  {
-  \begin{array}{*{20}l}
-    D^T= \frac{1}{e_1\,e_2\,e_3 } & \left\{ \quad \quad \frac{\partial }{\partial i}  \left. \left[  e_2\,e_3 \, A^{lT}
-                               \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]  \right|_s  \right. \\
-        &  \quad \  +   \            \left.   \frac{\partial }{\partial j}  \left. \left[  e_1\,e_3 \, A^{lT}
-                               \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]  \right|_s  \right. \\
-        &  \quad \  +   \           \left.  e_1\,e_2\, \frac{\partial }{\partial s}  \left[ A^{lT} \; \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 
-                          +\left( \varepsilon +\sigma_1^2+\sigma_2 ^2 \right) \; \frac{1}{e_3 } \; \frac{\partial T}{\partial s} \right) \; \right] \;  \right\} .
-  \end{array}
-          }
-\end{align*}
-
-\autoref{apdx:B2} is obtained from \autoref{apdx:B1} without any additional assumption.
-Indeed, for the special case $k=z$ and thus $e_3 =1$,
-we introduce an arbitrary vertical coordinate $s = s (i,j,z)$ as in \autoref{apdx:A} and
-use \autoref{apdx:A_s_slope} and \autoref{apdx:A_s_chain_rule}.
-Since no cross horizontal derivative $\partial _i \partial _j $ appears in \autoref{apdx:B1},
-the ($i$,$z$) and ($j$,$z$) planes are independent.
-The derivation can then be demonstrated for the ($i$,$z$)~$\to$~($j$,$s$) transformation without
-any loss of generality:
-
-\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}$, this becomes:}
-    %
-    D^T & =\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 s}} \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, $D^T$ becomes:}
-    %
-   D^T &= \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 two terms on the second line cancel, while
-    the third line reduces to a single vertical derivative, so it becomes:}
-  %
-    D^T & =\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*}
-%\addtocounter{equation}{-2}
-
-% ================================================================
-% Isopycnal/Vertical 2nd Order Tracer Diffusive Operators
-% ================================================================
-\section{Iso/Diapycnal $2^{nd}$ order tracer diffusive operators}
-\label{sec:B_2}
-
-\subsubsection*{In z-coordinates}
-
-The iso/diapycnal diffusive tensor $\textbf {A}_{\textbf I}$ expressed in
-the ($i$,$j$,$k$) curvilinear coordinate system in which
-the equations of the ocean circulation model are formulated,
-takes the following form \citep{redi_JPO82}:
-
-\begin{equation}
-  \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_2 ^2 +\varepsilon a_1 ^2} \hfill & {-a_1 a_2 (1-\varepsilon)} \hfill & {-a_1 (1-\varepsilon) } \hfill \\
-          {-a_1 a_2 (1-\varepsilon) } \hfill & {1+a_1 ^2 +\varepsilon a_2 ^2} \hfill & {-a_2 (1-\varepsilon)} \hfill \\
-          {-a_1 (1-\varepsilon)} \hfill & {-a_2 (1-\varepsilon)} \hfill & {\varepsilon +a_1 ^2+a_2 ^2} \hfill \\
-        \end{array}
-      }} \right]
-\end{equation}
-where ($a_1$, $a_2$) are $(-1) \times$ the isopycnal slopes in
-($\textbf{i}$, $\textbf{j}$) directions, relative to geopotentials (or
-equivalently the slopes of the geopotential surfaces in the isopycnal
-coordinate framework):
-\[
-  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}
-\]
-and, as before, $\epsilon = A^{vT} / A^{lT}$.
-
-In practice, $\epsilon$ is small and isopycnal slopes are generally less than $10^{-2}$ in the ocean,
-so $\textbf {A}_{\textbf I}$ can be simplified appreciably \citep{cox_OM87}. Keeping leading order terms\footnote{Apart from the (1,0) 
-and (0,1) elements which are set to zero. See \citet{griffies_bk04}, section 14.1.4.1 for a discussion of this point.}:
-\begin{subequations}
-  \label{apdx:B4}
-  \begin{equation}
-    \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],
-  \end{equation}
-  and the iso/dianeutral diffusive operator in $z$-coordinates is then
-  \begin{equation}
-    \label{apdx:B4b}
-    D^T = \left. \nabla \right|_z \cdot
-    \left[ A^{lT} \;\Re \cdot \left. \nabla \right|_z T  \right]. \\
-  \end{equation}
-\end{subequations}
-
-Physically, the full tensor \autoref{apdx:B3} represents strong isoneutral diffusion on a plane parallel to
-the isoneutral surface and weak dianeutral diffusion perpendicular to this plane.
-However,
-the approximate `weak-slope' tensor \autoref{apdx:B4a} represents strong diffusion along the isoneutral surface,
-with weak \emph{vertical} diffusion -- the principal axes of the tensor are no longer orthogonal.
-This simplification also decouples the ($i$,$z$) and ($j$,$z$) planes of the tensor.
-The weak-slope operator therefore takes the same form, \autoref{apdx:B4}, as \autoref{apdx:B2},
-the diffusion operator for geopotential diffusion written in non-orthogonal $i,j,s$-coordinates.
-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]}. \\
-\end{multline}
-
-The isopycnal diffusion operator \autoref{apdx:B4},
-\autoref{apdx:B_ldfiso} conserves tracer quantity and dissipates its square.
-As \autoref{apdx:B4} is the divergence of a flux, the demonstration of the first property is trivial, providing that the flux normal to the boundary is zero 
-(as it is when $A_h$ is zero at the boundary). 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,
-\]
-and since
-\begin{align*}
-  {
-  \begin{array}{*{20}l}
-    \nabla T\;.\left( {{\mathrm {\mathbf A}}_{\mathrm {\mathbf 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*}
-%\addtocounter{equation}{-1}
-the property becomes obvious.
-
-\subsubsection*{In generalized vertical coordinates}
-
-Because the weak-slope operator \autoref{apdx:B4},
-\autoref{apdx:B_ldfiso} is decoupled in the ($i$,$z$) and ($j$,$z$) planes,
-it may be transformed into generalized $s$-coordinates in the same way as
-\autoref{sec:B_1} was transformed into \autoref{sec:B_2}.
-The resulting operator then takes the simple form
-
-\begin{equation}
-  \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),
-\end{equation}
-
-where ($r_1$, $r_2$) are $(-1)\times$ the isopycnal slopes in ($\textbf{i}$, $\textbf{j}$) directions,
-relative to $s$-coordinate surfaces (or equivalently the slopes of the
-$s$-coordinate surfaces in the isopycnal coordinate framework):
-\[
-  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}.
-\]
-
-To prove \autoref{apdx:B_ldfiso_s} by direct re-expression of \autoref{apdx:B_ldfiso} is straightforward, but laborious.
-An easier way is first to note (by reversing the derivation of \autoref{sec:B_2} from \autoref{sec:B_1} ) that
-the weak-slope operator may be \emph{exactly} reexpressed in non-orthogonal $i,j,\rho$-coordinates as
-
-\begin{equation}
-  \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).
-\end{equation}
-Then direct transformation from $i,j,\rho$-coordinates to $i,j,s$-coordinates gives
-\autoref{apdx:B_ldfiso_s} immediately.
-
-Note that the weak-slope approximation is only made in transforming from
-the (rotated,orthogonal) isoneutral axes to the non-orthogonal $i,j,\rho$-coordinates.
-The further transformation into $i,j,s$-coordinates is exact, whatever the steepness of the $s$-surfaces,
-in the same way as the transformation of horizontal/vertical Laplacian diffusion in $z$-coordinates in
-\autoref{sec:B_1} onto $s$-coordinates is exact, however steep the $s$-surfaces.
-
-
-% ================================================================
-% Lateral/Vertical Momentum Diffusive Operators
-% ================================================================
-\section{Lateral/Vertical momentum diffusive operators}
-\label{sec:B_3}
-
-The second order momentum diffusion operator (Laplacian) in $z$-coordinates is found by
-applying \autoref{eq:PE_lap_vector}, the expression for the Laplacian of a vector,
-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)
-\end{align*}
-Using \autoref{eq:PE_div}, the definition of the horizontal divergence,
-the third component of the second vector is obviously zero and thus :
-\[
-  \Delta {\textbf{U}}_h = \nabla _h \left( \chi \right) - \nabla _h \times \left( \zeta \textbf{k} \right) + \frac {1}{e_3 } \frac {\partial }{\partial k} \left( {\frac {1}{e_3 } \frac{\partial {\textbf{ U}}_h }{\partial k}} \right) . 
-\]
-
-Note that this operator ensures a full separation between
-the vorticity and horizontal divergence fields (see \autoref{apdx:C}).
-It is only equal to a Laplacian applied to each component in Cartesian coordinates, not on the sphere.
-
-The horizontal/vertical second order (Laplacian type) operator used to diffuse horizontal momentum in
-the $z$-coordinate therefore takes the following form:
-\begin{equation}
-  \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 {\mathrm {\mathbf U}}_h }{\partial k}} \right) , \\
-\end{equation}
-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 }{\partial k} \left( \frac{A^{vm}}{e_3} \frac{\partial u}{\partial k} \right)   ,   \\
-  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 }{\partial k} \left( \frac{A^{vm}}{e_3} \frac{\partial v}{\partial k} \right) .
-\end{align*}
-
-Note Bene: introducing a rotation in \autoref{apdx:B_Lap_U} does not lead to
-a useful expression for the iso/diapycnal Laplacian operator in the $z$-coordinate.
-Similarly, we did not found an expression of practical use for
-the geopotential horizontal/vertical Laplacian operator in the $s$-coordinate.
-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
-
-\pindex
-
-\end{document}
Index: MO/trunk/doc/latex/NEMO/subfiles/annex_C.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/subfiles/annex_C.tex	(revision 11542)
+++ 	(revision )
@@ -1,1534 +1,0 @@
-\documentclass[../main/NEMO_manual]{subfiles}
-
-\begin{document}
-% ================================================================
-% Chapter Ñ Appendix C : Discrete Invariants of the Equations
-% ================================================================
-\chapter{Discrete Invariants of the Equations}
-\label{apdx:C}
-
-\chaptertoc
-
-%%%  Appendix put in gmcomment as it has not been updated for \zstar and s coordinate
-%I'm writting this appendix. It will be available in a forthcoming release of the documentation
-
-%\gmcomment{
-
-\newpage
-
-% ================================================================
-% Introduction / Notations
-% ================================================================
-\section{Introduction / Notations}
-\label{sec:C.0}
-
-Notation used in this appendix in the demonstations:
-
-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
-\]
-
-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}
-\]
-
-partial derivative notation: $\partial_\bullet = \frac{\partial}{\partial \bullet}$
-
-$dv=e_1\,e_2\,e_3 \,di\,dj\,dk$  is the volume element, with only $e_3$ that depends on time.
-$D$ and $S$ are the ocean domain volume and surface, respectively.
-No wetting/drying is allow (\ie\ $\frac{\partial S}{\partial t} = 0$).
-Let $k_s$ and $k_b$ be the ocean surface and bottom, resp.
-(\ie\ $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}
-\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
-\]
-
-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
-\]
-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
-\]
-equation of evolution of $Q$ written as
-the time evolution of the vertical content of $Q$ like for tracers, or momentum in flux form,
-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 } \\
-\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 }
-  -   \frac{1}{2} \int_D {  \frac{Q^2}{e_3} \partial_t (e_3) \;dv }
-\end{flalign}
-equation of evolution of $Q$ written as the time evolution of $Q$ like for momentum in vector invariant form,
-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 } \\
-\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 }
-\end{flalign}
-
-% ================================================================
-% Continuous Total energy Conservation
-% ================================================================
-\section{Continuous conservation}
-\label{sec:C.1}
-
-The discretization of pimitive equation in $s$-coordinate (\ie\ 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 (\ie\ kinetic plus potential energies) is conserved:
-\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}
-under the following assumptions: no dissipation, no forcing (wind, buoyancy flux, atmospheric pressure variations),
-mass conservation, and closed domain.
-
-This equation can be transformed to obtain several sub-equalities.
-The transformation for the advection term depends on whether the vector invariant form or
-the flux form is used for the momentum equation.
-Using \autoref{eq:Q2_vect} and introducing \autoref{apdx:A_dyn_vect} in
-\autoref{eq:Tot_Energy} for the former form and
-using \autoref{eq:Q2_flux} and introducing \autoref{apdx:A_dyn_flux} in
-\autoref{eq:Tot_Energy} for the latter form leads to:
-
-% \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_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
-\]
-coriolis term
-\[
-  % \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
-\]
-
-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
-  \]
-  \begin{equation}
-    \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{equation}
-\end{subequations}
-
-\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   &&&\\
-\end{flalign*}
-where the last equality is obtained by noting that the brackets is exactly the expression of $w$,
-the vertical velocity referenced to the fixe $z$-coordinate system (see \autoref{apdx:A_w_s}).
-
-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*}
-
-%gm comment
-\gmcomment{
-%
-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,
-\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}{\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    \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       &&&\\
-\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  \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
-  - \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
-\end{flalign*}
-% end gm comment
-}
-%
-
-% ================================================================
-% Discrete Total energy Conservation : vector invariant form
-% ================================================================
-\section{Discrete total energy conservation: vector invariant form}
-\label{sec:C.2}
-
-% -------------------------------------------------------------------------------------------------------------
-%       Total energy conservation
-% -------------------------------------------------------------------------------------------------------------
-\subsection{Total energy conservation}
-\label{subsec:C_KE+PE_vect}
-
-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
-\end{flalign*}
-which in vector invariant forms, it leads to:
-\begin{equation}
-  \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}
-\end{equation}
-
-Substituting the discrete expression of the time derivative of the velocity either in vector invariant,
-leads to the discrete equivalent of the four equations \autoref{eq:E_tot_flux}.
-
-% -------------------------------------------------------------------------------------------------------------
-%       Vorticity term (coriolis + vorticity part of the advection)
-% -------------------------------------------------------------------------------------------------------------
-\subsection{Vorticity term (coriolis + vorticity part of the advection)}
-\label{subsec:C_vor}
-
-Let $q$, located at $f$-points, be either the relative ($q=\zeta / e_{3f}$),
-or the planetary ($q=f/e_{3f}$), or the total potential vorticity ($q=(\zeta +f) /e_{3f}$).
-Two discretisation of the vorticity term (ENE and EEN) allows the conservation of the kinetic energy.
-% -------------------------------------------------------------------------------------------------------------
-%       Vorticity Term with ENE scheme
-% -------------------------------------------------------------------------------------------------------------
-\subsubsection{Vorticity term with ENE scheme (\protect\np{ln\_dynvor\_ene}\forcode{ = .true.})}
-\label{subsec:C_vorENE}
-
-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)
-\]
-
-This formulation does not conserve the enstrophy but it does conserve the total kinetic energy.
-Indeed, the kinetic energy tendency associated to the vorticity term and
-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}
-  }
-\end{flalign*}
-In other words, the domain averaged kinetic energy does not change due to the vorticity term.
-
-% -------------------------------------------------------------------------------------------------------------
-%       Vorticity Term with EEN scheme
-% -------------------------------------------------------------------------------------------------------------
-\subsubsection{Vorticity term with EEN scheme (\protect\np{ln\_dynvor\_een}\forcode{ = .true.})}
-\label{subsec:C_vorEEN_vect}
-
-With the EEN scheme, the vorticity terms are represented as:
-\begin{equation}
-  \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.
-\end{equation}
-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:
-\begin{equation}
-  \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)
-\end{equation}
-
-This formulation does conserve the total kinetic energy.
-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*}
-
-% -------------------------------------------------------------------------------------------------------------
-%       Gradient of Kinetic Energy / Vertical Advection
-% -------------------------------------------------------------------------------------------------------------
-\subsubsection{Gradient of kinetic energy / Vertical advection}
-\label{subsec:C_zad}
-
-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 }
-\]
-Indeed, using successively \autoref{eq:DOM_di_adj} (\ie\ the skew symmetry property of the $\delta$ operator)
-and the continuity equation, then \autoref{eq:DOM_di_adj} again,
-then the commutativity of operators $\overline {\,\cdot \,}$ and $\delta$, and finally \autoref{eq:DOM_mi_adj}
-(\ie\ the symmetry property of the $\overline {\,\cdot \,}$ 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 }    &&&\\
-\end{flalign*}
-
-There is two main points here.
-First, the satisfaction of this property links the choice of the discrete formulation of the vertical advection and
-of the horizontal gradient of KE.
-Choosing one imposes the other.
-For example KE can also be discretized as $1/2\,({\overline u^{\,i}}^2 + {\overline v^{\,j}}^2)$.
-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)
-\]
-a formulation that requires an additional horizontal mean in contrast with the one used in \NEMO.
-Nine velocity points have to be used instead of 3.
-This is the reason why it has not been chosen.
-
-Second, as soon as the chosen $s$-coordinate depends on time,
-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}
-\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*}
-
-Blah blah required on the the step representation of bottom topography.....
-
-
-% -------------------------------------------------------------------------------------------------------------
-%       Pressure Gradient Term
-% -------------------------------------------------------------------------------------------------------------
-\subsection{Pressure gradient term}
-\label{subsec:C.2.6}
-
-\gmcomment{
-  A pressure gradient has no contribution to the evolution of the vorticity as the curl of a gradient is zero.
-  In the $z$-coordinate, this property is satisfied locally on a C-grid with 2nd order finite differences
-  (property \autoref{eq:DOM_curl_grad}).
-}
-
-When the equation of state is linear
-(\ie\ when an advection-diffusion equation for density can be derived from those of temperature and salinity)
-the change of KE due to the work of pressure forces is balanced by
-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 g\, \rho \; \partial_t (z)  \;dv
-\]
-
-This property can be satisfied in a discrete sense for both $z$- and $s$-coordinates.
-Indeed, defining the depth of a $T$-point, $z_t$,
-as the sum of the vertical scale factors at $w$-points starting from the surface,
-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}, \ie\ 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}.
-It remains to demonstrate that the last term,
-which is obviously a discrete analogue of $\int_D \frac{p}{e_3} \partial_t (e_3)\;dv$ is equal to
-the last term 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\}
-\end{flalign*}
-
-Let introduce $p_w$ the pressure at $w$-point such that $\delta_k [p_w] = - \rho \,g\,e_{3t}$.
-The right-hand-side of the above equation can be transformed as follows:
-
-\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\}
-  \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\}
-\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\}
-\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\}
-\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*}
-  %
-}
-%end gm comment
-
-Note that this property strongly constrains the discrete expression of both the depth of $T-$points and
-of the term added to the pressure gradient in the $s$-coordinate.
-Nevertheless, it is almost never satisfied since a linear equation of state is rarely used.
-
-% ================================================================
-% Discrete Total energy Conservation : flux form
-% ================================================================
-\section{Discrete total energy conservation: flux form}
-\label{sec:C.3}
-
-% -------------------------------------------------------------------------------------------------------------
-%       Total energy conservation
-% -------------------------------------------------------------------------------------------------------------
-\subsection{Total energy conservation}
-\label{subsec:C_KE+PE_flux}
-
-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  \\
-\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\} \\
-\end{flalign*}
-
-Substituting the discrete expression of the time derivative of the velocity either in
-vector invariant or in flux form, leads to the discrete equivalent of the ????
-
-
-% -------------------------------------------------------------------------------------------------------------
-%       Coriolis and advection terms: flux form
-% -------------------------------------------------------------------------------------------------------------
-\subsection{Coriolis and advection terms: flux form}
-\label{subsec:C.3.2}
-
-% -------------------------------------------------------------------------------------------------------------
-%       Coriolis plus ``metric'' Term
-% -------------------------------------------------------------------------------------------------------------
-\subsubsection{Coriolis plus ``metric'' term}
-\label{subsec:C.3.3}
-
-In flux from the vorticity term reduces to a Coriolis term in which
-the Coriolis parameter has been modified to account for the ``metric'' term.
-This altered Coriolis parameter is discretised at an f-point.
-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)
-\]
-
-Either the ENE or EEN scheme is then applied to obtain the vorticity term in flux form.
-It therefore conserves the total KE.
-The derivation is the same as for the vorticity term in the vector invariant form (\autoref{subsec:C_vor}).
-
-% -------------------------------------------------------------------------------------------------------------
-%       Flux form advection
-% -------------------------------------------------------------------------------------------------------------
-\subsubsection{Flux form advection}
-\label{subsec:C.3.4}
-
-The flux form operator of the momentum advection is evaluated using
-a centered second order finite difference scheme.
-Because of the flux form, the discrete operator does not contribute to the global budget of linear momentum.
-Because of the centered second order scheme, it conserves the horizontal kinetic energy, that is:
-
-\begin{equation}
-  \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
-\end{equation}
-
-Let us first consider the first term of the scalar product
-(\ie\ 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\}    &&& \\
-\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\}
-\]
-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 discrete operator does not contribute to the global budget of linear momentum (flux form).
-The horizontal kinetic energy is not conserved, but forced to decay (\ie\ the scheme is diffusive).
-
-% ================================================================
-% Discrete Enstrophy Conservation
-% ================================================================
-\section{Discrete enstrophy conservation}
-\label{sec:C.4}
-
-% -------------------------------------------------------------------------------------------------------------
-%       Vorticity Term with ENS scheme
-% -------------------------------------------------------------------------------------------------------------
-\subsubsection{Vorticity term with ENS scheme  (\protect\np{ln\_dynvor\_ens}\forcode{ = .true.})}
-\label{subsec:C_vorENS}
-
-In the ENS scheme, the vorticity term is descretized as follows:
-\begin{equation}
-  \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.
-\end{equation}
-
-The scheme does not allow but the conservation of the total kinetic energy but the conservation of $q^2$,
-the potential enstrophy for a horizontally non-divergent flow (\ie\ when $\chi$=$0$).
-Indeed, using the symmetry or skew symmetry properties of the operators
-( \autoref{eq:DOM_mi_adj} and \autoref{eq:DOM_di_adj}),
-it can be shown that:
-\begin{equation}
-  \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
-\end{equation}
-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}
-  }
-\end{flalign*}
-The later equality is obtain only when the flow is horizontally non-divergent, \ie\ $\chi$=$0$.
-
-% -------------------------------------------------------------------------------------------------------------
-%       Vorticity Term with EEN scheme
-% -------------------------------------------------------------------------------------------------------------
-\subsubsection{Vorticity Term with EEN scheme (\protect\np{ln\_dynvor\_een}\forcode{ = .true.})}
-\label{subsec:C_vorEEN}
-
-With the EEN scheme, the vorticity terms are represented as:
-\begin{equation}
-  \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.
-\end{equation}
-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:
-\begin{equation}
-  \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)
-\end{equation}
-
-This formulation does conserve the potential enstrophy for a horizontally non-divergent flow (\ie\ $\chi=0$).
-
-Let consider one of the vorticity triad, for example ${^{i}_j}\mathbb{Q}^{+1/2}_{+1/2} $,
-similar manipulation can be done for the 3 others.
-The discrete form of the right hand side of \autoref{eq:C_1.1} applied to
-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*}
-
-% ================================================================
-% Conservation Properties on Tracers
-% ================================================================
-\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
-the internal dynamics and physics (equations in flux form).
-For advection,
-only the CEN2 scheme (\ie\ $2^{nd}$ order finite different scheme) conserves the global variance of tracer.
-Nevertheless the other schemes ensure that the global variance decreases
-(\ie\ they are at least slightly diffusive).
-For diffusion, all the schemes ensure the decrease of the total tracer variance, except the iso-neutral operator.
-There is generally no strict conservation of mass,
-as the equation of state is non linear with respect to $T$ and $S$.
-In practice, the mass is conserved to a very high accuracy.
-% -------------------------------------------------------------------------------------------------------------
-%       Advection Term
-% -------------------------------------------------------------------------------------------------------------
-\subsection{Advection term}
-\label{subsec:C.5.1}
-
-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
-\]
-
-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*}
-
-Whatever the advection scheme considered it conserves of the tracer content as
-all the scheme are written in flux form.
-Indeed, let $T$ be the tracer and its $\tau_u$, $\tau_v$, and $\tau_w$ interpolated values at velocity point
-(whatever the interpolation is),
-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]
- 	 + \delta_k \left[ W \;\tau_w \right] \right\}   && \\
-  &\equiv 0 &&&
-\end{flalign*}
-
-The conservation of the variance of tracer due to the advection tendency can be achieved only with the CEN2 scheme,
-\ie\ when $\tau_u= \overline T^{\,i+1/2}$, $\tau_v= \overline T^{\,j+1/2}$, and $\tau_w= \overline T^{\,k+1/2}$.
-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\}      &&& \\
-\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 }$.
-
-% ================================================================
-% Conservation Properties on Lateral Momentum Physics
-% ================================================================
-\section{Conservation properties on lateral momentum physics}
-\label{sec:dynldf_properties}
-
-The discrete formulation of the horizontal diffusion of momentum ensures
-the conservation of potential vorticity and the horizontal divergence,
-and the dissipation of the square of these quantities
-(\ie\ enstrophy and the variance of the horizontal divergence) as well as
-the dissipation of the horizontal kinetic energy.
-In particular, when the eddy coefficients are horizontally uniform,
-it ensures a complete separation of vorticity and horizontal divergence fields,
-so that diffusion (dissipation) of vorticity (enstrophy) does not generate horizontal divergence
-(variance of the horizontal divergence) and \textit{vice versa}.
-
-These properties of the horizontal diffusion operator are a direct consequence of
-properties \autoref{eq:DOM_curl_grad} and \autoref{eq:DOM_div_curl}.
-When the vertical curl of the horizontal diffusion of momentum (discrete sense) is taken,
-the term associated with the horizontal gradient of the divergence is locally zero.
-
-% -------------------------------------------------------------------------------------------------------------
-%       Conservation of Potential Vorticity
-% -------------------------------------------------------------------------------------------------------------
-\subsection{Conservation of potential vorticity}
-\label{subsec:C.6.1}
-
-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]
-	 + \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
-  \\
-\end{flalign*}
-
-% -------------------------------------------------------------------------------------------------------------
-%       Dissipation of Horizontal Kinetic Energy
-% -------------------------------------------------------------------------------------------------------------
-\subsection{Dissipation of horizontal kinetic energy}
-\label{subsec:C.6.2}
-
-The lateral momentum diffusion term dissipates the horizontal kinetic energy:
-%\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}
-\]
-
-% -------------------------------------------------------------------------------------------------------------
-%       Dissipation of Enstrophy
-% -------------------------------------------------------------------------------------------------------------
-\subsection{Dissipation of enstrophy}
-\label{subsec:C.6.3}
-
-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    &&&\\
-\end{flalign*}
-
-% -------------------------------------------------------------------------------------------------------------
-%       Conservation of Horizontal Divergence
-% -------------------------------------------------------------------------------------------------------------
-\subsection{Conservation of horizontal divergence}
-\label{subsec:C.6.4}
-
-When the horizontal divergence of the horizontal diffusion of momentum (discrete sense) is taken,
-the term associated with the vertical curl of the vorticity is zero locally, due to \autoref{eq:DOM_div_curl}.
-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
-\end{flalign*}
-
-% -------------------------------------------------------------------------------------------------------------
-%       Dissipation of Horizontal Divergence Variance
-% -------------------------------------------------------------------------------------------------------------
-\subsection{Dissipation of horizontal divergence variance}
-\label{subsec:C.6.5}
-
-\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
-\end{flalign*}
-
-% ================================================================
-% Conservation Properties on Vertical Momentum Physics
-% ================================================================
-\section{Conservation properties on vertical momentum physics}
-\label{sec:C.7}
-
-As for the lateral momentum physics,
-the continuous form of the vertical diffusion of momentum satisfies several integral constraints.
-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
-\end{align*}
-
-The first property is obvious.
-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   &&&
-\end{flalign*}
-
-The vorticity is also conserved.
-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   &&
-\end{flalign*}
-
-If the vertical diffusion coefficient is uniform over the whole domain, the enstrophy is dissipated, \ie
-\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   &&&
-\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\}  &&
-\end{flalign*}
-Using the fact that the vertical diffusion coefficients are uniform,
-and that in $z$-coordinate, the vertical scale factors do not depend on $i$ and $j$ so that:
-$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    &&&
-\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    &&&
-\end{flalign*}
-and the square of the horizontal divergence decreases (\ie\ the horizontal divergence is dissipated) if
-the vertical diffusion coefficient is uniform over the whole domain:
-
-\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  &&&
-\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    &&&
-\end{flalign*}
-
-% ================================================================
-% Conservation Properties on Tracer Physics
-% ================================================================
-\section{Conservation properties on tracer physics}
-\label{sec:C.8}
-
-The numerical schemes used for tracer subgridscale physics are written such that
-the heat and salt contents are conserved (equations in flux form).
-Since a flux form is used to compute the temperature and salinity,
-the quadratic form of these quantities (\ie\ their variance) globally tends to diminish.
-As for the advection term, there is conservation of mass only if the Equation Of Seawater is linear.
-
-% -------------------------------------------------------------------------------------------------------------
-%       Conservation of Tracers
-% -------------------------------------------------------------------------------------------------------------
-\subsection{Conservation of tracers}
-\label{subsec:C.8.1}
-
-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
-  &&
-\end{flalign*}
-
-In fact, this property simply results from the flux form of the operator.
-
-% -------------------------------------------------------------------------------------------------------------
-%       Dissipation of Tracer Variance
-% -------------------------------------------------------------------------------------------------------------
-\subsection{Dissipation of tracer variance}
-\label{subsec:C.8.2}
-
-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*}
-
-%%%%  end of appendix in gm comment
-%}
-\biblio
-
-\pindex
-
-\end{document}
Index: MO/trunk/doc/latex/NEMO/subfiles/annex_DOMAINcfg.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/subfiles/annex_DOMAINcfg.tex	(revision 11542)
+++ 	(revision )
@@ -1,563 +1,0 @@
-\documentclass[../main/NEMO_manual]{subfiles}
-
-\begin{document}
-% ================================================================
-% Appendix DOMAINcfg : A brief guide to the DOMAINcfg tool
-% ================================================================
-\chapter{A brief guide to the DOMAINcfg tool}
-\label{apdx:DOMAINcfg}
-
-\chaptertoc
-\vfill
-\begin{figure}[b]
-\subsubsection*{Changes record}
-\begin{tabular}{m{0.08\linewidth}||m{0.32\linewidth}|m{0.6\linewidth}}
-    Release   & Author(s)     & Modifications \\
-\hline
-    {\em 4.0} & {\em Andrew Coward} & {\em Created at v4.0 from materials removed from chap\_DOM that are still relevant to the \forcode{DOMAINcfg} tool and which illustrate and explain the choices to be made by the user when setting up new domains }  \\
-\end{tabular}
-\end{figure}
-
-\newpage
-
-This appendix briefly describes some of the options available in the
-\forcode{DOMAINcfg} tool mentioned in \autoref{chap:DOM}.
-
-This tool will evolve into an independent utility with its own documentation but its
-current manifestation is mostly a wrapper for \NEMO\ \forcode{DOM} modules more aligned to
-those in the previous versions of \NEMO. These versions allowed the user to define some
-horizontal and vertical grids through additional namelist parameters. Explanations of
-these parameters are retained here for reference pending better documentation for
-\forcode{DOMAINcfg}. Please note that the namelist blocks named in this appendix refer to
-those read by \forcode{DOMAINcfg} via its own \forcode{namelist_ref} and
-\forcode{namelist_cfg} files. Although, due to their origins, these namelists share names
-with those used by \NEMO, they are not interchangeable and should be considered independent
-of those described elsewhere in this manual.
-
-% -------------------------------------------------------------------------------------------------------------
-%        Choice of horizontal grid
-% -------------------------------------------------------------------------------------------------------------
-\section{Choice of horizontal grid}
-\label{sec:DOMCFG_hor}
-
-%--------------------------------------------namdom-------------------------------------------------------
-
-\nlst{namdom_domcfg}
-%--------------------------------------------------------------------------------------------------------------
-
-The user has three options available in defining a horizontal grid, which involve the
-namelist variable \np{jphgr\_mesh} of the \nam{dom} (\texttt{DOMAINcfg} variant only)
-namelist.
-
-\begin{description}
- \item[\np{jphgr\_mesh}=0]  The most general curvilinear orthogonal grids.
-  The coordinates and their first derivatives with respect to $i$ and $j$ are provided
-  in a input file (\ifile{coordinates}), read in \rou{hgr\_read} subroutine of the domhgr module.
-  This is now the only option available within \NEMO\ itself from v4.0 onwards.
-\item[\np{jphgr\_mesh}=1 to 5] A few simple analytical grids are provided (see below).
-  For other analytical grids, the \mdl{domhgr} module (\texttt{DOMAINcfg} variant) must be
-  modified by the user. In most cases, modifying the \mdl{usrdef\_hgr} module of \NEMO\ is
-  a better alternative since this is designed to allow simple analytical domains to be
-  configured and used without the need for external data files.
-\end{description}
-
-There are two simple cases of geographical grids on the sphere. With
-\np{jphgr\_mesh}=1, the grid (expressed in degrees) is regular in space,
-with grid sizes specified by parameters \np{ppe1\_deg} and \np{ppe2\_deg},
-respectively. Such a geographical grid can be very anisotropic at high latitudes
-because of the convergence of meridians (the zonal scale factors $e_1$
-become much smaller than the meridional scale factors $e_2$). The Mercator
-grid (\np{jphgr\_mesh}=4) avoids this anisotropy by refining the meridional scale
-factors in the same way as the zonal ones. In this case, meridional scale factors
-and latitudes are calculated analytically using the formulae appropriate for
-a Mercator projection, based on \np{ppe1\_deg} which is a reference grid spacing
-at the equator (this applies even when the geographical equator is situated outside
-the model domain).
-
-In these two cases (\np{jphgr\_mesh}=1 or 4), the grid position is defined by the
-longitude and latitude of the south-westernmost point (\np{ppglamt0}
-and \np{ppgphi0}). Note that for the Mercator grid the user need only provide
-an approximate starting latitude: the real latitude will be recalculated analytically,
-in order to ensure that the equator corresponds to line passing through $t$-
-and $u$-points.
-
-Rectangular grids ignoring the spherical geometry are defined with
-\np{jphgr\_mesh} = 2, 3, 5. The domain is either an $f$-plane (\np{jphgr\_mesh} = 2,
-Coriolis factor is constant) or a beta-plane (\np{jphgr\_mesh} = 3, the Coriolis factor
-is linear in the $j$-direction). The grid size is uniform in meter in each direction,
-and given by the parameters \np{ppe1\_m} and \np{ppe2\_m} respectively.
-The zonal grid coordinate (\textit{glam} arrays) is in kilometers, starting at zero
-with the first $t$-point. The meridional coordinate (gphi. arrays) is in kilometers,
-and the second $t$-point corresponds to coordinate $gphit=0$. The input
-variable \np{ppglam0} is ignored. \np{ppgphi0} is used to set the reference
-latitude for computation of the Coriolis parameter. In the case of the beta plane,
-\np{ppgphi0} corresponds to the center of the domain. Finally, the special case
-\np{jphgr\_mesh}=5 corresponds to a beta plane in a rotated domain for the
-GYRE configuration, representing a classical mid-latitude double gyre system.
-The rotation allows us to maximize the jet length relative to the gyre areas
-(and the number of grid points).
-
-% -------------------------------------------------------------------------------------------------------------
-%        vertical reference coordinate transformation
-% -------------------------------------------------------------------------------------------------------------
-\section{Vertical grid}
-\label{sec:DOMCFG_vert}
-\subsection{Vertical reference coordinate}
-\label{sec:DOMCFG_zref}
-
-%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-\begin{figure}[!tb]
-  \begin{center}
-    \includegraphics[width=\textwidth]{Fig_zgr}
-    \caption{
-      \protect\label{fig:DOMCFG_zgr}
-      Default vertical mesh for ORCA2: 30 ocean levels (L30).
-      Vertical level functions for (a) T-point depth and (b) the associated scale factor for the $z$-coordinate case.
-    }
-  \end{center}
-\end{figure}
-%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-The reference coordinate transformation $z_0(k)$ defines the arrays $gdept_0$ and
-$gdepw_0$ for $t$- and $w$-points, respectively. See \autoref{sec:DOMCFG_sco} for the
-S-coordinate options.  As indicated on \autoref{fig:index_vert} \jp{jpk} is the number of
-$w$-levels.  $gdepw_0(1)$ is the ocean surface.  There are at most \jp{jpk}-1 $t$-points
-inside the ocean, the additional $t$-point at $jk = jpk$ is below the sea floor and is not
-used.  The vertical location of $w$- and $t$-levels is defined from the analytic
-expression of the depth $z_0(k)$ whose analytical derivative with respect to $k$ provides
-the vertical scale factors.  The user must provide the analytical expression of both $z_0$
-and its first derivative with respect to $k$.  This is done in routine \mdl{domzgr}
-through statement functions, using parameters provided in the \nam{dom} namelist
-(\texttt{DOMAINcfg} variant).
-
-It is possible to define a simple regular vertical grid by giving zero stretching
-(\np{ppacr}\forcode{ = 0}).  In that case, the parameters \jp{jpk} (number of $w$-levels)
-and \np{pphmax} (total ocean depth in meters) fully define the grid.
-
-For climate-related studies it is often desirable to concentrate the vertical resolution
-near the ocean surface.  The following function is proposed as a standard for a
-$z$-coordinate (with either full or partial steps):
-\begin{gather}
-  \label{eq:DOMCFG_zgr_ana_1}
-    z_0  (k) = h_{sur} - h_0 \; k - \; h_1 \; \log  \big[ \cosh ((k - h_{th}) / h_{cr}) \big] \\
-    e_3^0(k) = \lt|    - h_0      -    h_1 \; \tanh \big[        (k - h_{th}) / h_{cr}  \big] \rt|
-\end{gather}
-
-where $k = 1$ to \jp{jpk} for $w$-levels and $k = 1$ to $k = 1$ for $t-$levels.  Such an
-expression allows us to define a nearly uniform vertical location of levels at the ocean
-top and bottom with a smooth hyperbolic tangent transition in between (\autoref{fig:DOMCFG_zgr}).
-
-A double hyperbolic tangent version (\np{ldbletanh}\forcode{ = .true.}) is also available
-which permits finer control and is used, typically, to obtain a well resolved upper ocean
-without compromising on resolution at depth using a moderate number of levels.
-
-\begin{gather}
-  \label{eq:DOMCFG_zgr_ana_1b}
-    \begin{split}
-    z_0  (k) = h_{sur} - h_0 \; k &- \; h_1 \; \log  \big[ \cosh ((k - h_{th}) / h_{cr}) \big] \\
-                             \;   &- \; h2_1 \; \log  \big[ \cosh ((k - h2_{th}) / h2_{cr}) \big]
-    \end{split}
-\end{gather}
-\begin{gather}
-    \begin{split}
-    e_3^0(k) = \big|    - h_0    &-   h_1 \; \tanh \big[       (k - h_{th})  / h_{cr}   \big]  \\
-                                 &-  h2_1 \; \tanh \big[       (k - h2_{th}) / h2_{cr}  \big] \big|
-    \end{split}
-\end{gather}
-
-If the ice shelf cavities are opened (\np{ln\_isfcav}\forcode{ = .true.}), the definition
-of $z_0$ is the same.  However, definition of $e_3^0$ at $t$- and $w$-points is
-respectively changed to:
-\begin{equation}
-  \label{eq:DOMCFG_zgr_ana_2}
-  \begin{split}
-    e_3^T(k) &= z_W (k + 1) - z_W (k    ) \\
-    e_3^W(k) &= z_T (k    ) - z_T (k - 1)
-  \end{split}
-\end{equation}
-
-This formulation decreases the self-generated circulation into the ice shelf cavity
-(which can, in extreme case, leads to numerical instability). This is now the recommended formulation for all configurations using v4.0 onwards. The analytical derivation of thicknesses is maintained for backwards compatibility.
-
-The most used vertical grid for ORCA2 has $10~m$ ($500~m$) resolution in the surface
-(bottom) layers and a depth which varies from 0 at the sea surface to a minimum of
-$-5000~m$.  This leads to the following conditions:
-
-\begin{equation}
-  \label{eq:DOMCFG_zgr_coef}
-  \begin{array}{ll}
-    e_3 (1   + 1/2) =  10. & z(1  ) =     0. \\
-    e_3 (jpk - 1/2) = 500. & z(jpk) = -5000.
-  \end{array}
-\end{equation}
-
-With the choice of the stretching $h_{cr} = 3$ and the number of levels \jp{jpk}~$= 31$,
-the four coefficients $h_{sur}$, $h_0$, $h_1$, and $h_{th}$ in
-\autoref{eq:DOMCFG_zgr_ana_2} have been determined such that \autoref{eq:DOMCFG_zgr_coef}
-is satisfied, through an optimisation procedure using a bisection method.
-For the first standard ORCA2 vertical grid this led to the following values:
-$h_{sur} = 4762.96$, $h_0 = 255.58, h_1 = 245.5813$, and $h_{th} = 21.43336$.
-The resulting depths and scale factors as a function of the model levels are shown in
-\autoref{fig:DOMCFG_zgr} and given in \autoref{tab:DOMCFG_orca_zgr}.
-Those values correspond to the parameters \np{ppsur}, \np{ppa0}, \np{ppa1}, \np{ppkth} in \nam{cfg} namelist.
-
-Rather than entering parameters $h_{sur}$, $h_0$, and $h_1$ directly, it is possible to
-recalculate them.  In that case the user sets \np{ppsur}~$=$~\np{ppa0}~$=$~\np{ppa1}~$=
-999999$., in \nam{cfg} namelist, and specifies instead the four following parameters:
-\begin{itemize}
-\item
-  \np{ppacr}~$= h_{cr}$: stretching factor (nondimensional).
-  The larger \np{ppacr}, the smaller the stretching.
-  Values from $3$ to $10$ are usual.
-\item
-  \np{ppkth}~$= h_{th}$: is approximately the model level at which maximum stretching occurs
-  (nondimensional, usually of order 1/2 or 2/3 of \jp{jpk})
-\item
-  \np{ppdzmin}: minimum thickness for the top layer (in meters).
-\item
-  \np{pphmax}: total depth of the ocean (meters).
-\end{itemize}
-
-As an example, for the $45$ layers used in the DRAKKAR configuration those parameters are:
-\jp{jpk}~$= 46$, \np{ppacr}~$= 9$, \np{ppkth}~$= 23.563$, \np{ppdzmin}~$= 6~m$,
-\np{pphmax}~$= 5750~m$.
-
-%% %>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-\begin{table}
-  \begin{center}
-    \begin{tabular}{c||r|r|r|r}
-      \hline
-      \textbf{LEVEL} & \textbf{gdept\_1d} & \textbf{gdepw\_1d} & \textbf{e3t\_1d } & \textbf{e3w\_1d} \\
-   \hline
-      1              & \textbf{     5.00} &               0.00 & \textbf{   10.00} &            10.00 \\
-      \hline
-      2              & \textbf{    15.00} &	            10.00 & \textbf{   10.00} &            10.00 \\
-      \hline
-      3              & \textbf{    25.00} &              20.00 & \textbf{   10.00} &            10.00 \\
-      \hline
-      4              & \textbf{    35.01} &	            30.00 & \textbf{   10.01} &            10.00 \\
-      \hline
-      5              & \textbf{    45.01} &              40.01 & \textbf{   10.01} &            10.01 \\
-      \hline
-      6              & \textbf{    55.03} &              50.02 & \textbf{   10.02} &            10.02 \\
-      \hline
-      7              & \textbf{    65.06} &              60.04 & \textbf{   10.04} &            10.03 \\
-      \hline
-      8              & \textbf{    75.13} &              70.09 & \textbf{   10.09} &            10.06 \\
-      \hline
-      9              & \textbf{    85.25} &              80.18 & \textbf{   10.17} &            10.12 \\
-      \hline
-      10             & \textbf{    95.49} &              90.35 & \textbf{   10.33} &            10.24 \\
-      \hline
-      11             & \textbf{   105.97} &             100.69 & \textbf{   10.65} &            10.47 \\
-      \hline
-      12             & \textbf{   116.90} &             111.36 & \textbf{   11.27} &            10.91 \\
-      \hline
-      13             & \textbf{   128.70} &             122.65 & \textbf{   12.47} &            11.77 \\
-      \hline
-      14             & \textbf{   142.20} &             135.16 & \textbf{   14.78} &            13.43 \\
-      \hline
-      15             & \textbf{   158.96} &             150.03 & \textbf{   19.23} &            16.65 \\
-      \hline
-      16             & \textbf{   181.96} &             169.42 & \textbf{   27.66} &            22.78 \\
-      \hline
-      17             & \textbf{   216.65} &             197.37 & \textbf{   43.26} &            34.30 \\
-      \hline
-      18             & \textbf{   272.48} &             241.13 & \textbf{   70.88} &            55.21 \\
-      \hline
-      19             & \textbf{   364.30} &             312.74 & \textbf{  116.11} &            90.99 \\
-      \hline
-      20             & \textbf{   511.53} &             429.72 & \textbf{  181.55} &           146.43 \\
-      \hline
-      21             & \textbf{   732.20} &             611.89 & \textbf{  261.03} &           220.35 \\
-      \hline
-      22             & \textbf{  1033.22} &             872.87 & \textbf{  339.39} &           301.42 \\
-      \hline
-      23             & \textbf{  1405.70} &            1211.59 & \textbf{  402.26} &           373.31 \\
-      \hline
-      24             & \textbf{  1830.89} &            1612.98 & \textbf{  444.87} &           426.00 \\
-      \hline
-      25             & \textbf{  2289.77} &            2057.13 & \textbf{  470.55} &           459.47 \\
-      \hline
-      26             & \textbf{  2768.24} &            2527.22 & \textbf{  484.95} &           478.83 \\
-      \hline
-      27             & \textbf{  3257.48} &            3011.90 & \textbf{  492.70} &           489.44 \\
-      \hline
-      28             & \textbf{  3752.44} &            3504.46 & \textbf{  496.78} &           495.07 \\
-      \hline
-      29             & \textbf{  4250.40} &            4001.16 & \textbf{  498.90} &           498.02 \\
-      \hline
-      30             & \textbf{  4749.91} &            4500.02 & \textbf{  500.00} &           499.54 \\
-      \hline
-      31             & \textbf{  5250.23} &            5000.00 & \textbf{  500.56} &           500.33 \\
-      \hline
-    \end{tabular}
-  \end{center}
-  \caption{
-    \protect\label{tab:DOMCFG_orca_zgr}
-    Default vertical mesh in $z$-coordinate for 30 layers ORCA2 configuration as computed from
-    \autoref{eq:DOMCFG_zgr_ana_2} using the coefficients given in \autoref{eq:DOMCFG_zgr_coef}
-  }
-\end{table}
-%%%YY
-%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-%% % -------------------------------------------------------------------------------------------------------------
-%% %        Meter Bathymetry
-%% % -------------------------------------------------------------------------------------------------------------
-\subsection{Model bathymetry}
-\label{subsec:DOMCFG_bathy}
-
-Three options are possible for defining the bathymetry, according to the namelist variable
-\np{nn\_bathy} (found in \nam{dom} namelist (\texttt{DOMAINCFG} variant) ):
-\begin{description}
-\item[\np{nn\_bathy}\forcode{ = 0}]:
-  a flat-bottom domain is defined.
-  The total depth $z_w (jpk)$ is given by the coordinate transformation.
-  The domain can either be a closed basin or a periodic channel depending on the parameter \np{jperio}.
-\item[\np{nn\_bathy}\forcode{ = -1}]:
-  a domain with a bump of topography one third of the domain width at the central latitude.
-  This is meant for the "EEL-R5" configuration, a periodic or open boundary channel with a seamount.
-\item[\np{nn\_bathy}\forcode{ = 1}]:
-  read a bathymetry and ice shelf draft (if needed).
-  The \ifile{bathy\_meter} file (Netcdf format) provides the ocean depth (positive, in meters) at
-  each grid point of the model grid.
-  The bathymetry is usually built by interpolating a standard bathymetry product (\eg\ ETOPO2) onto
-  the horizontal ocean mesh.
-  Defining the bathymetry also defines the coastline: where the bathymetry is zero,
-  no wet levels are defined (all levels are masked).
-
-  The \ifile{isfdraft\_meter} file (Netcdf format) provides the ice shelf draft (positive, in meters) at
-  each grid point of the model grid.
-  This file is only needed if \np{ln\_isfcav}\forcode{ = .true.}.
-  Defining the ice shelf draft will also define the ice shelf edge and the grounding line position.
-\end{description}
-
-\subsection{Choice of vertical grid}
-\label{sec:DOMCFG_vgrd}
-
-After reading the bathymetry, the algorithm for vertical grid definition differs between the different options:
-\begin{description}
-\item[\forcode{ln_zco = .true.}]
-  set a reference coordinate transformation $z_0(k)$, and set $z(i,j,k,t) = z_0(k)$ where $z_0(k)$ is the closest match to the depth at $(i,j)$.
-\item[\forcode{ln_zps = .true.}]
-  set a reference coordinate transformation $z_0(k)$, and calculate the thickness of the deepest level at
-  each $(i,j)$ point using the bathymetry, to obtain the final three-dimensional depth and scale factor arrays.
-\item[\forcode{ln_sco = .true.}]
-  smooth the bathymetry to fulfill the hydrostatic consistency criteria and
-  set the three-dimensional transformation.
-\item[\forcode{s-z and s-zps}]
-  smooth the bathymetry to fulfill the hydrostatic consistency criteria and
-  set the three-dimensional transformation $z(i,j,k)$,
-  and possibly introduce masking of extra land points to better fit the original bathymetry file.
-\end{description}
-%%%
-
-% -------------------------------------------------------------------------------------------------------------
-%        z-coordinate with constant thickness
-% -------------------------------------------------------------------------------------------------------------
-\subsubsection[$Z$-coordinate with uniform thickness levels (\forcode{ln_zco = .true.})]
-{$Z$-coordinate with uniform thickness levels (\protect\np{ln\_zco}\forcode{ = .true.})}
-\label{subsec:DOMCFG_zco}
-
-With this option the model topography can be fully described by the reference vertical
-coordinate and a 2D integer field giving the number of wet levels at each location
-(\forcode{bathy_level}). The resulting match to the real topography is likely to be poor
-though (especially with thick, deep levels) and slopes poorly represented. This option is
-rarely used in modern simulations but it can be useful for testing purposes.
-
-% -------------------------------------------------------------------------------------------------------------
-%        z-coordinate with partial step
-% -------------------------------------------------------------------------------------------------------------
-\subsubsection[$Z$-coordinate with partial step (\forcode{ln_zps = .true.})]
-{$Z$-coordinate with partial step (\protect\np{ln\_zps}\forcode{ = .true.})}
-\label{subsec:DOMCFG_zps}
-
-In $z$-coordinate partial step, the depths of the model levels are defined by the
-reference analytical function $z_0(k)$ as described in \autoref{sec:DOMCFG_zref},
-\textit{except} in the bottom layer.  The thickness of the bottom layer is allowed to vary
-as a function of geographical location $(\lambda,\varphi)$ to allow a better
-representation of the bathymetry, especially in the case of small slopes (where the
-bathymetry varies by less than one level thickness from one grid point to the next).  The
-reference layer thicknesses $e_{3t}^0$ have been defined in the absence of bathymetry.
-With partial steps, layers from 1 to \jp{jpk}-2 can have a thickness smaller than
-$e_{3t}(jk)$.
-
-The model deepest layer (\jp{jpk}-1) is allowed to have either a smaller or larger
-thickness than $e_{3t}(jpk)$: the maximum thickness allowed is $2*e_{3t}(jpk - 1)$.
-
-This has to be kept in mind when specifying values in \nam{dom} namelist
-(\texttt{DOMAINCFG} variant), such as the maximum depth \np{pphmax} in partial steps.
-
-For example, with \np{pphmax}~$= 5750~m$ for the DRAKKAR 45 layer grid, the maximum ocean
-depth allowed is actually $6000~m$ (the default thickness $e_{3t}(jpk - 1)$ being
-$250~m$).  Two variables in the namdom namelist are used to define the partial step
-vertical grid.  The mimimum water thickness (in meters) allowed for a cell partially
-filled with bathymetry at level jk is the minimum of \np{rn\_e3zps\_min} (thickness in
-meters, usually $20~m$) or $e_{3t}(jk)*$\np{rn\_e3zps\_rat} (a fraction, usually 10\%, of
-the default thickness $e_{3t}(jk)$).
-
-% -------------------------------------------------------------------------------------------------------------
-%        s-coordinate
-% -------------------------------------------------------------------------------------------------------------
-\subsubsection[$S$-coordinate (\forcode{ln_sco = .true.})]
-{$S$-coordinate (\protect\np{ln\_sco}\forcode{ = .true.})}
-\label{sec:DOMCFG_sco}
-%------------------------------------------nam_zgr_sco---------------------------------------------------
-%
-\nlst{namzgr_sco_domcfg}
-%--------------------------------------------------------------------------------------------------------------
-Options are defined in \nam{zgr\_sco} (\texttt{DOMAINcfg} only).
-In $s$-coordinate (\np{ln\_sco}\forcode{ = .true.}), the depth and thickness of the model levels are defined from
-the product of a depth field and either a stretching function or its derivative, respectively:
-
-\begin{align*}
-  % \label{eq:DOMCFG_sco_ana}
-  z(k)   &= h(i,j) \; z_0 (k) \\
-  e_3(k) &= h(i,j) \; z_0'(k)
-\end{align*}
-
-where $h$ is the depth of the last $w$-level ($z_0(k)$) defined at the $t$-point location in the horizontal and
-$z_0(k)$ is a function which varies from $0$ at the sea surface to $1$ at the ocean bottom.
-The depth field $h$ is not necessary the ocean depth,
-since a mixed step-like and bottom-following representation of the topography can be used
-(\autoref{fig:z_zps_s_sps}) or an envelop bathymetry can be defined (\autoref{fig:z_zps_s_sps}).
-The namelist parameter \np{rn\_rmax} determines the slope at which
-the terrain-following coordinate intersects the sea bed and becomes a pseudo z-coordinate.
-The coordinate can also be hybridised by specifying \np{rn\_sbot\_min} and \np{rn\_sbot\_max} as
-the minimum and maximum depths at which the terrain-following vertical coordinate is calculated.
-
-Options for stretching the coordinate are provided as examples,
-but care must be taken to ensure that the vertical stretch used is appropriate for the application.
-
-The original default \NEMO\ s-coordinate stretching is available if neither of the other options are specified as true
-(\np{ln\_s\_SH94}\forcode{ = .false.} and \np{ln\_s\_SF12}\forcode{ = .false.}).
-This uses a depth independent $\tanh$ function for the stretching \citep{madec.delecluse.ea_JPO96}:
-
-\[
-  z = s_{min} + C (s) (H - s_{min})
-  % \label{eq:SH94_1}
-\]
-
-where $s_{min}$ is the depth at which the $s$-coordinate stretching starts and
-allows a $z$-coordinate to placed on top of the stretched coordinate,
-and $z$ is the depth (negative down from the asea surface).
-\begin{gather*}
-  s = - \frac{k}{n - 1} \quad \text{and} \quad 0 \leq k \leq n - 1
-  % \label{eq:DOMCFG_s}
- \\
- \label{eq:DOMCFG_sco_function}
-  C(s) = \frac{[\tanh(\theta \, (s + b)) - \tanh(\theta \, b)]}{2 \; \sinh(\theta)}
-\end{gather*}
-
-A stretching function,
-modified from the commonly used \citet{song.haidvogel_JCP94} stretching (\np{ln\_s\_SH94}\forcode{ = .true.}),
-is also available and is more commonly used for shelf seas modelling:
-
-\[
-  C(s) =   (1 - b) \frac{\sinh(\theta s)}{\sinh(\theta)}
-         + b       \frac{\tanh \lt[ \theta \lt(s + \frac{1}{2} \rt) \rt] -   \tanh \lt( \frac{\theta}{2} \rt)}
-                        {                                                  2 \tanh \lt( \frac{\theta}{2} \rt)}
- \label{eq:SH94_2}
-\]
-
-%% %>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-\begin{figure}[!ht]
-  \begin{center}
-    \includegraphics[width=\textwidth]{Fig_sco_function}
-    \caption{
-      \protect\label{fig:sco_function}
-      Examples of the stretching function applied to a seamount;
-      from left to right: surface, surface and bottom, and bottom intensified resolutions
-    }
-  \end{center}
-\end{figure}
-%% %>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-where $H_c$ is the critical depth (\np{rn\_hc}) at which the coordinate transitions from pure $\sigma$ to
-the stretched coordinate, and $\theta$ (\np{rn\_theta}) and $b$ (\np{rn\_bb}) are the surface and
-bottom control parameters such that $0 \leqslant \theta \leqslant 20$, and $0 \leqslant b \leqslant 1$.
-$b$ has been designed to allow surface and/or bottom increase of the vertical resolution
-(\autoref{fig:sco_function}).
-
-Another example has been provided at version 3.5 (\np{ln\_s\_SF12}) that allows a fixed surface resolution in
-an analytical terrain-following stretching \citet{siddorn.furner_OM13}.
-In this case the a stretching function $\gamma$ is defined such that:
-
-\begin{equation}
-  z = - \gamma h \quad \text{with} \quad 0 \leq \gamma \leq 1
-  % \label{eq:z}
-\end{equation}
-
-The function is defined with respect to $\sigma$, the unstretched terrain-following coordinate:
-
-\begin{gather*}
-  % \label{eq:DOMCFG_gamma_deriv}
-  \gamma =   A \lt( \sigma   - \frac{1}{2} (\sigma^2     + f (\sigma)) \rt)
-           + B \lt( \sigma^3 - f           (\sigma) \rt) + f (\sigma)       \\
-  \intertext{Where:}
- \label{eq:DOMCFG_gamma}
-  f(\sigma) = (\alpha + 2) \sigma^{\alpha + 1} - (\alpha + 1) \sigma^{\alpha + 2}
-  \quad \text{and} \quad \sigma = \frac{k}{n - 1}
-\end{gather*}
-
-This gives an analytical stretching of $\sigma$ that is solvable in $A$ and $B$ as a function of
-the user prescribed stretching parameter $\alpha$ (\np{rn\_alpha}) that stretches towards
-the surface ($\alpha > 1.0$) or the bottom ($\alpha < 1.0$) and
-user prescribed surface (\np{rn\_zs}) and bottom depths.
-The bottom cell depth in this example is given as a function of water depth:
-
-\[
-  % \label{eq:DOMCFG_zb}
-  Z_b = h a + b
-\]
-
-where the namelist parameters \np{rn\_zb\_a} and \np{rn\_zb\_b} are $a$ and $b$ respectively.
-
-%% %>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-\begin{figure}[!ht]
-  \includegraphics[width=\textwidth]{Fig_DOM_compare_coordinates_surface}
-  \caption{
-    A comparison of the \citet{song.haidvogel_JCP94} $S$-coordinate (solid lines),
-    a 50 level $Z$-coordinate (contoured surfaces) and
-    the \citet{siddorn.furner_OM13} $S$-coordinate (dashed lines) in the surface $100~m$ for
-    a idealised bathymetry that goes from $50~m$ to $5500~m$ depth.
-    For clarity every third coordinate surface is shown.
-  }
-  \label{fig:fig_compare_coordinates_surface}
-\end{figure}
- % >>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-This gives a smooth analytical stretching in computational space that is constrained to
-given specified surface and bottom grid cell thicknesses in real space.
-This is not to be confused with the hybrid schemes that
-superimpose geopotential coordinates on terrain following coordinates thus
-creating a non-analytical vertical coordinate that
-therefore may suffer from large gradients in the vertical resolutions.
-This stretching is less straightforward to implement than the \citet{song.haidvogel_JCP94} stretching,
-but has the advantage of resolving diurnal processes in deep water and has generally flatter slopes.
-
-As with the \citet{song.haidvogel_JCP94} stretching the stretch is only applied at depths greater than
-the critical depth $h_c$.
-In this example two options are available in depths shallower than $h_c$,
-with pure sigma being applied if the \np{ln\_sigcrit} is true and pure z-coordinates if it is false
-(the z-coordinate being equal to the depths of the stretched coordinate at $h_c$).
-
-Minimising the horizontal slope of the vertical coordinate is important in terrain-following systems as
-large slopes lead to hydrostatic consistency.
-A hydrostatic consistency parameter diagnostic following \citet{haney_JPO91} has been implemented,
-and is output as part of the model mesh file at the start of the run.
-
-% -------------------------------------------------------------------------------------------------------------
-%        z*- or s*-coordinate
-% -------------------------------------------------------------------------------------------------------------
-\subsubsection[\zstar- or \sstar-coordinate (\forcode{ln_linssh = .false.})]
-{\zstar- or \sstar-coordinate (\protect\np{ln\_linssh}\forcode{ = .false.})}
-\label{subsec:DOMCFG_zgr_star}
-
-This option is described in the Report by Levier \textit{et al.} (2007), available on the \NEMO\ web site.
-
-\biblio
-
-\pindex
-
-\end{document}
Index: MO/trunk/doc/latex/NEMO/subfiles/annex_E.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/subfiles/annex_E.tex	(revision 11542)
+++ 	(revision )
@@ -1,848 +1,0 @@
-\documentclass[../main/NEMO_manual]{subfiles}
-
-\begin{document}
-% ================================================================
-% Appendix E : Note on some algorithms
-% ================================================================
-\chapter{Note on some algorithms}
-\label{apdx:E}
-
-\chaptertoc
-
-\newpage
-
-This appendix some on going consideration on algorithms used or planned to be used in \NEMO. 
-
-% -------------------------------------------------------------------------------------------------------------
-%        UBS scheme  
-% -------------------------------------------------------------------------------------------------------------
-\section{Upstream Biased Scheme (UBS) (\protect\np{ln\_traadv\_ubs}\forcode{ = .true.})}
-\label{sec:TRA_adv_ubs}
-
-The UBS advection scheme is an upstream biased third order scheme based on
-an upstream-biased parabolic interpolation.
-It is also known as Cell Averaged QUICK scheme (Quadratic Upstream Interpolation for Convective Kinematics).
-For example, in the $i$-direction:
-\begin{equation}
-  \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.
-\end{equation}
-or equivalently, the advective flux is
-\begin{equation}
-  \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]
-\end{equation}
-where $U_{i+1/2} = e_{1u}\,e_{3u}\,u_{i+1/2}$ and
-$\tau "_i =\delta_i \left[ {\delta_{i+1/2} \left[ \tau \right]} \right]$.
-By choosing this expression for $\tau "$ we consider a fourth order approximation of $\partial_i^2$ with
-a constant i-grid spacing ($\Delta i=1$).
-
-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 (\ie\ hyper-diffusive) truncation error
-\citep{shchepetkin.mcwilliams_OM05}.
-The overall performance of the advection scheme is similar to that reported in \cite{farrow.stevens_JPO95}.
-It is a relatively good compromise between accuracy and smoothness.
-It is not a \emph{positive} scheme meaning false extrema are permitted but
-the amplitude of such are significantly reduced over the centred second order method.
-Nevertheless it is not recommended to apply it to a passive tracer that requires positivity. 
-
-The intrinsic diffusion of UBS makes its use risky in the vertical direction where
-the control of artificial diapycnal fluxes is of paramount importance.
-It has therefore been preferred to evaluate the vertical flux using the TVD scheme when
-\np{ln\_traadv\_ubs}\forcode{ = .true.}.
-
-For stability reasons, in \autoref{eq:tra_adv_ubs}, the first term which corresponds to
-a second order centred scheme is evaluated using the \textit{now} velocity (centred in time) while
-the second term which is the diffusive part of the scheme, is evaluated using the \textit{before} velocity
-(forward in time).
-This is discussed by \citet{webb.de-cuevas.ea_JAOT98} in the context of the Quick advection scheme.
-UBS and QUICK schemes only differ by one coefficient.
-Substituting 1/6 with 1/8 in (\autoref{eq:tra_adv_ubs}) leads to the QUICK advection scheme \citep{webb.de-cuevas.ea_JAOT98}.
-This option is not available through a namelist parameter, since the 1/6 coefficient is hard coded.
-Nevertheless it is quite easy to make the substitution in \mdl{traadv\_ubs} module and obtain a QUICK scheme.
-
-NB 1: When a high vertical resolution $O(1m)$ is used, the model stability can be controlled by vertical advection
-(not vertical diffusion which is usually solved using an implicit scheme).
-Computer time can be saved by using a time-splitting technique on vertical advection.
-This possibility have been implemented and validated in ORCA05-L301.
-It is not currently offered in the current reference version. 
-
-NB 2: In a forthcoming release four options will be proposed for the vertical component used in the UBS scheme.
-$\tau_w^{ubs}$ will be evaluated using either \textit{(a)} a centered $2^{nd}$ order scheme,
-or \textit{(b)} a TVD scheme, or \textit{(c)} an interpolation based on conservative parabolic splines following
-\citet{shchepetkin.mcwilliams_OM05} implementation of UBS in ROMS, or \textit{(d)} an UBS.
-The $3^{rd}$ case has dispersion properties similar to an eight-order accurate conventional scheme.
-
-NB 3: It is straight forward to rewrite \autoref{eq:tra_adv_ubs} as follows:
-\begin{equation}
-  \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.
-\end{equation}
-or equivalently 
-\begin{equation}
-  \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}
-\end{equation}
-\autoref{eq:tra_adv_ubs2} has several advantages.
-First it clearly evidences that the UBS scheme is based on the fourth order scheme to which
-is added an upstream biased diffusive term.
-Second, this emphasises that the $4^{th}$ order part have to be evaluated at \emph{now} time step,
-not only the $2^{th}$ order part as stated above using \autoref{eq:tra_adv_ubs}.
-Third, the diffusive term is in fact a biharmonic operator with a eddy coefficient which
-is simply proportional to the velocity.
-
-laplacian diffusion:
-\begin{equation}
-  \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}
-\end{equation}
-
-bilaplacian:
-\begin{equation}
-  \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}
-\end{equation}
-with ${A_u^{lT}}^2 = \frac{1}{12} {e_{1u}}^3\ |u|$, 
-\ie\ $A_u^{lT} = \frac{1}{\sqrt{12}} \,e_{1u}\ \sqrt{ e_{1u}\,|u|\,}$
-it comes:
-\begin{equation}
-  \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}
-\end{equation}
-if the velocity is uniform (\ie\ $|u|=cst$) then the diffusive flux is
-\begin{equation}
-  \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}
-\end{equation}
-beurk....  reverte the logic: starting from the diffusive part of the advective flux it comes:
-
-\begin{equation}
-  \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}
-\end{equation}
-if the velocity is uniform (\ie\ $|u|=cst$) and
-choosing $\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]$
-
-sol 1 coefficient at T-point ( add $e_{1u}$ and $e_{1T}$ on both side of first $\delta$):
-\begin{equation}
-  \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}
-\end{equation}
-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}}$
-\begin{equation}
-  \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}
-\end{equation}
-which leads to ${A_u^{lT}} = \frac{1}{12} {e_{1u}}^3\ |u|$
-
-% -------------------------------------------------------------------------------------------------------------
-%        Leap-Frog energetic  
-% -------------------------------------------------------------------------------------------------------------
-\section{Leapfrog energetic}
-\label{sec:LF}
-
-We adopt the following semi-discrete notation for time derivative.
-Given the values of a variable $q$ at successive time step,
-the time derivation and averaging operators at the mid time step are:
-\[
-  % \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
-$\overline{\cdot}^{\,t\,*}= \overline{\cdot}^{\,t+\Delta/2}$, respectively.
-
-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}
-\] 
-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, \ie\ 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) ,
-\]
-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}
-\]
-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!!!}
-
-% ================================================================
-% Iso-neutral diffusion : 
-% ================================================================
-
-\section{Lateral diffusion operator}
-
-% ================================================================
-% Griffies' iso-neutral diffusion operator : 
-% ================================================================
-\subsection{Griffies iso-neutral diffusion operator}
-
-Let try to define a scheme that get its inspiration from the \citet{griffies.gnanadesikan.ea_JPO98} scheme,
-but is formulated within the \NEMO\ framework
-(\ie\ using scale factors rather than grid-size and having a position of $T$-points that
-is not necessary in the middle of vertical velocity points, see \autoref{fig:zgr_e3}).
-
-In the formulation \autoref{eq:tra_ldf_iso} introduced in 1995 in OPA, the ancestor of \NEMO,
-the off-diagonal terms of the small angle diffusion tensor contain several double spatial averages of a gradient,
-for example $\overline{\overline{\delta_k \cdot}}^{\,i,k}$.
-It is apparent that the combination of a $k$ average and a $k$ derivative of the tracer allows for
-the presence of grid point oscillation structures that will be invisible to the operator.
-These structures are \textit{computational modes}.
-They will not be damped by the iso-neutral operator, and even possibly amplified by it.
-In other word, the operator applied to a tracer does not warranties the decrease of its global average variance.
-To circumvent this, we have introduced a smoothing of the slopes of the iso-neutral surfaces
-(see \autoref{chap:LDF}).
-Nevertheless, this technique works fine for $T$ and $S$ as they are active tracers
-(\ie\ they enter the computation of density), but it does not work for a passive tracer.
-\citep{griffies.gnanadesikan.ea_JPO98} introduce a different way to discretise the off-diagonal terms that
-nicely solve the problem.
-The idea is to get rid of combinations of an averaged in one direction combined with
-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:
-\begin{equation}
-  \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)
-\end{equation}
-where the indices $i_p$ and $k_p$ define the four triads and take the following value:
-$i_p = -1/2$ or $1/2$ and $k_p = -1/2$ or $1/2$,
-$b_u= e_{1u}\,e_{2u}\,e_{3u}$ is the volume of $u$-cells,
-$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:
-\begin{equation}
-  \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 ] }
-\end{equation}
-Note that in \autoref{eq:Gf_slopes} we use the ratio $\alpha / \beta$ instead of
-multiplying the temperature derivative by $\alpha$ and the salinity derivative by $\beta$.
-This is more efficient as the ratio $\alpha / \beta$ can to be evaluated directly.
-
-Note that in \autoref{eq:Gf_triads}, we chose to use ${b_u}_{\,i+i_p}^{\,k}$ instead of ${b_{uw}}_{\,i+i_p}^{\,k+k_p}$.
-This choice has been motivated by the decrease of tracer variance and
-the presence of partial cell at the ocean bottom (see \autoref{apdx:Gf_operator}).
-
-%>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-\begin{figure}[!ht]
-  \begin{center}
-    \includegraphics[width=\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*}
-
-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}
-\end{flalign}
-resulting in a iso-neutral diffusion tendency on temperature given by
-the divergence of the sum of all the four triad fluxes:
-\begin{equation}
-  \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\}
-\end{equation}
-where $b_T= e_{1T}\,e_{2T}\,e_{3T}$ is the volume of $T$-cells. 
-
-This expression of the iso-neutral diffusion has been chosen in order to satisfy the following six properties:
-\begin{description}
-\item[$\bullet$ horizontal diffusion]
-  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
-  \]
-
-\item[$\bullet$ implicit treatment in the vertical]
-  In the diagonal term associated with the vertical divergence of the iso-neutral fluxes
-  \ie\ the term associated with a second order vertical derivative)
-  appears only tracer values associated with a single water column.
-  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\{
-		A_i^k \; \left(_i^k \mathbb{R}_{i_p}^{k_p}\right)^2
-    \right\}
-  \]
-  can be quite large.
-
-\item[$\bullet$ pure iso-neutral operator]
-  The iso-neutral flux of locally referenced potential density is zero, \ie
-  \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, \ie
-  \[
-    % \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, \ie
-  \[
-    % \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.
-It means that the operator is also a dissipation term,
-\ie\ it is a sink term for the square of the quantity on which it is applied.
-It therfore ensures that, when the diffusivity coefficient is large enough,
-the field on which it is applied become free of grid-point noise.
-
-\item[$\bullet$ self-adjoint operator]
-  The iso-neutral diffusion operator is self-adjoint, \ie
-  \[
-    % \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.
-This properties can be demonstrated quite easily in a similar way the "non increase of tracer variance" property
-has been proved (see \autoref{apdx:Gf_operator}).
-\end{description}
-
-% ================================================================
-% Skew flux formulation for Eddy Induced Velocity : 
-% ================================================================
-\subsection{Eddy induced velocity and skew flux formulation}
-
-When Gent and McWilliams [1990] diffusion is used (\key{traldf\_eiv} defined),
-an additional advection term is added.
-The associated velocity is the so called eddy induced velocity,
-the formulation of which depends on the slopes of iso-neutral surfaces.
-Contrary to the case of iso-neutral mixing, the slopes used here are referenced to the geopotential surfaces,
-\ie\ \autoref{eq:ldfslp_geo} is used in $z$-coordinate,
-and the sum \autoref{eq:ldfslp_geo} + \autoref{eq:ldfslp_iso} in $z^*$ or $s$-coordinates. 
-
-The eddy induced velocity is given by: 
-\begin{equation}
-  \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}
-\end{equation}
-where $A_{e}$ is the eddy induced velocity coefficient,
-and $r_i$ and $r_j$ the slopes between the iso-neutral and the geopotential surfaces.
-%%gm wrong: to be modified with 2 2D streamfunctions
-In other words, the eddy induced velocity can be derived from a vector streamfuntion, $\phi$,
-which is given by $\phi = A_e\,\textbf{r}$ as $\textbf{U}^*  = \textbf{k} \times \nabla \phi$.
-%%end gm
-
-A traditional way to implement this additional advection is to add it to the eulerian velocity prior to
-compute the tracer advection.
-This allows us to take advantage of all the advection schemes offered for the tracers
-(see \autoref{sec:TRA_adv}) and not just a $2^{nd}$ order advection scheme.
-This is particularly useful for passive tracers where
-\emph{positivity} of the advection scheme is of paramount importance. 
-% give here the expression using the triads. It is different from the one given in \autoref{eq:ldfeiv}
-% see just below a copy of this equation:
-%\begin{equation} \label{eq:ldfeiv}
-%\begin{split}
-% u^* & = \frac{1}{e_{2u}e_{3u}}\; \delta_k \left[e_{2u} \, A_{uw}^{eiv} \; \overline{r_{1w}}^{\,i+1/2} \right]\\
-% v^* & = \frac{1}{e_{1u}e_{3v}}\; \delta_k \left[e_{1v} \, A_{vw}^{eiv} \; \overline{r_{2w}}^{\,j+1/2} \right]\\
-%w^* & = \frac{1}{e_{1w}e_{2w}}\; \left\{ \delta_i \left[e_{2u} \, A_{uw}^{eiv} \; \overline{r_{1w}}^{\,i+1/2} \right] + %\delta_j \left[e_{1v} \, A_{vw}^{eiv} \; \overline{r_{2w}}^{\,j+1/2} \right] \right\} \\
-%\end{split}
-%\end{equation}
-\[
-  % \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.
-It is based on a transformation of the advective fluxes using the non-divergent nature of the eddy induced velocity.
-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}
-\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:
-\begin{equation}
-  \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}
-\end{equation}
-The tendency associated with eddy induced velocity is then simply the divergence of
-the \autoref{eq:eiv_skew_continuous} fluxes.
-It naturally conserves the tracer content, as it is expressed in flux form and,
-as the advective form, it preserves the tracer variance.
-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*}
-The horizontal component reduces to the one use for an horizontal laplacian operator and
-the vertical one keeps the same complexity, but not more.
-This property has been used to reduce the computational time \citep{griffies_JPO98},
-but it is not of practical use as usually $A \neq A_e$.
-Nevertheless this property can be used to choose a discret form of \autoref{eq:eiv_skew_continuous} which
-is consistent with the iso-neutral operator \autoref{eq:Gf_operator}.
-Using the slopes \autoref{eq:Gf_slopes} and defining $A_e$ at $T$-point(\ie\ as $A$,
-the eddy diffusivity coefficient), the resulting discret form is given by:
-\begin{equation}
-  \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)
-\end{equation}
-Note that \autoref{eq:eiv_skew} is valid in $z$-coordinate with or without partial cells. 
-In $z^*$ or $s$-coordinate, the slope between the level and the geopotential surfaces must be added to
-$\mathbb{R}$ for the discret form to be exact. 
-
-Such a choice of discretisation is consistent with the iso-neutral operator as
-it uses the same definition for the slopes.
-It also ensures the conservation of the tracer variance (see Appendix \autoref{apdx:eiv_skew}),
-\ie\ it does not include a diffusive component but is a "pure" advection term.
-
-$\ $\newpage      %force an empty line
-% ================================================================
-% Discrete Invariants of the iso-neutral diffrusion 
-% ================================================================
-\subsection{Discrete invariants of the iso-neutral diffrusion}
-\label{subsec:Gf_operator}
-
-Demonstration of the decrease of the tracer variance in the (\textbf{i},\textbf{j}) plane. 
-
-This part will be moved in an Appendix.
-
-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 \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
-  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
-\end{align*} 
-The last inequality is obviously obtained as we succeed in obtaining a negative summation of square quantities.
-
-Note that, if instead of multiplying $D_l^T$ by $T$, we were using another tracer field, let say $S$,
-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\}
-\end{align*} 
-This means that the iso-neutral operator is self-adjoint.
-There is no need to develop a specific to obtain it.
-
-\newpage
-
-% ================================================================
-% Discrete Invariants of the skew flux formulation
-% ================================================================
-\subsection{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. 
-
-This have to be moved in an Appendix.
-
-The continuous property to be demonstrated is:
-\begin{align*}
-  \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\}
-\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\}
-\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\ \ \ \:}
-    &\ {\ \ \;_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}   
-\end{align*}
-The two terms associated with the triad ${_i^k \mathbb{R}_{+1/2}^{+1/2}}$ are the same but of opposite signs,
-they cancel out. 
-Exactly the same thing occurs for the triad ${_i^k \mathbb{R}_{-1/2}^{-1/2}}$.
-The two terms associated with the triad ${_i^k \mathbb{R}_{+1/2}^{-1/2}}$ are the same but both of opposite signs and
-shifted by 1 in $k$ direction.
-When summing over $k$ they cancel out with the neighbouring grid points.
-Exactly the same thing occurs for the triad ${_i^k \mathbb{R}_{-1/2}^{+1/2}}$ in the $i$ direction.
-Therefore the sum over the domain is zero,
-\ie\ the variance of the tracer is preserved by the discretisation of the skew fluxes.
-
-\biblio
-
-\pindex
-
-\end{document}
Index: MO/trunk/doc/latex/NEMO/subfiles/annex_iso.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/subfiles/annex_iso.tex	(revision 11542)
+++ 	(revision )
@@ -1,1182 +1,0 @@
-\documentclass[../main/NEMO_manual]{subfiles}
-
-%% Local cmds
-\newcommand{\rML}[1][i]{\ensuremath{_{\mathrm{ML}\,#1}}}
-\newcommand{\rMLt}[1][i]{\tilde{r}_{\mathrm{ML}\,#1}}
-%% Move to ../../global/new_cmds.tex to avoid error with \listoffigures
-%\newcommand{\triad}[6][]{\ensuremath{{}_{#2}^{#3}{\mathbb{#4}_{#1}}_{#5}^{\,#6}}
-\newcommand{\triadd}[5]{\ensuremath{{}_{#1}^{#2}{\mathbb{#3}}_{#4}^{\,#5}}}
-\newcommand{\triadt}[5]{\ensuremath{{}_{#1}^{#2}{\tilde{\mathbb{#3}}}_{#4}^{\,#5}}}
-\newcommand{\rtriad}[2][]{\ensuremath{\triad[#1]{i}{k}{#2}{i_p}{k_p}}}
-\newcommand{\rtriadt}[1]{\ensuremath{\triadt{i}{k}{#1}{i_p}{k_p}}}
-
-\begin{document}
-% ================================================================
-% Iso-neutral diffusion :
-% ================================================================
-\chapter{Iso-Neutral Diffusion and Eddy Advection using Triads}
-\label{apdx:triad}
-
-\chaptertoc
-
-\newpage
-
-\section[Choice of \texttt{namtra\_ldf} namelist parameters]
-{Choice of \protect\nam{tra\_ldf} namelist parameters}
-%-----------------------------------------nam_traldf------------------------------------------------------
-
-\nlst{namtra_ldf}
-%---------------------------------------------------------------------------------------------------------
-
-Two scheme are available to perform the iso-neutral diffusion.
-If the namelist logical \np{ln\_traldf\_triad} is set true,
-\NEMO\ updates both active and passive tracers using the Griffies triad representation of iso-neutral diffusion and
-the eddy-induced advective skew (GM) fluxes.
-If the namelist logical \np{ln\_traldf\_iso} is set true,
-the filtered version of Cox's original scheme (the Standard scheme) is employed (\autoref{sec:LDF_slp}).
-In the present implementation of the Griffies scheme,
-the advective skew fluxes are implemented even if \np{ln\_traldf\_eiv} is false.
-
-Values of iso-neutral diffusivity and GM coefficient are set as described in \autoref{sec:LDF_coef}.
-Note that when GM fluxes are used, the eddy-advective (GM) velocities are output for diagnostic purposes using XIOS,
-even though the eddy advection is accomplished by means of the skew fluxes.
-
-The options specific to the Griffies scheme include:
-\begin{description}
-\item[\np{ln\_triad\_iso}]
-  See \autoref{sec:taper}.
-  If this is set false (the default),
-  then `iso-neutral' mixing is accomplished within the surface mixed-layer along slopes linearly decreasing with
-  depth from the value immediately below the mixed-layer to zero (flat) at the surface (\autoref{sec:lintaper}).
-  This is the same treatment as used in the default implementation
-  \autoref{subsec:LDF_slp_iso}; \autoref{fig:eiv_slp}.
-  Where \np{ln\_triad\_iso} is set true,
-  the vertical skew flux is further reduced to ensure no vertical buoyancy flux,
-  giving an almost pure horizontal diffusive tracer flux within the mixed layer.
-  This is similar to the tapering suggested by \citet{gerdes.koberle.ea_CD91}. See \autoref{subsec:Gerdes-taper}
-\item[\np{ln\_botmix\_triad}]
-  See \autoref{sec:iso_bdry}. 
-  If this is set false (the default) then the lateral diffusive fluxes
-  associated with triads partly masked by topography are neglected. 
-  If it is set true, however, then these lateral diffusive fluxes are applied, 
-  giving smoother bottom tracer fields at the cost of introducing diapycnal mixing.
-\item[\np{rn\_sw\_triad}]
-  blah blah to be added....
-\end{description}
-The options shared with the Standard scheme include:
-\begin{description}
-\item[\np{ln\_traldf\_msc}]   blah blah to be added
-\item[\np{rn\_slpmax}]  blah blah to be added
-\end{description}
-
-\section{Triad formulation of iso-neutral diffusion}
-\label{sec:iso}
-
-We have implemented into \NEMO\ a scheme inspired by \citet{griffies.gnanadesikan.ea_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{equation}
-    D^{lT}=-\nabla \cdot\vect{f}^{lT}\equiv
-    -\frac{1}{e_1e_2e_3}\left[\pd{i}\left (f_1^{lT}e_2e_3\right) +
-      \pd{j}\left (f_2^{lT}e_2e_3\right) + \pd{k}\left (f_3^{lT}e_1e_2\right)\right],
-  \end{equation}
-  where the diffusive flux per unit area of physical space
-  \begin{equation}
-    \vect{f}^{lT}=-{A^{lT}}\Re\cdot\nabla T,
-  \end{equation}
-  \begin{equation}
-    \label{eq:iso_tensor_2}
-    \mbox{with}\quad \;\;\Re =
-    \begin{pmatrix}
-      1   &  0   & -r_1           \rule[-.9 em]{0pt}{1.79 em} \\
-      0   &  1   & -r_2           \rule[-.9 em]{0pt}{1.79 em} \\
-      -r_1 & -r_2 &  r_1 ^2+r_2 ^2 \rule[-.9 em]{0pt}{1.79 em}
-    \end{pmatrix}
-    \quad \text{and} \quad\nabla T=
-    \begin{pmatrix}
-      \frac{1}{e_1} \pd[T]{i} \rule[-.9 em]{0pt}{1.79 em} \\
-      \frac{1}{e_2} \pd[T]{j} \rule[-.9 em]{0pt}{1.79 em} \\
-      \frac{1}{e_3} \pd[T]{k} \rule[-.9 em]{0pt}{1.79 em}
-    \end{pmatrix}
-    .
-  \end{equation}
-\end{subequations}
-% \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 & {r_1 ^2+r_2 ^2} \hfill \\
-% \end{array} }} \right)
-Here \autoref{eq:PE_iso_slopes} 
-\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}
-\end{align*}
-is the $i$-component of the slope of the iso-neutral surface relative to the computational surface,
-and $r_2$ is the $j$-component.
-
-We will find it useful to consider the fluxes per unit area in $i,j,k$ space; we write
-\[
-  % \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).
-\]
-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}$,
-with $f_{ij}=R_{ij}e_i^{-1}\partial T/\partial x_i$ (no summation) etc.
-
-The off-diagonal terms of the small angle diffusion tensor
-\autoref{eq:iso_tensor_1}, \autoref{eq:iso_tensor_2} produce skew-fluxes along
-the $i$- and $j$-directions resulting from the vertical tracer gradient:
-\begin{align}
-  \label{eq:i13c}
-  f_{13}=&+{A^{lT}} r_1\frac{1}{e_3}\frac{\partial T}{\partial k},\qquad f_{23}=+{A^{lT}} r_2\frac{1}{e_3}\frac{\partial T}{\partial k}\\
-  \intertext{and in the k-direction resulting from the lateral tracer gradients}
-  \label{eq:i31c}
-  f_{31}+f_{32}=& {A^{lT}} r_1\frac{1}{e_1}\frac{\partial T}{\partial i}+{A^{lT}} r_2\frac{1}{e_1}\frac{\partial T}{\partial i}
-\end{align}
-
-The vertical diffusive flux associated with the $_{33}$ component of the small angle diffusion tensor is
-\begin{equation}
-  \label{eq:i33c}
-  f_{33}=-{A^{lT}}(r_1^2 +r_2^2) \frac{1}{e_3}\frac{\partial T}{\partial k}.
-\end{equation}
-
-Since there are no cross terms involving $r_1$ and $r_2$ in the above,
-we can consider the iso-neutral diffusive fluxes separately in the $i$-$k$ and $j$-$k$ planes,
-just adding together the vertical components from each plane.
-The following description will describe the fluxes on the $i$-$k$ plane.
-
-There is no natural discretization for the $i$-component of the skew-flux, \autoref{eq:i13c},
-as although it must be evaluated at $u$-points,
-it involves vertical gradients (both for the tracer and the slope $r_1$), defined at $w$-points.
-Similarly, the vertical skew flux, \autoref{eq:i31c},
-is evaluated at $w$-points but involves horizontal gradients defined at $u$-points.
-
-\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,
-\autoref{eq:tra_ldf_iso}, is to calculate a mean vertical gradient at the $u$-point from
-the average of the four surrounding vertical tracer gradients, and multiply this by a mean slope at the $u$-point,
-calculated from the averaged surrounding vertical density gradients.
-The total area-integrated skew-flux (flux per unit area in $ijk$ space) from tracer cell $i,k$ to $i+1,k$,
-noting that the $e_{{3}_{i+1/2}^k}$ in the area $e{_{3}}_{i+1/2}^k{e_{2}}_{i+1/2}i^k$ at the $u$-point cancels out with
-the $1/{e_{3}}_{i+1/2}^k$ associated with the vertical tracer gradient, is then \autoref{eq:tra_ldf_iso}
-\[
-  \left(F_u^{13} \right)_{i+\frac{1}{2}}^k = {A}_{i+\frac{1}{2}}^k
-  {e_{2}}_{i+1/2}^k \overline{\overline
-    r_1} ^{\,i,k}\,\overline{\overline{\delta_k T}}^{\,i,k},
-\]
-where
-\[
-  \overline{\overline
-    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}},
-\]
-and here and in the following we drop the $^{lT}$ superscript from ${A^{lT}}$ for simplicity.
-Unfortunately the resulting combination $\overline{\overline{\delta_k\bullet}}^{\,i,k}$ of a $k$ average and
-a $k$ difference of the tracer reduces to $\bullet_{k+1}-\bullet_{k-1}$,
-so two-grid-point oscillations are invisible to this discretization of the iso-neutral operator.
-These \emph{computational modes} will not be damped by this operator, and may even possibly be amplified by it.
-Consequently, applying this operator to a tracer does not guarantee the decrease of its global-average variance.
-To correct this, we introduced a smoothing of the slopes of the iso-neutral surfaces (see \autoref{chap:LDF}).
-This technique works for $T$ and $S$ in so far as they are active tracers
-(\ie\ they enter the computation of density), but it does not work for a passive tracer.
-
-\subsection{Expression of the skew-flux in terms of triad slopes}
-
-\citep{griffies.gnanadesikan.ea_JPO98} introduce a different discretization of the off-diagonal terms that
-nicely solves the problem.
-% Instead of multiplying the mean slope calculated at the $u$-point by
-% the mean vertical gradient at the $u$-point,
-% >>>>>>>>>>>>>>>>>>>>>>>>>>>>
-\begin{figure}[tb]
-  \begin{center}
-    \includegraphics[width=\textwidth]{Fig_GRIFF_triad_fluxes}
-    \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$
-      (b) Triads $S'_i$ and tracer gradients to give vertical tracer flux from
-      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
-the corresponding `triad' slope calculated from the lateral density gradient across the $u$-point divided by
-the vertical density gradient at the same $w$-point as the tracer gradient.
-See \autoref{fig:ISO_triad}a, where the thick lines denote the tracer gradients,
-and the thin lines the corresponding triads, with slopes $s_1, \dotsc s_4$.
-The total area-integrated skew-flux from tracer cell $i,k$ to $i+1,k$
-\begin{multline}
-  \label{eq:i13}
-  \left( F_u^{13}  \right)_{i+\frac{1}{2}}^k = {A}_{i+1}^k a_1 s_1
-  \delta_{k+\frac{1}{2}} \left[ T^{i+1}
-  \right]/e_{{3w}_{i+1}}^{k+\frac{1}{2}}  + {A} _i^k a_2 s_2 \delta
-  _{k+\frac{1}{2}} \left[ T^i
-  \right]/e_{{3w}_{i+1}}^{k+\frac{1}{2}} \\
-  +{A} _{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}}  +{A} _i^k a_4 s_4 \delta
-  _{k-\frac{1}{2}} \left[ T^i \right]/e_{{3w}_{i+1}}^{k+\frac{1}{2}},
-\end{multline}
-where the contributions of the triad fluxes are weighted by areas $a_1, \dotsc a_4$,
-and ${A}$ is now defined at the tracer points rather than the $u$-points.
-This discretization gives a much closer stencil, and disallows the two-point computational modes.
-
-The vertical skew flux \autoref{eq:i31c} from tracer cell $i,k$ to $i,k+1$ at
-the $w$-point $i,k+\frac{1}{2}$ is constructed similarly (\autoref{fig:ISO_triad}b) by
-multiplying lateral tracer gradients from each of the four surrounding $u$-points by the appropriate triad slope:
-\begin{multline}
-  \label{eq:i31}
-  \left( F_w^{31} \right) _i ^{k+\frac{1}{2}} =  {A}_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}
-  +{A}_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} \\
-  + {A}_i^k a_{3}' s_{3}' \delta_{i-\frac{1}{2}} \left[ T^k\right]/{e_{3u}}_{i-\frac{1}{2}}^k
-  +{A}_i^k a_{4}' s_{4}' \delta_{i+\frac{1}{2}} \left[ T^k \right]/{e_{3u}}_{i+\frac{1}{2}}^k.
-\end{multline}
-
-We notate the triad slopes $s_i$ and $s'_i$ in terms of the `anchor point' $i,k$
-(appearing in both the vertical and lateral gradient),
-and the $u$- and $w$-points $(i+i_p,k)$, $(i,k+k_p)$ at the centres of the `arms' of the triad as follows
-(see also \autoref{fig:ISO_triad}):
-\begin{equation}
-  \label{eq:R}
-  _i^k \mathbb{R}_{i_p}^{k_p}
-  =-\frac{ {e_{3w}}_{\,i}^{\,k+k_p}} { {e_{1u}}_{\,i+i_p}^{\,k}}
-  \
-  \frac
-  { \alpha_i^k  \ \delta_{i+i_p}[T^k] - \beta_i^k \ \delta_{i+i_p}[S^k] }
-  { \alpha_i^k  \ \delta_{k+k_p}[T^i] - \beta_i^k \ \delta_{k+k_p}[S^i] }.
-\end{equation}
-In calculating the slopes of the local neutral surfaces,
-the expansion coefficients $\alpha$ and $\beta$ are evaluated at the anchor points of the triad,
-while the metrics are calculated at the $u$- and $w$-points on the arms.
-
-% >>>>>>>>>>>>>>>>>>>>>>>>>>>>
-\begin{figure}[tb]
-  \begin{center}
-    \includegraphics[width=\textwidth]{Fig_GRIFF_qcells}
-    \caption{
-      \protect\label{fig:qcells}
-      Triad notation for quarter cells. $T$-cells are inside boxes,
-      while the  $i+\fractext{1}{2},k$ $u$-cell is shaded in green and
-      the $i,k+\fractext{1}{2}$ $w$-cell is shaded in pink.
-    }
-  \end{center}
-\end{figure}
-% >>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-Each triad $\{_i^{k}\:_{i_p}^{k_p}\}$ is associated (\autoref{fig:qcells}) with the quarter cell that is
-the intersection of the $i,k$ $T$-cell, the $i+i_p,k$ $u$-cell and the $i,k+k_p$ $w$-cell.
-Expressing the slopes $s_i$ and $s'_i$ in \autoref{eq:i13} and \autoref{eq:i31} in this notation,
-we have \eg\ \ $s_1=s'_1={\:}_i^k \mathbb{R}_{1/2}^{1/2}$.
-Each triad slope $_i^k\mathbb{R}_{i_p}^{k_p}$ is used once (as an $s$) to
-calculate the lateral flux along its $u$-arm, at $(i+i_p,k)$,
-and then again as an $s'$ to calculate the vertical flux along its $w$-arm at $(i,k+k_p)$.
-Each vertical area $a_i$ used to calculate the lateral flux and horizontal area $a'_i$ used to
-calculate the vertical flux can also be identified as the area across the $u$- and $w$-arms of a unique triad,
-and we notate these areas, similarly to the triad slopes,
-as $_i^k{\mathbb{A}_u}_{i_p}^{k_p}$, $_i^k{\mathbb{A}_w}_{i_p}^{k_p}$,
-where \eg\ in \autoref{eq:i13} $a_{1}={\:}_i^k{\mathbb{A}_u}_{1/2}^{1/2}$,
-and in \autoref{eq:i31} $a'_{1}={\:}_i^k{\mathbb{A}_w}_{1/2}^{1/2}$.
-
-\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.
-The lateral density flux disappears so long as the area-integrated lateral diffusive flux from
-tracer cell $i,k$ to $i+1,k$ coming from the $_{11}$ term of the diffusion tensor takes the form
-\begin{equation}
-  \label{eq:i11}
-  \left( F_u^{11} \right) _{i+\frac{1}{2}} ^{k} =
-  - \left( {A}_i^{k+1} a_{1} + {A}_i^{k+1} a_{2} + {A}_i^k
-    a_{3} + {A}_i^k a_{4} \right)
-  \frac{\delta_{i+1/2} \left[ T^k\right]}{{e_{1u}}_{\,i+1/2}^{\,k}},
-\end{equation}
-where the areas $a_i$ are as in \autoref{eq:i13}.
-In this case, separating the total lateral flux, the sum of \autoref{eq:i13} and \autoref{eq:i11},
-into triad components, a lateral tracer flux
-\begin{equation}
-  \label{eq:latflux-triad}
-  _i^k {\mathbb{F}_u}_{i_p}^{k_p} (T) = - {A}_i^k{ \:}_i^k{\mathbb{A}_u}_{i_p}^{k_p}
-  \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)
-\end{equation}
-can be identified with each triad.
-Then, because the same metric factors ${e_{3w}}_{\,i}^{\,k+k_p}$ and ${e_{1u}}_{\,i+i_p}^{\,k}$ are employed for both
-the density gradients in $ _i^k \mathbb{R}_{i_p}^{k_p}$ and the tracer gradients,
-the lateral density flux associated with each triad separately disappears.
-\begin{equation}
-  \label{eq:latflux-rho}
-  {\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
-\end{equation}
-Thus the total flux $\left( F_u^{31} \right) ^i _{i,k+\frac{1}{2}} + \left( F_u^{11} \right) ^i _{i,k+\frac{1}{2}}$ from
-tracer cell $i,k$ to $i+1,k$ must also vanish since it is a sum of four such triad fluxes.
-
-The squared slope $r_1^2$ in the expression \autoref{eq:i33c} for the $_{33}$ component is also expressed in
-terms of area-weighted squared triad slopes,
-so the area-integrated vertical flux from tracer cell $i,k$ to $i,k+1$ resulting from the $r_1^2$ term is
-\begin{equation}
-  \label{eq:i33}
-  \left( F_w^{33} \right) _i^{k+\frac{1}{2}} =
-  - \left( {A}_i^{k+1} a_{1}' s_{1}'^2
-    + {A}_i^{k+1} a_{2}' s_{2}'^2
-    + {A}_i^k a_{3}' s_{3}'^2
-    + {A}_i^k a_{4}' s_{4}'^2 \right)\delta_{k+\frac{1}{2}} \left[ T^{i+1} \right],
-\end{equation}
-where the areas $a'$ and slopes $s'$ are the same as in \autoref{eq:i31}.
-Then, separating the total vertical flux, the sum of \autoref{eq:i31} and \autoref{eq:i33},
-into triad components, a vertical flux
-\begin{align}
-  \label{eq:vertflux-triad}
-  _i^k {\mathbb{F}_w}_{i_p}^{k_p} (T)
-  &= {A}_i^k{\: }_i^k{\mathbb{A}_w}_{i_p}^{k_p}
-    \left(
-    {_i^k\mathbb{R}_{i_p}^{k_p}}\frac{ \delta_{i+ i_p}[T^k] }{ {e_{1u}}_{\,i + i_p}^{\,k} }
-    -\ \left({_i^k\mathbb{R}_{i_p}^{k_p}}\right)^2 \
-    \frac{ \delta_{k+k_p} [T^i] }{{e_{3w}}_{\,i}^{\,k+k_p} }
-    \right) \\
-  &= - \left(\left.{ }_i^k{\mathbb{A}_w}_{i_p}^{k_p}\right/{ }_i^k{\mathbb{A}_u}_{i_p}^{k_p}\right)
-    {_i^k\mathbb{R}_{i_p}^{k_p}}{\: }_i^k{\mathbb{F}_u}_{i_p}^{k_p} (T) \label{eq:vertflux-triad2}
-\end{align}
-may be associated with each triad.
-Each vertical density flux $_i^k {\mathbb{F}_w}_{i_p}^{k_p} (\rho)$ associated with a triad then
-separately disappears (because the lateral flux $_i^k{\mathbb{F}_u}_{i_p}^{k_p} (\rho)$ disappears).
-Consequently the total vertical density flux
-$\left( F_w^{31} \right)_i ^{k+\frac{1}{2}} + \left( F_w^{33} \right)_i^{k+\frac{1}{2}}$ from
-tracer cell $i,k$ to $i,k+1$ must also vanish since it is a sum of four such triad fluxes.
-
-We can explicitly identify (\autoref{fig:qcells}) the triads associated with the $s_i$, $a_i$,
-and $s'_i$, $a'_i$ used in the definition of the $u$-fluxes and $w$-fluxes in \autoref{eq:i31},
-\autoref{eq:i13}, \autoref{eq:i11} \autoref{eq:i33} and \autoref{fig:ISO_triad} to write out
-the iso-neutral fluxes at $u$- and $w$-points as sums of the triad fluxes that cross the $u$- and $w$-faces:
-%(\autoref{fig:ISO_triad}):
-\begin{flalign}
-  \label{eq:iso_flux} \vect{F}_{\mathrm{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}.
-\end{flalign}
-
-\subsection{Ensuring the scheme does not increase tracer variance}
-\label{subsec:variance}
-
-We now require that this operator should not increase the globally-integrated tracer variance.
-%This changes according to
-% \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\}      \\
-% \end{align*}
-Each triad slope $_i^k\mathbb{R}_{i_p}^{k_p}$ drives a lateral flux $_i^k{\mathbb{F}_u}_{i_p}^{k_p} (T)$ across
-the $u$-point $i+i_p,k$ and a vertical flux $_i^k{\mathbb{F}_w}_{i_p}^{k_p} (T)$ across the $w$-point $i,k+k_p$.
-The lateral flux drives a net rate of change of variance,
-summed over the two $T$-points $i+i_p-\fractext{1}{2},k$ and $i+i_p+\fractext{1}{2},k$, of
-\begin{multline}
-  {b_T}_{i+i_p-1/2}^k\left(\frac{\partial T}{\partial t}T\right)_{i+i_p-1/2}^k+
-  \quad {b_T}_{i+i_p+1/2}^k\left(\frac{\partial T}{\partial
-      t}T\right)_{i+i_p+1/2}^k \\
-  \begin{aligned}
-    &= -T_{i+i_p-1/2}^k{\;} _i^k{\mathbb{F}_u}_{i_p}^{k_p} (T) \quad + \quad  T_{i+i_p+1/2}^k
-    {\;}_i^k{\mathbb{F}_u}_{i_p}^{k_p} (T) \\
-    &={\;} _i^k{\mathbb{F}_u}_{i_p}^{k_p} (T)\,\delta_{i+ i_p}[T^k], \label{eq:dvar_iso_i}
-  \end{aligned}
-\end{multline}
-while the vertical flux similarly drives a net rate of change of variance summed over
-the $T$-points $i,k+k_p-\fractext{1}{2}$ (above) and $i,k+k_p+\fractext{1}{2}$ (below) of
-\begin{equation}
-  \label{eq:dvar_iso_k}
-  _i^k{\mathbb{F}_w}_{i_p}^{k_p} (T) \,\delta_{k+ k_p}[T^i].
-\end{equation}
-The total variance tendency driven by the triad is the sum of these two.
-Expanding $_i^k{\mathbb{F}_u}_{i_p}^{k_p} (T)$ and $_i^k{\mathbb{F}_w}_{i_p}^{k_p} (T)$ with
-\autoref{eq:latflux-triad} and \autoref{eq:vertflux-triad}, it is
-\begin{multline*}
-  -{A}_i^k\left \{
-    { } _i^k{\mathbb{A}_u}_{i_p}^{k_p}
-    \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)\,\delta_{i+ i_p}[T^k] \right.\\
-  - \left. { } _i^k{\mathbb{A}_w}_{i_p}^{k_p}
-    \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) {\,}_i^k\mathbb{R}_{i_p}^{k_p}\delta_{k+ k_p}[T^i]
-  \right \}.
-\end{multline*}
-The key point is then that if we require $_i^k{\mathbb{A}_u}_{i_p}^{k_p}$ and $_i^k{\mathbb{A}_w}_{i_p}^{k_p}$ to
-be related to a triad volume $_i^k\mathbb{V}_{i_p}^{k_p}$ by
-\begin{equation}
-  \label{eq:V-A}
-  _i^k\mathbb{V}_{i_p}^{k_p}
-  ={\;}_i^k{\mathbb{A}_u}_{i_p}^{k_p}\,{e_{1u}}_{\,i + i_p}^{\,k}
-  ={\;}_i^k{\mathbb{A}_w}_{i_p}^{k_p}\,{e_{3w}}_{\,i}^{\,k + k_p},
-\end{equation}
-the variance tendency reduces to the perfect square
-\begin{equation}
-  \label{eq:perfect-square}
-  -{A}_i^k{\:} _i^k\mathbb{V}_{i_p}^{k_p}
-  \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)^2\leq 0.
-\end{equation}
-Thus, the constraint \autoref{eq:V-A} ensures that the fluxes
-(\autoref{eq:latflux-triad}, \autoref{eq:vertflux-triad}) associated with
-a given slope triad $_i^k\mathbb{R}_{i_p}^{k_p}$ do not increase the net variance.
-Since the total fluxes are sums of such fluxes from the various triads, this constraint, applied to all triads,
-is sufficient to ensure that the globally integrated variance does not increase.
-
-The expression \autoref{eq:V-A} can be interpreted as a discretization of the global integral
-\begin{equation}
-  \label{eq:cts-var}
-  \frac{\partial}{\partial t}\int\!\fractext{1}{2} T^2\, dV =
-  \int\!\mathbf{F}\cdot\nabla T\, dV,
-\end{equation}
-where, within each triad volume $_i^k\mathbb{V}_{i_p}^{k_p}$, the lateral and vertical fluxes/unit area
-\[
-  \mathbf{F}=\left(
-    \left.{}_i^k{\mathbb{F}_u}_{i_p}^{k_p} (T)\right/{}_i^k{\mathbb{A}_u}_{i_p}^{k_p},
-    \left.{\:}_i^k{\mathbb{F}_w}_{i_p}^{k_p} (T)\right/{}_i^k{\mathbb{A}_w}_{i_p}^{k_p}
-  \right)
-\]
-and the gradient
-\[
-  \nabla T = \left(
-    \left.\delta_{i+ i_p}[T^k] \right/ {e_{1u}}_{\,i + i_p}^{\,k},
-    \left.\delta_{k+ k_p}[T^i] \right/ {e_{3w}}_{\,i}^{\,k + k_p}
-  \right)
-\]
-
-\subsection{Triad volumes in Griffes's scheme and in \NEMO}
-
-To complete the discretization we now need only specify the triad volumes $_i^k\mathbb{V}_{i_p}^{k_p}$.
-\citet{griffies.gnanadesikan.ea_JPO98} identifies these $_i^k\mathbb{V}_{i_p}^{k_p}$ as the volumes of the quarter cells,
-defined in terms of the distances between $T$, $u$,$f$ and $w$-points.
-This is the natural discretization of \autoref{eq:cts-var}.
-The \NEMO\ model, however, operates with scale factors instead of grid sizes,
-and scale factors for the quarter cells are not defined.
-Instead, therefore we simply choose
-\begin{equation}
-  \label{eq:V-NEMO}
-  _i^k\mathbb{V}_{i_p}^{k_p}=\fractext{1}{4} {b_u}_{i+i_p}^k,
-\end{equation}
-as a quarter of the volume of the $u$-cell inside which the triad quarter-cell lies.
-This has the nice property that when the slopes $\mathbb{R}$ vanish,
-the lateral flux from tracer cell $i,k$ to $i+1,k$ reduces to the classical form
-\begin{equation}
-  \label{eq:lat-normal}
-  -\overline{A}_{\,i+1/2}^k\;
-  \frac{{b_u}_{i+1/2}^k}{{e_{1u}}_{\,i + i_p}^{\,k}}
-  \;\frac{\delta_{i+ 1/2}[T^k] }{{e_{1u}}_{\,i + i_p}^{\,k}}
-  = -\overline{A}_{\,i+1/2}^k\;\frac{{e_{1w}}_{\,i + 1/2}^{\,k}\:{e_{1v}}_{\,i + 1/2}^{\,k}\;\delta_{i+ 1/2}[T^k]}{{e_{1u}}_{\,i + 1/2}^{\,k}}.
-\end{equation}
-In fact if the diffusive coefficient is defined at $u$-points,
-so that we employ ${A}_{i+i_p}^k$ instead of  ${A}_i^k$ in the definitions of the triad fluxes
-\autoref{eq:latflux-triad} and \autoref{eq:vertflux-triad},
-we can replace $\overline{A}_{\,i+1/2}^k$ by $A_{i+1/2}^k$ in the above.
-
-\subsection{Summary of the scheme}
-
-The iso-neutral fluxes at $u$- and $w$-points are the sums of the triad fluxes that
-cross the $u$- and $w$-faces \autoref{eq:iso_flux}:
-\begin{subequations}
-  % \label{eq:alltriadflux}
-  \begin{flalign*}
-    % \label{eq:vect_isoflux}
-    \vect{F}_{\mathrm{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},
-  \end{flalign*}
-  where \autoref{eq:latflux-triad}:
-  \begin{align}
-    \label{eq:triadfluxu}
-    _i^k {\mathbb{F}_u}_{i_p}^{k_p} (T) &= - {A}_i^k{
-                                          \:}\frac{{{}_i^k\mathbb{V}}_{i_p}^{k_p}}{{e_{1u}}_{\,i + i_p}^{\,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),\\
-    \intertext{and}
-    _i^k {\mathbb{F}_w}_{i_p}^{k_p} (T)
-                                        &= {A}_i^k{\: }\frac{{{}_i^k\mathbb{V}}_{i_p}^{k_p}}{{e_{3w}}_{\,i}^{\,k+k_p}}
-                                          \left(
-                                          {_i^k\mathbb{R}_{i_p}^{k_p}}\frac{ \delta_{i+ i_p}[T^k] }{ {e_{1u}}_{\,i + i_p}^{\,k} }
-                                          -\ \left({_i^k\mathbb{R}_{i_p}^{k_p}}\right)^2 \
-                                          \frac{ \delta_{k+k_p} [T^i] }{{e_{3w}}_{\,i}^{\,k+k_p} }
-                                          \right),\label{eq:triadfluxw}
-  \end{align}
-  with \autoref{eq:V-NEMO}
-  \[
-    % \label{eq:V-NEMO2}
-    _i^k{\mathbb{V}}_{i_p}^{k_p}=\fractext{1}{4} {b_u}_{i+i_p}^k.
-  \]
-\end{subequations}
-
-The divergence of the expression \autoref{eq:iso_flux} for the fluxes gives the iso-neutral diffusion tendency at
-each tracer point:
-\[
-  % \label{eq:iso_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 diffusion scheme satisfies the following six properties:
-\begin{description}
-\item[$\bullet$ horizontal diffusion]
-  The discretization of the diffusion operator recovers the traditional five-point Laplacian
-  \autoref{eq:lat-normal} in the limit of flat iso-neutral direction:
-  \[
-    % \label{eq:iso_property0}
-    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]
-  Only tracer values associated with a single water column appear in the expression \autoref{eq:i33} for
-  the $_{33}$ fluxes, vertical fluxes driven by vertical gradients.
-  This is of paramount importance since it means that a time-implicit algorithm can be used to
-  solve the vertical diffusion equation.
-  This is necessary since the vertical eddy diffusivity associated with this term,
-  \[
-    \frac{1}{b_w}\sum_{\substack{i_p, \,k_p}} \left\{
-      {\:}_i^k\mathbb{V}_{i_p}^{k_p} \: {A}_i^k \: \left(_i^k \mathbb{R}_{i_p}^{k_p}\right)^2
-    \right\}  =
-    \frac{1}{4b_w}\sum_{\substack{i_p, \,k_p}} \left\{
-      {b_u}_{i+i_p}^k\: {A}_i^k \: \left(_i^k \mathbb{R}_{i_p}^{k_p}\right)^2
-    \right\},
-  \]
-  (where $b_w= e_{1w}\,e_{2w}\,e_{3w}$ is the volume of $w$-cells) can be quite large.
-
-\item[$\bullet$ pure iso-neutral operator]
-  The iso-neutral flux of locally referenced potential density is zero.
-  See \autoref{eq:latflux-rho} and \autoref{eq:vertflux-triad2}.
-
-\item[$\bullet$ conservation of tracer]
-  The iso-neutral diffusion conserves tracer content, \ie
-  \[
-    % \label{eq:iso_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$ no increase of tracer variance]
-  The iso-neutral diffusion does not increase the tracer variance, \ie
-  \[
-    % \label{eq:iso_property2}
-    \sum_{i,j,k} \left\{ T \ D_l^T      \ b_T \right\} \leq 0
-  \]
-  The property is demonstrated in \autoref{subsec:variance} above.
-  It is a key property for a diffusion term.
-  It means that it is also a dissipation term,
-  \ie\ it dissipates the square of the quantity on which it is applied.
-  It therefore ensures that, when the diffusivity coefficient is large enough,
-  the field on which it is applied becomes free of grid-point noise.
-
-\item[$\bullet$ self-adjoint operator]
-  The iso-neutral diffusion operator is self-adjoint, \ie
-  \begin{equation}
-    \label{eq:iso_property3}
-    \sum_{i,j,k} \left\{ S \ D_l^T \ b_T \right\} = \sum_{i,j,k} \left\{ D_l^S \ T \ b_T \right\}
-  \end{equation}
-  In other word, there is no need to develop a specific routine from the adjoint of this operator.
-  We just have to apply the same routine.
-  This property can be demonstrated similarly to the proof of the `no increase of tracer variance' property.
-  The contribution by a single triad towards the left hand side of \autoref{eq:iso_property3},
-  can be found by replacing $\delta[T]$ by $\delta[S]$ in \autoref{eq:dvar_iso_i} and \autoref{eq:dvar_iso_k}.
-  This results in a term similar to \autoref{eq:perfect-square},
-  \[
-    % \label{eq:TScovar}
-    - {A}_i^k{\:} _i^k\mathbb{V}_{i_p}^{k_p}
-    \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)
-    \left(
-      \frac{ \delta_{i+ i_p}[S^k] }{ {e_{1u}}_{\,i + i_p}^{\,k} }
-      -{\:}_i^k\mathbb{R}_{i_p}^{k_p}
-      \frac{ \delta_{k+k_p} [S^i] }{{e_{3w}}_{\,i}^{\,k+k_p} }
-    \right).
-  \]
-This is symmetrical in $T $ and $S$, so exactly the same term arises from
-the discretization of this triad's contribution towards the RHS of \autoref{eq:iso_property3}.
-\end{description}
-
-\subsection{Treatment of the triads at the boundaries}
-\label{sec:iso_bdry}
-
-The triad slope can only be defined where both the grid boxes centred at the end of the arms exist.
-Triads that would poke up through the upper ocean surface into the atmosphere,
-or down into the ocean floor, must be masked out.
-See \autoref{fig:bdry_triads}.
-Surface layer triads \triad{i}{1}{R}{1/2}{-1/2} (magenta) and \triad{i+1}{1}{R}{-1/2}{-1/2} (blue) that
-require density to be specified above the ocean surface are masked (\autoref{fig:bdry_triads}a):
-this ensures that lateral tracer gradients produce no flux through the ocean surface.
-However, to prevent surface noise, it is customary to retain the $_{11}$ contributions towards
-the lateral triad fluxes \triad[u]{i}{1}{F}{1/2}{-1/2} and \triad[u]{i+1}{1}{F}{-1/2}{-1/2};
-this drives diapycnal tracer fluxes.
-Similar comments apply to triads that would intersect the ocean floor (\autoref{fig:bdry_triads}b).
-Note that both near bottom triad slopes \triad{i}{k}{R}{1/2}{1/2} and \triad{i+1}{k}{R}{-1/2}{1/2} are masked when
-either of the $i,k+1$ or $i+1,k+1$ tracer points is masked, \ie\ the $i,k+1$ $u$-point is masked.
-The associated lateral fluxes (grey-black dashed line) are masked if \np{ln\_botmix\_triad}\forcode{ = .false.},
-but left unmasked, giving bottom mixing, if \np{ln\_botmix\_triad}\forcode{ = .true.}.
-
-The default option \np{ln\_botmix\_triad}\forcode{ = .false.} is suitable when the bbl mixing option is enabled
-(\np{ln\_trabbl}\forcode{ = .true.}, with \np{nn\_bbl\_ldf}\forcode{ = 1}), or for simple idealized problems.
-For setups with topography without bbl mixing, \np{ln\_botmix\_triad}\forcode{ = .true.} may be necessary.
-% >>>>>>>>>>>>>>>>>>>>>>>>>>>>
-\begin{figure}[h]
-  \begin{center}
-    \includegraphics[width=\textwidth]{Fig_GRIFF_bdry_triads}
-    \caption{
-      \protect\label{fig:bdry_triads}
-      (a) Uppermost model layer $k=1$ with $i,1$ and $i+1,1$ tracer points (black dots),
-      and $i+1/2,1$ $u$-point (blue square).
-      Triad slopes \triad{i}{1}{R}{1/2}{-1/2} (magenta) and \triad{i+1}{1}{R}{-1/2}{-1/2} (blue) poking through
-      the ocean surface are masked (faded in figure).
-      However, the lateral $_{11}$ contributions towards \triad[u]{i}{1}{F}{1/2}{-1/2} and
-      \triad[u]{i+1}{1}{F}{-1/2}{-1/2} (yellow line) are still applied,
-      giving diapycnal diffusive fluxes.
-      \newline
-      (b) Both near bottom triad slopes \triad{i}{k}{R}{1/2}{1/2} and
-      \triad{i+1}{k}{R}{-1/2}{1/2} are masked when either of the $i,k+1$ or $i+1,k+1$ tracer points is masked,
-      \ie\ the $i,k+1$ $u$-point is masked.
-      The associated lateral fluxes (grey-black dashed line) are masked if
-      \protect\np{ln\_botmix\_triad}\forcode{ = .false.}, but left unmasked,
-      giving bottom mixing, if \protect\np{ln\_botmix\_triad}\forcode{ = .true.}
-    }
-  \end{center}
-\end{figure}
-% >>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-\subsection{ Limiting of the slopes within the interior}
-\label{sec:limit}
-
-As discussed in \autoref{subsec:LDF_slp_iso},
-iso-neutral slopes relative to geopotentials must be bounded everywhere,
-both for consistency with the small-slope approximation and for numerical stability \citep{cox_OM87, griffies_bk04}.
-The bound chosen in \NEMO\ is applied to each component of the slope separately and
-has a value of $1/100$ in the ocean interior.
-%, ramping linearly down above 70~m depth to zero at the surface
-It is of course relevant to the iso-neutral slopes $\tilde{r}_i=r_i+\sigma_i$ relative to geopotentials
-(here the $\sigma_i$ are the slopes of the coordinate surfaces relative to geopotentials)
-\autoref{eq:PE_slopes_eiv} rather than the slope $r_i$ relative to coordinate surfaces, so we require
-\[
-  |\tilde{r}_i|\leq \tilde{r}_\mathrm{max}=0.01.
-\]
-and then recalculate the slopes $r_i$ relative to coordinates.
-Each individual triad slope
-\begin{equation}
-  \label{eq:Rtilde}
-  _i^k\tilde{\mathbb{R}}_{i_p}^{k_p} = {}_i^k\mathbb{R}_{i_p}^{k_p}  + \frac{\delta_{i+i_p}[z_T^k]}{{e_{1u}}_{\,i + i_p}^{\,k}}
-\end{equation}
-is limited like this and then the corresponding $_i^k\mathbb{R}_{i_p}^{k_p} $ are recalculated and
-combined to form the fluxes.
-Note that where the slopes have been limited, there is now a non-zero iso-neutral density flux that
-drives dianeutral mixing.
-In particular this iso-neutral density flux is always downwards,
-and so acts to reduce gravitational potential energy.
-
-\subsection{Tapering within the surface mixed layer}
-\label{sec:taper}
-
-Additional tapering of the iso-neutral fluxes is necessary within the surface mixed layer.
-When the Griffies triads are used, we offer two options for this.
-
-\subsubsection{Linear slope tapering within the surface mixed layer}
-\label{sec:lintaper}
-
-This is the option activated by the default choice \np{ln\_triad\_iso}\forcode{ = .false.}.
-Slopes $\tilde{r}_i$ relative to geopotentials are tapered linearly from their value immediately below
-the mixed layer to zero at the surface, as described in option (c) of \autoref{fig:eiv_slp}, to values
-\begin{equation}
-  \label{eq:rmtilde}
-  \rMLt = -\frac{z}{h}\left.\tilde{r}_i\right|_{z=-h}\quad \text{ for  } z>-h,
-\end{equation}
-and then the $r_i$ relative to vertical coordinate surfaces are appropriately adjusted to
-\[
-  % \label{eq:rm}
-  \rML =\rMLt -\sigma_i \quad \text{ for  } z>-h.
-\]
-Thus the diffusion operator within the mixed layer is given by:
-\[
-  % \label{eq:iso_tensor_ML}
-  D^{lT}=\nabla {\mathrm {\mathbf .}}\left( {A^{lT}\;\Re \;\nabla T} \right) \qquad
-  \mbox{with}\quad \;\;\Re =\left( {{
-        \begin{array}{*{20}c}
-          1 \hfill & 0 \hfill & {-\rML[1]}\hfill \\
-          0 \hfill & 1 \hfill & {-\rML[2]} \hfill \\
-          {-\rML[1]}\hfill &   {-\rML[2]} \hfill & {\rML[1]^2+\rML[2]^2} \hfill
-        \end{array}
-      }} \right)
-\]
-
-This slope tapering gives a natural connection between tracer in the mixed-layer and
-in isopycnal layers immediately below, in the thermocline.
-It is consistent with the way the $\tilde{r}_i$ are tapered within the mixed layer
-(see \autoref{sec:taperskew} below) so as to ensure a uniform GM eddy-induced velocity throughout the mixed layer.
-However, it gives a downwards density flux and so acts so as to reduce potential energy in the same way as
-does the slope limiting discussed above in \autoref{sec:limit}.
- 
-As in \autoref{sec:limit} above, the tapering \autoref{eq:rmtilde} is applied separately to
-each triad $_i^k\tilde{\mathbb{R}}_{i_p}^{k_p}$, and the $_i^k\mathbb{R}_{i_p}^{k_p}$ adjusted.
-For clarity, we assume $z$-coordinates in the following;
-the conversion from $\mathbb{R}$ to $\tilde{\mathbb{R}}$ and back to $\mathbb{R}$ follows exactly as
-described above by \autoref{eq:Rtilde}.
-\begin{enumerate}
-\item
-  Mixed-layer depth is defined so as to avoid including regions of weak vertical stratification in
-  the slope definition.
-  At each $i,j$ (simplified to $i$ in \autoref{fig:MLB_triad}),
-  we define the mixed-layer by setting the vertical index of the tracer point immediately below the mixed layer,
-  $k_{\mathrm{ML}}$, as the maximum $k$ (shallowest tracer point) such that
-  the potential density ${\rho_0}_{i,k}>{\rho_0}_{i,k_{10}}+\Delta\rho_c$,
-  where $i,k_{10}$ is the tracer gridbox within which the depth reaches 10~m.
-  See the left side of \autoref{fig:MLB_triad}.
-  We use the $k_{10}$-gridbox instead of the surface gridbox to avoid problems \eg\ with thin daytime mixed-layers.
-  Currently we use the same $\Delta\rho_c=0.01\;\mathrm{kg\:m^{-3}}$ for ML triad tapering as is used to
-  output the diagnosed mixed-layer depth $h_{\mathrm{ML}}=|z_{W}|_{k_{\mathrm{ML}}+1/2}$,
-  the depth of the $w$-point above the $i,k_{\mathrm{ML}}$ tracer point.
-\item
-  We define `basal' triad slopes ${\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p}$ as
-  the slopes of those triads whose vertical `arms' go down from the $i,k_{\mathrm{ML}}$ tracer point to
-  the $i,k_{\mathrm{ML}}-1$ tracer point below.
-  This is to ensure that the vertical density gradients associated with
-  these basal triad slopes ${\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p}$ are representative of the thermocline.
-  The four basal triads defined in the bottom part of \autoref{fig:MLB_triad} are then
-  \begin{align*}
-    {\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p} &=
-                                                       {\:}^{k_{\mathrm{ML}}-k_p-1/2}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p},
-                                                       % \label{eq:Rbase}
-    \\
-    \intertext{with \eg\ the green triad}
-    {\:}_i{\mathbb{R}_{\mathrm{base}}}_{1/2}^{-1/2}&=
-                                                     {\:}^{k_{\mathrm{ML}}}_i{\mathbb{R}_{\mathrm{base}}}_{\,1/2}^{-1/2}.
-  \end{align*}
-The vertical flux associated with each of these triads passes through
-the $w$-point $i,k_{\mathrm{ML}}-1/2$ lying \emph{below} the $i,k_{\mathrm{ML}}$ tracer point, so it is this depth
-\[
-  % \label{eq:zbase}
-  {z_\mathrm{base}}_{\,i}={z_{w}}_{k_\mathrm{ML}-1/2}
-\]
-one gridbox deeper than the diagnosed ML depth $z_{\mathrm{ML}})$ that sets the $h$ used to taper the slopes in
-\autoref{eq:rmtilde}.
-\item
-  Finally, we calculate the adjusted triads ${\:}_i^k{\mathbb{R}_{\mathrm{ML}}}_{\,i_p}^{k_p}$ within
-  the mixed layer, by multiplying the appropriate ${\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p}$ by
-  the ratio of the depth of the $w$-point ${z_w}_{k+k_p}$ to ${z_{\mathrm{base}}}_{\,i}$.
-  For instance the green triad centred on $i,k$
-  \begin{align*}
-    {\:}_i^k{\mathbb{R}_{\mathrm{ML}}}_{\,1/2}^{-1/2} &=
-                                                        \frac{{z_w}_{k-1/2}}{{z_{\mathrm{base}}}_{\,i}}{\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,1/2}^{-1/2} \\
-    \intertext{and more generally}
-    {\:}_i^k{\mathbb{R}_{\mathrm{ML}}}_{\,i_p}^{k_p} &=
-                                                       \frac{{z_w}_{k+k_p}}{{z_{\mathrm{base}}}_{\,i}}{\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p}.
-                                                       % \label{eq:RML}
-  \end{align*}
-\end{enumerate}
-
-% >>>>>>>>>>>>>>>>>>>>>>>>>>>>
-\begin{figure}[h]
-%  \fcapside {
-  \caption{
-    \protect\label{fig:MLB_triad}
-    Definition of mixed-layer depth and calculation of linearly tapered triads.
-    The figure shows a water column at a given $i,j$ (simplified to $i$), with the ocean surface at the top.
-    Tracer points are denoted by bullets, and black lines the edges of the tracer cells;
-    $k$ increases upwards.
-    \newline
-    \hspace{5 em}
-    We define the mixed-layer by setting the vertical index of the tracer point immediately below the mixed layer,
-    $k_{\mathrm{ML}}$, as the maximum $k$ (shallowest tracer point) such that
-    ${\rho_0}_{i,k}>{\rho_0}_{i,k_{10}}+\Delta\rho_c$,
-    where $i,k_{10}$ is the tracer gridbox within which the depth reaches 10~m.
-    We calculate the triad slopes within the mixed layer by linearly tapering them from zero
-    (at the surface) to the `basal' slopes,
-    the slopes of the four triads passing through the $w$-point $i,k_{\mathrm{ML}}-1/2$ (blue square),
-    ${\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p}$.
-    Triads with different $i_p,k_p$, denoted by different colours,
-    (\eg\ the green triad $i_p=1/2,k_p=-1/2$) are tapered to the appropriate basal triad.}
-  % }
-  \includegraphics[width=\textwidth]{Fig_GRIFF_MLB_triads}
-\end{figure}
-% >>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-\subsubsection{Additional truncation of skew iso-neutral flux components}
-\label{subsec:Gerdes-taper}
-
-The alternative option is activated by setting \np{ln\_triad\_iso} = true.
-This retains the same tapered slope $\rML$  described above for the calculation of the $_{33}$ term of
-the iso-neutral diffusion tensor (the vertical tracer flux driven by vertical tracer gradients),
-but replaces the $\rML$ in the skew term by
-\begin{equation}
-  \label{eq:rm*}
-  \rML^*=\left.\rMLt^2\right/\tilde{r}_i-\sigma_i,
-\end{equation}
-giving a ML diffusive operator
-\[
-  % \label{eq:iso_tensor_ML2}
-  D^{lT}=\nabla {\mathrm {\mathbf .}}\left( {A^{lT}\;\Re \;\nabla T} \right) \qquad
-  \mbox{with}\quad \;\;\Re =\left( {{
-        \begin{array}{*{20}c}
-          1 \hfill & 0 \hfill & {-\rML[1]^*}\hfill \\
-          0 \hfill & 1 \hfill & {-\rML[2]^*} \hfill \\
-          {-\rML[1]^*}\hfill &   {-\rML[2]^*} \hfill & {\rML[1]^2+\rML[2]^2} \hfill \\
-        \end{array}
-      }} \right).
-\]
-This operator
-\footnote{
-  To ensure good behaviour where horizontal density gradients are weak,
-  we in fact follow \citet{gerdes.koberle.ea_CD91} and
-  set $\rML^*=\mathrm{sgn}(\tilde{r}_i)\min(|\rMLt^2/\tilde{r}_i|,|\tilde{r}_i|)-\sigma_i$.
-}
-then has the property it gives no vertical density flux, and so does not change the potential energy.
-This approach is similar to multiplying the iso-neutral diffusion coefficient by
-$\tilde{r}_{\mathrm{max}}^{-2}\tilde{r}_i^{-2}$ for steep slopes,
-as suggested by \citet{gerdes.koberle.ea_CD91} (see also \citet{griffies_bk04}).
-Again it is applied separately to each triad $_i^k\mathbb{R}_{i_p}^{k_p}$
-
-In practice, this approach gives weak vertical tracer fluxes through the mixed-layer,
-as well as vanishing density fluxes.
-While it is theoretically advantageous that it does not change the potential energy,
-it may give a discontinuity between the fluxes within the mixed-layer (purely horizontal) and
-just below (along iso-neutral surfaces).
-% This may give strange looking results,
-% particularly where the mixed-layer depth varies strongly laterally.
-% ================================================================
-% Skew flux formulation for Eddy Induced Velocity :
-% ================================================================
-\section{Eddy induced advection formulated as a skew flux}
-\label{sec:skew-flux}
-
-\subsection{Continuous skew flux formulation}
-\label{sec:continuous-skew-flux}
-
-When Gent and McWilliams's [1990] diffusion is used, an additional advection term is added.
-The associated velocity is the so called eddy induced velocity,
-the formulation of which depends on the slopes of iso-neutral surfaces.
-Contrary to the case of iso-neutral mixing, the slopes used here are referenced to the geopotential surfaces,
-\ie\ \autoref{eq:ldfslp_geo} is used in $z$-coordinate,
-and the sum \autoref{eq:ldfslp_geo} + \autoref{eq:ldfslp_iso} in $z^*$ or $s$-coordinates.
-
-The eddy induced velocity is given by:
-\begin{subequations}
-  % \label{eq:eiv}
-  \begin{equation}
-    \label{eq:eiv_v}
-    \begin{split}
-      u^* & = - \frac{1}{e_{3}}\;          \partial_i\psi_1,  \\
-      v^* & = - \frac{1}{e_{3}}\;          \partial_j\psi_2,    \\
-      w^* & =    \frac{1}{e_{1}e_{2}}\; \left\{ \partial_i  \left( e_{2} \, \psi_1\right)
-        + \partial_j  \left( e_{1} \, \psi_2\right) \right\},
-    \end{split}
-  \end{equation}
-  where the streamfunctions $\psi_i$ are given by
-  \begin{equation}
-    \label{eq:eiv_psi}
-    \begin{split}
-      \psi_1 & = A_{e} \; \tilde{r}_1,   \\
-      \psi_2 & = A_{e} \; \tilde{r}_2,
-    \end{split}
-  \end{equation}
-\end{subequations}
-with $A_{e}$ the eddy induced velocity coefficient,
-and $\tilde{r}_1$ and $\tilde{r}_2$ the slopes between the iso-neutral and the geopotential surfaces.
-
-The traditional way to implement this additional advection is to add it to the Eulerian velocity prior to
-computing the tracer advection.
-This is implemented if \texttt{traldf\_eiv?} is set in the default implementation,
-where \np{ln\_traldf\_triad} is set false.
-This allows us to take advantage of all the advection schemes offered for the tracers
-(see \autoref{sec:TRA_adv}) and not just a $2^{nd}$ order advection scheme.
-This is particularly useful for passive tracers where
-\emph{positivity} of the advection scheme is of paramount importance.
-
-However, when \np{ln\_traldf\_triad} is set true,
-\NEMO\ instead implements eddy induced advection according to the so-called skew form \citep{griffies_JPO98}.
-It is based on a transformation of the advective fluxes using the non-divergent nature of the eddy induced velocity.
-For example in the (\textbf{i},\textbf{k}) plane,
-the tracer advective fluxes per unit area in $ijk$ space can be transformed as follows:
-\begin{flalign*}
-  \begin{split}
-    \textbf{F}_{\mathrm{eiv}}^T =
-    \begin{pmatrix}
-      {e_{2}\,e_{3}\;  u^*} \\
- 		{e_{1}\,e_{2}\; w^*}
-    \end{pmatrix}   \;   T
-    &=
-    \begin{pmatrix}
-      { - \partial_k \left( e_{2} \,\psi_1 \right) \; T \;} \\
- 		{+ \partial_i  \left( e_{2} \, \psi_1 \right) \; T \;}
-    \end{pmatrix} 			\\
-    &=
-    \begin{pmatrix}
-      { - \partial_k \left( e_{2} \, \psi_1  \; T \right) \;} \\
- 		{+ \partial_i  \left( e_{2} \,\psi_1 \; T \right) \;}
-    \end{pmatrix}
-    +
-    \begin{pmatrix}
-      {+ e_{2} \, \psi_1  \; \partial_k T} \\
- 		{ - e_{2} \, \psi_1  \; \partial_i  T}
-    \end{pmatrix}
-  \end{split}
-\end{flalign*}
-and since the eddy induced velocity field is non-divergent,
-we end up with the skew form of the eddy induced advective fluxes per unit area in $ijk$ space:
-\begin{equation}
-  \label{eq:eiv_skew_ijk}
-  \textbf{F}_\mathrm{eiv}^T =
-  \begin{pmatrix}
-    {+ e_{2} \, \psi_1  \; \partial_k T}   \\
-    { - e_{2} \, \psi_1  \; \partial_i  T}
-  \end{pmatrix}
-\end{equation}
-The total fluxes per unit physical area are then
-\begin{equation}
-  \label{eq:eiv_skew_physical}
-  \begin{split}
-    f^*_1 & = \frac{1}{e_{3}}\; \psi_1 \partial_k T   \\
-    f^*_2 & = \frac{1}{e_{3}}\; \psi_2 \partial_k T   \\
-    f^*_3 & =  -\frac{1}{e_{1}e_{2}}\; \left\{ e_{2} \psi_1 \partial_i T + e_{1} \psi_2 \partial_j T \right\}.
-\end{split}
-\end{equation}
-Note that \autoref{eq:eiv_skew_physical} takes the same form whatever the vertical coordinate,
-though of course the slopes $\tilde{r}_i$ which define the $\psi_i$ in \autoref{eq:eiv_psi} are relative to
-geopotentials.
-The tendency associated with eddy induced velocity is then simply the convergence of the fluxes
-(\autoref{eq:eiv_skew_ijk}, \autoref{eq:eiv_skew_physical}), so
-\[
-  % \label{eq:skew_eiv_conv}
-  \frac{\partial T}{\partial t}= -\frac{1}{e_1 \, e_2 \, e_3 }      \left[
-    \frac{\partial}{\partial i} \left( e_2 \psi_1 \partial_k T\right)
-    + \frac{\partial}{\partial j} \left( e_1  \;
-      \psi_2 \partial_k T\right)
-    -  \frac{\partial}{\partial k} \left( e_{2} \psi_1 \partial_i T
-      + e_{1} \psi_2 \partial_j T \right)  \right]
-\]
-It naturally conserves the tracer content, as it is expressed in flux form.
-Since it has the same divergence as the advective form it also preserves the tracer variance.
-
-\subsection{Discrete skew flux formulation}
-
-The skew fluxes in (\autoref{eq:eiv_skew_physical}, \autoref{eq:eiv_skew_ijk}),
-like the off-diagonal terms (\autoref{eq:i13c}, \autoref{eq:i31c}) of the small angle diffusion tensor,
-are best expressed in terms of the triad slopes, as in \autoref{fig:ISO_triad} and
-(\autoref{eq:i13}, \autoref{eq:i31});
-but now in terms of the triad slopes $\tilde{\mathbb{R}}$ relative to geopotentials instead of
-the $\mathbb{R}$ relative to coordinate surfaces.
-The discrete form of \autoref{eq:eiv_skew_ijk} using the slopes \autoref{eq:R} and
-defining $A_e$ at $T$-points is then given by:
-
-\begin{subequations}
-  % \label{eq:allskewflux}
-  \begin{flalign*}
-    % \label{eq:vect_skew_flux}
-    \vect{F}_{\mathrm{eiv}}(T) &\equiv    \sum_{\substack{i_p,\,k_p}}
-    \begin{pmatrix}
-      {_{i+1/2-i_p}^k {\mathbb{S}_u}_{i_p}^{k_p} } (T)      \\      \\
-      {_i^{k+1/2-k_p} {\mathbb{S}_w}_{i_p}^{k_p} } (T)      \\
-    \end{pmatrix},
-  \end{flalign*}
-  where the skew flux in the $i$-direction associated with a given triad is (\autoref{eq:latflux-triad},
-  \autoref{eq:triadfluxu}):
-  \begin{align}
-    \label{eq:skewfluxu}
-    _i^k {\mathbb{S}_u}_{i_p}^{k_p} (T) &= + \fractext{1}{4} {A_e}_i^k{
-                                          \:}\frac{{b_u}_{i+i_p}^k}{{e_{1u}}_{\,i + i_p}^{\,k}}
-                                          \ {_i^k\tilde{\mathbb{R}}_{i_p}^{k_p}} \
-                                          \frac{ \delta_{k+k_p} [T^i] }{{e_{3w}}_{\,i}^{\,k+k_p} }, \\
-    \intertext{
-    and \autoref{eq:triadfluxw} in the $k$-direction, changing the sign
-    to be consistent with \autoref{eq:eiv_skew_ijk}:
-    }
-    _i^k {\mathbb{S}_w}_{i_p}^{k_p} (T)
-                                        &= -\fractext{1}{4} {A_e}_i^k{\: }\frac{{b_u}_{i+i_p}^k}{{e_{3w}}_{\,i}^{\,k+k_p}}
-                                          {_i^k\tilde{\mathbb{R}}_{i_p}^{k_p}}\frac{ \delta_{i+ i_p}[T^k] }{ {e_{1u}}_{\,i + i_p}^{\,k} }.\label{eq:skewfluxw}
-  \end{align}
-\end{subequations}
-
-Such a discretisation is consistent with the iso-neutral operator as it uses the same definition for the slopes.
-It also ensures the following two key properties.
-
-\subsubsection{No change in tracer variance}
-
-The discretization conserves tracer variance, \ie\ it does not include a diffusive component but is a `pure' advection term.
-This can be seen %either from Appendix \autoref{apdx:eiv_skew} or
-by considering the fluxes associated with a given triad slope $_i^k{\mathbb{R}}_{i_p}^{k_p} (T)$.
-For, following \autoref{subsec:variance} and \autoref{eq:dvar_iso_i},
-the associated horizontal skew-flux $_i^k{\mathbb{S}_u}_{i_p}^{k_p} (T)$ drives a net rate of change of variance,
-summed over the two $T$-points $i+i_p-\fractext{1}{2},k$ and $i+i_p+\fractext{1}{2},k$, of
-\begin{equation}
-  \label{eq:dvar_eiv_i}
-  _i^k{\mathbb{S}_u}_{i_p}^{k_p} (T)\,\delta_{i+ i_p}[T^k],
-\end{equation}
-while the associated vertical skew-flux gives a variance change summed over
-the $T$-points $i,k+k_p-\fractext{1}{2}$ (above) and $i,k+k_p+\fractext{1}{2}$ (below) of
-\begin{equation}
-  \label{eq:dvar_eiv_k}
-  _i^k{\mathbb{S}_w}_{i_p}^{k_p} (T) \,\delta_{k+ k_p}[T^i].
-\end{equation}
-Inspection of the definitions (\autoref{eq:skewfluxu}, \autoref{eq:skewfluxw}) shows that
-these two variance changes (\autoref{eq:dvar_eiv_i}, \autoref{eq:dvar_eiv_k}) sum to zero.
-Hence the two fluxes associated with each triad make no net contribution to the variance budget.
-
-\subsubsection{Reduction in gravitational PE}
-
-The vertical density flux associated with the vertical skew-flux always has the same sign as
-the vertical density gradient;
-thus, so long as the fluid is stable (the vertical density gradient is negative)
-the vertical density flux is negative (downward) and hence reduces the gravitational PE.
-
-For the change in gravitational PE driven by the $k$-flux is
-\begin{align}
-  \label{eq:vert_densityPE}
-  g {e_{3w}}_{\,i}^{\,k+k_p}{\mathbb{S}_w}_{i_p}^{k_p} (\rho)
-  &=g {e_{3w}}_{\,i}^{\,k+k_p}\left[-\alpha _i^k {\:}_i^k
-    {\mathbb{S}_w}_{i_p}^{k_p} (T) + \beta_i^k {\:}_i^k
-    {\mathbb{S}_w}_{i_p}^{k_p} (S) \right]. \notag \\
-  \intertext{Substituting  ${\:}_i^k {\mathbb{S}_w}_{i_p}^{k_p}$ from \autoref{eq:skewfluxw}, gives}
-  % and separating out
-  % $\rtriadt{R}=\rtriad{R} + \delta_{i+i_p}[z_T^k]$,
-  % gives two terms. The
-  % first $\rtriad{R}$ term (the only term for $z$-coordinates) is:
-  &=-\fractext{1}{4} g{A_e}_i^k{\: }{b_u}_{i+i_p}^k {_i^k\tilde{\mathbb{R}}_{i_p}^{k_p}}
-    \frac{ -\alpha _i^k\delta_{i+ i_p}[T^k]+ \beta_i^k\delta_{i+ i_p}[S^k]} { {e_{1u}}_{\,i + i_p}^{\,k} } \notag \\
-  &=+\fractext{1}{4} g{A_e}_i^k{\: }{b_u}_{i+i_p}^k
-    \left({_i^k\mathbb{R}_{i_p}^{k_p}}+\frac{\delta_{i+i_p}[z_T^k]}{{e_{1u}}_{\,i + i_p}^{\,k}}\right) {_i^k\mathbb{R}_{i_p}^{k_p}}
-    \frac{-\alpha_i^k \delta_{k+ k_p}[T^i]+ \beta_i^k\delta_{k+ k_p}[S^i]} {{e_{3w}}_{\,i}^{\,k+k_p}},
-\end{align}
-using the definition of the triad slope $\rtriad{R}$, \autoref{eq:R} to
-express $-\alpha _i^k\delta_{i+ i_p}[T^k]+\beta_i^k\delta_{i+ i_p}[S^k]$ in terms of
-$-\alpha_i^k \delta_{k+ k_p}[T^i]+ \beta_i^k\delta_{k+ k_p}[S^i]$.
-
-Where the coordinates slope, the $i$-flux gives a PE change
-\begin{multline}
-  \label{eq:lat_densityPE}
-  g \delta_{i+i_p}[z_T^k]
-  \left[
-    -\alpha _i^k {\:}_i^k {\mathbb{S}_u}_{i_p}^{k_p} (T) + \beta_i^k {\:}_i^k {\mathbb{S}_u}_{i_p}^{k_p} (S)
-  \right] \\
-  = +\fractext{1}{4} g{A_e}_i^k{\: }{b_u}_{i+i_p}^k
-  \frac{\delta_{i+i_p}[z_T^k]}{{e_{1u}}_{\,i + i_p}^{\,k}}
-  \left({_i^k\mathbb{R}_{i_p}^{k_p}}+\frac{\delta_{i+i_p}[z_T^k]}{{e_{1u}}_{\,i + i_p}^{\,k}}\right)
-  \frac{-\alpha_i^k \delta_{k+ k_p}[T^i]+ \beta_i^k\delta_{k+ k_p}[S^i]} {{e_{3w}}_{\,i}^{\,k+k_p}},
-\end{multline}
-(using \autoref{eq:skewfluxu}) and so the total PE change \autoref{eq:vert_densityPE} +
-\autoref{eq:lat_densityPE} associated with the triad fluxes is
-\begin{multline*}
-  % \label{eq:tot_densityPE}
-  g{e_{3w}}_{\,i}^{\,k+k_p}{\mathbb{S}_w}_{i_p}^{k_p} (\rho) +
-  g\delta_{i+i_p}[z_T^k] {\:}_i^k {\mathbb{S}_u}_{i_p}^{k_p} (\rho) \\
-  = +\fractext{1}{4} g{A_e}_i^k{\: }{b_u}_{i+i_p}^k
-  \left({_i^k\mathbb{R}_{i_p}^{k_p}}+\frac{\delta_{i+i_p}[z_T^k]}{{e_{1u}}_{\,i + i_p}^{\,k}}\right)^2
-  \frac{-\alpha_i^k \delta_{k+ k_p}[T^i]+ \beta_i^k\delta_{k+ k_p}[S^i]} {{e_{3w}}_{\,i}^{\,k+k_p}}.
-\end{multline*}
-Where the fluid is stable, with $-\alpha_i^k \delta_{k+ k_p}[T^i]+
-\beta_i^k\delta_{k+ k_p}[S^i]<0$, this PE change is negative.
-
-\subsection{Treatment of the triads at the boundaries}
-\label{sec:skew_bdry}
-
-Triad slopes \rtriadt{R} used for the calculation of the eddy-induced skew-fluxes are masked at the boundaries 
-in exactly the same way as are the triad slopes \rtriad{R} used for the iso-neutral diffusive fluxes, 
-as described in \autoref{sec:iso_bdry} and \autoref{fig:bdry_triads}. 
-Thus surface layer triads $\triadt{i}{1}{R}{1/2}{-1/2}$ and $\triadt{i+1}{1}{R}{-1/2}{-1/2}$ are masked, 
-and both near bottom triad slopes $\triadt{i}{k}{R}{1/2}{1/2}$ and $\triadt{i+1}{k}{R}{-1/2}{1/2}$ are masked when 
-either of the $i,k+1$ or $i+1,k+1$ tracer points is masked, \ie\ the $i,k+1$ $u$-point is masked. 
-The namelist parameter \np{ln\_botmix\_triad} has no effect on the eddy-induced skew-fluxes.
-
-\subsection{Limiting of the slopes within the interior}
-\label{sec:limitskew}
-
-Presently, the iso-neutral slopes $\tilde{r}_i$ relative to geopotentials are limited to be less than $1/100$, 
-exactly as in calculating the iso-neutral diffusion, \S \autoref{sec:limit}. 
-Each individual triad \rtriadt{R} is so limited.
-
-\subsection{Tapering within the surface mixed layer}
-\label{sec:taperskew}
-
-The slopes $\tilde{r}_i$ relative to geopotentials (and thus the individual triads \rtriadt{R}) 
-are always tapered linearly from their value immediately below the mixed layer to zero at the surface 
-\autoref{eq:rmtilde}, as described in \autoref{sec:lintaper}. 
-This is option (c) of \autoref{fig:eiv_slp}. 
-This linear tapering for the slopes used to calculate the eddy-induced fluxes is unaffected by 
-the value of \np{ln\_triad\_iso}.
-
-The justification for this linear slope tapering is that, for $A_e$ that is constant or varies only in
-the horizontal (the most commonly used options in \NEMO: see \autoref{sec:LDF_coef}),
-it is equivalent to a horizontal eiv (eddy-induced velocity) that is uniform within the mixed layer
-\autoref{eq:eiv_v}.
-This ensures that the eiv velocities do not restratify the mixed layer \citep{treguier.held.ea_JPO97,danabasoglu.ferrari.ea_JC08}.
-Equivantly, in terms of the skew-flux formulation we use here,
-the linear slope tapering within the mixed-layer gives a linearly varying vertical flux,
-and so a tracer convergence uniform in depth
-(the horizontal flux convergence is relatively insignificant within the mixed-layer).
-
-\subsection{Streamfunction diagnostics}
-\label{sec:sfdiag}
-
-Where the namelist parameter \np{ln\_traldf\_gdia}\forcode{ = .true.},
-diagnosed mean eddy-induced velocities are output.
-Each time step, streamfunctions are calculated in the $i$-$k$ and $j$-$k$ planes at
-$uw$ (integer +1/2 $i$, integer $j$, integer +1/2 $k$) and $vw$ (integer $i$, integer +1/2 $j$, integer +1/2 $k$)
-points (see Table \autoref{tab:cell}) respectively.
-We follow \citep{griffies_bk04} and calculate the streamfunction at a given $uw$-point from
-the surrounding four triads according to:
-\[
-  % \label{eq:sfdiagi}
-  {\psi_1}_{i+1/2}^{k+1/2}={\fractext{1}{4}}\sum_{\substack{i_p,\,k_p}}
-  {A_e}_{i+1/2-i_p}^{k+1/2-k_p}\:\triadd{i+1/2-i_p}{k+1/2-k_p}{R}{i_p}{k_p}.
-\]
-The streamfunction $\psi_1$ is calculated similarly at $vw$ points.
-The eddy-induced velocities are then calculated from the straightforward discretisation of \autoref{eq:eiv_v}:
-\[
-  % \label{eq:eiv_v_discrete}
-  \begin{split}
-    {u^*}_{i+1/2}^{k} & = - \frac{1}{{e_{3u}}_{i}^{k}}\left({\psi_1}_{i+1/2}^{k+1/2}-{\psi_1}_{i+1/2}^{k+1/2}\right),   \\
-    {v^*}_{j+1/2}^{k} & = - \frac{1}{{e_{3v}}_{j}^{k}}\left({\psi_2}_{j+1/2}^{k+1/2}-{\psi_2}_{j+1/2}^{k+1/2}\right),   \\
-    {w^*}_{i,j}^{k+1/2} & =    \frac{1}{e_{1t}e_{2t}}\; \left\{
-      {e_{2u}}_{i+1/2}^{k+1/2} \,{\psi_1}_{i+1/2}^{k+1/2} -
-      {e_{2u}}_{i-1/2}^{k+1/2} \,{\psi_1}_{i-1/2}^{k+1/2} \right. + \\
-    \phantom{=} & \qquad\qquad\left. {e_{2v}}_{j+1/2}^{k+1/2} \,{\psi_2}_{j+1/2}^{k+1/2} - {e_{2v}}_{j-1/2}^{k+1/2} \,{\psi_2}_{j-1/2}^{k+1/2} \right\},
-  \end{split}
-\]
-
-\biblio
-
-\pindex
-
-\end{document}
Index: /NEMO/trunk/doc/latex/NEMO/subfiles/apdx_DOMAINcfg.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/subfiles/apdx_DOMAINcfg.tex	(revision 11543)
+++ /NEMO/trunk/doc/latex/NEMO/subfiles/apdx_DOMAINcfg.tex	(revision 11543)
@@ -0,0 +1,563 @@
+\documentclass[../main/NEMO_manual]{subfiles}
+
+\begin{document}
+% ================================================================
+% Appendix DOMAINcfg : A brief guide to the DOMAINcfg tool
+% ================================================================
+\chapter{A brief guide to the DOMAINcfg tool}
+\label{apdx:DOMCFG}
+
+\chaptertoc
+\vfill
+\begin{figure}[b]
+\subsubsection*{Changes record}
+\begin{tabular}{m{0.08\linewidth}||m{0.32\linewidth}|m{0.6\linewidth}}
+    Release   & Author(s)     & Modifications \\
+\hline
+    {\em 4.0} & {\em Andrew Coward} & {\em Created at v4.0 from materials removed from chap\_DOM that are still relevant to the \forcode{DOMAINcfg} tool and which illustrate and explain the choices to be made by the user when setting up new domains }  \\
+\end{tabular}
+\end{figure}
+
+\newpage
+
+This appendix briefly describes some of the options available in the
+\forcode{DOMAINcfg} tool mentioned in \autoref{chap:DOM}.
+
+This tool will evolve into an independent utility with its own documentation but its
+current manifestation is mostly a wrapper for \NEMO\ \forcode{DOM} modules more aligned to
+those in the previous versions of \NEMO. These versions allowed the user to define some
+horizontal and vertical grids through additional namelist parameters. Explanations of
+these parameters are retained here for reference pending better documentation for
+\forcode{DOMAINcfg}. Please note that the namelist blocks named in this appendix refer to
+those read by \forcode{DOMAINcfg} via its own \forcode{namelist_ref} and
+\forcode{namelist_cfg} files. Although, due to their origins, these namelists share names
+with those used by \NEMO, they are not interchangeable and should be considered independent
+of those described elsewhere in this manual.
+
+% -------------------------------------------------------------------------------------------------------------
+%        Choice of horizontal grid
+% -------------------------------------------------------------------------------------------------------------
+\section{Choice of horizontal grid}
+\label{sec:DOMCFG_hor}
+
+%--------------------------------------------namdom-------------------------------------------------------
+
+\nlst{namdom_domcfg}
+%--------------------------------------------------------------------------------------------------------------
+
+The user has three options available in defining a horizontal grid, which involve the
+namelist variable \np{jphgr\_mesh} of the \nam{dom} (\texttt{DOMAINcfg} variant only)
+namelist.
+
+\begin{description}
+ \item[\np{jphgr\_mesh}=0]  The most general curvilinear orthogonal grids.
+  The coordinates and their first derivatives with respect to $i$ and $j$ are provided
+  in a input file (\ifile{coordinates}), read in \rou{hgr\_read} subroutine of the domhgr module.
+  This is now the only option available within \NEMO\ itself from v4.0 onwards.
+\item[\np{jphgr\_mesh}=1 to 5] A few simple analytical grids are provided (see below).
+  For other analytical grids, the \mdl{domhgr} module (\texttt{DOMAINcfg} variant) must be
+  modified by the user. In most cases, modifying the \mdl{usrdef\_hgr} module of \NEMO\ is
+  a better alternative since this is designed to allow simple analytical domains to be
+  configured and used without the need for external data files.
+\end{description}
+
+There are two simple cases of geographical grids on the sphere. With
+\np{jphgr\_mesh}=1, the grid (expressed in degrees) is regular in space,
+with grid sizes specified by parameters \np{ppe1\_deg} and \np{ppe2\_deg},
+respectively. Such a geographical grid can be very anisotropic at high latitudes
+because of the convergence of meridians (the zonal scale factors $e_1$
+become much smaller than the meridional scale factors $e_2$). The Mercator
+grid (\np{jphgr\_mesh}=4) avoids this anisotropy by refining the meridional scale
+factors in the same way as the zonal ones. In this case, meridional scale factors
+and latitudes are calculated analytically using the formulae appropriate for
+a Mercator projection, based on \np{ppe1\_deg} which is a reference grid spacing
+at the equator (this applies even when the geographical equator is situated outside
+the model domain).
+
+In these two cases (\np{jphgr\_mesh}=1 or 4), the grid position is defined by the
+longitude and latitude of the south-westernmost point (\np{ppglamt0}
+and \np{ppgphi0}). Note that for the Mercator grid the user need only provide
+an approximate starting latitude: the real latitude will be recalculated analytically,
+in order to ensure that the equator corresponds to line passing through $t$-
+and $u$-points.
+
+Rectangular grids ignoring the spherical geometry are defined with
+\np{jphgr\_mesh} = 2, 3, 5. The domain is either an $f$-plane (\np{jphgr\_mesh} = 2,
+Coriolis factor is constant) or a beta-plane (\np{jphgr\_mesh} = 3, the Coriolis factor
+is linear in the $j$-direction). The grid size is uniform in meter in each direction,
+and given by the parameters \np{ppe1\_m} and \np{ppe2\_m} respectively.
+The zonal grid coordinate (\textit{glam} arrays) is in kilometers, starting at zero
+with the first $t$-point. The meridional coordinate (gphi. arrays) is in kilometers,
+and the second $t$-point corresponds to coordinate $gphit=0$. The input
+variable \np{ppglam0} is ignored. \np{ppgphi0} is used to set the reference
+latitude for computation of the Coriolis parameter. In the case of the beta plane,
+\np{ppgphi0} corresponds to the center of the domain. Finally, the special case
+\np{jphgr\_mesh}=5 corresponds to a beta plane in a rotated domain for the
+GYRE configuration, representing a classical mid-latitude double gyre system.
+The rotation allows us to maximize the jet length relative to the gyre areas
+(and the number of grid points).
+
+% -------------------------------------------------------------------------------------------------------------
+%        vertical reference coordinate transformation
+% -------------------------------------------------------------------------------------------------------------
+\section{Vertical grid}
+\label{sec:DOMCFG_vert}
+\subsection{Vertical reference coordinate}
+\label{sec:DOMCFG_zref}
+
+%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+\begin{figure}[!tb]
+  \begin{center}
+    \includegraphics[width=\textwidth]{Fig_zgr}
+    \caption{
+      \protect\label{fig:DOMCFG_zgr}
+      Default vertical mesh for ORCA2: 30 ocean levels (L30).
+      Vertical level functions for (a) T-point depth and (b) the associated scale factor for the $z$-coordinate case.
+    }
+  \end{center}
+\end{figure}
+%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+
+The reference coordinate transformation $z_0(k)$ defines the arrays $gdept_0$ and
+$gdepw_0$ for $t$- and $w$-points, respectively. See \autoref{sec:DOMCFG_sco} for the
+S-coordinate options.  As indicated on \autoref{fig:DOM_index_vert} \jp{jpk} is the number of
+$w$-levels.  $gdepw_0(1)$ is the ocean surface.  There are at most \jp{jpk}-1 $t$-points
+inside the ocean, the additional $t$-point at $jk = jpk$ is below the sea floor and is not
+used.  The vertical location of $w$- and $t$-levels is defined from the analytic
+expression of the depth $z_0(k)$ whose analytical derivative with respect to $k$ provides
+the vertical scale factors.  The user must provide the analytical expression of both $z_0$
+and its first derivative with respect to $k$.  This is done in routine \mdl{domzgr}
+through statement functions, using parameters provided in the \nam{dom} namelist
+(\texttt{DOMAINcfg} variant).
+
+It is possible to define a simple regular vertical grid by giving zero stretching
+(\np{ppacr}\forcode{ = 0}).  In that case, the parameters \jp{jpk} (number of $w$-levels)
+and \np{pphmax} (total ocean depth in meters) fully define the grid.
+
+For climate-related studies it is often desirable to concentrate the vertical resolution
+near the ocean surface.  The following function is proposed as a standard for a
+$z$-coordinate (with either full or partial steps):
+\begin{gather}
+  \label{eq:DOMCFG_zgr_ana_1}
+    z_0  (k) = h_{sur} - h_0 \; k - \; h_1 \; \log  \big[ \cosh ((k - h_{th}) / h_{cr}) \big] \\
+    e_3^0(k) = \lt|    - h_0      -    h_1 \; \tanh \big[        (k - h_{th}) / h_{cr}  \big] \rt|
+\end{gather}
+
+where $k = 1$ to \jp{jpk} for $w$-levels and $k = 1$ to $k = 1$ for $t-$levels.  Such an
+expression allows us to define a nearly uniform vertical location of levels at the ocean
+top and bottom with a smooth hyperbolic tangent transition in between (\autoref{fig:DOMCFG_zgr}).
+
+A double hyperbolic tangent version (\np{ldbletanh}\forcode{ = .true.}) is also available
+which permits finer control and is used, typically, to obtain a well resolved upper ocean
+without compromising on resolution at depth using a moderate number of levels.
+
+\begin{gather}
+  \label{eq:DOMCFG_zgr_ana_1b}
+    \begin{split}
+    z_0  (k) = h_{sur} - h_0 \; k &- \; h_1 \; \log  \big[ \cosh ((k - h_{th}) / h_{cr}) \big] \\
+                             \;   &- \; h2_1 \; \log  \big[ \cosh ((k - h2_{th}) / h2_{cr}) \big]
+    \end{split}
+\end{gather}
+\begin{gather}
+    \begin{split}
+    e_3^0(k) = \big|    - h_0    &-   h_1 \; \tanh \big[       (k - h_{th})  / h_{cr}   \big]  \\
+                                 &-  h2_1 \; \tanh \big[       (k - h2_{th}) / h2_{cr}  \big] \big|
+    \end{split}
+\end{gather}
+
+If the ice shelf cavities are opened (\np{ln\_isfcav}\forcode{ = .true.}), the definition
+of $z_0$ is the same.  However, definition of $e_3^0$ at $t$- and $w$-points is
+respectively changed to:
+\begin{equation}
+  \label{eq:DOMCFG_zgr_ana_2}
+  \begin{split}
+    e_3^T(k) &= z_W (k + 1) - z_W (k    ) \\
+    e_3^W(k) &= z_T (k    ) - z_T (k - 1)
+  \end{split}
+\end{equation}
+
+This formulation decreases the self-generated circulation into the ice shelf cavity
+(which can, in extreme case, leads to numerical instability). This is now the recommended formulation for all configurations using v4.0 onwards. The analytical derivation of thicknesses is maintained for backwards compatibility.
+
+The most used vertical grid for ORCA2 has $10~m$ ($500~m$) resolution in the surface
+(bottom) layers and a depth which varies from 0 at the sea surface to a minimum of
+$-5000~m$.  This leads to the following conditions:
+
+\begin{equation}
+  \label{eq:DOMCFG_zgr_coef}
+  \begin{array}{ll}
+    e_3 (1   + 1/2) =  10. & z(1  ) =     0. \\
+    e_3 (jpk - 1/2) = 500. & z(jpk) = -5000.
+  \end{array}
+\end{equation}
+
+With the choice of the stretching $h_{cr} = 3$ and the number of levels \jp{jpk}~$= 31$,
+the four coefficients $h_{sur}$, $h_0$, $h_1$, and $h_{th}$ in
+\autoref{eq:DOMCFG_zgr_ana_2} have been determined such that \autoref{eq:DOMCFG_zgr_coef}
+is satisfied, through an optimisation procedure using a bisection method.
+For the first standard ORCA2 vertical grid this led to the following values:
+$h_{sur} = 4762.96$, $h_0 = 255.58, h_1 = 245.5813$, and $h_{th} = 21.43336$.
+The resulting depths and scale factors as a function of the model levels are shown in
+\autoref{fig:DOMCFG_zgr} and given in \autoref{tab:DOMCFG_orca_zgr}.
+Those values correspond to the parameters \np{ppsur}, \np{ppa0}, \np{ppa1}, \np{ppkth} in \nam{cfg} namelist.
+
+Rather than entering parameters $h_{sur}$, $h_0$, and $h_1$ directly, it is possible to
+recalculate them.  In that case the user sets \np{ppsur}~$=$~\np{ppa0}~$=$~\np{ppa1}~$=
+999999$., in \nam{cfg} namelist, and specifies instead the four following parameters:
+\begin{itemize}
+\item
+  \np{ppacr}~$= h_{cr}$: stretching factor (nondimensional).
+  The larger \np{ppacr}, the smaller the stretching.
+  Values from $3$ to $10$ are usual.
+\item
+  \np{ppkth}~$= h_{th}$: is approximately the model level at which maximum stretching occurs
+  (nondimensional, usually of order 1/2 or 2/3 of \jp{jpk})
+\item
+  \np{ppdzmin}: minimum thickness for the top layer (in meters).
+\item
+  \np{pphmax}: total depth of the ocean (meters).
+\end{itemize}
+
+As an example, for the $45$ layers used in the DRAKKAR configuration those parameters are:
+\jp{jpk}~$= 46$, \np{ppacr}~$= 9$, \np{ppkth}~$= 23.563$, \np{ppdzmin}~$= 6~m$,
+\np{pphmax}~$= 5750~m$.
+
+%% %>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+\begin{table}
+  \begin{center}
+    \begin{tabular}{c||r|r|r|r}
+      \hline
+      \textbf{LEVEL} & \textbf{gdept\_1d} & \textbf{gdepw\_1d} & \textbf{e3t\_1d } & \textbf{e3w\_1d} \\
+   \hline
+      1              & \textbf{     5.00} &               0.00 & \textbf{   10.00} &            10.00 \\
+      \hline
+      2              & \textbf{    15.00} &	            10.00 & \textbf{   10.00} &            10.00 \\
+      \hline
+      3              & \textbf{    25.00} &              20.00 & \textbf{   10.00} &            10.00 \\
+      \hline
+      4              & \textbf{    35.01} &	            30.00 & \textbf{   10.01} &            10.00 \\
+      \hline
+      5              & \textbf{    45.01} &              40.01 & \textbf{   10.01} &            10.01 \\
+      \hline
+      6              & \textbf{    55.03} &              50.02 & \textbf{   10.02} &            10.02 \\
+      \hline
+      7              & \textbf{    65.06} &              60.04 & \textbf{   10.04} &            10.03 \\
+      \hline
+      8              & \textbf{    75.13} &              70.09 & \textbf{   10.09} &            10.06 \\
+      \hline
+      9              & \textbf{    85.25} &              80.18 & \textbf{   10.17} &            10.12 \\
+      \hline
+      10             & \textbf{    95.49} &              90.35 & \textbf{   10.33} &            10.24 \\
+      \hline
+      11             & \textbf{   105.97} &             100.69 & \textbf{   10.65} &            10.47 \\
+      \hline
+      12             & \textbf{   116.90} &             111.36 & \textbf{   11.27} &            10.91 \\
+      \hline
+      13             & \textbf{   128.70} &             122.65 & \textbf{   12.47} &            11.77 \\
+      \hline
+      14             & \textbf{   142.20} &             135.16 & \textbf{   14.78} &            13.43 \\
+      \hline
+      15             & \textbf{   158.96} &             150.03 & \textbf{   19.23} &            16.65 \\
+      \hline
+      16             & \textbf{   181.96} &             169.42 & \textbf{   27.66} &            22.78 \\
+      \hline
+      17             & \textbf{   216.65} &             197.37 & \textbf{   43.26} &            34.30 \\
+      \hline
+      18             & \textbf{   272.48} &             241.13 & \textbf{   70.88} &            55.21 \\
+      \hline
+      19             & \textbf{   364.30} &             312.74 & \textbf{  116.11} &            90.99 \\
+      \hline
+      20             & \textbf{   511.53} &             429.72 & \textbf{  181.55} &           146.43 \\
+      \hline
+      21             & \textbf{   732.20} &             611.89 & \textbf{  261.03} &           220.35 \\
+      \hline
+      22             & \textbf{  1033.22} &             872.87 & \textbf{  339.39} &           301.42 \\
+      \hline
+      23             & \textbf{  1405.70} &            1211.59 & \textbf{  402.26} &           373.31 \\
+      \hline
+      24             & \textbf{  1830.89} &            1612.98 & \textbf{  444.87} &           426.00 \\
+      \hline
+      25             & \textbf{  2289.77} &            2057.13 & \textbf{  470.55} &           459.47 \\
+      \hline
+      26             & \textbf{  2768.24} &            2527.22 & \textbf{  484.95} &           478.83 \\
+      \hline
+      27             & \textbf{  3257.48} &            3011.90 & \textbf{  492.70} &           489.44 \\
+      \hline
+      28             & \textbf{  3752.44} &            3504.46 & \textbf{  496.78} &           495.07 \\
+      \hline
+      29             & \textbf{  4250.40} &            4001.16 & \textbf{  498.90} &           498.02 \\
+      \hline
+      30             & \textbf{  4749.91} &            4500.02 & \textbf{  500.00} &           499.54 \\
+      \hline
+      31             & \textbf{  5250.23} &            5000.00 & \textbf{  500.56} &           500.33 \\
+      \hline
+    \end{tabular}
+  \end{center}
+  \caption{
+    \protect\label{tab:DOMCFG_orca_zgr}
+    Default vertical mesh in $z$-coordinate for 30 layers ORCA2 configuration as computed from
+    \autoref{eq:DOMCFG_zgr_ana_2} using the coefficients given in \autoref{eq:DOMCFG_zgr_coef}
+  }
+\end{table}
+%%%YY
+%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+%% % -------------------------------------------------------------------------------------------------------------
+%% %        Meter Bathymetry
+%% % -------------------------------------------------------------------------------------------------------------
+\subsection{Model bathymetry}
+\label{subsec:DOMCFG_bathy}
+
+Three options are possible for defining the bathymetry, according to the namelist variable
+\np{nn\_bathy} (found in \nam{dom} namelist (\texttt{DOMAINCFG} variant) ):
+\begin{description}
+\item[\np{nn\_bathy}\forcode{ = 0}]:
+  a flat-bottom domain is defined.
+  The total depth $z_w (jpk)$ is given by the coordinate transformation.
+  The domain can either be a closed basin or a periodic channel depending on the parameter \np{jperio}.
+\item[\np{nn\_bathy}\forcode{ = -1}]:
+  a domain with a bump of topography one third of the domain width at the central latitude.
+  This is meant for the "EEL-R5" configuration, a periodic or open boundary channel with a seamount.
+\item[\np{nn\_bathy}\forcode{ = 1}]:
+  read a bathymetry and ice shelf draft (if needed).
+  The \ifile{bathy\_meter} file (Netcdf format) provides the ocean depth (positive, in meters) at
+  each grid point of the model grid.
+  The bathymetry is usually built by interpolating a standard bathymetry product (\eg\ ETOPO2) onto
+  the horizontal ocean mesh.
+  Defining the bathymetry also defines the coastline: where the bathymetry is zero,
+  no wet levels are defined (all levels are masked).
+
+  The \ifile{isfdraft\_meter} file (Netcdf format) provides the ice shelf draft (positive, in meters) at
+  each grid point of the model grid.
+  This file is only needed if \np{ln\_isfcav}\forcode{ = .true.}.
+  Defining the ice shelf draft will also define the ice shelf edge and the grounding line position.
+\end{description}
+
+\subsection{Choice of vertical grid}
+\label{sec:DOMCFG_vgrd}
+
+After reading the bathymetry, the algorithm for vertical grid definition differs between the different options:
+\begin{description}
+\item[\forcode{ln_zco = .true.}]
+  set a reference coordinate transformation $z_0(k)$, and set $z(i,j,k,t) = z_0(k)$ where $z_0(k)$ is the closest match to the depth at $(i,j)$.
+\item[\forcode{ln_zps = .true.}]
+  set a reference coordinate transformation $z_0(k)$, and calculate the thickness of the deepest level at
+  each $(i,j)$ point using the bathymetry, to obtain the final three-dimensional depth and scale factor arrays.
+\item[\forcode{ln_sco = .true.}]
+  smooth the bathymetry to fulfill the hydrostatic consistency criteria and
+  set the three-dimensional transformation.
+\item[\forcode{s-z and s-zps}]
+  smooth the bathymetry to fulfill the hydrostatic consistency criteria and
+  set the three-dimensional transformation $z(i,j,k)$,
+  and possibly introduce masking of extra land points to better fit the original bathymetry file.
+\end{description}
+%%%
+
+% -------------------------------------------------------------------------------------------------------------
+%        z-coordinate with constant thickness
+% -------------------------------------------------------------------------------------------------------------
+\subsubsection[$Z$-coordinate with uniform thickness levels (\forcode{ln_zco = .true.})]
+{$Z$-coordinate with uniform thickness levels (\protect\np{ln\_zco}\forcode{ = .true.})}
+\label{subsec:DOMCFG_zco}
+
+With this option the model topography can be fully described by the reference vertical
+coordinate and a 2D integer field giving the number of wet levels at each location
+(\forcode{bathy_level}). The resulting match to the real topography is likely to be poor
+though (especially with thick, deep levels) and slopes poorly represented. This option is
+rarely used in modern simulations but it can be useful for testing purposes.
+
+% -------------------------------------------------------------------------------------------------------------
+%        z-coordinate with partial step
+% -------------------------------------------------------------------------------------------------------------
+\subsubsection[$Z$-coordinate with partial step (\forcode{ln_zps = .true.})]
+{$Z$-coordinate with partial step (\protect\np{ln\_zps}\forcode{ = .true.})}
+\label{subsec:DOMCFG_zps}
+
+In $z$-coordinate partial step, the depths of the model levels are defined by the
+reference analytical function $z_0(k)$ as described in \autoref{sec:DOMCFG_zref},
+\textit{except} in the bottom layer.  The thickness of the bottom layer is allowed to vary
+as a function of geographical location $(\lambda,\varphi)$ to allow a better
+representation of the bathymetry, especially in the case of small slopes (where the
+bathymetry varies by less than one level thickness from one grid point to the next).  The
+reference layer thicknesses $e_{3t}^0$ have been defined in the absence of bathymetry.
+With partial steps, layers from 1 to \jp{jpk}-2 can have a thickness smaller than
+$e_{3t}(jk)$.
+
+The model deepest layer (\jp{jpk}-1) is allowed to have either a smaller or larger
+thickness than $e_{3t}(jpk)$: the maximum thickness allowed is $2*e_{3t}(jpk - 1)$.
+
+This has to be kept in mind when specifying values in \nam{dom} namelist
+(\texttt{DOMAINCFG} variant), such as the maximum depth \np{pphmax} in partial steps.
+
+For example, with \np{pphmax}~$= 5750~m$ for the DRAKKAR 45 layer grid, the maximum ocean
+depth allowed is actually $6000~m$ (the default thickness $e_{3t}(jpk - 1)$ being
+$250~m$).  Two variables in the namdom namelist are used to define the partial step
+vertical grid.  The mimimum water thickness (in meters) allowed for a cell partially
+filled with bathymetry at level jk is the minimum of \np{rn\_e3zps\_min} (thickness in
+meters, usually $20~m$) or $e_{3t}(jk)*$\np{rn\_e3zps\_rat} (a fraction, usually 10\%, of
+the default thickness $e_{3t}(jk)$).
+
+% -------------------------------------------------------------------------------------------------------------
+%        s-coordinate
+% -------------------------------------------------------------------------------------------------------------
+\subsubsection[$S$-coordinate (\forcode{ln_sco = .true.})]
+{$S$-coordinate (\protect\np{ln\_sco}\forcode{ = .true.})}
+\label{sec:DOMCFG_sco}
+%------------------------------------------nam_zgr_sco---------------------------------------------------
+%
+\nlst{namzgr_sco_domcfg}
+%--------------------------------------------------------------------------------------------------------------
+Options are defined in \nam{zgr\_sco} (\texttt{DOMAINcfg} only).
+In $s$-coordinate (\np{ln\_sco}\forcode{ = .true.}), the depth and thickness of the model levels are defined from
+the product of a depth field and either a stretching function or its derivative, respectively:
+
+\begin{align*}
+  % \label{eq:DOMCFG_sco_ana}
+  z(k)   &= h(i,j) \; z_0 (k) \\
+  e_3(k) &= h(i,j) \; z_0'(k)
+\end{align*}
+
+where $h$ is the depth of the last $w$-level ($z_0(k)$) defined at the $t$-point location in the horizontal and
+$z_0(k)$ is a function which varies from $0$ at the sea surface to $1$ at the ocean bottom.
+The depth field $h$ is not necessary the ocean depth,
+since a mixed step-like and bottom-following representation of the topography can be used
+(\autoref{fig:DOM_z_zps_s_sps}) or an envelop bathymetry can be defined (\autoref{fig:DOM_z_zps_s_sps}).
+The namelist parameter \np{rn\_rmax} determines the slope at which
+the terrain-following coordinate intersects the sea bed and becomes a pseudo z-coordinate.
+The coordinate can also be hybridised by specifying \np{rn\_sbot\_min} and \np{rn\_sbot\_max} as
+the minimum and maximum depths at which the terrain-following vertical coordinate is calculated.
+
+Options for stretching the coordinate are provided as examples,
+but care must be taken to ensure that the vertical stretch used is appropriate for the application.
+
+The original default \NEMO\ s-coordinate stretching is available if neither of the other options are specified as true
+(\np{ln\_s\_SH94}\forcode{ = .false.} and \np{ln\_s\_SF12}\forcode{ = .false.}).
+This uses a depth independent $\tanh$ function for the stretching \citep{madec.delecluse.ea_JPO96}:
+
+\[
+  z = s_{min} + C (s) (H - s_{min})
+  % \label{eq:DOMCFG_SH94_1}
+\]
+
+where $s_{min}$ is the depth at which the $s$-coordinate stretching starts and
+allows a $z$-coordinate to placed on top of the stretched coordinate,
+and $z$ is the depth (negative down from the asea surface).
+\begin{gather*}
+  s = - \frac{k}{n - 1} \quad \text{and} \quad 0 \leq k \leq n - 1
+  % \label{eq:DOMCFG_s}
+ \\
+ \label{eq:DOMCFG_sco_function}
+  C(s) = \frac{[\tanh(\theta \, (s + b)) - \tanh(\theta \, b)]}{2 \; \sinh(\theta)}
+\end{gather*}
+
+A stretching function,
+modified from the commonly used \citet{song.haidvogel_JCP94} stretching (\np{ln\_s\_SH94}\forcode{ = .true.}),
+is also available and is more commonly used for shelf seas modelling:
+
+\[
+  C(s) =   (1 - b) \frac{\sinh(\theta s)}{\sinh(\theta)}
+         + b       \frac{\tanh \lt[ \theta \lt(s + \frac{1}{2} \rt) \rt] -   \tanh \lt( \frac{\theta}{2} \rt)}
+                        {                                                  2 \tanh \lt( \frac{\theta}{2} \rt)}
+ \label{eq:DOMCFG_SH94_2}
+\]
+
+%% %>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+\begin{figure}[!ht]
+  \begin{center}
+    \includegraphics[width=\textwidth]{Fig_sco_function}
+    \caption{
+      \protect\label{fig:DOMCFG_sco_function}
+      Examples of the stretching function applied to a seamount;
+      from left to right: surface, surface and bottom, and bottom intensified resolutions
+    }
+  \end{center}
+\end{figure}
+%% %>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+
+where $H_c$ is the critical depth (\np{rn\_hc}) at which the coordinate transitions from pure $\sigma$ to
+the stretched coordinate, and $\theta$ (\np{rn\_theta}) and $b$ (\np{rn\_bb}) are the surface and
+bottom control parameters such that $0 \leqslant \theta \leqslant 20$, and $0 \leqslant b \leqslant 1$.
+$b$ has been designed to allow surface and/or bottom increase of the vertical resolution
+(\autoref{fig:DOMCFG_sco_function}).
+
+Another example has been provided at version 3.5 (\np{ln\_s\_SF12}) that allows a fixed surface resolution in
+an analytical terrain-following stretching \citet{siddorn.furner_OM13}.
+In this case the a stretching function $\gamma$ is defined such that:
+
+\begin{equation}
+  z = - \gamma h \quad \text{with} \quad 0 \leq \gamma \leq 1
+  % \label{eq:DOMCFG_z}
+\end{equation}
+
+The function is defined with respect to $\sigma$, the unstretched terrain-following coordinate:
+
+\begin{gather*}
+  % \label{eq:DOMCFG_gamma_deriv}
+  \gamma =   A \lt( \sigma   - \frac{1}{2} (\sigma^2     + f (\sigma)) \rt)
+           + B \lt( \sigma^3 - f           (\sigma) \rt) + f (\sigma)       \\
+  \intertext{Where:}
+ \label{eq:DOMCFG_gamma}
+  f(\sigma) = (\alpha + 2) \sigma^{\alpha + 1} - (\alpha + 1) \sigma^{\alpha + 2}
+  \quad \text{and} \quad \sigma = \frac{k}{n - 1}
+\end{gather*}
+
+This gives an analytical stretching of $\sigma$ that is solvable in $A$ and $B$ as a function of
+the user prescribed stretching parameter $\alpha$ (\np{rn\_alpha}) that stretches towards
+the surface ($\alpha > 1.0$) or the bottom ($\alpha < 1.0$) and
+user prescribed surface (\np{rn\_zs}) and bottom depths.
+The bottom cell depth in this example is given as a function of water depth:
+
+\[
+  % \label{eq:DOMCFG_zb}
+  Z_b = h a + b
+\]
+
+where the namelist parameters \np{rn\_zb\_a} and \np{rn\_zb\_b} are $a$ and $b$ respectively.
+
+%% %>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+\begin{figure}[!ht]
+  \includegraphics[width=\textwidth]{Fig_DOM_compare_coordinates_surface}
+  \caption{
+    A comparison of the \citet{song.haidvogel_JCP94} $S$-coordinate (solid lines),
+    a 50 level $Z$-coordinate (contoured surfaces) and
+    the \citet{siddorn.furner_OM13} $S$-coordinate (dashed lines) in the surface $100~m$ for
+    a idealised bathymetry that goes from $50~m$ to $5500~m$ depth.
+    For clarity every third coordinate surface is shown.
+  }
+  \label{fig:DOMCFG_fig_compare_coordinates_surface}
+\end{figure}
+ % >>>>>>>>>>>>>>>>>>>>>>>>>>>>
+
+This gives a smooth analytical stretching in computational space that is constrained to
+given specified surface and bottom grid cell thicknesses in real space.
+This is not to be confused with the hybrid schemes that
+superimpose geopotential coordinates on terrain following coordinates thus
+creating a non-analytical vertical coordinate that
+therefore may suffer from large gradients in the vertical resolutions.
+This stretching is less straightforward to implement than the \citet{song.haidvogel_JCP94} stretching,
+but has the advantage of resolving diurnal processes in deep water and has generally flatter slopes.
+
+As with the \citet{song.haidvogel_JCP94} stretching the stretch is only applied at depths greater than
+the critical depth $h_c$.
+In this example two options are available in depths shallower than $h_c$,
+with pure sigma being applied if the \np{ln\_sigcrit} is true and pure z-coordinates if it is false
+(the z-coordinate being equal to the depths of the stretched coordinate at $h_c$).
+
+Minimising the horizontal slope of the vertical coordinate is important in terrain-following systems as
+large slopes lead to hydrostatic consistency.
+A hydrostatic consistency parameter diagnostic following \citet{haney_JPO91} has been implemented,
+and is output as part of the model mesh file at the start of the run.
+
+% -------------------------------------------------------------------------------------------------------------
+%        z*- or s*-coordinate
+% -------------------------------------------------------------------------------------------------------------
+\subsubsection[\zstar- or \sstar-coordinate (\forcode{ln_linssh = .false.})]
+{\zstar- or \sstar-coordinate (\protect\np{ln\_linssh}\forcode{ = .false.})}
+\label{subsec:DOMCFG_zgr_star}
+
+This option is described in the Report by Levier \textit{et al.} (2007), available on the \NEMO\ web site.
+
+\biblio
+
+\pindex
+
+\end{document}
Index: /NEMO/trunk/doc/latex/NEMO/subfiles/apdx_algos.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/subfiles/apdx_algos.tex	(revision 11543)
+++ /NEMO/trunk/doc/latex/NEMO/subfiles/apdx_algos.tex	(revision 11543)
@@ -0,0 +1,848 @@
+\documentclass[../main/NEMO_manual]{subfiles}
+
+\begin{document}
+% ================================================================
+% Appendix E : Note on some algorithms
+% ================================================================
+\chapter{Note on some algorithms}
+\label{apdx:ALGOS}
+
+\chaptertoc
+
+\newpage
+
+This appendix some on going consideration on algorithms used or planned to be used in \NEMO.
+
+% -------------------------------------------------------------------------------------------------------------
+%        UBS scheme
+% -------------------------------------------------------------------------------------------------------------
+\section{Upstream Biased Scheme (UBS) (\protect\np{ln\_traadv\_ubs}\forcode{ = .true.})}
+\label{sec:TRA_adv_ubs}
+
+The UBS advection scheme is an upstream biased third order scheme based on
+an upstream-biased parabolic interpolation.
+It is also known as Cell Averaged QUICK scheme (Quadratic Upstream Interpolation for Convective Kinematics).
+For example, in the $i$-direction:
+\begin{equation}
+  \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.
+\end{equation}
+or equivalently, the advective flux is
+\begin{equation}
+  \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]
+\end{equation}
+where $U_{i+1/2} = e_{1u}\,e_{3u}\,u_{i+1/2}$ and
+$\tau "_i =\delta_i \left[ {\delta_{i+1/2} \left[ \tau \right]} \right]$.
+By choosing this expression for $\tau "$ we consider a fourth order approximation of $\partial_i^2$ with
+a constant i-grid spacing ($\Delta i=1$).
+
+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 (\ie\ hyper-diffusive) truncation error
+\citep{shchepetkin.mcwilliams_OM05}.
+The overall performance of the advection scheme is similar to that reported in \cite{farrow.stevens_JPO95}.
+It is a relatively good compromise between accuracy and smoothness.
+It is not a \emph{positive} scheme meaning false extrema are permitted but
+the amplitude of such are significantly reduced over the centred second order method.
+Nevertheless it is not recommended to apply it to a passive tracer that requires positivity.
+
+The intrinsic diffusion of UBS makes its use risky in the vertical direction where
+the control of artificial diapycnal fluxes is of paramount importance.
+It has therefore been preferred to evaluate the vertical flux using the TVD scheme when
+\np{ln\_traadv\_ubs}\forcode{ = .true.}.
+
+For stability reasons, in \autoref{eq:TRA_adv_ubs}, the first term which corresponds to
+a second order centred scheme is evaluated using the \textit{now} velocity (centred in time) while
+the second term which is the diffusive part of the scheme, is evaluated using the \textit{before} velocity
+(forward in time).
+This is discussed by \citet{webb.de-cuevas.ea_JAOT98} in the context of the Quick advection scheme.
+UBS and QUICK schemes only differ by one coefficient.
+Substituting 1/6 with 1/8 in (\autoref{eq:TRA_adv_ubs}) leads to the QUICK advection scheme \citep{webb.de-cuevas.ea_JAOT98}.
+This option is not available through a namelist parameter, since the 1/6 coefficient is hard coded.
+Nevertheless it is quite easy to make the substitution in \mdl{traadv\_ubs} module and obtain a QUICK scheme.
+
+NB 1: When a high vertical resolution $O(1m)$ is used, the model stability can be controlled by vertical advection
+(not vertical diffusion which is usually solved using an implicit scheme).
+Computer time can be saved by using a time-splitting technique on vertical advection.
+This possibility have been implemented and validated in ORCA05-L301.
+It is not currently offered in the current reference version.
+
+NB 2: In a forthcoming release four options will be proposed for the vertical component used in the UBS scheme.
+$\tau_w^{ubs}$ will be evaluated using either \textit{(a)} a centered $2^{nd}$ order scheme,
+or \textit{(b)} a TVD scheme, or \textit{(c)} an interpolation based on conservative parabolic splines following
+\citet{shchepetkin.mcwilliams_OM05} implementation of UBS in ROMS, or \textit{(d)} an UBS.
+The $3^{rd}$ case has dispersion properties similar to an eight-order accurate conventional scheme.
+
+NB 3: It is straight forward to rewrite \autoref{eq:TRA_adv_ubs} as follows:
+\begin{equation}
+  \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.
+\end{equation}
+or equivalently
+\begin{equation}
+  \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}
+\end{equation}
+\autoref{eq:TRA_adv_ubs2} has several advantages.
+First it clearly evidences that the UBS scheme is based on the fourth order scheme to which
+is added an upstream biased diffusive term.
+Second, this emphasises that the $4^{th}$ order part have to be evaluated at \emph{now} time step,
+not only the $2^{th}$ order part as stated above using \autoref{eq:TRA_adv_ubs}.
+Third, the diffusive term is in fact a biharmonic operator with a eddy coefficient which
+is simply proportional to the velocity.
+
+laplacian diffusion:
+\begin{equation}
+  \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}
+\end{equation}
+
+bilaplacian:
+\begin{equation}
+  \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}
+\end{equation}
+with ${A_u^{lT}}^2 = \frac{1}{12} {e_{1u}}^3\ |u|$,
+\ie\ $A_u^{lT} = \frac{1}{\sqrt{12}} \,e_{1u}\ \sqrt{ e_{1u}\,|u|\,}$
+it comes:
+\begin{equation}
+  \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}
+\end{equation}
+if the velocity is uniform (\ie\ $|u|=cst$) then the diffusive flux is
+\begin{equation}
+  \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}
+\end{equation}
+beurk....  reverte the logic: starting from the diffusive part of the advective flux it comes:
+
+\begin{equation}
+  \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}
+\end{equation}
+if the velocity is uniform (\ie\ $|u|=cst$) and
+choosing $\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]$
+
+sol 1 coefficient at T-point ( add $e_{1u}$ and $e_{1T}$ on both side of first $\delta$):
+\begin{equation}
+  \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}
+\end{equation}
+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}}$
+\begin{equation}
+  \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}
+\end{equation}
+which leads to ${A_u^{lT}} = \frac{1}{12} {e_{1u}}^3\ |u|$
+
+% -------------------------------------------------------------------------------------------------------------
+%        Leap-Frog energetic
+% -------------------------------------------------------------------------------------------------------------
+\section{Leapfrog energetic}
+\label{sec:LF}
+
+We adopt the following semi-discrete notation for time derivative.
+Given the values of a variable $q$ at successive time step,
+the time derivation and averaging operators at the mid time step are:
+\[
+  % \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
+$\overline{\cdot}^{\,t\,*}= \overline{\cdot}^{\,t+\Delta/2}$, respectively.
+
+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}
+\]
+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, \ie\ 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) ,
+\]
+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}
+\]
+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!!!}
+
+% ================================================================
+% Iso-neutral diffusion :
+% ================================================================
+
+\section{Lateral diffusion operator}
+
+% ================================================================
+% Griffies' iso-neutral diffusion operator :
+% ================================================================
+\subsection{Griffies iso-neutral diffusion operator}
+
+Let try to define a scheme that get its inspiration from the \citet{griffies.gnanadesikan.ea_JPO98} scheme,
+but is formulated within the \NEMO\ framework
+(\ie\ using scale factors rather than grid-size and having a position of $T$-points that
+is not necessary in the middle of vertical velocity points, see \autoref{fig:DOM_zgr_e3}).
+
+In the formulation \autoref{eq:TRA_ldf_iso} introduced in 1995 in OPA, the ancestor of \NEMO,
+the off-diagonal terms of the small angle diffusion tensor contain several double spatial averages of a gradient,
+for example $\overline{\overline{\delta_k \cdot}}^{\,i,k}$.
+It is apparent that the combination of a $k$ average and a $k$ derivative of the tracer allows for
+the presence of grid point oscillation structures that will be invisible to the operator.
+These structures are \textit{computational modes}.
+They will not be damped by the iso-neutral operator, and even possibly amplified by it.
+In other word, the operator applied to a tracer does not warranties the decrease of its global average variance.
+To circumvent this, we have introduced a smoothing of the slopes of the iso-neutral surfaces
+(see \autoref{chap:LDF}).
+Nevertheless, this technique works fine for $T$ and $S$ as they are active tracers
+(\ie\ they enter the computation of density), but it does not work for a passive tracer.
+\citep{griffies.gnanadesikan.ea_JPO98} introduce a different way to discretise the off-diagonal terms that
+nicely solve the problem.
+The idea is to get rid of combinations of an averaged in one direction combined with
+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:
+\begin{equation}
+  \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)
+\end{equation}
+where the indices $i_p$ and $k_p$ define the four triads and take the following value:
+$i_p = -1/2$ or $1/2$ and $k_p = -1/2$ or $1/2$,
+$b_u= e_{1u}\,e_{2u}\,e_{3u}$ is the volume of $u$-cells,
+$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:
+\begin{equation}
+  \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 ] }
+\end{equation}
+Note that in \autoref{eq:Gf_slopes} we use the ratio $\alpha / \beta$ instead of
+multiplying the temperature derivative by $\alpha$ and the salinity derivative by $\beta$.
+This is more efficient as the ratio $\alpha / \beta$ can to be evaluated directly.
+
+Note that in \autoref{eq:Gf_triads}, we chose to use ${b_u}_{\,i+i_p}^{\,k}$ instead of ${b_{uw}}_{\,i+i_p}^{\,k+k_p}$.
+This choice has been motivated by the decrease of tracer variance and
+the presence of partial cell at the ocean bottom (see \autoref{apdx:Gf_operator}).
+
+%>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+\begin{figure}[!ht]
+  \begin{center}
+    \includegraphics[width=\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*}
+
+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:TRIADS_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}
+\end{flalign}
+resulting in a iso-neutral diffusion tendency on temperature given by
+the divergence of the sum of all the four triad fluxes:
+\begin{equation}
+  \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\}
+\end{equation}
+where $b_T= e_{1T}\,e_{2T}\,e_{3T}$ is the volume of $T$-cells.
+
+This expression of the iso-neutral diffusion has been chosen in order to satisfy the following six properties:
+\begin{description}
+\item[$\bullet$ horizontal diffusion]
+  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
+  \]
+
+\item[$\bullet$ implicit treatment in the vertical]
+  In the diagonal term associated with the vertical divergence of the iso-neutral fluxes
+  \ie\ the term associated with a second order vertical derivative)
+  appears only tracer values associated with a single water column.
+  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\{
+		A_i^k \; \left(_i^k \mathbb{R}_{i_p}^{k_p}\right)^2
+    \right\}
+  \]
+  can be quite large.
+
+\item[$\bullet$ pure iso-neutral operator]
+  The iso-neutral flux of locally referenced potential density is zero, \ie
+  \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, \ie
+  \[
+    % \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, \ie
+  \[
+    % \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.
+It means that the operator is also a dissipation term,
+\ie\ it is a sink term for the square of the quantity on which it is applied.
+It therfore ensures that, when the diffusivity coefficient is large enough,
+the field on which it is applied become free of grid-point noise.
+
+\item[$\bullet$ self-adjoint operator]
+  The iso-neutral diffusion operator is self-adjoint, \ie
+  \[
+    % \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.
+This properties can be demonstrated quite easily in a similar way the "non increase of tracer variance" property
+has been proved (see \autoref{apdx:Gf_operator}).
+\end{description}
+
+% ================================================================
+% Skew flux formulation for Eddy Induced Velocity :
+% ================================================================
+\subsection{Eddy induced velocity and skew flux formulation}
+
+When Gent and McWilliams [1990] diffusion is used (\key{traldf\_eiv} defined),
+an additional advection term is added.
+The associated velocity is the so called eddy induced velocity,
+the formulation of which depends on the slopes of iso-neutral surfaces.
+Contrary to the case of iso-neutral mixing, the slopes used here are referenced to the geopotential surfaces,
+\ie\ \autoref{eq:LDF_slp_geo} is used in $z$-coordinate,
+and the sum \autoref{eq:LDF_slp_geo} + \autoref{eq:LDF_slp_iso} in $z^*$ or $s$-coordinates.
+
+The eddy induced velocity is given by:
+\begin{equation}
+  \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}
+\end{equation}
+where $A_{e}$ is the eddy induced velocity coefficient,
+and $r_i$ and $r_j$ the slopes between the iso-neutral and the geopotential surfaces.
+%%gm wrong: to be modified with 2 2D streamfunctions
+In other words, the eddy induced velocity can be derived from a vector streamfuntion, $\phi$,
+which is given by $\phi = A_e\,\textbf{r}$ as $\textbf{U}^*  = \textbf{k} \times \nabla \phi$.
+%%end gm
+
+A traditional way to implement this additional advection is to add it to the eulerian velocity prior to
+compute the tracer advection.
+This allows us to take advantage of all the advection schemes offered for the tracers
+(see \autoref{sec:TRA_adv}) and not just a $2^{nd}$ order advection scheme.
+This is particularly useful for passive tracers where
+\emph{positivity} of the advection scheme is of paramount importance.
+% give here the expression using the triads. It is different from the one given in \autoref{eq:LDF_eiv}
+% see just below a copy of this equation:
+%\begin{equation} \label{eq:ldfeiv}
+%\begin{split}
+% u^* & = \frac{1}{e_{2u}e_{3u}}\; \delta_k \left[e_{2u} \, A_{uw}^{eiv} \; \overline{r_{1w}}^{\,i+1/2} \right]\\
+% v^* & = \frac{1}{e_{1u}e_{3v}}\; \delta_k \left[e_{1v} \, A_{vw}^{eiv} \; \overline{r_{2w}}^{\,j+1/2} \right]\\
+%w^* & = \frac{1}{e_{1w}e_{2w}}\; \left\{ \delta_i \left[e_{2u} \, A_{uw}^{eiv} \; \overline{r_{1w}}^{\,i+1/2} \right] + %\delta_j \left[e_{1v} \, A_{vw}^{eiv} \; \overline{r_{2w}}^{\,j+1/2} \right] \right\} \\
+%\end{split}
+%\end{equation}
+\[
+  % \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.
+It is based on a transformation of the advective fluxes using the non-divergent nature of the eddy induced velocity.
+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}
+\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:
+\begin{equation}
+  \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}
+\end{equation}
+The tendency associated with eddy induced velocity is then simply the divergence of
+the \autoref{eq:eiv_skew_continuous} fluxes.
+It naturally conserves the tracer content, as it is expressed in flux form and,
+as the advective form, it preserves the tracer variance.
+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*}
+The horizontal component reduces to the one use for an horizontal laplacian operator and
+the vertical one keeps the same complexity, but not more.
+This property has been used to reduce the computational time \citep{griffies_JPO98},
+but it is not of practical use as usually $A \neq A_e$.
+Nevertheless this property can be used to choose a discret form of \autoref{eq:eiv_skew_continuous} which
+is consistent with the iso-neutral operator \autoref{eq:Gf_operator}.
+Using the slopes \autoref{eq:Gf_slopes} and defining $A_e$ at $T$-point(\ie\ as $A$,
+the eddy diffusivity coefficient), the resulting discret form is given by:
+\begin{equation}
+  \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)
+\end{equation}
+Note that \autoref{eq:eiv_skew} is valid in $z$-coordinate with or without partial cells.
+In $z^*$ or $s$-coordinate, the slope between the level and the geopotential surfaces must be added to
+$\mathbb{R}$ for the discret form to be exact.
+
+Such a choice of discretisation is consistent with the iso-neutral operator as
+it uses the same definition for the slopes.
+It also ensures the conservation of the tracer variance (see Appendix \autoref{apdx:eiv_skew}),
+\ie\ it does not include a diffusive component but is a "pure" advection term.
+
+$\ $\newpage      %force an empty line
+% ================================================================
+% Discrete Invariants of the iso-neutral diffrusion
+% ================================================================
+\subsection{Discrete invariants of the iso-neutral diffrusion}
+\label{subsec:Gf_operator}
+
+Demonstration of the decrease of the tracer variance in the (\textbf{i},\textbf{j}) plane.
+
+This part will be moved in an Appendix.
+
+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:TRIADS_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,
+  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
+  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
+\end{align*}
+The last inequality is obviously obtained as we succeed in obtaining a negative summation of square quantities.
+
+Note that, if instead of multiplying $D_l^T$ by $T$, we were using another tracer field, let say $S$,
+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\}
+\end{align*}
+This means that the iso-neutral operator is self-adjoint.
+There is no need to develop a specific to obtain it.
+
+\newpage
+
+% ================================================================
+% Discrete Invariants of the skew flux formulation
+% ================================================================
+\subsection{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.
+
+This have to be moved in an Appendix.
+
+The continuous property to be demonstrated is:
+\begin{align*}
+  \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\}
+\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\}
+\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\ \ \ \:}
+    &\ {\ \ \;_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}
+\end{align*}
+The two terms associated with the triad ${_i^k \mathbb{R}_{+1/2}^{+1/2}}$ are the same but of opposite signs,
+they cancel out.
+Exactly the same thing occurs for the triad ${_i^k \mathbb{R}_{-1/2}^{-1/2}}$.
+The two terms associated with the triad ${_i^k \mathbb{R}_{+1/2}^{-1/2}}$ are the same but both of opposite signs and
+shifted by 1 in $k$ direction.
+When summing over $k$ they cancel out with the neighbouring grid points.
+Exactly the same thing occurs for the triad ${_i^k \mathbb{R}_{-1/2}^{+1/2}}$ in the $i$ direction.
+Therefore the sum over the domain is zero,
+\ie\ the variance of the tracer is preserved by the discretisation of the skew fluxes.
+
+\biblio
+
+\pindex
+
+\end{document}
Index: /NEMO/trunk/doc/latex/NEMO/subfiles/apdx_diff_opers.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/subfiles/apdx_diff_opers.tex	(revision 11543)
+++ /NEMO/trunk/doc/latex/NEMO/subfiles/apdx_diff_opers.tex	(revision 11543)
@@ -0,0 +1,417 @@
+\documentclass[../main/NEMO_manual]{subfiles}
+
+\begin{document}
+% ================================================================
+% Chapter Appendix B : Diffusive Operators
+% ================================================================
+\chapter{Diffusive Operators}
+\label{apdx:DIFFOPERS}
+
+\chaptertoc
+
+\newpage
+
+% ================================================================
+% Horizontal/Vertical 2nd Order Tracer Diffusive Operators
+% ================================================================
+\section{Horizontal/Vertical $2^{nd}$ order tracer diffusive operators}
+\label{sec:DIFFOPERS_1}
+
+\subsubsection*{In z-coordinates}
+
+In $z$-coordinates, the horizontal/vertical second order tracer diffusion operator is given by:
+\begin{align}
+  \label{eq:DIFFOPERS_1}
+  &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{eq:SCOORD_s_slope} and
+the vertical/horizontal ratio of diffusion coefficient by $\epsilon = A^{vT} / A^{lT}$.
+The diffusion operator is given by:
+
+\begin{equation}
+  \label{eq:DIFFOPERS_2}
+  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)
+\end{equation}
+or in expanded form:
+\begin{align*}
+  {
+  \begin{array}{*{20}l}
+    D^T= \frac{1}{e_1\,e_2\,e_3 } & \left\{ \quad \quad \frac{\partial }{\partial i}  \left. \left[  e_2\,e_3 \, A^{lT}
+                               \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]  \right|_s  \right. \\
+        &  \quad \  +   \            \left.   \frac{\partial }{\partial j}  \left. \left[  e_1\,e_3 \, A^{lT}
+                               \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]  \right|_s  \right. \\
+        &  \quad \  +   \           \left.  e_1\,e_2\, \frac{\partial }{\partial s}  \left[ A^{lT} \; \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
+                          +\left( \varepsilon +\sigma_1^2+\sigma_2 ^2 \right) \; \frac{1}{e_3 } \; \frac{\partial T}{\partial s} \right) \; \right] \;  \right\} .
+  \end{array}
+          }
+\end{align*}
+
+\autoref{eq:DIFFOPERS_2} is obtained from \autoref{eq:DIFFOPERS_1} without any additional assumption.
+Indeed, for the special case $k=z$ and thus $e_3 =1$,
+we introduce an arbitrary vertical coordinate $s = s (i,j,z)$ as in \autoref{apdx:SCOORD} and
+use \autoref{eq:SCOORD_s_slope} and \autoref{eq:SCOORD_s_chain_rule}.
+Since no cross horizontal derivative $\partial _i \partial _j $ appears in \autoref{eq:DIFFOPERS_1},
+the ($i$,$z$) and ($j$,$z$) planes are independent.
+The derivation can then be demonstrated for the ($i$,$z$)~$\to$~($j$,$s$) transformation without
+any loss of generality:
+
+\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}$, this becomes:}
+    %
+    D^T & =\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 s}} \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, $D^T$ becomes:}
+    %
+   D^T &= \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 two terms on the second line cancel, while
+    the third line reduces to a single vertical derivative, so it becomes:}
+  %
+    D^T & =\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*}
+%\addtocounter{equation}{-2}
+
+% ================================================================
+% Isopycnal/Vertical 2nd Order Tracer Diffusive Operators
+% ================================================================
+\section{Iso/Diapycnal $2^{nd}$ order tracer diffusive operators}
+\label{sec:DIFFOPERS_2}
+
+\subsubsection*{In z-coordinates}
+
+The iso/diapycnal diffusive tensor $\textbf {A}_{\textbf I}$ expressed in
+the ($i$,$j$,$k$) curvilinear coordinate system in which
+the equations of the ocean circulation model are formulated,
+takes the following form \citep{redi_JPO82}:
+
+\begin{equation}
+  \label{eq:DIFFOPERS_3}
+  \textbf {A}_{\textbf I} = \frac{A^{lT}}{\left( {1+a_1 ^2+a_2 ^2} \right)}
+  \left[ {{
+        \begin{array}{*{20}c}
+          {1+a_2 ^2 +\varepsilon a_1 ^2} \hfill & {-a_1 a_2 (1-\varepsilon)} \hfill & {-a_1 (1-\varepsilon) } \hfill \\
+          {-a_1 a_2 (1-\varepsilon) } \hfill & {1+a_1 ^2 +\varepsilon a_2 ^2} \hfill & {-a_2 (1-\varepsilon)} \hfill \\
+          {-a_1 (1-\varepsilon)} \hfill & {-a_2 (1-\varepsilon)} \hfill & {\varepsilon +a_1 ^2+a_2 ^2} \hfill \\
+        \end{array}
+      }} \right]
+\end{equation}
+where ($a_1$, $a_2$) are $(-1) \times$ the isopycnal slopes in
+($\textbf{i}$, $\textbf{j}$) directions, relative to geopotentials (or
+equivalently the slopes of the geopotential surfaces in the isopycnal
+coordinate framework):
+\[
+  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}
+\]
+and, as before, $\epsilon = A^{vT} / A^{lT}$.
+
+In practice, $\epsilon$ is small and isopycnal slopes are generally less than $10^{-2}$ in the ocean,
+so $\textbf {A}_{\textbf I}$ can be simplified appreciably \citep{cox_OM87}. Keeping leading order terms\footnote{Apart from the (1,0)
+and (0,1) elements which are set to zero. See \citet{griffies_bk04}, section 14.1.4.1 for a discussion of this point.}:
+\begin{subequations}
+  \label{eq:DIFFOPERS_4}
+  \begin{equation}
+    \label{eq:DIFFOPERS_4a}
+    {\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],
+  \end{equation}
+  and the iso/dianeutral diffusive operator in $z$-coordinates is then
+  \begin{equation}
+    \label{eq:DIFFOPERS_4b}
+    D^T = \left. \nabla \right|_z \cdot
+    \left[ A^{lT} \;\Re \cdot \left. \nabla \right|_z T  \right]. \\
+  \end{equation}
+\end{subequations}
+
+Physically, the full tensor \autoref{eq:DIFFOPERS_3} represents strong isoneutral diffusion on a plane parallel to
+the isoneutral surface and weak dianeutral diffusion perpendicular to this plane.
+However,
+the approximate `weak-slope' tensor \autoref{eq:DIFFOPERS_4a} represents strong diffusion along the isoneutral surface,
+with weak \emph{vertical} diffusion -- the principal axes of the tensor are no longer orthogonal.
+This simplification also decouples the ($i$,$z$) and ($j$,$z$) planes of the tensor.
+The weak-slope operator therefore takes the same form, \autoref{eq:DIFFOPERS_4}, as \autoref{eq:DIFFOPERS_2},
+the diffusion operator for geopotential diffusion written in non-orthogonal $i,j,s$-coordinates.
+Written out explicitly,
+
+\begin{multline}
+  \label{eq:DIFFOPERS_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{eq:DIFFOPERS_4},
+\autoref{eq:DIFFOPERS_ldfiso} conserves tracer quantity and dissipates its square.
+As \autoref{eq:DIFFOPERS_4} is the divergence of a flux, the demonstration of the first property is trivial, providing that the flux normal to the boundary is zero
+(as it is when $A_h$ is zero at the boundary). 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,
+\]
+and since
+\begin{align*}
+  {
+  \begin{array}{*{20}l}
+    \nabla T\;.\left( {{\mathrm {\mathbf A}}_{\mathrm {\mathbf 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*}
+%\addtocounter{equation}{-1}
+the property becomes obvious.
+
+\subsubsection*{In generalized vertical coordinates}
+
+Because the weak-slope operator \autoref{eq:DIFFOPERS_4},
+\autoref{eq:DIFFOPERS_ldfiso} is decoupled in the ($i$,$z$) and ($j$,$z$) planes,
+it may be transformed into generalized $s$-coordinates in the same way as
+\autoref{sec:DIFFOPERS_1} was transformed into \autoref{sec:DIFFOPERS_2}.
+The resulting operator then takes the simple form
+
+\begin{equation}
+  \label{eq:DIFFOPERS_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),
+\end{equation}
+
+where ($r_1$, $r_2$) are $(-1)\times$ the isopycnal slopes in ($\textbf{i}$, $\textbf{j}$) directions,
+relative to $s$-coordinate surfaces (or equivalently the slopes of the
+$s$-coordinate surfaces in the isopycnal coordinate framework):
+\[
+  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}.
+\]
+
+To prove \autoref{eq:DIFFOPERS_ldfiso_s} by direct re-expression of \autoref{eq:DIFFOPERS_ldfiso} is straightforward, but laborious.
+An easier way is first to note (by reversing the derivation of \autoref{sec:DIFFOPERS_2} from \autoref{sec:DIFFOPERS_1} ) that
+the weak-slope operator may be \emph{exactly} reexpressed in non-orthogonal $i,j,\rho$-coordinates as
+
+\begin{equation}
+  \label{eq:DIFFOPERS_5}
+  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).
+\end{equation}
+Then direct transformation from $i,j,\rho$-coordinates to $i,j,s$-coordinates gives
+\autoref{eq:DIFFOPERS_ldfiso_s} immediately.
+
+Note that the weak-slope approximation is only made in transforming from
+the (rotated,orthogonal) isoneutral axes to the non-orthogonal $i,j,\rho$-coordinates.
+The further transformation into $i,j,s$-coordinates is exact, whatever the steepness of the $s$-surfaces,
+in the same way as the transformation of horizontal/vertical Laplacian diffusion in $z$-coordinates in
+\autoref{sec:DIFFOPERS_1} onto $s$-coordinates is exact, however steep the $s$-surfaces.
+
+
+% ================================================================
+% Lateral/Vertical Momentum Diffusive Operators
+% ================================================================
+\section{Lateral/Vertical momentum diffusive operators}
+\label{sec:DIFFOPERS_3}
+
+The second order momentum diffusion operator (Laplacian) in $z$-coordinates is found by
+applying \autoref{eq:MB_lap_vector}, the expression for the Laplacian of a vector,
+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)
+\end{align*}
+Using \autoref{eq:MB_div}, the definition of the horizontal divergence,
+the third component of the second vector is obviously zero and thus :
+\[
+  \Delta {\textbf{U}}_h = \nabla _h \left( \chi \right) - \nabla _h \times \left( \zeta \textbf{k} \right) + \frac {1}{e_3 } \frac {\partial }{\partial k} \left( {\frac {1}{e_3 } \frac{\partial {\textbf{ U}}_h }{\partial k}} \right) .
+\]
+
+Note that this operator ensures a full separation between
+the vorticity and horizontal divergence fields (see \autoref{apdx:INVARIANTS}).
+It is only equal to a Laplacian applied to each component in Cartesian coordinates, not on the sphere.
+
+The horizontal/vertical second order (Laplacian type) operator used to diffuse horizontal momentum in
+the $z$-coordinate therefore takes the following form:
+\begin{equation}
+  \label{eq:DIFFOPERS_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 {\mathrm {\mathbf U}}_h }{\partial k}} \right) , \\
+\end{equation}
+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 }{\partial k} \left( \frac{A^{vm}}{e_3} \frac{\partial u}{\partial k} \right)   ,   \\
+  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 }{\partial k} \left( \frac{A^{vm}}{e_3} \frac{\partial v}{\partial k} \right) .
+\end{align*}
+
+Note Bene: introducing a rotation in \autoref{eq:DIFFOPERS_Lap_U} does not lead to
+a useful expression for the iso/diapycnal Laplacian operator in the $z$-coordinate.
+Similarly, we did not found an expression of practical use for
+the geopotential horizontal/vertical Laplacian operator in the $s$-coordinate.
+Generally, \autoref{eq:DIFFOPERS_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
+
+\pindex
+
+\end{document}
Index: /NEMO/trunk/doc/latex/NEMO/subfiles/apdx_invariants.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/subfiles/apdx_invariants.tex	(revision 11543)
+++ /NEMO/trunk/doc/latex/NEMO/subfiles/apdx_invariants.tex	(revision 11543)
@@ -0,0 +1,1534 @@
+\documentclass[../main/NEMO_manual]{subfiles}
+
+\begin{document}
+% ================================================================
+% Chapter Ñ Appendix C : Discrete Invariants of the Equations
+% ================================================================
+\chapter{Discrete Invariants of the Equations}
+\label{apdx:INVARIANTS}
+
+\chaptertoc
+
+%%%  Appendix put in gmcomment as it has not been updated for \zstar and s coordinate
+%I'm writting this appendix. It will be available in a forthcoming release of the documentation
+
+%\gmcomment{
+
+\newpage
+
+% ================================================================
+% Introduction / Notations
+% ================================================================
+\section{Introduction / Notations}
+\label{sec:INVARIANTS_0}
+
+Notation used in this appendix in the demonstations:
+
+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
+\]
+
+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}
+\]
+
+partial derivative notation: $\partial_\bullet = \frac{\partial}{\partial \bullet}$
+
+$dv=e_1\,e_2\,e_3 \,di\,dj\,dk$  is the volume element, with only $e_3$ that depends on time.
+$D$ and $S$ are the ocean domain volume and surface, respectively.
+No wetting/drying is allow (\ie\ $\frac{\partial S}{\partial t} = 0$).
+Let $k_s$ and $k_b$ be the ocean surface and bottom, resp.
+(\ie\ $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}
+\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
+\]
+
+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
+\]
+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
+\]
+equation of evolution of $Q$ written as
+the time evolution of the vertical content of $Q$ like for tracers, or momentum in flux form,
+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 } \\
+\end{flalign*}
+that is in a more compact form :
+\begin{flalign}
+  \label{eq:INVARIANTS_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}
+equation of evolution of $Q$ written as the time evolution of $Q$ like for momentum in vector invariant form,
+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 } \\
+\end{flalign*}
+that is in a more compact form:
+\begin{flalign}
+  \label{eq:INVARIANTS_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}
+
+% ================================================================
+% Continuous Total energy Conservation
+% ================================================================
+\section{Continuous conservation}
+\label{sec:INVARIANTS_1}
+
+The discretization of pimitive equation in $s$-coordinate (\ie\ 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 (\ie\ kinetic plus potential energies) is conserved:
+\begin{flalign}
+  \label{eq:INVARIANTS_Tot_Energy}
+  \partial_t \left( \int_D \left( \frac{1}{2} {\textbf{U}_h}^2 +  \rho \, g \, z \right) \;dv \right)  = & 0
+\end{flalign}
+under the following assumptions: no dissipation, no forcing (wind, buoyancy flux, atmospheric pressure variations),
+mass conservation, and closed domain.
+
+This equation can be transformed to obtain several sub-equalities.
+The transformation for the advection term depends on whether the vector invariant form or
+the flux form is used for the momentum equation.
+Using \autoref{eq:INVARIANTS_Q2_vect} and introducing \autoref{eq:SCOORD_dyn_vect} in
+\autoref{eq:INVARIANTS_Tot_Energy} for the former form and
+using \autoref{eq:INVARIANTS_Q2_flux} and introducing \autoref{eq:SCOORD_dyn_flux} in
+\autoref{eq:INVARIANTS_Tot_Energy} for the latter form leads to:
+
+% \label{eq:INVARIANTS_E_tot}
+advection term (vector invariant form):
+\[
+  % \label{eq:INVARIANTS_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:INVARIANTS_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:INVARIANTS_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:INVARIANTS_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
+\[
+  % \label{eq:INVARIANTS_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:INVARIANTS_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:INVARIANTS_E_tot_vect}
+\[
+  % \label{eq:INVARIANTS_E_tot_vect_vor_2}
+  \int\limits_D   \textbf{U}_h \cdot \text{VOR} \;dv   = 0
+\]
+\[
+  % \label{eq:INVARIANTS_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:INVARIANTS_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:INVARIANTS_E_tot_flux}
+  \[
+    % \label{eq:INVARIANTS_E_tot_flux_metric_2}
+    \int\limits_D  \textbf{U}_h \cdot \text {COR} \;  dv   = 0
+  \]
+  \[
+    % \label{eq:INVARIANTS_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
+  \]
+  \begin{equation}
+    \label{eq:INVARIANTS_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{equation}
+\end{subequations}
+
+\autoref{eq:INVARIANTS_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:INVARIANTS_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   &&&\\
+\end{flalign*}
+where the last equality is obtained by noting that the brackets is exactly the expression of $w$,
+the vertical velocity referenced to the fixe $z$-coordinate system (see \autoref{eq:SCOORD_w_s}).
+
+The left hand side of \autoref{eq:INVARIANTS_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*}
+
+%gm comment
+\gmcomment{
+%
+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,
+\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}{\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    \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       &&&\\
+\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  \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
+  - \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
+\end{flalign*}
+% end gm comment
+}
+%
+
+% ================================================================
+% Discrete Total energy Conservation : vector invariant form
+% ================================================================
+\section{Discrete total energy conservation: vector invariant form}
+\label{sec:INVARIANTS_2}
+
+% -------------------------------------------------------------------------------------------------------------
+%       Total energy conservation
+% -------------------------------------------------------------------------------------------------------------
+\subsection{Total energy conservation}
+\label{subsec:INVARIANTS_KE+PE_vect}
+
+The discrete form of the total energy conservation, \autoref{eq:INVARIANTS_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
+\end{flalign*}
+which in vector invariant forms, it leads to:
+\begin{equation}
+  \label{eq:INVARIANTS_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}
+\end{equation}
+
+Substituting the discrete expression of the time derivative of the velocity either in vector invariant,
+leads to the discrete equivalent of the four equations \autoref{eq:INVARIANTS_E_tot_flux}.
+
+% -------------------------------------------------------------------------------------------------------------
+%       Vorticity term (coriolis + vorticity part of the advection)
+% -------------------------------------------------------------------------------------------------------------
+\subsection{Vorticity term (coriolis + vorticity part of the advection)}
+\label{subsec:INVARIANTS_vor}
+
+Let $q$, located at $f$-points, be either the relative ($q=\zeta / e_{3f}$),
+or the planetary ($q=f/e_{3f}$), or the total potential vorticity ($q=(\zeta +f) /e_{3f}$).
+Two discretisation of the vorticity term (ENE and EEN) allows the conservation of the kinetic energy.
+% -------------------------------------------------------------------------------------------------------------
+%       Vorticity Term with ENE scheme
+% -------------------------------------------------------------------------------------------------------------
+\subsubsection{Vorticity term with ENE scheme (\protect\np{ln\_dynvor\_ene}\forcode{ = .true.})}
+\label{subsec:INVARIANTS_vorENE}
+
+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)
+\]
+
+This formulation does not conserve the enstrophy but it does conserve the total kinetic energy.
+Indeed, the kinetic energy tendency associated to the vorticity term and
+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}
+  }
+\end{flalign*}
+In other words, the domain averaged kinetic energy does not change due to the vorticity term.
+
+% -------------------------------------------------------------------------------------------------------------
+%       Vorticity Term with EEN scheme
+% -------------------------------------------------------------------------------------------------------------
+\subsubsection{Vorticity term with EEN scheme (\protect\np{ln\_dynvor\_een}\forcode{ = .true.})}
+\label{subsec:INVARIANTS_vorEEN_vect}
+
+With the EEN scheme, the vorticity terms are represented as:
+\begin{equation}
+  \label{eq:INVARIANTS_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.
+\end{equation}
+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:
+\begin{equation}
+  \label{eq:INVARIANTS_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)
+\end{equation}
+
+This formulation does conserve the total kinetic energy.
+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*}
+
+% -------------------------------------------------------------------------------------------------------------
+%       Gradient of Kinetic Energy / Vertical Advection
+% -------------------------------------------------------------------------------------------------------------
+\subsubsection{Gradient of kinetic energy / Vertical advection}
+\label{subsec:INVARIANTS_zad}
+
+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 }
+\]
+Indeed, using successively \autoref{eq:DOM_di_adj} (\ie\ the skew symmetry property of the $\delta$ operator)
+and the continuity equation, then \autoref{eq:DOM_di_adj} again,
+then the commutativity of operators $\overline {\,\cdot \,}$ and $\delta$, and finally \autoref{eq:DOM_mi_adj}
+(\ie\ the symmetry property of the $\overline {\,\cdot \,}$ 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:INVARIANTS_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*}
+
+There is two main points here.
+First, the satisfaction of this property links the choice of the discrete formulation of the vertical advection and
+of the horizontal gradient of KE.
+Choosing one imposes the other.
+For example KE can also be discretized as $1/2\,({\overline u^{\,i}}^2 + {\overline v^{\,j}}^2)$.
+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)
+\]
+a formulation that requires an additional horizontal mean in contrast with the one used in \NEMO.
+Nine velocity points have to be used instead of 3.
+This is the reason why it has not been chosen.
+
+Second, as soon as the chosen $s$-coordinate depends on time,
+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}
+\end{flalign*}
+which is (over-)satified by defining the vertical scale factor as follows:
+\begin{flalign*}
+  % \label{eq:INVARIANTS_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.....
+
+
+% -------------------------------------------------------------------------------------------------------------
+%       Pressure Gradient Term
+% -------------------------------------------------------------------------------------------------------------
+\subsection{Pressure gradient term}
+\label{subsec:INVARIANTS_2.6}
+
+\gmcomment{
+  A pressure gradient has no contribution to the evolution of the vorticity as the curl of a gradient is zero.
+  In the $z$-coordinate, this property is satisfied locally on a C-grid with 2nd order finite differences
+  (property \autoref{eq:DOM_curl_grad}).
+}
+
+When the equation of state is linear
+(\ie\ when an advection-diffusion equation for density can be derived from those of temperature and salinity)
+the change of KE due to the work of pressure forces is balanced by
+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 g\, \rho \; \partial_t (z)  \;dv
+\]
+
+This property can be satisfied in a discrete sense for both $z$- and $s$-coordinates.
+Indeed, defining the depth of a $T$-point, $z_t$,
+as the sum of the vertical scale factors at $w$-points starting from the surface,
+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}, \ie\ the skew symmetry property of
+    the $\delta$ operator, \autoref{eq:DYN_wzv}, the continuity equation, \autoref{eq:DYN_hpg_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:INVARIANTS_KE+PE_vect_discrete}.
+It remains to demonstrate that the last term,
+which is obviously a discrete analogue of $\int_D \frac{p}{e_3} \partial_t (e_3)\;dv$ is equal to
+the last term of \autoref{eq:INVARIANTS_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\}
+\end{flalign*}
+
+Let introduce $p_w$ the pressure at $w$-point such that $\delta_k [p_w] = - \rho \,g\,e_{3t}$.
+The right-hand-side of the above equation can be transformed as follows:
+
+\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\}
+  \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\}
+\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\}
+\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\}
+\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*}
+  %
+}
+%end gm comment
+
+Note that this property strongly constrains the discrete expression of both the depth of $T-$points and
+of the term added to the pressure gradient in the $s$-coordinate.
+Nevertheless, it is almost never satisfied since a linear equation of state is rarely used.
+
+% ================================================================
+% Discrete Total energy Conservation : flux form
+% ================================================================
+\section{Discrete total energy conservation: flux form}
+\label{sec:INVARIANTS_3}
+
+% -------------------------------------------------------------------------------------------------------------
+%       Total energy conservation
+% -------------------------------------------------------------------------------------------------------------
+\subsection{Total energy conservation}
+\label{subsec:INVARIANTS_KE+PE_flux}
+
+The discrete form of the total energy conservation, \autoref{eq:INVARIANTS_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  \\
+\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\} \\
+\end{flalign*}
+
+Substituting the discrete expression of the time derivative of the velocity either in
+vector invariant or in flux form, leads to the discrete equivalent of the ????
+
+
+% -------------------------------------------------------------------------------------------------------------
+%       Coriolis and advection terms: flux form
+% -------------------------------------------------------------------------------------------------------------
+\subsection{Coriolis and advection terms: flux form}
+\label{subsec:INVARIANTS_3.2}
+
+% -------------------------------------------------------------------------------------------------------------
+%       Coriolis plus ``metric'' Term
+% -------------------------------------------------------------------------------------------------------------
+\subsubsection{Coriolis plus ``metric'' term}
+\label{subsec:INVARIANTS_3.3}
+
+In flux from the vorticity term reduces to a Coriolis term in which
+the Coriolis parameter has been modified to account for the ``metric'' term.
+This altered Coriolis parameter is discretised at an f-point.
+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)
+\]
+
+Either the ENE or EEN scheme is then applied to obtain the vorticity term in flux form.
+It therefore conserves the total KE.
+The derivation is the same as for the vorticity term in the vector invariant form (\autoref{subsec:INVARIANTS_vor}).
+
+% -------------------------------------------------------------------------------------------------------------
+%       Flux form advection
+% -------------------------------------------------------------------------------------------------------------
+\subsubsection{Flux form advection}
+\label{subsec:INVARIANTS_3.4}
+
+The flux form operator of the momentum advection is evaluated using
+a centered second order finite difference scheme.
+Because of the flux form, the discrete operator does not contribute to the global budget of linear momentum.
+Because of the centered second order scheme, it conserves the horizontal kinetic energy, that is:
+
+\begin{equation}
+  \label{eq:INVARIANTS_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
+\end{equation}
+
+Let us first consider the first term of the scalar product
+(\ie\ 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\}    &&& \\
+\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\}
+\]
+which is the discrete form of $ \frac{1}{2} \int_D u \cdot \nabla \cdot \left(   \textbf{U}\,u   \right) \; dv $.
+\autoref{eq:INVARIANTS_ADV_KE_flux} is thus satisfied.
+
+When the UBS scheme is used to evaluate the flux form momentum advection,
+the discrete operator does not contribute to the global budget of linear momentum (flux form).
+The horizontal kinetic energy is not conserved, but forced to decay (\ie\ the scheme is diffusive).
+
+% ================================================================
+% Discrete Enstrophy Conservation
+% ================================================================
+\section{Discrete enstrophy conservation}
+\label{sec:INVARIANTS_4}
+
+% -------------------------------------------------------------------------------------------------------------
+%       Vorticity Term with ENS scheme
+% -------------------------------------------------------------------------------------------------------------
+\subsubsection{Vorticity term with ENS scheme  (\protect\np{ln\_dynvor\_ens}\forcode{ = .true.})}
+\label{subsec:INVARIANTS_vorENS}
+
+In the ENS scheme, the vorticity term is descretized as follows:
+\begin{equation}
+  \label{eq:INVARIANTS_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.
+\end{equation}
+
+The scheme does not allow but the conservation of the total kinetic energy but the conservation of $q^2$,
+the potential enstrophy for a horizontally non-divergent flow (\ie\ when $\chi$=$0$).
+Indeed, using the symmetry or skew symmetry properties of the operators
+( \autoref{eq:DOM_mi_adj} and \autoref{eq:DOM_di_adj}),
+it can be shown that:
+\begin{equation}
+  \label{eq:INVARIANTS_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
+\end{equation}
+where $dv=e_1\,e_2\,e_3 \; di\,dj\,dk$ is the volume element.
+Indeed, using \autoref{eq:DYN_vor_ens},
+the discrete form of the right hand side of \autoref{eq:INVARIANTS_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}
+  }
+\end{flalign*}
+The later equality is obtain only when the flow is horizontally non-divergent, \ie\ $\chi$=$0$.
+
+% -------------------------------------------------------------------------------------------------------------
+%       Vorticity Term with EEN scheme
+% -------------------------------------------------------------------------------------------------------------
+\subsubsection{Vorticity Term with EEN scheme (\protect\np{ln\_dynvor\_een}\forcode{ = .true.})}
+\label{subsec:INVARIANTS_vorEEN}
+
+With the EEN scheme, the vorticity terms are represented as:
+\begin{equation}
+  \label{eq:INVARIANTS_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.
+\end{equation}
+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:
+\begin{equation}
+  \tag{\ref{eq:INVARIANTS_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)
+\end{equation}
+
+This formulation does conserve the potential enstrophy for a horizontally non-divergent flow (\ie\ $\chi=0$).
+
+Let consider one of the vorticity triad, for example ${^{i}_j}\mathbb{Q}^{+1/2}_{+1/2} $,
+similar manipulation can be done for the 3 others.
+The discrete form of the right hand side of \autoref{eq:INVARIANTS_1.1} applied to
+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*}
+
+% ================================================================
+% Conservation Properties on Tracers
+% ================================================================
+\section{Conservation properties on tracers}
+\label{sec:INVARIANTS_5}
+
+All the numerical schemes used in \NEMO\ are written such that the tracer content is conserved by
+the internal dynamics and physics (equations in flux form).
+For advection,
+only the CEN2 scheme (\ie\ $2^{nd}$ order finite different scheme) conserves the global variance of tracer.
+Nevertheless the other schemes ensure that the global variance decreases
+(\ie\ they are at least slightly diffusive).
+For diffusion, all the schemes ensure the decrease of the total tracer variance, except the iso-neutral operator.
+There is generally no strict conservation of mass,
+as the equation of state is non linear with respect to $T$ and $S$.
+In practice, the mass is conserved to a very high accuracy.
+% -------------------------------------------------------------------------------------------------------------
+%       Advection Term
+% -------------------------------------------------------------------------------------------------------------
+\subsection{Advection term}
+\label{subsec:INVARIANTS_5.1}
+
+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
+\]
+
+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*}
+
+Whatever the advection scheme considered it conserves of the tracer content as
+all the scheme are written in flux form.
+Indeed, let $T$ be the tracer and its $\tau_u$, $\tau_v$, and $\tau_w$ interpolated values at velocity point
+(whatever the interpolation is),
+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]
+ 	 + \delta_k \left[ W \;\tau_w \right] \right\}   && \\
+  &\equiv 0 &&&
+\end{flalign*}
+
+The conservation of the variance of tracer due to the advection tendency can be achieved only with the CEN2 scheme,
+\ie\ when $\tau_u= \overline T^{\,i+1/2}$, $\tau_v= \overline T^{\,j+1/2}$, and $\tau_w= \overline T^{\,k+1/2}$.
+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\}      &&& \\
+\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 }$.
+
+% ================================================================
+% Conservation Properties on Lateral Momentum Physics
+% ================================================================
+\section{Conservation properties on lateral momentum physics}
+\label{sec:INVARIANTS_dynldf_properties}
+
+The discrete formulation of the horizontal diffusion of momentum ensures
+the conservation of potential vorticity and the horizontal divergence,
+and the dissipation of the square of these quantities
+(\ie\ enstrophy and the variance of the horizontal divergence) as well as
+the dissipation of the horizontal kinetic energy.
+In particular, when the eddy coefficients are horizontally uniform,
+it ensures a complete separation of vorticity and horizontal divergence fields,
+so that diffusion (dissipation) of vorticity (enstrophy) does not generate horizontal divergence
+(variance of the horizontal divergence) and \textit{vice versa}.
+
+These properties of the horizontal diffusion operator are a direct consequence of
+properties \autoref{eq:DOM_curl_grad} and \autoref{eq:DOM_div_curl}.
+When the vertical curl of the horizontal diffusion of momentum (discrete sense) is taken,
+the term associated with the horizontal gradient of the divergence is locally zero.
+
+% -------------------------------------------------------------------------------------------------------------
+%       Conservation of Potential Vorticity
+% -------------------------------------------------------------------------------------------------------------
+\subsection{Conservation of potential vorticity}
+\label{subsec:INVARIANTS_6.1}
+
+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]
+	 + \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
+  \\
+\end{flalign*}
+
+% -------------------------------------------------------------------------------------------------------------
+%       Dissipation of Horizontal Kinetic Energy
+% -------------------------------------------------------------------------------------------------------------
+\subsection{Dissipation of horizontal kinetic energy}
+\label{subsec:INVARIANTS_6.2}
+
+The lateral momentum diffusion term dissipates the horizontal kinetic energy:
+%\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}
+\]
+
+% -------------------------------------------------------------------------------------------------------------
+%       Dissipation of Enstrophy
+% -------------------------------------------------------------------------------------------------------------
+\subsection{Dissipation of enstrophy}
+\label{subsec:INVARIANTS_6.3}
+
+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    &&&\\
+\end{flalign*}
+
+% -------------------------------------------------------------------------------------------------------------
+%       Conservation of Horizontal Divergence
+% -------------------------------------------------------------------------------------------------------------
+\subsection{Conservation of horizontal divergence}
+\label{subsec:INVARIANTS_6.4}
+
+When the horizontal divergence of the horizontal diffusion of momentum (discrete sense) is taken,
+the term associated with the vertical curl of the vorticity is zero locally, due to \autoref{eq:DOM_div_curl}.
+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
+\end{flalign*}
+
+% -------------------------------------------------------------------------------------------------------------
+%       Dissipation of Horizontal Divergence Variance
+% -------------------------------------------------------------------------------------------------------------
+\subsection{Dissipation of horizontal divergence variance}
+\label{subsec:INVARIANTS_6.5}
+
+\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
+\end{flalign*}
+
+% ================================================================
+% Conservation Properties on Vertical Momentum Physics
+% ================================================================
+\section{Conservation properties on vertical momentum physics}
+\label{sec:INVARIANTS_7}
+
+As for the lateral momentum physics,
+the continuous form of the vertical diffusion of momentum satisfies several integral constraints.
+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
+\end{align*}
+
+The first property is obvious.
+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   &&&
+\end{flalign*}
+
+The vorticity is also conserved.
+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   &&
+\end{flalign*}
+
+If the vertical diffusion coefficient is uniform over the whole domain, the enstrophy is dissipated, \ie
+\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   &&&
+\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\}  &&
+\end{flalign*}
+Using the fact that the vertical diffusion coefficients are uniform,
+and that in $z$-coordinate, the vertical scale factors do not depend on $i$ and $j$ so that:
+$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    &&&
+\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    &&&
+\end{flalign*}
+and the square of the horizontal divergence decreases (\ie\ the horizontal divergence is dissipated) if
+the vertical diffusion coefficient is uniform over the whole domain:
+
+\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  &&&
+\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    &&&
+\end{flalign*}
+
+% ================================================================
+% Conservation Properties on Tracer Physics
+% ================================================================
+\section{Conservation properties on tracer physics}
+\label{sec:INVARIANTS_8}
+
+The numerical schemes used for tracer subgridscale physics are written such that
+the heat and salt contents are conserved (equations in flux form).
+Since a flux form is used to compute the temperature and salinity,
+the quadratic form of these quantities (\ie\ their variance) globally tends to diminish.
+As for the advection term, there is conservation of mass only if the Equation Of Seawater is linear.
+
+% -------------------------------------------------------------------------------------------------------------
+%       Conservation of Tracers
+% -------------------------------------------------------------------------------------------------------------
+\subsection{Conservation of tracers}
+\label{subsec:INVARIANTS_8.1}
+
+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
+  &&
+\end{flalign*}
+
+In fact, this property simply results from the flux form of the operator.
+
+% -------------------------------------------------------------------------------------------------------------
+%       Dissipation of Tracer Variance
+% -------------------------------------------------------------------------------------------------------------
+\subsection{Dissipation of tracer variance}
+\label{subsec:INVARIANTS_8.2}
+
+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*}
+
+%%%%  end of appendix in gm comment
+%}
+\biblio
+
+\pindex
+
+\end{document}
Index: /NEMO/trunk/doc/latex/NEMO/subfiles/apdx_s_coord.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/subfiles/apdx_s_coord.tex	(revision 11543)
+++ /NEMO/trunk/doc/latex/NEMO/subfiles/apdx_s_coord.tex	(revision 11543)
@@ -0,0 +1,600 @@
+\documentclass[../main/NEMO_manual]{subfiles}
+
+\begin{document}
+
+% ================================================================
+% Chapter Appendix A : Curvilinear s-Coordinate Equations
+% ================================================================
+\chapter{Curvilinear $s-$Coordinate Equations}
+\label{apdx:SCOORD}
+
+\chaptertoc
+
+\vfill
+\begin{figure}[b]
+\subsubsection*{Changes record}
+\begin{tabular}{l||l|m{0.65\linewidth}}
+    Release   & Author        & Modifications \\
+    {\em 4.0} & {\em Mike Bell} & {\em review}  \\
+    {\em 3.x} & {\em Gurvan Madec} & {\em original}  \\
+\end{tabular}
+\end{figure}
+
+
+\newpage
+
+% ================================================================
+% Chain rule
+% ================================================================
+\section{Chain rule for $s-$coordinates}
+\label{sec:SCOORD_chain}
+
+In order to establish the set of Primitive Equation in curvilinear $s$-coordinates
+(\ie\ an orthogonal curvilinear coordinate in the horizontal and
+an Arbitrary Lagrangian Eulerian (ALE) coordinate in the vertical),
+we start from the set of equations established in \autoref{subsec:MB_zco_Eq} for
+the special case $k = z$ and thus $e_3 = 1$,
+and we introduce an arbitrary vertical coordinate $a = a(i,j,z,t)$.
+Let us define a new vertical scale factor by $e_3 = \partial z / \partial s$ (which now depends on $(i,j,z,t)$) and
+the horizontal slope of $s-$surfaces by:
+\begin{equation}
+  \label{eq:SCOORD_s_slope}
+  \sigma_1 =\frac{1}{e_1 } \; \left. {\frac{\partial z}{\partial i}} \right|_s
+  \quad \text{and} \quad
+  \sigma_2 =\frac{1}{e_2 } \; \left. {\frac{\partial z}{\partial j}} \right|_s .
+\end{equation}
+
+The model fields (e.g. pressure $p$) can be viewed as functions of $(i,j,z,t)$ (e.g. $p(i,j,z,t)$) or as
+functions of $(i,j,s,t)$ (e.g. $p(i,j,s,t)$). The symbol $\bullet$ will be used to represent any one of
+these fields.  Any ``infinitesimal'' change in $\bullet$ can be written in two forms:
+\begin{equation}
+  \label{eq:SCOORD_s_infin_changes}
+  \begin{aligned}
+    & \delta \bullet =  \delta i \left. \frac{ \partial \bullet }{\partial i} \right|_{j,s,t}
+                + \delta j \left. \frac{ \partial \bullet }{\partial i} \right|_{i,s,t}
+                + \delta s \left. \frac{ \partial \bullet }{\partial s} \right|_{i,j,t}
+                + \delta t \left. \frac{ \partial \bullet }{\partial t} \right|_{i,j,s} , \\
+    & \delta \bullet =  \delta i \left. \frac{ \partial \bullet }{\partial i} \right|_{j,z,t}
+                + \delta j \left. \frac{ \partial \bullet }{\partial i} \right|_{i,z,t}
+                + \delta z \left. \frac{ \partial \bullet }{\partial z} \right|_{i,j,t}
+                + \delta t \left. \frac{ \partial \bullet }{\partial t} \right|_{i,j,z} .
+  \end{aligned}
+\end{equation}
+Using the first form and considering a change $\delta i$ with $j, z$ and $t$ held constant, shows that
+\begin{equation}
+  \label{eq:SCOORD_s_chain_rule}
+      \left. {\frac{\partial \bullet }{\partial i}} \right|_{j,z,t}  =
+      \left. {\frac{\partial \bullet }{\partial i}} \right|_{j,s,t}
+    + \left. {\frac{\partial s       }{\partial i}} \right|_{j,z,t} \;
+      \left. {\frac{\partial \bullet }{\partial s}} \right|_{i,j,t} .
+\end{equation}
+The term $\left. \partial s / \partial i \right|_{j,z,t}$ can be related to the slope of constant $s$ surfaces,
+(\autoref{eq:SCOORD_s_slope}), by applying the second of (\autoref{eq:SCOORD_s_infin_changes}) with $\bullet$ set to
+$s$ and $j, t$ held constant
+\begin{equation}
+\label{eq:SCOORD_delta_s}
+\delta s|_{j,t} =
+         \delta i \left. \frac{ \partial s }{\partial i} \right|_{j,z,t}
+       + \delta z \left. \frac{ \partial s }{\partial z} \right|_{i,j,t} .
+\end{equation}
+Choosing to look at a direction in the $(i,z)$ plane in which $\delta s = 0$ and using
+(\autoref{eq:SCOORD_s_slope}) we obtain
+\begin{equation}
+\left. \frac{ \partial s }{\partial i} \right|_{j,z,t} =
+         -  \left. \frac{ \partial z }{\partial i} \right|_{j,s,t} \;
+            \left. \frac{ \partial s }{\partial z} \right|_{i,j,t}
+	 = - \frac{e_1 }{e_3 }\sigma_1  .
+\label{eq:SCOORD_ds_di_z}
+\end{equation}
+Another identity, similar in form to (\autoref{eq:SCOORD_ds_di_z}), can be derived
+by choosing $\bullet$ to be $s$ and using the second form of (\autoref{eq:SCOORD_s_infin_changes}) to consider
+changes in which $i , j$ and $s$ are constant. This shows that
+\begin{equation}
+\label{eq:SCOORD_w_in_s}
+w_s = \left. \frac{ \partial z }{\partial t} \right|_{i,j,s} =
+- \left. \frac{ \partial z }{\partial s} \right|_{i,j,t}
+  \left. \frac{ \partial s }{\partial t} \right|_{i,j,z}
+  = - e_3 \left. \frac{ \partial s }{\partial t} \right|_{i,j,z} .
+\end{equation}
+
+In what follows, for brevity, indication of the constancy of the $i, j$ and $t$ indices is
+usually omitted. Using the arguments outlined above one can show that the chain rules needed to establish
+the model equations in the curvilinear $s-$coordinate system are:
+\begin{equation}
+  \label{eq:SCOORD_s_chain_rule}
+  \begin{aligned}
+    &\left. {\frac{\partial \bullet }{\partial t}} \right|_z  =
+    \left. {\frac{\partial \bullet }{\partial t}} \right|_s
+	 + \frac{\partial \bullet }{\partial s}\; \frac{\partial s}{\partial t} , \\
+    &\left. {\frac{\partial \bullet }{\partial i}} \right|_z  =
+    \left. {\frac{\partial \bullet }{\partial i}} \right|_s
+    +\frac{\partial \bullet }{\partial s}\; \frac{\partial s}{\partial i}=
+    \left. {\frac{\partial \bullet }{\partial i}} \right|_s
+    -\frac{e_1 }{e_3 }\sigma_1 \frac{\partial \bullet }{\partial s} , \\
+    &\left. {\frac{\partial \bullet }{\partial j}} \right|_z  =
+    \left. {\frac{\partial \bullet }{\partial j}} \right|_s
+    + \frac{\partial \bullet }{\partial s}\;\frac{\partial s}{\partial j}=
+    \left. {\frac{\partial \bullet }{\partial j}} \right|_s
+    - \frac{e_2 }{e_3 }\sigma_2 \frac{\partial \bullet }{\partial s} , \\
+    &\;\frac{\partial \bullet }{\partial z}  \;\; = \frac{1}{e_3 }\frac{\partial \bullet }{\partial s} .
+  \end{aligned}
+\end{equation}
+
+
+% ================================================================
+% continuity equation
+% ================================================================
+\section{Continuity equation in $s-$coordinates}
+\label{sec:SCOORD_continuity}
+
+Using (\autoref{eq:SCOORD_s_chain_rule}) and
+the fact that the horizontal scale factors $e_1$ and $e_2$ do not depend on the vertical coordinate,
+the divergence of the velocity relative to the ($i$,$j$,$z$) coordinate system is transformed as follows in order to
+obtain its expression in the curvilinear $s-$coordinate system:
+
+\begin{subequations}
+  \begin{align*}
+    {
+    \begin{array}{*{20}l}
+      \nabla \cdot {\mathrm {\mathbf U}}
+      &= \frac{1}{e_1 \,e_2 }  \left[ \left. {\frac{\partial (e_2 \,u)}{\partial i}} \right|_z
+        +\left. {\frac{\partial(e_1 \,v)}{\partial j}} \right|_z  \right]
+        + \frac{\partial w}{\partial z} \\ \\
+      &     = \frac{1}{e_1 \,e_2 }  \left[
+		  \left.   \frac{\partial (e_2 \,u)}{\partial i}    \right|_s
+		  - \frac{e_1 }{e_3 } \sigma_1 \frac{\partial (e_2 \,u)}{\partial s}
+        + \left.   \frac{\partial (e_1 \,v)}{\partial j}    \right|_s
+		  - \frac{e_2 }{e_3 } \sigma_2 \frac{\partial (e_1 \,v)}{\partial s}	\right]
+        + \frac{\partial w}{\partial s} \; \frac{\partial s}{\partial z} \\ \\
+      &     = \frac{1}{e_1 \,e_2 }   \left[
+		  \left.   \frac{\partial (e_2 \,u)}{\partial i}    \right|_s
+        + \left.   \frac{\partial (e_1 \,v)}{\partial j}    \right|_s       	\right]
+        + \frac{1}{e_3 }\left[        \frac{\partial w}{\partial s}
+        -  \sigma_1 \frac{\partial u}{\partial s}
+        -  \sigma_2 \frac{\partial v}{\partial s}      \right] \\ \\
+      &     = \frac{1}{e_1 \,e_2 \,e_3 }   \left[
+		  \left.   \frac{\partial (e_2 \,e_3 \,u)}{\partial i}    \right|_s
+		  -\left.    e_2 \,u    \frac{\partial e_3 }{\partial i}     \right|_s
+        + \left.  \frac{\partial (e_1 \,e_3 \,v)}{\partial j}    \right|_s
+		  - \left.    e_1 v      \frac{\partial e_3 }{\partial j}    \right|_s   \right] \\
+      & \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad
+        + \frac{1}{e_3 } \left[        \frac{\partial w}{\partial s}
+        -  \sigma_1 \frac{\partial u}{\partial s}
+        -  \sigma_2 \frac{\partial v}{\partial s}      \right]      \\
+      %
+      \intertext{Noting that $
+      \frac{1}{e_1} \left.{ \frac{\partial e_3}{\partial i}} \right|_s
+      =\frac{1}{e_1} \left.{ \frac{\partial^2 z}{\partial i\,\partial s}} \right|_s
+      =\frac{\partial}{\partial s} \left( {\frac{1}{e_1 } \left.{ \frac{\partial z}{\partial i} }\right|_s } \right)
+      =\frac{\partial \sigma_1}{\partial s}
+      $ and $
+      \frac{1}{e_2 }\left. {\frac{\partial e_3 }{\partial j}} \right|_s
+      =\frac{\partial \sigma_2}{\partial s}
+      $, it becomes:}
+    %
+      \nabla \cdot {\mathrm {\mathbf U}}
+      & = \frac{1}{e_1 \,e_2 \,e_3 }  \left[
+		  \left.  \frac{\partial (e_2 \,e_3 \,u)}{\partial i} \right|_s
+        +\left.  \frac{\partial (e_1 \,e_3 \,v)}{\partial j} \right|_s        \right] \\
+      & \qquad \qquad \qquad \qquad \quad
+        +\frac{1}{e_3 }\left[ {\frac{\partial w}{\partial s}-u\frac{\partial \sigma_1 }{\partial s}-v\frac{\partial \sigma_2 }{\partial s}-\sigma_1 \frac{\partial u}{\partial s}-\sigma_2 \frac{\partial v}{\partial s}} \right] \\
+      \\
+      & = \frac{1}{e_1 \,e_2 \,e_3 }  \left[
+		  \left.  \frac{\partial (e_2 \,e_3 \,u)}{\partial i} \right|_s
+        +\left.  \frac{\partial (e_1 \,e_3 \,v)}{\partial j} \right|_s        \right]
+        + \frac{1}{e_3 } \; \frac{\partial}{\partial s}   \left[  w -  u\;\sigma_1  - v\;\sigma_2  \right]
+    \end{array}
+        }
+  \end{align*}
+\end{subequations}
+
+Here, $w$ is the vertical velocity relative to the $z-$coordinate system.
+Using the first form of (\autoref{eq:SCOORD_s_infin_changes})
+and the definitions (\autoref{eq:SCOORD_s_slope}) and (\autoref{eq:SCOORD_w_in_s}) for $\sigma_1$, $\sigma_2$ and  $w_s$,
+one can show that the vertical velocity, $w_p$ of a point
+moving with the horizontal velocity of the fluid along an $s$ surface is given by
+\begin{equation}
+\label{eq:SCOORD_w_p}
+\begin{split}
+w_p  = & \left. \frac{ \partial z }{\partial t} \right|_s
+     + \frac{u}{e_1} \left. \frac{ \partial z }{\partial i} \right|_s
+     + \frac{v}{e_2} \left. \frac{ \partial z }{\partial j} \right|_s \\
+     = & w_s + u \sigma_1 + v \sigma_2 .
+\end{split}
+\end{equation}
+ The vertical velocity across this surface is denoted by
+\begin{equation}
+  \label{eq:SCOORD_w_s}
+  \omega  = w - w_p = w - ( w_s + \sigma_1 \,u + \sigma_2 \,v )  .
+\end{equation}
+Hence
+\begin{equation}
+\frac{1}{e_3 } \frac{\partial}{\partial s}   \left[  w -  u\;\sigma_1  - v\;\sigma_2  \right] =
+\frac{1}{e_3 } \frac{\partial}{\partial s} \left[  \omega + w_s \right] =
+   \frac{1}{e_3 } \left[ \frac{\partial \omega}{\partial s}
+ + \left. \frac{ \partial }{\partial t} \right|_s \frac{\partial z}{\partial s} \right] =
+   \frac{1}{e_3 } \frac{\partial \omega}{\partial s} + \frac{1}{e_3 } \left. \frac{ \partial e_3}{\partial t} . \right|_s
+\end{equation}
+
+Using (\autoref{eq:SCOORD_w_s}) in our expression for $\nabla \cdot {\mathrm {\mathbf U}}$ we obtain
+our final expression for the divergence of the velocity in the curvilinear $s-$coordinate system:
+\begin{equation}
+      \nabla \cdot {\mathrm {\mathbf U}} =
+         \frac{1}{e_1 \,e_2 \,e_3 }    \left[
+		  \left.  \frac{\partial (e_2 \,e_3 \,u)}{\partial i} \right|_s
+        +\left.  \frac{\partial (e_1 \,e_3 \,v)}{\partial j} \right|_s        \right]
+        + \frac{1}{e_3 } \frac{\partial \omega }{\partial s}
+        + \frac{1}{e_3 } \left. \frac{\partial e_3}{\partial t} \right|_s .
+\end{equation}
+
+As a result, the continuity equation \autoref{eq:MB_PE_continuity} in the $s-$coordinates is:
+\begin{equation}
+  \label{eq:SCOORD_sco_Continuity}
+  \frac{1}{e_3 } \frac{\partial e_3}{\partial t}
+  + \frac{1}{e_1 \,e_2 \,e_3 }\left[
+    {\left. {\frac{\partial (e_2 \,e_3 \,u)}{\partial i}} \right|_s
+      +  \left. {\frac{\partial (e_1 \,e_3 \,v)}{\partial j}} \right|_s } \right]
+  +\frac{1}{e_3 }\frac{\partial \omega }{\partial s} = 0 .
+\end{equation}
+An additional term has appeared that takes into account
+the contribution of the time variation of the vertical coordinate to the volume budget.
+
+
+% ================================================================
+% momentum equation
+% ================================================================
+\section{Momentum equation in $s-$coordinate}
+\label{sec:SCOORD_momentum}
+
+Here we only consider the first component of the momentum equation,
+the generalization to the second one being straightforward.
+
+$\bullet$ \textbf{Total derivative in vector invariant form}
+
+Let us consider \autoref{eq:MB_dyn_vect}, the first component of the momentum equation in the vector invariant form.
+Its total $z-$coordinate time derivative,
+$\left. \frac{D u}{D t} \right|_z$ can be transformed as follows in order to obtain
+its expression in the curvilinear $s-$coordinate system:
+
+\begin{subequations}
+  \begin{align*}
+    {
+    \begin{array}{*{20}l}
+      \left. \frac{D u}{D t} \right|_z
+      &= \left. {\frac{\partial u }{\partial t}} \right|_z
+        - \left. \zeta \right|_z v
+        + \frac{1}{2e_1} \left.{ \frac{\partial (u^2+v^2)}{\partial i}} \right|_z
+        + w \;\frac{\partial u}{\partial z} \\ \\
+      &= \left. {\frac{\partial u }{\partial t}} \right|_z
+        -  \frac{1}{e_1 \,e_2 }\left[ { \left.{ \frac{\partial (e_2 \,v)}{\partial i} }\right|_z
+        -\left.{ \frac{\partial (e_1 \,u)}{\partial j} }\right|_z } \right] \; v
+        +  \frac{1}{2e_1} \left.{ \frac{\partial (u^2+v^2)}{\partial i} } \right|_z
+        +  w \;\frac{\partial u}{\partial z}      \\
+        %
+      \intertext{introducing the chain rule (\autoref{eq:SCOORD_s_chain_rule}) }
+      %
+      &= \left. {\frac{\partial u }{\partial t}} \right|_z
+        - \frac{1}{e_1\,e_2}\left[ { \left.{ \frac{\partial (e_2 \,v)}{\partial i} } \right|_s
+        -\left.{ \frac{\partial (e_1 \,u)}{\partial j} } \right|_s } \right.
+        \left. {-\frac{e_1}{e_3}\sigma_1 \frac{\partial (e_2 \,v)}{\partial s}
+        +\frac{e_2}{e_3}\sigma_2 \frac{\partial (e_1 \,u)}{\partial s}} \right] \; v  \\
+      & \qquad \qquad \qquad \qquad
+        {
+        + \frac{1}{2e_1} \left(                                  \left.  \frac{\partial (u^2+v^2)}{\partial i} \right|_s
+        - \frac{e_1}{e_3}\sigma_1 \frac{\partial (u^2+v^2)}{\partial s}               \right)
+        + \frac{w}{e_3 } \;\frac{\partial u}{\partial s}
+        } \\ \\
+      &= \left. {\frac{\partial u }{\partial t}} \right|_z
+        - \left. \zeta \right|_s \;v
+        + \frac{1}{2\,e_1}\left. {\frac{\partial (u^2+v^2)}{\partial i}} \right|_s \\
+      &\qquad \qquad \qquad \quad
+        + \frac{w}{e_3 } \;\frac{\partial u}{\partial s}
+        + \left[   {\frac{\sigma_1 }{e_3 }\frac{\partial v}{\partial s}
+        - \frac{\sigma_2 }{e_3 }\frac{\partial u}{\partial s}}   \right]\;v
+        - \frac{\sigma_1 }{2e_3 }\frac{\partial (u^2+v^2)}{\partial s} \\ \\
+      &= \left. {\frac{\partial u }{\partial t}} \right|_z
+        - \left. \zeta \right|_s \;v
+        + \frac{1}{2\,e_1}\left. {\frac{\partial (u^2+v^2)}{\partial i}} \right|_s \\
+      &\qquad \qquad \qquad \quad
+        + \frac{1}{e_3} \left[    {w\frac{\partial u}{\partial s}
+        +\sigma_1 v\frac{\partial v}{\partial s} - \sigma_2 v\frac{\partial u}{\partial s}
+        - \sigma_1 u\frac{\partial u}{\partial s} - \sigma_1 v\frac{\partial v}{\partial s}} \right] \\ \\
+      &= \left. {\frac{\partial u }{\partial t}} \right|_z
+        - \left. \zeta \right|_s \;v
+        + \frac{1}{2\,e_1}\left. {\frac{\partial (u^2+v^2)}{\partial i}} \right|_s
+        + \frac{1}{e_3} \left[  w - \sigma_2 v - \sigma_1 u  \right]
+        \; \frac{\partial u}{\partial s} .  \\
+        %
+      \intertext{Introducing $\omega$, the dia-s-surface velocity given by (\autoref{eq:SCOORD_w_s}) }
+      %
+      &= \left. {\frac{\partial u }{\partial t}} \right|_z
+        - \left. \zeta \right|_s \;v
+        + \frac{1}{2\,e_1}\left. {\frac{\partial (u^2+v^2)}{\partial i}} \right|_s
+        + \frac{1}{e_3 } \left( \omega + w_s \right) \frac{\partial u}{\partial s}   \\
+    \end{array}
+    }
+  \end{align*}
+\end{subequations}
+%
+Applying the time derivative chain rule (first equation of (\autoref{eq:SCOORD_s_chain_rule})) to $u$ and
+using (\autoref{eq:SCOORD_w_in_s}) provides the expression of the last term of the right hand side,
+\[
+  {
+    \begin{array}{*{20}l}
+      \frac{w_s}{e_3}  \;\frac{\partial u}{\partial s}
+      = - \left. \frac{\partial s}{\partial t} \right|_z \;  \frac{\partial u }{\partial s}
+      = \left. {\frac{\partial u }{\partial t}} \right|_s  - \left. {\frac{\partial u }{\partial t}} \right|_z \ .
+    \end{array}
+  }
+\]
+This leads to the $s-$coordinate formulation of the total $z-$coordinate time derivative,
+\ie\ the total $s-$coordinate time derivative :
+\begin{align}
+  \label{eq:SCOORD_sco_Dt_vect}
+  \left. \frac{D u}{D t} \right|_s
+  = \left. {\frac{\partial u }{\partial t}} \right|_s
+  - \left. \zeta \right|_s \;v
+  + \frac{1}{2\,e_1}\left. {\frac{\partial (u^2+v^2)}{\partial i}} \right|_s
+  + \frac{1}{e_3 } \omega \;\frac{\partial u}{\partial s} .
+\end{align}
+Therefore, the vector invariant form of the total time derivative has exactly the same mathematical form in
+$z-$ and $s-$coordinates.
+This is not the case for the flux form as shown in next paragraph.
+
+$\bullet$ \textbf{Total derivative in flux form}
+
+Let us start from the total time derivative in the curvilinear $s-$coordinate system we have just establish.
+Following the procedure used to establish (\autoref{eq:MB_flux_form}), it can be transformed into :
+% \begin{subequations}
+\begin{align*}
+  {
+  \begin{array}{*{20}l}
+    \left. \frac{D u}{D t} \right|_s  &= \left. {\frac{\partial u }{\partial t}} \right|_s
+    & -  \zeta \;v
+      + \frac{1}{2\;e_1 } \frac{\partial \left( {u^2+v^2} \right)}{\partial i}
+      + \frac{1}{e_3} \omega \;\frac{\partial u}{\partial s} \\ \\
+                                      &= \left. {\frac{\partial u }{\partial t}} \right|_s
+    &+\frac{1}{e_1\;e_2}  \left(    \frac{\partial \left( {e_2 \,u\,u } \right)}{\partial i}
+      + \frac{\partial \left( {e_1 \,u\,v } \right)}{\partial j}     \right)
+      + \frac{1}{e_3 } \frac{\partial \left( {\omega\,u} \right)}{\partial s} \\ \\
+                                      &&- \,u \left[     \frac{1}{e_1 e_2 } \left(    \frac{\partial(e_2 u)}{\partial i}
+                                         + \frac{\partial(e_1 v)}{\partial j}    \right)
+                                         + \frac{1}{e_3}        \frac{\partial \omega}{\partial s}                       \right] \\ \\
+                                      &&- \frac{v}{e_1 e_2 }\left(    v	\;\frac{\partial e_2 }{\partial i}
+                                         -u	\;\frac{\partial e_1 }{\partial j} 	\right) . \\
+  \end{array}
+  }
+\end{align*}
+%
+Introducing the vertical scale factor inside the horizontal derivative of the first two terms
+(\ie\ the horizontal divergence), it becomes :
+\begin{align*}
+  {
+  \begin{array}{*{20}l}
+    % \begin{align*} {\begin{array}{*{20}l}
+    %     {\begin{array}{*{20}l} \left. \frac{D u}{D t} \right|_s
+    &= \left. {\frac{\partial u }{\partial t}} \right|_s
+    &+ \frac{1}{e_1\,e_2\,e_3}  \left(  \frac{\partial( e_2 e_3 \,u^2 )}{\partial i}
+      + \frac{\partial( e_1 e_3 \,u v )}{\partial j}
+      -  e_2 u u \frac{\partial e_3}{\partial i}
+      -  e_1 u v \frac{\partial e_3 }{\partial j}    \right)
+      + \frac{1}{e_3} \frac{\partial \left( {\omega\,u} \right)}{\partial s} \\ \\
+    && - \,u \left[  \frac{1}{e_1 e_2 e_3} \left(   \frac{\partial(e_2 e_3 \, u)}{\partial i}
+       + \frac{\partial(e_1 e_3 \, v)}{\partial j}
+       -  e_2 u \;\frac{\partial e_3 }{\partial i}
+       -  e_1 v \;\frac{\partial e_3 }{\partial j}   \right)
+       + \frac{1}{e_3}        \frac{\partial \omega}{\partial s}                       \right] \\ \\
+    && - \frac{v}{e_1 e_2 }\left( 	v  \;\frac{\partial e_2 }{\partial i}
+       -u  \;\frac{\partial e_1 }{\partial j} 	\right) \\ \\
+    &= \left. {\frac{\partial u }{\partial t}} \right|_s
+    &+ \frac{1}{e_1\,e_2\,e_3}  \left(  \frac{\partial( e_2 e_3 \,u\,u )}{\partial i}
+      + \frac{\partial( e_1 e_3 \,u\,v )}{\partial j}    \right)
+      + \frac{1}{e_3 } \frac{\partial \left( {\omega\,u} \right)}{\partial s} \\ \\
+    && - \,u \left[  \frac{1}{e_1 e_2 e_3} \left(   \frac{\partial(e_2 e_3 \, u)}{\partial i}
+       + \frac{\partial(e_1 e_3 \, v)}{\partial j}  \right)
+       + \frac{1}{e_3}        \frac{\partial \omega}{\partial s}                       \right]
+       - \frac{v}{e_1 e_2 }\left( 	v   \;\frac{\partial e_2 }{\partial i}
+       -u   \;\frac{\partial e_1 }{\partial j} 	\right)     .             \\
+     %
+    \intertext {Introducing a more compact form for the divergence of the momentum fluxes,
+    and using (\autoref{eq:SCOORD_sco_Continuity}), the $s-$coordinate continuity equation,
+    it becomes : }
+  %
+    &= \left. {\frac{\partial u }{\partial t}} \right|_s
+    &+ \left.  \nabla \cdot \left(   {{\mathrm {\mathbf U}}\,u}   \right)    \right|_s
+      + \,u \frac{1}{e_3 } \frac{\partial e_3}{\partial t}
+      - \frac{v}{e_1 e_2 }\left(    v  \;\frac{\partial e_2 }{\partial i}
+      -u  \;\frac{\partial e_1 }{\partial j} 	\right)
+    \\
+  \end{array}
+  }
+\end{align*}
+which leads to the $s-$coordinate flux formulation of the total $s-$coordinate time derivative,
+\ie\ the total $s-$coordinate time derivative in flux form:
+\begin{flalign}
+  \label{eq:SCOORD_sco_Dt_flux}
+  \left. \frac{D u}{D t} \right|_s   = \frac{1}{e_3}  \left. \frac{\partial ( e_3\,u)}{\partial t} \right|_s
+  + \left.  \nabla \cdot \left(   {{\mathrm {\mathbf U}}\,u}   \right)    \right|_s
+  - \frac{v}{e_1 e_2 }\left(    v  \;\frac{\partial e_2 }{\partial i}
+    -u  \;\frac{\partial e_1 }{\partial j}            \right).
+\end{flalign}
+which is the total time derivative expressed in the curvilinear $s-$coordinate system.
+It has the same form as in the $z-$coordinate but for
+the vertical scale factor that has appeared inside the time derivative which
+comes from the modification of (\autoref{eq:SCOORD_sco_Continuity}),
+the continuity equation.
+
+$\bullet$ \textbf{horizontal pressure gradient}
+
+The horizontal pressure gradient term can be transformed as follows:
+\[
+  \begin{split}
+    -\frac{1}{\rho_o \, e_1 }\left. {\frac{\partial p}{\partial i}} \right|_z
+    & =-\frac{1}{\rho_o e_1 }\left[ {\left. {\frac{\partial p}{\partial i}} \right|_s -\frac{e_1 }{e_3 }\sigma_1 \frac{\partial p}{\partial s}} \right] \\
+    & =-\frac{1}{\rho_o \,e_1 }\left. {\frac{\partial p}{\partial i}} \right|_s +\frac{\sigma_1 }{\rho_o \,e_3 }\left( {-g\;\rho \;e_3 } \right) \\
+    &=-\frac{1}{\rho_o \,e_1 }\left. {\frac{\partial p}{\partial i}} \right|_s -\frac{g\;\rho }{\rho_o }\sigma_1 .
+  \end{split}
+\]
+Applying similar manipulation to the second component and
+replacing $\sigma_1$ and $\sigma_2$ by their expression \autoref{eq:SCOORD_s_slope}, it becomes:
+\begin{equation}
+  \label{eq:SCOORD_grad_p_1}
+  \begin{split}
+    -\frac{1}{\rho_o \, e_1 } \left. {\frac{\partial p}{\partial i}} \right|_z
+    &=-\frac{1}{\rho_o \,e_1 } \left(     \left.              {\frac{\partial p}{\partial i}} \right|_s
+      + g\;\rho  \;\left. {\frac{\partial z}{\partial i}} \right|_s    \right) \\
+             %
+    -\frac{1}{\rho_o \, e_2 }\left. {\frac{\partial p}{\partial j}} \right|_z
+    &=-\frac{1}{\rho_o \,e_2 } \left(    \left.               {\frac{\partial p}{\partial j}} \right|_s
+      + g\;\rho \;\left. {\frac{\partial z}{\partial j}} \right|_s   \right) . \\
+  \end{split}
+\end{equation}
+
+An additional term appears in (\autoref{eq:SCOORD_grad_p_1}) which accounts for
+the tilt of $s-$surfaces with respect to geopotential $z-$surfaces.
+
+As in $z$-coordinate,
+the horizontal pressure gradient can be split in two parts following \citet{marsaleix.auclair.ea_OM08}.
+Let defined a density anomaly, $d$, by $d=(\rho - \rho_o)/ \rho_o$,
+and a hydrostatic pressure anomaly, $p_h'$, by $p_h'= g \; \int_z^\eta d \; e_3 \; dk$.
+The pressure is then given by:
+\[
+  \begin{split}
+    p &= g\; \int_z^\eta \rho \; e_3 \; dk = g\; \int_z^\eta \rho_o \left( d + 1 \right) \; e_3 \; dk   \\
+    &= g \, \rho_o \; \int_z^\eta d \; e_3 \; dk + \rho_o g \, \int_z^\eta e_3 \; dk .
+  \end{split}
+\]
+Therefore, $p$ and $p_h'$ are linked through:
+\begin{equation}
+  \label{eq:SCOORD_pressure}
+  p = \rho_o \; p_h' + \rho_o \, g \, ( \eta - z )
+\end{equation}
+and the hydrostatic pressure balance expressed in terms of $p_h'$ and $d$ is:
+\[
+  \frac{\partial p_h'}{\partial k} = - d \, g \, e_3 .
+\]
+
+Substituing \autoref{eq:SCOORD_pressure} in \autoref{eq:SCOORD_grad_p_1} and
+using the definition of the density anomaly it becomes an expression in two parts:
+\begin{equation}
+  \label{eq:SCOORD_grad_p_2}
+  \begin{split}
+    -\frac{1}{\rho_o \, e_1 } \left. {\frac{\partial p}{\partial i}} \right|_z
+    &=-\frac{1}{e_1 } \left(     \left.              {\frac{\partial p_h'}{\partial i}} \right|_s
+      + g\; d  \;\left. {\frac{\partial z}{\partial i}} \right|_s    \right)  - \frac{g}{e_1 } \frac{\partial \eta}{\partial i} ,  \\
+             %
+    -\frac{1}{\rho_o \, e_2 }\left. {\frac{\partial p}{\partial j}} \right|_z
+    &=-\frac{1}{e_2 } \left(    \left.               {\frac{\partial p_h'}{\partial j}} \right|_s
+      + g\; d \;\left. {\frac{\partial z}{\partial j}} \right|_s   \right)  - \frac{g}{e_2 } \frac{\partial \eta}{\partial j} . \\
+  \end{split}
+\end{equation}
+This formulation of the pressure gradient is characterised by the appearance of
+a term depending on the sea surface height only
+(last term on the right hand side of expression \autoref{eq:SCOORD_grad_p_2}).
+This term will be loosely termed \textit{surface pressure gradient} whereas
+the first term will be termed the \textit{hydrostatic pressure gradient} by analogy to
+the $z$-coordinate formulation.
+In fact, the true surface pressure gradient is $1/\rho_o \nabla (\rho \eta)$,
+and $\eta$ is implicitly included in the computation of $p_h'$ through the upper bound of the vertical integration.
+
+$\bullet$ \textbf{The other terms of the momentum equation}
+
+The coriolis and forcing terms as well as the the vertical physics remain unchanged as
+they involve neither time nor space derivatives.
+The form of the lateral physics is discussed in \autoref{apdx:DIFFOPERS}.
+
+$\bullet$ \textbf{Full momentum equation}
+
+To sum up, in a curvilinear $s$-coordinate system,
+the vector invariant momentum equation solved by the model has the same mathematical expression as
+the one in a curvilinear $z-$coordinate, except for the pressure gradient term:
+\begin{subequations}
+  \label{eq:SCOORD_dyn_vect}
+  \begin{multline}
+    \label{eq:SCOORD_PE_dyn_vect_u}
+    \frac{\partial u}{\partial t}=
+    +   \left( {\zeta +f} \right)\,v
+    -   \frac{1}{2\,e_1} \frac{\partial}{\partial i} \left(  u^2+v^2   \right)
+    -   \frac{1}{e_3} \omega \frac{\partial u}{\partial k}       \\
+    -   \frac{1}{e_1 } \left(    \frac{\partial p_h'}{\partial i} + g\; d  \; \frac{\partial z}{\partial i}    \right)
+    -   \frac{g}{e_1 } \frac{\partial \eta}{\partial i}
+    +   D_u^{\vect{U}}  +   F_u^{\vect{U}} ,
+  \end{multline}
+  \begin{multline}
+    \label{eq:SCOORD_dyn_vect_v}
+    \frac{\partial v}{\partial t}=
+    -   \left( {\zeta +f} \right)\,u
+    -   \frac{1}{2\,e_2 }\frac{\partial }{\partial j}\left(  u^2+v^2  \right)
+    -   \frac{1}{e_3 } \omega \frac{\partial v}{\partial k}         \\
+    -   \frac{1}{e_2 } \left(    \frac{\partial p_h'}{\partial j} + g\; d  \; \frac{\partial z}{\partial j}    \right)
+    -   \frac{g}{e_2 } \frac{\partial \eta}{\partial j}
+    +  D_v^{\vect{U}}  +   F_v^{\vect{U}} .
+  \end{multline}
+\end{subequations}
+whereas the flux form momentum equation differs from it by
+the formulation of both the time derivative and the pressure gradient term:
+\begin{subequations}
+  \label{eq:SCOORD_dyn_flux}
+  \begin{multline}
+    \label{eq:SCOORD_PE_dyn_flux_u}
+    \frac{1}{e_3} \frac{\partial \left(  e_3\,u  \right) }{\partial t} =
+    - \nabla \cdot \left(   {{\mathrm {\mathbf U}}\,u}   \right)
+    +   \left\{ {f + \frac{1}{e_1 e_2 }\left(    v  \;\frac{\partial e_2 }{\partial i}
+          -u  \;\frac{\partial e_1 }{\partial j}            \right)} \right\} \,v     \\
+    -   \frac{1}{e_1 } \left(    \frac{\partial p_h'}{\partial i} + g\; d  \; \frac{\partial z}{\partial i}    \right)
+    -   \frac{g}{e_1 } \frac{\partial \eta}{\partial i}
+    +   D_u^{\vect{U}}  +   F_u^{\vect{U}} ,
+  \end{multline}
+  \begin{multline}
+    \label{eq:SCOORD_dyn_flux_v}
+    \frac{1}{e_3}\frac{\partial \left(  e_3\,v  \right) }{\partial t}=
+    -  \nabla \cdot \left(   {{\mathrm {\mathbf U}}\,v}   \right)
+    -   \left\{ {f + \frac{1}{e_1 e_2 }\left(    v  \;\frac{\partial e_2 }{\partial i}
+          -u  \;\frac{\partial e_1 }{\partial j}            \right)} \right\} \,u     \\
+    -   \frac{1}{e_2 } \left(    \frac{\partial p_h'}{\partial j} + g\; d  \; \frac{\partial z}{\partial j}    \right)
+    -   \frac{g}{e_2 } \frac{\partial \eta}{\partial j}
+    +  D_v^{\vect{U}}  +   F_v^{\vect{U}} .
+  \end{multline}
+\end{subequations}
+Both formulation share the same hydrostatic pressure balance expressed in terms of
+hydrostatic pressure and density anomalies, $p_h'$ and $d=( \frac{\rho}{\rho_o}-1 )$:
+\begin{equation}
+  \label{eq:SCOORD_dyn_zph}
+  \frac{\partial p_h'}{\partial k} = - d \, g \, e_3 .
+\end{equation}
+
+It is important to realize that the change in coordinate system has only concerned the position on the vertical.
+It has not affected (\textbf{i},\textbf{j},\textbf{k}), the orthogonal curvilinear set of unit vectors.
+($u$,$v$) are always horizontal velocities so that their evolution is driven by \emph{horizontal} forces,
+in particular the pressure gradient.
+By contrast, $\omega$ is not $w$, the third component of the velocity, but the dia-surface velocity component,
+\ie\ the volume flux across the moving $s$-surfaces per unit horizontal area.
+
+
+% ================================================================
+% Tracer equation
+% ================================================================
+\section{Tracer equation}
+\label{sec:SCOORD_tracer}
+
+The tracer equation is obtained using the same calculation as for the continuity equation and then
+regrouping the time derivative terms in the left hand side :
+
+\begin{multline}
+  \label{eq:SCOORD_tracer}
+  \frac{1}{e_3} \frac{\partial \left(  e_3 T  \right)}{\partial t}
+  = -\frac{1}{e_1 \,e_2 \,e_3}
+  \left[           \frac{\partial }{\partial i} \left( {e_2 \,e_3 \;Tu} \right)
+    +   \frac{\partial }{\partial j} \left( {e_1 \,e_3 \;Tv} \right)               \right]       \\
+  -  \frac{1}{e_3}  \frac{\partial }{\partial k} \left(                   Tw  \right)
+  +  D^{T} +F^{T}
+\end{multline}
+
+The expression for the advection term is a straight consequence of (\autoref{eq:SCOORD_sco_Continuity}),
+the expression of the 3D divergence in the $s-$coordinates established above.
+
+\biblio
+
+\pindex
+
+\end{document}
Index: /NEMO/trunk/doc/latex/NEMO/subfiles/apdx_triads.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/subfiles/apdx_triads.tex	(revision 11543)
+++ /NEMO/trunk/doc/latex/NEMO/subfiles/apdx_triads.tex	(revision 11543)
@@ -0,0 +1,1182 @@
+\documentclass[../main/NEMO_manual]{subfiles}
+
+%% Local cmds
+\newcommand{\rML}[1][i]{\ensuremath{_{\mathrm{ML}\,#1}}}
+\newcommand{\rMLt}[1][i]{\tilde{r}_{\mathrm{ML}\,#1}}
+%% Move to ../../global/new_cmds.tex to avoid error with \listoffigures
+%\newcommand{\triad}[6][]{\ensuremath{{}_{#2}^{#3}{\mathbb{#4}_{#1}}_{#5}^{\,#6}}
+\newcommand{\triadd}[5]{\ensuremath{{}_{#1}^{#2}{\mathbb{#3}}_{#4}^{\,#5}}}
+\newcommand{\triadt}[5]{\ensuremath{{}_{#1}^{#2}{\tilde{\mathbb{#3}}}_{#4}^{\,#5}}}
+\newcommand{\rtriad}[2][]{\ensuremath{\triad[#1]{i}{k}{#2}{i_p}{k_p}}}
+\newcommand{\rtriadt}[1]{\ensuremath{\triadt{i}{k}{#1}{i_p}{k_p}}}
+
+\begin{document}
+% ================================================================
+% Iso-neutral diffusion :
+% ================================================================
+\chapter{Iso-Neutral Diffusion and Eddy Advection using Triads}
+\label{apdx:TRIADS}
+
+\chaptertoc
+
+\newpage
+
+\section[Choice of \texttt{namtra\_ldf} namelist parameters]
+{Choice of \protect\nam{tra\_ldf} namelist parameters}
+%-----------------------------------------nam_traldf------------------------------------------------------
+
+\nlst{namtra_ldf}
+%---------------------------------------------------------------------------------------------------------
+
+Two scheme are available to perform the iso-neutral diffusion.
+If the namelist logical \np{ln\_traldf\_triad} is set true,
+\NEMO\ updates both active and passive tracers using the Griffies triad representation of iso-neutral diffusion and
+the eddy-induced advective skew (GM) fluxes.
+If the namelist logical \np{ln\_traldf\_iso} is set true,
+the filtered version of Cox's original scheme (the Standard scheme) is employed (\autoref{sec:LDF_slp}).
+In the present implementation of the Griffies scheme,
+the advective skew fluxes are implemented even if \np{ln\_traldf\_eiv} is false.
+
+Values of iso-neutral diffusivity and GM coefficient are set as described in \autoref{sec:LDF_coef}.
+Note that when GM fluxes are used, the eddy-advective (GM) velocities are output for diagnostic purposes using XIOS,
+even though the eddy advection is accomplished by means of the skew fluxes.
+
+The options specific to the Griffies scheme include:
+\begin{description}
+\item[\np{ln\_triad\_iso}]
+  See \autoref{sec:TRIADS_taper}.
+  If this is set false (the default),
+  then `iso-neutral' mixing is accomplished within the surface mixed-layer along slopes linearly decreasing with
+  depth from the value immediately below the mixed-layer to zero (flat) at the surface (\autoref{sec:TRIADS_lintaper}).
+  This is the same treatment as used in the default implementation
+  \autoref{subsec:LDF_slp_iso}; \autoref{fig:LDF_eiv_slp}.
+  Where \np{ln\_triad\_iso} is set true,
+  the vertical skew flux is further reduced to ensure no vertical buoyancy flux,
+  giving an almost pure horizontal diffusive tracer flux within the mixed layer.
+  This is similar to the tapering suggested by \citet{gerdes.koberle.ea_CD91}. See \autoref{subsec:TRIADS_Gerdes-taper}
+\item[\np{ln\_botmix\_triad}]
+  See \autoref{sec:TRIADS_iso_bdry}.
+  If this is set false (the default) then the lateral diffusive fluxes
+  associated with triads partly masked by topography are neglected.
+  If it is set true, however, then these lateral diffusive fluxes are applied,
+  giving smoother bottom tracer fields at the cost of introducing diapycnal mixing.
+\item[\np{rn\_sw\_triad}]
+  blah blah to be added....
+\end{description}
+The options shared with the Standard scheme include:
+\begin{description}
+\item[\np{ln\_traldf\_msc}]   blah blah to be added
+\item[\np{rn\_slpmax}]  blah blah to be added
+\end{description}
+
+\section{Triad formulation of iso-neutral diffusion}
+\label{sec:TRIADS_iso}
+
+We have implemented into \NEMO\ a scheme inspired by \citet{griffies.gnanadesikan.ea_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:TRIADS_iso_tensor_1}:
+\begin{subequations}
+  \label{eq:TRIADS_iso_tensor_1}
+  \begin{equation}
+    D^{lT}=-\nabla \cdot\vect{f}^{lT}\equiv
+    -\frac{1}{e_1e_2e_3}\left[\pd{i}\left (f_1^{lT}e_2e_3\right) +
+      \pd{j}\left (f_2^{lT}e_2e_3\right) + \pd{k}\left (f_3^{lT}e_1e_2\right)\right],
+  \end{equation}
+  where the diffusive flux per unit area of physical space
+  \begin{equation}
+    \vect{f}^{lT}=-{A^{lT}}\Re\cdot\nabla T,
+  \end{equation}
+  \begin{equation}
+    \label{eq:TRIADS_iso_tensor_2}
+    \mbox{with}\quad \;\;\Re =
+    \begin{pmatrix}
+      1   &  0   & -r_1           \rule[-.9 em]{0pt}{1.79 em} \\
+      0   &  1   & -r_2           \rule[-.9 em]{0pt}{1.79 em} \\
+      -r_1 & -r_2 &  r_1 ^2+r_2 ^2 \rule[-.9 em]{0pt}{1.79 em}
+    \end{pmatrix}
+    \quad \text{and} \quad\nabla T=
+    \begin{pmatrix}
+      \frac{1}{e_1} \pd[T]{i} \rule[-.9 em]{0pt}{1.79 em} \\
+      \frac{1}{e_2} \pd[T]{j} \rule[-.9 em]{0pt}{1.79 em} \\
+      \frac{1}{e_3} \pd[T]{k} \rule[-.9 em]{0pt}{1.79 em}
+    \end{pmatrix}
+    .
+  \end{equation}
+\end{subequations}
+% \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 & {r_1 ^2+r_2 ^2} \hfill \\
+% \end{array} }} \right)
+Here \autoref{eq:MB_iso_slopes}
+\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}
+\end{align*}
+is the $i$-component of the slope of the iso-neutral surface relative to the computational surface,
+and $r_2$ is the $j$-component.
+
+We will find it useful to consider the fluxes per unit area in $i,j,k$ space; we write
+\[
+  % \label{eq:TRIADS_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).
+\]
+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}$,
+with $f_{ij}=R_{ij}e_i^{-1}\partial T/\partial x_i$ (no summation) etc.
+
+The off-diagonal terms of the small angle diffusion tensor
+\autoref{eq:TRIADS_iso_tensor_1}, \autoref{eq:TRIADS_iso_tensor_2} produce skew-fluxes along
+the $i$- and $j$-directions resulting from the vertical tracer gradient:
+\begin{align}
+  \label{eq:TRIADS_i13c}
+  f_{13}=&+{A^{lT}} r_1\frac{1}{e_3}\frac{\partial T}{\partial k},\qquad f_{23}=+{A^{lT}} r_2\frac{1}{e_3}\frac{\partial T}{\partial k}\\
+  \intertext{and in the k-direction resulting from the lateral tracer gradients}
+  \label{eq:TRIADS_i31c}
+  f_{31}+f_{32}=& {A^{lT}} r_1\frac{1}{e_1}\frac{\partial T}{\partial i}+{A^{lT}} r_2\frac{1}{e_1}\frac{\partial T}{\partial i}
+\end{align}
+
+The vertical diffusive flux associated with the $_{33}$ component of the small angle diffusion tensor is
+\begin{equation}
+  \label{eq:TRIADS_i33c}
+  f_{33}=-{A^{lT}}(r_1^2 +r_2^2) \frac{1}{e_3}\frac{\partial T}{\partial k}.
+\end{equation}
+
+Since there are no cross terms involving $r_1$ and $r_2$ in the above,
+we can consider the iso-neutral diffusive fluxes separately in the $i$-$k$ and $j$-$k$ planes,
+just adding together the vertical components from each plane.
+The following description will describe the fluxes on the $i$-$k$ plane.
+
+There is no natural discretization for the $i$-component of the skew-flux, \autoref{eq:TRIADS_i13c},
+as although it must be evaluated at $u$-points,
+it involves vertical gradients (both for the tracer and the slope $r_1$), defined at $w$-points.
+Similarly, the vertical skew flux, \autoref{eq:TRIADS_i31c},
+is evaluated at $w$-points but involves horizontal gradients defined at $u$-points.
+
+\subsection{Standard discretization}
+
+The straightforward approach to discretize the lateral skew flux
+\autoref{eq:TRIADS_i13c} from tracer cell $i,k$ to $i+1,k$, introduced in 1995 into OPA,
+\autoref{eq:TRA_ldf_iso}, is to calculate a mean vertical gradient at the $u$-point from
+the average of the four surrounding vertical tracer gradients, and multiply this by a mean slope at the $u$-point,
+calculated from the averaged surrounding vertical density gradients.
+The total area-integrated skew-flux (flux per unit area in $ijk$ space) from tracer cell $i,k$ to $i+1,k$,
+noting that the $e_{{3}_{i+1/2}^k}$ in the area $e{_{3}}_{i+1/2}^k{e_{2}}_{i+1/2}i^k$ at the $u$-point cancels out with
+the $1/{e_{3}}_{i+1/2}^k$ associated with the vertical tracer gradient, is then \autoref{eq:TRA_ldf_iso}
+\[
+  \left(F_u^{13} \right)_{i+\frac{1}{2}}^k = {A}_{i+\frac{1}{2}}^k
+  {e_{2}}_{i+1/2}^k \overline{\overline
+    r_1} ^{\,i,k}\,\overline{\overline{\delta_k T}}^{\,i,k},
+\]
+where
+\[
+  \overline{\overline
+    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}},
+\]
+and here and in the following we drop the $^{lT}$ superscript from ${A^{lT}}$ for simplicity.
+Unfortunately the resulting combination $\overline{\overline{\delta_k\bullet}}^{\,i,k}$ of a $k$ average and
+a $k$ difference of the tracer reduces to $\bullet_{k+1}-\bullet_{k-1}$,
+so two-grid-point oscillations are invisible to this discretization of the iso-neutral operator.
+These \emph{computational modes} will not be damped by this operator, and may even possibly be amplified by it.
+Consequently, applying this operator to a tracer does not guarantee the decrease of its global-average variance.
+To correct this, we introduced a smoothing of the slopes of the iso-neutral surfaces (see \autoref{chap:LDF}).
+This technique works for $T$ and $S$ in so far as they are active tracers
+(\ie\ they enter the computation of density), but it does not work for a passive tracer.
+
+\subsection{Expression of the skew-flux in terms of triad slopes}
+
+\citep{griffies.gnanadesikan.ea_JPO98} introduce a different discretization of the off-diagonal terms that
+nicely solves the problem.
+% Instead of multiplying the mean slope calculated at the $u$-point by
+% the mean vertical gradient at the $u$-point,
+% >>>>>>>>>>>>>>>>>>>>>>>>>>>>
+\begin{figure}[tb]
+  \begin{center}
+    \includegraphics[width=\textwidth]{Fig_GRIFF_triad_fluxes}
+    \caption{
+      \protect\label{fig:TRIADS_ISO_triad}
+      (a) Arrangement of triads $S_i$ and tracer gradients to
+      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}
+% >>>>>>>>>>>>>>>>>>>>>>>>>>>>
+They get the skew flux from the products of the vertical gradients at each $w$-point surrounding the $u$-point with
+the corresponding `triad' slope calculated from the lateral density gradient across the $u$-point divided by
+the vertical density gradient at the same $w$-point as the tracer gradient.
+See \autoref{fig:TRIADS_ISO_triad}a, where the thick lines denote the tracer gradients,
+and the thin lines the corresponding triads, with slopes $s_1, \dotsc s_4$.
+The total area-integrated skew-flux from tracer cell $i,k$ to $i+1,k$
+\begin{multline}
+  \label{eq:TRIADS_i13}
+  \left( F_u^{13}  \right)_{i+\frac{1}{2}}^k = {A}_{i+1}^k a_1 s_1
+  \delta_{k+\frac{1}{2}} \left[ T^{i+1}
+  \right]/e_{{3w}_{i+1}}^{k+\frac{1}{2}}  + {A} _i^k a_2 s_2 \delta
+  _{k+\frac{1}{2}} \left[ T^i
+  \right]/e_{{3w}_{i+1}}^{k+\frac{1}{2}} \\
+  +{A} _{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}}  +{A} _i^k a_4 s_4 \delta
+  _{k-\frac{1}{2}} \left[ T^i \right]/e_{{3w}_{i+1}}^{k+\frac{1}{2}},
+\end{multline}
+where the contributions of the triad fluxes are weighted by areas $a_1, \dotsc a_4$,
+and ${A}$ is now defined at the tracer points rather than the $u$-points.
+This discretization gives a much closer stencil, and disallows the two-point computational modes.
+
+The vertical skew flux \autoref{eq:TRIADS_i31c} from tracer cell $i,k$ to $i,k+1$ at
+the $w$-point $i,k+\frac{1}{2}$ is constructed similarly (\autoref{fig:TRIADS_ISO_triad}b) by
+multiplying lateral tracer gradients from each of the four surrounding $u$-points by the appropriate triad slope:
+\begin{multline}
+  \label{eq:TRIADS_i31}
+  \left( F_w^{31} \right) _i ^{k+\frac{1}{2}} =  {A}_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}
+  +{A}_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} \\
+  + {A}_i^k a_{3}' s_{3}' \delta_{i-\frac{1}{2}} \left[ T^k\right]/{e_{3u}}_{i-\frac{1}{2}}^k
+  +{A}_i^k a_{4}' s_{4}' \delta_{i+\frac{1}{2}} \left[ T^k \right]/{e_{3u}}_{i+\frac{1}{2}}^k.
+\end{multline}
+
+We notate the triad slopes $s_i$ and $s'_i$ in terms of the `anchor point' $i,k$
+(appearing in both the vertical and lateral gradient),
+and the $u$- and $w$-points $(i+i_p,k)$, $(i,k+k_p)$ at the centres of the `arms' of the triad as follows
+(see also \autoref{fig:TRIADS_ISO_triad}):
+\begin{equation}
+  \label{eq:TRIADS_R}
+  _i^k \mathbb{R}_{i_p}^{k_p}
+  =-\frac{ {e_{3w}}_{\,i}^{\,k+k_p}} { {e_{1u}}_{\,i+i_p}^{\,k}}
+  \
+  \frac
+  { \alpha_i^k  \ \delta_{i+i_p}[T^k] - \beta_i^k \ \delta_{i+i_p}[S^k] }
+  { \alpha_i^k  \ \delta_{k+k_p}[T^i] - \beta_i^k \ \delta_{k+k_p}[S^i] }.
+\end{equation}
+In calculating the slopes of the local neutral surfaces,
+the expansion coefficients $\alpha$ and $\beta$ are evaluated at the anchor points of the triad,
+while the metrics are calculated at the $u$- and $w$-points on the arms.
+
+% >>>>>>>>>>>>>>>>>>>>>>>>>>>>
+\begin{figure}[tb]
+  \begin{center}
+    \includegraphics[width=\textwidth]{Fig_GRIFF_qcells}
+    \caption{
+      \protect\label{fig:TRIADS_qcells}
+      Triad notation for quarter cells. $T$-cells are inside boxes,
+      while the  $i+\fractext{1}{2},k$ $u$-cell is shaded in green and
+      the $i,k+\fractext{1}{2}$ $w$-cell is shaded in pink.
+    }
+  \end{center}
+\end{figure}
+% >>>>>>>>>>>>>>>>>>>>>>>>>>>>
+
+Each triad $\{_i^{k}\:_{i_p}^{k_p}\}$ is associated (\autoref{fig:TRIADS_qcells}) with the quarter cell that is
+the intersection of the $i,k$ $T$-cell, the $i+i_p,k$ $u$-cell and the $i,k+k_p$ $w$-cell.
+Expressing the slopes $s_i$ and $s'_i$ in \autoref{eq:TRIADS_i13} and \autoref{eq:TRIADS_i31} in this notation,
+we have \eg\ \ $s_1=s'_1={\:}_i^k \mathbb{R}_{1/2}^{1/2}$.
+Each triad slope $_i^k\mathbb{R}_{i_p}^{k_p}$ is used once (as an $s$) to
+calculate the lateral flux along its $u$-arm, at $(i+i_p,k)$,
+and then again as an $s'$ to calculate the vertical flux along its $w$-arm at $(i,k+k_p)$.
+Each vertical area $a_i$ used to calculate the lateral flux and horizontal area $a'_i$ used to
+calculate the vertical flux can also be identified as the area across the $u$- and $w$-arms of a unique triad,
+and we notate these areas, similarly to the triad slopes,
+as $_i^k{\mathbb{A}_u}_{i_p}^{k_p}$, $_i^k{\mathbb{A}_w}_{i_p}^{k_p}$,
+where \eg\ in \autoref{eq:TRIADS_i13} $a_{1}={\:}_i^k{\mathbb{A}_u}_{1/2}^{1/2}$,
+and in \autoref{eq:TRIADS_i31} $a'_{1}={\:}_i^k{\mathbb{A}_w}_{1/2}^{1/2}$.
+
+\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.
+The lateral density flux disappears so long as the area-integrated lateral diffusive flux from
+tracer cell $i,k$ to $i+1,k$ coming from the $_{11}$ term of the diffusion tensor takes the form
+\begin{equation}
+  \label{eq:TRIADS_i11}
+  \left( F_u^{11} \right) _{i+\frac{1}{2}} ^{k} =
+  - \left( {A}_i^{k+1} a_{1} + {A}_i^{k+1} a_{2} + {A}_i^k
+    a_{3} + {A}_i^k a_{4} \right)
+  \frac{\delta_{i+1/2} \left[ T^k\right]}{{e_{1u}}_{\,i+1/2}^{\,k}},
+\end{equation}
+where the areas $a_i$ are as in \autoref{eq:TRIADS_i13}.
+In this case, separating the total lateral flux, the sum of \autoref{eq:TRIADS_i13} and \autoref{eq:TRIADS_i11},
+into triad components, a lateral tracer flux
+\begin{equation}
+  \label{eq:TRIADS_latflux-triad}
+  _i^k {\mathbb{F}_u}_{i_p}^{k_p} (T) = - {A}_i^k{ \:}_i^k{\mathbb{A}_u}_{i_p}^{k_p}
+  \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)
+\end{equation}
+can be identified with each triad.
+Then, because the same metric factors ${e_{3w}}_{\,i}^{\,k+k_p}$ and ${e_{1u}}_{\,i+i_p}^{\,k}$ are employed for both
+the density gradients in $ _i^k \mathbb{R}_{i_p}^{k_p}$ and the tracer gradients,
+the lateral density flux associated with each triad separately disappears.
+\begin{equation}
+  \label{eq:TRIADS_latflux-rho}
+  {\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
+\end{equation}
+Thus the total flux $\left( F_u^{31} \right) ^i _{i,k+\frac{1}{2}} + \left( F_u^{11} \right) ^i _{i,k+\frac{1}{2}}$ from
+tracer cell $i,k$ to $i+1,k$ must also vanish since it is a sum of four such triad fluxes.
+
+The squared slope $r_1^2$ in the expression \autoref{eq:TRIADS_i33c} for the $_{33}$ component is also expressed in
+terms of area-weighted squared triad slopes,
+so the area-integrated vertical flux from tracer cell $i,k$ to $i,k+1$ resulting from the $r_1^2$ term is
+\begin{equation}
+  \label{eq:TRIADS_i33}
+  \left( F_w^{33} \right) _i^{k+\frac{1}{2}} =
+  - \left( {A}_i^{k+1} a_{1}' s_{1}'^2
+    + {A}_i^{k+1} a_{2}' s_{2}'^2
+    + {A}_i^k a_{3}' s_{3}'^2
+    + {A}_i^k a_{4}' s_{4}'^2 \right)\delta_{k+\frac{1}{2}} \left[ T^{i+1} \right],
+\end{equation}
+where the areas $a'$ and slopes $s'$ are the same as in \autoref{eq:TRIADS_i31}.
+Then, separating the total vertical flux, the sum of \autoref{eq:TRIADS_i31} and \autoref{eq:TRIADS_i33},
+into triad components, a vertical flux
+\begin{align}
+  \label{eq:TRIADS_vertflux-triad}
+  _i^k {\mathbb{F}_w}_{i_p}^{k_p} (T)
+  &= {A}_i^k{\: }_i^k{\mathbb{A}_w}_{i_p}^{k_p}
+    \left(
+    {_i^k\mathbb{R}_{i_p}^{k_p}}\frac{ \delta_{i+ i_p}[T^k] }{ {e_{1u}}_{\,i + i_p}^{\,k} }
+    -\ \left({_i^k\mathbb{R}_{i_p}^{k_p}}\right)^2 \
+    \frac{ \delta_{k+k_p} [T^i] }{{e_{3w}}_{\,i}^{\,k+k_p} }
+    \right) \\
+  &= - \left(\left.{ }_i^k{\mathbb{A}_w}_{i_p}^{k_p}\right/{ }_i^k{\mathbb{A}_u}_{i_p}^{k_p}\right)
+    {_i^k\mathbb{R}_{i_p}^{k_p}}{\: }_i^k{\mathbb{F}_u}_{i_p}^{k_p} (T) \label{eq:TRIADS_vertflux-triad2}
+\end{align}
+may be associated with each triad.
+Each vertical density flux $_i^k {\mathbb{F}_w}_{i_p}^{k_p} (\rho)$ associated with a triad then
+separately disappears (because the lateral flux $_i^k{\mathbb{F}_u}_{i_p}^{k_p} (\rho)$ disappears).
+Consequently the total vertical density flux
+$\left( F_w^{31} \right)_i ^{k+\frac{1}{2}} + \left( F_w^{33} \right)_i^{k+\frac{1}{2}}$ from
+tracer cell $i,k$ to $i,k+1$ must also vanish since it is a sum of four such triad fluxes.
+
+We can explicitly identify (\autoref{fig:TRIADS_qcells}) the triads associated with the $s_i$, $a_i$,
+and $s'_i$, $a'_i$ used in the definition of the $u$-fluxes and $w$-fluxes in \autoref{eq:TRIADS_i31},
+\autoref{eq:TRIADS_i13}, \autoref{eq:TRIADS_i11} \autoref{eq:TRIADS_i33} and \autoref{fig:TRIADS_ISO_triad} to write out
+the iso-neutral fluxes at $u$- and $w$-points as sums of the triad fluxes that cross the $u$- and $w$-faces:
+%(\autoref{fig:TRIADS_ISO_triad}):
+\begin{flalign}
+  \label{eq:TRIADS_iso_flux} \vect{F}_{\mathrm{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}.
+\end{flalign}
+
+\subsection{Ensuring the scheme does not increase tracer variance}
+\label{subsec:TRIADS_variance}
+
+We now require that this operator should not increase the globally-integrated tracer variance.
+%This changes according to
+% \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\}      \\
+% \end{align*}
+Each triad slope $_i^k\mathbb{R}_{i_p}^{k_p}$ drives a lateral flux $_i^k{\mathbb{F}_u}_{i_p}^{k_p} (T)$ across
+the $u$-point $i+i_p,k$ and a vertical flux $_i^k{\mathbb{F}_w}_{i_p}^{k_p} (T)$ across the $w$-point $i,k+k_p$.
+The lateral flux drives a net rate of change of variance,
+summed over the two $T$-points $i+i_p-\fractext{1}{2},k$ and $i+i_p+\fractext{1}{2},k$, of
+\begin{multline}
+  {b_T}_{i+i_p-1/2}^k\left(\frac{\partial T}{\partial t}T\right)_{i+i_p-1/2}^k+
+  \quad {b_T}_{i+i_p+1/2}^k\left(\frac{\partial T}{\partial
+      t}T\right)_{i+i_p+1/2}^k \\
+  \begin{aligned}
+    &= -T_{i+i_p-1/2}^k{\;} _i^k{\mathbb{F}_u}_{i_p}^{k_p} (T) \quad + \quad  T_{i+i_p+1/2}^k
+    {\;}_i^k{\mathbb{F}_u}_{i_p}^{k_p} (T) \\
+    &={\;} _i^k{\mathbb{F}_u}_{i_p}^{k_p} (T)\,\delta_{i+ i_p}[T^k], \label{eq:TRIADS_dvar_iso_i}
+  \end{aligned}
+\end{multline}
+while the vertical flux similarly drives a net rate of change of variance summed over
+the $T$-points $i,k+k_p-\fractext{1}{2}$ (above) and $i,k+k_p+\fractext{1}{2}$ (below) of
+\begin{equation}
+  \label{eq:TRIADS_dvar_iso_k}
+  _i^k{\mathbb{F}_w}_{i_p}^{k_p} (T) \,\delta_{k+ k_p}[T^i].
+\end{equation}
+The total variance tendency driven by the triad is the sum of these two.
+Expanding $_i^k{\mathbb{F}_u}_{i_p}^{k_p} (T)$ and $_i^k{\mathbb{F}_w}_{i_p}^{k_p} (T)$ with
+\autoref{eq:TRIADS_latflux-triad} and \autoref{eq:TRIADS_vertflux-triad}, it is
+\begin{multline*}
+  -{A}_i^k\left \{
+    { } _i^k{\mathbb{A}_u}_{i_p}^{k_p}
+    \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)\,\delta_{i+ i_p}[T^k] \right.\\
+  - \left. { } _i^k{\mathbb{A}_w}_{i_p}^{k_p}
+    \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) {\,}_i^k\mathbb{R}_{i_p}^{k_p}\delta_{k+ k_p}[T^i]
+  \right \}.
+\end{multline*}
+The key point is then that if we require $_i^k{\mathbb{A}_u}_{i_p}^{k_p}$ and $_i^k{\mathbb{A}_w}_{i_p}^{k_p}$ to
+be related to a triad volume $_i^k\mathbb{V}_{i_p}^{k_p}$ by
+\begin{equation}
+  \label{eq:TRIADS_V-A}
+  _i^k\mathbb{V}_{i_p}^{k_p}
+  ={\;}_i^k{\mathbb{A}_u}_{i_p}^{k_p}\,{e_{1u}}_{\,i + i_p}^{\,k}
+  ={\;}_i^k{\mathbb{A}_w}_{i_p}^{k_p}\,{e_{3w}}_{\,i}^{\,k + k_p},
+\end{equation}
+the variance tendency reduces to the perfect square
+\begin{equation}
+  \label{eq:TRIADS_perfect-square}
+  -{A}_i^k{\:} _i^k\mathbb{V}_{i_p}^{k_p}
+  \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)^2\leq 0.
+\end{equation}
+Thus, the constraint \autoref{eq:TRIADS_V-A} ensures that the fluxes
+(\autoref{eq:TRIADS_latflux-triad}, \autoref{eq:TRIADS_vertflux-triad}) associated with
+a given slope triad $_i^k\mathbb{R}_{i_p}^{k_p}$ do not increase the net variance.
+Since the total fluxes are sums of such fluxes from the various triads, this constraint, applied to all triads,
+is sufficient to ensure that the globally integrated variance does not increase.
+
+The expression \autoref{eq:TRIADS_V-A} can be interpreted as a discretization of the global integral
+\begin{equation}
+  \label{eq:TRIADS_cts-var}
+  \frac{\partial}{\partial t}\int\!\fractext{1}{2} T^2\, dV =
+  \int\!\mathbf{F}\cdot\nabla T\, dV,
+\end{equation}
+where, within each triad volume $_i^k\mathbb{V}_{i_p}^{k_p}$, the lateral and vertical fluxes/unit area
+\[
+  \mathbf{F}=\left(
+    \left.{}_i^k{\mathbb{F}_u}_{i_p}^{k_p} (T)\right/{}_i^k{\mathbb{A}_u}_{i_p}^{k_p},
+    \left.{\:}_i^k{\mathbb{F}_w}_{i_p}^{k_p} (T)\right/{}_i^k{\mathbb{A}_w}_{i_p}^{k_p}
+  \right)
+\]
+and the gradient
+\[
+  \nabla T = \left(
+    \left.\delta_{i+ i_p}[T^k] \right/ {e_{1u}}_{\,i + i_p}^{\,k},
+    \left.\delta_{k+ k_p}[T^i] \right/ {e_{3w}}_{\,i}^{\,k + k_p}
+  \right)
+\]
+
+\subsection{Triad volumes in Griffes's scheme and in \NEMO}
+
+To complete the discretization we now need only specify the triad volumes $_i^k\mathbb{V}_{i_p}^{k_p}$.
+\citet{griffies.gnanadesikan.ea_JPO98} identifies these $_i^k\mathbb{V}_{i_p}^{k_p}$ as the volumes of the quarter cells,
+defined in terms of the distances between $T$, $u$,$f$ and $w$-points.
+This is the natural discretization of \autoref{eq:TRIADS_cts-var}.
+The \NEMO\ model, however, operates with scale factors instead of grid sizes,
+and scale factors for the quarter cells are not defined.
+Instead, therefore we simply choose
+\begin{equation}
+  \label{eq:TRIADS_V-NEMO}
+  _i^k\mathbb{V}_{i_p}^{k_p}=\fractext{1}{4} {b_u}_{i+i_p}^k,
+\end{equation}
+as a quarter of the volume of the $u$-cell inside which the triad quarter-cell lies.
+This has the nice property that when the slopes $\mathbb{R}$ vanish,
+the lateral flux from tracer cell $i,k$ to $i+1,k$ reduces to the classical form
+\begin{equation}
+  \label{eq:TRIADS_lat-normal}
+  -\overline{A}_{\,i+1/2}^k\;
+  \frac{{b_u}_{i+1/2}^k}{{e_{1u}}_{\,i + i_p}^{\,k}}
+  \;\frac{\delta_{i+ 1/2}[T^k] }{{e_{1u}}_{\,i + i_p}^{\,k}}
+  = -\overline{A}_{\,i+1/2}^k\;\frac{{e_{1w}}_{\,i + 1/2}^{\,k}\:{e_{1v}}_{\,i + 1/2}^{\,k}\;\delta_{i+ 1/2}[T^k]}{{e_{1u}}_{\,i + 1/2}^{\,k}}.
+\end{equation}
+In fact if the diffusive coefficient is defined at $u$-points,
+so that we employ ${A}_{i+i_p}^k$ instead of  ${A}_i^k$ in the definitions of the triad fluxes
+\autoref{eq:TRIADS_latflux-triad} and \autoref{eq:TRIADS_vertflux-triad},
+we can replace $\overline{A}_{\,i+1/2}^k$ by $A_{i+1/2}^k$ in the above.
+
+\subsection{Summary of the scheme}
+
+The iso-neutral fluxes at $u$- and $w$-points are the sums of the triad fluxes that
+cross the $u$- and $w$-faces \autoref{eq:TRIADS_iso_flux}:
+\begin{subequations}
+  % \label{eq:TRIADS_alltriadflux}
+  \begin{flalign*}
+    % \label{eq:TRIADS_vect_isoflux}
+    \vect{F}_{\mathrm{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},
+  \end{flalign*}
+  where \autoref{eq:TRIADS_latflux-triad}:
+  \begin{align}
+    \label{eq:TRIADS_triadfluxu}
+    _i^k {\mathbb{F}_u}_{i_p}^{k_p} (T) &= - {A}_i^k{
+                                          \:}\frac{{{}_i^k\mathbb{V}}_{i_p}^{k_p}}{{e_{1u}}_{\,i + i_p}^{\,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),\\
+    \intertext{and}
+    _i^k {\mathbb{F}_w}_{i_p}^{k_p} (T)
+                                        &= {A}_i^k{\: }\frac{{{}_i^k\mathbb{V}}_{i_p}^{k_p}}{{e_{3w}}_{\,i}^{\,k+k_p}}
+                                          \left(
+                                          {_i^k\mathbb{R}_{i_p}^{k_p}}\frac{ \delta_{i+ i_p}[T^k] }{ {e_{1u}}_{\,i + i_p}^{\,k} }
+                                          -\ \left({_i^k\mathbb{R}_{i_p}^{k_p}}\right)^2 \
+                                          \frac{ \delta_{k+k_p} [T^i] }{{e_{3w}}_{\,i}^{\,k+k_p} }
+                                          \right),\label{eq:TRIADS_triadfluxw}
+  \end{align}
+  with \autoref{eq:TRIADS_V-NEMO}
+  \[
+    % \label{eq:TRIADS_V-NEMO2}
+    _i^k{\mathbb{V}}_{i_p}^{k_p}=\fractext{1}{4} {b_u}_{i+i_p}^k.
+  \]
+\end{subequations}
+
+The divergence of the expression \autoref{eq:TRIADS_iso_flux} for the fluxes gives the iso-neutral diffusion tendency at
+each tracer point:
+\[
+  % \label{eq:TRIADS_iso_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 diffusion scheme satisfies the following six properties:
+\begin{description}
+\item[$\bullet$ horizontal diffusion]
+  The discretization of the diffusion operator recovers the traditional five-point Laplacian
+  \autoref{eq:TRIADS_lat-normal} in the limit of flat iso-neutral direction:
+  \[
+    % \label{eq:TRIADS_iso_property0}
+    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]
+  Only tracer values associated with a single water column appear in the expression \autoref{eq:TRIADS_i33} for
+  the $_{33}$ fluxes, vertical fluxes driven by vertical gradients.
+  This is of paramount importance since it means that a time-implicit algorithm can be used to
+  solve the vertical diffusion equation.
+  This is necessary since the vertical eddy diffusivity associated with this term,
+  \[
+    \frac{1}{b_w}\sum_{\substack{i_p, \,k_p}} \left\{
+      {\:}_i^k\mathbb{V}_{i_p}^{k_p} \: {A}_i^k \: \left(_i^k \mathbb{R}_{i_p}^{k_p}\right)^2
+    \right\}  =
+    \frac{1}{4b_w}\sum_{\substack{i_p, \,k_p}} \left\{
+      {b_u}_{i+i_p}^k\: {A}_i^k \: \left(_i^k \mathbb{R}_{i_p}^{k_p}\right)^2
+    \right\},
+  \]
+  (where $b_w= e_{1w}\,e_{2w}\,e_{3w}$ is the volume of $w$-cells) can be quite large.
+
+\item[$\bullet$ pure iso-neutral operator]
+  The iso-neutral flux of locally referenced potential density is zero.
+  See \autoref{eq:TRIADS_latflux-rho} and \autoref{eq:TRIADS_vertflux-triad2}.
+
+\item[$\bullet$ conservation of tracer]
+  The iso-neutral diffusion conserves tracer content, \ie
+  \[
+    % \label{eq:TRIADS_iso_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$ no increase of tracer variance]
+  The iso-neutral diffusion does not increase the tracer variance, \ie
+  \[
+    % \label{eq:TRIADS_iso_property2}
+    \sum_{i,j,k} \left\{ T \ D_l^T      \ b_T \right\} \leq 0
+  \]
+  The property is demonstrated in \autoref{subsec:TRIADS_variance} above.
+  It is a key property for a diffusion term.
+  It means that it is also a dissipation term,
+  \ie\ it dissipates the square of the quantity on which it is applied.
+  It therefore ensures that, when the diffusivity coefficient is large enough,
+  the field on which it is applied becomes free of grid-point noise.
+
+\item[$\bullet$ self-adjoint operator]
+  The iso-neutral diffusion operator is self-adjoint, \ie
+  \begin{equation}
+    \label{eq:TRIADS_iso_property3}
+    \sum_{i,j,k} \left\{ S \ D_l^T \ b_T \right\} = \sum_{i,j,k} \left\{ D_l^S \ T \ b_T \right\}
+  \end{equation}
+  In other word, there is no need to develop a specific routine from the adjoint of this operator.
+  We just have to apply the same routine.
+  This property can be demonstrated similarly to the proof of the `no increase of tracer variance' property.
+  The contribution by a single triad towards the left hand side of \autoref{eq:TRIADS_iso_property3},
+  can be found by replacing $\delta[T]$ by $\delta[S]$ in \autoref{eq:TRIADS_dvar_iso_i} and \autoref{eq:TRIADS_dvar_iso_k}.
+  This results in a term similar to \autoref{eq:TRIADS_perfect-square},
+  \[
+    % \label{eq:TRIADS_TScovar}
+    - {A}_i^k{\:} _i^k\mathbb{V}_{i_p}^{k_p}
+    \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)
+    \left(
+      \frac{ \delta_{i+ i_p}[S^k] }{ {e_{1u}}_{\,i + i_p}^{\,k} }
+      -{\:}_i^k\mathbb{R}_{i_p}^{k_p}
+      \frac{ \delta_{k+k_p} [S^i] }{{e_{3w}}_{\,i}^{\,k+k_p} }
+    \right).
+  \]
+This is symmetrical in $T $ and $S$, so exactly the same term arises from
+the discretization of this triad's contribution towards the RHS of \autoref{eq:TRIADS_iso_property3}.
+\end{description}
+
+\subsection{Treatment of the triads at the boundaries}
+\label{sec:TRIADS_iso_bdry}
+
+The triad slope can only be defined where both the grid boxes centred at the end of the arms exist.
+Triads that would poke up through the upper ocean surface into the atmosphere,
+or down into the ocean floor, must be masked out.
+See \autoref{fig:TRIADS_bdry_triads}.
+Surface layer triads \triad{i}{1}{R}{1/2}{-1/2} (magenta) and \triad{i+1}{1}{R}{-1/2}{-1/2} (blue) that
+require density to be specified above the ocean surface are masked (\autoref{fig:TRIADS_bdry_triads}a):
+this ensures that lateral tracer gradients produce no flux through the ocean surface.
+However, to prevent surface noise, it is customary to retain the $_{11}$ contributions towards
+the lateral triad fluxes \triad[u]{i}{1}{F}{1/2}{-1/2} and \triad[u]{i+1}{1}{F}{-1/2}{-1/2};
+this drives diapycnal tracer fluxes.
+Similar comments apply to triads that would intersect the ocean floor (\autoref{fig:TRIADS_bdry_triads}b).
+Note that both near bottom triad slopes \triad{i}{k}{R}{1/2}{1/2} and \triad{i+1}{k}{R}{-1/2}{1/2} are masked when
+either of the $i,k+1$ or $i+1,k+1$ tracer points is masked, \ie\ the $i,k+1$ $u$-point is masked.
+The associated lateral fluxes (grey-black dashed line) are masked if \np{ln\_botmix\_triad}\forcode{ = .false.},
+but left unmasked, giving bottom mixing, if \np{ln\_botmix\_triad}\forcode{ = .true.}.
+
+The default option \np{ln\_botmix\_triad}\forcode{ = .false.} is suitable when the bbl mixing option is enabled
+(\np{ln\_trabbl}\forcode{ = .true.}, with \np{nn\_bbl\_ldf}\forcode{ = 1}), or for simple idealized problems.
+For setups with topography without bbl mixing, \np{ln\_botmix\_triad}\forcode{ = .true.} may be necessary.
+% >>>>>>>>>>>>>>>>>>>>>>>>>>>>
+\begin{figure}[h]
+  \begin{center}
+    \includegraphics[width=\textwidth]{Fig_GRIFF_bdry_triads}
+    \caption{
+      \protect\label{fig:TRIADS_bdry_triads}
+      (a) Uppermost model layer $k=1$ with $i,1$ and $i+1,1$ tracer points (black dots),
+      and $i+1/2,1$ $u$-point (blue square).
+      Triad slopes \triad{i}{1}{R}{1/2}{-1/2} (magenta) and \triad{i+1}{1}{R}{-1/2}{-1/2} (blue) poking through
+      the ocean surface are masked (faded in figure).
+      However, the lateral $_{11}$ contributions towards \triad[u]{i}{1}{F}{1/2}{-1/2} and
+      \triad[u]{i+1}{1}{F}{-1/2}{-1/2} (yellow line) are still applied,
+      giving diapycnal diffusive fluxes.
+      \newline
+      (b) Both near bottom triad slopes \triad{i}{k}{R}{1/2}{1/2} and
+      \triad{i+1}{k}{R}{-1/2}{1/2} are masked when either of the $i,k+1$ or $i+1,k+1$ tracer points is masked,
+      \ie\ the $i,k+1$ $u$-point is masked.
+      The associated lateral fluxes (grey-black dashed line) are masked if
+      \protect\np{ln\_botmix\_triad}\forcode{ = .false.}, but left unmasked,
+      giving bottom mixing, if \protect\np{ln\_botmix\_triad}\forcode{ = .true.}
+    }
+  \end{center}
+\end{figure}
+% >>>>>>>>>>>>>>>>>>>>>>>>>>>>
+
+\subsection{ Limiting of the slopes within the interior}
+\label{sec:TRIADS_limit}
+
+As discussed in \autoref{subsec:LDF_slp_iso},
+iso-neutral slopes relative to geopotentials must be bounded everywhere,
+both for consistency with the small-slope approximation and for numerical stability \citep{cox_OM87, griffies_bk04}.
+The bound chosen in \NEMO\ is applied to each component of the slope separately and
+has a value of $1/100$ in the ocean interior.
+%, ramping linearly down above 70~m depth to zero at the surface
+It is of course relevant to the iso-neutral slopes $\tilde{r}_i=r_i+\sigma_i$ relative to geopotentials
+(here the $\sigma_i$ are the slopes of the coordinate surfaces relative to geopotentials)
+\autoref{eq:MB_slopes_eiv} rather than the slope $r_i$ relative to coordinate surfaces, so we require
+\[
+  |\tilde{r}_i|\leq \tilde{r}_\mathrm{max}=0.01.
+\]
+and then recalculate the slopes $r_i$ relative to coordinates.
+Each individual triad slope
+\begin{equation}
+  \label{eq:TRIADS_Rtilde}
+  _i^k\tilde{\mathbb{R}}_{i_p}^{k_p} = {}_i^k\mathbb{R}_{i_p}^{k_p}  + \frac{\delta_{i+i_p}[z_T^k]}{{e_{1u}}_{\,i + i_p}^{\,k}}
+\end{equation}
+is limited like this and then the corresponding $_i^k\mathbb{R}_{i_p}^{k_p} $ are recalculated and
+combined to form the fluxes.
+Note that where the slopes have been limited, there is now a non-zero iso-neutral density flux that
+drives dianeutral mixing.
+In particular this iso-neutral density flux is always downwards,
+and so acts to reduce gravitational potential energy.
+
+\subsection{Tapering within the surface mixed layer}
+\label{sec:TRIADS_taper}
+
+Additional tapering of the iso-neutral fluxes is necessary within the surface mixed layer.
+When the Griffies triads are used, we offer two options for this.
+
+\subsubsection{Linear slope tapering within the surface mixed layer}
+\label{sec:TRIADS_lintaper}
+
+This is the option activated by the default choice \np{ln\_triad\_iso}\forcode{ = .false.}.
+Slopes $\tilde{r}_i$ relative to geopotentials are tapered linearly from their value immediately below
+the mixed layer to zero at the surface, as described in option (c) of \autoref{fig:LDF_eiv_slp}, to values
+\begin{equation}
+  \label{eq:TRIADS_rmtilde}
+  \rMLt = -\frac{z}{h}\left.\tilde{r}_i\right|_{z=-h}\quad \text{ for  } z>-h,
+\end{equation}
+and then the $r_i$ relative to vertical coordinate surfaces are appropriately adjusted to
+\[
+  % \label{eq:TRIADS_rm}
+  \rML =\rMLt -\sigma_i \quad \text{ for  } z>-h.
+\]
+Thus the diffusion operator within the mixed layer is given by:
+\[
+  % \label{eq:TRIADS_iso_tensor_ML}
+  D^{lT}=\nabla {\mathrm {\mathbf .}}\left( {A^{lT}\;\Re \;\nabla T} \right) \qquad
+  \mbox{with}\quad \;\;\Re =\left( {{
+        \begin{array}{*{20}c}
+          1 \hfill & 0 \hfill & {-\rML[1]}\hfill \\
+          0 \hfill & 1 \hfill & {-\rML[2]} \hfill \\
+          {-\rML[1]}\hfill &   {-\rML[2]} \hfill & {\rML[1]^2+\rML[2]^2} \hfill
+        \end{array}
+      }} \right)
+\]
+
+This slope tapering gives a natural connection between tracer in the mixed-layer and
+in isopycnal layers immediately below, in the thermocline.
+It is consistent with the way the $\tilde{r}_i$ are tapered within the mixed layer
+(see \autoref{sec:TRIADS_taperskew} below) so as to ensure a uniform GM eddy-induced velocity throughout the mixed layer.
+However, it gives a downwards density flux and so acts so as to reduce potential energy in the same way as
+does the slope limiting discussed above in \autoref{sec:TRIADS_limit}.
+
+As in \autoref{sec:TRIADS_limit} above, the tapering \autoref{eq:TRIADS_rmtilde} is applied separately to
+each triad $_i^k\tilde{\mathbb{R}}_{i_p}^{k_p}$, and the $_i^k\mathbb{R}_{i_p}^{k_p}$ adjusted.
+For clarity, we assume $z$-coordinates in the following;
+the conversion from $\mathbb{R}$ to $\tilde{\mathbb{R}}$ and back to $\mathbb{R}$ follows exactly as
+described above by \autoref{eq:TRIADS_Rtilde}.
+\begin{enumerate}
+\item
+  Mixed-layer depth is defined so as to avoid including regions of weak vertical stratification in
+  the slope definition.
+  At each $i,j$ (simplified to $i$ in \autoref{fig:TRIADS_MLB_triad}),
+  we define the mixed-layer by setting the vertical index of the tracer point immediately below the mixed layer,
+  $k_{\mathrm{ML}}$, as the maximum $k$ (shallowest tracer point) such that
+  the potential density ${\rho_0}_{i,k}>{\rho_0}_{i,k_{10}}+\Delta\rho_c$,
+  where $i,k_{10}$ is the tracer gridbox within which the depth reaches 10~m.
+  See the left side of \autoref{fig:TRIADS_MLB_triad}.
+  We use the $k_{10}$-gridbox instead of the surface gridbox to avoid problems \eg\ with thin daytime mixed-layers.
+  Currently we use the same $\Delta\rho_c=0.01\;\mathrm{kg\:m^{-3}}$ for ML triad tapering as is used to
+  output the diagnosed mixed-layer depth $h_{\mathrm{ML}}=|z_{W}|_{k_{\mathrm{ML}}+1/2}$,
+  the depth of the $w$-point above the $i,k_{\mathrm{ML}}$ tracer point.
+\item
+  We define `basal' triad slopes ${\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p}$ as
+  the slopes of those triads whose vertical `arms' go down from the $i,k_{\mathrm{ML}}$ tracer point to
+  the $i,k_{\mathrm{ML}}-1$ tracer point below.
+  This is to ensure that the vertical density gradients associated with
+  these basal triad slopes ${\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p}$ are representative of the thermocline.
+  The four basal triads defined in the bottom part of \autoref{fig:TRIADS_MLB_triad} are then
+  \begin{align*}
+    {\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p} &=
+                                                       {\:}^{k_{\mathrm{ML}}-k_p-1/2}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p},
+                                                       % \label{eq:TRIADS_Rbase}
+    \\
+    \intertext{with \eg\ the green triad}
+    {\:}_i{\mathbb{R}_{\mathrm{base}}}_{1/2}^{-1/2}&=
+                                                     {\:}^{k_{\mathrm{ML}}}_i{\mathbb{R}_{\mathrm{base}}}_{\,1/2}^{-1/2}.
+  \end{align*}
+The vertical flux associated with each of these triads passes through
+the $w$-point $i,k_{\mathrm{ML}}-1/2$ lying \emph{below} the $i,k_{\mathrm{ML}}$ tracer point, so it is this depth
+\[
+  % \label{eq:TRIADS_zbase}
+  {z_\mathrm{base}}_{\,i}={z_{w}}_{k_\mathrm{ML}-1/2}
+\]
+one gridbox deeper than the diagnosed ML depth $z_{\mathrm{ML}})$ that sets the $h$ used to taper the slopes in
+\autoref{eq:TRIADS_rmtilde}.
+\item
+  Finally, we calculate the adjusted triads ${\:}_i^k{\mathbb{R}_{\mathrm{ML}}}_{\,i_p}^{k_p}$ within
+  the mixed layer, by multiplying the appropriate ${\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p}$ by
+  the ratio of the depth of the $w$-point ${z_w}_{k+k_p}$ to ${z_{\mathrm{base}}}_{\,i}$.
+  For instance the green triad centred on $i,k$
+  \begin{align*}
+    {\:}_i^k{\mathbb{R}_{\mathrm{ML}}}_{\,1/2}^{-1/2} &=
+                                                        \frac{{z_w}_{k-1/2}}{{z_{\mathrm{base}}}_{\,i}}{\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,1/2}^{-1/2} \\
+    \intertext{and more generally}
+    {\:}_i^k{\mathbb{R}_{\mathrm{ML}}}_{\,i_p}^{k_p} &=
+                                                       \frac{{z_w}_{k+k_p}}{{z_{\mathrm{base}}}_{\,i}}{\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p}.
+                                                       % \label{eq:TRIADS_RML}
+  \end{align*}
+\end{enumerate}
+
+% >>>>>>>>>>>>>>>>>>>>>>>>>>>>
+\begin{figure}[h]
+%  \fcapside {
+  \caption{
+    \protect\label{fig:TRIADS_MLB_triad}
+    Definition of mixed-layer depth and calculation of linearly tapered triads.
+    The figure shows a water column at a given $i,j$ (simplified to $i$), with the ocean surface at the top.
+    Tracer points are denoted by bullets, and black lines the edges of the tracer cells;
+    $k$ increases upwards.
+    \newline
+    \hspace{5 em}
+    We define the mixed-layer by setting the vertical index of the tracer point immediately below the mixed layer,
+    $k_{\mathrm{ML}}$, as the maximum $k$ (shallowest tracer point) such that
+    ${\rho_0}_{i,k}>{\rho_0}_{i,k_{10}}+\Delta\rho_c$,
+    where $i,k_{10}$ is the tracer gridbox within which the depth reaches 10~m.
+    We calculate the triad slopes within the mixed layer by linearly tapering them from zero
+    (at the surface) to the `basal' slopes,
+    the slopes of the four triads passing through the $w$-point $i,k_{\mathrm{ML}}-1/2$ (blue square),
+    ${\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p}$.
+    Triads with different $i_p,k_p$, denoted by different colours,
+    (\eg\ the green triad $i_p=1/2,k_p=-1/2$) are tapered to the appropriate basal triad.}
+  % }
+  \includegraphics[width=\textwidth]{Fig_GRIFF_MLB_triads}
+\end{figure}
+% >>>>>>>>>>>>>>>>>>>>>>>>>>>>
+
+\subsubsection{Additional truncation of skew iso-neutral flux components}
+\label{subsec:TRIADS_Gerdes-taper}
+
+The alternative option is activated by setting \np{ln\_triad\_iso} = true.
+This retains the same tapered slope $\rML$  described above for the calculation of the $_{33}$ term of
+the iso-neutral diffusion tensor (the vertical tracer flux driven by vertical tracer gradients),
+but replaces the $\rML$ in the skew term by
+\begin{equation}
+  \label{eq:TRIADS_rm*}
+  \rML^*=\left.\rMLt^2\right/\tilde{r}_i-\sigma_i,
+\end{equation}
+giving a ML diffusive operator
+\[
+  % \label{eq:TRIADS_iso_tensor_ML2}
+  D^{lT}=\nabla {\mathrm {\mathbf .}}\left( {A^{lT}\;\Re \;\nabla T} \right) \qquad
+  \mbox{with}\quad \;\;\Re =\left( {{
+        \begin{array}{*{20}c}
+          1 \hfill & 0 \hfill & {-\rML[1]^*}\hfill \\
+          0 \hfill & 1 \hfill & {-\rML[2]^*} \hfill \\
+          {-\rML[1]^*}\hfill &   {-\rML[2]^*} \hfill & {\rML[1]^2+\rML[2]^2} \hfill \\
+        \end{array}
+      }} \right).
+\]
+This operator
+\footnote{
+  To ensure good behaviour where horizontal density gradients are weak,
+  we in fact follow \citet{gerdes.koberle.ea_CD91} and
+  set $\rML^*=\mathrm{sgn}(\tilde{r}_i)\min(|\rMLt^2/\tilde{r}_i|,|\tilde{r}_i|)-\sigma_i$.
+}
+then has the property it gives no vertical density flux, and so does not change the potential energy.
+This approach is similar to multiplying the iso-neutral diffusion coefficient by
+$\tilde{r}_{\mathrm{max}}^{-2}\tilde{r}_i^{-2}$ for steep slopes,
+as suggested by \citet{gerdes.koberle.ea_CD91} (see also \citet{griffies_bk04}).
+Again it is applied separately to each triad $_i^k\mathbb{R}_{i_p}^{k_p}$
+
+In practice, this approach gives weak vertical tracer fluxes through the mixed-layer,
+as well as vanishing density fluxes.
+While it is theoretically advantageous that it does not change the potential energy,
+it may give a discontinuity between the fluxes within the mixed-layer (purely horizontal) and
+just below (along iso-neutral surfaces).
+% This may give strange looking results,
+% particularly where the mixed-layer depth varies strongly laterally.
+% ================================================================
+% Skew flux formulation for Eddy Induced Velocity :
+% ================================================================
+\section{Eddy induced advection formulated as a skew flux}
+\label{sec:TRIADS_skew-flux}
+
+\subsection{Continuous skew flux formulation}
+\label{sec:TRIADS_continuous-skew-flux}
+
+When Gent and McWilliams's [1990] diffusion is used, an additional advection term is added.
+The associated velocity is the so called eddy induced velocity,
+the formulation of which depends on the slopes of iso-neutral surfaces.
+Contrary to the case of iso-neutral mixing, the slopes used here are referenced to the geopotential surfaces,
+\ie\ \autoref{eq:LDF_slp_geo} is used in $z$-coordinate,
+and the sum \autoref{eq:LDF_slp_geo} + \autoref{eq:LDF_slp_iso} in $z^*$ or $s$-coordinates.
+
+The eddy induced velocity is given by:
+\begin{subequations}
+  % \label{eq:TRIADS_eiv}
+  \begin{equation}
+    \label{eq:TRIADS_eiv_v}
+    \begin{split}
+      u^* & = - \frac{1}{e_{3}}\;          \partial_i\psi_1,  \\
+      v^* & = - \frac{1}{e_{3}}\;          \partial_j\psi_2,    \\
+      w^* & =    \frac{1}{e_{1}e_{2}}\; \left\{ \partial_i  \left( e_{2} \, \psi_1\right)
+        + \partial_j  \left( e_{1} \, \psi_2\right) \right\},
+    \end{split}
+  \end{equation}
+  where the streamfunctions $\psi_i$ are given by
+  \begin{equation}
+    \label{eq:TRIADS_eiv_psi}
+    \begin{split}
+      \psi_1 & = A_{e} \; \tilde{r}_1,   \\
+      \psi_2 & = A_{e} \; \tilde{r}_2,
+    \end{split}
+  \end{equation}
+\end{subequations}
+with $A_{e}$ the eddy induced velocity coefficient,
+and $\tilde{r}_1$ and $\tilde{r}_2$ the slopes between the iso-neutral and the geopotential surfaces.
+
+The traditional way to implement this additional advection is to add it to the Eulerian velocity prior to
+computing the tracer advection.
+This is implemented if \texttt{traldf\_eiv?} is set in the default implementation,
+where \np{ln\_traldf\_triad} is set false.
+This allows us to take advantage of all the advection schemes offered for the tracers
+(see \autoref{sec:TRA_adv}) and not just a $2^{nd}$ order advection scheme.
+This is particularly useful for passive tracers where
+\emph{positivity} of the advection scheme is of paramount importance.
+
+However, when \np{ln\_traldf\_triad} is set true,
+\NEMO\ instead implements eddy induced advection according to the so-called skew form \citep{griffies_JPO98}.
+It is based on a transformation of the advective fluxes using the non-divergent nature of the eddy induced velocity.
+For example in the (\textbf{i},\textbf{k}) plane,
+the tracer advective fluxes per unit area in $ijk$ space can be transformed as follows:
+\begin{flalign*}
+  \begin{split}
+    \textbf{F}_{\mathrm{eiv}}^T =
+    \begin{pmatrix}
+      {e_{2}\,e_{3}\;  u^*} \\
+ 		{e_{1}\,e_{2}\; w^*}
+    \end{pmatrix}   \;   T
+    &=
+    \begin{pmatrix}
+      { - \partial_k \left( e_{2} \,\psi_1 \right) \; T \;} \\
+ 		{+ \partial_i  \left( e_{2} \, \psi_1 \right) \; T \;}
+    \end{pmatrix} 			\\
+    &=
+    \begin{pmatrix}
+      { - \partial_k \left( e_{2} \, \psi_1  \; T \right) \;} \\
+ 		{+ \partial_i  \left( e_{2} \,\psi_1 \; T \right) \;}
+    \end{pmatrix}
+    +
+    \begin{pmatrix}
+      {+ e_{2} \, \psi_1  \; \partial_k T} \\
+ 		{ - e_{2} \, \psi_1  \; \partial_i  T}
+    \end{pmatrix}
+  \end{split}
+\end{flalign*}
+and since the eddy induced velocity field is non-divergent,
+we end up with the skew form of the eddy induced advective fluxes per unit area in $ijk$ space:
+\begin{equation}
+  \label{eq:TRIADS_eiv_skew_ijk}
+  \textbf{F}_\mathrm{eiv}^T =
+  \begin{pmatrix}
+    {+ e_{2} \, \psi_1  \; \partial_k T}   \\
+    { - e_{2} \, \psi_1  \; \partial_i  T}
+  \end{pmatrix}
+\end{equation}
+The total fluxes per unit physical area are then
+\begin{equation}
+  \label{eq:TRIADS_eiv_skew_physical}
+  \begin{split}
+    f^*_1 & = \frac{1}{e_{3}}\; \psi_1 \partial_k T   \\
+    f^*_2 & = \frac{1}{e_{3}}\; \psi_2 \partial_k T   \\
+    f^*_3 & =  -\frac{1}{e_{1}e_{2}}\; \left\{ e_{2} \psi_1 \partial_i T + e_{1} \psi_2 \partial_j T \right\}.
+\end{split}
+\end{equation}
+Note that \autoref{eq:TRIADS_eiv_skew_physical} takes the same form whatever the vertical coordinate,
+though of course the slopes $\tilde{r}_i$ which define the $\psi_i$ in \autoref{eq:TRIADS_eiv_psi} are relative to
+geopotentials.
+The tendency associated with eddy induced velocity is then simply the convergence of the fluxes
+(\autoref{eq:TRIADS_eiv_skew_ijk}, \autoref{eq:TRIADS_eiv_skew_physical}), so
+\[
+  % \label{eq:TRIADS_skew_eiv_conv}
+  \frac{\partial T}{\partial t}= -\frac{1}{e_1 \, e_2 \, e_3 }      \left[
+    \frac{\partial}{\partial i} \left( e_2 \psi_1 \partial_k T\right)
+    + \frac{\partial}{\partial j} \left( e_1  \;
+      \psi_2 \partial_k T\right)
+    -  \frac{\partial}{\partial k} \left( e_{2} \psi_1 \partial_i T
+      + e_{1} \psi_2 \partial_j T \right)  \right]
+\]
+It naturally conserves the tracer content, as it is expressed in flux form.
+Since it has the same divergence as the advective form it also preserves the tracer variance.
+
+\subsection{Discrete skew flux formulation}
+
+The skew fluxes in (\autoref{eq:TRIADS_eiv_skew_physical}, \autoref{eq:TRIADS_eiv_skew_ijk}),
+like the off-diagonal terms (\autoref{eq:TRIADS_i13c}, \autoref{eq:TRIADS_i31c}) of the small angle diffusion tensor,
+are best expressed in terms of the triad slopes, as in \autoref{fig:TRIADS_ISO_triad} and
+(\autoref{eq:TRIADS_i13}, \autoref{eq:TRIADS_i31});
+but now in terms of the triad slopes $\tilde{\mathbb{R}}$ relative to geopotentials instead of
+the $\mathbb{R}$ relative to coordinate surfaces.
+The discrete form of \autoref{eq:TRIADS_eiv_skew_ijk} using the slopes \autoref{eq:TRIADS_R} and
+defining $A_e$ at $T$-points is then given by:
+
+\begin{subequations}
+  % \label{eq:TRIADS_allskewflux}
+  \begin{flalign*}
+    % \label{eq:TRIADS_vect_skew_flux}
+    \vect{F}_{\mathrm{eiv}}(T) &\equiv    \sum_{\substack{i_p,\,k_p}}
+    \begin{pmatrix}
+      {_{i+1/2-i_p}^k {\mathbb{S}_u}_{i_p}^{k_p} } (T)      \\      \\
+      {_i^{k+1/2-k_p} {\mathbb{S}_w}_{i_p}^{k_p} } (T)      \\
+    \end{pmatrix},
+  \end{flalign*}
+  where the skew flux in the $i$-direction associated with a given triad is (\autoref{eq:TRIADS_latflux-triad},
+  \autoref{eq:TRIADS_triadfluxu}):
+  \begin{align}
+    \label{eq:TRIADS_skewfluxu}
+    _i^k {\mathbb{S}_u}_{i_p}^{k_p} (T) &= + \fractext{1}{4} {A_e}_i^k{
+                                          \:}\frac{{b_u}_{i+i_p}^k}{{e_{1u}}_{\,i + i_p}^{\,k}}
+                                          \ {_i^k\tilde{\mathbb{R}}_{i_p}^{k_p}} \
+                                          \frac{ \delta_{k+k_p} [T^i] }{{e_{3w}}_{\,i}^{\,k+k_p} }, \\
+    \intertext{
+    and \autoref{eq:TRIADS_triadfluxw} in the $k$-direction, changing the sign
+    to be consistent with \autoref{eq:TRIADS_eiv_skew_ijk}:
+    }
+    _i^k {\mathbb{S}_w}_{i_p}^{k_p} (T)
+                                        &= -\fractext{1}{4} {A_e}_i^k{\: }\frac{{b_u}_{i+i_p}^k}{{e_{3w}}_{\,i}^{\,k+k_p}}
+                                          {_i^k\tilde{\mathbb{R}}_{i_p}^{k_p}}\frac{ \delta_{i+ i_p}[T^k] }{ {e_{1u}}_{\,i + i_p}^{\,k} }.\label{eq:TRIADS_skewfluxw}
+  \end{align}
+\end{subequations}
+
+Such a discretisation is consistent with the iso-neutral operator as it uses the same definition for the slopes.
+It also ensures the following two key properties.
+
+\subsubsection{No change in tracer variance}
+
+The discretization conserves tracer variance, \ie\ it does not include a diffusive component but is a `pure' advection term.
+This can be seen %either from Appendix \autoref{apdx:eiv_skew} or
+by considering the fluxes associated with a given triad slope $_i^k{\mathbb{R}}_{i_p}^{k_p} (T)$.
+For, following \autoref{subsec:TRIADS_variance} and \autoref{eq:TRIADS_dvar_iso_i},
+the associated horizontal skew-flux $_i^k{\mathbb{S}_u}_{i_p}^{k_p} (T)$ drives a net rate of change of variance,
+summed over the two $T$-points $i+i_p-\fractext{1}{2},k$ and $i+i_p+\fractext{1}{2},k$, of
+\begin{equation}
+  \label{eq:TRIADS_dvar_eiv_i}
+  _i^k{\mathbb{S}_u}_{i_p}^{k_p} (T)\,\delta_{i+ i_p}[T^k],
+\end{equation}
+while the associated vertical skew-flux gives a variance change summed over
+the $T$-points $i,k+k_p-\fractext{1}{2}$ (above) and $i,k+k_p+\fractext{1}{2}$ (below) of
+\begin{equation}
+  \label{eq:TRIADS_dvar_eiv_k}
+  _i^k{\mathbb{S}_w}_{i_p}^{k_p} (T) \,\delta_{k+ k_p}[T^i].
+\end{equation}
+Inspection of the definitions (\autoref{eq:TRIADS_skewfluxu}, \autoref{eq:TRIADS_skewfluxw}) shows that
+these two variance changes (\autoref{eq:TRIADS_dvar_eiv_i}, \autoref{eq:TRIADS_dvar_eiv_k}) sum to zero.
+Hence the two fluxes associated with each triad make no net contribution to the variance budget.
+
+\subsubsection{Reduction in gravitational PE}
+
+The vertical density flux associated with the vertical skew-flux always has the same sign as
+the vertical density gradient;
+thus, so long as the fluid is stable (the vertical density gradient is negative)
+the vertical density flux is negative (downward) and hence reduces the gravitational PE.
+
+For the change in gravitational PE driven by the $k$-flux is
+\begin{align}
+  \label{eq:TRIADS_vert_densityPE}
+  g {e_{3w}}_{\,i}^{\,k+k_p}{\mathbb{S}_w}_{i_p}^{k_p} (\rho)
+  &=g {e_{3w}}_{\,i}^{\,k+k_p}\left[-\alpha _i^k {\:}_i^k
+    {\mathbb{S}_w}_{i_p}^{k_p} (T) + \beta_i^k {\:}_i^k
+    {\mathbb{S}_w}_{i_p}^{k_p} (S) \right]. \notag \\
+  \intertext{Substituting  ${\:}_i^k {\mathbb{S}_w}_{i_p}^{k_p}$ from \autoref{eq:TRIADS_skewfluxw}, gives}
+  % and separating out
+  % $\rtriadt{R}=\rtriad{R} + \delta_{i+i_p}[z_T^k]$,
+  % gives two terms. The
+  % first $\rtriad{R}$ term (the only term for $z$-coordinates) is:
+  &=-\fractext{1}{4} g{A_e}_i^k{\: }{b_u}_{i+i_p}^k {_i^k\tilde{\mathbb{R}}_{i_p}^{k_p}}
+    \frac{ -\alpha _i^k\delta_{i+ i_p}[T^k]+ \beta_i^k\delta_{i+ i_p}[S^k]} { {e_{1u}}_{\,i + i_p}^{\,k} } \notag \\
+  &=+\fractext{1}{4} g{A_e}_i^k{\: }{b_u}_{i+i_p}^k
+    \left({_i^k\mathbb{R}_{i_p}^{k_p}}+\frac{\delta_{i+i_p}[z_T^k]}{{e_{1u}}_{\,i + i_p}^{\,k}}\right) {_i^k\mathbb{R}_{i_p}^{k_p}}
+    \frac{-\alpha_i^k \delta_{k+ k_p}[T^i]+ \beta_i^k\delta_{k+ k_p}[S^i]} {{e_{3w}}_{\,i}^{\,k+k_p}},
+\end{align}
+using the definition of the triad slope $\rtriad{R}$, \autoref{eq:TRIADS_R} to
+express $-\alpha _i^k\delta_{i+ i_p}[T^k]+\beta_i^k\delta_{i+ i_p}[S^k]$ in terms of
+$-\alpha_i^k \delta_{k+ k_p}[T^i]+ \beta_i^k\delta_{k+ k_p}[S^i]$.
+
+Where the coordinates slope, the $i$-flux gives a PE change
+\begin{multline}
+  \label{eq:TRIADS_lat_densityPE}
+  g \delta_{i+i_p}[z_T^k]
+  \left[
+    -\alpha _i^k {\:}_i^k {\mathbb{S}_u}_{i_p}^{k_p} (T) + \beta_i^k {\:}_i^k {\mathbb{S}_u}_{i_p}^{k_p} (S)
+  \right] \\
+  = +\fractext{1}{4} g{A_e}_i^k{\: }{b_u}_{i+i_p}^k
+  \frac{\delta_{i+i_p}[z_T^k]}{{e_{1u}}_{\,i + i_p}^{\,k}}
+  \left({_i^k\mathbb{R}_{i_p}^{k_p}}+\frac{\delta_{i+i_p}[z_T^k]}{{e_{1u}}_{\,i + i_p}^{\,k}}\right)
+  \frac{-\alpha_i^k \delta_{k+ k_p}[T^i]+ \beta_i^k\delta_{k+ k_p}[S^i]} {{e_{3w}}_{\,i}^{\,k+k_p}},
+\end{multline}
+(using \autoref{eq:TRIADS_skewfluxu}) and so the total PE change \autoref{eq:TRIADS_vert_densityPE} +
+\autoref{eq:TRIADS_lat_densityPE} associated with the triad fluxes is
+\begin{multline*}
+  % \label{eq:TRIADS_tot_densityPE}
+  g{e_{3w}}_{\,i}^{\,k+k_p}{\mathbb{S}_w}_{i_p}^{k_p} (\rho) +
+  g\delta_{i+i_p}[z_T^k] {\:}_i^k {\mathbb{S}_u}_{i_p}^{k_p} (\rho) \\
+  = +\fractext{1}{4} g{A_e}_i^k{\: }{b_u}_{i+i_p}^k
+  \left({_i^k\mathbb{R}_{i_p}^{k_p}}+\frac{\delta_{i+i_p}[z_T^k]}{{e_{1u}}_{\,i + i_p}^{\,k}}\right)^2
+  \frac{-\alpha_i^k \delta_{k+ k_p}[T^i]+ \beta_i^k\delta_{k+ k_p}[S^i]} {{e_{3w}}_{\,i}^{\,k+k_p}}.
+\end{multline*}
+Where the fluid is stable, with $-\alpha_i^k \delta_{k+ k_p}[T^i]+
+\beta_i^k\delta_{k+ k_p}[S^i]<0$, this PE change is negative.
+
+\subsection{Treatment of the triads at the boundaries}
+\label{sec:TRIADS_skew_bdry}
+
+Triad slopes \rtriadt{R} used for the calculation of the eddy-induced skew-fluxes are masked at the boundaries
+in exactly the same way as are the triad slopes \rtriad{R} used for the iso-neutral diffusive fluxes,
+as described in \autoref{sec:TRIADS_iso_bdry} and \autoref{fig:TRIADS_bdry_triads}.
+Thus surface layer triads $\triadt{i}{1}{R}{1/2}{-1/2}$ and $\triadt{i+1}{1}{R}{-1/2}{-1/2}$ are masked,
+and both near bottom triad slopes $\triadt{i}{k}{R}{1/2}{1/2}$ and $\triadt{i+1}{k}{R}{-1/2}{1/2}$ are masked when
+either of the $i,k+1$ or $i+1,k+1$ tracer points is masked, \ie\ the $i,k+1$ $u$-point is masked.
+The namelist parameter \np{ln\_botmix\_triad} has no effect on the eddy-induced skew-fluxes.
+
+\subsection{Limiting of the slopes within the interior}
+\label{sec:TRIADS_limitskew}
+
+Presently, the iso-neutral slopes $\tilde{r}_i$ relative to geopotentials are limited to be less than $1/100$,
+exactly as in calculating the iso-neutral diffusion, \S \autoref{sec:TRIADS_limit}.
+Each individual triad \rtriadt{R} is so limited.
+
+\subsection{Tapering within the surface mixed layer}
+\label{sec:TRIADS_taperskew}
+
+The slopes $\tilde{r}_i$ relative to geopotentials (and thus the individual triads \rtriadt{R})
+are always tapered linearly from their value immediately below the mixed layer to zero at the surface
+\autoref{eq:TRIADS_rmtilde}, as described in \autoref{sec:TRIADS_lintaper}.
+This is option (c) of \autoref{fig:LDF_eiv_slp}.
+This linear tapering for the slopes used to calculate the eddy-induced fluxes is unaffected by
+the value of \np{ln\_triad\_iso}.
+
+The justification for this linear slope tapering is that, for $A_e$ that is constant or varies only in
+the horizontal (the most commonly used options in \NEMO: see \autoref{sec:LDF_coef}),
+it is equivalent to a horizontal eiv (eddy-induced velocity) that is uniform within the mixed layer
+\autoref{eq:TRIADS_eiv_v}.
+This ensures that the eiv velocities do not restratify the mixed layer \citep{treguier.held.ea_JPO97,danabasoglu.ferrari.ea_JC08}.
+Equivantly, in terms of the skew-flux formulation we use here,
+the linear slope tapering within the mixed-layer gives a linearly varying vertical flux,
+and so a tracer convergence uniform in depth
+(the horizontal flux convergence is relatively insignificant within the mixed-layer).
+
+\subsection{Streamfunction diagnostics}
+\label{sec:TRIADS_sfdiag}
+
+Where the namelist parameter \np{ln\_traldf\_gdia}\forcode{ = .true.},
+diagnosed mean eddy-induced velocities are output.
+Each time step, streamfunctions are calculated in the $i$-$k$ and $j$-$k$ planes at
+$uw$ (integer +1/2 $i$, integer $j$, integer +1/2 $k$) and $vw$ (integer $i$, integer +1/2 $j$, integer +1/2 $k$)
+points (see Table \autoref{tab:DOM_cell}) respectively.
+We follow \citep{griffies_bk04} and calculate the streamfunction at a given $uw$-point from
+the surrounding four triads according to:
+\[
+  % \label{eq:TRIADS_sfdiagi}
+  {\psi_1}_{i+1/2}^{k+1/2}={\fractext{1}{4}}\sum_{\substack{i_p,\,k_p}}
+  {A_e}_{i+1/2-i_p}^{k+1/2-k_p}\:\triadd{i+1/2-i_p}{k+1/2-k_p}{R}{i_p}{k_p}.
+\]
+The streamfunction $\psi_1$ is calculated similarly at $vw$ points.
+The eddy-induced velocities are then calculated from the straightforward discretisation of \autoref{eq:TRIADS_eiv_v}:
+\[
+  % \label{eq:TRIADS_eiv_v_discrete}
+  \begin{split}
+    {u^*}_{i+1/2}^{k} & = - \frac{1}{{e_{3u}}_{i}^{k}}\left({\psi_1}_{i+1/2}^{k+1/2}-{\psi_1}_{i+1/2}^{k+1/2}\right),   \\
+    {v^*}_{j+1/2}^{k} & = - \frac{1}{{e_{3v}}_{j}^{k}}\left({\psi_2}_{j+1/2}^{k+1/2}-{\psi_2}_{j+1/2}^{k+1/2}\right),   \\
+    {w^*}_{i,j}^{k+1/2} & =    \frac{1}{e_{1t}e_{2t}}\; \left\{
+      {e_{2u}}_{i+1/2}^{k+1/2} \,{\psi_1}_{i+1/2}^{k+1/2} -
+      {e_{2u}}_{i-1/2}^{k+1/2} \,{\psi_1}_{i-1/2}^{k+1/2} \right. + \\
+    \phantom{=} & \qquad\qquad\left. {e_{2v}}_{j+1/2}^{k+1/2} \,{\psi_2}_{j+1/2}^{k+1/2} - {e_{2v}}_{j-1/2}^{k+1/2} \,{\psi_2}_{j-1/2}^{k+1/2} \right\},
+  \end{split}
+\]
+
+\biblio
+
+\pindex
+
+\end{document}
Index: /NEMO/trunk/doc/latex/NEMO/subfiles/chap_ASM.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/subfiles/chap_ASM.tex	(revision 11542)
+++ /NEMO/trunk/doc/latex/NEMO/subfiles/chap_ASM.tex	(revision 11543)
@@ -53,5 +53,5 @@
 additional tendency terms to the prognostic equations:
 \begin{align*}
-  % \label{eq:wa_traj_iau}
+  % \label{eq:ASM_wa_traj_iau}
   {\mathbf x}^{a}(t_{i}) = M(t_{i}, t_{0})[{\mathbf x}^{b}(t_{0})] \; + \; F_{i} \delta \tilde{\mathbf x}^{a}
 \end{align*}
@@ -66,5 +66,5 @@
 The first function (namelist option \np{niaufn}=0) employs constant weights,
 \begin{align}
-  \label{eq:F1_i}
+  \label{eq:ASM_F1_i}
   F^{(1)}_{i}
   =\left\{
@@ -80,5 +80,5 @@
 with the weighting reduced linearly to a small value at the window end-points:
 \begin{align}
-  \label{eq:F2_i}
+  \label{eq:ASM_F2_i}
   F^{(2)}_{i}
   =\left\{
@@ -92,6 +92,6 @@
 \end{align}
 where $\alpha^{-1} = \sum_{i=1}^{M/2} 2i$ and $M$ is assumed to be even.
-The weights described by \autoref{eq:F2_i} provide a smoother transition of the analysis trajectory from
-one assimilation cycle to the next than that described by \autoref{eq:F1_i}.
+The weights described by \autoref{eq:ASM_F2_i} provide a smoother transition of the analysis trajectory from
+one assimilation cycle to the next than that described by \autoref{eq:ASM_F1_i}.
 
 %==========================================================================
@@ -106,5 +106,5 @@
 
 \begin{equation}
-  \label{eq:asm_dmp}
+  \label{eq:ASM_dmp}
   \left\{
     \begin{aligned}
@@ -120,5 +120,5 @@
 
 \[
-  % \label{eq:asm_div}
+  % \label{eq:ASM_div}
   \chi^{n-1}_I = \frac{1}{e_{1t}\,e_{2t}\,e_{3t} }
   \left( {\delta_i \left[ {e_{2u}\,e_{3u}\,u^{n-1}_I} \right]
@@ -126,5 +126,5 @@
 \]
 
-By the application of \autoref{eq:asm_dmp} the divergence is filtered in each iteration,
+By the application of \autoref{eq:ASM_dmp} the divergence is filtered in each iteration,
 and the vorticity is left unchanged.
 In the presence of coastal boundaries with zero velocity increments perpendicular to the coast
Index: MO/trunk/doc/latex/NEMO/subfiles/chap_CONFIG.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/subfiles/chap_CONFIG.tex	(revision 11542)
+++ 	(revision )
@@ -1,317 +1,0 @@
-\documentclass[../main/NEMO_manual]{subfiles}
-
-\begin{document}
-% ================================================================
-% Chapter Configurations
-% ================================================================
-\chapter{Configurations}
-\label{chap:CFG}
-
-\chaptertoc
-
-\newpage
-
-% ================================================================
-% Introduction
-% ================================================================
-\section{Introduction}
-\label{sec:CFG_intro}
-
-The purpose of this part of the manual is to introduce the \NEMO\ reference configurations.
-These configurations are offered as means to explore various numerical and physical options,
-thus allowing the user to verify that the code is performing in a manner consistent with that we are running.
-This form of verification is critical as one adopts the code for his or her particular research purposes.
-The reference configurations also provide a sense for some of the options available in the code,
-though by no means are all options exercised in the reference configurations.
-Configuration is defined manually through the \nam{cfg} namelist variables.
-
-%------------------------------------------namcfg----------------------------------------------------
-
-\nlst{namcfg}
-%-------------------------------------------------------------------------------------------------------------
-
-% ================================================================
-% 1D model configuration
-% ================================================================
-\section[C1D: 1D Water column model (\texttt{\textbf{key\_c1d}})]
-{C1D: 1D Water column model (\protect\key{c1d})}
-\label{sec:CFG_c1d}
-
-The 1D model option simulates a stand alone water column within the 3D \NEMO\ system.
-It can be applied to the ocean alone or to the ocean-ice system and can include passive tracers or a biogeochemical model.
-It is set up by defining the position of the 1D water column in the grid
-(see \path{./cfgs/SHARED/namelist\_ref}).
-The 1D model is a very useful tool
-\textit{(a)} to learn about the physics and numerical treatment of vertical mixing processes;
-\textit{(b)} to investigate suitable parameterisations of unresolved turbulence
-(surface wave breaking, Langmuir circulation, ...);
-\textit{(c)} to compare the behaviour of different vertical mixing schemes;
-\textit{(d)} to perform sensitivity studies on the vertical diffusion at a particular point of an ocean domain;
-\textit{(d)} to produce extra diagnostics, without the large memory requirement of the full 3D model.
-
-The methodology is based on the configuration of the smallest possible domain:
-a 3x3 domain with 75 vertical levels.
-
-The 1D model has some specifies. First, all the horizontal derivatives are assumed to be zero,
-and second, the two components of the velocity are moved on a $T$-point.
-Therefore, defining \key{c1d} changes some things in the code behaviour:
-\begin{description}
-\item[(1)]
-  a simplified \rou{stp} routine is used (\rou{stp\_c1d}, see \mdl{step\_c1d} module) in which
-  both lateral tendancy terms and lateral physics are not called;
-\item[(2)]
-  the vertical velocity is zero
-  (so far, no attempt at introducing a Ekman pumping velocity has been made);
-\item[(3)]
-  a simplified treatment of the Coriolis term is performed as $U$- and $V$-points are the same
-  (see \mdl{dyncor\_c1d}).
-\end{description}
-All the relevant \textit{\_c1d} modules can be found in the src/OCE/C1D directory of
-the \NEMO\ distribution.
-
-% to be added:  a test case on the yearlong Ocean Weather Station (OWS) Papa dataset of Martin (1985)
-
-% ================================================================
-% ORCA family configurations
-% ================================================================
-\section{ORCA family: global ocean with tripolar grid}
-\label{sec:CFG_orca}
-
-The ORCA family is a series of global ocean configurations that are run together with
-the SI3 model (ORCA-ICE) and possibly with PISCES biogeochemical model (ORCA-ICE-PISCES).
-An appropriate namelist is available in \path{./cfgs/ORCA2_ICE_PISCES/EXPREF/namelist_cfg} for ORCA2.
-The domain of ORCA2 configuration is defined in \ifile{ORCA\_R2\_zps\_domcfg} file,
-this file is available in tar file on the \NEMO\ community zenodo platform: \\
-https://doi.org/10.5281/zenodo.2640723
-
-In this namelist\_cfg the name of domain input file is set in \nam{cfg} block of namelist.
-
-%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-\begin{figure}[!t]
-  \begin{center}
-    \includegraphics[width=\textwidth]{Fig_ORCA_NH_mesh}
-    \caption{
-      \protect\label{fig:MISC_ORCA_msh}
-      ORCA mesh conception.
-      The departure from an isotropic Mercator grid start poleward of 20\deg{N}.
-      The two "north pole" are the foci of a series of embedded ellipses (blue curves) which
-      are determined analytically and form the i-lines of the ORCA mesh (pseudo latitudes).
-      Then, following \citet{madec.imbard_CD96}, the normal to the series of ellipses (red curves) is computed which
-      provides the j-lines of the mesh (pseudo longitudes).
-    }
-  \end{center}
-\end{figure}
-%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-% -------------------------------------------------------------------------------------------------------------
-%       ORCA tripolar grid
-% -------------------------------------------------------------------------------------------------------------
-\subsection{ORCA tripolar grid}
-\label{subsec:CFG_orca_grid}
-
-The ORCA grid is a tripolar grid based on the semi-analytical method of \citet{madec.imbard_CD96}.
-It allows to construct a global orthogonal curvilinear ocean mesh which has no singularity point inside
-the computational domain since two north mesh poles are introduced and placed on lands.
-The method involves defining an analytical set of mesh parallels in the stereographic polar plan,
-computing the associated set of mesh meridians, and projecting the resulting mesh onto the sphere.
-The set of mesh parallels used is a series of embedded ellipses which foci are the two mesh north poles
-(\autoref{fig:MISC_ORCA_msh}).
-The resulting mesh presents no loss of continuity in either the mesh lines or the scale factors,
-or even the scale factor derivatives over the whole ocean domain, as the mesh is not a composite mesh.
-%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-\begin{figure}[!tbp]
-  \begin{center}
-    \includegraphics[width=\textwidth]{Fig_ORCA_NH_msh05_e1_e2}
-    \includegraphics[width=\textwidth]{Fig_ORCA_aniso}
-    \caption {
-      \protect\label{fig:MISC_ORCA_e1e2}
-      \textit{Top}: Horizontal scale factors ($e_1$, $e_2$) and
-      \textit{Bottom}: ratio of anisotropy ($e_1 / e_2$)
-      for ORCA 0.5\deg ~mesh.
-      South of 20\deg{N} a Mercator grid is used ($e_1 = e_2$) so that the anisotropy ratio is 1.
-      Poleward of 20\deg{N}, the two "north pole" introduce a weak anisotropy over the ocean areas ($< 1.2$) except in
-      vicinity of Victoria Island (Canadian Arctic Archipelago).
-    }
-  \end{center}
-\end{figure}
-%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-The method is applied to Mercator grid (\ie\ same zonal and meridional grid spacing) poleward of 20\deg{N},
-so that the Equator is a mesh line, which provides a better numerical solution for equatorial dynamics.
-The choice of the series of embedded ellipses (position of the foci and variation of the ellipses)
-is a compromise between maintaining the ratio of mesh anisotropy ($e_1 / e_2$) close to one in the ocean
-(especially in area of strong eddy activities such as the Gulf Stream) and keeping the smallest scale factor in
-the northern hemisphere larger than the smallest one in the southern hemisphere.
-The resulting mesh is shown in \autoref{fig:MISC_ORCA_msh} and \autoref{fig:MISC_ORCA_e1e2} for
-a half a degree grid (ORCA\_R05).
-The smallest ocean scale factor is found in along Antarctica,
-while the ratio of anisotropy remains close to one except near the Victoria Island in the Canadian Archipelago.
-
-% -------------------------------------------------------------------------------------------------------------
-%       ORCA-ICE(-PISCES) configurations
-% -------------------------------------------------------------------------------------------------------------
-\subsection{ORCA pre-defined resolution}
-\label{subsec:CFG_orca_resolution}
-
-The \NEMO\ system is provided with five built-in ORCA configurations which differ in the horizontal resolution.
-The value of the resolution is given by the resolution at the Equator expressed in degrees.
-Each of configuration is set through the \textit{domain\_cfg} domain configuration file,
-which sets the grid size and configuration name parameters.
-The \NEMO\ System Team provides only ORCA2 domain input file "\ifile{ORCA\_R2\_zps\_domcfg}" file
-(\autoref{tab:ORCA}).
-
-%--------------------------------------------------TABLE--------------------------------------------------
-\begin{table}[!t]
-  \begin{center}
-    \begin{tabular}{p{4cm} c c c c}
-      Horizontal Grid & \jp{ORCA\_index} & \jp{jpiglo} & \jp{jpjglo} \\
-      \hline \hline
-%             4   \deg &              4   &          92 &          76 \\
-             2   \deg &              2   &         182 &         149 \\
-             1   \deg &              1   &         362 &         292 \\
-             0.5 \deg &              05  &         722 &         511 \\
-             0.25\deg &              025 &        1442 &        1021 \\
-      \hline \hline
-    \end{tabular}
-    \caption{
-      \protect\label{tab:ORCA}
-      Domain size of ORCA family configurations.
-      The flag for configurations of ORCA family need to be set in \textit{domain\_cfg} file.
-    }
-  \end{center}
-\end{table}
-%--------------------------------------------------------------------------------------------------------------
-
-
-The ORCA\_R2 configuration has the following specificity: starting from a 2\deg~ORCA mesh,
-local mesh refinements were applied to the Mediterranean, Red, Black and Caspian Seas,
-so that the resolution is 1\deg~ there.
-A local transformation were also applied with in the Tropics in order to refine the meridional resolution up to
-0.5\deg~ at the Equator.
-
-The ORCA\_R1 configuration has only a local tropical transformation to refine the meridional resolution up to
-1/3\deg~at the Equator.
-Note that the tropical mesh refinements in ORCA\_R2 and R1 strongly increases the mesh anisotropy there.
-
-The ORCA\_R05 and higher global configurations do not incorporate any regional refinements.
-
-For ORCA\_R1 and R025, setting the configuration key to 75 allows to use 75 vertical levels, otherwise 46 are used.
-In the other ORCA configurations, 31 levels are used
-(see \autoref{tab:orca_zgr}). %\sfcomment{HERE I need to put new table for ORCA2 values} and \autoref{fig:zgr}).
-
-Only the ORCA\_R2 is provided with all its input files in the \NEMO\ distribution.
-%It is very similar to that used as part of the climate model developed at IPSL for the 4th IPCC assessment of
-%climate change (Marti et al., 2009).
-%It is also the basis for the \NEMO\ contribution to the Coordinate Ocean-ice Reference Experiments (COREs)
-%documented in \citet{griffies.biastoch.ea_OM09}.
-
-This version of ORCA\_R2 has 31 levels in the vertical, with the highest resolution (10m) in the upper 150m
-(see \autoref{tab:orca_zgr} and \autoref{fig:zgr}).
-The bottom topography and the coastlines are derived from the global atlas of Smith and Sandwell (1997).
-The default forcing uses the boundary forcing from \citet{large.yeager_rpt04} (see \autoref{subsec:SBC_blk_core}),
-which was developed for the purpose of running global coupled ocean-ice simulations without
-an interactive atmosphere.
-This \citet{large.yeager_rpt04} dataset is available through
-the \href{http://nomads.gfdl.noaa.gov/nomads/forms/mom4/CORE.html}{GFDL web site}.
-The "normal year" of \citet{large.yeager_rpt04} has been chosen of the \NEMO\ distribution since release v3.3.
-
-ORCA\_R2 pre-defined configuration can also be run with multiply online nested zooms (\ie\ with AGRIF, \key{agrif} defined).
-This is available as the AGRIF\_DEMO configuration that can be found in the \path{./cfgs/AGRIF_DEMO/} directory.
-
-A regional Arctic or peri-Antarctic configuration is extracted from an ORCA\_R2 or R05 configurations using
-sponge layers at open boundaries.
-
-% -------------------------------------------------------------------------------------------------------------
-%       GYRE family: double gyre basin
-% -------------------------------------------------------------------------------------------------------------
-\section{GYRE family: double gyre basin}
-\label{sec:CFG_gyre}
-
-The GYRE configuration \citep{levy.klein.ea_OM10} has been built to
-simulate the seasonal cycle of a double-gyre box model.
-It consists in an idealized domain similar to that used in the studies of \citet{drijfhout_JPO94} and
-\citet{hazeleger.drijfhout_JPO98, hazeleger.drijfhout_JPO99, hazeleger.drijfhout_JGR00, hazeleger.drijfhout_JPO00},
-over which an analytical seasonal forcing is applied.
-This allows to investigate the spontaneous generation of a large number of interacting, transient mesoscale eddies
-and their contribution to the large scale circulation.
-
-The GYRE configuration run together with the PISCES biogeochemical model (GYRE-PISCES).
-The domain geometry is a closed rectangular basin on the $\beta$-plane centred at $\sim$ 30\deg{N} and
-rotated by 45\deg, 3180~km long, 2120~km wide and 4~km deep (\autoref{fig:MISC_strait_hand}).
-The domain is bounded by vertical walls and by a flat bottom.
-The configuration is meant to represent an idealized North Atlantic or North Pacific basin.
-The circulation is forced by analytical profiles of wind and buoyancy fluxes.
-The applied forcings vary seasonally in a sinusoidal manner between winter and summer extrema \citep{levy.klein.ea_OM10}.
-The wind stress is zonal and its curl changes sign at 22\deg{N} and 36\deg{N}.
-It forces a subpolar gyre in the north, a subtropical gyre in the wider part of the domain and
-a small recirculation gyre in the southern corner.
-The net heat flux takes the form of a restoring toward a zonal apparent air temperature profile.
-A portion of the net heat flux which comes from the solar radiation is allowed to penetrate within the water column.
-The fresh water flux is also prescribed and varies zonally.
-It is determined such as, at each time step, the basin-integrated flux is zero.
-The basin is initialised at rest with vertical profiles of temperature and salinity uniformly applied to
-the whole domain.
-
-The GYRE configuration is set like an analytical configuration.
-Through \np{ln\_read\_cfg}\forcode{=.false.} in \nam{cfg} namelist defined in
-the reference configuration \path{./cfgs/GYRE_PISCES/EXPREF/namelist_cfg}
-analytical definition of grid in GYRE is done in usrdef\_hrg, usrdef\_zgr routines.
-Its horizontal resolution (and thus the size of the domain) is determined by
-setting \np{nn\_GYRE} in \nam{usr\_def}: \\
-
-\jp{jpiglo} $= 30 \times$ \np{nn\_GYRE} + 2   \\
-
-\jp{jpjglo} $= 20 \times$ \np{nn\_GYRE} + 2   \\
-
-Obviously, the namelist parameters have to be adjusted to the chosen resolution,
-see the Configurations pages on the \NEMO\ web site (\NEMO\ Configurations).
-In the vertical, GYRE uses the default 30 ocean levels (\jp{jpk}\forcode{=31}) (\autoref{fig:zgr}).
-
-The GYRE configuration is also used in benchmark test as it is very simple to increase its resolution and
-as it does not requires any input file.
-For example, keeping a same model size on each processor while increasing the number of processor used is very easy,
-even though the physical integrity of the solution can be compromised.
-Benchmark is activate via \np{ln\_bench}\forcode{=.true.} in \nam{usr\_def} in
-namelist \path{./cfgs/GYRE_PISCES/EXPREF/namelist_cfg}.
-
-%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-\begin{figure}[!t]
-  \begin{center}
-    \includegraphics[width=\textwidth]{Fig_GYRE}
-    \caption{
-      \protect\label{fig:GYRE}
-      Snapshot of relative vorticity at the surface of the model domain in GYRE R9, R27 and R54.
-      From \citet{levy.klein.ea_OM10}.
-    }
-  \end{center}
-\end{figure}
-%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-% -------------------------------------------------------------------------------------------------------------
-%       AMM configuration
-% -------------------------------------------------------------------------------------------------------------
-\section{AMM: atlantic margin configuration}
-\label{sec:MISC_config_AMM}
-
-The AMM, Atlantic Margins Model, is a regional model covering the Northwest European Shelf domain on
-a regular lat-lon grid at approximately 12km horizontal resolution.
-The appropriate \textit{\&namcfg} namelist  is available in \path{./cfgs/AMM12/EXPREF/namelist\_cfg}.
-It is used to build the correct dimensions of the AMM domain.
-
-This configuration tests several features of \NEMO\ functionality specific to the shelf seas.
-In particular, the AMM uses $s$-coordinates in the vertical rather than $z$-coordinates and
-is forced with tidal lateral boundary conditions using a Flather boundary condition from the BDY module.
-Also specific to the AMM configuration is the use of the GLS turbulence scheme (\np{ln\_zdfgls} \forcode{= .true.}).
-
-In addition to the tidal boundary condition the model may also take open boundary conditions from
-a North Atlantic model.
-Boundaries may be completely omitted by setting \np{ln\_bdy} to false.
-Sample surface fluxes, river forcing and a sample initial restart file are included to test a realistic model run.
-The Baltic boundary is included within the river input file and is specified as a river source.
-Unlike ordinary river points the Baltic inputs also include salinity and temperature data.
-
-\biblio
-
-\pindex
-
-\end{document}
Index: /NEMO/trunk/doc/latex/NEMO/subfiles/chap_DIA.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/subfiles/chap_DIA.tex	(revision 11542)
+++ /NEMO/trunk/doc/latex/NEMO/subfiles/chap_DIA.tex	(revision 11543)
@@ -696,42 +696,42 @@
 \begin{table}
   \scriptsize
-  \begin{tabularx}{\textwidth}{|X|c|c|c|}
+  \begin{tabular}{|l|c|c|}
     \hline
     tag ids affected by automatic definition of some of their attributes &
     name attribute                                                       &
-    attribute value                      \\
+    attribute value                                                      \\
     \hline
     \hline
     field\_definition                                                    &
     freq\_op                                                             &
-    \np{rn\_rdt}                         \\
+    \np{rn\_rdt}                                                         \\
     \hline
     SBC                                                                  &
     freq\_op                                                             &
-    \np{rn\_rdt} $\times$ \np{nn\_fsbc}  \\
+    \np{rn\_rdt} $\times$ \np{nn\_fsbc}                                  \\
     \hline
     ptrc\_T                                                              &
     freq\_op                                                             &
-    \np{rn\_rdt} $\times$ \np{nn\_dttrc} \\
+    \np{rn\_rdt} $\times$ \np{nn\_dttrc}                                 \\
     \hline
     diad\_T                                                              &
     freq\_op                                                             &
-    \np{rn\_rdt} $\times$ \np{nn\_dttrc} \\
+    \np{rn\_rdt} $\times$ \np{nn\_dttrc}                                 \\
     \hline
     EqT, EqU, EqW                                                        &
     jbegin, ni,                                                          &
-    according to the grid                \\
-    &
+    according to the grid                                                \\
+                                                                         &
     name\_suffix                                                         &
-    \\
+                                                                         \\
     \hline
     TAO, RAMA and PIRATA moorings                                        &
     zoom\_ibegin, zoom\_jbegin,                                          &
-    according to the grid                \\
-    &
+    according to the grid                                                \\
+                                                                         &
     name\_suffix                                                         &
-    \\
-    \hline
-  \end{tabularx}
+                                                                         \\
+    \hline
+  \end{tabular}
 \end{table}
 
@@ -739,5 +739,5 @@
 
 \subsection{XML reference tables}
-\label{subsec:IOM_xmlref}
+\label{subsec:DIA_IOM_xmlref}
 
 \begin{enumerate}
@@ -1336,5 +1336,5 @@
 the CF metadata standard.
 Therefore while a user may wish to add their own metadata to the output files (as demonstrated in example 4 of
-section \autoref{subsec:IOM_xmlref}) the metadata should, for the most part, comply with the CF-1.5 standard.
+section \autoref{subsec:DIA_IOM_xmlref}) the metadata should, for the most part, comply with the CF-1.5 standard.
 
 Some metadata that may significantly increase the file size (horizontal cell areas and vertices) are controlled by
@@ -1407,5 +1407,5 @@
 the mono-processor case (\ie\ global domain of {\small\ttfamily 182x149x31}).
 An illustration of the potential space savings that NetCDF4 chunking and compression provides is given in
-table \autoref{tab:NC4} which compares the results of two short runs of the ORCA2\_LIM reference configuration with
+table \autoref{tab:DIA_NC4} which compares the results of two short runs of the ORCA2\_LIM reference configuration with
 a 4x2 mpi partitioning.
 Note the variation in the compression ratio achieved which reflects chiefly the dry to wet volume ratio of
@@ -1447,5 +1447,5 @@
   \end{tabular}
   \caption{
-    \protect\label{tab:NC4}
+    \protect\label{tab:DIA_NC4}
     Filesize comparison between NetCDF3 and NetCDF4 with chunking and compression
   }
@@ -1515,5 +1515,5 @@
 \section[FLO: On-Line Floats trajectories (\texttt{\textbf{key\_floats}})]
 {FLO: On-Line Floats trajectories (\protect\key{floats})}
-\label{sec:FLO}
+\label{sec:DIA_FLO}
 %--------------------------------------------namflo-------------------------------------------------------
 
@@ -1847,5 +1847,5 @@
     \mathcal{V} &=  \mathcal{A}  \;\bar{\eta}
   \end{split}
-  \label{eq:MV_nBq}
+  \label{eq:DIA_MV_nBq}
 \end{equation}
 
@@ -1855,5 +1855,5 @@
   \frac{1}{e_3} \partial_t ( e_3\,\rho) + \nabla( \rho \, \textbf{U} )
   = \left. \frac{\textit{emp}}{e_3}\right|_\textit{surface}
-  \label{eq:Co_nBq}
+  \label{eq:DIA_Co_nBq}
 \end{equation}
 
@@ -1864,9 +1864,9 @@
 \begin{equation}
   \partial_t \mathcal{M} = \mathcal{A} \;\overline{\textit{emp}}
-  \label{eq:Mass_nBq}
+  \label{eq:DIA_Mass_nBq}
 \end{equation}
 
 where $\overline{\textit{emp}} = \int_S \textit{emp}\,ds$ is the net mass flux through the ocean surface.
-Bringing \autoref{eq:Mass_nBq} and the time derivative of \autoref{eq:MV_nBq} together leads to
+Bringing \autoref{eq:DIA_Mass_nBq} and the time derivative of \autoref{eq:DIA_MV_nBq} together leads to
 the evolution equation of the mean sea level
 
@@ -1874,17 +1874,17 @@
   \partial_t \bar{\eta} = \frac{\overline{\textit{emp}}}{ \bar{\rho}}
   - \frac{\mathcal{V}}{\mathcal{A}} \;\frac{\partial_t \bar{\rho} }{\bar{\rho}}
-  \label{eq:ssh_nBq}
+  \label{eq:DIA_ssh_nBq}
 \end{equation}
 
-The first term in equation \autoref{eq:ssh_nBq} alters sea level by adding or subtracting mass from the ocean.
+The first term in equation \autoref{eq:DIA_ssh_nBq} alters sea level by adding or subtracting mass from the ocean.
 The second term arises from temporal changes in the global mean density; \ie\ from steric effects.
 
 In a Boussinesq fluid, $\rho$ is replaced by $\rho_o$ in all the equation except when $\rho$ appears multiplied by
 the gravity (\ie\ in the hydrostatic balance of the primitive Equations).
-In particular, the mass conservation equation, \autoref{eq:Co_nBq}, degenerates into the incompressibility equation:
+In particular, the mass conservation equation, \autoref{eq:DIA_Co_nBq}, degenerates into the incompressibility equation:
 
 \[
   \frac{1}{e_3} \partial_t ( e_3 ) + \nabla( \textbf{U} ) = \left. \frac{\textit{emp}}{\rho_o \,e_3}\right|_ \textit{surface}
-  % \label{eq:Co_Bq}
+  % \label{eq:DIA_Co_Bq}
 \]
 
@@ -1893,5 +1893,5 @@
 \[
   \partial_t \mathcal{V} = \mathcal{A} \;\frac{\overline{\textit{emp}}}{\rho_o}
-  % \label{eq:V_Bq}
+  % \label{eq:DIA_V_Bq}
 \]
 
@@ -1912,5 +1912,5 @@
 \begin{equation}
   \mathcal{M}_o = \mathcal{M} + \rho_o \,\eta_s \,\mathcal{A}
-  \label{eq:M_Bq}
+  \label{eq:DIA_M_Bq}
 \end{equation}
 
@@ -1919,9 +1919,9 @@
 Introducing the total density anomaly, $\mathcal{D}= \int_D d_a \,dv$,
 where $d_a = (\rho -\rho_o ) / \rho_o$ is the density anomaly used in \NEMO\ (cf. \autoref{subsec:TRA_eos})
-in \autoref{eq:M_Bq} leads to a very simple form for the steric height:
+in \autoref{eq:DIA_M_Bq} leads to a very simple form for the steric height:
 
 \begin{equation}
   \eta_s = - \frac{1}{\mathcal{A}} \mathcal{D}
-  \label{eq:steric_Bq}
+  \label{eq:DIA_steric_Bq}
 \end{equation}
 
@@ -1943,10 +1943,10 @@
 (wetting and drying of grid point is not allowed).
 
-Third, the discretisation of \autoref{eq:steric_Bq} depends on the type of free surface which is considered.
+Third, the discretisation of \autoref{eq:DIA_steric_Bq} depends on the type of free surface which is considered.
 In the non linear free surface case, \ie\ \np{ln\_linssh}\forcode{=.true.}, it is given by
 
 \[
   \eta_s = - \frac{ \sum_{i,\,j,\,k} d_a\; e_{1t} e_{2t} e_{3t} }{ \sum_{i,\,j,\,k}       e_{1t} e_{2t} e_{3t} }
-  % \label{eq:discrete_steric_Bq_nfs}
+  % \label{eq:DIA_discrete_steric_Bq_nfs}
 \]
 
@@ -1958,5 +1958,5 @@
   \eta_s = - \frac{ \sum_{i,\,j,\,k} d_a\; e_{1t}e_{2t}e_{3t} + \sum_{i,\,j} d_a\; e_{1t}e_{2t} \eta }
                   { \sum_{i,\,j,\,k}       e_{1t}e_{2t}e_{3t} + \sum_{i,\,j}       e_{1t}e_{2t} \eta }
-  % \label{eq:discrete_steric_Bq_fs}
+  % \label{eq:DIA_discrete_steric_Bq_fs}
 \]
 
@@ -1978,5 +1978,5 @@
 \[
   \eta_s = - \frac{1}{\mathcal{A}} \int_D d_a(T,S_o,p_o) \,dv
-  % \label{eq:thermosteric_Bq}
+  % \label{eq:DIA_thermosteric_Bq}
 \]
 
@@ -2014,5 +2014,5 @@
     \includegraphics[width=\textwidth]{Fig_mask_subasins}
     \caption{
-      \protect\label{fig:mask_subasins}
+      \protect\label{fig:DIA_mask_subasins}
 		Decomposition of the World Ocean (here ORCA2) into sub-basin used in to
       compute the heat and salt transports as well as the meridional stream-function:
@@ -2045,5 +2045,5 @@
 Pacific and Indo-Pacific Oceans (defined north of 30\deg{S}) as well as for the World Ocean.
 The sub-basin decomposition requires an input file (\ifile{subbasins}) which contains three 2D mask arrays,
-the Indo-Pacific mask been deduced from the sum of the Indian and Pacific mask (\autoref{fig:mask_subasins}).
+the Indo-Pacific mask been deduced from the sum of the Indian and Pacific mask (\autoref{fig:DIA_mask_subasins}).
 
 %------------------------------------------namptr-----------------------------------------
@@ -2093,5 +2093,5 @@
 \[
   C_u = |u|\frac{\rdt}{e_{1u}}, \quad C_v = |v|\frac{\rdt}{e_{2v}}, \quad C_w = |w|\frac{\rdt}{e_{3w}}
-  % \label{eq:CFL}
+  % \label{eq:DIA_CFL}
 \]
 
Index: /NEMO/trunk/doc/latex/NEMO/subfiles/chap_DOM.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/subfiles/chap_DOM.tex	(revision 11542)
+++ /NEMO/trunk/doc/latex/NEMO/subfiles/chap_DOM.tex	(revision 11543)
@@ -29,5 +29,5 @@
     {\em
       Compatibility changes Major simplification has moved many of the options to external domain configuration tools.
-      (see \autoref{apdx:DOMAINcfg})
+      (see \autoref{apdx:DOMCFG})
     }                                                                                            \\
     {\em 3.x} & {\em Rachid Benshila, Gurvan Madec \& S\'{e}bastien Masson} &
@@ -38,5 +38,5 @@
 \newpage
 
-Having defined the continuous equations in \autoref{chap:PE} and chosen a time discretisation \autoref{chap:STP},
+Having defined the continuous equations in \autoref{chap:MB} and chosen a time discretisation \autoref{chap:TD},
 we need to choose a grid for spatial discretisation and related numerical algorithms.
 In the present chapter, we provide a general description of the staggered grid used in \NEMO,
@@ -60,5 +60,5 @@
     \includegraphics[width=\textwidth]{Fig_cell}
     \caption{
-      \protect\label{fig:cell}
+      \protect\label{fig:DOM_cell}
       Arrangement of variables.
       $t$ indicates scalar points where temperature, salinity, density, pressure and
@@ -76,5 +76,5 @@
 The arrangement of variables is the same in all directions.
 It consists of cells centred on scalar points ($t$, $S$, $p$, $\rho$) with vector points $(u, v, w)$ defined in
-the centre of each face of the cells (\autoref{fig:cell}).
+the centre of each face of the cells (\autoref{fig:DOM_cell}).
 This is the generalisation to three dimensions of the well-known ``C'' grid in Arakawa's classification
 \citep{mesinger.arakawa_bk76}.
@@ -84,8 +84,8 @@
 The ocean mesh (\ie\ the position of all the scalar and vector points) is defined by the transformation that
 gives $(\lambda,\varphi,z)$ as a function of $(i,j,k)$.
-The grid-points are located at integer or integer and a half value of $(i,j,k)$ as indicated on \autoref{tab:cell}.
+The grid-points are located at integer or integer and a half value of $(i,j,k)$ as indicated on \autoref{tab:DOM_cell}.
 In all the following, subscripts $u$, $v$, $w$, $f$, $uw$, $vw$ or $fw$ indicate the position of
 the grid-point where the scale factors are defined.
-Each scale factor is defined as the local analytical value provided by \autoref{eq:scale_factors}.
+Each scale factor is defined as the local analytical value provided by \autoref{eq:MB_scale_factors}.
 As a result, the mesh on which partial derivatives $\pd[]{\lambda}$, $\pd[]{\varphi}$ and
 $\pd[]{z}$ are evaluated is a uniform mesh with a grid size of unity.
@@ -95,5 +95,5 @@
 centred finite difference approximation, not from their analytical expression.
 This preserves the symmetry of the discrete set of equations and therefore satisfies many of
-the continuous properties (see \autoref{apdx:C}).
+the continuous properties (see \autoref{apdx:INVARIANTS}).
 A similar, related remark can be made about the domain size:
 when needed, an area, volume, or the total ocean depth must be evaluated as the product or sum of the relevant scale factors
@@ -123,5 +123,5 @@
     \end{tabular}
     \caption{
-      \protect\label{tab:cell}
+      \protect\label{tab:DOM_cell}
       Location of grid-points as a function of integer or integer and a half value of the column, line or level.
       This indexing is only used for the writing of the semi -discrete equations.
@@ -145,5 +145,5 @@
 secondly, analytical transformations encourage good practice by the definition of smoothly varying grids
 (rather than allowing the user to set arbitrary jumps in thickness between adjacent layers) \citep{treguier.dukowicz.ea_JGR96}.
-An example of the effect of such a choice is shown in \autoref{fig:zgr_e3}.
+An example of the effect of such a choice is shown in \autoref{fig:DOM_zgr_e3}.
 %>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 \begin{figure}[!t]
@@ -151,5 +151,5 @@
     \includegraphics[width=\textwidth]{Fig_zgr_e3}
     \caption{
-      \protect\label{fig:zgr_e3}
+      \protect\label{fig:DOM_zgr_e3}
       Comparison of (a) traditional definitions of grid-point position and grid-size in the vertical,
       and (b) analytically derived grid-point position and scale factors.
@@ -174,5 +174,5 @@
 the midpoint between them are:
 \begin{alignat*}{2}
-  % \label{eq:di_mi}
+  % \label{eq:DOM_di_mi}
   \delta_i [q]      &= &       &q (i + 1/2) - q (i - 1/2) \\
   \overline q^{\, i} &= &\big\{ &q (i + 1/2) + q (i - 1/2) \big\} / 2
@@ -180,5 +180,5 @@
 
 Similar operators are defined with respect to $i + 1/2$, $j$, $j + 1/2$, $k$, and $k + 1/2$.
-Following \autoref{eq:PE_grad} and \autoref{eq:PE_lap}, the gradient of a variable $q$ defined at a $t$-point has
+Following \autoref{eq:MB_grad} and \autoref{eq:MB_lap}, the gradient of a variable $q$ defined at a $t$-point has
 its three components defined at $u$-, $v$- and $w$-points while its Laplacian is defined at the $t$-point.
 These operators have the following discrete forms in the curvilinear $s$-coordinates system:
@@ -198,5 +198,5 @@
 \end{multline*}
 
-Following \autoref{eq:PE_curl} and \autoref{eq:PE_div}, a vector $\vect A = (a_1,a_2,a_3)$ defined at
+Following \autoref{eq:MB_curl} and \autoref{eq:MB_div}, a vector $\vect A = (a_1,a_2,a_3)$ defined at
 vector points $(u,v,w)$ has its three curl components defined at $vw$-, $uw$, and $f$-points, and
 its divergence defined at $t$-points:
@@ -255,5 +255,5 @@
 In other words, the adjoint of the differencing and averaging operators are $\delta_i^* = \delta_{i + 1/2}$ and
 $(\overline{\cdots}^{\, i})^* = \overline{\cdots}^{\, i + 1/2}$, respectively.
-These two properties will be used extensively in the \autoref{apdx:C} to
+These two properties will be used extensively in the \autoref{apdx:INVARIANTS} to
 demonstrate integral conservative properties of the discrete formulation chosen.
 
@@ -269,5 +269,5 @@
     \includegraphics[width=\textwidth]{Fig_index_hor}
     \caption{
-      \protect\label{fig:index_hor}
+      \protect\label{fig:DOM_index_hor}
       Horizontal integer indexing used in the \fortran code.
       The dashed area indicates the cell in which variables contained in arrays have the same $i$- and $j$-indices
@@ -290,8 +290,8 @@
 \label{subsec:DOM_Num_Index_hor}
 
-The indexing in the horizontal plane has been chosen as shown in \autoref{fig:index_hor}.
+The indexing in the horizontal plane has been chosen as shown in \autoref{fig:DOM_index_hor}.
 For an increasing $i$ index ($j$ index),
 the $t$-point and the eastward $u$-point (northward $v$-point) have the same index
-(see the dashed area in \autoref{fig:index_hor}).
+(see the dashed area in \autoref{fig:DOM_index_hor}).
 A $t$-point and its nearest north-east $f$-point have the same $i$-and $j$-indices.
 
@@ -306,12 +306,12 @@
 given in \autoref{subsec:DOM_cell}.
 The sea surface corresponds to the $w$-level $k = 1$, which is the same index as the $t$-level just below
-(\autoref{fig:index_vert}).
+(\autoref{fig:DOM_index_vert}).
 The last $w$-level ($k = jpk$) either corresponds to or is below the ocean floor while
-the last $t$-level is always outside the ocean domain (\autoref{fig:index_vert}).
+the last $t$-level is always outside the ocean domain (\autoref{fig:DOM_index_vert}).
 Note that a $w$-point and the directly underlaying $t$-point have a common $k$ index
 (\ie\ $t$-points and their nearest $w$-point neighbour in negative index direction),
 in contrast to the indexing on the horizontal plane where the $t$-point has the same index as
 the nearest velocity points in the positive direction of the respective horizontal axis index
-(compare the dashed area in \autoref{fig:index_hor} and \autoref{fig:index_vert}).
+(compare the dashed area in \autoref{fig:DOM_index_hor} and \autoref{fig:DOM_index_vert}).
 Since the scale factors are chosen to be strictly positive,
 a \textit{minus sign} is included in the \fortran implementations of
@@ -324,5 +324,5 @@
     \includegraphics[width=\textwidth]{Fig_index_vert}
     \caption{
-      \protect\label{fig:index_vert}
+      \protect\label{fig:DOM_index_vert}
       Vertical integer indexing used in the \fortran code.
       Note that the $k$-axis is oriented downward.
@@ -363,5 +363,5 @@
 the model domain itself can be altered by runtime selections.
 The code previously used to perform vertical discretisation has been incorporated into an external tool
-(\path{./tools/DOMAINcfg}) which is briefly described in \autoref{apdx:DOMAINcfg}.
+(\path{./tools/DOMAINcfg}) which is briefly described in \autoref{apdx:DOMCFG}.
 
 The next subsections summarise the parameter and fields related to the configuration of the whole model domain.
@@ -418,5 +418,5 @@
 The values of the geographic longitude and latitude arrays at indices $i,j$ correspond to
 the analytical expressions of the longitude $\lambda$ and latitude $\varphi$ as a function of $(i,j)$,
-evaluated at the values as specified in \autoref{tab:cell} for the respective grid-point position.
+evaluated at the values as specified in \autoref{tab:DOM_cell} for the respective grid-point position.
 The calculation of the values of the horizontal scale factor arrays in general additionally involves
 partial derivatives of $\lambda$ and $\varphi$ with respect to $i$ and $j$,
@@ -485,5 +485,5 @@
     \includegraphics[width=\textwidth]{Fig_z_zps_s_sps}
     \caption{
-      \protect\label{fig:z_zps_s_sps}
+      \protect\label{fig:DOM_z_zps_s_sps}
       The ocean bottom as seen by the model:
       (a) $z$-coordinate with full step,
@@ -510,5 +510,5 @@
 By default a non-linear free surface is used (\np{ln\_linssh} set to \forcode{=.false.} in \nam{dom}):
 the coordinate follow the time-variation of the free surface so that the transformation is time dependent:
-$z(i,j,k,t)$ (\eg\ \autoref{fig:z_zps_s_sps}f).
+$z(i,j,k,t)$ (\eg\ \autoref{fig:DOM_z_zps_s_sps}f).
 When a linear free surface is assumed (\np{ln\_linssh} set to \forcode{=.true.} in \nam{dom}),
 the vertical coordinates are fixed in time, but the seawater can move up and down across the $z_0$ surface
@@ -527,5 +527,5 @@
 \medskip
 The decision on these choices must be made when the \np{cn\_domcfg} file is constructed.
-Three main choices are offered (\autoref{fig:z_zps_s_sps}a-c):
+Three main choices are offered (\autoref{fig:DOM_z_zps_s_sps}a-c):
 
 \begin{itemize}
@@ -536,5 +536,5 @@
 
 Additionally, hybrid combinations of the three main coordinates are available:
-$s-z$ or $s-zps$ coordinate (\autoref{fig:z_zps_s_sps}d and \autoref{fig:z_zps_s_sps}e).
+$s-z$ or $s-zps$ coordinate (\autoref{fig:DOM_z_zps_s_sps}d and \autoref{fig:DOM_z_zps_s_sps}e).
 
 A further choice related to vertical coordinate concerns
@@ -678,5 +678,5 @@
 \section[Initial state (\textit{istate.F90} and \textit{dtatsd.F90})]
 {Initial state (\protect\mdl{istate} and \protect\mdl{dtatsd})}
-\label{sec:DTA_tsd}
+\label{sec:DOM_DTA_tsd}
 %-----------------------------------------namtsd-------------------------------------------
 \nlst{namtsd}
@@ -697,5 +697,5 @@
   Initial values for T and S are set via a user supplied \rou{usr\_def\_istate} routine contained in \mdl{userdef\_istate}.
   The default version sets horizontally uniform T and profiles as used in the GYRE configuration
-  (see \autoref{sec:CFG_gyre}).
+  (see \autoref{sec:CFGS_gyre}).
 \end{description}
 
Index: /NEMO/trunk/doc/latex/NEMO/subfiles/chap_DYN.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/subfiles/chap_DYN.tex	(revision 11542)
+++ /NEMO/trunk/doc/latex/NEMO/subfiles/chap_DYN.tex	(revision 11543)
@@ -65,11 +65,10 @@
 %           Horizontal divergence and relative vorticity
 %--------------------------------------------------------------------------------------------------------------
-\subsection[Horizontal divergence and relative vorticity (\textit{divcur.F90})]
-{Horizontal divergence and relative vorticity (\protect\mdl{divcur})}
+\subsection[Horizontal divergence and relative vorticity (\textit{divcur.F90})]{Horizontal divergence and relative vorticity (\protect\mdl{divcur})}
 \label{subsec:DYN_divcur}
 
 The vorticity is defined at an $f$-point (\ie\ corner point) as follows:
 \begin{equation}
-  \label{eq:divcur_cur}
+  \label{eq:DYN_divcur_cur}
   \zeta =\frac{1}{e_{1f}\,e_{2f} }\left( {\;\delta_{i+1/2} \left[ {e_{2v}\;v} \right]
       -\delta_{j+1/2} \left[ {e_{1u}\;u} \right]\;} \right)
@@ -79,5 +78,5 @@
 It is given by:
 \[
-  % \label{eq:divcur_div}
+  % \label{eq:DYN_divcur_div}
   \chi =\frac{1}{e_{1t}\,e_{2t}\,e_{3t} }
   \left( {\delta_i \left[ {e_{2u}\,e_{3u}\,u} \right]
@@ -102,11 +101,10 @@
 %           Sea Surface Height evolution
 %--------------------------------------------------------------------------------------------------------------
-\subsection[Horizontal divergence and relative vorticity (\textit{sshwzv.F90})]
-{Horizontal divergence and relative vorticity (\protect\mdl{sshwzv})}
+\subsection[Horizontal divergence and relative vorticity (\textit{sshwzv.F90})]{Horizontal divergence and relative vorticity (\protect\mdl{sshwzv})}
 \label{subsec:DYN_sshwzv}
 
 The sea surface height is given by:
 \begin{equation}
-  \label{eq:dynspg_ssh}
+  \label{eq:DYN_spg_ssh}
   \begin{aligned}
     \frac{\partial \eta }{\partial t}
@@ -123,7 +121,7 @@
 \textit{emp} can be written as the evaporation minus precipitation, minus the river runoff.
 The sea-surface height is evaluated using exactly the same time stepping scheme as
-the tracer equation \autoref{eq:tra_nxt}:
+the tracer equation \autoref{eq:TRA_nxt}:
 a leapfrog scheme in combination with an Asselin time filter,
-\ie\ the velocity appearing in \autoref{eq:dynspg_ssh} is centred in time (\textit{now} velocity).
+\ie\ the velocity appearing in \autoref{eq:DYN_spg_ssh} is centred in time (\textit{now} velocity).
 This is of paramount importance.
 Replacing $T$ by the number $1$ in the tracer equation and summing over the water column must lead to
@@ -134,5 +132,5 @@
 taking into account the change of the thickness of the levels:
 \begin{equation}
-  \label{eq:wzv}
+  \label{eq:DYN_wzv}
   \left\{
     \begin{aligned}
@@ -148,8 +146,8 @@
 re-orientated downward.
 \gmcomment{not sure of this...  to be modified with the change in emp setting}
-In the case of a linear free surface, the time derivative in \autoref{eq:wzv} disappears.
+In the case of a linear free surface, the time derivative in \autoref{eq:DYN_wzv} disappears.
 The upper boundary condition applies at a fixed level $z=0$.
 The top vertical velocity is thus equal to the divergence of the barotropic transport
-(\ie\ the first term in the right-hand-side of \autoref{eq:dynspg_ssh}).
+(\ie\ the first term in the right-hand-side of \autoref{eq:DYN_spg_ssh}).
 
 Note also that whereas the vertical velocity has the same discrete expression in $z$- and $s$-coordinates,
@@ -157,5 +155,5 @@
 in the second case, $w$ is the velocity normal to the $s$-surfaces.
 Note also that the $k$-axis is re-orientated downwards in the \fortran code compared to
-the indexing used in the semi-discrete equations such as \autoref{eq:wzv}
+the indexing used in the semi-discrete equations such as \autoref{eq:DYN_wzv}
 (see \autoref{subsec:DOM_Num_Index_vertical}).
 
@@ -183,6 +181,5 @@
 %        Vorticity term
 % -------------------------------------------------------------------------------------------------------------
-\subsection[Vorticity term (\textit{dynvor.F90})]
-{Vorticity term (\protect\mdl{dynvor})}
+\subsection[Vorticity term (\textit{dynvor.F90})]{Vorticity term (\protect\mdl{dynvor})}
 \label{subsec:DYN_vor}
 %------------------------------------------nam_dynvor----------------------------------------------------
@@ -198,5 +195,5 @@
 horizontal kinetic energy for the planetary vorticity term (MIX scheme);
 or conserving both the potential enstrophy of horizontally non-divergent flow and horizontal kinetic energy
-(EEN scheme) (see \autoref{subsec:C_vorEEN}).
+(EEN scheme) (see \autoref{subsec:INVARIANTS_vorEEN}).
 In the case of ENS, ENE or MIX schemes the land sea mask may be slightly modified to ensure the consistency of
 vorticity term with analytical equations (\np{ln\_dynvor\_con}\forcode{=.true.}).
@@ -206,6 +203,5 @@
 %                 enstrophy conserving scheme
 %-------------------------------------------------------------
-\subsubsection[Enstrophy conserving scheme (\forcode{ln_dynvor_ens=.true.})]
-{Enstrophy conserving scheme (\protect\np{ln\_dynvor\_ens}\forcode{=.true.})}
+\subsubsection[Enstrophy conserving scheme (\forcode{ln_dynvor_ens = .true.})]{Enstrophy conserving scheme (\protect\np{ln\_dynvor\_ens}\forcode{ = .true.})}
 \label{subsec:DYN_vor_ens}
 
@@ -216,5 +212,5 @@
 It is given by:
 \begin{equation}
-  \label{eq:dynvor_ens}
+  \label{eq:DYN_vor_ens}
   \left\{
     \begin{aligned}
@@ -230,6 +226,5 @@
 %                 energy conserving scheme
 %-------------------------------------------------------------
-\subsubsection[Energy conserving scheme (\forcode{ln_dynvor_ene=.true.})]
-{Energy conserving scheme (\protect\np{ln\_dynvor\_ene}\forcode{=.true.})}
+\subsubsection[Energy conserving scheme (\forcode{ln_dynvor_ene = .true.})]{Energy conserving scheme (\protect\np{ln\_dynvor\_ene}\forcode{ = .true.})}
 \label{subsec:DYN_vor_ene}
 
@@ -237,5 +232,5 @@
 It is given by:
 \begin{equation}
-  \label{eq:dynvor_ene}
+  \label{eq:DYN_vor_ene}
   \left\{
     \begin{aligned}
@@ -251,13 +246,12 @@
 %                 mix energy/enstrophy conserving scheme
 %-------------------------------------------------------------
-\subsubsection[Mixed energy/enstrophy conserving scheme (\forcode{ln_dynvor_mix=.true.})]
-{Mixed energy/enstrophy conserving scheme (\protect\np{ln\_dynvor\_mix}\forcode{=.true.})}
+\subsubsection[Mixed energy/enstrophy conserving scheme (\forcode{ln_dynvor_mix = .true.})]{Mixed energy/enstrophy conserving scheme (\protect\np{ln\_dynvor\_mix}\forcode{ = .true.})}
 \label{subsec:DYN_vor_mix}
 
 For the mixed energy/enstrophy conserving scheme (MIX scheme), a mixture of the two previous schemes is used.
-It consists of the ENS scheme (\autoref{eq:dynvor_ens}) for the relative vorticity term,
-and of the ENE scheme (\autoref{eq:dynvor_ene}) applied to the planetary vorticity term.
-\[
-  % \label{eq:dynvor_mix}
+It consists of the ENS scheme (\autoref{eq:DYN_vor_ens}) for the relative vorticity term,
+and of the ENE scheme (\autoref{eq:DYN_vor_ene}) applied to the planetary vorticity term.
+\[
+  % \label{eq:DYN_vor_mix}
   \left\{ {
       \begin{aligned}
@@ -277,6 +271,5 @@
 %                 energy and enstrophy conserving scheme
 %-------------------------------------------------------------
-\subsubsection[Energy and enstrophy conserving scheme (\forcode{ln_dynvor_een=.true.})]
-{Energy and enstrophy conserving scheme (\protect\np{ln\_dynvor\_een}\forcode{=.true.})}
+\subsubsection[Energy and enstrophy conserving scheme (\forcode{ln_dynvor_een = .true.})]{Energy and enstrophy conserving scheme (\protect\np{ln\_dynvor\_een}\forcode{ = .true.})}
 \label{subsec:DYN_vor_een}
 
@@ -297,5 +290,5 @@
 The idea is to get rid of the double averaging by considering triad combinations of vorticity.
 It is noteworthy that this solution is conceptually quite similar to the one proposed by
-\citep{griffies.gnanadesikan.ea_JPO98} for the discretization of the iso-neutral diffusion operator (see \autoref{apdx:C}).
+\citep{griffies.gnanadesikan.ea_JPO98} for the discretization of the iso-neutral diffusion operator (see \autoref{apdx:INVARIANTS}).
 
 The \citet{arakawa.hsu_MWR90} vorticity advection scheme for a single layer is modified
@@ -303,11 +296,11 @@
 First consider the discrete expression of the potential vorticity, $q$, defined at an $f$-point:
 \[
-  % \label{eq:pot_vor}
+  % \label{eq:DYN_pot_vor}
   q  = \frac{\zeta +f} {e_{3f} }
 \]
-where the relative vorticity is defined by (\autoref{eq:divcur_cur}),
+where the relative vorticity is defined by (\autoref{eq:DYN_divcur_cur}),
 the Coriolis parameter is given by $f=2 \,\Omega \;\sin \varphi _f $ and the layer thickness at $f$-points is:
 \begin{equation}
-  \label{eq:een_e3f}
+  \label{eq:DYN_een_e3f}
   e_{3f} = \overline{\overline {e_{3t} }} ^{\,i+1/2,j+1/2}
 \end{equation}
@@ -326,5 +319,5 @@
 % >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 
-A key point in \autoref{eq:een_e3f} is how the averaging in the \textbf{i}- and \textbf{j}- directions is made.
+A key point in \autoref{eq:DYN_een_e3f} is how the averaging in the \textbf{i}- and \textbf{j}- directions is made.
 It uses the sum of masked t-point vertical scale factor divided either by the sum of the four t-point masks
 (\np{nn\_een\_e3f}\forcode{=1}), or just by $4$ (\np{nn\_een\_e3f}\forcode{=.true.}).
@@ -340,5 +333,5 @@
 (\autoref{fig:DYN_een_triad}):
 \begin{equation}
-  \label{eq:Q_triads}
+  \label{eq:DYN_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)
@@ -348,5 +341,5 @@
 Finally, the vorticity terms are represented as:
 \begin{equation}
-  \label{eq:dynvor_een}
+  \label{eq:DYN_vor_een}
   \left\{ {
       \begin{aligned}
@@ -361,5 +354,5 @@
 This EEN scheme in fact combines the conservation properties of the ENS and ENE schemes.
 It conserves both total energy and potential enstrophy in the limit of horizontally nondivergent flow
-(\ie\ $\chi$=$0$) (see \autoref{subsec:C_vorEEN}).
+(\ie\ $\chi$=$0$) (see \autoref{subsec:INVARIANTS_vorEEN}).
 Applied to a realistic ocean configuration, it has been shown that it leads to a significant reduction of
 the noise in the vertical velocity field \citep{le-sommer.penduff.ea_OM09}.
@@ -371,14 +364,13 @@
 %           Kinetic Energy Gradient term
 %--------------------------------------------------------------------------------------------------------------
-\subsection[Kinetic energy gradient term (\textit{dynkeg.F90})]
-{Kinetic energy gradient term (\protect\mdl{dynkeg})}
+\subsection[Kinetic energy gradient term (\textit{dynkeg.F90})]{Kinetic energy gradient term (\protect\mdl{dynkeg})}
 \label{subsec:DYN_keg}
 
-As demonstrated in \autoref{apdx:C},
+As demonstrated in \autoref{apdx:INVARIANTS},
 there is a single discrete formulation of the kinetic energy gradient term that,
 together with the formulation chosen for the vertical advection (see below),
 conserves the total kinetic energy:
 \[
-  % \label{eq:dynkeg}
+  % \label{eq:DYN_keg}
   \left\{
     \begin{aligned}
@@ -392,6 +384,5 @@
 %           Vertical advection term
 %--------------------------------------------------------------------------------------------------------------
-\subsection[Vertical advection term (\textit{dynzad.F90})]
-{Vertical advection term (\protect\mdl{dynzad})}
+\subsection[Vertical advection term (\textit{dynzad.F90})]{Vertical advection term (\protect\mdl{dynzad})}
 \label{subsec:DYN_zad}
 
@@ -400,7 +391,7 @@
 conserves the total kinetic energy.
 Indeed, the change of KE due to the vertical advection is exactly balanced by
-the change of KE due to the gradient of KE (see \autoref{apdx:C}).
-\[
-  % \label{eq:dynzad}
+the change of KE due to the gradient of KE (see \autoref{apdx:INVARIANTS}).
+\[
+  % \label{eq:DYN_zad}
   \left\{
     \begin{aligned}
@@ -439,6 +430,5 @@
 %           Coriolis plus curvature metric terms
 %--------------------------------------------------------------------------------------------------------------
-\subsection[Coriolis plus curvature metric terms (\textit{dynvor.F90})]
-{Coriolis plus curvature metric terms (\protect\mdl{dynvor})}
+\subsection[Coriolis plus curvature metric terms (\textit{dynvor.F90})]{Coriolis plus curvature metric terms (\protect\mdl{dynvor})}
 \label{subsec:DYN_cor_flux}
 
@@ -447,5 +437,5 @@
 It is given by:
 \begin{multline*}
-  % \label{eq:dyncor_metric}
+  % \label{eq:DYN_cor_metric}
   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]
@@ -453,7 +443,7 @@
 \end{multline*}
 
-Any of the (\autoref{eq:dynvor_ens}), (\autoref{eq:dynvor_ene}) and (\autoref{eq:dynvor_een}) schemes can be used to
+Any of the (\autoref{eq:DYN_vor_ens}), (\autoref{eq:DYN_vor_ene}) and (\autoref{eq:DYN_vor_een}) schemes can be used to
 compute the product of the Coriolis parameter and the vorticity.
-However, the energy-conserving scheme (\autoref{eq:dynvor_een}) has exclusively been used to date.
+However, the energy-conserving scheme (\autoref{eq:DYN_vor_een}) has exclusively been used to date.
 This term is evaluated using a leapfrog scheme, \ie\ the velocity is centred in time (\textit{now} velocity).
 
@@ -461,11 +451,10 @@
 %           Flux form Advection term
 %--------------------------------------------------------------------------------------------------------------
-\subsection[Flux form advection term (\textit{dynadv.F90})]
-{Flux form advection term (\protect\mdl{dynadv})}
+\subsection[Flux form advection term (\textit{dynadv.F90})]{Flux form advection term (\protect\mdl{dynadv})}
 \label{subsec:DYN_adv_flux}
 
 The discrete expression of the advection term is given by:
 \[
-  % \label{eq:dynadv}
+  % \label{eq:DYN_adv}
   \left\{
     \begin{aligned}
@@ -495,11 +484,10 @@
 %                 2nd order centred scheme
 %-------------------------------------------------------------
-\subsubsection[CEN2: $2^{nd}$ order centred scheme (\forcode{ln_dynadv_cen2=.true.})]
-{CEN2: $2^{nd}$ order centred scheme (\protect\np{ln\_dynadv\_cen2}\forcode{=.true.})}
+\subsubsection[CEN2: $2^{nd}$ order centred scheme (\forcode{ln_dynadv_cen2 = .true.})]{CEN2: $2^{nd}$ order centred scheme (\protect\np{ln\_dynadv\_cen2}\forcode{ = .true.})}
 \label{subsec:DYN_adv_cen2}
 
 In the centered $2^{nd}$ order formulation, the velocity is evaluated as the mean of the two neighbouring points:
 \begin{equation}
-  \label{eq:dynadv_cen2}
+  \label{eq:DYN_adv_cen2}
   \left\{
     \begin{aligned}
@@ -519,6 +507,5 @@
 %                 UBS scheme
 %-------------------------------------------------------------
-\subsubsection[UBS: Upstream Biased Scheme (\forcode{ln_dynadv_ubs=.true.})]
-{UBS: Upstream Biased Scheme (\protect\np{ln\_dynadv\_ubs}\forcode{=.true.})}
+\subsubsection[UBS: Upstream Biased Scheme (\forcode{ln_dynadv_ubs = .true.})]{UBS: Upstream Biased Scheme (\protect\np{ln\_dynadv\_ubs}\forcode{ = .true.})}
 \label{subsec:DYN_adv_ubs}
 
@@ -527,5 +514,5 @@
 For example, the evaluation of $u_T^{ubs} $ is done as follows:
 \begin{equation}
-  \label{eq:dynadv_ubs}
+  \label{eq:DYN_adv_ubs}
   u_T^{ubs} =\overline u ^i-\;\frac{1}{6}
   \begin{cases}
@@ -547,9 +534,9 @@
 The UBS scheme is not used in all directions.
 In the vertical, the centred $2^{nd}$ order evaluation of the advection is preferred, \ie\ $u_{uw}^{ubs}$ and
-$u_{vw}^{ubs}$ in \autoref{eq:dynadv_cen2} are used.
+$u_{vw}^{ubs}$ in \autoref{eq:DYN_adv_cen2} are used.
 UBS is diffusive and is associated with vertical mixing of momentum. \gmcomment{ gm  pursue the
 sentence:Since vertical mixing of momentum is a source term of the TKE equation...  }
 
-For stability reasons, the first term in (\autoref{eq:dynadv_ubs}),
+For stability reasons, the first term in (\autoref{eq:DYN_adv_ubs}),
 which corresponds to a second order centred scheme, is evaluated using the \textit{now} velocity (centred in time),
 while the second term, which is the diffusion part of the scheme,
@@ -559,5 +546,5 @@
 Note that the UBS and QUICK (Quadratic Upstream Interpolation for Convective Kinematics) schemes only differ by
 one coefficient.
-Replacing $1/6$ by $1/8$ in (\autoref{eq:dynadv_ubs}) leads to the QUICK advection scheme \citep{webb.de-cuevas.ea_JAOT98}.
+Replacing $1/6$ by $1/8$ in (\autoref{eq:DYN_adv_ubs}) leads to the QUICK advection scheme \citep{webb.de-cuevas.ea_JAOT98}.
 This option is not available through a namelist parameter, since the $1/6$ coefficient is hard coded.
 Nevertheless it is quite easy to make the substitution in the \mdl{dynadv\_ubs} module and obtain a QUICK scheme.
@@ -573,6 +560,5 @@
 %           Hydrostatic pressure gradient term
 % ================================================================
-\section[Hydrostatic pressure gradient (\textit{dynhpg.F90})]
-{Hydrostatic pressure gradient (\protect\mdl{dynhpg})}
+\section[Hydrostatic pressure gradient (\textit{dynhpg.F90})]{Hydrostatic pressure gradient (\protect\mdl{dynhpg})}
 \label{sec:DYN_hpg}
 %------------------------------------------nam_dynhpg---------------------------------------------------
@@ -596,6 +582,5 @@
 %           z-coordinate with full step
 %--------------------------------------------------------------------------------------------------------------
-\subsection[Full step $Z$-coordinate (\forcode{ln_dynhpg_zco=.true.})]
-{Full step $Z$-coordinate (\protect\np{ln\_dynhpg\_zco}\forcode{=.true.})}
+\subsection[Full step $Z$-coordinate (\forcode{ln_dynhpg_zco = .true.})]{Full step $Z$-coordinate (\protect\np{ln\_dynhpg\_zco}\forcode{ = .true.})}
 \label{subsec:DYN_hpg_zco}
 
@@ -607,5 +592,5 @@
 for $k=km$ (surface layer, $jk=1$ in the code)
 \begin{equation}
-  \label{eq:dynhpg_zco_surf}
+  \label{eq:DYN_hpg_zco_surf}
   \left\{
     \begin{aligned}
@@ -620,5 +605,5 @@
 for $1<k<km$ (interior layer)
 \begin{equation}
-  \label{eq:dynhpg_zco}
+  \label{eq:DYN_hpg_zco}
   \left\{
     \begin{aligned}
@@ -633,15 +618,14 @@
 \end{equation}
 
-Note that the $1/2$ factor in (\autoref{eq:dynhpg_zco_surf}) is adequate because of the definition of $e_{3w}$ as
+Note that the $1/2$ factor in (\autoref{eq:DYN_hpg_zco_surf}) is adequate because of the definition of $e_{3w}$ as
 the vertical derivative of the scale factor at the surface level ($z=0$).
 Note also that in case of variable volume level (\texttt{vvl?} defined),
-the surface pressure gradient is included in \autoref{eq:dynhpg_zco_surf} and
-\autoref{eq:dynhpg_zco} through the space and time variations of the vertical scale factor $e_{3w}$.
+the surface pressure gradient is included in \autoref{eq:DYN_hpg_zco_surf} and
+\autoref{eq:DYN_hpg_zco} through the space and time variations of the vertical scale factor $e_{3w}$.
 
 %--------------------------------------------------------------------------------------------------------------
 %           z-coordinate with partial step
 %--------------------------------------------------------------------------------------------------------------
-\subsection[Partial step $Z$-coordinate (\forcode{ln_dynhpg_zps=.true.})]
-{Partial step $Z$-coordinate (\protect\np{ln\_dynhpg\_zps}\forcode{=.true.})}
+\subsection[Partial step $Z$-coordinate (\forcode{ln_dynhpg_zps = .true.})]{Partial step $Z$-coordinate (\protect\np{ln\_dynhpg\_zps}\forcode{ = .true.})}
 \label{subsec:DYN_hpg_zps}
 
@@ -674,5 +658,5 @@
 $\bullet$ Traditional coding (see for example \citet{madec.delecluse.ea_JPO96}: (\np{ln\_dynhpg\_sco}\forcode{=.true.})
 \begin{equation}
-  \label{eq:dynhpg_sco}
+  \label{eq:DYN_hpg_sco}
   \left\{
     \begin{aligned}
@@ -686,5 +670,5 @@
 
 Where the first term is the pressure gradient along coordinates,
-computed as in \autoref{eq:dynhpg_zco_surf} - \autoref{eq:dynhpg_zco},
+computed as in \autoref{eq:DYN_hpg_zco_surf} - \autoref{eq:DYN_hpg_zco},
 and $z_T$ is the depth of the $T$-point evaluated from the sum of the vertical scale factors at the $w$-point
 ($e_{3w}$).
@@ -698,5 +682,5 @@
 (\np{ln\_dynhpg\_djc}\forcode{=.true.}) (currently disabled; under development)
 
-Note that expression \autoref{eq:dynhpg_sco} is commonly used when the variable volume formulation is activated
+Note that expression \autoref{eq:DYN_hpg_sco} is commonly used when the variable volume formulation is activated
 (\texttt{vvl?}) because in that case, even with a flat bottom,
 the coordinate surfaces are not horizontal but follow the free surface \citep{levier.treguier.ea_rpt07}.
@@ -712,4 +696,5 @@
 \subsection{Ice shelf cavity}
 \label{subsec:DYN_hpg_isf}
+
 Beneath an ice shelf, the total pressure gradient is the sum of the pressure gradient due to the ice shelf load and
 the pressure gradient due to the ocean load (\np{ln\_dynhpg\_isf}\forcode{=.true.}).\\
@@ -722,5 +707,5 @@
 A detailed description of this method is described in \citet{losch_JGR08}.\\
 
-The pressure gradient due to ocean load is computed using the expression \autoref{eq:dynhpg_sco} described in
+The pressure gradient due to ocean load is computed using the expression \autoref{eq:DYN_hpg_sco} described in
 \autoref{subsec:DYN_hpg_sco}.
 
@@ -728,6 +713,5 @@
 %           Time-scheme
 %--------------------------------------------------------------------------------------------------------------
-\subsection[Time-scheme (\forcode{ln_dynhpg_imp={.true.,.false.}})]
-{Time-scheme (\protect\np{ln\_dynhpg\_imp}\forcode{=.true.,.false.})}
+\subsection[Time-scheme (\forcode{ln_dynhpg_imp = .{true,false}.})]{Time-scheme (\protect\np{ln\_dynhpg\_imp}\forcode{ = .\{true,false\}}.)}
 \label{subsec:DYN_hpg_imp}
 
@@ -748,5 +732,5 @@
 
 \begin{equation}
-  \label{eq:dynhpg_lf}
+  \label{eq:DYN_hpg_lf}
   \frac{u^{t+\rdt}-u^{t-\rdt}}{2\rdt} = \;\cdots \;
   -\frac{1}{\rho_o \,e_{1u} }\delta_{i+1/2} \left[ {p_h^t } \right]
@@ -755,17 +739,17 @@
 $\bullet$ semi-implicit scheme (\np{ln\_dynhpg\_imp}\forcode{=.true.}):
 \begin{equation}
-  \label{eq:dynhpg_imp}
+  \label{eq:DYN_hpg_imp}
   \frac{u^{t+\rdt}-u^{t-\rdt}}{2\rdt} = \;\cdots \;
   -\frac{1}{4\,\rho_o \,e_{1u} } \delta_{i+1/2} \left[ p_h^{t+\rdt} +2\,p_h^t +p_h^{t-\rdt}  \right]
 \end{equation}
 
-The semi-implicit time scheme \autoref{eq:dynhpg_imp} is made possible without
+The semi-implicit time scheme \autoref{eq:DYN_hpg_imp} is made possible without
 significant additional computation since the density can be updated to time level $t+\rdt$ before
 computing the horizontal hydrostatic pressure gradient.
 It can be easily shown that the stability limit associated with the hydrostatic pressure gradient doubles using
-\autoref{eq:dynhpg_imp} compared to that using the standard leapfrog scheme \autoref{eq:dynhpg_lf}.
-Note that \autoref{eq:dynhpg_imp} is equivalent to applying a time filter to the pressure gradient to
+\autoref{eq:DYN_hpg_imp} compared to that using the standard leapfrog scheme \autoref{eq:DYN_hpg_lf}.
+Note that \autoref{eq:DYN_hpg_imp} is equivalent to applying a time filter to the pressure gradient to
 eliminate high frequency IGWs.
-Obviously, when using \autoref{eq:dynhpg_imp},
+Obviously, when using \autoref{eq:DYN_hpg_imp},
 the doubling of the time-step is achievable only if no other factors control the time-step,
 such as the stability limits associated with advection or diffusion.
@@ -777,5 +761,5 @@
 The density used to compute the hydrostatic pressure gradient (whatever the formulation) is evaluated as follows:
 \[
-  % \label{eq:rho_flt}
+  % \label{eq:DYN_rho_flt}
   \rho^t = \rho( \widetilde{T},\widetilde {S},z_t)
   \quad	  \text{with}	\quad
@@ -790,6 +774,5 @@
 % Surface Pressure Gradient
 % ================================================================
-\section[Surface pressure gradient (\textit{dynspg.F90})]
-{Surface pressure gradient (\protect\mdl{dynspg})}
+\section[Surface pressure gradient (\textit{dynspg.F90})]{Surface pressure gradient (\protect\mdl{dynspg})}
 \label{sec:DYN_spg}
 %-----------------------------------------nam_dynspg----------------------------------------------------
@@ -799,14 +782,14 @@
 
 Options are defined through the \nam{dyn\_spg} namelist variables.
-The surface pressure gradient term is related to the representation of the free surface (\autoref{sec:PE_hor_pg}).
+The surface pressure gradient term is related to the representation of the free surface (\autoref{sec:MB_hor_pg}).
 The main distinction is between the fixed volume case (linear free surface) and
 the variable volume case (nonlinear free surface, \texttt{vvl?} is defined).
-In the linear free surface case (\autoref{subsec:PE_free_surface})
+In the linear free surface case (\autoref{subsec:MB_free_surface})
 the vertical scale factors $e_{3}$ are fixed in time,
-while they are time-dependent in the nonlinear case (\autoref{subsec:PE_free_surface}).
+while they are time-dependent in the nonlinear case (\autoref{subsec:MB_free_surface}).
 With both linear and nonlinear free surface, external gravity waves are allowed in the equations,
 which imposes a very small time step when an explicit time stepping is used.
 Two methods are proposed to allow a longer time step for the three-dimensional equations:
-the filtered free surface, which is a modification of the continuous equations (see \autoref{eq:PE_flt?}),
+the filtered free surface, which is a modification of the continuous equations (see \autoref{eq:MB_flt?}),
 and the split-explicit free surface described below.
 The extra term introduced in the filtered method is calculated implicitly,
@@ -815,5 +798,5 @@
 
 The form of the surface pressure gradient term depends on how the user wants to
-handle the fast external gravity waves that are a solution of the analytical equation (\autoref{sec:PE_hor_pg}).
+handle the fast external gravity waves that are a solution of the analytical equation (\autoref{sec:MB_hor_pg}).
 Three formulations are available, all controlled by a CPP key (ln\_dynspg\_xxx):
 an explicit formulation which requires a small time step;
@@ -829,6 +812,5 @@
 % Explicit free surface formulation
 %--------------------------------------------------------------------------------------------------------------
-\subsection[Explicit free surface (\texttt{ln\_dynspg\_exp}\forcode{=.true.})]
-{Explicit free surface (\protect\np{ln\_dynspg\_exp}\forcode{=.true.})}
+\subsection[Explicit free surface (\texttt{ln\_dynspg\_exp}\forcode{ = .true.})]{Explicit free surface (\protect\np{ln\_dynspg\_exp}\forcode{ = .true.})}
 \label{subsec:DYN_spg_exp}
 
@@ -839,5 +821,5 @@
 is thus simply given by :
 \begin{equation}
-  \label{eq:dynspg_exp}
+  \label{eq:DYN_spg_exp}
   \left\{
     \begin{aligned}
@@ -856,6 +838,5 @@
 % Split-explict free surface formulation
 %--------------------------------------------------------------------------------------------------------------
-\subsection[Split-explicit free surface (\texttt{ln\_dynspg\_ts}\forcode{=.true.})]
-{Split-explicit free surface (\protect\np{ln\_dynspg\_ts}\forcode{=.true.})}
+\subsection[Split-explicit free surface (\texttt{ln\_dynspg\_ts}\forcode{ = .true.})]{Split-explicit free surface (\protect\np{ln\_dynspg\_ts}\forcode{ = .true.})}
 \label{subsec:DYN_spg_ts}
 %------------------------------------------namsplit-----------------------------------------------------------
@@ -868,5 +849,5 @@
 The general idea is to solve the free surface equation and the associated barotropic velocity equations with
 a smaller time step than $\rdt$, the time step used for the three dimensional prognostic variables
-(\autoref{fig:DYN_dynspg_ts}).
+(\autoref{fig:DYN_spg_ts}).
 The size of the small time step, $\rdt_e$ (the external mode or barotropic time step) is provided through
 the \np{nn\_baro} namelist parameter as: $\rdt_e = \rdt / nn\_baro$.
@@ -879,7 +860,7 @@
 The barotropic mode solves the following equations:
 % \begin{subequations}
-%  \label{eq:BT}
-\begin{equation}
-  \label{eq:BT_dyn}
+%  \label{eq:DYN_BT}
+\begin{equation}
+  \label{eq:DYN_BT_dyn}
   \frac{\partial {\mathrm \overline{{\mathbf U}}_h} }{\partial t}=
   -f\;{\mathrm {\mathbf k}}\times {\mathrm \overline{{\mathbf U}}_h}
@@ -887,5 +868,5 @@
 \end{equation}
 \[
-  % \label{eq:BT_ssh}
+  % \label{eq:DYN_BT_ssh}
   \frac{\partial \eta }{\partial t}=-\nabla \cdot \left[ {\left( {H+\eta } \right) \; {\mathrm{\mathbf \overline{U}}}_h \,} \right]+P-E
 \]
@@ -893,6 +874,6 @@
 where $\mathrm {\overline{\mathbf G}}$ is a forcing term held constant, containing coupling term between modes,
 surface atmospheric forcing as well as slowly varying barotropic terms not explicitly computed to gain efficiency.
-The third term on the right hand side of \autoref{eq:BT_dyn} represents the bottom stress
-(see section \autoref{sec:ZDF_bfr}), explicitly accounted for at each barotropic iteration.
+The third term on the right hand side of \autoref{eq:DYN_BT_dyn} represents the bottom stress
+(see section \autoref{sec:ZDF_drg}), explicitly accounted for at each barotropic iteration.
 Temporal discretization of the system above follows a three-time step Generalized Forward Backward algorithm
 detailed in \citet{shchepetkin.mcwilliams_OM05}.
@@ -906,5 +887,5 @@
     \includegraphics[width=\textwidth]{Fig_DYN_dynspg_ts}
     \caption{
-      \protect\label{fig:DYN_dynspg_ts}
+      \protect\label{fig:DYN_spg_ts}
       Schematic of the split-explicit time stepping scheme for the external and internal modes.
       Time increases to the right. In this particular exemple,
@@ -929,5 +910,5 @@
 In the default case (\np{ln\_bt\_fw}\forcode{=.true.}),
 the external mode is integrated between \textit{now} and \textit{after} baroclinic time-steps
-(\autoref{fig:DYN_dynspg_ts}a).
+(\autoref{fig:DYN_spg_ts}a).
 To avoid aliasing of fast barotropic motions into three dimensional equations,
 time filtering is eventually applied on barotropic quantities (\np{ln\_bt\_av}\forcode{=.true.}).
@@ -1101,10 +1082,9 @@
 % Filtered free surface formulation
 %--------------------------------------------------------------------------------------------------------------
-\subsection[Filtered free surface (\texttt{dynspg\_flt?})]
-{Filtered free surface (\protect\texttt{dynspg\_flt?})}
+\subsection[Filtered free surface (\texttt{dynspg\_flt?})]{Filtered free surface (\protect\texttt{dynspg\_flt?})}
 \label{subsec:DYN_spg_fltp}
 
 The filtered formulation follows the \citet{roullet.madec_JGR00} implementation.
-The extra term introduced in the equations (see \autoref{subsec:PE_free_surface}) is solved implicitly.
+The extra term introduced in the equations (see \autoref{subsec:MB_free_surface}) is solved implicitly.
 The elliptic solvers available in the code are documented in \autoref{chap:MISC}.
 
@@ -1112,5 +1092,5 @@
 \gmcomment{               %%% copy from chap-model basics
   \[
-    % \label{eq:spg_flt}
+    % \label{eq:DYN_spg_flt}
     \frac{\partial {\mathrm {\mathbf U}}_h }{\partial t}= {\mathrm {\mathbf M}}
     - g \nabla \left( \tilde{\rho} \ \eta \right)
@@ -1120,5 +1100,5 @@
   $\widetilde{\rho} = \rho / \rho_o$ is the dimensionless density,
   and $\mathrm {\mathbf M}$ represents the collected contributions of the Coriolis, hydrostatic pressure gradient,
-  non-linear and viscous terms in \autoref{eq:PE_dyn}.
+  non-linear and viscous terms in \autoref{eq:MB_dyn}.
 }   %end gmcomment
 
@@ -1130,6 +1110,5 @@
 % Lateral diffusion term
 % ================================================================
-\section[Lateral diffusion term and operators (\textit{dynldf.F90})]
-{Lateral diffusion term and operators (\protect\mdl{dynldf})}
+\section[Lateral diffusion term and operators (\textit{dynldf.F90})]{Lateral diffusion term and operators (\protect\mdl{dynldf})}
 \label{sec:DYN_ldf}
 %------------------------------------------nam_dynldf----------------------------------------------------
@@ -1145,5 +1124,5 @@
 \ie\ the velocity appearing in its expression is the \textit{before} velocity in time,
 except for the pure vertical component that appears when a tensor of rotation is used.
-This latter term is solved implicitly together with the vertical diffusion term (see \autoref{chap:STP}).
+This latter term is solved implicitly together with the vertical diffusion term (see \autoref{chap:TD}).
 
 At the lateral boundaries either free slip,
@@ -1165,11 +1144,10 @@
 
 % ================================================================
-\subsection[Iso-level laplacian (\forcode{ln_dynldf_lap=.true.})]
-{Iso-level laplacian operator (\protect\np{ln\_dynldf\_lap}\forcode{=.true.})}
+\subsection[Iso-level laplacian (\forcode{ln_dynldf_lap = .true.})]{Iso-level laplacian operator (\protect\np{ln\_dynldf\_lap}\forcode{ = .true.})}
 \label{subsec:DYN_ldf_lap}
 
 For lateral iso-level diffusion, the discrete operator is:
 \begin{equation}
-  \label{eq:dynldf_lap}
+  \label{eq:DYN_ldf_lap}
   \left\{
     \begin{aligned}
@@ -1184,5 +1162,5 @@
 \end{equation}
 
-As explained in \autoref{subsec:PE_ldf},
+As explained in \autoref{subsec:MB_ldf},
 this formulation (as the gradient of a divergence and curl of the vorticity) preserves symmetry and
 ensures a complete separation between the vorticity and divergence parts of the momentum diffusion.
@@ -1191,6 +1169,5 @@
 %           Rotated laplacian operator
 %--------------------------------------------------------------------------------------------------------------
-\subsection[Rotated laplacian (\forcode{ln_dynldf_iso=.true.})]
-{Rotated laplacian operator (\protect\np{ln\_dynldf\_iso}\forcode{=.true.})}
+\subsection[Rotated laplacian (\forcode{ln_dynldf_iso = .true.})]{Rotated laplacian operator (\protect\np{ln\_dynldf\_iso}\forcode{ = .true.})}
 \label{subsec:DYN_ldf_iso}
 
@@ -1206,5 +1183,5 @@
 The resulting discrete representation is:
 \begin{equation}
-  \label{eq:dyn_ldf_iso}
+  \label{eq:DYN_ldf_iso}
   \begin{split}
     D_u^{l\textbf{U}} &= \frac{1}{e_{1u} \, e_{2u} \, e_{3u} }	\\
@@ -1250,9 +1227,8 @@
 %           Iso-level bilaplacian operator
 %--------------------------------------------------------------------------------------------------------------
-\subsection[Iso-level bilaplacian (\forcode{ln_dynldf_bilap=.true.})]
-{Iso-level bilaplacian operator (\protect\np{ln\_dynldf\_bilap}\forcode{=.true.})}
+\subsection[Iso-level bilaplacian (\forcode{ln_dynldf_bilap = .true.})]{Iso-level bilaplacian operator (\protect\np{ln\_dynldf\_bilap}\forcode{ = .true.})}
 \label{subsec:DYN_ldf_bilap}
 
-The lateral fourth order operator formulation on momentum is obtained by applying \autoref{eq:dynldf_lap} twice.
+The lateral fourth order operator formulation on momentum is obtained by applying \autoref{eq:DYN_ldf_lap} twice.
 It requires an additional assumption on boundary conditions:
 the first derivative term normal to the coast depends on the free or no-slip lateral boundary conditions chosen,
@@ -1265,6 +1241,5 @@
 %           Vertical diffusion term
 % ================================================================
-\section[Vertical diffusion term (\textit{dynzdf.F90})]
-{Vertical diffusion term (\protect\mdl{dynzdf})}
+\section[Vertical diffusion term (\textit{dynzdf.F90})]{Vertical diffusion term (\protect\mdl{dynzdf})}
 \label{sec:DYN_zdf}
 %----------------------------------------------namzdf------------------------------------------------------
@@ -1279,11 +1254,11 @@
 (\np{ln\_zdfexp}\forcode{=.true.}) using a time splitting technique (\np{nn\_zdfexp} $>$ 1) or
 $(b)$ a backward (or implicit) time differencing scheme (\np{ln\_zdfexp}\forcode{=.false.})
-(see \autoref{chap:STP}).
+(see \autoref{chap:TD}).
 Note that namelist variables \np{ln\_zdfexp} and \np{nn\_zdfexp} apply to both tracers and dynamics.
 
 The formulation of the vertical subgrid scale physics is the same whatever the vertical coordinate is.
-The vertical diffusion operators given by \autoref{eq:PE_zdf} take the following semi-discrete space form:
-\[
-  % \label{eq:dynzdf}
+The vertical diffusion operators given by \autoref{eq:MB_zdf} take the following semi-discrete space form:
+\[
+  % \label{eq:DYN_zdf}
   \left\{
     \begin{aligned}
@@ -1303,5 +1278,5 @@
 the vertical turbulent momentum fluxes,
 \begin{equation}
-  \label{eq:dynzdf_sbc}
+  \label{eq:DYN_zdf_sbc}
   \left.{\left( {\frac{A^{vm} }{e_3 }\ \frac{\partial \textbf{U}_h}{\partial k}} \right)} \right|_{z=1}
   = \frac{1}{\rho_o} \binom{\tau_u}{\tau_v }
@@ -1316,5 +1291,5 @@
 
 The turbulent flux of momentum at the bottom of the ocean is specified through a bottom friction parameterisation
-(see \autoref{sec:ZDF_bfr})
+(see \autoref{sec:ZDF_drg})
 
 % ================================================================
@@ -1347,4 +1322,5 @@
 \section{Wetting and drying }
 \label{sec:DYN_wetdry}
+
 There are two main options for wetting and drying code (wd):
 (a) an iterative limiter (il) and (b) a directional limiter (dl).
@@ -1395,7 +1371,7 @@
 %   Iterative limiters
 %-----------------------------------------------------------------------------------------
-\subsection[Directional limiter (\textit{wet\_dry.F90})]
-{Directional limiter (\mdl{wet\_dry})}
+\subsection[Directional limiter (\textit{wet\_dry.F90})]{Directional limiter (\mdl{wet\_dry})}
 \label{subsec:DYN_wd_directional_limiter}
+
 The principal idea of the directional limiter is that
 water should not be allowed to flow out of a dry tracer cell (i.e. one whose water depth is less than \np{rn\_wdmin1}).
@@ -1435,11 +1411,9 @@
 %-----------------------------------------------------------------------------------------
 
-\subsection[Iterative limiter (\textit{wet\_dry.F90})]
-{Iterative limiter (\mdl{wet\_dry})}
+\subsection[Iterative limiter (\textit{wet\_dry.F90})]{Iterative limiter (\mdl{wet\_dry})}
 \label{subsec:DYN_wd_iterative_limiter}
 
-\subsubsection[Iterative flux limiter (\textit{wet\_dry.F90})]
-{Iterative flux limiter (\mdl{wet\_dry})}
-\label{subsubsec:DYN_wd_il_spg_limiter}
+\subsubsection[Iterative flux limiter (\textit{wet\_dry.F90})]{Iterative flux limiter (\mdl{wet\_dry})}
+\label{subsec:DYN_wd_il_spg_limiter}
 
 The iterative limiter modifies the fluxes across the faces of cells that are either already ``dry''
@@ -1449,13 +1423,15 @@
 
 The continuity equation for the total water depth in a column
-\begin{equation} \label{dyn_wd_continuity}
- \frac{\partial h}{\partial t} + \mathbf{\nabla.}(h\mathbf{u}) = 0 .
+\begin{equation}
+  \label{eq:DYN_wd_continuity}
+  \frac{\partial h}{\partial t} + \mathbf{\nabla.}(h\mathbf{u}) = 0 .
 \end{equation}
 can be written in discrete form  as
 
-\begin{align} \label{dyn_wd_continuity_2}
-\frac{e_1 e_2}{\Delta t} ( h_{i,j}(t_{n+1}) - h_{i,j}(t_e) )
-&= - ( \mathrm{flxu}_{i+1,j} - \mathrm{flxu}_{i,j}  + \mathrm{flxv}_{i,j+1} - \mathrm{flxv}_{i,j} ) \\
-&= \mathrm{zzflx}_{i,j} .
+\begin{align}
+  \label{eq:DYN_wd_continuity_2}
+  \frac{e_1 e_2}{\Delta t} ( h_{i,j}(t_{n+1}) - h_{i,j}(t_e) )
+  &= - ( \mathrm{flxu}_{i+1,j} - \mathrm{flxu}_{i,j}  + \mathrm{flxv}_{i,j+1} - \mathrm{flxv}_{i,j} ) \\
+  &= \mathrm{zzflx}_{i,j} .
 \end{align}
 
@@ -1470,6 +1446,7 @@
 (zzflxp) and fluxes that are into the cell (zzflxn).  Clearly
 
-\begin{equation} \label{dyn_wd_zzflx_p_n_1}
-\mathrm{zzflx}_{i,j} = \mathrm{zzflxp}_{i,j} + \mathrm{zzflxn}_{i,j} .
+\begin{equation}
+  \label{eq:DYN_wd_zzflx_p_n_1}
+  \mathrm{zzflx}_{i,j} = \mathrm{zzflxp}_{i,j} + \mathrm{zzflxn}_{i,j} .
 \end{equation}
 
@@ -1482,9 +1459,10 @@
 $\mathrm{zcoef}_{i,j}^{(m)}$ such that:
 
-\begin{equation} \label{dyn_wd_continuity_coef}
-\begin{split}
-\mathrm{zzflxp}^{(m)}_{i,j} =& \mathrm{zcoef}_{i,j}^{(m)} \mathrm{zzflxp}^{(0)}_{i,j} \\
-\mathrm{zzflxn}^{(m)}_{i,j} =& \mathrm{zcoef}_{i,j}^{(m)} \mathrm{zzflxn}^{(0)}_{i,j}
-\end{split}
+\begin{equation}
+  \label{eq:DYN_wd_continuity_coef}
+  \begin{split}
+    \mathrm{zzflxp}^{(m)}_{i,j} =& \mathrm{zcoef}_{i,j}^{(m)} \mathrm{zzflxp}^{(0)}_{i,j} \\
+    \mathrm{zzflxn}^{(m)}_{i,j} =& \mathrm{zcoef}_{i,j}^{(m)} \mathrm{zzflxn}^{(0)}_{i,j}
+  \end{split}
 \end{equation}
 
@@ -1494,37 +1472,41 @@
 The iteration is initialised by setting
 
-\begin{equation} \label{dyn_wd_zzflx_initial}
-\mathrm{zzflxp^{(0)}}_{i,j} = \mathrm{zzflxp}_{i,j} , \quad  \mathrm{zzflxn^{(0)}}_{i,j} = \mathrm{zzflxn}_{i,j} .
+\begin{equation}
+  \label{eq:DYN_wd_zzflx_initial}
+  \mathrm{zzflxp^{(0)}}_{i,j} = \mathrm{zzflxp}_{i,j} , \quad  \mathrm{zzflxn^{(0)}}_{i,j} = \mathrm{zzflxn}_{i,j} .
 \end{equation}
 
 The fluxes out of cell $(i,j)$ are updated at the $m+1$th iteration if the depth of the
 cell on timestep $t_e$, namely $h_{i,j}(t_e)$, is less than the total flux out of the cell
-times the timestep divided by the cell area. Using (\ref{dyn_wd_continuity_2}) this
+times the timestep divided by the cell area. Using (\autoref{eq:DYN_wd_continuity_2}) this
 condition is
 
-\begin{equation} \label{dyn_wd_continuity_if}
-h_{i,j}(t_e)  - \mathrm{rn\_wdmin1} <  \frac{\Delta t}{e_1 e_2} ( \mathrm{zzflxp}^{(m)}_{i,j} + \mathrm{zzflxn}^{(m)}_{i,j} ) .
-\end{equation}
-
-Rearranging (\ref{dyn_wd_continuity_if}) we can obtain an expression for the maximum
+\begin{equation}
+  \label{eq:DYN_wd_continuity_if}
+  h_{i,j}(t_e)  - \mathrm{rn\_wdmin1} <  \frac{\Delta t}{e_1 e_2} ( \mathrm{zzflxp}^{(m)}_{i,j} + \mathrm{zzflxn}^{(m)}_{i,j} ) .
+\end{equation}
+
+Rearranging (\autoref{eq:DYN_wd_continuity_if}) we can obtain an expression for the maximum
 outward flux that can be allowed and still maintain the minimum wet depth:
 
-\begin{equation} \label{dyn_wd_max_flux}
-\begin{split}
-\mathrm{zzflxp}^{(m+1)}_{i,j} = \Big[ (h_{i,j}(t_e) & - \mathrm{rn\_wdmin1} - \mathrm{rn\_wdmin2})  \frac{e_1 e_2}{\Delta t} \phantom{]} \\
-\phantom{[} & -  \mathrm{zzflxn}^{(m)}_{i,j} \Big]
-\end{split}
+\begin{equation}
+  \label{eq:DYN_wd_max_flux}
+  \begin{split}
+    \mathrm{zzflxp}^{(m+1)}_{i,j} = \Big[ (h_{i,j}(t_e) & - \mathrm{rn\_wdmin1} - \mathrm{rn\_wdmin2})  \frac{e_1 e_2}{\Delta t} \phantom{]} \\
+    \phantom{[} & -  \mathrm{zzflxn}^{(m)}_{i,j} \Big]
+  \end{split}
 \end{equation}
 
 Note a small tolerance ($\mathrm{rn\_wdmin2}$) has been introduced here {\itshape [Q: Why is
-this necessary/desirable?]}. Substituting from (\ref{dyn_wd_continuity_coef}) gives an
+this necessary/desirable?]}. Substituting from (\autoref{eq:DYN_wd_continuity_coef}) gives an
 expression for the coefficient needed to multiply the outward flux at this cell in order
 to avoid drying.
 
-\begin{equation} \label{dyn_wd_continuity_nxtcoef}
-\begin{split}
-\mathrm{zcoef}^{(m+1)}_{i,j} = \Big[ (h_{i,j}(t_e) & - \mathrm{rn\_wdmin1} - \mathrm{rn\_wdmin2})  \frac{e_1 e_2}{\Delta t} \phantom{]} \\
-\phantom{[} & -  \mathrm{zzflxn}^{(m)}_{i,j} \Big] \frac{1}{ \mathrm{zzflxp}^{(0)}_{i,j} }
-\end{split}
+\begin{equation}
+  \label{eq:DYN_wd_continuity_nxtcoef}
+  \begin{split}
+    \mathrm{zcoef}^{(m+1)}_{i,j} = \Big[ (h_{i,j}(t_e) & - \mathrm{rn\_wdmin1} - \mathrm{rn\_wdmin2})  \frac{e_1 e_2}{\Delta t} \phantom{]} \\
+    \phantom{[} & -  \mathrm{zzflxn}^{(m)}_{i,j} \Big] \frac{1}{ \mathrm{zzflxp}^{(0)}_{i,j} }
+  \end{split}
 \end{equation}
 
@@ -1545,7 +1527,6 @@
 %      Surface pressure gradients
 %----------------------------------------------------------------------------------------
-\subsubsection[Modification of surface pressure gradients (\textit{dynhpg.F90})]
-{Modification of surface pressure gradients (\mdl{dynhpg})}
-\label{subsubsec:DYN_wd_il_spg}
+\subsubsection[Modification of surface pressure gradients (\textit{dynhpg.F90})]{Modification of surface pressure gradients (\mdl{dynhpg})}
+\label{subsec:DYN_wd_il_spg}
 
 At ``dry'' points the water depth is usually close to $\mathrm{rn\_wdmin1}$. If the
@@ -1560,13 +1541,15 @@
 neighbouring $(i+1,j)$ and $(i,j)$ tracer points.  zcpx is calculated using two logicals
 variables, $\mathrm{ll\_tmp1}$ and $\mathrm{ll\_tmp2}$ which are evaluated for each grid
-column.  The three possible combinations are illustrated in figure \ref{Fig_WAD_dynhpg}.
+column.  The three possible combinations are illustrated in figure \autoref{fig:DYN_WAD_dynhpg}.
 
 %>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 \begin{figure}[!ht] \begin{center}
 \includegraphics[width=\textwidth]{Fig_WAD_dynhpg}
-\caption{ \label{Fig_WAD_dynhpg}
-Illustrations of the three possible combinations of the logical variables controlling the
-limiting of the horizontal pressure gradient in wetting and drying regimes}
-\end{center}\end{figure}
+\caption{
+  \label{fig:DYN_WAD_dynhpg}
+  Illustrations of the three possible combinations of the logical variables controlling the
+  limiting of the horizontal pressure gradient in wetting and drying regimes}
+\end{center}
+\end{figure}
 %>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 
@@ -1576,12 +1559,13 @@
 of the topography at the two points:
 
-\begin{equation} \label{dyn_ll_tmp1}
-\begin{split}
-\mathrm{ll\_tmp1}  = & \mathrm{MIN(sshn(ji,jj), sshn(ji+1,jj))} > \\
+\begin{equation}
+  \label{eq:DYN_ll_tmp1}
+  \begin{split}
+    \mathrm{ll\_tmp1}  = & \mathrm{MIN(sshn(ji,jj), sshn(ji+1,jj))} > \\
                      & \quad \mathrm{MAX(-ht\_wd(ji,jj), -ht\_wd(ji+1,jj))\  .and.} \\
-& \mathrm{MAX(sshn(ji,jj) + ht\_wd(ji,jj),} \\
-& \mathrm{\phantom{MAX(}sshn(ji+1,jj) + ht\_wd(ji+1,jj))} >\\
-& \quad\quad\mathrm{rn\_wdmin1 + rn\_wdmin2 }
-\end{split}
+                     & \mathrm{MAX(sshn(ji,jj) + ht\_wd(ji,jj),} \\
+                     & \mathrm{\phantom{MAX(}sshn(ji+1,jj) + ht\_wd(ji+1,jj))} >\\
+                     & \quad\quad\mathrm{rn\_wdmin1 + rn\_wdmin2 }
+  \end{split}
 \end{equation}
 
@@ -1590,10 +1574,11 @@
 at the two points plus $\mathrm{rn\_wdmin1} + \mathrm{rn\_wdmin2}$
 
-\begin{equation} \label{dyn_ll_tmp2}
-\begin{split}
-\mathrm{ ll\_tmp2 } = & \mathrm{( ABS( sshn(ji,jj) - sshn(ji+1,jj) ) > 1.E-12 )\ .AND.}\\
-& \mathrm{( MAX(sshn(ji,jj), sshn(ji+1,jj)) > } \\
-& \mathrm{\phantom{(} MAX(-ht\_wd(ji,jj), -ht\_wd(ji+1,jj)) + rn\_wdmin1 + rn\_wdmin2}) .
-\end{split}
+\begin{equation}
+  \label{eq:DYN_ll_tmp2}
+  \begin{split}
+    \mathrm{ ll\_tmp2 } = & \mathrm{( ABS( sshn(ji,jj) - sshn(ji+1,jj) ) > 1.E-12 )\ .AND.}\\
+    & \mathrm{( MAX(sshn(ji,jj), sshn(ji+1,jj)) > } \\
+    & \mathrm{\phantom{(} MAX(-ht\_wd(ji,jj), -ht\_wd(ji+1,jj)) + rn\_wdmin1 + rn\_wdmin2}) .
+  \end{split}
 \end{equation}
 
@@ -1611,7 +1596,6 @@
 conditions.
 
-\subsubsection[Additional considerations (\textit{usrdef\_zgr.F90})]
-{Additional considerations (\mdl{usrdef\_zgr})}
-\label{subsubsec:WAD_additional}
+\subsubsection[Additional considerations (\textit{usrdef\_zgr.F90})]{Additional considerations (\mdl{usrdef\_zgr})}
+\label{subsec:DYN_WAD_additional}
 
 In the very shallow water where wetting and drying occurs the parametrisation of
@@ -1626,7 +1610,6 @@
 %      The WAD test cases
 %----------------------------------------------------------------------------------------
-\subsection[The WAD test cases (\textit{usrdef\_zgr.F90})]
-{The WAD test cases (\mdl{usrdef\_zgr})}
-\label{WAD_test_cases}
+\subsection[The WAD test cases (\textit{usrdef\_zgr.F90})]{The WAD test cases (\mdl{usrdef\_zgr})}
+\label{subsec:DYN_WAD_test_cases}
 
 See the WAD tests MY\_DOC documention for details of the WAD test cases.
@@ -1637,6 +1620,5 @@
 % Time evolution term
 % ================================================================
-\section[Time evolution term (\textit{dynnxt.F90})]
-{Time evolution term (\protect\mdl{dynnxt})}
+\section[Time evolution term (\textit{dynnxt.F90})]{Time evolution term (\protect\mdl{dynnxt})}
 \label{sec:DYN_nxt}
 
@@ -1648,14 +1630,14 @@
 Options are defined through the \nam{dom} namelist variables.
 The general framework for dynamics time stepping is a leap-frog scheme,
-\ie\ a three level centred time scheme associated with an Asselin time filter (cf. \autoref{chap:STP}).
+\ie\ a three level centred time scheme associated with an Asselin time filter (cf. \autoref{chap:TD}).
 The scheme is applied to the velocity, except when
 using the flux form of momentum advection (cf. \autoref{sec:DYN_adv_cor_flux})
 in the variable volume case (\texttt{vvl?} defined),
-where it has to be applied to the thickness weighted velocity (see \autoref{sec:A_momentum})
+where it has to be applied to the thickness weighted velocity (see \autoref{sec:SCOORD_momentum})
 
 $\bullet$ vector invariant form or linear free surface
 (\np{ln\_dynhpg\_vec}\forcode{=.true.} ; \texttt{vvl?} not defined):
 \[
-  % \label{eq:dynnxt_vec}
+  % \label{eq:DYN_nxt_vec}
   \left\{
     \begin{aligned}
@@ -1669,5 +1651,5 @@
 (\np{ln\_dynhpg\_vec}\forcode{=.false.} ; \texttt{vvl?} defined):
 \[
-  % \label{eq:dynnxt_flux}
+  % \label{eq:DYN_nxt_flux}
   \left\{
     \begin{aligned}
Index: /NEMO/trunk/doc/latex/NEMO/subfiles/chap_LBC.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/subfiles/chap_LBC.tex	(revision 11542)
+++ /NEMO/trunk/doc/latex/NEMO/subfiles/chap_LBC.tex	(revision 11543)
@@ -57,5 +57,5 @@
 
 \[
-  % \label{eq:lbc_aaaa}
+  % \label{eq:LBC_aaaa}
   \frac{A^{lT} }{e_1 }\frac{\partial T}{\partial i}\equiv \frac{A_u^{lT}
   }{e_{1u} } \; \delta_{i+1 / 2} \left[ T \right]\;\;mask_u
@@ -134,5 +134,5 @@
   the no-slip boundary condition, simply by multiplying it by the mask$_{f}$ :
   \[
-    % \label{eq:lbc_bbbb}
+    % \label{eq:LBC_bbbb}
     \zeta \equiv \frac{1}{e_{1f} {\kern 1pt}e_{2f} }\left( {\delta_{i+1/2}
         \left[ {e_{2v} \,v} \right]-\delta_{j+1/2} \left[ {e_{1u} \,u} \right]}
@@ -226,6 +226,6 @@
 The north fold boundary condition has been introduced in order to handle the north boundary of
 a three-polar ORCA grid.
-Such a grid has two poles in the northern hemisphere (\autoref{fig:MISC_ORCA_msh},
-and thus requires a specific treatment illustrated in \autoref{fig:North_Fold_T}.
+Such a grid has two poles in the northern hemisphere (\autoref{fig:CFGS_ORCA_msh},
+and thus requires a specific treatment illustrated in \autoref{fig:LBC_North_Fold_T}.
 Further information can be found in \mdl{lbcnfd} module which applies the north fold boundary condition.
 
@@ -235,5 +235,5 @@
     \includegraphics[width=\textwidth]{Fig_North_Fold_T}
     \caption{
-      \protect\label{fig:North_Fold_T}
+      \protect\label{fig:LBC_North_Fold_T}
       North fold boundary with a $T$-point pivot and cyclic east-west boundary condition ($jperio=4$),
       as used in ORCA 2, 1/4, and 1/12.
@@ -256,5 +256,11 @@
 %-----------------------------------------------------------------------------------------------
 
-For massively parallel processing (mpp), a domain decomposition method is used. The basic idea of the method is to split the large computation domain of a numerical experiment into several smaller domains and solve the set of equations by addressing independent local problems. Each processor has its own local memory and computes the model equation over a subdomain of the whole model domain. The subdomain boundary conditions are specified through communications between processors which are organized by explicit statements (message passing method). The present implementation is largely inspired by Guyon's work [Guyon 1995].
+For massively parallel processing (mpp), a domain decomposition method is used.
+The basic idea of the method is to split the large computation domain of a numerical experiment into several smaller domains and
+solve the set of equations by addressing independent local problems.
+Each processor has its own local memory and computes the model equation over a subdomain of the whole model domain.
+The subdomain boundary conditions are specified through communications between processors which are organized by
+explicit statements (message passing method).
+The present implementation is largely inspired by Guyon's work [Guyon 1995].
 
 The parallelization strategy is defined by the physical characteristics of the ocean model.
@@ -272,5 +278,8 @@
 each processor sends to its neighbouring processors the update values of the points corresponding to
 the interior overlapping area to its neighbouring sub-domain (\ie\ the innermost of the two overlapping rows).
-Communications are first done according to the east-west direction and next according to the north-south direction. There is no specific communications for the corners. The communication is done through the Message Passing Interface (MPI) and requires \key{mpp\_mpi}. Use also \key{mpi2} if MPI3 is not available on your computer.
+Communications are first done according to the east-west direction and next according to the north-south direction.
+There is no specific communications for the corners.
+The communication is done through the Message Passing Interface (MPI) and requires \key{mpp\_mpi}.
+Use also \key{mpi2} if MPI3 is not available on your computer.
 The data exchanges between processors are required at the very place where
 lateral domain boundary conditions are set in the mono-domain computation:
@@ -285,5 +294,5 @@
     \includegraphics[width=\textwidth]{Fig_mpp}
     \caption{
-      \protect\label{fig:mpp}
+      \protect\label{fig:LBC_mpp}
       Positioning of a sub-domain when massively parallel processing is used.
     }
@@ -292,21 +301,31 @@
 %>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 
-In \NEMO, the splitting is regular and arithmetic. The total number of subdomains corresponds to the number of MPI processes allocated to \NEMO\ when the model is launched (\ie\ mpirun -np x ./nemo will automatically give x subdomains). The i-axis is divided by \np{jpni} and the j-axis by \np{jpnj}. These parameters are defined in \nam{mpp} namelist. If \np{jpni} and \np{jpnj} are < 1, they will be automatically redefined in the code to give the best domain decomposition (see bellow).
-
-Each processor is independent and without message passing or synchronous process, programs run alone and access just its own local memory. For this reason, the main model dimensions are now the local dimensions of the subdomain (pencil) that are named \jp{jpi}, \jp{jpj}, \jp{jpk}.
-These dimensions include the internal domain and the overlapping rows. The number of rows to exchange (known as the halo) is usually set to one (nn\_hls=1, in \mdl{par\_oce}, and must be kept to one until further notice). The whole domain dimensions are named \jp{jpiglo}, \jp{jpjglo} and \jp{jpk}. The relationship between the whole domain and a sub-domain is:
-\[
-  jpi = ( jpiglo-2\times nn\_hls + (jpni-1) ) / jpni + 2\times nn\_hls
-\]
-\[
+In \NEMO, the splitting is regular and arithmetic.
+The total number of subdomains corresponds to the number of MPI processes allocated to \NEMO\ when the model is launched
+(\ie\ mpirun -np x ./nemo will automatically give x subdomains).
+The i-axis is divided by \np{jpni} and the j-axis by \np{jpnj}.
+These parameters are defined in \nam{mpp} namelist.
+If \np{jpni} and \np{jpnj} are < 1, they will be automatically redefined in the code to give the best domain decomposition
+(see bellow).
+
+Each processor is independent and without message passing or synchronous process, programs run alone and access just its own local memory.
+For this reason,
+the main model dimensions are now the local dimensions of the subdomain (pencil) that are named \jp{jpi}, \jp{jpj}, \jp{jpk}.
+These dimensions include the internal domain and the overlapping rows.
+The number of rows to exchange (known as the halo) is usually set to one (nn\_hls=1, in \mdl{par\_oce},
+and must be kept to one until further notice).
+The whole domain dimensions are named \jp{jpiglo}, \jp{jpjglo} and \jp{jpk}.
+The relationship between the whole domain and a sub-domain is:
+\begin{gather*}
+  jpi = ( jpiglo-2\times nn\_hls + (jpni-1) ) / jpni + 2\times nn\_hls \\
   jpj = ( jpjglo-2\times nn\_hls + (jpnj-1) ) / jpnj + 2\times nn\_hls
-\]
-
-One also defines variables nldi and nlei which correspond to the internal domain bounds, and the variables nimpp and njmpp which are the position of the (1,1) grid-point in the global domain (\autoref{fig:mpp}). Note that since the version 4, there is no more extra-halo area as defined in \autoref{fig:mpp} so \jp{jpi} is now always equal to nlci and \jp{jpj} equal to nlcj.
+\end{gather*}
+
+One also defines variables nldi and nlei which correspond to the internal domain bounds, and the variables nimpp and njmpp which are the position of the (1,1) grid-point in the global domain (\autoref{fig:LBC_mpp}). Note that since the version 4, there is no more extra-halo area as defined in \autoref{fig:LBC_mpp} so \jp{jpi} is now always equal to nlci and \jp{jpj} equal to nlcj.
 
 An element of $T_{l}$, a local array (subdomain) corresponds to an element of $T_{g}$,
 a global array (whole domain) by the relationship:
 \[
-  % \label{eq:lbc_nimpp}
+  % \label{eq:LBC_nimpp}
   T_{g} (i+nimpp-1,j+njmpp-1,k) = T_{l} (i,j,k),
 \]
@@ -322,7 +341,7 @@
 
 If the domain decomposition is automatically defined (when \np{jpni} and \np{jpnj} are < 1), the decomposition chosen by the model will minimise the sub-domain size (defined as $max_{all domains}(jpi \times jpj)$) and maximize the number of eliminated land subdomains. This means that no other domain decomposition (a set of \np{jpni} and \np{jpnj} values) will use less processes than $(jpni  \times  jpnj - N_{land})$ and get a smaller subdomain size.
-In order to specify $N_{mpi}$ properly (minimize $N_{useless}$), you must run the model once with \np{ln\_list} activated. In this case, the model will start the initialisation phase, print the list of optimum decompositions ($N_{mpi}$, \np{jpni} and \np{jpnj}) in \texttt{ocean.output} and directly abort. The maximum value of $N_{mpi}$ tested in this list is given by $max(N_{MPI\_tasks}, \np{jpni} \times \np{jpnj})$. For example, run the model on 40 nodes with ln\_list activated and $\np{jpni} = 10000$ and $\np{jpnj} = 1$, will print the list of optimum domains decomposition from 1 to about 10000. 
-
-Processors are numbered from 0 to $N_{mpi} - 1$. Subdomains containning some ocean points are numbered first from 0 to $jpni * jpnj - N_{land} -1$. The remaining $N_{useless}$ land subdomains are numbered next, which means that, for a given (\np{jpni}, \np{jpnj}), the numbers attributed to he ocean subdomains do not vary with $N_{useless}$. 
+In order to specify $N_{mpi}$ properly (minimize $N_{useless}$), you must run the model once with \np{ln\_list} activated. In this case, the model will start the initialisation phase, print the list of optimum decompositions ($N_{mpi}$, \np{jpni} and \np{jpnj}) in \texttt{ocean.output} and directly abort. The maximum value of $N_{mpi}$ tested in this list is given by $max(N_{MPI\_tasks}, \np{jpni} \times \np{jpnj})$. For example, run the model on 40 nodes with ln\_list activated and $\np{jpni} = 10000$ and $\np{jpnj} = 1$, will print the list of optimum domains decomposition from 1 to about 10000.
+
+Processors are numbered from 0 to $N_{mpi} - 1$. Subdomains containning some ocean points are numbered first from 0 to $jpni * jpnj - N_{land} -1$. The remaining $N_{useless}$ land subdomains are numbered next, which means that, for a given (\np{jpni}, \np{jpnj}), the numbers attributed to he ocean subdomains do not vary with $N_{useless}$.
 
 When land processors are eliminated, the value corresponding to these locations in the model output files is undefined. \np{ln\_mskland} must be activated in order avoid Not a Number values in output files. Note that it is better to not eliminate land processors when creating a meshmask file (\ie\ when setting a non-zero value to \np{nn\_msh}).
@@ -332,6 +351,6 @@
   \begin{center}
     \includegraphics[width=\textwidth]{Fig_mppini2}
-    \caption {
-      \protect\label{fig:mppini2}
+    \caption[Atlantic domain]{
+      \protect\label{fig:LBC_mppini2}
       Example of Atlantic domain defined for the CLIPPER projet.
       Initial grid is composed of 773 x 1236 horizontal points.
@@ -374,5 +393,5 @@
 %----------------------------------------------
 \subsection{Namelists}
-\label{subsec:BDY_namelist}
+\label{subsec:LBC_bdy_namelist}
 
 The BDY module is activated by setting \np{ln\_bdy}\forcode{=.true.} .
@@ -384,5 +403,5 @@
 In the example above, there are two boundary sets, the first of which is defined via a file and
 the second is defined in the namelist.
-For more details of the definition of the boundary geometry see section \autoref{subsec:BDY_geometry}.
+For more details of the definition of the boundary geometry see section \autoref{subsec:LBC_bdy_geometry}.
 
 For each boundary set a boundary condition has to be chosen for the barotropic solution
@@ -441,5 +460,5 @@
 %----------------------------------------------
 \subsection{Flow relaxation scheme}
-\label{subsec:BDY_FRS_scheme}
+\label{subsec:LBC_bdy_FRS_scheme}
 
 The Flow Relaxation Scheme (FRS) \citep{davies_QJRMS76,engedahl_T95},
@@ -448,5 +467,5 @@
 Given a model prognostic variable $\Phi$
 \[
-  % \label{eq:bdy_frs1}
+  % \label{eq:LBC_bdy_frs1}
   \Phi(d) = \alpha(d)\Phi_{e}(d) + (1-\alpha(d))\Phi_{m}(d)\;\;\;\;\; d=1,N
 \]
@@ -457,10 +476,10 @@
 the prognostic equation for $\Phi$ of the form:
 \[
-  % \label{eq:bdy_frs2}
+  % \label{eq:LBC_bdy_frs2}
   -\frac{1}{\tau}\left(\Phi - \Phi_{e}\right)
 \]
 where the relaxation time scale $\tau$ is given by a function of $\alpha$ and the model time step $\Delta t$:
 \[
-  % \label{eq:bdy_frs3}
+  % \label{eq:LBC_bdy_frs3}
   \tau = \frac{1-\alpha}{\alpha}  \,\rdt
 \]
@@ -472,5 +491,5 @@
 The function $\alpha$ is specified as a $tanh$ function:
 \[
-  % \label{eq:bdy_frs4}
+  % \label{eq:LBC_bdy_frs4}
   \alpha(d) = 1 - \tanh\left(\frac{d-1}{2}\right),       \quad d=1,N
 \]
@@ -480,11 +499,12 @@
 %----------------------------------------------
 \subsection{Flather radiation scheme}
-\label{subsec:BDY_flather_scheme}
+\label{subsec:LBC_bdy_flather_scheme}
 
 The \citet{flather_JPO94} scheme is a radiation condition on the normal,
 depth-mean transport across the open boundary.
 It takes the form
-\begin{equation}  \label{eq:bdy_fla1}
-U = U_{e} + \frac{c}{h}\left(\eta - \eta_{e}\right),
+\begin{equation}
+  \label{eq:LBC_bdy_fla1}
+  U = U_{e} + \frac{c}{h}\left(\eta - \eta_{e}\right),
 \end{equation}
 where $U$ is the depth-mean velocity normal to the boundary and $\eta$ is the sea surface height,
@@ -495,5 +515,5 @@
 the external depth-mean normal velocity,
 plus a correction term that allows gravity waves generated internally to exit the model boundary.
-Note that the sea-surface height gradient in \autoref{eq:bdy_fla1} is a spatial gradient across the model boundary,
+Note that the sea-surface height gradient in \autoref{eq:LBC_bdy_fla1} is a spatial gradient across the model boundary,
 so that $\eta_{e}$ is defined on the $T$ points with $nbr=1$ and $\eta$ is defined on the $T$ points with $nbr=2$.
 $U$ and $U_{e}$ are defined on the $U$ or $V$ points with $nbr=1$, \ie\ between the two $T$ grid points.
@@ -501,5 +521,5 @@
 %----------------------------------------------
 \subsection{Orlanski radiation scheme}
-\label{subsec:BDY_orlanski_scheme}
+\label{subsec:LBC_bdy_orlanski_scheme}
 
 The Orlanski scheme is based on the algorithm described by \citep{marchesiello.mcwilliams.ea_OM01}, hereafter MMS.
@@ -507,7 +527,7 @@
 The adaptive Orlanski condition solves a wave plus relaxation equation at the boundary:
 \begin{equation}
-\frac{\partial\phi}{\partial t} + c_x \frac{\partial\phi}{\partial x} + c_y \frac{\partial\phi}{\partial y} =
-                                                -\frac{1}{\tau}(\phi - \phi^{ext})
-\label{eq:wave_continuous}
+  \label{eq:LBC_wave_continuous}
+  \frac{\partial\phi}{\partial t} + c_x \frac{\partial\phi}{\partial x} + c_y \frac{\partial\phi}{\partial y} =
+  -\frac{1}{\tau}(\phi - \phi^{ext})
 \end{equation}
 
@@ -515,14 +535,15 @@
 velocities are diagnosed from the model fields as:
 
-\begin{equation} \label{eq:cx}
-c_x = -\frac{\partial\phi}{\partial t}\frac{\partial\phi / \partial x}{(\partial\phi /\partial x)^2 + (\partial\phi /\partial y)^2}
+\begin{equation}
+  \label{eq:LBC_cx}
+  c_x = -\frac{\partial\phi}{\partial t}\frac{\partial\phi / \partial x}{(\partial\phi /\partial x)^2 + (\partial\phi /\partial y)^2}
 \end{equation}
 \begin{equation}
-\label{eq:cy}
-c_y = -\frac{\partial\phi}{\partial t}\frac{\partial\phi / \partial y}{(\partial\phi /\partial x)^2 + (\partial\phi /\partial y)^2}
+  \label{eq:LBC_cy}
+  c_y = -\frac{\partial\phi}{\partial t}\frac{\partial\phi / \partial y}{(\partial\phi /\partial x)^2 + (\partial\phi /\partial y)^2}
 \end{equation}
 
 (As noted by MMS, this is a circular diagnosis of the phase speeds which only makes sense on a discrete grid).
-Equation (\autoref{eq:wave_continuous}) is defined adaptively depending on the sign of the phase velocity normal to the boundary $c_x$.
+Equation (\autoref{eq:LBC_wave_continuous}) is defined adaptively depending on the sign of the phase velocity normal to the boundary $c_x$.
 For $c_x$ outward, we have
 
@@ -534,19 +555,19 @@
 
 \begin{equation}
-\tau = \tau_{in}\,\,\,;\,\,\, c_x = c_y = 0
-\label{eq:tau_in}
+  \label{eq:LBC_tau_in}
+  \tau = \tau_{in}\,\,\,;\,\,\, c_x = c_y = 0
 \end{equation}
 
 Generally the relaxation time scale at inward propagation points (\np{rn\_time\_dmp}) is set much shorter than the time scale at outward propagation
 points (\np{rn\_time\_dmp\_out}) so that the solution is constrained more strongly by the external data at inward propagation points.
-See \autoref{subsec:BDY_relaxation} for detailed on the spatial shape of the scaling.\\
+See \autoref{subsec:LBC_bdy_relaxation} for detailed on the spatial shape of the scaling.\\
 The ``normal propagation of oblique radiation'' or NPO approximation (called \forcode{'orlanski_npo'}) involves assuming
-that $c_y$ is zero in equation (\autoref{eq:wave_continuous}), but including
-this term in the denominator of equation (\autoref{eq:cx}). Both versions of the scheme are options in BDY. Equations
-(\autoref{eq:wave_continuous}) - (\autoref{eq:tau_in}) correspond to equations (13) - (15) and (2) - (3) in MMS.\\
+that $c_y$ is zero in equation (\autoref{eq:LBC_wave_continuous}), but including
+this term in the denominator of equation (\autoref{eq:LBC_cx}). Both versions of the scheme are options in BDY. Equations
+(\autoref{eq:LBC_wave_continuous}) - (\autoref{eq:LBC_tau_in}) correspond to equations (13) - (15) and (2) - (3) in MMS.\\
 
 %----------------------------------------------
 \subsection{Relaxation at the boundary}
-\label{subsec:BDY_relaxation}
+\label{subsec:LBC_bdy_relaxation}
 
 In addition to a specific boundary condition specified as \np{cn\_tra} and \np{cn\_dyn3d}, relaxation on baroclinic velocities and tracers variables are available.
@@ -564,5 +585,5 @@
 %----------------------------------------------
 \subsection{Boundary geometry}
-\label{subsec:BDY_geometry}
+\label{subsec:LBC_bdy_geometry}
 
 Each open boundary set is defined as a list of points.
@@ -615,5 +636,5 @@
 %----------------------------------------------
 \subsection{Input boundary data files}
-\label{subsec:BDY_data}
+\label{subsec:LBC_bdy_data}
 
 The data files contain the data arrays in the order in which the points are defined in the $nbi$ and $nbj$ arrays.
@@ -655,5 +676,5 @@
 %----------------------------------------------
 \subsection{Volume correction}
-\label{subsec:BDY_vol_corr}
+\label{subsec:LBC_bdy_vol_corr}
 
 There is an option to force the total volume in the regional model to be constant.
@@ -672,5 +693,5 @@
 %----------------------------------------------
 \subsection{Tidal harmonic forcing}
-\label{subsec:BDY_tides}
+\label{subsec:LBC_bdy_tides}
 
 %-----------------------------------------nambdy_tide--------------------------------------------
Index: /NEMO/trunk/doc/latex/NEMO/subfiles/chap_LDF.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/subfiles/chap_LDF.tex	(revision 11542)
+++ /NEMO/trunk/doc/latex/NEMO/subfiles/chap_LDF.tex	(revision 11543)
@@ -13,5 +13,5 @@
 \newpage
 
-The lateral physics terms in the momentum and tracer equations have been described in \autoref{eq:PE_zdf} and
+The lateral physics terms in the momentum and tracer equations have been described in \autoref{eq:MB_zdf} and
 their discrete formulation in \autoref{sec:TRA_ldf} and \autoref{sec:DYN_ldf}).
 In this section we further discuss each lateral physics option.
@@ -25,5 +25,5 @@
 Note that this chapter describes the standard implementation of iso-neutral tracer mixing. 
 Griffies's implementation, which is used if \np{ln\_traldf\_triad}\forcode{=.true.},
-is described in \autoref{apdx:triad}
+is described in \autoref{apdx:TRIADS}
 
 %-----------------------------------namtra_ldf - namdyn_ldf--------------------------------------------
@@ -82,5 +82,5 @@
 the cell of the quantity to be diffused.
 For a tracer, this leads to the following four slopes:
-$r_{1u}$, $r_{1w}$, $r_{2v}$, $r_{2w}$ (see \autoref{eq:tra_ldf_iso}),
+$r_{1u}$, $r_{1w}$, $r_{2v}$, $r_{2w}$ (see \autoref{eq:TRA_ldf_iso}),
 while for momentum the slopes are  $r_{1t}$, $r_{1uw}$, $r_{2f}$, $r_{2uw}$ for $u$ and
 $r_{1f}$, $r_{1vw}$, $r_{2t}$, $r_{2vw}$ for $v$. 
@@ -92,5 +92,5 @@
 In $s$-coordinates, geopotential mixing (\ie\ horizontal mixing) $r_1$ and $r_2$ are the slopes between
 the geopotential and computational surfaces.
-Their discrete formulation is found by locally solving \autoref{eq:tra_ldf_iso} when
+Their discrete formulation is found by locally solving \autoref{eq:TRA_ldf_iso} when
 the diffusive fluxes in the three directions are set to zero and $T$ is assumed to be horizontally uniform,
 \ie\ a linear function of $z_T$, the depth of a $T$-point. 
@@ -98,5 +98,5 @@
 
 \begin{equation}
-  \label{eq:ldfslp_geo}
+  \label{eq:LDF_slp_geo}
   \begin{aligned}
     r_{1u} &= \frac{e_{3u}}{ \left( e_{1u}\;\overline{\overline{e_{3w}}}^{\,i+1/2,\,k} \right)}
@@ -125,9 +125,9 @@
 Their discrete formulation is found using the fact that the diffusive fluxes of
 locally referenced potential density (\ie\ $in situ$ density) vanish.
-So, substituting $T$ by $\rho$ in \autoref{eq:tra_ldf_iso} and setting the diffusive fluxes in
+So, substituting $T$ by $\rho$ in \autoref{eq:TRA_ldf_iso} and setting the diffusive fluxes in
 the three directions to zero leads to the following definition for the neutral slopes:
 
 \begin{equation}
-  \label{eq:ldfslp_iso}
+  \label{eq:LDF_slp_iso}
   \begin{split}
     r_{1u} &= \frac{e_{3u}}{e_{1u}}\; \frac{\delta_{i+1/2}[\rho]}
@@ -145,14 +145,14 @@
 
 %gm% rewrite this as the explanation is not very clear !!!
-%In practice, \autoref{eq:ldfslp_iso} is of little help in evaluating the neutral surface slopes. Indeed, for an unsimplified equation of state, the density has a strong dependancy on pressure (here approximated as the depth), therefore applying \autoref{eq:ldfslp_iso} using the $in situ$ density, $\rho$, computed at T-points leads to a flattening of slopes as the depth increases. This is due to the strong increase of the $in situ$ density with depth. 
-
-%By definition, neutral surfaces are tangent to the local $in situ$ density \citep{mcdougall_JPO87}, therefore in \autoref{eq:ldfslp_iso}, all the derivatives have to be evaluated at the same local pressure (which in decibars is approximated by the depth in meters).
-
-%In the $z$-coordinate, the derivative of the  \autoref{eq:ldfslp_iso} numerator is evaluated at the same depth \nocite{as what?} ($T$-level, which is the same as the $u$- and $v$-levels), so  the $in situ$ density can be used for its evaluation. 
-
-As the mixing is performed along neutral surfaces, the gradient of $\rho$ in \autoref{eq:ldfslp_iso} has to
+%In practice, \autoref{eq:LDF_slp_iso} is of little help in evaluating the neutral surface slopes. Indeed, for an unsimplified equation of state, the density has a strong dependancy on pressure (here approximated as the depth), therefore applying \autoref{eq:LDF_slp_iso} using the $in situ$ density, $\rho$, computed at T-points leads to a flattening of slopes as the depth increases. This is due to the strong increase of the $in situ$ density with depth. 
+
+%By definition, neutral surfaces are tangent to the local $in situ$ density \citep{mcdougall_JPO87}, therefore in \autoref{eq:LDF_slp_iso}, all the derivatives have to be evaluated at the same local pressure (which in decibars is approximated by the depth in meters).
+
+%In the $z$-coordinate, the derivative of the  \autoref{eq:LDF_slp_iso} numerator is evaluated at the same depth \nocite{as what?} ($T$-level, which is the same as the $u$- and $v$-levels), so  the $in situ$ density can be used for its evaluation. 
+
+As the mixing is performed along neutral surfaces, the gradient of $\rho$ in \autoref{eq:LDF_slp_iso} has to
 be evaluated at the same local pressure
 (which, in decibars, is approximated by the depth in meters in the model).
-Therefore \autoref{eq:ldfslp_iso} cannot be used as such,
+Therefore \autoref{eq:LDF_slp_iso} cannot be used as such,
 but further transformation is needed depending on the vertical coordinate used:
 
@@ -160,5 +160,5 @@
 
 \item[$z$-coordinate with full step: ]
-  in \autoref{eq:ldfslp_iso} the densities appearing in the $i$ and $j$ derivatives  are taken at the same depth,
+  in \autoref{eq:LDF_slp_iso} the densities appearing in the $i$ and $j$ derivatives  are taken at the same depth,
   thus the $in situ$ density can be used.
   This is not the case for the vertical derivatives: $\delta_{k+1/2}[\rho]$ is replaced by $-\rho N^2/g$,
@@ -173,8 +173,8 @@
   in the current release of \NEMO, iso-neutral mixing is only employed for $s$-coordinates if
   the Griffies scheme is used (\np{ln\_traldf\_triad}\forcode{=.true.};
-  see \autoref{apdx:triad}).
+  see \autoref{apdx:TRIADS}).
   In other words, iso-neutral mixing will only be accurately represented with a linear equation of state
   (\np{ln\_seos}\forcode{=.true.}).
-  In the case of a "true" equation of state, the evaluation of $i$ and $j$ derivatives in \autoref{eq:ldfslp_iso}
+  In the case of a "true" equation of state, the evaluation of $i$ and $j$ derivatives in \autoref{eq:LDF_slp_iso}
   will include a pressure dependent part, leading to the wrong evaluation of the neutral slopes.
 
@@ -193,5 +193,5 @@
 
 \[
-  % \label{eq:ldfslp_iso2}
+  % \label{eq:LDF_slp_iso2}
   \begin{split}
     r_{1u} &= \frac{e_{3u}}{e_{1u}}\; \frac
@@ -230,5 +230,5 @@
 To overcome this problem, several techniques have been proposed in which the numerical schemes of
 the ocean model are modified \citep{weaver.eby_JPO97, griffies.gnanadesikan.ea_JPO98}.
-Griffies's scheme is now available in \NEMO\ if \np{ln\_traldf\_triad}\forcode{=.true.}; see \autoref{apdx:triad}.
+Griffies's scheme is now available in \NEMO\ if \np{ln\_traldf\_triad}\forcode{ = .true.}; see \autoref{apdx:TRIADS}.
 Here, another strategy is presented \citep{lazar_phd97}:
 a local filtering of the iso-neutral slopes (made on 9 grid-points) prevents the development of
@@ -280,5 +280,5 @@
     \includegraphics[width=\textwidth]{Fig_eiv_slp}
     \caption{
-      \protect\label{fig:eiv_slp}
+      \protect\label{fig:LDF_eiv_slp}
       Vertical profile of the slope used for lateral mixing in the mixed layer:
       \textit{(a)} in the real ocean the slope is the iso-neutral slope in the ocean interior,
@@ -304,13 +304,13 @@
 The iso-neutral diffusion operator on momentum is the same as the one used on tracers but
 applied to each component of the velocity separately
-(see \autoref{eq:dyn_ldf_iso} in section~\autoref{subsec:DYN_ldf_iso}).
+(see \autoref{eq:DYN_ldf_iso} in section~\autoref{subsec:DYN_ldf_iso}).
 The slopes between the surface along which the diffusion operator acts and the surface of computation
 ($z$- or $s$-surfaces) are defined at $T$-, $f$-, and \textit{uw}- points for the $u$-component, and $T$-, $f$- and
 \textit{vw}- points for the $v$-component.
 They are computed from the slopes used for tracer diffusion,
-\ie\ \autoref{eq:ldfslp_geo} and \autoref{eq:ldfslp_iso}:
+\ie\ \autoref{eq:LDF_slp_geo} and \autoref{eq:LDF_slp_iso}:
 
 \[
-  % \label{eq:ldfslp_dyn}
+  % \label{eq:LDF_slp_dyn}
   \begin{aligned}
     &r_{1t}\ \ = \overline{r_{1u}}^{\,i}       &&&    r_{1f}\ \ &= \overline{r_{1u}}^{\,i+1/2} \\
@@ -371,5 +371,5 @@
 
 \begin{equation}
-  \label{eq:constantah}
+  \label{eq:LDF_constantah}
   A_o^l = \left\{
     \begin{aligned}
@@ -386,5 +386,5 @@
 
 In the vertically varying case, a hyperbolic variation of the lateral mixing coefficient is introduced in which
-the surface value is given by \autoref{eq:constantah}, the bottom value is 1/4 of the surface value,
+the surface value is given by \autoref{eq:LDF_constantah}, the bottom value is 1/4 of the surface value,
 and the transition takes place around z=500~m with a width of 200~m.
 This profile is hard coded in module \mdl{ldfc1d\_c2d}, but can be easily modified by users.
@@ -396,5 +396,5 @@
 the type of operator used:
 \begin{equation}
-  \label{eq:title}
+  \label{eq:LDF_title}
   A_l = \left\{
     \begin{aligned}
@@ -411,5 +411,5 @@
 model configurations presenting large changes in grid spacing such as global ocean models.
 Indeed, in such a case, a constant mixing coefficient can lead to a blow up of the model due to
-large coefficient compare to the smallest grid size (see \autoref{sec:STP_forward_imp}),
+large coefficient compare to the smallest grid size (see \autoref{sec:TD_forward_imp}),
 especially when using a bilaplacian operator.
 
@@ -429,5 +429,5 @@
 
 \begin{equation}
-  \label{eq:flowah}
+  \label{eq:LDF_flowah}
   A_l = \left\{
     \begin{aligned}
@@ -445,5 +445,5 @@
 
 \begin{equation}
-  \label{eq:smag1}
+  \label{eq:LDF_smag1}
   \begin{split}
     T_{smag}^{-1} & = \sqrt{\left( \partial_x u - \partial_y v\right)^2 + \left( \partial_y u + \partial_x v\right)^2  } \\
@@ -455,5 +455,5 @@
 
 \begin{equation}
-  \label{eq:smag2}
+  \label{eq:LDF_smag2}
   A_{smag} = \left\{
     \begin{aligned}
@@ -464,7 +464,7 @@
 \end{equation}
 
-For stability reasons, upper and lower limits are applied on the resulting coefficient (see \autoref{sec:STP_forward_imp}) so that:
-\begin{equation}
-  \label{eq:smag3}
+For stability reasons, upper and lower limits are applied on the resulting coefficient (see \autoref{sec:TD_forward_imp}) so that:
+\begin{equation}
+  \label{eq:LDF_smag3}
     \begin{aligned}
       & C_{min} \frac{1}{2}   \lvert U \rvert  e    < A_{smag} < C_{max} \frac{e^2}{   8\rdt}                 & \text{for laplacian operator } \\
@@ -480,5 +480,5 @@
 
 (1) the momentum diffusion operator acting along model level surfaces is written in terms of curl and
-divergent components of the horizontal current (see \autoref{subsec:PE_ldf}).
+divergent components of the horizontal current (see \autoref{subsec:MB_ldf}).
 Although the eddy coefficient could be set to different values in these two terms,
 this option is not currently available. 
@@ -486,5 +486,5 @@
 (2) with an horizontally varying viscosity, the quadratic integral constraints on enstrophy and on the square of
 the horizontal divergence for operators acting along model-surfaces are no longer satisfied
-(\autoref{sec:dynldf_properties}).
+(\autoref{sec:INVARIANTS_dynldf_properties}).
 
 % ================================================================
@@ -527,10 +527,10 @@
 the formulation of which depends on the slopes of iso-neutral surfaces.
 Contrary to the case of iso-neutral mixing, the slopes used here are referenced to the geopotential surfaces,
-\ie\ \autoref{eq:ldfslp_geo} is used in $z$-coordinates,
-and the sum \autoref{eq:ldfslp_geo} + \autoref{eq:ldfslp_iso} in $s$-coordinates.
+\ie\ \autoref{eq:LDF_slp_geo} is used in $z$-coordinates,
+and the sum \autoref{eq:LDF_slp_geo} + \autoref{eq:LDF_slp_iso} in $s$-coordinates.
 
 If isopycnal mixing is used in the standard way, \ie\ \np{ln\_traldf\_triad}\forcode{=.false.}, the eddy induced velocity is given by: 
 \begin{equation}
-  \label{eq:ldfeiv}
+  \label{eq:LDF_eiv}
   \begin{split}
     u^* & = \frac{1}{e_{2u}e_{3u}}\; \delta_k \left[e_{2u} \, A_{uw}^{eiv} \; \overline{r_{1w}}^{\,i+1/2} \right]\\
@@ -554,5 +554,5 @@
 \colorbox{yellow}{CASE \np{nn\_aei\_ijk\_t} = 21 to be added}
 
-In case of setting \np{ln\_traldf\_triad}\forcode{=.true.}, a skew form of the eddy induced advective fluxes is used, which is described in \autoref{apdx:triad}.
+In case of setting \np{ln\_traldf\_triad}\forcode{ = .true.}, a skew form of the eddy induced advective fluxes is used, which is described in \autoref{apdx:TRIADS}.
 
 % ================================================================
Index: /NEMO/trunk/doc/latex/NEMO/subfiles/chap_OBS.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/subfiles/chap_OBS.tex	(revision 11542)
+++ /NEMO/trunk/doc/latex/NEMO/subfiles/chap_OBS.tex	(revision 11543)
@@ -691,5 +691,5 @@
 
 Examples of the weights calculated for an observation with rectangular and radial footprints are shown in
-\autoref{fig:obsavgrec} and~\autoref{fig:obsavgrad}.
+\autoref{fig:OBS_avgrec} and~\autoref{fig:OBS_avgrad}.
 
 %>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@@ -698,5 +698,5 @@
     \includegraphics[width=\textwidth]{Fig_OBS_avg_rec}
     \caption{
-      \protect\label{fig:obsavgrec}
+      \protect\label{fig:OBS_avgrec}
       Weights associated with each model grid box (blue lines and numbers)
       for an observation at -170.5\deg{E}, 56.0\deg{N} with a rectangular footprint of 1\deg x 1\deg.
@@ -711,5 +711,5 @@
     \includegraphics[width=\textwidth]{Fig_OBS_avg_rad}
     \caption{
-      \protect\label{fig:obsavgrad}
+      \protect\label{fig:OBS_avgrad}
       Weights associated with each model grid box (blue lines and numbers)
       for an observation at -170.5\deg{E}, 56.0\deg{N} with a radial footprint with diameter 1\deg.
@@ -756,5 +756,5 @@
           ({\phi_{}}_{\mathrm D}  \;  - \; {\phi_{}}_{\mathrm P} )] \; \widehat{\mathbf k} \\
   \end{array}
-  % \label{eq:cross}
+  % \label{eq:OBS_cross}
 \end{align*}
 point in the opposite direction to the unit normal $\widehat{\mathbf k}$
@@ -791,5 +791,5 @@
     \includegraphics[width=\textwidth]{Fig_ASM_obsdist_local}
     \caption{
-      \protect\label{fig:obslocal}
+      \protect\label{fig:OBS_local}
       Example of the distribution of observations with the geographical distribution of observational data.
     }
@@ -800,5 +800,5 @@
 This is the simplest option in which the observations are distributed according to
 the domain of the grid-point parallelization.
-\autoref{fig:obslocal} shows an example of the distribution of the {\em in situ} data on processors with
+\autoref{fig:OBS_local} shows an example of the distribution of the {\em in situ} data on processors with
 a different colour for each observation on a given processor for a 4 $\times$ 2 decomposition with ORCA2.
 The grid-point domain decomposition is clearly visible on the plot.
@@ -820,5 +820,5 @@
     \includegraphics[width=\textwidth]{Fig_ASM_obsdist_global}
     \caption{
-      \protect\label{fig:obsglobal}
+      \protect\label{fig:OBS_global}
       Example of the distribution of observations with the round-robin distribution of observational data.
     }
@@ -830,7 +830,7 @@
 use message passing in order to retrieve the stencil for interpolation.
 The simplest distribution of the observations is to distribute them using a round-robin scheme.
-\autoref{fig:obsglobal} shows the distribution of the {\em in situ} data on processors for
+\autoref{fig:OBS_global} shows the distribution of the {\em in situ} data on processors for
 the round-robin distribution of observations with a different colour for each observation on a given processor for
-a 4 $\times$ 2 decomposition with ORCA2 for the same input data as in \autoref{fig:obslocal}.
+a 4 $\times$ 2 decomposition with ORCA2 for the same input data as in \autoref{fig:OBS_local}.
 The observations are now clearly randomly distributed on the globe.
 In order to be able to perform horizontal interpolation in this case,
@@ -1118,5 +1118,5 @@
 \end{minted}
 
-\autoref{fig:obsdataplotmain} shows the main window which is launched when dataplot starts.
+\autoref{fig:OBS_dataplotmain} shows the main window which is launched when dataplot starts.
 This is split into three parts.
 At the top there is a menu bar which contains a variety of drop down menus.
@@ -1154,5 +1154,5 @@
     \includegraphics[width=\textwidth]{Fig_OBS_dataplot_main}
     \caption{
-      \protect\label{fig:obsdataplotmain}
+      \protect\label{fig:OBS_dataplotmain}
       Main window of dataplot.
     }
@@ -1162,5 +1162,5 @@
 
 If a profile point is clicked with the mouse button a plot of the observation and background values as
-a function of depth (\autoref{fig:obsdataplotprofile}).
+a function of depth (\autoref{fig:OBS_dataplotprofile}).
 
 %>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@@ -1170,5 +1170,5 @@
     \includegraphics[width=\textwidth]{Fig_OBS_dataplot_prof}
     \caption{
-      \protect\label{fig:obsdataplotprofile}
+      \protect\label{fig:OBS_dataplotprofile}
       Profile plot from dataplot produced by right clicking on a point in the main window.
     }
Index: /NEMO/trunk/doc/latex/NEMO/subfiles/chap_SBC.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/subfiles/chap_SBC.tex	(revision 11542)
+++ /NEMO/trunk/doc/latex/NEMO/subfiles/chap_SBC.tex	(revision 11543)
@@ -109,5 +109,5 @@
 Next, the scheme for interpolation on the fly is described.
 Finally, the different options that further modify the fluxes applied to the ocean are discussed.
-One of these is modification by icebergs (see \autoref{sec:ICB_icebergs}),
+One of these is modification by icebergs (see \autoref{sec:SBC_ICB_icebergs}),
 which act as drifting sources of fresh water.
 Another example of modification is that due to the ice shelf melting/freezing (see \autoref{sec:SBC_isf}),
@@ -124,5 +124,5 @@
 The surface ocean stress is the stress exerted by the wind and the sea-ice on the ocean.
 It is applied in \mdl{dynzdf} module as a surface boundary condition of the computation of
-the momentum vertical mixing trend (see \autoref{eq:dynzdf_sbc} in \autoref{sec:DYN_zdf}).
+the momentum vertical mixing trend (see \autoref{eq:DYN_zdf_sbc} in \autoref{sec:DYN_zdf}).
 As such, it has to be provided as a 2D vector interpolated onto the horizontal velocity ocean mesh,
 \ie\ resolved onto the model (\textbf{i},\textbf{j}) direction at $u$- and $v$-points.
@@ -135,5 +135,5 @@
 It is applied in \mdl{trasbc} module as a surface boundary condition trend of
 the first level temperature time evolution equation
-(see \autoref{eq:tra_sbc} and \autoref{eq:tra_sbc_lin} in \autoref{subsec:TRA_sbc}).
+(see \autoref{eq:TRA_sbc} and \autoref{eq:TRA_sbc_lin} in \autoref{subsec:TRA_sbc}).
 The latter is the penetrative part of the heat flux.
 It is applied as a 3D trend of the temperature equation (\mdl{traqsr} module) when
@@ -177,5 +177,5 @@
 The ocean model provides, at each time step, to the surface module (\mdl{sbcmod})
 the surface currents, temperature and salinity.
-These variables are averaged over \np{nn\_fsbc} time-step (\autoref{tab:ssm}), and
+These variables are averaged over \np{nn\_fsbc} time-step (\autoref{tab:SBC_ssm}), and
 these averaged fields are used to compute the surface fluxes at the frequency of \np{nn\_fsbc} time-steps.
 
@@ -193,5 +193,5 @@
     \end{tabular}
     \caption{
-      \protect\label{tab:ssm}
+      \protect\label{tab:SBC_ssm}
       Ocean variables provided by the ocean to the surface module (SBC).
       The variable are averaged over \np{nn\_fsbc} time-step,
@@ -264,5 +264,5 @@
   This stem will be completed automatically by the model, with the addition of a '.nc' at its end and
   by date information and possibly a prefix (when using AGRIF).
-  \autoref{tab:fldread} provides the resulting file name in all possible cases according to
+  \autoref{tab:SBC_fldread} provides the resulting file name in all possible cases according to
   whether it is a climatological file or not, and to the open/close frequency (see below for definition).
 
@@ -278,5 +278,5 @@
     \end{center}
     \caption{
-      \protect\label{tab:fldread}
+      \protect\label{tab:SBC_fldread}
       naming nomenclature for climatological or interannual input file(s), as a function of the open/close frequency.
       The stem name is assumed to be 'fn'.
@@ -515,5 +515,5 @@
 % -------------------------------------------------------------------------------------------------------------
 \subsection{Standalone surface boundary condition scheme (SAS)}
-\label{subsec:SAS}
+\label{subsec:SBC_SAS}
 
 %---------------------------------------namsbc_sas--------------------------------------------------
@@ -649,5 +649,5 @@
 %--------------------------------------------------TABLE--------------------------------------------------
 \begin{table}[htbp]
-  \label{tab:BULK}
+  \label{tab:SBC_BULK}
   \begin{center}
     \begin{tabular}{|l|c|c|c|}
@@ -852,7 +852,7 @@
 The tidal forcing, generated by the gravity forces of the Earth-Moon and Earth-Sun sytems,
 is activated if \np{ln\_tide} and \np{ln\_tide\_pot} are both set to \forcode{.true.} in \nam{\_tide}.
-This translates as an additional barotropic force in the momentum equations \ref{eq:PE_dyn} such that:
-\[
-  % \label{eq:PE_dyn_tides}
+This translates as an additional barotropic force in the momentum \autoref{eq:MB_PE_dyn} such that:
+\[
+  % \label{eq:SBC_PE_dyn_tides}
   \frac{\partial {\mathrm {\mathbf U}}_h }{\partial t}= ...
   +g\nabla (\Pi_{eq} + \Pi_{sal})
@@ -895,6 +895,5 @@
 %        River runoffs
 % ================================================================
-\section[River runoffs (\textit{sbcrnf.F90})]
-{River runoffs (\protect\mdl{sbcrnf})}
+\section[River runoffs (\textit{sbcrnf.F90})]{River runoffs (\protect\mdl{sbcrnf})}
 \label{sec:SBC_rnf}
 %------------------------------------------namsbc_rnf----------------------------------------------------
@@ -1022,6 +1021,5 @@
 %        Ice shelf melting
 % ================================================================
-\section[Ice shelf melting (\textit{sbcisf.F90})]
-{Ice shelf melting (\protect\mdl{sbcisf})}
+\section[Ice shelf melting (\textit{sbcisf.F90})]{Ice shelf melting (\protect\mdl{sbcisf})}
 \label{sec:SBC_isf}
 %------------------------------------------namsbc_isf----------------------------------------------------
@@ -1066,5 +1064,5 @@
      The salt and heat exchange coefficients are constant and defined by \np{rn\_gammas0} and \np{rn\_gammat0}.
 \[
-  % \label{eq:sbc_isf_gamma_iso}
+  % \label{eq:SBC_isf_gamma_iso}
 \gamma^{T} = \np{rn\_gammat0}
 \]
@@ -1213,5 +1211,5 @@
 % ================================================================
 \section{Handling of icebergs (ICB)}
-\label{sec:ICB_icebergs}
+\label{sec:SBC_ICB_icebergs}
 %------------------------------------------namberg----------------------------------------------------
 
@@ -1282,6 +1280,5 @@
 %        Interactions with waves (sbcwave.F90, ln_wave)
 % =============================================================================================================
-\section[Interactions with waves (\textit{sbcwave.F90}, \texttt{ln\_wave})]
-{Interactions with waves (\protect\mdl{sbcwave}, \protect\np{ln\_wave})}
+\section[Interactions with waves (\textit{sbcwave.F90}, \texttt{ln\_wave})]{Interactions with waves (\protect\mdl{sbcwave}, \protect\np{ln\_wave})}
 \label{sec:SBC_wave}
 %------------------------------------------namsbc_wave--------------------------------------------------------
@@ -1314,6 +1311,5 @@
 
 % ----------------------------------------------------------------
-\subsection[Neutral drag coefficient from wave model (\texttt{ln\_cdgw})]
-{Neutral drag coefficient from wave model (\protect\np{ln\_cdgw})}
+\subsection[Neutral drag coefficient from wave model (\texttt{ln\_cdgw})]{Neutral drag coefficient from wave model (\protect\np{ln\_cdgw})}
 \label{subsec:SBC_wave_cdgw}
 
@@ -1328,6 +1324,5 @@
 % 3D Stokes Drift (ln_sdw, nn_sdrift)
 % ----------------------------------------------------------------
-\subsection[3D Stokes Drift (\texttt{ln\_sdw}, \texttt{nn\_sdrift})]
-{3D Stokes Drift (\protect\np{ln\_sdw, nn\_sdrift})}
+\subsection[3D Stokes Drift (\texttt{ln\_sdw}, \texttt{nn\_sdrift})]{3D Stokes Drift (\protect\np{ln\_sdw, nn\_sdrift})}
 \label{subsec:SBC_wave_sdw}
 
@@ -1343,5 +1338,5 @@
 
 \[
-  % \label{eq:sbc_wave_sdw}
+  % \label{eq:SBC_wave_sdw}
   \mathbf{U}_{st} = \frac{16{\pi^3}} {g}
   \int_0^\infty \int_{-\pi}^{\pi} (cos{\theta},sin{\theta}) {f^3}
@@ -1368,5 +1363,5 @@
 
 \[
-  % \label{eq:sbc_wave_sdw_0a}
+  % \label{eq:SBC_wave_sdw_0a}
   \mathbf{U}_{st} \cong \mathbf{U}_{st |_{z=0}} \frac{\mathrm{e}^{-2k_ez}} {1-8k_ez}
 \]
@@ -1375,5 +1370,5 @@
 
 \[
-  % \label{eq:sbc_wave_sdw_0b}
+  % \label{eq:SBC_wave_sdw_0b}
   k_e = \frac{|\mathbf{U}_{\left.st\right|_{z=0}}|} {|T_{st}|}
   \quad \text{and }\
@@ -1388,5 +1383,5 @@
 
 \[
-  % \label{eq:sbc_wave_sdw_1}
+  % \label{eq:SBC_wave_sdw_1}
   \mathbf{U}_{st} \cong \mathbf{U}_{st |_{z=0}} \Big[exp(2k_pz)-\beta \sqrt{-2 \pi k_pz}
   \textit{ erf } \Big(\sqrt{-2 k_pz}\Big)\Big]
@@ -1404,5 +1399,5 @@
 
 \[
-  % \label{eq:sbc_wave_eta_sdw}
+  % \label{eq:SBC_wave_eta_sdw}
   \frac{\partial{\eta}}{\partial{t}} =
   -\nabla_h \int_{-H}^{\eta} (\mathbf{U} + \mathbf{U}_{st}) dz
@@ -1416,5 +1411,5 @@
 
 \[
-  % \label{eq:sbc_wave_tra_sdw}
+  % \label{eq:SBC_wave_tra_sdw}
   \frac{\partial{c}}{\partial{t}} =
   - (\mathbf{U} + \mathbf{U}_{st}) \cdot \nabla{c}
@@ -1425,6 +1420,5 @@
 % Stokes-Coriolis term (ln_stcor)
 % ----------------------------------------------------------------
-\subsection[Stokes-Coriolis term (\texttt{ln\_stcor})]
-{Stokes-Coriolis term (\protect\np{ln\_stcor})}
+\subsection[Stokes-Coriolis term (\texttt{ln\_stcor})]{Stokes-Coriolis term (\protect\np{ln\_stcor})}
 \label{subsec:SBC_wave_stcor}
 
@@ -1440,6 +1434,5 @@
 % Waves modified stress (ln_tauwoc, ln_tauw)
 % ----------------------------------------------------------------
-\subsection[Wave modified stress (\texttt{ln\_tauwoc}, \texttt{ln\_tauw})]
-{Wave modified sress (\protect\np{ln\_tauwoc, ln\_tauw})}
+\subsection[Wave modified stress (\texttt{ln\_tauwoc}, \texttt{ln\_tauw})]{Wave modified sress (\protect\np{ln\_tauwoc, ln\_tauw})}
 \label{subsec:SBC_wave_tauw}
 
@@ -1453,5 +1446,5 @@
 
 \[
-  % \label{eq:sbc_wave_tauoc}
+  % \label{eq:SBC_wave_tauoc}
   \tau_{oc,a} = \tau_a - \tau_w
 \]
@@ -1461,5 +1454,5 @@
 
 \[
-  % \label{eq:sbc_wave_tauw}
+  % \label{eq:SBC_wave_tauw}
   \tau_w = \rho g \int {\frac{dk}{c_p} (S_{in}+S_{nl}+S_{diss})}
 \]
@@ -1490,6 +1483,5 @@
 %        Diurnal cycle
 % -------------------------------------------------------------------------------------------------------------
-\subsection[Diurnal cycle (\textit{sbcdcy.F90})]
-{Diurnal cycle (\protect\mdl{sbcdcy})}
+\subsection[Diurnal cycle (\textit{sbcdcy.F90})]{Diurnal cycle (\protect\mdl{sbcdcy})}
 \label{subsec:SBC_dcy}
 %------------------------------------------namsbc-------------------------------------------------------------
@@ -1577,6 +1569,5 @@
 %        Surface restoring to observed SST and/or SSS
 % -------------------------------------------------------------------------------------------------------------
-\subsection[Surface restoring to observed SST and/or SSS (\textit{sbcssr.F90})]
-{Surface restoring to observed SST and/or SSS (\protect\mdl{sbcssr})}
+\subsection[Surface restoring to observed SST and/or SSS (\textit{sbcssr.F90})]{Surface restoring to observed SST and/or SSS (\protect\mdl{sbcssr})}
 \label{subsec:SBC_ssr}
 %------------------------------------------namsbc_ssr----------------------------------------------------
@@ -1589,5 +1580,5 @@
 a feedback term \emph{must} be added to the surface heat flux $Q_{ns}^o$:
 \[
-  % \label{eq:sbc_dmp_q}
+  % \label{eq:SBC_dmp_q}
   Q_{ns} = Q_{ns}^o + \frac{dQ}{dT} \left( \left. T \right|_{k=1} - SST_{Obs} \right)
 \]
@@ -1602,5 +1593,5 @@
 
 \begin{equation}
-  \label{eq:sbc_dmp_emp}
+  \label{eq:SBC_dmp_emp}
   \textit{emp} = \textit{emp}_o + \gamma_s^{-1} e_{3t}  \frac{  \left(\left.S\right|_{k=1}-SSS_{Obs}\right)}
   {\left.S\right|_{k=1}}
@@ -1613,5 +1604,5 @@
 $\left.S\right|_{k=1}$ is the model surface layer salinity and
 $\gamma_s$ is a negative feedback coefficient which is provided as a namelist parameter.
-Unlike heat flux, there is no physical justification for the feedback term in \autoref{eq:sbc_dmp_emp} as
+Unlike heat flux, there is no physical justification for the feedback term in \autoref{eq:SBC_dmp_emp} as
 the atmosphere does not care about ocean surface salinity \citep{madec.delecluse_IWN97}.
 The SSS restoring term should be viewed as a flux correction on freshwater fluxes to
@@ -1663,6 +1654,5 @@
 %        CICE-ocean Interface
 % -------------------------------------------------------------------------------------------------------------
-\subsection[Interface to CICE (\textit{sbcice\_cice.F90})]
-{Interface to CICE (\protect\mdl{sbcice\_cice})}
+\subsection[Interface to CICE (\textit{sbcice\_cice.F90})]{Interface to CICE (\protect\mdl{sbcice\_cice})}
 \label{subsec:SBC_cice}
 
@@ -1698,6 +1688,5 @@
 %        Freshwater budget control
 % -------------------------------------------------------------------------------------------------------------
-\subsection[Freshwater budget control (\textit{sbcfwb.F90})]
-{Freshwater budget control (\protect\mdl{sbcfwb})}
+\subsection[Freshwater budget control (\textit{sbcfwb.F90})]{Freshwater budget control (\protect\mdl{sbcfwb})}
 \label{subsec:SBC_fwb}
 
Index: /NEMO/trunk/doc/latex/NEMO/subfiles/chap_TRA.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/subfiles/chap_TRA.tex	(revision 11542)
+++ /NEMO/trunk/doc/latex/NEMO/subfiles/chap_TRA.tex	(revision 11543)
@@ -73,5 +73,5 @@
 Its discrete expression is given by :
 \begin{equation}
-  \label{eq:tra_adv}
+  \label{eq:TRA_adv}
   ADV_\tau = - \frac{1}{b_t} \Big(   \delta_i [ e_{2u} \, e_{3u} \; u \; \tau_u]
                                    + \delta_j [ e_{1v} \, e_{3v} \; v \; \tau_v] \Big)
@@ -79,5 +79,5 @@
 \end{equation}
 where $\tau$ is either T or S, and $b_t = e_{1t} \, e_{2t} \, e_{3t}$ is the volume of $T$-cells.
-The flux form in \autoref{eq:tra_adv} implicitly requires the use of the continuity equation.
+The flux form in \autoref{eq:TRA_adv} implicitly requires the use of the continuity equation.
 Indeed, it is obtained by using the following equality: $\nabla \cdot (\vect U \, T) = \vect U \cdot \nabla T$ which
 results from the use of the continuity equation, $\partial_t e_3 + e_3 \; \nabla \cdot \vect U = 0$
@@ -86,5 +86,5 @@
 it is consistent with the continuity equation in order to enforce the conservation properties of
 the continuous equations.
-In other words, by setting $\tau=1$ in (\autoref{eq:tra_adv}) we recover the discrete form of
+In other words, by setting $\tau = 1$ in (\autoref{eq:TRA_adv}) we recover the discrete form of
 the continuity equation which is used to calculate the vertical velocity.
 %>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@@ -93,5 +93,5 @@
     \includegraphics[width=\textwidth]{Fig_adv_scheme}
     \caption{
-      \protect\label{fig:adv_scheme}
+      \protect\label{fig:TRA_adv_scheme}
       Schematic representation of some ways used to evaluate the tracer value at $u$-point and
       the amount of tracer exchanged between two neighbouring grid points.
@@ -112,5 +112,5 @@
 The key difference between the advection schemes available in \NEMO\ is the choice made in space and
 time interpolation to define the value of the tracer at the velocity points
-(\autoref{fig:adv_scheme}).
+(\autoref{fig:TRA_adv_scheme}).
 
 Along solid lateral and bottom boundaries a zero tracer flux is automatically specified,
@@ -139,5 +139,5 @@
 two quantities that are not correlated \citep{roullet.madec_JGR00, griffies.pacanowski.ea_MWR01, campin.adcroft.ea_OM04}.
 
-The velocity field that appears in (\autoref{eq:tra_adv} is
+The velocity field that appears in (\autoref{eq:TRA_adv} is
 the centred (\textit{now}) \textit{effective} ocean velocity, \ie\ the \textit{eulerian} velocity
 (see \autoref{chap:DYN}) plus the eddy induced velocity (\textit{eiv}) and/or
@@ -199,5 +199,5 @@
 For example, in the $i$-direction :
 \begin{equation}
-  \label{eq:tra_adv_cen2}
+  \label{eq:TRA_adv_cen2}
   \tau_u^{cen2} = \overline T ^{i + 1/2}
 \end{equation}
@@ -208,8 +208,8 @@
 produce a sensible solution.
 The associated time-stepping is performed using a leapfrog scheme in conjunction with an Asselin time-filter,
-so $T$ in (\autoref{eq:tra_adv_cen2}) is the \textit{now} tracer value.
+so $T$ in (\autoref{eq:TRA_adv_cen2}) is the \textit{now} tracer value.
 
 Note that using the CEN2, the overall tracer advection is of second order accuracy since
-both (\autoref{eq:tra_adv}) and (\autoref{eq:tra_adv_cen2}) have this order of accuracy.
+both (\autoref{eq:TRA_adv}) and (\autoref{eq:TRA_adv_cen2}) have this order of accuracy.
 
 %        4nd order centred scheme
@@ -219,5 +219,5 @@
 For example, in the $i$-direction:
 \begin{equation}
-  \label{eq:tra_adv_cen4}
+  \label{eq:TRA_adv_cen4}
   \tau_u^{cen4} = \overline{T - \frac{1}{6} \, \delta_i \Big[ \delta_{i + 1/2}[T] \, \Big]}^{\,i + 1/2}
 \end{equation}
@@ -229,5 +229,5 @@
 Strictly speaking, the CEN4 scheme is not a $4^{th}$ order advection scheme but
 a $4^{th}$ order evaluation of advective fluxes,
-since the divergence of advective fluxes \autoref{eq:tra_adv} is kept at $2^{nd}$ order.
+since the divergence of advective fluxes \autoref{eq:TRA_adv} is kept at $2^{nd}$ order.
 The expression \textit{$4^{th}$ order scheme} used in oceanographic literature is usually associated with
 the scheme presented here.
@@ -240,5 +240,5 @@
 Furthermore, it must be used in conjunction with an explicit diffusion operator to produce a sensible solution.
 As in CEN2 case, the time-stepping is performed using a leapfrog scheme in conjunction with an Asselin time-filter,
-so $T$ in (\autoref{eq:tra_adv_cen4}) is the \textit{now} tracer.
+so $T$ in (\autoref{eq:TRA_adv_cen4}) is the \textit{now} tracer.
 
 At a $T$-grid cell adjacent to a boundary (coastline, bottom and surface),
@@ -265,5 +265,5 @@
 For example, in the $i$-direction :
 \begin{equation}
-  \label{eq:tra_adv_fct}
+  \label{eq:TRA_adv_fct}
   \begin{split}
     \tau_u^{ups} &=
@@ -287,6 +287,6 @@
 
 
-For stability reasons (see \autoref{chap:STP}),
-$\tau_u^{cen}$ is evaluated in (\autoref{eq:tra_adv_fct}) using the \textit{now} tracer while
+For stability reasons (see \autoref{chap:TD}),
+$\tau_u^{cen}$ is evaluated in (\autoref{eq:TRA_adv_fct}) using the \textit{now} tracer while
 $\tau_u^{ups}$ is evaluated using the \textit{before} tracer.
 In other words, the advective part of the scheme is time stepped with a leap-frog scheme
@@ -305,8 +305,8 @@
 MUSCL has been first implemented in \NEMO\ by \citet{levy.estublier.ea_GRL01}.
 In its formulation, the tracer at velocity points is evaluated assuming a linear tracer variation between
-two $T$-points (\autoref{fig:adv_scheme}).
+two $T$-points (\autoref{fig:TRA_adv_scheme}).
 For example, in the $i$-direction :
 \begin{equation}
-  % \label{eq:tra_adv_mus}
+  % \label{eq:TRA_adv_mus}
   \tau_u^{mus} = \lt\{
   \begin{split}
@@ -345,5 +345,5 @@
 For example, in the $i$-direction:
 \begin{equation}
-  \label{eq:tra_adv_ubs}
+  \label{eq:TRA_adv_ubs}
   \tau_u^{ubs} = \overline T ^{i + 1/2} - \frac{1}{6}
     \begin{cases}
@@ -369,5 +369,5 @@
 (\np{nn\_ubs\_v}\forcode{=2 or 4}).
 
-For stability reasons (see \autoref{chap:STP}), the first term  in \autoref{eq:tra_adv_ubs}
+For stability reasons (see \autoref{chap:TD}), the first term  in \autoref{eq:TRA_adv_ubs}
 (which corresponds to a second order centred scheme)
 is evaluated using the \textit{now} tracer (centred in time) while the second term
@@ -376,11 +376,11 @@
 This choice is discussed by \citet{webb.de-cuevas.ea_JAOT98} in the context of the QUICK advection scheme.
 UBS and QUICK schemes only differ by one coefficient.
-Replacing 1/6 with 1/8 in \autoref{eq:tra_adv_ubs} leads to the QUICK advection scheme \citep{webb.de-cuevas.ea_JAOT98}.
+Replacing 1/6 with 1/8 in \autoref{eq:TRA_adv_ubs} leads to the QUICK advection scheme \citep{webb.de-cuevas.ea_JAOT98}.
 This option is not available through a namelist parameter, since the 1/6 coefficient is hard coded.
 Nevertheless it is quite easy to make the substitution in the \mdl{traadv\_ubs} module and obtain a QUICK scheme.
 
-Note that it is straightforward to rewrite \autoref{eq:tra_adv_ubs} as follows:
+Note that it is straightforward to rewrite \autoref{eq:TRA_adv_ubs} as follows:
 \begin{gather}
-  \label{eq:traadv_ubs2}
+  \label{eq:TRA_adv_ubs2}
   \tau_u^{ubs} = \tau_u^{cen4} + \frac{1}{12}
     \begin{cases}
@@ -389,17 +389,17 @@
     \end{cases}
   \intertext{or equivalently}
-  % \label{eq:traadv_ubs2b}
+  % \label{eq:TRA_adv_ubs2b}
   u_{i + 1/2} \ \tau_u^{ubs} = u_{i + 1/2} \, \overline{T - \frac{1}{6} \, \delta_i \Big[ \delta_{i + 1/2}[T] \Big]}^{\,i + 1/2}
                              - \frac{1}{2} |u|_{i + 1/2} \, \frac{1}{6} \, \delta_{i + 1/2} [\tau"_i] \nonumber
 \end{gather}
 
-\autoref{eq:traadv_ubs2} has several advantages.
+\autoref{eq:TRA_adv_ubs2} has several advantages.
 Firstly, it clearly reveals that the UBS scheme is based on the fourth order scheme to which
 an upstream-biased diffusion term is added.
 Secondly, this emphasises that the $4^{th}$ order part (as well as the $2^{nd}$ order part as stated above) has to
-be evaluated at the \textit{now} time step using \autoref{eq:tra_adv_ubs}.
+be evaluated at the \textit{now} time step using \autoref{eq:TRA_adv_ubs}.
 Thirdly, the diffusion term is in fact a biharmonic operator with an eddy coefficient which
 is simply proportional to the velocity: $A_u^{lm} = \frac{1}{12} \, {e_{1u}}^3 \, |u|$.
-Note the current version of \NEMO\ uses the computationally more efficient formulation \autoref{eq:tra_adv_ubs}.
+Note the current version of \NEMO\ uses the computationally more efficient formulation \autoref{eq:TRA_adv_ubs}.
 
 % -------------------------------------------------------------------------------------------------------------
@@ -452,5 +452,5 @@
 \ie\ the tracers appearing in its expression are the \textit{before} tracers in time,
 except for the pure vertical component that appears when a rotation tensor is used.
-This latter component is solved implicitly together with the vertical diffusion term (see \autoref{chap:STP}).
+This latter component is solved implicitly together with the vertical diffusion term (see \autoref{chap:TD}).
 When \np{ln\_traldf\_msc}\forcode{=.true.}, a Method of Stabilizing Correction is used in which
 the pure vertical component is split into an explicit and an implicit part \citep{lemarie.debreu.ea_OM12}.
@@ -527,5 +527,5 @@
 The laplacian diffusion operator acting along the model (\textit{i,j})-surfaces is given by:
 \begin{equation}
-  \label{eq:tra_ldf_lap}
+  \label{eq:TRA_ldf_lap}
   D_t^{lT} = \frac{1}{b_t} \Bigg(   \delta_{i} \lt[ A_u^{lT} \; \frac{e_{2u} \, e_{3u}}{e_{1u}} \; \delta_{i + 1/2} [T] \rt]
                                   + \delta_{j} \lt[ A_v^{lT} \; \frac{e_{1v} \, e_{3v}}{e_{2v}} \; \delta_{j + 1/2} [T] \rt] \Bigg)
@@ -547,5 +547,5 @@
 Note that in the partial step $z$-coordinate (\np{ln\_zps}\forcode{=.true.}),
 tracers in horizontally adjacent cells are located at different depths in the vicinity of the bottom.
-In this case, horizontal derivatives in (\autoref{eq:tra_ldf_lap}) at the bottom level require a specific treatment.
+In this case, horizontal derivatives in (\autoref{eq:TRA_ldf_lap}) at the bottom level require a specific treatment.
 They are calculated in the \mdl{zpshde} module, described in \autoref{sec:TRA_zpshde}.
 
@@ -561,8 +561,8 @@
 {Standard rotated (bi-)laplacian operator (\protect\mdl{traldf\_iso})}
 \label{subsec:TRA_ldf_iso}
-The general form of the second order lateral tracer subgrid scale physics (\autoref{eq:PE_zdf})
+The general form of the second order lateral tracer subgrid scale physics (\autoref{eq:MB_zdf})
 takes the following semi -discrete space form in $z$- and $s$-coordinates:
 \begin{equation}
-  \label{eq:tra_ldf_iso}
+  \label{eq:TRA_ldf_iso}
   \begin{split}
     D_T^{lT} = \frac{1}{b_t} \Bigg[ \quad &\delta_i A_u^{lT} \lt( \frac{e_{2u} e_{3u}}{e_{1u}}                      \, \delta_{i + 1/2} [T]
@@ -585,5 +585,5 @@
 the mask technique (see \autoref{sec:LBC_coast}).
 
-The operator in \autoref{eq:tra_ldf_iso} involves both lateral and vertical derivatives.
+The operator in \autoref{eq:TRA_ldf_iso} involves both lateral and vertical derivatives.
 For numerical stability, the vertical second derivative must be solved using the same implicit time scheme as that
 used in the vertical physics (see \autoref{sec:TRA_zdf}).
@@ -597,5 +597,5 @@
 
 Note that in the partial step $z$-coordinate (\np{ln\_zps}\forcode{=.true.}),
-the horizontal derivatives at the bottom level in \autoref{eq:tra_ldf_iso} require a specific treatment.
+the horizontal derivatives at the bottom level in \autoref{eq:TRA_ldf_iso} require a specific treatment.
 They are calculated in module zpshde, described in \autoref{sec:TRA_zpshde}.
 
@@ -608,11 +608,11 @@
 An alternative scheme developed by \cite{griffies.gnanadesikan.ea_JPO98} which ensures tracer variance decreases
 is also available in \NEMO\ (\np{ln\_traldf\_triad}\forcode{=.true.}).
-A complete description of the algorithm is given in \autoref{apdx:triad}.
-
-The lateral fourth order bilaplacian operator on tracers is obtained by applying (\autoref{eq:tra_ldf_lap}) twice.
+A complete description of the algorithm is given in \autoref{apdx:TRIADS}.
+
+The lateral fourth order bilaplacian operator on tracers is obtained by applying (\autoref{eq:TRA_ldf_lap}) twice.
 The operator requires an additional assumption on boundary conditions:
 both first and third derivative terms normal to the coast are set to zero.
 
-The lateral fourth order operator formulation on tracers is obtained by applying (\autoref{eq:tra_ldf_iso}) twice.
+The lateral fourth order operator formulation on tracers is obtained by applying (\autoref{eq:TRA_ldf_iso}) twice.
 It requires an additional assumption on boundary conditions:
 first and third derivative terms normal to the coast,
@@ -646,7 +646,7 @@
 The formulation of the vertical subgrid scale tracer physics is the same for all the vertical coordinates,
 and is based on a laplacian operator.
-The vertical diffusion operator given by (\autoref{eq:PE_zdf}) takes the following semi -discrete space form:
+The vertical diffusion operator given by (\autoref{eq:MB_zdf}) takes the following semi -discrete space form:
 \begin{gather*}
-  % \label{eq:tra_zdf}
+  % \label{eq:TRA_zdf}
     D^{vT}_T = \frac{1}{e_{3t}} \, \delta_k \lt[ \, \frac{A^{vT}_w}{e_{3w}} \delta_{k + 1/2}[T] \, \rt] \\
     D^{vS}_T = \frac{1}{e_{3t}} \; \delta_k \lt[ \, \frac{A^{vS}_w}{e_{3w}} \delta_{k + 1/2}[S] \, \rt]
@@ -659,5 +659,5 @@
 Furthermore, when iso-neutral mixing is used, both mixing coefficients are increased by
 $\frac{e_{1w} e_{2w}}{e_{3w} }({r_{1w}^2 + r_{2w}^2})$ to account for the vertical second derivative of
-\autoref{eq:tra_ldf_iso}.
+\autoref{eq:TRA_ldf_iso}.
 
 At the surface and bottom boundaries, the turbulent fluxes of heat and salt must be specified.
@@ -721,5 +721,5 @@
 The surface boundary condition on temperature and salinity is applied as follows:
 \begin{equation}
-  \label{eq:tra_sbc}
+  \label{eq:TRA_sbc}
   \begin{alignedat}{2}
     F^T &= \frac{1}{C_p} &\frac{1}{\rho_o \lt. e_{3t} \rt|_{k = 1}} &\overline{Q_{ns}      }^t \\
@@ -729,5 +729,5 @@
 where $\overline x^t$ means that $x$ is averaged over two consecutive time steps
 ($t - \rdt / 2$ and $t + \rdt / 2$).
-Such time averaging prevents the divergence of odd and even time step (see \autoref{chap:STP}).
+Such time averaging prevents the divergence of odd and even time step (see \autoref{chap:TD}).
 
 In the linear free surface case (\np{ln\_linssh}\forcode{=.true.}), an additional term has to be added on
@@ -738,5 +738,5 @@
 The resulting surface boundary condition is applied as follows:
 \begin{equation}
-  \label{eq:tra_sbc_lin}
+  \label{eq:TRA_sbc_lin}
   \begin{alignedat}{2}
     F^T &= \frac{1}{C_p} &\frac{1}{\rho_o \lt. e_{3t} \rt|_{k = 1}}
@@ -749,5 +749,5 @@
 In the linear free surface case, there is a small imbalance.
 The imbalance is larger than the imbalance associated with the Asselin time filter \citep{leclair.madec_OM09}.
-This is the reason why the modified filter is not applied in the linear free surface case (see \autoref{chap:STP}).
+This is the reason why the modified filter is not applied in the linear free surface case (see \autoref{chap:TD}).
 
 % -------------------------------------------------------------------------------------------------------------
@@ -766,9 +766,9 @@
 the solar radiation penetrates the top few tens of meters of the ocean.
 If it is not used (\np{ln\_traqsr}\forcode{=.false.}) all the heat flux is absorbed in the first ocean level.
-Thus, in the former case a term is added to the time evolution equation of temperature \autoref{eq:PE_tra_T} and
+Thus, in the former case a term is added to the time evolution equation of temperature \autoref{eq:MB_PE_tra_T} and
 the surface boundary condition is modified to take into account only the non-penetrative part of the surface
 heat flux:
 \begin{equation}
-  \label{eq:PE_qsr}
+  \label{eq:TRA_PE_qsr}
   \begin{gathered}
     \pd[T]{t} = \ldots + \frac{1}{\rho_o \, C_p \, e_3} \; \pd[I]{k} \\
@@ -778,7 +778,7 @@
 where $Q_{sr}$ is the penetrative part of the surface heat flux (\ie\ the shortwave radiation) and
 $I$ is the downward irradiance ($\lt. I \rt|_{z = \eta} = Q_{sr}$).
-The additional term in \autoref{eq:PE_qsr} is discretized as follows:
-\begin{equation}
-  \label{eq:tra_qsr}
+The additional term in \autoref{eq:TRA_PE_qsr} is discretized as follows:
+\begin{equation}
+  \label{eq:TRA_qsr}
   \frac{1}{\rho_o \, C_p \, e_3} \, \pd[I]{k} \equiv \frac{1}{\rho_o \, C_p \, e_{3t}} \delta_k [I_w]
 \end{equation}
@@ -798,5 +798,5 @@
 leading to the following expression \citep{paulson.simpson_JPO77}:
 \[
-  % \label{eq:traqsr_iradiance}
+  % \label{eq:TRA_qsr_iradiance}
   I(z) = Q_{sr} \lt[ Re^{- z / \xi_0} + (1 - R) e^{- z / \xi_1} \rt]
 \]
@@ -807,5 +807,5 @@
 
 Such assumptions have been shown to provide a very crude and simplistic representation of
-observed light penetration profiles (\cite{morel_JGR88}, see also \autoref{fig:traqsr_irradiance}).
+observed light penetration profiles (\cite{morel_JGR88}, see also \autoref{fig:TRA_qsr_irradiance}).
 Light absorption in the ocean depends on particle concentration and is spectrally selective.
 \cite{morel_JGR88} has shown that an accurate representation of light penetration can be provided by
@@ -817,5 +817,5 @@
 the full spectral model of \cite{morel_JGR88} (as modified by \cite{morel.maritorena_JGR01}),
 assuming the same power-law relationship.
-As shown in \autoref{fig:traqsr_irradiance}, this formulation, called RGB (Red-Green-Blue),
+As shown in \autoref{fig:TRA_qsr_irradiance}, this formulation, called RGB (Red-Green-Blue),
 reproduces quite closely the light penetration profiles predicted by the full spectal model,
 but with much greater computational efficiency.
@@ -843,5 +843,5 @@
 \end{description}
 
-The trend in \autoref{eq:tra_qsr} associated with the penetration of the solar radiation is added to
+The trend in \autoref{eq:TRA_qsr} associated with the penetration of the solar radiation is added to
 the temperature trend, and the surface heat flux is modified in routine \mdl{traqsr}.
 
@@ -860,5 +860,5 @@
     \includegraphics[width=\textwidth]{Fig_TRA_Irradiance}
     \caption{
-      \protect\label{fig:traqsr_irradiance}
+      \protect\label{fig:TRA_qsr_irradiance}
       Penetration profile of the downward solar irradiance calculated by four models.
       Two waveband chlorophyll-independent formulation (blue),
@@ -888,5 +888,5 @@
     \includegraphics[width=\textwidth]{Fig_TRA_geoth}
     \caption{
-      \protect\label{fig:geothermal}
+      \protect\label{fig:TRA_geothermal}
       Geothermal Heat flux (in $mW.m^{-2}$) used by \cite{emile-geay.madec_OS09}.
       It is inferred from the age of the sea floor and the formulae of \citet{stein.stein_N92}.
@@ -910,5 +910,5 @@
 the \np{rn\_geoflx\_cst}, which is also a namelist parameter.
 When \np{nn\_geoflx} is set to 2, a spatially varying geothermal heat flux is introduced which is provided in
-the \ifile{geothermal\_heating} NetCDF file (\autoref{fig:geothermal}) \citep{emile-geay.madec_OS09}.
+the \ifile{geothermal\_heating} NetCDF file (\autoref{fig:TRA_geothermal}) \citep{emile-geay.madec_OS09}.
 
 % ================================================================
@@ -955,5 +955,5 @@
 the diffusive flux between two adjacent cells at the ocean floor is given by
 \[
-  % \label{eq:tra_bbl_diff}
+  % \label{eq:TRA_bbl_diff}
   \vect F_\sigma = A_l^\sigma \, \nabla_\sigma T
 \]
@@ -963,5 +963,5 @@
 \ie\ in the conditional form
 \begin{equation}
-  \label{eq:tra_bbl_coef}
+  \label{eq:TRA_bbl_coef}
   A_l^\sigma (i,j,t) =
       \begin{cases}
@@ -973,11 +973,11 @@
 where $A_{bbl}$ is the BBL diffusivity coefficient, given by the namelist parameter \np{rn\_ahtbbl} and
 usually set to a value much larger than the one used for lateral mixing in the open ocean.
-The constraint in \autoref{eq:tra_bbl_coef} implies that sigma-like diffusion only occurs when
+The constraint in \autoref{eq:TRA_bbl_coef} implies that sigma-like diffusion only occurs when
 the density above the sea floor, at the top of the slope, is larger than in the deeper ocean
-(see green arrow in \autoref{fig:bbl}).
+(see green arrow in \autoref{fig:TRA_bbl}).
 In practice, this constraint is applied separately in the two horizontal directions,
-and the density gradient in \autoref{eq:tra_bbl_coef} is evaluated with the log gradient formulation:
+and the density gradient in \autoref{eq:TRA_bbl_coef} is evaluated with the log gradient formulation:
 \[
-  % \label{eq:tra_bbl_Drho}
+  % \label{eq:TRA_bbl_Drho}
   \nabla_\sigma \rho / \rho = \alpha \, \nabla_\sigma T + \beta \, \nabla_\sigma S
 \]
@@ -1002,5 +1002,5 @@
     \includegraphics[width=\textwidth]{Fig_BBL_adv}
     \caption{
-      \protect\label{fig:bbl}
+      \protect\label{fig:TRA_bbl}
       Advective/diffusive Bottom Boundary Layer.
       The BBL parameterisation is activated when $\rho^i_{kup}$ is larger than $\rho^{i + 1}_{kdnw}$.
@@ -1026,5 +1026,5 @@
 \np{nn\_bbl\_adv}\forcode{=1}:
 the downslope velocity is chosen to be the Eulerian ocean velocity just above the topographic step
-(see black arrow in \autoref{fig:bbl}) \citep{beckmann.doscher_JPO97}.
+(see black arrow in \autoref{fig:TRA_bbl}) \citep{beckmann.doscher_JPO97}.
 It is a \textit{conditional advection}, that is, advection is allowed only
 if dense water overlies less dense water on the slope (\ie\ $\nabla_\sigma \rho \cdot \nabla H < 0$) and
@@ -1036,8 +1036,8 @@
 The advection is allowed only  if dense water overlies less dense water on the slope
 (\ie\ $\nabla_\sigma \rho \cdot \nabla H < 0$).
-For example, the resulting transport of the downslope flow, here in the $i$-direction (\autoref{fig:bbl}),
+For example, the resulting transport of the downslope flow, here in the $i$-direction (\autoref{fig:TRA_bbl}),
 is simply given by the following expression:
 \[
-  % \label{eq:bbl_Utr}
+  % \label{eq:TRA_bbl_Utr}
   u^{tr}_{bbl} = \gamma g \frac{\Delta \rho}{\rho_o} e_{1u} \, min ({e_{3u}}_{kup},{e_{3u}}_{kdwn})
 \]
@@ -1053,14 +1053,14 @@
 the surrounding water at intermediate depths.
 The entrainment is replaced by the vertical mixing implicit in the advection scheme.
-Let us consider as an example the case displayed in \autoref{fig:bbl} where
+Let us consider as an example the case displayed in \autoref{fig:TRA_bbl} where
 the density at level $(i,kup)$ is larger than the one at level $(i,kdwn)$.
 The advective BBL scheme modifies the tracer time tendency of the ocean cells near the topographic step by
-the downslope flow \autoref{eq:bbl_dw}, the horizontal \autoref{eq:bbl_hor} and
-the upward \autoref{eq:bbl_up} return flows as follows:
+the downslope flow \autoref{eq:TRA_bbl_dw}, the horizontal \autoref{eq:TRA_bbl_hor} and
+the upward \autoref{eq:TRA_bbl_up} return flows as follows:
 \begin{alignat}{3}
-  \label{eq:bbl_dw}
+  \label{eq:TRA_bbl_dw}
   \partial_t T^{do}_{kdw} &\equiv \partial_t T^{do}_{kdw}
                                 &&+ \frac{u^{tr}_{bbl}}{{b_t}^{do}_{kdw}} &&\lt( T^{sh}_{kup} - T^{do}_{kdw} \rt) \\
-  \label{eq:bbl_hor}
+  \label{eq:TRA_bbl_hor}
   \partial_t T^{sh}_{kup} &\equiv \partial_t T^{sh}_{kup}
                                 &&+ \frac{u^{tr}_{bbl}}{{b_t}^{sh}_{kup}} &&\lt( T^{do}_{kup} - T^{sh}_{kup} \rt) \\
@@ -1068,5 +1068,5 @@
   \intertext{and for $k =kdw-1,\;..., \; kup$ :}
   %
-  \label{eq:bbl_up}
+  \label{eq:TRA_bbl_up}
   \partial_t T^{do}_{k} &\equiv \partial_t S^{do}_{k}
                                 &&+ \frac{u^{tr}_{bbl}}{{b_t}^{do}_{k}}   &&\lt( T^{do}_{k +1} - T^{sh}_{k}   \rt)
@@ -1090,5 +1090,5 @@
 In some applications it can be useful to add a Newtonian damping term into the temperature and salinity equations:
 \begin{equation}
-  \label{eq:tra_dmp}
+  \label{eq:TRA_dmp}
   \begin{gathered}
     \pd[T]{t} = \cdots - \gamma (T - T_o) \\
@@ -1108,5 +1108,5 @@
 The DMP\_TOOLS tool is provided to allow users to generate the netcdf file.
 
-The two main cases in which \autoref{eq:tra_dmp} is used are
+The two main cases in which \autoref{eq:TRA_dmp} is used are
 \textit{(a)} the specification of the boundary conditions along artificial walls of a limited domain basin and
 \textit{(b)} the computation of the velocity field associated with a given $T$-$S$ field
@@ -1146,7 +1146,7 @@
 Options are defined through the \nam{dom} namelist variables.
 The general framework for tracer time stepping is a modified leap-frog scheme \citep{leclair.madec_OM09},
-\ie\ a three level centred time scheme associated with a Asselin time filter (cf. \autoref{sec:STP_mLF}):
-\begin{equation}
-  \label{eq:tra_nxt}
+\ie\ a three level centred time scheme associated with a Asselin time filter (cf. \autoref{sec:TD_mLF}):
+\begin{equation}
+  \label{eq:TRA_nxt}
   \begin{alignedat}{3}
     &(e_{3t}T)^{t + \rdt} &&= (e_{3t}T)_f^{t - \rdt} &&+ 2 \, \rdt \,e_{3t}^t \ \text{RHS}^t \\
@@ -1263,5 +1263,5 @@
 
   \begin{gather*}
-    % \label{eq:tra_S-EOS}
+    % \label{eq:TRA_S-EOS}
     \begin{alignedat}{2}
     &d_a(T,S,z) = \frac{1}{\rho_o} \big[ &- a_0 \; ( 1 + 0.5 \; \lambda_1 \; T_a + \mu_1 \; z ) * &T_a \big. \\
@@ -1272,5 +1272,5 @@
     \text{with~} T_a = T - 10 \, ; \, S_a = S - 35 \, ; \, \rho_o = 1026~Kg/m^3
   \end{gather*}
-  where the computer name of the coefficients as well as their standard value are given in \autoref{tab:SEOS}.
+  where the computer name of the coefficients as well as their standard value are given in \autoref{tab:TRA_SEOS}.
   In fact, when choosing S-EOS, various approximation of EOS can be specified simply by
   changing the associated coefficients.
@@ -1304,5 +1304,5 @@
     \end{tabular}
     \caption{
-      \protect\label{tab:SEOS}
+      \protect\label{tab:TRA_SEOS}
       Standard value of S-EOS coefficients.
     }
@@ -1326,5 +1326,5 @@
 The expression for $N^2$  is given by:
 \[
-  % \label{eq:tra_bn2}
+  % \label{eq:TRA_bn2}
   N^2 = \frac{g}{e_{3w}} \lt( \beta \; \delta_{k + 1/2}[S] - \alpha \; \delta_{k + 1/2}[T] \rt)
 \]
@@ -1343,5 +1343,5 @@
 The freezing point of seawater is a function of salinity and pressure \citep{fofonoff.millard_bk83}:
 \begin{equation}
-  \label{eq:tra_eos_fzp}
+  \label{eq:TRA_eos_fzp}
   \begin{split}
     &T_f (S,p) = \lt( a + b \, \sqrt{S} + c \, S \rt) \, S + d \, p \\
@@ -1351,7 +1351,7 @@
 \end{equation}
 
-\autoref{eq:tra_eos_fzp} is only used to compute the potential freezing point of sea water
+\autoref{eq:TRA_eos_fzp} is only used to compute the potential freezing point of sea water
 (\ie\ referenced to the surface $p = 0$),
-thus the pressure dependent terms in \autoref{eq:tra_eos_fzp} (last term) have been dropped.
+thus the pressure dependent terms in \autoref{eq:TRA_eos_fzp} (last term) have been dropped.
 The freezing point is computed through \textit{eos\_fzp},
 a \fortran function that can be found in \mdl{eosbn2}.
@@ -1386,5 +1386,5 @@
 Before taking horizontal gradients between the tracers next to the bottom,
 a linear interpolation in the vertical is used to approximate the deeper tracer as if
-it actually lived at the depth of the shallower tracer point (\autoref{fig:Partial_step_scheme}).
+it actually lived at the depth of the shallower tracer point (\autoref{fig:TRA_Partial_step_scheme}).
 For example, for temperature in the $i$-direction the needed interpolated temperature, $\widetilde T$, is:
 
@@ -1394,5 +1394,5 @@
     \includegraphics[width=\textwidth]{Fig_partial_step_scheme}
     \caption{
-      \protect\label{fig:Partial_step_scheme}
+      \protect\label{fig:TRA_Partial_step_scheme}
       Discretisation of the horizontal difference and average of tracers in the $z$-partial step coordinate
       (\protect\np{ln\_zps}\forcode{=.true.}) in the case $(e3w_k^{i + 1} - e3w_k^i) > 0$.
@@ -1417,5 +1417,5 @@
 and the resulting forms for the horizontal difference and the horizontal average value of $T$ at a $U$-point are:
 \begin{equation}
-  \label{eq:zps_hde}
+  \label{eq:TRA_zps_hde}
   \begin{split}
     \delta_{i + 1/2} T       &=
@@ -1443,5 +1443,5 @@
 (in the equation of state pressure is approximated by depth, see \autoref{subsec:TRA_eos}):
 \[
-  % \label{eq:zps_hde_rho}
+  % \label{eq:TRA_zps_hde_rho}
   \widetilde \rho = \rho (\widetilde T,\widetilde S,z_u) \quad \text{where~} z_u = \min \lt( z_T^{i + 1},z_T^i \rt)
 \]
@@ -1454,5 +1454,5 @@
 Note that in almost all the advection schemes presented in this Chapter,
 both averaging and differencing operators appear.
-Yet \autoref{eq:zps_hde} has not been used in these schemes:
+Yet \autoref{eq:TRA_zps_hde} has not been used in these schemes:
 in contrast to diffusion and pressure gradient computations,
 no correction for partial steps is applied for advection.
Index: /NEMO/trunk/doc/latex/NEMO/subfiles/chap_ZDF.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/subfiles/chap_ZDF.tex	(revision 11542)
+++ /NEMO/trunk/doc/latex/NEMO/subfiles/chap_ZDF.tex	(revision 11543)
@@ -18,5 +18,5 @@
 % ================================================================
 \section{Vertical mixing}
-\label{sec:ZDF_zdf}
+\label{sec:ZDF}
 
 The discrete form of the ocean subgrid scale physics has been presented in
@@ -41,5 +41,5 @@
 %(namelist parameter \np{ln\_zdfexp}\forcode{=.true.}) or a backward time stepping scheme
 %(\np{ln\_zdfexp}\forcode{=.false.}) depending on the magnitude of the mixing coefficients,
-%and thus of the formulation used (see \autoref{chap:STP}).
+%and thus of the formulation used (see \autoref{chap:TD}).
 
 %--------------------------------------------namzdf--------------------------------------------------------
@@ -92,5 +92,5 @@
 Following \citet{pacanowski.philander_JPO81}, the following formulation has been implemented:
 \[
-  % \label{eq:zdfric}
+  % \label{eq:ZDF_ric}
   \left\{
     \begin{aligned}
@@ -151,5 +151,5 @@
 its destruction through stratification, its vertical diffusion, and its dissipation of \citet{kolmogorov_IANS42} type:
 \begin{equation}
-  \label{eq:zdftke_e}
+  \label{eq:ZDF_tke_e}
   \frac{\partial \bar{e}}{\partial t} =
   \frac{K_m}{{e_3}^2 }\;\left[ {\left( {\frac{\partial u}{\partial k}} \right)^2
@@ -161,5 +161,5 @@
 \end{equation}
 \[
-  % \label{eq:zdftke_kz}
+  % \label{eq:ZDF_tke_kz}
   \begin{split}
     K_m &= C_k\  l_k\  \sqrt {\bar{e}\; }  	\\
@@ -175,5 +175,5 @@
 $P_{rt}$ can be set to unity or, following \citet{blanke.delecluse_JPO93}, be a function of the local Richardson number, $R_i$:
 \begin{align*}
-  % \label{eq:prt}
+  % \label{eq:ZDF_prt}
   P_{rt} =
   \begin{cases}
@@ -208,5 +208,5 @@
 The first two are based on the following first order approximation \citep{blanke.delecluse_JPO93}:
 \begin{equation}
-  \label{eq:tke_mxl0_1}
+  \label{eq:ZDF_tke_mxl0_1}
   l_k = l_\epsilon = \sqrt {2 \bar{e}\; } / N
 \end{equation}
@@ -219,11 +219,11 @@
 To overcome these drawbacks, \citet{madec.delecluse.ea_NPM98} introduces the \np{nn\_mxl}\forcode{=2, 3} cases,
 which add an extra assumption concerning the vertical gradient of the computed length scale.
-So, the length scales are first evaluated as in \autoref{eq:tke_mxl0_1} and then bounded such that:
+So, the length scales are first evaluated as in \autoref{eq:ZDF_tke_mxl0_1} and then bounded such that:
 \begin{equation}
-  \label{eq:tke_mxl_constraint}
+  \label{eq:ZDF_tke_mxl_constraint}
   \frac{1}{e_3 }\left| {\frac{\partial l}{\partial k}} \right| \leq 1
   \qquad \text{with }\  l =  l_k = l_\epsilon
 \end{equation}
-\autoref{eq:tke_mxl_constraint} means that the vertical variations of the length scale cannot be larger than
+\autoref{eq:ZDF_tke_mxl_constraint} means that the vertical variations of the length scale cannot be larger than
 the variations of depth.
 It provides a better approximation of the \citet{gaspar.gregoris.ea_JGR90} formulation while being much less
@@ -231,6 +231,6 @@
 In particular, it allows the length scale to be limited not only by the distance to the surface or
 to the ocean bottom but also by the distance to a strongly stratified portion of the water column such as
-the thermocline (\autoref{fig:mixing_length}).
-In order to impose the \autoref{eq:tke_mxl_constraint} constraint, we introduce two additional length scales:
+the thermocline (\autoref{fig:ZDF_mixing_length}).
+In order to impose the \autoref{eq:ZDF_tke_mxl_constraint} constraint, we introduce two additional length scales:
 $l_{up}$ and $l_{dwn}$, the upward and downward length scales, and
 evaluate the dissipation and mixing length scales as
@@ -241,5 +241,5 @@
     \includegraphics[width=\textwidth]{Fig_mixing_length}
     \caption{
-      \protect\label{fig:mixing_length}
+      \protect\label{fig:ZDF_mixing_length}
       Illustration of the mixing length computation.
     }
@@ -248,5 +248,5 @@
 %>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 \[
-  % \label{eq:tke_mxl2}
+  % \label{eq:ZDF_tke_mxl2}
   \begin{aligned}
     l_{up\ \ }^{(k)} &= \min \left(  l^{(k)} \ , \ l_{up}^{(k+1)} + e_{3t}^{(k)}\ \ \ \;  \right)
@@ -256,5 +256,5 @@
   \end{aligned}
 \]
-where $l^{(k)}$ is computed using \autoref{eq:tke_mxl0_1}, \ie\ $l^{(k)} = \sqrt {2 {\bar e}^{(k)} / {N^2}^{(k)} }$.
+where $l^{(k)}$ is computed using \autoref{eq:ZDF_tke_mxl0_1}, \ie\ $l^{(k)} = \sqrt {2 {\bar e}^{(k)} / {N^2}^{(k)} }$.
 
 In the \np{nn\_mxl}\forcode{=2} case, the dissipation and mixing length scales take the same value:
@@ -262,5 +262,5 @@
 the dissipation and mixing turbulent length scales are give as in \citet{gaspar.gregoris.ea_JGR90}:
 \[
-  % \label{eq:tke_mxl_gaspar}
+  % \label{eq:ZDF_tke_mxl_gaspar}
   \begin{aligned}
     & l_k          = \sqrt{\  l_{up} \ \ l_{dwn}\ }  	\\
@@ -325,5 +325,5 @@
 The parameterization, tuned against large-eddy simulation, includes the whole effect of LC in
 an extra source term of TKE, $P_{LC}$.
-The presence of $P_{LC}$ in \autoref{eq:zdftke_e}, the TKE equation, is controlled by setting \np{ln\_lc} to
+The presence of $P_{LC}$ in \autoref{eq:ZDF_tke_e}, the TKE equation, is controlled by setting \np{ln\_lc} to
 \forcode{.true.} in the \nam{zdf\_tke} namelist.
 
@@ -428,10 +428,10 @@
 $\psi$ \citep{umlauf.burchard_JMR03, umlauf.burchard_CSR05}.
 This later variable is defined as: $\psi = {C_{0\mu}}^{p} \ {\bar{e}}^{m} \ l^{n}$,
-where the triplet $(p, m, n)$ value given in Tab.\autoref{tab:GLS} allows to recover a number of
+where the triplet $(p, m, n)$ value given in Tab.\autoref{tab:ZDF_GLS} allows to recover a number of
 well-known turbulent closures ($k$-$kl$ \citep{mellor.yamada_RG82}, $k$-$\epsilon$ \citep{rodi_JGR87},
 $k$-$\omega$ \citep{wilcox_AJ88} among others \citep{umlauf.burchard_JMR03,kantha.carniel_JMR03}).
 The GLS scheme is given by the following set of equations:
 \begin{equation}
-  \label{eq:zdfgls_e}
+  \label{eq:ZDF_gls_e}
   \frac{\partial \bar{e}}{\partial t} =
   \frac{K_m}{\sigma_e e_3 }\;\left[ {\left( \frac{\partial u}{\partial k} \right)^2
@@ -443,5 +443,5 @@
 
 \[
-  % \label{eq:zdfgls_psi}
+  % \label{eq:ZDF_gls_psi}
   \begin{split}
     \frac{\partial \psi}{\partial t} =& \frac{\psi}{\bar{e}} \left\{
@@ -455,5 +455,5 @@
 
 \[
-  % \label{eq:zdfgls_kz}
+  % \label{eq:ZDF_gls_kz}
   \begin{split}
     K_m    &= C_{\mu} \ \sqrt {\bar{e}} \ l         \\
@@ -463,5 +463,5 @@
 
 \[
-  % \label{eq:zdfgls_eps}
+  % \label{eq:ZDF_gls_eps}
   {\epsilon} = C_{0\mu} \,\frac{\bar {e}^{3/2}}{l} \;
 \]
@@ -470,5 +470,5 @@
 The constants $C_1$, $C_2$, $C_3$, ${\sigma_e}$, ${\sigma_{\psi}}$ and the wall function ($Fw$) depends of
 the choice of the turbulence model.
-Four different turbulent models are pre-defined (\autoref{tab:GLS}).
+Four different turbulent models are pre-defined (\autoref{tab:ZDF_GLS}).
 They are made available through the \np{nn\_clo} namelist parameter.
 
@@ -495,5 +495,5 @@
     \end{tabular}
     \caption{
-      \protect\label{tab:GLS}
+      \protect\label{tab:ZDF_GLS}
       Set of predefined GLS parameters, or equivalently predefined turbulence models available with
       \protect\np{ln\_zdfgls}\forcode{=.true.} and controlled by the \protect\np{nn\_clos} namelist variable in \protect\nam{zdf\_gls}.
@@ -559,5 +559,5 @@
     \includegraphics[width=\textwidth]{Fig_ZDF_TKE_time_scheme}
     \caption{
-      \protect\label{fig:TKE_time_scheme}
+      \protect\label{fig:ZDF_TKE_time_scheme}
       Illustration of the subgrid kinetic energy integration in GLS and TKE schemes and its links to the momentum and tracer time integration.
     }
@@ -567,10 +567,10 @@
 
 The production of turbulence by vertical shear (the first term of the right hand side of
-\autoref{eq:zdftke_e}) and  \autoref{eq:zdfgls_e}) should balance the loss of kinetic energy associated with the vertical momentum diffusion
-(first line in \autoref{eq:PE_zdf}).
+\autoref{eq:ZDF_tke_e}) and  \autoref{eq:ZDF_gls_e}) should balance the loss of kinetic energy associated with the vertical momentum diffusion
+(first line in \autoref{eq:MB_zdf}).
 To do so a special care has to be taken for both the time and space discretization of
 the kinetic energy equation \citep{burchard_OM02,marsaleix.auclair.ea_OM08}.
 
-Let us first address the time stepping issue. \autoref{fig:TKE_time_scheme} shows how
+Let us first address the time stepping issue. \autoref{fig:ZDF_TKE_time_scheme} shows how
 the two-level Leap-Frog time stepping of the momentum and tracer equations interplays with
 the one-level forward time stepping of the equation for $\bar{e}$.
@@ -579,5 +579,5 @@
 summing the result vertically:
 \begin{equation}
-  \label{eq:energ1}
+  \label{eq:ZDF_energ1}
   \begin{split}
     \int_{-H}^{\eta}  u^t \,\partial_z &\left( {K_m}^t \,(\partial_z u)^{t+\rdt}  \right) \,dz   \\
@@ -587,11 +587,11 @@
 \end{equation}
 Here, the vertical diffusion of momentum is discretized backward in time with a coefficient, $K_m$,
-known at time $t$ (\autoref{fig:TKE_time_scheme}), as it is required when using the TKE scheme
-(see \autoref{sec:STP_forward_imp}).
-The first term of the right hand side of \autoref{eq:energ1} represents the kinetic energy transfer at
+known at time $t$ (\autoref{fig:ZDF_TKE_time_scheme}), as it is required when using the TKE scheme
+(see \autoref{sec:TD_forward_imp}).
+The first term of the right hand side of \autoref{eq:ZDF_energ1} represents the kinetic energy transfer at
 the surface (atmospheric forcing) and at the bottom (friction effect).
 The second term is always negative.
 It is the dissipation rate of kinetic energy, and thus minus the shear production rate of $\bar{e}$.
-\autoref{eq:energ1} implies that, to be energetically consistent,
+\autoref{eq:ZDF_energ1} implies that, to be energetically consistent,
 the production rate of $\bar{e}$ used to compute $(\bar{e})^t$ (and thus ${K_m}^t$) should be expressed as
 ${K_m}^{t-\rdt}\,(\partial_z u)^{t-\rdt} \,(\partial_z u)^t$
@@ -599,10 +599,10 @@
 
 A similar consideration applies on the destruction rate of $\bar{e}$ due to stratification
-(second term of the right hand side of \autoref{eq:zdftke_e} and \autoref{eq:zdfgls_e}).
+(second term of the right hand side of \autoref{eq:ZDF_tke_e} and \autoref{eq:ZDF_gls_e}).
 This term must balance the input of potential energy resulting from vertical mixing.
 The rate of change of potential energy (in 1D for the demonstration) due to vertical mixing is obtained by
 multiplying the vertical density diffusion tendency by $g\,z$ and and summing the result vertically:
 \begin{equation}
-  \label{eq:energ2}
+  \label{eq:ZDF_energ2}
   \begin{split}
     \int_{-H}^{\eta} g\,z\,\partial_z &\left( {K_\rho}^t \,(\partial_k \rho)^{t+\rdt}   \right) \,dz    \\
@@ -614,15 +614,15 @@
 \end{equation}
 where we use $N^2 = -g \,\partial_k \rho / (e_3 \rho)$.
-The first term of the right hand side of \autoref{eq:energ2} is always zero because
+The first term of the right hand side of \autoref{eq:ZDF_energ2} is always zero because
 there is no diffusive flux through the ocean surface and bottom).
 The second term is minus the destruction rate of  $\bar{e}$ due to stratification.
-Therefore \autoref{eq:energ1} implies that, to be energetically consistent,
-the product ${K_\rho}^{t-\rdt}\,(N^2)^t$ should be used in \autoref{eq:zdftke_e} and  \autoref{eq:zdfgls_e}.
+Therefore \autoref{eq:ZDF_energ1} implies that, to be energetically consistent,
+the product ${K_\rho}^{t-\rdt}\,(N^2)^t$ should be used in \autoref{eq:ZDF_tke_e} and  \autoref{eq:ZDF_gls_e}.
 
 Let us now address the space discretization issue.
 The vertical eddy coefficients are defined at $w$-point whereas the horizontal velocity components are in
-the centre of the side faces of a $t$-box in staggered C-grid (\autoref{fig:cell}).
+the centre of the side faces of a $t$-box in staggered C-grid (\autoref{fig:DOM_cell}).
 A space averaging is thus required to obtain the shear TKE production term.
-By redoing the \autoref{eq:energ1} in the 3D case, it can be shown that the product of eddy coefficient by
+By redoing the \autoref{eq:ZDF_energ1} in the 3D case, it can be shown that the product of eddy coefficient by
 the shear at $t$ and $t-\rdt$ must be performed prior to the averaging.
 Furthermore, the time variation of $e_3$ has be taken into account.
@@ -630,5 +630,5 @@
 The above energetic considerations leads to the following final discrete form for the TKE equation:
 \begin{equation}
-  \label{eq:zdftke_ene}
+  \label{eq:ZDF_tke_ene}
   \begin{split}
     \frac { (\bar{e})^t - (\bar{e})^{t-\rdt} } {\rdt}  \equiv
@@ -647,9 +647,9 @@
   \end{split}
 \end{equation}
-where the last two terms in \autoref{eq:zdftke_ene} (vertical diffusion and Kolmogorov dissipation)
-are time stepped using a backward scheme (see\autoref{sec:STP_forward_imp}).
+where the last two terms in \autoref{eq:ZDF_tke_ene} (vertical diffusion and Kolmogorov dissipation)
+are time stepped using a backward scheme (see\autoref{sec:TD_forward_imp}).
 Note that the Kolmogorov term has been linearized in time in order to render the implicit computation possible.
 %The restart of the TKE scheme requires the storage of $\bar {e}$, $K_m$, $K_\rho$ and $l_\epsilon$ as
-%they all appear in the right hand side of \autoref{eq:zdftke_ene}.
+%they all appear in the right hand side of \autoref{eq:ZDF_tke_ene}.
 %For the latter, it is in fact the ratio $\sqrt{\bar{e}}/l_\epsilon$ which is stored.
 
@@ -679,5 +679,5 @@
     \includegraphics[width=\textwidth]{Fig_npc}
     \caption{
-      \protect\label{fig:npc}
+      \protect\label{fig:ZDF_npc}
       Example of an unstable density profile treated by the non penetrative convective adjustment algorithm.
       $1^{st}$ step: the initial profile is checked from the surface to the bottom.
@@ -702,5 +702,5 @@
 (\ie\ until the mixed portion of the water column has \textit{exactly} the density of the water just below)
 \citep{madec.delecluse.ea_JPO91}.
-The associated algorithm is an iterative process used in the following way (\autoref{fig:npc}):
+The associated algorithm is an iterative process used in the following way (\autoref{fig:ZDF_npc}):
 starting from the top of the ocean, the first instability is found.
 Assume in the following that the instability is located between levels $k$ and $k+1$.
@@ -759,5 +759,5 @@
 Note that the stability test is performed on both \textit{before} and \textit{now} values of $N^2$.
 This removes a potential source of divergence of odd and even time step in
-a leapfrog environment \citep{leclair_phd10} (see \autoref{sec:STP_mLF}).
+a leapfrog environment \citep{leclair_phd10} (see \autoref{sec:TD_mLF}).
 
 % -------------------------------------------------------------------------------------------------------------
@@ -772,5 +772,5 @@
 with statically unstable density profiles.
 In such a case, the term corresponding to the destruction of turbulent kinetic energy through stratification in
-\autoref{eq:zdftke_e} or \autoref{eq:zdfgls_e} becomes a source term, since $N^2$ is negative.
+\autoref{eq:ZDF_tke_e} or \autoref{eq:ZDF_gls_e} becomes a source term, since $N^2$ is negative.
 It results in large values of $A_T^{vT}$ and  $A_T^{vT}$, and also of the four neighboring values at
 velocity points $A_u^{vm} {and}\;A_v^{vm}$ (up to $1\;m^2s^{-1}$).
@@ -814,5 +814,5 @@
 Diapycnal mixing of S and T are described by diapycnal diffusion coefficients
 \begin{align*}
-  % \label{eq:zdfddm_Kz}
+  % \label{eq:ZDF_ddm_Kz}
   &A^{vT} = A_o^{vT}+A_f^{vT}+A_d^{vT}	\\
   &A^{vS} = A_o^{vS}+A_f^{vS}+A_d^{vS}
@@ -826,5 +826,5 @@
 (1981):
 \begin{align}
-  \label{eq:zdfddm_f}
+  \label{eq:ZDF_ddm_f}
   A_f^{vS} &=
              \begin{cases}
@@ -832,5 +832,5 @@
                0 				  					    &\text{otherwise}
              \end{cases}
-  \\ 		    \label{eq:zdfddm_f_T}
+  \\ 		    \label{eq:ZDF_ddm_f_T}
   A_f^{vT} &= 0.7 \ A_f^{vS} / R_\rho
 \end{align}
@@ -841,5 +841,5 @@
     \includegraphics[width=\textwidth]{Fig_zdfddm}
     \caption{
-      \protect\label{fig:zdfddm}
+      \protect\label{fig:ZDF_ddm}
       From \citet{merryfield.holloway.ea_JPO99} :
       (a) Diapycnal diffusivities $A_f^{vT}$ and $A_f^{vS}$ for temperature and salt in regions of salt fingering.
@@ -854,5 +854,5 @@
 %>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 
-The factor 0.7 in \autoref{eq:zdfddm_f_T} reflects the measured ratio $\alpha F_T /\beta F_S \approx  0.7$ of
+The factor 0.7 in \autoref{eq:ZDF_ddm_f_T} reflects the measured ratio $\alpha F_T /\beta F_S \approx  0.7$ of
 buoyancy flux of heat to buoyancy flux of salt (\eg, \citet{mcdougall.taylor_JMR84}).
 Following  \citet{merryfield.holloway.ea_JPO99}, we adopt $R_c = 1.6$, $n = 6$, and $A^{\ast v} = 10^{-4}~m^2.s^{-1}$.
@@ -861,5 +861,5 @@
 Federov (1988) is used:
 \begin{align}
-  % \label{eq:zdfddm_d}
+  % \label{eq:ZDF_ddm_d}
   A_d^{vT} &=
              \begin{cases}
@@ -869,5 +869,5 @@
              \end{cases}
                                        \nonumber \\
-  \label{eq:zdfddm_d_S}
+  \label{eq:ZDF_ddm_d_S}
   A_d^{vS} &=
              \begin{cases}
@@ -878,6 +878,6 @@
 \end{align}
 
-The dependencies of \autoref{eq:zdfddm_f} to \autoref{eq:zdfddm_d_S} on $R_\rho$ are illustrated in
-\autoref{fig:zdfddm}.
+The dependencies of \autoref{eq:ZDF_ddm_f} to \autoref{eq:ZDF_ddm_d_S} on $R_\rho$ are illustrated in
+\autoref{fig:ZDF_ddm}.
 Implementing this requires computing $R_\rho$ at each grid point on every time step.
 This is done in \mdl{eosbn2} at the same time as $N^2$ is computed.
@@ -891,5 +891,5 @@
  \label{sec:ZDF_drg}
 
-%--------------------------------------------nambfr--------------------------------------------------------
+%--------------------------------------------namdrg--------------------------------------------------------
 %
 \nlst{namdrg}
@@ -910,5 +910,5 @@
 For the bottom boundary layer, one has:
  \[
-   % \label{eq:zdfbfr_flux}
+   % \label{eq:ZDF_bfr_flux}
    A^{vm} \left( \partial {\textbf U}_h / \partial z \right) = {{\cal F}}_h^{\textbf U}
  \]
@@ -926,5 +926,5 @@
 To illustrate this, consider the equation for $u$ at $k$, the last ocean level:
 \begin{equation}
-  \label{eq:zdfdrg_flux2}
+  \label{eq:ZDF_drg_flux2}
   \frac{\partial u_k}{\partial t} = \frac{1}{e_{3u}} \left[ \frac{A_{uw}^{vm}}{e_{3uw}} \delta_{k+1/2}\;[u] - {\cal F}^u_h \right] \approx - \frac{{\cal F}^u_{h}}{e_{3u}}
 \end{equation}
@@ -946,5 +946,5 @@
  These coefficients are computed in \mdl{zdfdrg} and generally take the form $c_b^{\textbf U}$ where:
 \begin{equation}
-  \label{eq:zdfbfr_bdef}
+  \label{eq:ZDF_bfr_bdef}
   \frac{\partial {\textbf U_h}}{\partial t} =
   - \frac{{\cal F}^{\textbf U}_{h}}{e_{3u}} = \frac{c_b^{\textbf U}}{e_{3u}} \;{\textbf U}_h^b
@@ -963,5 +963,5 @@
 the friction is proportional to the interior velocity (\ie\ the velocity of the first/last model level):
 \[
-  % \label{eq:zdfbfr_linear}
+  % \label{eq:ZDF_bfr_linear}
   {\cal F}_h^\textbf{U} = \frac{A^{vm}}{e_3} \; \frac{\partial \textbf{U}_h}{\partial k} = r \; \textbf{U}_h^b
 \]
@@ -978,7 +978,7 @@
 It can be changed by specifying \np{rn\_Uc0} (namelist parameter).
 
- For the linear friction case the drag coefficient used in the general expression \autoref{eq:zdfbfr_bdef} is:
-\[
-  % \label{eq:zdfbfr_linbfr_b}
+ For the linear friction case the drag coefficient used in the general expression \autoref{eq:ZDF_bfr_bdef} is:
+\[
+  % \label{eq:ZDF_bfr_linbfr_b}
     c_b^T = - r
 \]
@@ -1002,5 +1002,5 @@
 The non-linear bottom friction parameterisation assumes that the top/bottom friction is quadratic:
 \[
-  % \label{eq:zdfdrg_nonlinear}
+  % \label{eq:ZDF_drg_nonlinear}
   {\cal F}_h^\textbf{U} = \frac{A^{vm}}{e_3 }\frac{\partial \textbf {U}_h
   }{\partial k}=C_D \;\sqrt {u_b ^2+v_b ^2+e_b } \;\; \textbf {U}_h^b
@@ -1018,5 +1018,5 @@
 For the non-linear friction case the term computed in \mdl{zdfdrg} is:
 \[
-  % \label{eq:zdfdrg_nonlinbfr}
+  % \label{eq:ZDF_drg_nonlinbfr}
     c_b^T = - \; C_D\;\left[ \left(\bar{u_b}^{i}\right)^2 + \left(\bar{v_b}^{j}\right)^2 + e_b \right]^{1/2}
 \]
@@ -1077,7 +1077,7 @@
 
 Since this is conditionally stable, some care needs to exercised over the choice of parameters to ensure that the implementation of explicit top/bottom friction does not induce numerical instability.
-For the purposes of stability analysis, an approximation to \autoref{eq:zdfdrg_flux2} is:
+For the purposes of stability analysis, an approximation to \autoref{eq:ZDF_drg_flux2} is:
 \begin{equation}
-  \label{eq:Eqn_drgstab}
+  \label{eq:ZDF_Eqn_drgstab}
   \begin{split}
     \Delta u &= -\frac{{{\cal F}_h}^u}{e_{3u}}\;2 \rdt    \\
@@ -1090,5 +1090,5 @@
   |\Delta u| < \;|u|
 \]
-\noindent which, using \autoref{eq:Eqn_drgstab}, gives:
+\noindent which, using \autoref{eq:ZDF_Eqn_drgstab}, gives:
 \[
   r\frac{2\rdt}{e_{3u}} < 1 \qquad  \Rightarrow \qquad r < \frac{e_{3u}}{2\rdt}\\
@@ -1133,5 +1133,5 @@
 At the top (below an ice shelf cavity):
 \[
-  % \label{eq:dynzdf_drg_top}
+  % \label{eq:ZDF_dynZDF__drg_top}
   \left.{\left( {\frac{A^{vm} }{e_3 }\ \frac{\partial \textbf{U}_h}{\partial k}} \right)} \right|_{t}
   = c_{t}^{\textbf{U}}\textbf{u}^{n+1}_{t}
@@ -1140,5 +1140,5 @@
 At the bottom (above the sea floor):
 \[
-  % \label{eq:dynzdf_drg_bot}
+  % \label{eq:ZDF_dynZDF__drg_bot}
   \left.{\left( {\frac{A^{vm} }{e_3 }\ \frac{\partial \textbf{U}_h}{\partial k}} \right)} \right|_{b}
   = c_{b}^{\textbf{U}}\textbf{u}^{n+1}_{b}
@@ -1183,5 +1183,5 @@
 and the resulting diffusivity is obtained as
 \[
-  % \label{eq:Kwave}
+  % \label{eq:ZDF_Kwave}
   A^{vT}_{wave} =  R_f \,\frac{ \epsilon }{ \rho \, N^2 }
 \]
@@ -1242,5 +1242,5 @@
 
 \begin{equation}
-  \label{eq:Bv}
+  \label{eq:ZDF_Bv}
   B_{v} = \alpha {A} {U}_{st} {exp(3kz)}
 \end{equation}
@@ -1276,5 +1276,5 @@
 criteria for a range of advection schemes. The values for the Leap-Frog with Robert
 asselin filter time-stepping (as used in NEMO) are reproduced in
-\autoref{tab:zad_Aimp_CFLcrit}. Treating the vertical advection implicitly can avoid these
+\autoref{tab:ZDF_zad_Aimp_CFLcrit}. Treating the vertical advection implicitly can avoid these
 restrictions but at the cost of large dispersive errors and, possibly, large numerical
 viscosity. The adaptive-implicit vertical advection option provides a targetted use of the
@@ -1296,5 +1296,5 @@
     \end{tabular}
     \caption{
-      \protect\label{tab:zad_Aimp_CFLcrit}
+      \protect\label{tab:ZDF_zad_Aimp_CFLcrit}
       The advective CFL criteria for a range of spatial discretizations for the Leap-Frog with Robert Asselin filter time-stepping
       ($\nu=0.1$) as given in \citep{lemarie.debreu.ea_OM15}.
@@ -1313,5 +1313,5 @@
 
 \begin{equation}
-  \label{eq:Eqn_zad_Aimp_Courant}
+  \label{eq:ZDF_Eqn_zad_Aimp_Courant}
   \begin{split}
     Cu &= {2 \rdt \over e^n_{3t_{ijk}}} \bigg (\big [ \texttt{Max}(w^n_{ijk},0.0) - \texttt{Min}(w^n_{ijk+1},0.0) \big ]    \\
@@ -1326,5 +1326,5 @@
 
 \begin{align}
-  \label{eq:Eqn_zad_Aimp_partition}
+  \label{eq:ZDF_Eqn_zad_Aimp_partition}
 Cu_{min} &= 0.15 \nonumber \\
 Cu_{max} &= 0.3  \nonumber \\
@@ -1343,5 +1343,5 @@
     \includegraphics[width=\textwidth]{Fig_ZDF_zad_Aimp_coeff}
     \caption{
-      \protect\label{fig:zad_Aimp_coeff}
+      \protect\label{fig:ZDF_zad_Aimp_coeff}
       The value of the partitioning coefficient ($C\kern-0.14em f$) used to partition vertical velocities into parts to
       be treated implicitly and explicitly for a range of typical Courant numbers (\forcode{ln_zad_Aimp=.true.})
@@ -1355,16 +1355,16 @@
 
 \begin{align}
-  \label{eq:Eqn_zad_Aimp_partition2}
+  \label{eq:ZDF_Eqn_zad_Aimp_partition2}
     w_{i_{ijk}} &= C\kern-0.14em f_{ijk} w_{n_{ijk}}     \nonumber \\
-    w_{n_{ijk}} &= (1-C\kern-0.14em f_{ijk}) w_{n_{ijk}}           
+    w_{n_{ijk}} &= (1-C\kern-0.14em f_{ijk}) w_{n_{ijk}}
 \end{align}
 
 \noindent Note that the coefficient is such that the treatment is never fully implicit;
-the three cases from \autoref{eq:Eqn_zad_Aimp_partition} can be considered as:
+the three cases from \autoref{eq:ZDF_Eqn_zad_Aimp_partition} can be considered as:
 fully-explicit; mixed explicit/implicit and mostly-implicit.  With the settings shown the
-coefficient ($C\kern-0.14em f$) varies as shown in \autoref{fig:zad_Aimp_coeff}. Note with these values
+coefficient ($C\kern-0.14em f$) varies as shown in \autoref{fig:ZDF_zad_Aimp_coeff}. Note with these values
 the $Cu_{cut}$ boundary between the mixed implicit-explicit treatment and 'mostly
 implicit' is 0.45 which is just below the stability limited given in
-\autoref{tab:zad_Aimp_CFLcrit}  for a 3rd order scheme.
+\autoref{tab:ZDF_zad_Aimp_CFLcrit}  for a 3rd order scheme.
 
 The $w_i$ component is added to the implicit solvers for the vertical mixing in
@@ -1376,5 +1376,5 @@
 vertical fluxes are then removed since they are added by the implicit solver later on.
 
-The adaptive-implicit vertical advection option is new to NEMO at v4.0 and has yet to be 
+The adaptive-implicit vertical advection option is new to NEMO at v4.0 and has yet to be
 used in a wide range of simulations. The following test simulation, however, does illustrate
 the potential benefits and will hopefully encourage further testing and feedback from users:
@@ -1384,5 +1384,5 @@
     \includegraphics[width=\textwidth]{Fig_ZDF_zad_Aimp_overflow_frames}
     \caption{
-      \protect\label{fig:zad_Aimp_overflow_frames}
+      \protect\label{fig:ZDF_zad_Aimp_overflow_frames}
       A time-series of temperature vertical cross-sections for the OVERFLOW test case. These results are for the default
       settings with \forcode{nn_rdt=10.0} and without adaptive implicit vertical advection (\forcode{ln_zad_Aimp=.false.}).
@@ -1408,5 +1408,5 @@
 \noindent which were chosen to provide a slightly more stable and less noisy solution. The
 result when using the default value of \forcode{nn_rdt=10.} without adaptive-implicit
-vertical velocity is illustrated in \autoref{fig:zad_Aimp_overflow_frames}. The mass of
+vertical velocity is illustrated in \autoref{fig:ZDF_zad_Aimp_overflow_frames}. The mass of
 cold water, initially sitting on the shelf, moves down the slope and forms a
 bottom-trapped, dense plume. Even with these extra physics choices the model is close to
@@ -1418,5 +1418,5 @@
 
 The results with \forcode{ln_zad_Aimp=.true.} and a variety of model timesteps
-are shown in \autoref{fig:zad_Aimp_overflow_all_rdt} (together with the equivalent
+are shown in \autoref{fig:ZDF_zad_Aimp_overflow_all_rdt} (together with the equivalent
 frames from the base run).  In this simple example the use of the adaptive-implicit
 vertcal advection scheme has enabled a 12x increase in the model timestep without
@@ -1434,5 +1434,5 @@
 \autoref{sec:MISC_opt} for activation details).
 
-\autoref{fig:zad_Aimp_maxCf} shows examples of the maximum partitioning coefficient for
+\autoref{fig:ZDF_zad_Aimp_maxCf} shows examples of the maximum partitioning coefficient for
 the various overflow tests.  Note that the adaptive-implicit vertical advection scheme is
 active even in the base run with \forcode{nn_rdt=10.0s} adding to the evidence that the
@@ -1441,5 +1441,5 @@
 oscillatory nature of this measure appears to be linked to the progress of the plume front
 as each cusp is associated with the location of the maximum shifting to the adjacent cell.
-This is illustrated in \autoref{fig:zad_Aimp_maxCf_loc} where the i- and k- locations of the
+This is illustrated in \autoref{fig:ZDF_zad_Aimp_maxCf_loc} where the i- and k- locations of the
 maximum have been overlaid for the base run case.
 
@@ -1463,6 +1463,6 @@
     \includegraphics[width=\textwidth]{Fig_ZDF_zad_Aimp_overflow_all_rdt}
     \caption{
-      \protect\label{fig:zad_Aimp_overflow_all_rdt}
-      Sample temperature vertical cross-sections from mid- and end-run using different values for \forcode{nn_rdt} 
+      \protect\label{fig:ZDF_zad_Aimp_overflow_all_rdt}
+      Sample temperature vertical cross-sections from mid- and end-run using different values for \forcode{nn_rdt}
       and with or without adaptive implicit vertical advection. Without the adaptive implicit vertical advection only
       the run with the shortest timestep is able to run to completion. Note also that the colour-scale has been
@@ -1476,7 +1476,7 @@
     \includegraphics[width=\textwidth]{Fig_ZDF_zad_Aimp_maxCf}
     \caption{
-      \protect\label{fig:zad_Aimp_maxCf}
+      \protect\label{fig:ZDF_zad_Aimp_maxCf}
       The maximum partitioning coefficient during a series of test runs with increasing model timestep length.
-      At the larger timesteps, the vertical velocity is treated mostly implicitly at some location throughout 
+      At the larger timesteps, the vertical velocity is treated mostly implicitly at some location throughout
       the run.
     }
@@ -1488,7 +1488,7 @@
     \includegraphics[width=\textwidth]{Fig_ZDF_zad_Aimp_maxCf_loc}
     \caption{
-      \protect\label{fig:zad_Aimp_maxCf_loc}
+      \protect\label{fig:ZDF_zad_Aimp_maxCf_loc}
       The maximum partitioning coefficient for the  \forcode{nn_rdt=10.0s} case overlaid with  information on the gridcell i- and k-
-      locations of the maximum value. 
+      locations of the maximum value.
     }
   \end{center}
Index: /NEMO/trunk/doc/latex/NEMO/subfiles/chap_cfgs.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/subfiles/chap_cfgs.tex	(revision 11543)
+++ /NEMO/trunk/doc/latex/NEMO/subfiles/chap_cfgs.tex	(revision 11543)
@@ -0,0 +1,317 @@
+\documentclass[../main/NEMO_manual]{subfiles}
+
+\begin{document}
+% ================================================================
+% Chapter Configurations
+% ================================================================
+\chapter{Configurations}
+\label{chap:CFGS}
+
+\chaptertoc
+
+\newpage
+
+% ================================================================
+% Introduction
+% ================================================================
+\section{Introduction}
+\label{sec:CFGS_intro}
+
+The purpose of this part of the manual is to introduce the \NEMO\ reference configurations.
+These configurations are offered as means to explore various numerical and physical options,
+thus allowing the user to verify that the code is performing in a manner consistent with that we are running.
+This form of verification is critical as one adopts the code for his or her particular research purposes.
+The reference configurations also provide a sense for some of the options available in the code,
+though by no means are all options exercised in the reference configurations.
+Configuration is defined manually through the \nam{cfg} namelist variables.
+
+%------------------------------------------namcfg----------------------------------------------------
+
+\nlst{namcfg}
+%-------------------------------------------------------------------------------------------------------------
+
+% ================================================================
+% 1D model configuration
+% ================================================================
+\section[C1D: 1D Water column model (\texttt{\textbf{key\_c1d}})]
+{C1D: 1D Water column model (\protect\key{c1d})}
+\label{sec:CFGS_c1d}
+
+The 1D model option simulates a stand alone water column within the 3D \NEMO\ system.
+It can be applied to the ocean alone or to the ocean-ice system and can include passive tracers or a biogeochemical model.
+It is set up by defining the position of the 1D water column in the grid
+(see \path{./cfgs/SHARED/namelist\_ref}).
+The 1D model is a very useful tool
+\textit{(a)} to learn about the physics and numerical treatment of vertical mixing processes;
+\textit{(b)} to investigate suitable parameterisations of unresolved turbulence
+(surface wave breaking, Langmuir circulation, ...);
+\textit{(c)} to compare the behaviour of different vertical mixing schemes;
+\textit{(d)} to perform sensitivity studies on the vertical diffusion at a particular point of an ocean domain;
+\textit{(d)} to produce extra diagnostics, without the large memory requirement of the full 3D model.
+
+The methodology is based on the configuration of the smallest possible domain:
+a 3x3 domain with 75 vertical levels.
+
+The 1D model has some specifies. First, all the horizontal derivatives are assumed to be zero,
+and second, the two components of the velocity are moved on a $T$-point.
+Therefore, defining \key{c1d} changes some things in the code behaviour:
+\begin{description}
+\item[(1)]
+  a simplified \rou{stp} routine is used (\rou{stp\_c1d}, see \mdl{step\_c1d} module) in which
+  both lateral tendancy terms and lateral physics are not called;
+\item[(2)]
+  the vertical velocity is zero
+  (so far, no attempt at introducing a Ekman pumping velocity has been made);
+\item[(3)]
+  a simplified treatment of the Coriolis term is performed as $U$- and $V$-points are the same
+  (see \mdl{dyncor\_c1d}).
+\end{description}
+All the relevant \textit{\_c1d} modules can be found in the src/OCE/C1D directory of
+the \NEMO\ distribution.
+
+% to be added:  a test case on the yearlong Ocean Weather Station (OWS) Papa dataset of Martin (1985)
+
+% ================================================================
+% ORCA family configurations
+% ================================================================
+\section{ORCA family: global ocean with tripolar grid}
+\label{sec:CFGS_orca}
+
+The ORCA family is a series of global ocean configurations that are run together with
+the SI3 model (ORCA-ICE) and possibly with PISCES biogeochemical model (ORCA-ICE-PISCES).
+An appropriate namelist is available in \path{./cfgs/ORCA2_ICE_PISCES/EXPREF/namelist_cfg} for ORCA2.
+The domain of ORCA2 configuration is defined in \ifile{ORCA\_R2\_zps\_domcfg} file,
+this file is available in tar file on the \NEMO\ community zenodo platform: \\
+https://doi.org/10.5281/zenodo.2640723
+
+In this namelist\_cfg the name of domain input file is set in \nam{cfg} block of namelist.
+
+%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+\begin{figure}[!t]
+  \begin{center}
+    \includegraphics[width=\textwidth]{Fig_ORCA_NH_mesh}
+    \caption{
+      \protect\label{fig:CFGS_ORCA_msh}
+      ORCA mesh conception.
+      The departure from an isotropic Mercator grid start poleward of 20\deg{N}.
+      The two "north pole" are the foci of a series of embedded ellipses (blue curves) which
+      are determined analytically and form the i-lines of the ORCA mesh (pseudo latitudes).
+      Then, following \citet{madec.imbard_CD96}, the normal to the series of ellipses (red curves) is computed which
+      provides the j-lines of the mesh (pseudo longitudes).
+    }
+  \end{center}
+\end{figure}
+%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+
+% -------------------------------------------------------------------------------------------------------------
+%       ORCA tripolar grid
+% -------------------------------------------------------------------------------------------------------------
+\subsection{ORCA tripolar grid}
+\label{subsec:CFGS_orca_grid}
+
+The ORCA grid is a tripolar grid based on the semi-analytical method of \citet{madec.imbard_CD96}.
+It allows to construct a global orthogonal curvilinear ocean mesh which has no singularity point inside
+the computational domain since two north mesh poles are introduced and placed on lands.
+The method involves defining an analytical set of mesh parallels in the stereographic polar plan,
+computing the associated set of mesh meridians, and projecting the resulting mesh onto the sphere.
+The set of mesh parallels used is a series of embedded ellipses which foci are the two mesh north poles
+(\autoref{fig:CFGS_ORCA_msh}).
+The resulting mesh presents no loss of continuity in either the mesh lines or the scale factors,
+or even the scale factor derivatives over the whole ocean domain, as the mesh is not a composite mesh.
+%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+\begin{figure}[!tbp]
+  \begin{center}
+    \includegraphics[width=\textwidth]{Fig_ORCA_NH_msh05_e1_e2}
+    \includegraphics[width=\textwidth]{Fig_ORCA_aniso}
+    \caption {
+      \protect\label{fig:CFGS_ORCA_e1e2}
+      \textit{Top}: Horizontal scale factors ($e_1$, $e_2$) and
+      \textit{Bottom}: ratio of anisotropy ($e_1 / e_2$)
+      for ORCA 0.5\deg ~mesh.
+      South of 20\deg{N} a Mercator grid is used ($e_1 = e_2$) so that the anisotropy ratio is 1.
+      Poleward of 20\deg{N}, the two "north pole" introduce a weak anisotropy over the ocean areas ($< 1.2$) except in
+      vicinity of Victoria Island (Canadian Arctic Archipelago).
+    }
+  \end{center}
+\end{figure}
+%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+
+The method is applied to Mercator grid (\ie\ same zonal and meridional grid spacing) poleward of 20\deg{N},
+so that the Equator is a mesh line, which provides a better numerical solution for equatorial dynamics.
+The choice of the series of embedded ellipses (position of the foci and variation of the ellipses)
+is a compromise between maintaining the ratio of mesh anisotropy ($e_1 / e_2$) close to one in the ocean
+(especially in area of strong eddy activities such as the Gulf Stream) and keeping the smallest scale factor in
+the northern hemisphere larger than the smallest one in the southern hemisphere.
+The resulting mesh is shown in \autoref{fig:CFGS_ORCA_msh} and \autoref{fig:CFGS_ORCA_e1e2} for
+a half a degree grid (ORCA\_R05).
+The smallest ocean scale factor is found in along Antarctica,
+while the ratio of anisotropy remains close to one except near the Victoria Island in the Canadian Archipelago.
+
+% -------------------------------------------------------------------------------------------------------------
+%       ORCA-ICE(-PISCES) configurations
+% -------------------------------------------------------------------------------------------------------------
+\subsection{ORCA pre-defined resolution}
+\label{subsec:CFGS_orca_resolution}
+
+The \NEMO\ system is provided with five built-in ORCA configurations which differ in the horizontal resolution.
+The value of the resolution is given by the resolution at the Equator expressed in degrees.
+Each of configuration is set through the \textit{domain\_cfg} domain configuration file,
+which sets the grid size and configuration name parameters.
+The \NEMO\ System Team provides only ORCA2 domain input file "\ifile{ORCA\_R2\_zps\_domcfg}" file
+(\autoref{tab:CFGS_ORCA}).
+
+%--------------------------------------------------TABLE--------------------------------------------------
+\begin{table}[!t]
+  \begin{center}
+    \begin{tabular}{p{4cm} c c c c}
+      Horizontal Grid & \jp{ORCA\_index} & \jp{jpiglo} & \jp{jpjglo} \\
+      \hline \hline
+%             4   \deg &              4   &          92 &          76 \\
+             2   \deg &              2   &         182 &         149 \\
+             1   \deg &              1   &         362 &         292 \\
+             0.5 \deg &              05  &         722 &         511 \\
+             0.25\deg &              025 &        1442 &        1021 \\
+      \hline \hline
+    \end{tabular}
+    \caption{
+      \protect\label{tab:CFGS_ORCA}
+      Domain size of ORCA family configurations.
+      The flag for configurations of ORCA family need to be set in \textit{domain\_cfg} file.
+    }
+  \end{center}
+\end{table}
+%--------------------------------------------------------------------------------------------------------------
+
+
+The ORCA\_R2 configuration has the following specificity: starting from a 2\deg\ ORCA mesh,
+local mesh refinements were applied to the Mediterranean, Red, Black and Caspian Seas,
+so that the resolution is 1\deg\ there.
+A local transformation were also applied with in the Tropics in order to refine the meridional resolution up to
+0.5\deg\ at the Equator.
+
+The ORCA\_R1 configuration has only a local tropical transformation to refine the meridional resolution up to
+1/3\deg\ at the Equator.
+Note that the tropical mesh refinements in ORCA\_R2 and R1 strongly increases the mesh anisotropy there.
+
+The ORCA\_R05 and higher global configurations do not incorporate any regional refinements.
+
+For ORCA\_R1 and R025, setting the configuration key to 75 allows to use 75 vertical levels, otherwise 46 are used.
+In the other ORCA configurations, 31 levels are used
+(see \autoref{tab:CFGS_ORCA}). %\sfcomment{HERE I need to put new table for ORCA2 values} and \autoref{fig:DOM_zgr_e3}).
+
+Only the ORCA\_R2 is provided with all its input files in the \NEMO\ distribution.
+%It is very similar to that used as part of the climate model developed at IPSL for the 4th IPCC assessment of
+%climate change (Marti et al., 2009).
+%It is also the basis for the \NEMO\ contribution to the Coordinate Ocean-ice Reference Experiments (COREs)
+%documented in \citet{griffies.biastoch.ea_OM09}.
+
+This version of ORCA\_R2 has 31 levels in the vertical, with the highest resolution (10m) in the upper 150m
+(see \autoref{tab:CFGS_ORCA} and \autoref{fig:DOM_zgr_e3}).
+The bottom topography and the coastlines are derived from the global atlas of Smith and Sandwell (1997).
+The default forcing uses the boundary forcing from \citet{large.yeager_rpt04} (see \autoref{subsec:SBC_blk_ocean}),
+which was developed for the purpose of running global coupled ocean-ice simulations without
+an interactive atmosphere.
+This \citet{large.yeager_rpt04} dataset is available through
+the \href{http://nomads.gfdl.noaa.gov/nomads/forms/mom4/CORE.html}{GFDL web site}.
+The "normal year" of \citet{large.yeager_rpt04} has been chosen of the \NEMO\ distribution since release v3.3.
+
+ORCA\_R2 pre-defined configuration can also be run with multiply online nested zooms (\ie\ with AGRIF, \key{agrif} defined).
+This is available as the AGRIF\_DEMO configuration that can be found in the \path{./cfgs/AGRIF_DEMO/} directory.
+
+A regional Arctic or peri-Antarctic configuration is extracted from an ORCA\_R2 or R05 configurations using
+sponge layers at open boundaries.
+
+% -------------------------------------------------------------------------------------------------------------
+%       GYRE family: double gyre basin
+% -------------------------------------------------------------------------------------------------------------
+\section{GYRE family: double gyre basin}
+\label{sec:CFGS_gyre}
+
+The GYRE configuration \citep{levy.klein.ea_OM10} has been built to
+simulate the seasonal cycle of a double-gyre box model.
+It consists in an idealized domain similar to that used in the studies of \citet{drijfhout_JPO94} and
+\citet{hazeleger.drijfhout_JPO98, hazeleger.drijfhout_JPO99, hazeleger.drijfhout_JGR00, hazeleger.drijfhout_JPO00},
+over which an analytical seasonal forcing is applied.
+This allows to investigate the spontaneous generation of a large number of interacting, transient mesoscale eddies
+and their contribution to the large scale circulation.
+
+The GYRE configuration run together with the PISCES biogeochemical model (GYRE-PISCES).
+The domain geometry is a closed rectangular basin on the $\beta$-plane centred at $\sim$ 30\deg{N} and
+rotated by 45\deg, 3180~km long, 2120~km wide and 4~km deep (\autoref{fig:MISC_strait_hand}).
+The domain is bounded by vertical walls and by a flat bottom.
+The configuration is meant to represent an idealized North Atlantic or North Pacific basin.
+The circulation is forced by analytical profiles of wind and buoyancy fluxes.
+The applied forcings vary seasonally in a sinusoidal manner between winter and summer extrema \citep{levy.klein.ea_OM10}.
+The wind stress is zonal and its curl changes sign at 22\deg{N} and 36\deg{N}.
+It forces a subpolar gyre in the north, a subtropical gyre in the wider part of the domain and
+a small recirculation gyre in the southern corner.
+The net heat flux takes the form of a restoring toward a zonal apparent air temperature profile.
+A portion of the net heat flux which comes from the solar radiation is allowed to penetrate within the water column.
+The fresh water flux is also prescribed and varies zonally.
+It is determined such as, at each time step, the basin-integrated flux is zero.
+The basin is initialised at rest with vertical profiles of temperature and salinity uniformly applied to
+the whole domain.
+
+The GYRE configuration is set like an analytical configuration.
+Through \np{ln\_read\_cfg}\forcode{ = .false.} in \nam{cfg} namelist defined in
+the reference configuration \path{./cfgs/GYRE_PISCES/EXPREF/namelist_cfg}
+analytical definition of grid in GYRE is done in usrdef\_hrg, usrdef\_zgr routines.
+Its horizontal resolution (and thus the size of the domain) is determined by
+setting \np{nn\_GYRE} in \nam{usr\_def}: \\
+
+\jp{jpiglo} $= 30 \times$ \np{nn\_GYRE} + 2   \\
+
+\jp{jpjglo} $= 20 \times$ \np{nn\_GYRE} + 2   \\
+
+Obviously, the namelist parameters have to be adjusted to the chosen resolution,
+see the Configurations pages on the \NEMO\ web site (\NEMO\ Configurations).
+In the vertical, GYRE uses the default 30 ocean levels (\jp{jpk}\forcode{ = 31}) (\autoref{fig:DOM_zgr_e3}).
+
+The GYRE configuration is also used in benchmark test as it is very simple to increase its resolution and
+as it does not requires any input file.
+For example, keeping a same model size on each processor while increasing the number of processor used is very easy,
+even though the physical integrity of the solution can be compromised.
+Benchmark is activate via \np{ln\_bench}\forcode{ = .true.} in \nam{usr\_def} in
+namelist \path{./cfgs/GYRE_PISCES/EXPREF/namelist_cfg}.
+
+%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+\begin{figure}[!t]
+  \begin{center}
+    \includegraphics[width=\textwidth]{Fig_GYRE}
+    \caption{
+      \protect\label{fig:CFGS_GYRE}
+      Snapshot of relative vorticity at the surface of the model domain in GYRE R9, R27 and R54.
+      From \citet{levy.klein.ea_OM10}.
+    }
+  \end{center}
+\end{figure}
+%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+
+% -------------------------------------------------------------------------------------------------------------
+%       AMM configuration
+% -------------------------------------------------------------------------------------------------------------
+\section{AMM: atlantic margin configuration}
+\label{sec:CFGS_config_AMM}
+
+The AMM, Atlantic Margins Model, is a regional model covering the Northwest European Shelf domain on
+a regular lat-lon grid at approximately 12km horizontal resolution.
+The appropriate \textit{\&namcfg} namelist  is available in \path{./cfgs/AMM12/EXPREF/namelist\_cfg}.
+It is used to build the correct dimensions of the AMM domain.
+
+This configuration tests several features of \NEMO\ functionality specific to the shelf seas.
+In particular, the AMM uses $s$-coordinates in the vertical rather than $z$-coordinates and
+is forced with tidal lateral boundary conditions using a Flather boundary condition from the BDY module.
+Also specific to the AMM configuration is the use of the GLS turbulence scheme (\np{ln\_zdfgls} \forcode{= .true.}).
+
+In addition to the tidal boundary condition the model may also take open boundary conditions from
+a North Atlantic model.
+Boundaries may be completely omitted by setting \np{ln\_bdy} to false.
+Sample surface fluxes, river forcing and a sample initial restart file are included to test a realistic model run.
+The Baltic boundary is included within the river input file and is specified as a river source.
+Unlike ordinary river points the Baltic inputs also include salinity and temperature data.
+
+\biblio
+
+\pindex
+
+\end{document}
Index: /NEMO/trunk/doc/latex/NEMO/subfiles/chap_misc.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/subfiles/chap_misc.tex	(revision 11542)
+++ /NEMO/trunk/doc/latex/NEMO/subfiles/chap_misc.tex	(revision 11543)
@@ -110,5 +110,5 @@
     \includegraphics[width=\textwidth]{Fig_closea_mask_example}
     \caption{
-      \protect\label{fig:closea_mask_example}
+      \protect\label{fig:MISC_closea_mask_example}
       Example of mask fields for the closea module. \textit{Left}: a
       closea\_mask field; \textit{Right}: a closea\_mask\_rnf
@@ -159,5 +159,5 @@
 configuration file and ln\_closea=.true. in namelist namcfg.} Each
 inland sea or group of inland seas is set to a positive integer value
-in the closea\_mask field (see Figure \ref{fig:closea_mask_example}
+in the closea\_mask field (see \autoref{fig:MISC_closea_mask_example}
 for an example). The net surface flux over each inland sea or group of
 inland seas is set to zero each timestep and the residual flux is
@@ -174,6 +174,6 @@
 by the closea\_mask\_rnf field. Each mapping is defined by a positive
 integer value for the inland sea(s) and the corresponding runoff
-points. An example is given in Figure
-\ref{fig:closea_mask_example}. If no mapping is provided for a
+points. An example is given in
+\autoref{fig:MISC_closea_mask_example}. If no mapping is provided for a
 particular inland sea then the residual is spread over the global
 ocean.}
Index: /NEMO/trunk/doc/latex/NEMO/subfiles/chap_model_basics.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/subfiles/chap_model_basics.tex	(revision 11542)
+++ /NEMO/trunk/doc/latex/NEMO/subfiles/chap_model_basics.tex	(revision 11543)
@@ -8,5 +8,5 @@
 % ================================================================
 \chapter{Model Basics}
-\label{chap:PE}
+\label{chap:MB}
 
 \chaptertoc
@@ -18,5 +18,5 @@
 % ================================================================
 \section{Primitive equations}
-\label{sec:PE_PE}
+\label{sec:MB_PE}
 
 % -------------------------------------------------------------------------------------------------------------
@@ -25,5 +25,5 @@
 
 \subsection{Vector invariant formulation}
-\label{subsec:PE_Vector}
+\label{subsec:MB_PE_vector}
 
 The ocean is a fluid that can be described to a good approximation by the primitive equations,
@@ -48,5 +48,5 @@
   the buoyancy force
   \begin{equation}
-    \label{eq:PE_eos}
+    \label{eq:MB_PE_eos}
     \rho = \rho \ (T,S,p)
   \end{equation}
@@ -57,5 +57,5 @@
   convective processes must be parameterized instead)
   \begin{equation}
-    \label{eq:PE_hydrostatic}
+    \label{eq:MB_PE_hydrostatic}
     \pd[p]{z} = - \rho \ g
   \end{equation}
@@ -64,5 +64,5 @@
   is assumed to be zero.
   \begin{equation}
-    \label{eq:PE_continuity}
+    \label{eq:MB_PE_continuity}
     \nabla \cdot \vect U = 0
   \end{equation}
@@ -85,15 +85,15 @@
 the following equations:
 \begin{subequations}
-  \label{eq:PE}
+  \label{eq:MB_PE}
   \begin{gather}
     \intertext{$-$ the momentum balance}
-    \label{eq:PE_dyn}
+    \label{eq:MB_PE_dyn}
     \pd[\vect U_h]{t} = - \lt[ (\nabla \times \vect U) \times \vect U + \frac{1}{2} \nabla \lt( \vect U^2 \rt) \rt]_h
                         - f \; k \times \vect U_h - \frac{1}{\rho_o} \nabla_h p
                         + \vect D^{\vect U} + \vect F^{\vect U} \\
     \intertext{$-$ the heat and salt conservation equations}
-    \label{eq:PE_tra_T}
+    \label{eq:MB_PE_tra_T}
     \pd[T]{t} = - \nabla \cdot (T \ \vect U) + D^T + F^T \\
-    \label{eq:PE_tra_S}
+    \label{eq:MB_PE_tra_S}
     \pd[S]{t} = - \nabla \cdot (S \ \vect U) + D^S + F^S
   \end{gather}
@@ -101,10 +101,10 @@
 where $\nabla$ is the generalised derivative vector operator in $(i,j,k)$ directions, $t$ is the time,
 $z$ is the vertical coordinate, $\rho$ is the \textit{in situ} density given by the equation of state
-(\autoref{eq:PE_eos}), $\rho_o$ is a reference density, $p$ the pressure,
+(\autoref{eq:MB_PE_eos}), $\rho_o$ is a reference density, $p$ the pressure,
 $f = 2 \vect \Omega \cdot k$ is the Coriolis acceleration
 (where $\vect \Omega$ is the Earth's angular velocity vector), and $g$ is the gravitational acceleration.
 $\vect D^{\vect U}$, $D^T$ and $D^S$ are the parameterisations of small-scale physics for momentum,
 temperature and salinity, and $\vect F^{\vect U}$, $F^T$ and $F^S$ surface forcing terms.
-Their nature and formulation are discussed in \autoref{sec:PE_zdf_ldf} and \autoref{subsec:PE_boundary_condition}.
+Their nature and formulation are discussed in \autoref{sec:MB_zdf_ldf} and \autoref{subsec:MB_boundary_condition}.
 
 % -------------------------------------------------------------------------------------------------------------
@@ -112,5 +112,5 @@
 % -------------------------------------------------------------------------------------------------------------
 \subsection{Boundary conditions}
-\label{subsec:PE_boundary_condition}
+\label{subsec:MB_boundary_condition}
 
 An ocean is bounded by complex coastlines, bottom topography at its base and
@@ -120,5 +120,5 @@
 (discretisation can introduce additional artificial ``side-wall'' boundaries).
 Both $H$ and $\eta$ are referenced to a surface of constant geopotential (\ie\ a mean sea surface height) on which $z = 0$.
-(\autoref{fig:ocean_bc}).
+(\autoref{fig:MB_ocean_bc}).
 Through these two boundaries, the ocean can exchange fluxes of heat, fresh water, salt, and momentum with
 the solid earth, the continental margins, the sea ice and the atmosphere.
@@ -133,5 +133,5 @@
     \includegraphics[width=\textwidth]{Fig_I_ocean_bc}
     \caption{
-      \protect\label{fig:ocean_bc}
+      \protect\label{fig:MB_ocean_bc}
       The ocean is bounded by two surfaces, $z = - H(i,j)$ and $z = \eta(i,j,t)$,
       where $H$ is the depth of the sea floor and $\eta$ the height of the sea surface.
@@ -164,5 +164,5 @@
   can be expressed as:
   \begin{equation}
-    \label{eq:PE_w_bbc}
+    \label{eq:MB_w_bbc}
     w = - \vect U_h \cdot \nabla_h (H)
   \end{equation}
@@ -171,11 +171,11 @@
   It must be parameterized in terms of turbulent fluxes using bottom and/or lateral boundary conditions.
   Its specification depends on the nature of the physical parameterisation used for
-  $\vect D^{\vect U}$ in \autoref{eq:PE_dyn}.
-  It is discussed in \autoref{eq:PE_zdf}.% and Chap. III.6 to 9.
+  $\vect D^{\vect U}$ in \autoref{eq:MB_PE_dyn}.
+  It is discussed in \autoref{eq:MB_zdf}.% and Chap. III.6 to 9.
 \item[Atmosphere - ocean interface:]
   the kinematic surface condition plus the mass flux of fresh water PE (the precipitation minus evaporation budget)
   leads to:
   \[
-    % \label{eq:PE_w_sbc}
+    % \label{eq:MB_w_sbc}
     w = \pd[\eta]{t} + \lt. \vect U_h \rt|_{z = \eta} \cdot \nabla_h (\eta) + P - E
   \]
@@ -194,5 +194,5 @@
 % ================================================================
 \section{Horizontal pressure gradient}
-\label{sec:PE_hor_pg}
+\label{sec:MB_hor_pg}
 
 % -------------------------------------------------------------------------------------------------------------
@@ -200,14 +200,14 @@
 % -------------------------------------------------------------------------------------------------------------
 \subsection{Pressure formulation}
-\label{subsec:PE_p_formulation}
+\label{subsec:MB_p_formulation}
 
 The total pressure at a given depth $z$ is composed of a surface pressure $p_s$ at
 a reference geopotential surface ($z = 0$) and a hydrostatic pressure $p_h$ such that:
 $p(i,j,k,t) = p_s(i,j,t) + p_h(i,j,k,t)$.
-The latter is computed by integrating (\autoref{eq:PE_hydrostatic}),
-assuming that pressure in decibars can be approximated by depth in meters in (\autoref{eq:PE_eos}).
+The latter is computed by integrating (\autoref{eq:MB_PE_hydrostatic}),
+assuming that pressure in decibars can be approximated by depth in meters in (\autoref{eq:MB_PE_eos}).
 The hydrostatic pressure is then given by:
 \[
-  % \label{eq:PE_pressure}
+  % \label{eq:MB_pressure}
   p_h (i,j,z,t) = \int_{\varsigma = z}^{\varsigma = 0} g \; \rho (T,S,\varsigma) \; d \varsigma
 \]
@@ -234,15 +234,15 @@
 % -------------------------------------------------------------------------------------------------------------
 \subsection{Free surface formulation}
-\label{subsec:PE_free_surface}
+\label{subsec:MB_free_surface}
 
 In the free surface formulation, a variable $\eta$, the sea-surface height,
 is introduced which describes the shape of the air-sea interface.
 This variable is solution of a prognostic equation which is established by forming the vertical average of
-the kinematic surface condition (\autoref{eq:PE_w_bbc}):
+the kinematic surface condition (\autoref{eq:MB_w_bbc}):
 \begin{equation}
-  \label{eq:PE_ssh}
+  \label{eq:MB_ssh}
   \pd[\eta]{t} = - D + P - E \quad \text{where} \quad D = \nabla \cdot \lt[ (H + \eta) \; \overline{U}_h \, \rt]
 \end{equation}
-and using (\autoref{eq:PE_hydrostatic}) the surface pressure is given by: $p_s = \rho \, g \, \eta$.
+and using (\autoref{eq:MB_PE_hydrostatic}) the surface pressure is given by: $p_s = \rho \, g \, \eta$.
 
 Allowing the air-sea interface to move introduces the external gravity waves (EGWs) as
@@ -257,5 +257,5 @@
 the baroclinic structure of the ocean (internal waves) possibly in shallow seas,
 then a non linear free surface is the most appropriate.
-This means that no approximation is made in \autoref{eq:PE_ssh} and that
+This means that no approximation is made in \autoref{eq:MB_ssh} and that
 the variation of the ocean volume is fully taken into account.
 Note that in order to study the fast time scales associated with EGWs it is necessary to
@@ -268,5 +268,5 @@
 not altering the slow barotropic Rossby waves.
 If further, an approximative conservation of heat and salt contents is sufficient for the problem solved,
-then it is sufficient to solve a linearized version of \autoref{eq:PE_ssh},
+then it is sufficient to solve a linearized version of \autoref{eq:MB_ssh},
 which still allows to take into account freshwater fluxes applied at the ocean surface \citep{roullet.madec_JGR00}.
 Nevertheless, with the linearization, an exact conservation of heat and salt contents is lost.
@@ -286,5 +286,5 @@
 % ================================================================
 \section{Curvilinear \textit{z-}coordinate system}
-\label{sec:PE_zco}
+\label{sec:MB_zco}
 
 % -------------------------------------------------------------------------------------------------------------
@@ -292,5 +292,5 @@
 % -------------------------------------------------------------------------------------------------------------
 \subsection{Tensorial formalism}
-\label{subsec:PE_tensorial}
+\label{subsec:MB_tensorial}
 
 In many ocean circulation problems, the flow field has regions of enhanced dynamics
@@ -315,13 +315,13 @@
 $(i,j,k)$ linked to the earth such that
 $k$ is the local upward vector and $(i,j)$ are two vectors orthogonal to $k$,
-\ie\ along geopotential surfaces (\autoref{fig:referential}).
+\ie\ along geopotential surfaces (\autoref{fig:MB_referential}).
 Let $(\lambda,\varphi,z)$ be the geographical coordinate system in which a position is defined by
 the latitude $\varphi(i,j)$, the longitude $\lambda(i,j)$ and
 the distance from the centre of the earth $a + z(k)$ where $a$ is the earth's radius and
-$z$ the altitude above a reference sea level (\autoref{fig:referential}).
+$z$ the altitude above a reference sea level (\autoref{fig:MB_referential}).
 The local deformation of the curvilinear coordinate system is given by $e_1$, $e_2$ and $e_3$,
 the three scale factors:
 \begin{equation}
-  \label{eq:scale_factors}
+  \label{eq:MB_scale_factors}
   \begin{aligned}
     e_1 &= (a + z) \lt[ \lt( \pd[\lambda]{i} \cos \varphi \rt)^2 + \lt( \pd[\varphi]{i} \rt)^2 \rt]^{1/2} \\
@@ -336,5 +336,5 @@
     \includegraphics[width=\textwidth]{Fig_I_earth_referential}
     \caption{
-      \protect\label{fig:referential}
+      \protect\label{fig:MB_referential}
       the geographical coordinate system $(\lambda,\varphi,z)$ and the curvilinear
       coordinate system $(i,j,k)$.
@@ -345,23 +345,23 @@
 
 Since the ocean depth is far smaller than the earth's radius, $a + z$, can be replaced by $a$ in
-(\autoref{eq:scale_factors}) (thin-shell approximation).
+(\autoref{eq:MB_scale_factors}) (thin-shell approximation).
 The resulting horizontal scale factors $e_1$, $e_2$  are independent of $k$ while
 the vertical scale factor is a single function of $k$ as $k$ is parallel to $z$.
 The scalar and vector operators that appear in the primitive equations
-(\autoref{eq:PE_dyn} to \autoref{eq:PE_eos}) can then be written in the tensorial form,
+(\autoref{eq:MB_PE_dyn} to \autoref{eq:MB_PE_eos}) can then be written in the tensorial form,
 invariant in any orthogonal horizontal curvilinear coordinate system transformation:
 \begin{subequations}
-  % \label{eq:PE_discrete_operators}
+  % \label{eq:MB_discrete_operators}
   \begin{gather}
-    \label{eq:PE_grad}
+    \label{eq:MB_grad}
     \nabla q =   \frac{1}{e_1} \pd[q]{i} \; \vect i
                + \frac{1}{e_2} \pd[q]{j} \; \vect j
                + \frac{1}{e_3} \pd[q]{k} \; \vect k \\
-    \label{eq:PE_div}
+    \label{eq:MB_div}
     \nabla \cdot \vect A =   \frac{1}{e_1 \; e_2} \lt[ \pd[(e_2 \; a_1)]{\partial i} + \pd[(e_1 \; a_2)]{j} \rt]
                            + \frac{1}{e_3} \lt[ \pd[a_3]{k} \rt]
   \end{gather}
   \begin{multline}
-    \label{eq:PE_curl}
+    \label{eq:MB_curl}
       \nabla \times \vect{A} =   \lt[ \frac{1}{e_2} \pd[a_3]{j} - \frac{1}{e_3} \pd[a_2]{k}   \rt] \vect i \\
                                + \lt[ \frac{1}{e_3} \pd[a_1]{k} - \frac{1}{e_1} \pd[a_3]{i}   \rt] \vect j \\
@@ -369,7 +369,7 @@
   \end{multline}
   \begin{gather}
-    \label{eq:PE_lap}
+    \label{eq:MB_lap}
     \Delta q = \nabla \cdot (\nabla q) \\
-    \label{eq:PE_lap_vector}
+    \label{eq:MB_lap_vector}
     \Delta \vect A = \nabla (\nabla \cdot \vect A) - \nabla \times (\nabla \times \vect A)
   \end{gather}
@@ -381,15 +381,15 @@
 % -------------------------------------------------------------------------------------------------------------
 \subsection{Continuous model equations}
-\label{subsec:PE_zco_Eq}
+\label{subsec:MB_zco_Eq}
 
 In order to express the Primitive Equations in tensorial formalism,
 it is necessary to compute the horizontal component of the non-linear and viscous terms of the equation using
-\autoref{eq:PE_grad}) to \autoref{eq:PE_lap_vector}.
+\autoref{eq:MB_grad}) to \autoref{eq:MB_lap_vector}.
 Let us set $\vect U = (u,v,w) = \vect U_h + w \; \vect k $, the velocity in the $(i,j,k)$ coordinates system and
 define the relative vorticity $\zeta$ and the divergence of the horizontal velocity field $\chi$, by:
 \begin{gather}
-  \label{eq:PE_curl_Uh}
+  \label{eq:MB_curl_Uh}
   \zeta = \frac{1}{e_1 e_2} \lt[ \pd[(e_2 \, v)]{i} - \pd[(e_1 \, u)]{j} \rt] \\
-  \label{eq:PE_div_Uh}
+  \label{eq:MB_div_Uh}
   \chi  = \frac{1}{e_1 e_2} \lt[ \pd[(e_2 \, u)]{i} + \pd[(e_1 \, v)]{j} \rt]
 \end{gather}
@@ -397,5 +397,5 @@
 Using again the fact that the horizontal scale factors $e_1$ and $e_2$ are independent of $k$ and that
 $e_3$  is a function of the single variable $k$,
-$NLT$ the nonlinear term of \autoref{eq:PE_dyn} can be transformed as follows:
+$NLT$ the nonlinear term of \autoref{eq:MB_PE_dyn} can be transformed as follows:
 \begin{alignat*}{2}
   &NLT &=   &\lt[ (\nabla \times {\vect U}) \times {\vect U} + \frac{1}{2} \nabla \lt( {\vect U}^2 \rt) \rt]_h \\
@@ -438,7 +438,7 @@
 \end{alignat*}
 The last term of the right hand side is obviously zero, and thus the nonlinear term of
-\autoref{eq:PE_dyn} is written in the $(i,j,k)$ coordinate system:
+\autoref{eq:MB_PE_dyn} is written in the $(i,j,k)$ coordinate system:
 \begin{equation}
-  \label{eq:PE_vector_form}
+  \label{eq:MB_vector_form}
   NLT =   \zeta \; \vect k \times \vect U_h + \frac{1}{2} \nabla_h \lt( \vect U_h^2 \rt)
         + \frac{1}{e_3} w \pd[\vect U_h]{k}
@@ -448,5 +448,5 @@
 For some purposes, it can be advantageous to write this term in the so-called flux form,
 \ie\ to write it as the divergence of fluxes.
-For example, the first component of \autoref{eq:PE_vector_form} (the $i$-component) is transformed as follows:
+For example, the first component of \autoref{eq:MB_vector_form} (the $i$-component) is transformed as follows:
 \begin{alignat*}{2}
   &NLT_i &= &- \zeta \; v + \frac{1}{2 \; e_1} \pd[ (u^2 + v^2) ]{i} + \frac{1}{e_3} w \ \pd[u]{k} \\
@@ -473,5 +473,5 @@
 The flux form of the momentum advection term is therefore given by:
 \begin{equation}
-  \label{eq:PE_flux_form}
+  \label{eq:MB_flux_form}
   NLT =   \nabla \cdot \lt(
     \begin{array}{*{20}c}
@@ -488,5 +488,5 @@
 The latter is called the \textit{metric} term and can be viewed as a modification of the Coriolis parameter:
 \[
-  % \label{eq:PE_cor+metric}
+  % \label{eq:MB_cor+metric}
   f \to f + \frac{1}{e_1 e_2} \lt( v \pd[e_2]{i} - u \pd[e_1]{j} \rt)
 \]
@@ -503,7 +503,7 @@
   \textbf{Vector invariant form of the momentum equations}:
   \begin{equation}
-    \label{eq:PE_dyn_vect}
+    \label{eq:MB_dyn_vect}
     \begin{split}
-    % \label{eq:PE_dyn_vect_u}
+    % \label{eq:MB_dyn_vect_u}
       \pd[u]{t} = &+ (\zeta + f) \, v - \frac{1}{2 e_1} \pd[]{i} (u^2 + v^2)
                    - \frac{1}{e_3} w \pd[u]{k} - \frac{1}{e_1} \pd[]{i} \lt( \frac{p_s + p_h}{\rho_o} \rt) \\
@@ -516,7 +516,7 @@
 \item
   \textbf{flux form of the momentum equations}:
-  % \label{eq:PE_dyn_flux}
+  % \label{eq:MB_dyn_flux}
   \begin{multline*}
-    % \label{eq:PE_dyn_flux_u}
+    % \label{eq:MB_dyn_flux_u}
     \pd[u]{t} = + \lt[ f + \frac{1}{e_1 \; e_2} \lt( v \pd[e_2]{i} - u \pd[e_1]{j} \rt) \rt] \, v \\
                 - \frac{1}{e_1 \; e_2} \lt( \pd[(e_2 \, u \, u)]{i} + \pd[(e_1 \, v \, u)]{j} \rt) \\
@@ -525,5 +525,5 @@
   \end{multline*}
   \begin{multline*}
-    % \label{eq:PE_dyn_flux_v}
+    % \label{eq:MB_dyn_flux_v}
     \pd[v]{t} = - \lt[ f + \frac{1}{e_1 \; e_2} \lt( v \pd[e_2]{i} - u \pd[e_1]{j} \rt) \rt] \, u \\
                 - \frac{1}{e_1 \; e_2} \lt( \pd[(e_2 \, u \, v)]{i} + \pd[(e_1 \, v \, v)]{j} \rt) \\
@@ -531,20 +531,20 @@
                 + D_v^{\vect U} + F_v^{\vect U}
   \end{multline*}
-  where $\zeta$, the relative vorticity, is given by \autoref{eq:PE_curl_Uh} and $p_s$, the surface pressure,
+  where $\zeta$, the relative vorticity, is given by \autoref{eq:MB_curl_Uh} and $p_s$, the surface pressure,
   is given by:
   \[
-  % \label{eq:PE_spg}
+  % \label{eq:MB_spg}
     p_s = \rho \,g \, \eta
   \]
-  and $\eta$ is the solution of \autoref{eq:PE_ssh}.
+  and $\eta$ is the solution of \autoref{eq:MB_ssh}.
 
   The vertical velocity and the hydrostatic pressure are diagnosed from the following equations:
   \[
-  % \label{eq:w_diag}
+  % \label{eq:MB_w_diag}
     \pd[w]{k} = - \chi \; e_3 \qquad
-  % \label{eq:hp_diag}
+  % \label{eq:MB_hp_diag}
     \pd[p_h]{k} = - \rho \; g \; e_3
   \]
-  where the divergence of the horizontal velocity, $\chi$ is given by \autoref{eq:PE_div_Uh}.
+  where the divergence of the horizontal velocity, $\chi$ is given by \autoref{eq:MB_div_Uh}.
 
 \item
@@ -562,5 +562,5 @@
 
 The expression of $\vect D^{U}$, $D^{S}$ and $D^{T}$ depends on the subgrid scale parameterisation used.
-It will be defined in \autoref{eq:PE_zdf}.
+It will be defined in \autoref{eq:MB_zdf}.
 The nature and formulation of $\vect F^{\vect U}$, $F^T$ and $F^S$, the surface forcing terms,
 are discussed in \autoref{chap:SBC}.
@@ -572,5 +572,5 @@
 % ================================================================
 \section{Curvilinear generalised vertical coordinate system}
-\label{sec:PE_gco}
+\label{sec:MB_gco}
 
 The ocean domain presents a huge diversity of situation in the vertical.
@@ -596,12 +596,12 @@
 introducing an arbitrary vertical coordinate :
 \begin{equation}
-  \label{eq:PE_s}
+  \label{eq:MB_s}
   s = s(i,j,k,t)
 \end{equation}
 with the restriction that the above equation gives a single-valued monotonic relationship between $s$ and $k$,
 when $i$, $j$ and $t$ are held fixed.
-\autoref{eq:PE_s} is a transformation from the $(i,j,k,t)$ coordinate system with independent variables into
+\autoref{eq:MB_s} is a transformation from the $(i,j,k,t)$ coordinate system with independent variables into
 the $(i,j,s,t)$ generalised coordinate system with $s$ depending on the other three variables through
-\autoref{eq:PE_s}.
+\autoref{eq:MB_s}.
 This so-called \textit{generalised vertical coordinate} \citep{kasahara_MWR74} is in fact
 an Arbitrary Lagrangian--Eulerian (ALE) coordinate.
@@ -656,13 +656,13 @@
 \subsection{\textit{S}-coordinate formulation}
 
-Starting from the set of equations established in \autoref{sec:PE_zco} for the special case $k = z$ and
+Starting from the set of equations established in \autoref{sec:MB_zco} for the special case $k = z$ and
 thus $e_3 = 1$, we introduce an arbitrary vertical coordinate $s = s(i,j,k,t)$,
 which includes $z$-, \zstar- and $\sigma$-coordinates as special cases
 ($s = z$, $s = \zstar$, and $s = \sigma = z / H$ or $ = z / \lt( H + \eta \rt)$, resp.).
-A formal derivation of the transformed equations is given in \autoref{apdx:A}.
+A formal derivation of the transformed equations is given in \autoref{apdx:SCOORD}.
 Let us define the vertical scale factor by $e_3 = \partial_s z$  ($e_3$ is now a function of $(i,j,k,t)$ ),
 and the slopes in the $(i,j)$ directions between $s$- and $z$-surfaces by:
 \begin{equation}
-  \label{eq:PE_sco_slope}
+  \label{eq:MB_sco_slope}
   \sigma_1 = \frac{1}{e_1} \; \lt. \pd[z]{i} \rt|_s \quad \text{and} \quad
   \sigma_2 = \frac{1}{e_2} \; \lt. \pd[z]{j} \rt|_s
@@ -671,15 +671,15 @@
 relative to the moving $s$-surfaces and normal to them:
 \[
-  % \label{eq:PE_sco_w}
+  % \label{eq:MB_sco_w}
   \omega = w -  \, \lt. \pd[z]{t} \rt|_s - \sigma_1 \, u - \sigma_2 \, v
 \]
 
-The equations solved by the ocean model \autoref{eq:PE} in $s$-coordinate can be written as follows
-(see \autoref{sec:A_momentum}):
+The equations solved by the ocean model \autoref{eq:MB_PE} in $s$-coordinate can be written as follows
+(see \autoref{sec:SCOORD_momentum}):
 
 \begin{itemize}
 \item \textbf{Vector invariant form of the momentum equation}:
   \begin{multline*}
-  % \label{eq:PE_sco_u_vector}
+  % \label{eq:MB_sco_u_vector}
     \pd[u]{t} = + (\zeta + f) \, v - \frac{1}{2 \, e_1} \pd[]{i} (u^2 + v^2) - \frac{1}{e_3} \omega \pd[u]{k} \\
                 - \frac{1}{e_1} \pd[]{i} \lt( \frac{p_s + p_h}{\rho_o} \rt) - g \frac{\rho}{\rho_o} \sigma_1
@@ -687,5 +687,5 @@
   \end{multline*}
   \begin{multline*}
-  % \label{eq:PE_sco_v_vector}
+  % \label{eq:MB_sco_v_vector}
     \pd[v]{t} = - (\zeta + f) \, u - \frac{1}{2 \, e_2} \pd[]{j}(u^2 + v^2) - \frac{1}{e_3} \omega \pd[v]{k} \\
                 - \frac{1}{e_2} \pd[]{j} \lt( \frac{p_s + p_h}{\rho_o} \rt) - g \frac{\rho}{\rho_o} \sigma_2
@@ -694,5 +694,5 @@
 \item \textbf{Flux form of the momentum equation}:
   \begin{multline*}
-  % \label{eq:PE_sco_u_flux}
+  % \label{eq:MB_sco_u_flux}
     \frac{1}{e_3} \pd[(e_3 \, u)]{t} = + \lt[ f + \frac{1}{e_1 \; e_2} \lt( v \pd[e_2]{i} - u \pd[e_1]{j} \rt) \rt] \, v \\
                                        - \frac{1}{e_1 \; e_2 \; e_3} \lt( \pd[(e_2 \, e_3 \, u \, u)]{i} + \pd[(e_1 \, e_3 \, v \, u)]{j} \rt) \\
@@ -702,5 +702,5 @@
   \end{multline*}
   \begin{multline*}
-  % \label{eq:PE_sco_v_flux}
+  % \label{eq:MB_sco_v_flux}
     \frac{1}{e_3} \pd[(e_3 \, v)]{t} = - \lt[ f + \frac{1}{e_1 \; e_2} \lt( v \pd[e_2]{i} - u \pd[e_1]{j} \rt) \rt] \, u \\
                                        - \frac{1}{e_1 \; e_2 \; e_3} \lt( \pd[( e_2 \; e_3 \, u \, v)]{i} + \pd[(e_1 \; e_3 \, v \, v)]{j} \rt) \\
@@ -712,7 +712,7 @@
   and the hydrostatic pressure have the same expressions as in $z$-coordinates although
   they do not represent exactly the same quantities.
-  $\omega$ is provided by the continuity equation (see \autoref{apdx:A}):
+  $\omega$ is provided by the continuity equation (see \autoref{apdx:SCOORD}):
   \[
-  % \label{eq:PE_sco_continuity}
+  % \label{eq:MB_sco_continuity}
     \pd[e_3]{t} + e_3 \; \chi + \pd[\omega]{s} = 0 \quad \text{with} \quad
     \chi = \frac{1}{e_1 e_2 e_3} \lt( \pd[(e_2 e_3 \, u)]{i} + \pd[(e_1 e_3 \, v)]{j} \rt)
@@ -720,5 +720,5 @@
 \item \textit{tracer equations}:
   \begin{multline*}
-  % \label{eq:PE_sco_t}
+  % \label{eq:MB_sco_t}
     \frac{1}{e_3} \pd[(e_3 \, T)]{t} = - \frac{1}{e_1 e_2 e_3} \lt(   \pd[(e_2 e_3 \, u \, T)]{i}
                                                                     + \pd[(e_1 e_3 \, v \, T)]{j} \rt) \\
@@ -726,5 +726,5 @@
   \end{multline*}
   \begin{multline}
-  % \label{eq:PE_sco_s}
+  % \label{eq:MB_sco_s}
     \frac{1}{e_3} \pd[(e_3 \, S)]{t} = - \frac{1}{e_1 e_2 e_3} \lt(   \pd[(e_2 e_3 \, u \, S)]{i}
                                                                     + \pd[(e_1 e_3 \, v \, S)]{j} \rt) \\
@@ -745,5 +745,5 @@
 % -------------------------------------------------------------------------------------------------------------
 \subsection{Curvilinear \zstar-coordinate system}
-\label{subsec:PE_zco_star}
+\label{subsec:MB_zco_star}
 
 %>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@@ -752,5 +752,5 @@
     \includegraphics[width=\textwidth]{Fig_z_zstar}
     \caption{
-      \protect\label{fig:z_zstar}
+      \protect\label{fig:MB_z_zstar}
       (a) $z$-coordinate in linear free-surface case ;
       (b) $z$-coordinate in non-linear free surface case ;
@@ -771,6 +771,6 @@
 as in the $z$-coordinate formulation, but is equally distributed over the full water column.
 Thus vertical levels naturally follow sea-surface variations, with a linear attenuation with depth,
-as illustrated by \autoref{fig:z_zstar}.
-Note that with a flat bottom, such as in \autoref{fig:z_zstar}, the bottom-following $z$ coordinate and \zstar are equivalent.
+as illustrated by \autoref{fig:MB_z_zstar}.
+Note that with a flat bottom, such as in \autoref{fig:MB_z_zstar}, the bottom-following $z$ coordinate and \zstar are equivalent.
 The definition and modified oceanic equations for the rescaled vertical coordinate \zstar,
 including the treatment of fresh-water flux at the surface, are detailed in Adcroft and Campin (2004).
@@ -778,5 +778,5 @@
 The position (\zstar) and vertical discretization (\zstar) are expressed as:
 \[
-  % \label{eq:PE_z-star}
+  % \label{eq:MB_z-star}
   H + \zstar = (H + z)  / r \quad \text{and}  \quad \delta \zstar
               = \delta z / r \quad \text{with} \quad r
@@ -785,5 +785,5 @@
 Simple re-organisation of the above expressions gives
 \[
-  % \label{eq:PE_zstar_2}
+  % \label{eq:MB_zstar_2}
   \zstar = H \lt( \frac{z - \eta}{H + \eta} \rt) .
 \]
@@ -806,5 +806,5 @@
 it is clear that surfaces constant \zstar are very similar to the depth surfaces.
 These properties greatly reduce difficulties of computing the horizontal pressure gradient relative to
-terrain following sigma models discussed in \autoref{subsec:PE_sco}.
+terrain following sigma models discussed in \autoref{subsec:MB_sco}.
 Additionally, since $\zstar = z$ when $\eta = 0$,
 no flow is spontaneously generated in an unforced ocean starting from rest, regardless the bottom topography.
@@ -839,5 +839,5 @@
 % -------------------------------------------------------------------------------------------------------------
 \subsection{Curvilinear terrain-following \textit{s}--coordinate}
-\label{subsec:PE_sco}
+\label{subsec:MB_sco}
 
 % -------------------------------------------------------------------------------------------------------------
@@ -851,5 +851,5 @@
 For example, the topographic $\beta$-effect is usually larger than the planetary one along continental slopes.
 Topographic Rossby waves can be excited and can interact with the mean current.
-In the $z$-coordinate system presented in the previous section (\autoref{sec:PE_zco}),
+In the $z$-coordinate system presented in the previous section (\autoref{sec:MB_zco}),
 $z$-surfaces are geopotential surfaces.
 The bottom topography is discretised by steps.
@@ -875,12 +875,12 @@
 The main two problems come from the truncation error in the horizontal pressure gradient and
 a possibly increased diapycnal diffusion.
-The horizontal pressure force in $s$-coordinate consists of two terms (see \autoref{apdx:A}),
+The horizontal pressure force in $s$-coordinate consists of two terms (see \autoref{apdx:SCOORD}),
 
 \begin{equation}
-  \label{eq:PE_p_sco}
+  \label{eq:MB_p_sco}
   \nabla p |_z = \nabla p |_s - \frac{1}{e_3} \pd[p]{s} \nabla z |_s
 \end{equation}
 
-The second term in \autoref{eq:PE_p_sco} depends on the tilt of the coordinate surface and
+The second term in \autoref{eq:MB_p_sco} depends on the tilt of the coordinate surface and
 leads to a truncation error that is not present in a $z$-model.
 In the special case of a $\sigma$-coordinate (i.e. a depth-normalised coordinate system $\sigma = z/H$),
@@ -898,5 +898,5 @@
 an envelope topography is defined in $s$-coordinate on which a full or
 partial step bottom topography is then applied in order to adjust the model depth to the observed one
-(see \autoref{sec:DOM_zgr}.
+(see \autoref{subsec:DOM_zgr}.
 
 For numerical reasons a minimum of diffusion is required along the coordinate surfaces of
@@ -915,5 +915,5 @@
 the strongly stratified portion of the water column (\ie\ the main thermocline) \citep{madec.delecluse.ea_JPO96}.
 An alternate solution consists of rotating the lateral diffusive tensor to geopotential or to isoneutral surfaces
-(see \autoref{subsec:PE_ldf}).
+(see \autoref{subsec:MB_ldf}).
 Unfortunately, the slope of isoneutral surfaces relative to the $s$-surfaces can very large,
 strongly exceeding the stability limit of such a operator when it is discretized (see \autoref{chap:LDF}).
@@ -928,5 +928,5 @@
 % -------------------------------------------------------------------------------------------------------------
 \subsection{\texorpdfstring{Curvilinear \ztilde-coordinate}{}}
-\label{subsec:PE_zco_tilde}
+\label{subsec:MB_zco_tilde}
 
 The \ztilde -coordinate has been developed by \citet{leclair.madec_OM11}.
@@ -941,5 +941,5 @@
 % ================================================================
 \section{Subgrid scale physics}
-\label{sec:PE_zdf_ldf}
+\label{sec:MB_zdf_ldf}
 
 The hydrostatic primitive equations describe the behaviour of a geophysical fluid at space and time scales larger than
@@ -958,5 +958,5 @@
 The control exerted by gravity on the flow induces a strong anisotropy between the lateral and vertical motions.
 Therefore subgrid-scale physics \textbf{D}$^{\vect U}$, $D^{S}$ and $D^{T}$  in
-\autoref{eq:PE_dyn}, \autoref{eq:PE_tra_T} and \autoref{eq:PE_tra_S} are divided into
+\autoref{eq:MB_PE_dyn}, \autoref{eq:MB_PE_tra_T} and \autoref{eq:MB_PE_tra_S} are divided into
 a lateral part \textbf{D}$^{l \vect U}$, $D^{l S}$ and $D^{l T}$ and
 a vertical part \textbf{D}$^{v \vect U}$, $D^{v S}$ and $D^{v T}$.
@@ -967,5 +967,5 @@
 % -------------------------------------------------------------------------------------------------------------
 \subsection{Vertical subgrid scale physics}
-\label{subsec:PE_zdf}
+\label{subsec:MB_zdf}
 
 The model resolution is always larger than the scale at which the major sources of vertical turbulence occur
@@ -981,5 +981,5 @@
 The resulting vertical momentum and tracer diffusive operators are of second order:
 \begin{equation}
-  \label{eq:PE_zdf}
+  \label{eq:MB_zdf}
   \begin{gathered}
     \vect D^{v \vect U} = \pd[]{z} \lt( A^{vm} \pd[\vect U_h]{z} \rt) \ , \\
@@ -1001,5 +1001,5 @@
 % -------------------------------------------------------------------------------------------------------------
 \subsection{Formulation of the lateral diffusive and viscous operators}
-\label{subsec:PE_ldf}
+\label{subsec:MB_ldf}
 
 Lateral turbulence can be roughly divided into a mesoscale turbulence associated with eddies
@@ -1055,7 +1055,7 @@
 \subsubsection{Lateral laplacian tracer diffusive operator}
 
-The lateral Laplacian tracer diffusive operator is defined by (see \autoref{apdx:B}):
+The lateral Laplacian tracer diffusive operator is defined by (see \autoref{apdx:DIFFOPERS}):
 \begin{equation}
-  \label{eq:PE_iso_tensor}
+  \label{eq:MB_iso_tensor}
   D^{lT} = \nabla \vect . \lt( A^{lT} \; \Re \; \nabla T \rt) \quad \text{with} \quad
   \Re =
@@ -1068,12 +1068,12 @@
 where $r_1$ and $r_2$ are the slopes between the surface along which the diffusive operator acts and
 the model level (\eg\ $z$- or $s$-surfaces).
-Note that the formulation \autoref{eq:PE_iso_tensor} is exact for
+Note that the formulation \autoref{eq:MB_iso_tensor} is exact for
 the rotation between geopotential and $s$-surfaces,
 while it is only an approximation for the rotation between isoneutral and $z$- or $s$-surfaces.
-Indeed, in the latter case, two assumptions are made to simplify \autoref{eq:PE_iso_tensor} \citep{cox_OM87}.
+Indeed, in the latter case, two assumptions are made to simplify \autoref{eq:MB_iso_tensor} \citep{cox_OM87}.
 First, the horizontal contribution of the dianeutral mixing is neglected since the ratio between iso and
 dia-neutral diffusive coefficients is known to be several orders of magnitude smaller than unity.
 Second, the two isoneutral directions of diffusion are assumed to be independent since
-the slopes are generally less than $10^{-2}$ in the ocean (see \autoref{apdx:B}).
+the slopes are generally less than $10^{-2}$ in the ocean (see \autoref{apdx:DIFFOPERS}).
 
 For \textit{iso-level} diffusion, $r_1$ and $r_2 $ are zero.
@@ -1082,5 +1082,5 @@
 For \textit{geopotential} diffusion,
 $r_1$ and $r_2 $ are the slopes between the geopotential and computational surfaces:
-they are equal to $\sigma_1$ and $\sigma_2$, respectively (see \autoref{eq:PE_sco_slope}).
+they are equal to $\sigma_1$ and $\sigma_2$, respectively (see \autoref{eq:MB_sco_slope}).
 
 For \textit{isoneutral} diffusion $r_1$ and $r_2$ are the slopes between the isoneutral and computational surfaces.
@@ -1088,5 +1088,5 @@
 In $z$-coordinates:
 \begin{equation}
-  \label{eq:PE_iso_slopes}
+  \label{eq:MB_iso_slopes}
   r_1 = \frac{e_3}{e_1}	\lt( \pd[\rho]{i} \rt) \lt( \pd[\rho]{k} \rt)^{-1} \quad
   r_2 = \frac{e_3}{e_2}	\lt( \pd[\rho]{j} \rt) \lt( \pd[\rho]{k} \rt)^{-1}
@@ -1099,5 +1099,5 @@
 an additional tracer advection is introduced in combination with the isoneutral diffusion of tracers:
 \[
-  % \label{eq:PE_iso+eiv}
+  % \label{eq:MB_iso+eiv}
   D^{lT} = \nabla \cdot \lt( A^{lT} \; \Re \; \nabla T \rt) + \nabla \cdot \lt( \vect U^\ast \, T \rt)
 \]
@@ -1105,5 +1105,5 @@
 eddy-induced transport velocity. This velocity field is defined by:
 \begin{gather}
-  % \label{eq:PE_eiv}
+  % \label{eq:MB_eiv}
   u^\ast =   \frac{1}{e_3}            \pd[]{k} \lt( A^{eiv} \;        \tilde{r}_1 \rt) \\
   v^\ast =   \frac{1}{e_3}            \pd[]{k} \lt( A^{eiv} \;        \tilde{r}_2 \rt) \\
@@ -1116,5 +1116,5 @@
 Their values are thus independent of the vertical coordinate, but their expression depends on the coordinate:
 \begin{align}
-  \label{eq:PE_slopes_eiv}
+  \label{eq:MB_slopes_eiv}
   \tilde{r}_n =
     \begin{cases}
@@ -1134,9 +1134,9 @@
 The lateral bilaplacian tracer diffusive operator is defined by:
 \[
-  % \label{eq:PE_bilapT}
+  % \label{eq:MB_bilapT}
   D^{lT}= - \Delta \; (\Delta T) \quad \text{where} \quad
   \Delta \bullet = \nabla \lt( \sqrt{B^{lT}} \; \Re \; \nabla \bullet \rt)
 \]
-It is the Laplacian operator given by \autoref{eq:PE_iso_tensor} applied twice with
+It is the Laplacian operator given by \autoref{eq:MB_iso_tensor} applied twice with
 the harmonic eddy diffusion coefficient set to the square root of the biharmonic one.
 
@@ -1144,7 +1144,7 @@
 
 The Laplacian momentum diffusive operator along $z$- or $s$-surfaces is found by
-applying \autoref{eq:PE_lap_vector} to the horizontal velocity vector (see \autoref{apdx:B}):
+applying \autoref{eq:MB_lap_vector} to the horizontal velocity vector (see \autoref{apdx:DIFFOPERS}):
 \begin{align*}
-  % \label{eq:PE_lapU}
+  % \label{eq:MB_lapU}
   \vect D^{l \vect U} &=   \nabla_h        \big( A^{lm}    \chi             \big)
                          - \nabla_h \times \big( A^{lm} \, \zeta \; \vect k \big) \\
@@ -1156,5 +1156,5 @@
 
 Such a formulation ensures a complete separation between the vorticity and horizontal divergence fields
-(see \autoref{apdx:C}).
+(see \autoref{apdx:INVARIANTS}).
 Unfortunately, it is only available in \textit{iso-level} direction.
 When a rotation is required
@@ -1162,9 +1162,9 @@
 the $u$ and $v$-fields are considered as independent scalar fields, so that the diffusive operator is given by:
 \begin{gather*}
-  % \label{eq:PE_lapU_iso}
+  % \label{eq:MB_lapU_iso}
     D_u^{l \vect U} = \nabla . \lt( A^{lm} \; \Re \; \nabla u \rt) \\
     D_v^{l \vect U} = \nabla . \lt( A^{lm} \; \Re \; \nabla v \rt)
 \end{gather*}
-where $\Re$ is given by \autoref{eq:PE_iso_tensor}.
+where $\Re$ is given by \autoref{eq:MB_iso_tensor}.
 It is the same expression as those used for diffusive operator on tracers.
 It must be emphasised that such a formulation is only exact in a Cartesian coordinate system,
Index: /NEMO/trunk/doc/latex/NEMO/subfiles/chap_model_basics_zstar.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/subfiles/chap_model_basics_zstar.tex	(revision 11542)
+++ /NEMO/trunk/doc/latex/NEMO/subfiles/chap_model_basics_zstar.tex	(revision 11543)
@@ -40,5 +40,5 @@
 the surface height, it is clear that surfaces constant $z^\star$ are very similar to the depth surfaces.
 These properties greatly reduce difficulties of computing the horizontal pressure gradient relative to
-terrain following sigma models discussed in \autoref{subsec:PE_sco}.
+terrain following sigma models discussed in \autoref{subsec:MB_sco}.
 Additionally, since $z^\star$ when $\eta = 0$, no flow is spontaneously generated in
 an unforced ocean starting from rest, regardless the bottom topography.
@@ -81,14 +81,14 @@
 %------------------------------------------------------------------------------------------------------------
 Options are defined through the \nam{\_dynspg} namelist variables.
-The surface pressure gradient term is related to the representation of the free surface (\autoref{sec:PE_hor_pg}).
+The surface pressure gradient term is related to the representation of the free surface (\autoref{sec:MB_hor_pg}).
 The main distinction is between the fixed volume case (linear free surface or rigid lid) and
 the variable volume case (nonlinear free surface, \key{vvl} is active).
-In the linear free surface case (\autoref{subsec:PE_free_surface}) and rigid lid (\autoref{PE_rigid_lid}),
+In the linear free surface case (\autoref{subsec:MB_free_surface}) and rigid lid (\autoref{PE_rigid_lid}),
 the vertical scale factors $e_{3}$ are fixed in time,
-while in the nonlinear case (\autoref{subsec:PE_free_surface}) they are time-dependent.
+while in the nonlinear case (\autoref{subsec:MB_free_surface}) they are time-dependent.
 With both linear and nonlinear free surface, external gravity waves are allowed in the equations,
 which imposes a very small time step when an explicit time stepping is used.
 Two methods are proposed to allow a longer time step for the three-dimensional equations:
-the filtered free surface, which is a modification of the continuous equations %(see \autoref{eq:PE_flt?}),
+the filtered free surface, which is a modification of the continuous equations %(see \autoref{eq:MB_flt?}),
 and the split-explicit free surface described below.
 The extra term introduced in the filtered method is calculated implicitly,
@@ -116,5 +116,5 @@
 and $\rho_w =1,000\,Kg.m^{-3}$ is the volumic mass of pure water.
 The sea-surface height is evaluated using a leapfrog scheme in combination with an Asselin time filter,
-(\ie\ the velocity appearing in (\autoref{eq:dynspg_ssh}) is centred in time (\textit{now} velocity).
+(\ie\ the velocity appearing in (\autoref{eq:DYN_spg_ssh}) is centred in time (\textit{now} velocity).
 
 The surface pressure gradient, also evaluated using a leap-frog scheme, is then simply given by:
@@ -130,5 +130,5 @@
 
 Consistent with the linearization, a $\left. \rho \right|_{k=1} / \rho_o$ factor is omitted in
-(\autoref{eq:dynspg_exp}).
+(\autoref{eq:DYN_spg_exp}).
 
 %-------------------------------------------------------------
@@ -316,5 +316,5 @@
 This option is presented in a report \citep{levier.treguier.ea_rpt07} available on the \NEMO\ web site.
 The three time-stepping methods (explicit, split-explicit and filtered) are the same as in
-\autoref{DYN_spg_linear} except that the ocean depth is now time-dependent.
+\autoref{?:DYN_spg_linear?} except that the ocean depth is now time-dependent.
 In particular, this means that in filtered case, the matrix to be inverted has to be recomputed at each time-step.
 
Index: /NEMO/trunk/doc/latex/NEMO/subfiles/chap_time_domain.tex
===================================================================
--- /NEMO/trunk/doc/latex/NEMO/subfiles/chap_time_domain.tex	(revision 11542)
+++ /NEMO/trunk/doc/latex/NEMO/subfiles/chap_time_domain.tex	(revision 11543)
@@ -6,6 +6,6 @@
 % Chapter 2 ——— Time Domain (step.F90)
 % ================================================================
-\chapter{Time Domain (STP)}
-\label{chap:STP}
+\chapter{Time Domain}
+\label{chap:TD}
 \chaptertoc
 
@@ -19,5 +19,5 @@
 \newpage
 
-Having defined the continuous equations in \autoref{chap:PE}, we need now to choose a time discretization,
+Having defined the continuous equations in \autoref{chap:MB}, we need now to choose a time discretization,
 a key feature of an ocean model as it exerts a strong influence on the structure of the computer code
 (\ie\ on its flowchart).
@@ -29,9 +29,9 @@
 % ================================================================
 \section{Time stepping environment}
-\label{sec:STP_environment}
+\label{sec:TD_environment}
 
 The time stepping used in \NEMO\ is a three level scheme that can be represented as follows:
 \begin{equation}
-  \label{eq:STP}
+  \label{eq:TD}
   x^{t + \rdt} = x^{t - \rdt} + 2 \, \rdt \ \text{RHS}_x^{t - \rdt, \, t, \, t + \rdt}
 \end{equation}
@@ -52,5 +52,5 @@
 The third array, although referred to as $x_a$ (after) in the code,
 is usually not the variable at the after time step;
-but rather it is used to store the time derivative (RHS in \autoref{eq:STP}) prior to time-stepping the equation.
+but rather it is used to store the time derivative (RHS in \autoref{eq:TD}) prior to time-stepping the equation.
 The time stepping itself is performed once at each time step where implicit vertical diffusion is computed, \ie\ in the \mdl{trazdf} and \mdl{dynzdf} modules.
 
@@ -59,10 +59,10 @@
 % -------------------------------------------------------------------------------------------------------------
 \section{Non-diffusive part --- Leapfrog scheme}
-\label{sec:STP_leap_frog}
+\label{sec:TD_leap_frog}
 
 The time stepping used for processes other than diffusion is the well-known leapfrog scheme
 \citep{mesinger.arakawa_bk76}.
 This scheme is widely used for advection processes in low-viscosity fluids.
-It is a time centred scheme, \ie\ the RHS in \autoref{eq:STP} is evaluated at time step $t$, the now time step.
+It is a time centred scheme, \ie\ the RHS in \autoref{eq:TD} is evaluated at time step $t$, the now time step.
 It may be used for momentum and tracer advection, pressure gradient, and Coriolis terms,
 but not for diffusion terms.
@@ -81,10 +81,10 @@
 is a kind of laplacian diffusion in time that mixes odd and even time steps:
 \begin{equation}
-  \label{eq:STP_asselin}
+  \label{eq:TD_asselin}
   x_F^t = x^t + \gamma \, \lt[ x_F^{t - \rdt} - 2 x^t + x^{t + \rdt} \rt]
 \end{equation}
 where the subscript $F$ denotes filtered values and $\gamma$ is the Asselin coefficient.
 $\gamma$ is initialized as \np{rn\_atfp} (namelist parameter).
-Its default value is \np{rn\_atfp}\forcode{=10.e-3} (see \autoref{sec:STP_mLF}),
+Its default value is \np{rn\_atfp}\forcode{ = 10.e-3} (see \autoref{sec:TD_mLF}),
 causing only a weak dissipation of high frequency motions (\citep{farge-coulombier_phd87}).
 The addition of a time filter degrades the accuracy of the calculation from second to first order.
@@ -102,5 +102,5 @@
 % -------------------------------------------------------------------------------------------------------------
 \section{Diffusive part --- Forward or backward scheme}
-\label{sec:STP_forward_imp}
+\label{sec:TD_forward_imp}
 
 The leapfrog differencing scheme is unsuitable for the representation of diffusion and damping processes.
@@ -108,5 +108,5 @@
 (when present, see \autoref{sec:TRA_dmp}), a forward time differencing scheme is used :
 \[
-  %\label{eq:STP_euler}
+  %\label{eq:TD_euler}
   x^{t + \rdt} = x^{t - \rdt} + 2 \, \rdt \ D_x^{t - \rdt}
 \]
@@ -115,5 +115,5 @@
 The conditions for stability of second and fourth order horizontal diffusion schemes are \citep{griffies_bk04}:
 \begin{equation}
-  \label{eq:STP_euler_stability}
+  \label{eq:TD_euler_stability}
   A^h <
   \begin{cases}
@@ -123,5 +123,5 @@
 \end{equation}
 where $e$ is the smallest grid size in the two horizontal directions and $A^h$ is the mixing coefficient.
-The linear constraint \autoref{eq:STP_euler_stability} is a necessary condition, but not sufficient.
+The linear constraint \autoref{eq:TD_euler_stability} is a necessary condition, but not sufficient.
 If it is not satisfied, even mildly, then the model soon becomes wildly unstable.
 The instability can be removed by either reducing the length of the time steps or reducing the mixing coefficient.
@@ -131,5 +131,5 @@
 backward (or implicit) time differencing scheme is used. This scheme is unconditionally stable but diffusive and can be written as follows:
 \begin{equation}
-  \label{eq:STP_imp}
+  \label{eq:TD_imp}
   x^{t + \rdt} = x^{t - \rdt} + 2 \, \rdt \ \text{RHS}_x^{t + \rdt}
 \end{equation}
@@ -141,5 +141,5 @@
 This scheme is rather time consuming since it requires a matrix inversion. For example, the finite difference approximation of the temperature equation is:
 \[
-  % \label{eq:STP_imp_zdf}
+  % \label{eq:TD_imp_zdf}
   \frac{T(k)^{t + 1} - T(k)^{t - 1}}{2 \; \rdt}
   \equiv
@@ -147,7 +147,7 @@
 \]
 where RHS is the right hand side of the equation except for the vertical diffusion term.
-We rewrite \autoref{eq:STP_imp} as:
-\begin{equation}
-  \label{eq:STP_imp_mat}
+We rewrite \autoref{eq:TD_imp} as:
+\begin{equation}
+  \label{eq:TD_imp_mat}
   -c(k + 1) \; T^{t + 1}(k + 1) + d(k) \; T^{t + 1}(k) - \; c(k) \; T^{t + 1}(k - 1) \equiv b(k)
 \end{equation}
@@ -159,5 +159,5 @@
 \end{align*}
 
-\autoref{eq:STP_imp_mat} is a linear system of equations with an associated matrix which is tridiagonal.
+\autoref{eq:TD_imp_mat} is a linear system of equations with an associated matrix which is tridiagonal.
 Moreover,
 $c(k)$ and $d(k)$ are positive and the diagonal term is greater than the sum of the two extra-diagonal terms,
@@ -169,5 +169,5 @@
 % -------------------------------------------------------------------------------------------------------------
 \section{Surface pressure gradient}
-\label{sec:STP_spg_ts}
+\label{sec:TD_spg_ts}
 
 The leapfrog environment supports a centred in time computation of the surface pressure, \ie\ evaluated
@@ -177,5 +177,5 @@
 (\np{ln\_dynspg\_ts}\forcode{=.true.}) in which barotropic and baroclinic dynamical equations are solved separately with ad-hoc
 time steps. The use of the time-splitting (in combination with non-linear free surface) imposes some constraints on the design of
-the overall flowchart, in particular to ensure exact tracer conservation (see \autoref{fig:TimeStep_flowchart}).
+the overall flowchart, in particular to ensure exact tracer conservation (see \autoref{fig:TD_TimeStep_flowchart}).
 
 Compared to the former use of the filtered free surface in \NEMO\ v3.6 (\citet{roullet.madec_JGR00}), the use of a split-explicit free surface is advantageous
@@ -189,5 +189,5 @@
     \includegraphics[width=\textwidth]{Fig_TimeStepping_flowchart_v4}
     \caption{
-      \protect\label{fig:TimeStep_flowchart}
+      \protect\label{fig:TD_TimeStep_flowchart}
       Sketch of the leapfrog time stepping sequence in \NEMO\ with split-explicit free surface. The latter combined
        with non-linear free surface requires the dynamical tendency being updated prior tracers tendency to ensure
@@ -205,5 +205,5 @@
 % -------------------------------------------------------------------------------------------------------------
 \section{Modified Leapfrog -- Asselin filter scheme}
-\label{sec:STP_mLF}
+\label{sec:TD_mLF}
 
 Significant changes have been introduced by \cite{leclair.madec_OM09} in the LF-RA scheme in order to
@@ -214,14 +214,14 @@
 \ie\ it is time-stepped over a $2 \rdt$ period:
 $x^t = x^t + 2 \rdt Q^t$ where $Q$ is the forcing applied to $x$,
-and the time filter is given by \autoref{eq:STP_asselin} so that $Q$ is redistributed over several time step.
+and the time filter is given by \autoref{eq:TD_asselin} so that $Q$ is redistributed over several time step.
 In the modified LF-RA environment, these two formulations have been replaced by:
 \begin{gather}
-  \label{eq:STP_forcing}
+  \label{eq:TD_forcing}
   x^{t + \rdt} = x^{t - \rdt} + \rdt \lt( Q^{t - \rdt / 2} + Q^{t + \rdt / 2} \rt)  \\
-  \label{eq:STP_RA}
+  \label{eq:TD_RA}
   x_F^t       = x^t + \gamma \, \lt( x_F^{t - \rdt} - 2 x^t + x^{t + \rdt} \rt)
                     - \gamma \, \rdt \, \lt( Q^{t + \rdt / 2} - Q^{t - \rdt / 2} \rt)
 \end{gather}
-The change in the forcing formulation given by \autoref{eq:STP_forcing} (see \autoref{fig:MLF_forcing})
+The change in the forcing formulation given by \autoref{eq:TD_forcing} (see \autoref{fig:TD_MLF_forcing})
 has a significant effect:
 the forcing term no longer excites the divergence of odd and even time steps \citep{leclair.madec_OM09}.
@@ -231,9 +231,9 @@
 Indeed, time filtering is no longer required on the forcing part.
 The influence of the Asselin filter on the forcing is explicitly removed by adding a new term in the filter
-(last term in \autoref{eq:STP_RA} compared to \autoref{eq:STP_asselin}).
+(last term in \autoref{eq:TD_RA} compared to \autoref{eq:TD_asselin}).
 Since the filtering of the forcing was the source of non-conservation in the classical LF-RA scheme,
 the modified formulation becomes conservative \citep{leclair.madec_OM09}.
 Second, the LF-RA becomes a truly quasi -second order scheme.
-Indeed, \autoref{eq:STP_forcing} used in combination with a careful treatment of static instability
+Indeed, \autoref{eq:TD_forcing} used in combination with a careful treatment of static instability
 (\autoref{subsec:ZDF_evd}) and of the TKE physics (\autoref{subsec:ZDF_tke_ene})
 (the two other main sources of time step divergence),
@@ -242,5 +242,5 @@
 Note that the forcing is now provided at the middle of a time step:
 $Q^{t + \rdt / 2}$ is the forcing applied over the $[t,t + \rdt]$ time interval.
-This and the change in the time filter, \autoref{eq:STP_RA},
+This and the change in the time filter, \autoref{eq:TD_RA},
 allows for an exact evaluation of the contribution due to the forcing term between any two time steps,
 even if separated by only $\rdt$ since the time filter is no longer applied to the forcing term.
@@ -251,5 +251,5 @@
     \includegraphics[width=\textwidth]{Fig_MLF_forcing}
     \caption{
-      \protect\label{fig:MLF_forcing}
+      \protect\label{fig:TD_MLF_forcing}
       Illustration of forcing integration methods.
       (top) ''Traditional'' formulation:
@@ -268,5 +268,5 @@
 % -------------------------------------------------------------------------------------------------------------
 \section{Start/Restart strategy}
-\label{sec:STP_rst}
+\label{sec:TD_rst}
 
 %--------------------------------------------namrun-------------------------------------------
@@ -277,8 +277,8 @@
 (Euler time integration):
 \[
-  % \label{eq:DOM_euler}
+  % \label{eq:TD_DOM_euler}
   x^1 = x^0 + \rdt \ \text{RHS}^0
 \]
-This is done simply by keeping the leapfrog environment (\ie\ the \autoref{eq:STP} three level time stepping) but
+This is done simply by keeping the leapfrog environment (\ie\ the \autoref{eq:TD} three level time stepping) but
 setting all $x^0$ (\textit{before}) and $x^1$ (\textit{now}) fields equal at the first time step and
 using half the value of a leapfrog time step ($2 \rdt$).
@@ -314,5 +314,5 @@
 % -------------------------------------------------------------------------------------------------------------
 \subsection{Time domain}
-\label{subsec:STP_time}
+\label{subsec:TD_time}
 %--------------------------------------------namrun-------------------------------------------
 
Index: /NEMO/trunk/doc/latex/global/coding_rules.tex
===================================================================
--- /NEMO/trunk/doc/latex/global/coding_rules.tex	(revision 11542)
+++ /NEMO/trunk/doc/latex/global/coding_rules.tex	(revision 11543)
@@ -1,5 +1,5 @@
 
 \chapter{Coding Rules}
-\label{apdx:coding}
+\label{apdx:CODING}
 
 \chaptertoc
Index: /NEMO/trunk/doc/latex/global/document.tex
===================================================================
--- /NEMO/trunk/doc/latex/global/document.tex	(revision 11542)
+++ /NEMO/trunk/doc/latex/global/document.tex	(revision 11543)
@@ -11,5 +11,5 @@
 
 %% Document layout
-\documentclass[draft, fontsize = 10pt,
+\documentclass[fontsize = 10pt,
 twoside = semi, abstract = on,
 open = right]{scrreprt}
@@ -46,12 +46,15 @@
 \input{../../global/info_page}
 
+\listoffigures \listoftables %\listoflistings   %% \listoflistings not working
+
 \clearpage
 
 \pagenumbering{roman}
+\ofoot[]{\engine\ Reference Manual} \ifoot[]{\pagemark}
+
 \input{introduction}
 
 %% Table of Contents
 \tableofcontents
-\listoffigures \listoftables \listoflistings
 
 \clearpage
@@ -73,4 +76,5 @@
 
 \appendix   %% Chapter numbering with letters by now
+\lohead{Apdx\ \thechapter\ \leftmark}
 \include{appendices}
 
@@ -78,4 +82,5 @@
 \input{../../global/coding_rules}
 
+\clearpage
 
 %% Backmatter
