Index: NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/chap_time_domain.tex
===================================================================
--- NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/chap_time_domain.tex	(revision 10368)
+++ NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/chap_time_domain.tex	(revision 10419)
@@ -1,15 +1,16 @@
-\documentclass[../tex_main/NEMO_manual]{subfiles}
+\documentclass[../main/NEMO_manual]{subfiles}
+
 \begin{document}
 
 % ================================================================
-% Chapter 2 ——— Time Domain (step.F90)
+% Chapter 2 Time Domain (step.F90)
 % ================================================================
 \chapter{Time Domain (STP) }
 \label{chap:STP}
+
 \minitoc
 
 % Missing things:
 %	- daymod: definition of the time domain (nit000, nitend andd the calendar)
-
 
 \gmcomment{STEVEN :maybe a picture of the directory structure in the introduction which could be referred to here,
@@ -17,8 +18,5 @@
 %%%%
 
-
 \newpage
-$\ $\newline    % force a new ligne
-
 
 Having defined the continuous equations in \autoref{chap:PE}, we need now to choose a time discretization,
@@ -28,5 +26,4 @@
 the consequences for the order in which the equations are solved.
 
-$\ $\newline    % force a new ligne
 % ================================================================
 % Time Discretisation
@@ -36,6 +33,7 @@
 
 The time stepping used in \NEMO is a three level scheme that can be represented as follows:
-\begin{equation} \label{eq:STP}
-   x^{t+\rdt} = x^{t-\rdt} + 2 \, \rdt \  \text{RHS}_x^{t-\rdt,\,t,\,t+\rdt}
+\begin{equation}
+  \label{eq:STP}
+  x^{t+\rdt} = x^{t-\rdt} + 2 \, \rdt \  \text{RHS}_x^{t-\rdt,\,t,\,t+\rdt}
 \end{equation} 
 where $x$ stands for $u$, $v$, $T$ or $S$;
@@ -85,6 +83,7 @@
 This filter, first designed by \citet{Robert_JMSJ66} and more comprehensively studied by \citet{Asselin_MWR72},
 is a kind of laplacian diffusion in time that mixes odd and even time steps:
-\begin{equation} \label{eq:STP_asselin}
-x_F^t  = x^t + \gamma \, \left[ x_F^{t-\rdt} - 2 x^t + x^{t+\rdt} \right]
+\begin{equation}
+  \label{eq:STP_asselin}
+  x_F^t  = x^t + \gamma \, \left[ x_F^{t-\rdt} - 2 x^t + x^{t+\rdt} \right]
 \end{equation} 
 where the subscript $F$ denotes filtered values and $\gamma$ is the Asselin coefficient.
@@ -111,17 +110,19 @@
 For a tendancy $D_x$, representing a diffusion term or a restoring term to a tracer climatology
 (when present, see \autoref{sec:TRA_dmp}), a forward time differencing scheme is used :
-\begin{equation} \label{eq:STP_euler}
+\[
+  % \label{eq:STP_euler}
    x^{t+\rdt} = x^{t-\rdt} + 2 \, \rdt \ {D_x}^{t-\rdt}
-\end{equation} 
+\] 
 
 This is diffusive in time and conditionally stable.
 The conditions for stability of second and fourth order horizontal diffusion schemes are \citep{Griffies_Bk04}:
-\begin{equation} \label{eq:STP_euler_stability}
-A^h < \left\{
-\begin{aligned}
-                    &\frac{e^2}{  8 \; \rdt } 	&&\quad \text{laplacian diffusion} 	\\
-                    &\frac{e^4}{64 \; \rdt } 	&&\quad \text{bilaplacian diffusion} 
-            \end{aligned}
-\right.
+\begin{equation}
+  \label{eq:STP_euler_stability}
+  A^h < \left\{
+    \begin{aligned}
+      &\frac{e^2}{  8 \; \rdt } 	&&\quad \text{laplacian diffusion} 	\\
+      &\frac{e^4}{64 \; \rdt } 	&&\quad \text{bilaplacian diffusion}
+    \end{aligned}
+  \right.
 \end{equation}
 where $e$ is the smallest grid size in the two horizontal directions and $A^h$ is the mixing coefficient.
@@ -138,18 +139,20 @@
 the stability criterion is reduced by a factor of $N$.
 The computation is performed as follows:
-\begin{equation} \label{eq:STP_ts}
-\begin{split}
-& x_\ast ^{t-\rdt} = x^{t-\rdt}   \\
-& x_\ast ^{t-\rdt+L\frac{2\rdt}{N}}=x_\ast ^{t-\rdt+\left( {L-1} 
-\right)\frac{2\rdt}{N}}+\frac{2\rdt}{N}\;\text{DF}^{t-\rdt+\left( {L-1} \right)\frac{2\rdt}{N}}
-        \quad \text{for $L=1$ to $N$}      \\
-& x^{t+\rdt} = x_\ast^{t+\rdt}
-\end{split}
-\end{equation}
+\[
+  % \label{eq:STP_ts}
+  \begin{split}
+    & x_\ast ^{t-\rdt} = x^{t-\rdt}   \\
+    & x_\ast ^{t-\rdt+L\frac{2\rdt}{N}}=x_\ast ^{t-\rdt+\left( {L-1}
+      \right)\frac{2\rdt}{N}}+\frac{2\rdt}{N}\;\text{DF}^{t-\rdt+\left( {L-1} \right)\frac{2\rdt}{N}}
+    \quad \text{for $L=1$ to $N$}      \\
+    & x^{t+\rdt} = x_\ast^{t+\rdt}
+  \end{split}
+\]
 with DF a vertical diffusion term.
 The number of fractional time steps, $N$, is given by setting \np{nn\_zdfexp}, (namelist parameter).
 The scheme $(b)$ is unconditionally stable but diffusive. It can be written as follows:
-\begin{equation} \label{eq:STP_imp}
-   x^{t+\rdt} = x^{t-\rdt} + 2 \, \rdt \  \text{RHS}_x^{t+\rdt}
+\begin{equation}
+  \label{eq:STP_imp}
+  x^{t+\rdt} = x^{t-\rdt} + 2 \, \rdt \  \text{RHS}_x^{t+\rdt}
 \end{equation} 
 
@@ -161,19 +164,21 @@
 but it becomes attractive since a value of 3 or more is needed for N in the forward time differencing scheme.
 For example, the finite difference approximation of the temperature equation is:
-\begin{equation} \label{eq:STP_imp_zdf}
-\frac{T(k)^{t+1}-T(k)^{t-1}}{2\;\rdt}\equiv \text{RHS}+\frac{1}{e_{3t} }\delta 
-_k \left[ {\frac{A_w^{vT} }{e_{3w} }\delta _{k+1/2} \left[ {T^{t+1}} \right]} 
-\right]
-\end{equation}
+\[
+  % \label{eq:STP_imp_zdf}
+  \frac{T(k)^{t+1}-T(k)^{t-1}}{2\;\rdt}\equiv \text{RHS}+\frac{1}{e_{3t} }\delta
+  _k \left[ {\frac{A_w^{vT} }{e_{3w} }\delta_{k+1/2} \left[ {T^{t+1}} \right]}
+  \right]
+\]
 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}
--c(k+1)\;T^{t+1}(k+1) + d(k)\;T^{t+1}(k) - \;c(k)\;T^{t+1}(k-1) \equiv b(k)
+\begin{equation}
+  \label{eq:STP_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}
 where 
-\begin{align*} 
- c(k) &= A_w^{vT} (k) \, / \, e_{3w} (k)     \\
- d(k) &= e_{3t} (k)       \, / \, (2\rdt) + c_k + c_{k+1}    \\
- b(k) &= e_{3t} (k) \; \left( T^{t-1}(k) \, / \, (2\rdt) + \text{RHS} \right)    
+\begin{align*}
+  c(k) &= A_w^{vT} (k) \, / \, e_{3w} (k)     \\
+  d(k) &= e_{3t} (k)       \, / \, (2\rdt) + c_k + c_{k+1}    \\
+  b(k) &= e_{3t} (k) \; \left( T^{t-1}(k) \, / \, (2\rdt) + \text{RHS} \right)    
 \end{align*}
 
@@ -199,5 +204,6 @@
   \begin{center}
     \includegraphics[width=0.7\textwidth]{Fig_TimeStepping_flowchart}
-    \caption{ 	\protect\label{fig:TimeStep_flowchart}
+    \caption{
+      \protect\label{fig:TimeStep_flowchart}
       Sketch of the leapfrog time stepping sequence in \NEMO from \citet{Leclair_Madec_OM09}.
       The use of a semi-implicit computation of the hydrostatic pressure gradient requires the tracer equation to
@@ -208,5 +214,6 @@
       (see \autoref{sec:DYN_spg}).
     }
-\end{center}   \end{figure}
+  \end{center}
+\end{figure}
 %>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 %}
@@ -226,8 +233,8 @@
 and the time filter is given by \autoref{eq:STP_asselin} so that $Q$ is redistributed over several time step.
 In the modified LF-RA environment, these two formulations have been replaced by:
-\begin{align} 
-x^{t+\rdt}  &= x^{t-\rdt} + \rdt \left( Q^{t-\rdt/2} + Q^{t+\rdt/2} \right)                   \label{eq:STP_forcing} \\
-%
-x_F^t  &= x^t + \gamma \, \left[ x_F^{t-\rdt} - 2 x^t + x^{t+\rdt} \right] 
+\begin{align}
+  x^{t+\rdt}  &= x^{t-\rdt} + \rdt \left( Q^{t-\rdt/2} + Q^{t+\rdt/2} \right)                   \label{eq:STP_forcing} \\
+  %
+  x_F^t  &= x^t + \gamma \, \left[ x_F^{t-\rdt} - 2 x^t + x^{t+\rdt} \right]
            - \gamma\,\rdt \, \left[ Q^{t+\rdt/2} -  Q^{t-\rdt/2} \right]                          \label{eq:STP_RA}
 \end{align}
@@ -259,5 +266,6 @@
   \begin{center}
     \includegraphics[width=0.90\textwidth]{Fig_MLF_forcing}
-    \caption{ 	\protect\label{fig:MLF_forcing}
+    \caption{
+      \protect\label{fig:MLF_forcing}
       Illustration of forcing integration methods.
       (top) ''Traditional'' formulation:
@@ -284,7 +292,8 @@
 The first time step of this three level scheme when starting from initial conditions is a forward step
 (Euler time integration):
-\begin{equation} \label{eq:DOM_euler}
-	x^1 = x^0 + \rdt \ \text{RHS}^0
-\end{equation}
+\[
+  % \label{eq:DOM_euler}
+  x^1 = x^0 + \rdt \ \text{RHS}^0
+\]
 This is done simply by keeping the leapfrog environment ($i.e.$ the \autoref{eq:STP} three level time stepping) but
 setting all $x^0$ (\textit{before}) and $x^{1}$ (\textit{now}) fields equal at the first time step and
@@ -301,5 +310,5 @@
 (see \autoref{subsec:DYN_hpg_imp}), an extra three-dimensional field has to
 be added to the restart file to ensure an exact restartability.
-This is done optionally via the  \np{nn\_dynhpg\_rst} namelist parameter,
+This is done optionally via the \np{nn\_dynhpg\_rst} namelist parameter,
 so that the size of the restart file can be reduced when restartability is not a key issue
 (operational oceanography or in ensemble simulations for seasonal forecasting).
@@ -307,5 +316,5 @@
 Note the size of the time step used, $\rdt$, is also saved in the restart file.
 When restarting, if the the time step has been changed, a restart using an Euler time stepping scheme is imposed. 
-Options are defined through the  \ngn{namrun} namelist variables.
+Options are defined through the \ngn{namrun} namelist variables.
 %%%
 \gmcomment{
@@ -351,45 +360,45 @@
 
 \begin{flalign*}
-&\frac{\left( e_{3t}\,T \right)_k^{t+1}-\left( e_{3t}\,T \right)_k^{t-1}}{2\rdt}
-\equiv \text{RHS}+ \delta _k \left[ {\frac{A_w^{vt} }{e_{3w}^{t+1} }\delta _{k+1/2} \left[ {T^{t+1}} \right]} 
-\right]      \\
-&\left( e_{3t}\,T \right)_k^{t+1}-\left( e_{3t}\,T \right)_k^{t-1}
-\equiv {2\rdt} \ \text{RHS}+ {2\rdt} \ \delta _k \left[ {\frac{A_w^{vt} }{e_{3w}^{t+1} }\delta _{k+1/2} \left[ {T^{t+1}} \right]} 
-\right]      \\
-&\left( e_{3t}\,T \right)_k^{t+1}-\left( e_{3t}\,T \right)_k^{t-1}
-\equiv 2\rdt \ \text{RHS}
-+ 2\rdt \ \left\{ \left[ \frac{A_w^{vt}}{e_{3w}^{t+1}} \right]_{k+1/2} [ T_{k+1}^{t+1} - T_k      ^{t+1} ]
-                          - \left[ \frac{A_w^{vt}}{e_{3w}^{t+1}} \right]_{k-1/2} [ T_k       ^{t+1} - T_{k-1}^{t+1} ]  \right\}     \\
-&\\
-&\left( e_{3t}\,T \right)_k^{t+1}
--  {2\rdt} \           \left[ \frac{A_w^{vt}}{e_{3w}^{t+1}} \right]_{k+1/2}                  T_{k+1}^{t+1} 
-+ {2\rdt} \ \left\{  \left[ \frac{A_w^{vt}}{e_{3w}^{t+1}} \right]_{k+1/2} 
-                            +  \left[ \frac{A_w^{vt}}{e_{3w}^{t+1}} \right]_{k-1/2}     \right\}   T_{k    }^{t+1}
--  {2\rdt} \           \left[ \frac{A_w^{vt}}{e_{3w}^{t+1}} \right]_{k-1/2}                  T_{k-1}^{t+1}      \\
-&\equiv \left( e_{3t}\,T \right)_k^{t-1} + {2\rdt} \ \text{RHS}    \\
-%
+  &\frac{\left( e_{3t}\,T \right)_k^{t+1}-\left( e_{3t}\,T \right)_k^{t-1}}{2\rdt}
+  \equiv \text{RHS}+ \delta_k \left[ {\frac{A_w^{vt} }{e_{3w}^{t+1} }\delta_{k+1/2} \left[ {T^{t+1}} \right]}
+  \right]      \\
+  &\left( e_{3t}\,T \right)_k^{t+1}-\left( e_{3t}\,T \right)_k^{t-1}
+  \equiv {2\rdt} \ \text{RHS}+ {2\rdt} \ \delta_k \left[ {\frac{A_w^{vt} }{e_{3w}^{t+1} }\delta_{k+1/2} \left[ {T^{t+1}} \right]}
+  \right]      \\
+  &\left( e_{3t}\,T \right)_k^{t+1}-\left( e_{3t}\,T \right)_k^{t-1}
+  \equiv 2\rdt \ \text{RHS}
+  + 2\rdt \ \left\{ \left[ \frac{A_w^{vt}}{e_{3w}^{t+1}} \right]_{k+1/2} [ T_{k+1}^{t+1} - T_k      ^{t+1} ]
+    - \left[ \frac{A_w^{vt}}{e_{3w}^{t+1}} \right]_{k-1/2} [ T_k       ^{t+1} - T_{k-1}^{t+1} ]  \right\}     \\
+  &\\
+  &\left( e_{3t}\,T \right)_k^{t+1}
+  -  {2\rdt} \           \left[ \frac{A_w^{vt}}{e_{3w}^{t+1}} \right]_{k+1/2}                  T_{k+1}^{t+1}
+  + {2\rdt} \ \left\{  \left[ \frac{A_w^{vt}}{e_{3w}^{t+1}} \right]_{k+1/2}
+    +  \left[ \frac{A_w^{vt}}{e_{3w}^{t+1}} \right]_{k-1/2}     \right\}   T_{k    }^{t+1}
+  -  {2\rdt} \           \left[ \frac{A_w^{vt}}{e_{3w}^{t+1}} \right]_{k-1/2}                  T_{k-1}^{t+1}      \\
+  &\equiv \left( e_{3t}\,T \right)_k^{t-1} + {2\rdt} \ \text{RHS}    \\
+  % 
 \end{flalign*}
 
 \begin{flalign*}
-\allowdisplaybreaks
-\intertext{ Tracer case }
-%
-&  \qquad \qquad  \quad   -  {2\rdt}                  \ \left[ \frac{A_w^{vt}}{e_{3w}^{t+1}} \right]_{k+1/2}   
-                                                                                                      \qquad \qquad \qquad  \qquad  T_{k+1}^{t+1}   \\
-&+ {2\rdt} \ \biggl\{  (e_{3t})_{k   }^{t+1}  \bigg. +    \left[ \frac{A_w^{vt}}{e_{3w}^{t+1}} \right]_{k+1/2}  
-                                                                               +   \left[ \frac{A_w^{vt}}{e_{3w}^{t+1}} \right]_{k-1/2} \bigg. \biggr\}  \ \ \ T_{k   }^{t+1}  &&\\
-& \qquad \qquad  \qquad \qquad \qquad \quad \ \ -  {2\rdt} \                          \left[ \frac{A_w^{vt}}{e_{3w}^{t+1}} \right]_{k-1/2}                          \quad \ \ T_{k-1}^{t+1}     
-\ \equiv \ \left( e_{3t}\,T \right)_k^{t-1} + {2\rdt} \ \text{RHS}  \\
-%
+  \allowdisplaybreaks
+  \intertext{ Tracer case }
+  %
+  &  \qquad \qquad  \quad   -  {2\rdt}                  \ \left[ \frac{A_w^{vt}}{e_{3w}^{t+1}} \right]_{k+1/2}
+  \qquad \qquad \qquad  \qquad  T_{k+1}^{t+1}   \\
+  &+ {2\rdt} \ \biggl\{  (e_{3t})_{k   }^{t+1}  \bigg. +    \left[ \frac{A_w^{vt}}{e_{3w}^{t+1}} \right]_{k+1/2}
+  +   \left[ \frac{A_w^{vt}}{e_{3w}^{t+1}} \right]_{k-1/2} \bigg. \biggr\}  \ \ \ T_{k   }^{t+1}  &&\\
+  & \qquad \qquad  \qquad \qquad \qquad \quad \ \ -  {2\rdt} \                          \left[ \frac{A_w^{vt}}{e_{3w}^{t+1}} \right]_{k-1/2}                          \quad \ \ T_{k-1}^{t+1}
+  \ \equiv \ \left( e_{3t}\,T \right)_k^{t-1} + {2\rdt} \ \text{RHS}  \\
+  %
 \end{flalign*}
 \begin{flalign*}
-\allowdisplaybreaks
-\intertext{ Tracer content case }
-%
-& -  {2\rdt} \              & \frac{(A_w^{vt})_{k+1/2}} {(e_{3w})_{k+1/2}^{t+1}\;(e_{3t})_{k+1}^{t+1}}  && \  \left( e_{3t}\,T \right)_{k+1}^{t+1}   &\\
-& + {2\rdt} \ \left[ 1  \right.+ & \frac{(A_w^{vt})_{k+1/2}} {(e_{3w})_{k+1/2}^{t+1}\;(e_{3t})_k^{t+1}} 
-                                    + & \frac{(A_w^{vt})_{k -1/2}} {(e_{3w})_{k -1/2}^{t+1}\;(e_{3t})_k^{t+1}}  \left.  \right]  & \left( e_{3t}\,T \right)_{k   }^{t+1}  &\\
-& -  {2\rdt} \               & \frac{(A_w^{vt})_{k -1/2}} {(e_{3w})_{k -1/2}^{t+1}\;(e_{3t})_{k-1}^{t+1}}     &\  \left( e_{3t}\,T \right)_{k-1}^{t+1}   
-\equiv \left( e_{3t}\,T \right)_k^{t-1} + {2\rdt} \ \text{RHS}  &
+  \allowdisplaybreaks
+  \intertext{ Tracer content case }
+  %
+  & -  {2\rdt} \              & \frac{(A_w^{vt})_{k+1/2}} {(e_{3w})_{k+1/2}^{t+1}\;(e_{3t})_{k+1}^{t+1}}  && \  \left( e_{3t}\,T \right)_{k+1}^{t+1}   &\\
+  & + {2\rdt} \ \left[ 1  \right.+ & \frac{(A_w^{vt})_{k+1/2}} {(e_{3w})_{k+1/2}^{t+1}\;(e_{3t})_k^{t+1}}
+  + & \frac{(A_w^{vt})_{k -1/2}} {(e_{3w})_{k -1/2}^{t+1}\;(e_{3t})_k^{t+1}}  \left.  \right]  & \left( e_{3t}\,T \right)_{k   }^{t+1}  &\\
+  & -  {2\rdt} \               & \frac{(A_w^{vt})_{k -1/2}} {(e_{3w})_{k -1/2}^{t+1}\;(e_{3t})_{k-1}^{t+1}}     &\  \left( e_{3t}\,T \right)_{k-1}^{t+1}
+  \equiv \left( e_{3t}\,T \right)_k^{t-1} + {2\rdt} \ \text{RHS}  &
 \end{flalign*}
 
@@ -397,3 +406,5 @@
 }
 %%
+\biblio
+
 \end{document}
