New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 10502 for NEMO/trunk/doc/latex/NEMO/subfiles/chap_DOM.tex – NEMO

Ignore:
Timestamp:
2019-01-10T18:45:21+01:00 (5 years ago)
Author:
nicolasmartin
Message:

Global work on math environnements for equations (partial commits)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/doc/latex/NEMO/subfiles/chap_DOM.tex

    r10442 r10502  
    33\begin{document} 
    44% ================================================================ 
    5 % Chapter 2 Space and Time Domain (DOM) 
     5% Chapter 2 ——— Space and Time Domain (DOM) 
    66% ================================================================ 
    77\chapter{Space Domain (DOM)} 
     
    4040\begin{figure}[!tb] 
    4141  \begin{center} 
    42     \includegraphics[width=0.90\textwidth]{Fig_cell} 
     42    \includegraphics[]{Fig_cell} 
    4343    \caption{ 
    4444      \protect\label{fig:cell} 
     
    4646      $t$ indicates scalar points where temperature, salinity, density, pressure and 
    4747      horizontal divergence are defined. 
    48       ($u$,$v$,$w$) indicates vector points, 
    49       and $f$ indicates vorticity points where both relative and planetary vorticities are defined 
     48      $(u,v,w)$ indicates vector points, and $f$ indicates vorticity points where both relative and 
     49      planetary vorticities are defined. 
    5050    } 
    5151  \end{center} 
     
    6464the barotropic stream function $\psi$ is defined at horizontal points overlying the $\zeta$ and $f$-points. 
    6565 
    66 The ocean mesh (\ie the position of all the scalar and vector points) is defined by 
    67 the transformation that gives ($\lambda$ ,$\varphi$ ,$z$) as a function of $(i,j,k)$. 
     66The ocean mesh (\ie the position of all the scalar and vector points) is defined by the transformation that 
     67gives $(\lambda,\varphi,z)$ as a function of $(i,j,k)$. 
    6868The grid-points are located at integer or integer and a half value of $(i,j,k)$ as indicated on \autoref{tab:cell}. 
    6969In all the following, subscripts $u$, $v$, $w$, $f$, $uw$, $vw$ or $fw$ indicate the position of 
    7070the grid-point where the scale factors are defined. 
    7171Each scale factor is defined as the local analytical value provided by \autoref{eq:scale_factors}. 
    72 As a result, 
    73 the mesh on which partial derivatives $\frac{\partial}{\partial \lambda}, \frac{\partial}{\partial \varphi}$, 
    74 and $\frac{\partial}{\partial z} $ are evaluated is a uniform mesh with a grid size of unity. 
    75 Discrete partial derivatives are formulated by the traditional, 
    76 centred second order finite difference approximation while 
    77 the scale factors are chosen equal to their local analytical value. 
     72As a result, the mesh on which partial derivatives $\pd[]{\lambda}$, $\pd[]{\varphi}$ and 
     73$\pd[]{z}$ are evaluated in a uniform mesh with a grid size of unity. 
     74Discrete partial derivatives are formulated by the traditional, centred second order finite difference approximation 
     75while the scale factors are chosen equal to their local analytical value. 
    7876An important point here is that the partial derivative of the scale factors must be evaluated by 
    7977centred finite difference approximation, not from their analytical expression. 
    80 This preserves the symmetry of the discrete set of equations and 
    81 therefore satisfies many of the continuous properties (see \autoref{apdx:C}). 
     78This preserves the symmetry of the discrete set of equations and therefore satisfies many of 
     79the continuous properties (see \autoref{apdx:C}). 
    8280A similar, related remark can be made about the domain size: 
    8381when needed, an area, volume, or the total ocean depth must be evaluated as the sum of the relevant scale factors 
    84 (see \autoref{eq:DOM_bar}) in the next section). 
     82(see \autoref{eq:DOM_bar} in the next section). 
    8583 
    8684%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    8987    \begin{tabular}{|p{46pt}|p{56pt}|p{56pt}|p{56pt}|} 
    9088      \hline 
    91       T  &$i$     & $j$    & $k$     \\ \hline 
    92       u  & $i+1/2$   & $j$    & $k$    \\ \hline 
    93       v  & $i$    & $j+1/2$   & $k$    \\ \hline 
    94       w  & $i$    & $j$    & $k+1/2$   \\ \hline 
    95       f  & $i+1/2$   & $j+1/2$   & $k$    \\ \hline 
    96       uw & $i+1/2$   & $j$    & $k+1/2$   \\ \hline 
    97       vw & $i$    & $j+1/2$   & $k+1/2$   \\ \hline 
    98       fw & $i+1/2$   & $j+1/2$   & $k+1/2$   \\ \hline 
     89      T  & $i      $ & $j      $ & $k      $ \\ 
     90      \hline 
     91      u  & $i + 1/2$ & $j      $ & $k      $ \\ 
     92      \hline 
     93      v  & $i      $ & $j + 1/2$ & $k      $ \\ 
     94      \hline 
     95      w  & $i      $ & $j      $ & $k + 1/2$ \\ 
     96      \hline 
     97      f  & $i + 1/2$ & $j + 1/2$ & $k      $ \\ 
     98      \hline 
     99      uw & $i + 1/2$ & $j      $ & $k + 1/2$ \\ 
     100      \hline 
     101      vw & $i      $ & $j + 1/2$ & $k + 1/2$ \\ 
     102      \hline 
     103      fw & $i + 1/2$ & $j + 1/2$ & $k + 1/2$ \\ 
     104      \hline 
    99105    \end{tabular} 
    100106    \caption{ 
    101107      \protect\label{tab:cell} 
    102108      Location of grid-points as a function of integer or integer and a half value of the column, line or level. 
    103       This indexing is only used for the writing of the semi-discrete equation. 
     109      This indexing is only used for the writing of the semi -discrete equation. 
    104110      In the code, the indexing uses integer values only and has a reverse direction in the vertical 
    105111      (see \autoref{subsec:DOM_Num_Index}) 
     
    115121\label{subsec:DOM_operators} 
    116122 
    117 Given the values of a variable $q$ at adjacent points, 
    118 the differencing and averaging operators at the midpoint between them are: 
    119 \[ 
     123Given the values of a variable $q$ at adjacent points, the differencing and averaging operators at 
     124the midpoint between them are: 
     125\begin{alignat*}{2} 
    120126  % \label{eq:di_mi} 
    121   \begin{split} 
    122     \delta_i [q]       &=  \  \    q(i+1/2)  - q(i-1/2)     \\ 
    123     \overline q^{\,i} &= \left\{ q(i+1/2) + q(i-1/2) \right\} \; / \; 2 
    124   \end{split} 
    125 \] 
    126  
    127 Similar operators are defined with respect to $i+1/2$, $j$, $j+1/2$, $k$, and $k+1/2$. 
     127  \delta_i [q]      &= &       &q (i + 1/2) - q (i - 1/2) \\ 
     128  \overline q^{\, i} &= &\big\{ &q (i + 1/2) + q (i - 1/2) \big\} / 2 
     129\end{alignat*} 
     130 
     131Similar operators are defined with respect to $i + 1/2$, $j$, $j + 1/2$, $k$, and $k + 1/2$. 
    128132Following \autoref{eq:PE_grad} and \autoref{eq:PE_lap}, the gradient of a variable $q$ defined at 
    129133a $t$-point has its three components defined at $u$-, $v$- and $w$-points while 
    130 its Laplacien is defined at $t$-point. 
    131 These operators have the following discrete forms in the curvilinear $s$-coordinate system: 
     134its Laplacian is defined at $t$-point. 
     135These operators have the following discrete forms in the curvilinear $s$-coordinates system: 
    132136\[ 
    133137  % \label{eq:DOM_grad} 
    134   \nabla q\equiv  \frac{1}{e_{1u} } \delta_{i+1/2 } [q] \;\,\mathbf{i} 
    135   +   \frac{1}{e_{2v} } \delta_{j+1/2 } [q] \;\,\mathbf{j} 
    136   +   \frac{1}{e_{3w}} \delta_{k+1/2} [q] \;\,\mathbf{k} 
     138  \nabla q \equiv   \frac{1}{e_{1u}} \delta_{i + 1/2} [q] \; \, \vect i 
     139                  + \frac{1}{e_{2v}} \delta_{j + 1/2} [q] \; \, \vect j 
     140                  + \frac{1}{e_{3w}} \delta_{k + 1/2} [q] \; \, \vect k 
    137141\] 
    138142\begin{multline*} 
    139143  % \label{eq:DOM_lap} 
    140   \Delta q\equiv \frac{1}{e_{1t}\,e_{2t}\,e_{3t} } 
    141   \;\left(          \delta_i  \left[ \frac{e_{2u}\,e_{3u}} {e_{1u}} \;\delta_{i+1/2} [q] \right] 
    142     +                        \delta_j  \left[ \frac{e_{1v}\,e_{3v}}  {e_{2v}} \;\delta_{j+1/2} [q] \right] \;  \right)     \\ 
    143   +\frac{1}{e_{3t}} \delta_k \left[ \frac{1}{e_{3w} }                     \;\delta_{k+1/2} [q] \right] 
     144  \Delta q \equiv   \frac{1}{e_{1t} \, e_{2t} \, e_{3t}} 
     145                    \; \lt[   \delta_i \lt( \frac{e_{2u} \, e_{3u}}{e_{1u}} \; \delta_{i + 1/2} [q] \rt) 
     146                            + \delta_j \lt( \frac{e_{1v} \, e_{3v}}{e_{2v}} \; \delta_{j + 1/2} [q] \rt) \; \rt] \\ 
     147                  + \frac{1}{e_{3t}} 
     148                              \delta_k \lt[ \frac{1              }{e_{3w}} \; \delta_{k + 1/2} [q] \rt] 
    144149\end{multline*} 
    145150 
    146 Following \autoref{eq:PE_curl} and \autoref{eq:PE_div}, a vector ${\rm {\bf A}}=\left( a_1,a_2,a_3\right)$ 
    147 defined at vector points $(u,v,w)$ has its three curl components defined at $vw$-, $uw$, and $f$-points, 
    148 and its divergence defined at $t$-points: 
    149 \begin{align*} 
    150   % \label{eq:DOM_curl} 
    151   \nabla \times {\rm{\bf A}}\equiv & 
    152                                      \frac{1}{e_{2v}\,e_{3vw} } \ \left( \delta_{j +1/2} \left[e_{3w}\,a_3 \right] -\delta_{k+1/2} \left[e_{2v} \,a_2 \right] \right)  &\ \mathbf{i} \\ 
    153   +& \frac{1}{e_{2u}\,e_{3uw}} \ \left( \delta_{k+1/2} \left[e_{1u}\,a_1  \right] -\delta_{i +1/2} \left[e_{3w}\,a_3 \right] \right)  &\ \mathbf{j} \\ 
    154   +& \frac{1}{e_{1f} \,e_{2f}    } \ \left( \delta_{i +1/2} \left[e_{2v}\,a_2  \right] -\delta_{j +1/2} \left[e_{1u}\,a_1 \right] \right)  &\ \mathbf{k} 
    155 \end{align*} 
    156 \begin{align*} 
    157   % \label{eq:DOM_div} 
    158   \nabla \cdot \rm{\bf A} \equiv 
    159   \frac{1}{e_{1t}\,e_{2t}\,e_{3t}} \left( \delta_i \left[e_{2u}\,e_{3u}\,a_1 \right] 
    160   +\delta_j \left[e_{1v}\,e_{3v}\,a_2 \right] \right)+\frac{1}{e_{3t} }\delta_k \left[a_3 \right] 
    161 \end{align*} 
     151Following \autoref{eq:PE_curl} and \autoref{eq:PE_div}, a vector $\vect A = (a_1,a_2,a_3)$ defined at 
     152vector points $(u,v,w)$ has its three curl components defined at $vw$-, $uw$, and $f$-points, and 
     153its divergence defined at $t$-points: 
     154\begin{multline} 
     155% \label{eq:DOM_curl} 
     156  \nabla \times \vect A \equiv   \frac{1}{e_{2v} \, e_{3vw}} 
     157                                 \Big[   \delta_{j + 1/2} (e_{3w} \, a_3) 
     158                                       - \delta_{k + 1/2} (e_{2v} \, a_2) \Big] \vect i \\ 
     159                               + \frac{1}{e_{2u} \, e_{3uw}} 
     160                                 \Big[   \delta_{k + 1/2} (e_{1u} \, a_1) 
     161                                       - \delta_{i + 1/2} (e_{3w} \, a_3) \Big] \vect j \\ 
     162                               + \frac{1}{e_{1f} \, e_{2f}} 
     163                                 \Big[   \delta_{i + 1/2} (e_{2v} \, a_2) 
     164                                       - \delta_{j + 1/2} (e_{1u} \, a_1) \Big] \vect k 
     165\end{multline} 
     166\begin{equation} 
     167% \label{eq:DOM_div} 
     168  \nabla \cdot \vect A \equiv   \frac{1}{e_{1t} \, e_{2t} \, e_{3t}} 
     169                                \Big[ \delta_i (e_{2u} \, e_{3u} \, a_1) + \delta_j (e_{1v} \, e_{3v} \, a_2) \Big] 
     170                              + \frac{1}{e_{3t}} \delta_k (a_3) 
     171\end{equation} 
    162172 
    163173The vertical average over the whole water column denoted by an overbar becomes for a quantity $q$ which 
    164 is a masked field (\ie equal to zero inside solid area): 
     174is a masked field (i.e. equal to zero inside solid area): 
    165175\begin{equation} 
    166176  \label{eq:DOM_bar} 
    167   \bar q    =         \frac{1}{H}    \int_{k^b}^{k^o} {q\;e_{3q} \,dk} 
    168   \equiv \frac{1}{H_q }\sum\limits_k {q\;e_{3q} } 
     177  \bar q = \frac{1}{H} \int_{k^b}^{k^o} q \; e_{3q} \, dk \equiv \frac{1}{H_q} \sum \limits_k q \; e_{3q} 
    169178\end{equation} 
    170179where $H_q$  is the ocean depth, which is the masked sum of the vertical scale factors at $q$ points, 
    171 $k^b$ and $k^o$ are the bottom and surface $k$-indices, 
    172 and the symbol $k^o$ refers to a summation over all grid points of the same type in the direction indicated by 
    173 the subscript (here $k$).  
     180$k^b$ and $k^o$ are the bottom and surface $k$-indices, and the symbol $k^o$ refers to a summation over 
     181all grid points of the same type in the direction indicated by the subscript (here $k$). 
    174182 
    175183In continuous form, the following properties are satisfied: 
    176 \begin{equation} 
     184\begin{gather} 
    177185  \label{eq:DOM_curl_grad} 
    178   \nabla \times \nabla q ={\rm {\bf {0}}} 
    179 \end{equation} 
    180 \begin{equation} 
     186  \nabla \times \nabla q = \vect 0 \\ 
    181187  \label{eq:DOM_div_curl} 
    182   \nabla \cdot \left( {\nabla \times {\rm {\bf A}}} \right)=0 
    183 \end{equation} 
     188  \nabla \cdot (\nabla \times \vect A) = 0 
     189\end{gather} 
    184190 
    185191It is straightforward to demonstrate that these properties are verified locally in discrete form as soon as 
    186 the scalar $q$ is taken at $t$-points and 
    187 the vector \textbf{A} has its components defined at vector points $(u,v,w)$. 
     192the scalar $q$ is taken at $t$-points and the vector $\vect A$ has its components defined at 
     193vector points $(u,v,w)$. 
    188194 
    189195Let $a$ and $b$ be two fields defined on the mesh, with value zero inside continental area. 
    190 Using integration by parts it can be shown that 
    191 the differencing operators ($\delta_i$, $\delta_j$ and $\delta_k$) are skew-symmetric linear operators, 
    192 and further that the averaging operators $\overline{\,\cdot\,}^{\,i}$, $\overline{\,\cdot\,}^{\,k}$ and 
    193 $\overline{\,\cdot\,}^{\,k}$) are symmetric linear operators, \ie 
    194 \begin{align} 
     196Using integration by parts it can be shown that the differencing operators ($\delta_i$, $\delta_j$ and $\delta_k$) 
     197are skew-symmetric linear operators, and further that the averaging operators $\overline{\cdots}^{\, i}$, 
     198$\overline{\cdots}^{\, j}$ and $\overline{\cdots}^{\, k}$) are symmetric linear operators, \ie 
     199\begin{alignat}{4} 
    195200  \label{eq:DOM_di_adj} 
    196   \sum\limits_i { a_i \;\delta_i \left[ b \right]} 
    197   &\equiv -\sum\limits_i {\delta_{i+1/2} \left[ a \right]\;b_{i+1/2} }      \\ 
     201  &\sum \limits_i a_i \; \delta_i [b]      &\equiv &- &&\sum \limits_i \delta      _{   i + 1/2} [a] &b_{i + 1/2} \\ 
    198202  \label{eq:DOM_mi_adj} 
    199   \sum\limits_i { a_i \;\overline b^{\,i}} 
    200   & \equiv \quad \sum\limits_i {\overline a ^{\,i+1/2}\;b_{i+1/2} } 
    201 \end{align} 
    202  
    203 In other words, the adjoint of the differencing and averaging operators are $\delta_i^*=\delta_{i+1/2}$ and  
    204 ${(\overline{\,\cdot \,}^{\,i})}^*= \overline{\,\cdot\,}^{\,i+1/2}$, respectively.  
     203  &\sum \limits_i a_i \; \overline b^{\, i} &\equiv &  &&\sum \limits_i \overline a ^{\, i + 1/2}     &b_{i + 1/2} 
     204\end{alignat} 
     205 
     206In other words, the adjoint of the differencing and averaging operators are $\delta_i^* = \delta_{i + 1/2}$ and  
     207$(\overline{\cdots}^{\, i})^* = \overline{\cdots}^{\, i + 1/2}$, respectively. 
    205208These two properties will be used extensively in the \autoref{apdx:C} to 
    206209demonstrate integral conservative properties of the discrete formulation chosen. 
     
    215218\begin{figure}[!tb] 
    216219  \begin{center} 
    217     \includegraphics[width=0.90\textwidth]{Fig_index_hor} 
     220    \includegraphics[]{Fig_index_hor} 
    218221    \caption{ 
    219222      \protect\label{fig:index_hor} 
     
    230233Therefore a specific integer indexing must be defined for points other than $t$-points 
    231234(\ie velocity and vorticity grid-points). 
    232 Furthermore, the direction of the vertical indexing has been changed so that the surface level is at $k=1$. 
     235Furthermore, the direction of the vertical indexing has been changed so that the surface level is at $k = 1$. 
    233236 
    234237% ----------------------------------- 
     
    250253\label{subsec:DOM_Num_Index_vertical} 
    251254 
    252 In the vertical, the chosen indexing requires special attention since 
    253 the $k$-axis is re-orientated downward in the \fortran code compared to 
    254 the indexing used in the semi-discrete equations and given in \autoref{subsec:DOM_cell}. 
    255 The sea surface corresponds to the $w$-level $k=1$ which is the same index as $t$-level just below 
     255In the vertical, the chosen indexing requires special attention since the $k$-axis is re-orientated downward in 
     256the \fortran code compared to the indexing used in the semi -discrete equations and 
     257given in \autoref{subsec:DOM_cell}. 
     258The sea surface corresponds to the $w$-level $k = 1$ which is the same index as $t$-level just below 
    256259(\autoref{fig:index_vert}). 
    257 The last $w$-level ($k=jpk$) either corresponds to the ocean floor or is inside the bathymetry while 
     260The last $w$-level ($k = jpk$) either corresponds to the ocean floor or is inside the bathymetry while 
    258261the last $t$-level is always inside the bathymetry (\autoref{fig:index_vert}). 
    259262Note that for an increasing $k$ index, a $w$-point and the $t$-point just below have the same $k$ index, 
     
    262265have the same $i$ or $j$ index 
    263266(compare the dashed area in \autoref{fig:index_hor} and \autoref{fig:index_vert}). 
    264 Since the scale factors are chosen to be strictly positive, a \emph{minus sign} appears in the \fortran  
    265 code \emph{before all the vertical derivatives} of the discrete equations given in this documentation. 
     267Since the scale factors are chosen to be strictly positive, 
     268a \textit{minus sign} appears in the \fortran code \textit{before all the vertical derivatives} of 
     269the discrete equations given in this documentation. 
    266270 
    267271%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    268272\begin{figure}[!pt] 
    269273  \begin{center} 
    270     \includegraphics[width=.90\textwidth]{Fig_index_vert} 
     274    \includegraphics[]{Fig_index_vert} 
    271275    \caption{ 
    272276      \protect\label{fig:index_vert} 
     
    287291The total size of the computational domain is set by the parameters \np{jpiglo}, 
    288292\np{jpjglo} and \np{jpkglo} in the $i$, $j$ and $k$ directions respectively. 
    289 %%% 
    290 %%% 
    291 %%% 
    292293Parameters $jpi$ and $jpj$ refer to the size of each processor subdomain when 
    293294the code is run in parallel using domain decomposition (\key{mpp\_mpi} defined, 
     
    299300\section{Needed fields} 
    300301\label{sec:DOM_fields} 
    301 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)$. 
     302The ocean mesh (\ie the position of all the scalar and vector points) is defined by the transformation that 
     303gives $(\lambda,\varphi,z)$ as a function of $(i,j,k)$. 
    302304The grid-points are located at integer or integer and a half values of as indicated in \autoref{tab:cell}. 
    303305The associated scale factors are defined using the analytical first derivative of the transformation 
    304306\autoref{eq:scale_factors}. 
    305 Necessary fields for configuration definition are: \\ 
    306 Geographic position : 
    307  
    308 longitude: glamt, glamu, glamv and glamf (at T, U, V and F point) 
    309  
    310 latitude: gphit, gphiu, gphiv and gphif (at T, U, V and F point)\\ 
    311 Coriolis parameter (if domain not on the sphere):  
    312  
    313  ff\_f  and  ff\_t (at T and F point)\\ 
    314 Scale factors :  
     307Necessary fields for configuration definition are: 
     308 
     309\begin{itemize} 
     310\item 
     311  Geographic position: 
     312  longitude with \texttt{glamt}, \texttt{glamu}, \texttt{glamv}, \texttt{glamf} and 
     313  latitude  with \texttt{gphit}, \texttt{gphiu}, \texttt{gphiv}, \texttt{gphif} 
     314  (all respectively at T, U, V and F point) 
     315\item 
     316  Coriolis parameter (if domain not on the sphere): \texttt{ff\_f} and \texttt{ff\_t} 
     317  (at T and F point) 
     318\item 
     319  Scale factors: 
     320  \texttt{e1t}, \texttt{e1u}, \texttt{e1v} and \texttt{e1f} (on i direction), 
     321  \texttt{e2t}, \texttt{e2u}, \texttt{e2v} and \texttt{e2f} (on j direction) and 
     322  \texttt{ie1e2u\_v}, \texttt{e1e2u}, \texttt{e1e2v}. \\ 
     323  \texttt{e1e2u}, \texttt{e1e2v} are u and v surfaces (if gridsize reduction in some straits),  
     324  \texttt{ie1e2u\_v} is to flag set u and v surfaces are neither read nor computed. 
     325\end{itemize} 
    315326  
    316  e1t, e1u, e1v and e1f (on i direction), 
    317  
    318  e2t, e2u, e2v and e2f (on j direction) and 
    319  
    320  ie1e2u\_v, e1e2u , e1e2v    
    321   
    322 e1e2u , e1e2v are u and v surfaces (if gridsize reduction in some straits)\\ 
    323 ie1e2u\_v is a flag to flag set u and  v surfaces are neither read nor computed.\\ 
    324   
    325 These fields can be read in an domain input file which name is setted in 
    326 \np{cn\_domcfg} parameter specified in \ngn{namcfg}. 
     327These fields can be read in an domain input file which name is setted in \np{cn\_domcfg} parameter specified in 
     328\ngn{namcfg}. 
    327329 
    328330\nlst{namcfg} 
    329 or they can be defined in an analytical way in MY\_SRC directory of the configuration. 
     331 
     332Or they can be defined in an analytical way in \path{MY_SRC} directory of the configuration. 
    330333For Reference Configurations of NEMO input domain files are supplied by NEMO System Team. 
    331 For analytical definition of input fields two routines are supplied: \mdl{userdef\_hgr} and \mdl{userdef\_zgr}. 
    332 They are an example of GYRE configuration parameters, and they are available in NEMO/OPA\_SRC/USR directory, 
    333 they provide the horizontal and vertical mesh.  
     334For analytical definition of input fields two routines are supplied: \mdl{usrdef\_hgr} and \mdl{usrdef\_zgr}. 
     335They are an example of GYRE configuration parameters, and they are available in \path{src/OCE/USR} directory, 
     336they provide the horizontal and vertical mesh. 
    334337% ------------------------------------------------------------------------------------------------------------- 
    335338%        Needed fields  
     
    366369($i$ and $j$, respectively) (geographical configuration of the mesh), 
    367370the horizontal mesh definition reduces to define the wanted $\lambda(i)$, $\varphi(j)$, 
    368 and their derivatives $\lambda'(i)$ $\varphi'(j)$ in the \mdl{domhgr} module. 
     371and their derivatives $\lambda'(i) \ \varphi'(j)$ in the \mdl{domhgr} module. 
    369372The model computes the grid-point positions and scale factors in the horizontal plane as follows: 
    370 \begin{flalign*} 
    371   \lambda_t &\equiv \text{glamt}= \lambda(i)   & \varphi_t &\equiv \text{gphit} = \varphi(j)\\ 
    372   \lambda_u &\equiv \text{glamu}= \lambda(i+1/2)& \varphi_u &\equiv \text{gphiu}= \varphi(j)\\ 
    373   \lambda_v &\equiv \text{glamv}= \lambda(i)       & \varphi_v &\equiv \text{gphiv} = \varphi(j+1/2)\\ 
    374   \lambda_f &\equiv \text{glamf }= \lambda(i+1/2)& \varphi_f &\equiv \text{gphif }= \varphi(j+1/2) 
    375 \end{flalign*} 
    376 \begin{flalign*} 
    377   e_{1t} &\equiv \text{e1t} = r_a |\lambda'(i)     \; \cos\varphi(j)  |& 
    378   e_{2t} &\equiv \text{e2t} = r_a |\varphi'(j)|  \\ 
    379   e_{1u} &\equiv \text{e1t} = r_a |\lambda'(i+1/2) \; \cos\varphi(j)  |& 
    380   e_{2u} &\equiv \text{e2t} = r_a |\varphi'(j)|\\ 
    381   e_{1v} &\equiv \text{e1t} = r_a |\lambda'(i)     \; \cos\varphi(j+1/2)  |& 
    382   e_{2v} &\equiv \text{e2t} = r_a |\varphi'(j+1/2)|\\ 
    383   e_{1f} &\equiv \text{e1t} = r_a |\lambda'(i+1/2)\; \cos\varphi(j+1/2)  |& 
    384   e_{2f} &\equiv \text{e2t} = r_a |\varphi'(j+1/2)| 
    385 \end{flalign*} 
     373\begin{align*} 
     374   \lambda_t &\equiv \text{glamt} =      \lambda (i      ) 
     375  &\varphi_t &\equiv \text{gphit} =      \varphi (j      ) \\ 
     376   \lambda_u &\equiv \text{glamu} =      \lambda (i + 1/2) 
     377  &\varphi_u &\equiv \text{gphiu} =      \varphi (j      ) \\ 
     378   \lambda_v &\equiv \text{glamv} =      \lambda (i      ) 
     379  &\varphi_v &\equiv \text{gphiv} =      \varphi (j + 1/2) \\ 
     380   \lambda_f &\equiv \text{glamf} =      \lambda (i + 1/2) 
     381  &\varphi_f &\equiv \text{gphif} =      \varphi (j + 1/2) \\ 
     382   e_{1t}    &\equiv \text{e1t}   = r_a |\lambda'(i      ) \; \cos\varphi(j      ) | 
     383  &e_{2t}    &\equiv \text{e2t}   = r_a |\varphi'(j      )                         | \\ 
     384   e_{1u}    &\equiv \text{e1t}   = r_a |\lambda'(i + 1/2) \; \cos\varphi(j      ) | 
     385  &e_{2u}    &\equiv \text{e2t}   = r_a |\varphi'(j      )                         | \\ 
     386   e_{1v}    &\equiv \text{e1t}   = r_a |\lambda'(i      ) \; \cos\varphi(j + 1/2) | 
     387  &e_{2v}    &\equiv \text{e2t}   = r_a |\varphi'(j + 1/2)                         | \\ 
     388   e_{1f}    &\equiv \text{e1t}   = r_a |\lambda'(i + 1/2) \; \cos\varphi(j + 1/2) | 
     389  &e_{2f}    &\equiv \text{e2t}   = r_a |\varphi'(j + 1/2)                         | 
     390\end{align*} 
    386391where the last letter of each computational name indicates the grid point considered and 
    387392$r_a$ is the earth radius (defined in \mdl{phycst} along with all universal constants). 
    388393Note that the horizontal position of and scale factors at $w$-points are exactly equal to those of $t$-points, 
    389 thus no specific arrays are defined at $w$-points.  
     394thus no specific arrays are defined at $w$-points. 
    390395 
    391396Note that the definition of the scale factors 
     
    405410\begin{figure}[!t] 
    406411  \begin{center} 
    407     \includegraphics[width=0.90\textwidth]{Fig_zgr_e3} 
     412    \includegraphics[]{Fig_zgr_e3} 
    408413    \caption{ 
    409414      \protect\label{fig:zgr_e3} 
    410415      Comparison of (a) traditional definitions of grid-point position and grid-size in the vertical, 
    411416      and (b) analytically derived grid-point position and scale factors. 
    412       For both grids here, 
    413       the same $w$-point depth has been chosen but in (a) the $t$-points are set half way between $w$-points while 
    414       in (b) they are defined from an analytical function: $z(k)=5\,(k-1/2)^3 - 45\,(k-1/2)^2 + 140\,(k-1/2) - 150$. 
     417      For both grids here, the same $w$-point depth has been chosen but 
     418      in (a) the $t$-points are set half way between $w$-points while 
     419      in (b) they are defined from an analytical function: 
     420      $z(k) = 5 \, (k - 1/2)^3 - 45 \, (k - 1/2)^2 + 140 \, (k - 1/2) - 150$. 
    415421      Note the resulting difference between the value of the grid-size $\Delta_k$ and 
    416422      those of the scale factor $e_k$. 
     
    426432\label{subsec:DOM_hgr_msh_choice} 
    427433 
    428  
    429434% ------------------------------------------------------------------------------------------------------------- 
    430435%        Grid files 
     
    434439 
    435440All the arrays relating to a particular ocean model configuration (grid-point position, scale factors, masks) 
    436 can be saved in files if \np{nn\_msh} $\not= 0$ (namelist variable in \ngn{namdom}). 
     441can be saved in files if \np{nn\_msh} $\not = 0$ (namelist variable in \ngn{namdom}). 
    437442This can be particularly useful for plots and off-line diagnostics. 
    438443In some cases, the user may choose to make a local modification of a scale factor in the code. 
     
    441446An example is Gibraltar Strait in the ORCA2 configuration. 
    442447When such modifications are done, 
    443 the output grid written when \np{nn\_msh} $\not= 0$ is no more equal to the input grid. 
     448the output grid written when \np{nn\_msh} $\not = 0$ is no more equal to the input grid. 
    444449 
    445450% ================================================================ 
     
    466471\begin{figure}[!tb] 
    467472  \begin{center} 
    468     \includegraphics[width=1.0\textwidth]{Fig_z_zps_s_sps} 
     473    \includegraphics[]{Fig_z_zps_s_sps} 
    469474    \caption{ 
    470475      \protect\label{fig:z_zps_s_sps} 
     
    475480      (d) hybrid $s-z$ coordinate, 
    476481      (e) hybrid $s-z$ coordinate with partial step, and 
    477       (f) same as (e) but in the non-linear free surface (\protect\np{ln\_linssh}\forcode{ = .false.}). 
     482      (f) same as (e) but in the non-linear free surface (\protect\np{ln\_linssh}~\forcode{= .false.}). 
    478483      Note that the non-linear free surface can be used with any of the 5 coordinates (a) to (e). 
    479484    } 
     
    485490must be done once of all at the beginning of an experiment. 
    486491It is not intended as an option which can be enabled or disabled in the middle of an experiment. 
    487 Three main choices are offered (\autoref{fig:z_zps_s_sps}a to c): 
    488 $z$-coordinate with full step bathymetry (\np{ln\_zco}\forcode{ = .true.}), 
    489 $z$-coordinate with partial step bathymetry (\np{ln\_zps}\forcode{ = .true.}), 
    490 or generalized, $s$-coordinate (\np{ln\_sco}\forcode{ = .true.}). 
     492Three main choices are offered (\autoref{fig:z_zps_s_sps}): 
     493$z$-coordinate with full step bathymetry (\np{ln\_zco}~\forcode{= .true.}), 
     494$z$-coordinate with partial step bathymetry (\np{ln\_zps}~\forcode{= .true.}), 
     495or generalized, $s$-coordinate (\np{ln\_sco}~\forcode{= .true.}). 
    491496Hybridation of the three main coordinates are available: 
    492 $s-z$ or $s-zps$ coordinate (\autoref{fig:z_zps_s_sps} and \autoref{fig:z_zps_s_sps}e). 
     497$s-z$ or $s-zps$ coordinate (\autoref{fig:z_zps_s_sps} and \autoref{fig:z_zps_s_sps}). 
    493498By default a non-linear free surface is used: the coordinate follow the time-variation of the free surface so that 
    494 the transformation is time dependent: $z(i,j,k,t)$ (\autoref{fig:z_zps_s_sps}f). 
    495 When a linear free surface is assumed (\np{ln\_linssh}\forcode{ = .true.}), 
    496 the vertical coordinate are fixed in time, but the seawater can move up and down across the z=0 surface 
    497 (in other words, the top of the ocean in not a rigid-lid).  
     499the transformation is time dependent: $z(i,j,k,t)$ (\autoref{fig:z_zps_s_sps}). 
     500When a linear free surface is assumed (\np{ln\_linssh}~\forcode{= .true.}), 
     501the vertical coordinate are fixed in time, but the seawater can move up and down across the $z_0$ surface 
     502(in other words, the top of the ocean in not a rigid-lid). 
    498503The last choice in terms of vertical coordinate concerns the presence (or not) in 
    499504the model domain of ocean cavities beneath ice shelves. 
     
    502507and partial step are also applied at the ocean/ice shelf interface. 
    503508 
    504 Contrary to the horizontal grid, the vertical grid is computed in the code and 
    505 no provision is made for reading it from a file. 
     509Contrary to the horizontal grid, the vertical grid is computed in the code and no provision is made for 
     510reading it from a file. 
    506511The only input file is the bathymetry (in meters) (\ifile{bathy\_meter}) 
    507512\footnote{ 
    508513  N.B. in full step $z$-coordinate, a \ifile{bathy\_level} file can replace the \ifile{bathy\_meter} file, 
    509   so that the computation of the number of wet ocean point in each water column is by-passed 
    510 }.  
    511 If \np{ln\_isfcav}\forcode{ = .true.}, 
    512 an extra file input file describing the ice shelf draft (in meters) (\ifile{isf\_draft\_meter}) is needed. 
     514  so that the computation of the number of wet ocean point in each water column is by-passed}. 
     515If \np{ln\_isfcav}~\forcode{= .true.}, an extra file input file (\ifile{isf\_draft\_meter}) describing 
     516the ice shelf draft (in meters) is needed. 
    513517 
    514518After reading the bathymetry, the algorithm for vertical grid definition differs between the different options: 
    515519\begin{description} 
    516520\item[\textit{zco}] 
    517   set a reference coordinate transformation $z_0 (k)$, and set $z(i,j,k,t)=z_0 (k)$. 
     521  set a reference coordinate transformation $z_0(k)$, and set $z(i,j,k,t) = z_0(k)$. 
    518522\item[\textit{zps}] 
    519   set a reference coordinate transformation $z_0 (k)$, 
    520   and calculate the thickness of the deepest level at each $(i,j)$ point using the bathymetry, 
    521   to obtain the final three-dimensional depth and scale factor arrays. 
     523  set a reference coordinate transformation $z_0(k)$, and calculate the thickness of the deepest level at 
     524  each $(i,j)$ point using the bathymetry, to obtain the final three-dimensional depth and scale factor arrays. 
    522525\item[\textit{sco}] 
    523   smooth the bathymetry to fulfil the hydrostatic consistency criteria and 
     526  smooth the bathymetry to fulfill the hydrostatic consistency criteria and 
    524527  set the three-dimensional transformation. 
    525528\item[\textit{s-z} and \textit{s-zps}] 
    526   smooth the bathymetry to fulfil the hydrostatic consistency criteria and 
     529  smooth the bathymetry to fulfill the hydrostatic consistency criteria and 
    527530  set the three-dimensional transformation $z(i,j,k)$, 
    528531  and possibly introduce masking of extra land points to better fit the original bathymetry file. 
     
    532535%%% 
    533536 
    534 Unless a linear free surface is used (\np{ln\_linssh}\forcode{ = .false.}), 
     537Unless a linear free surface is used (\np{ln\_linssh}~\forcode{= .false.}), 
    535538the arrays describing the grid point depths and vertical scale factors are three set of 
    536539three dimensional arrays $(i,j,k)$ defined at \textit{before}, \textit{now} and \textit{after} time step. 
    537 The time at which they are defined is indicated by a suffix:$\_b$, $\_n$, or $\_a$, respectively. 
     540The time at which they are defined is indicated by a suffix: $\_b$, $\_n$, or $\_a$, respectively. 
    538541They are updated at each model time step using a fixed reference coordinate system which 
    539542computer names have a $\_0$ suffix. 
    540 When the linear free surface option is used (\np{ln\_linssh}\forcode{ = .true.}), 
    541 \textit{before}, \textit{now} and \textit{after} arrays are simply set one for all to their reference counterpart.  
    542  
     543When the linear free surface option is used (\np{ln\_linssh}~\forcode{= .true.}), \textit{before}, 
     544\textit{now} and \textit{after} arrays are simply set one for all to their reference counterpart. 
    543545 
    544546% ------------------------------------------------------------------------------------------------------------- 
     
    551553(found in \ngn{namdom} namelist):  
    552554\begin{description} 
    553 \item[\np{nn\_bathy}\forcode{ = 0}]: 
     555\item[\np{nn\_bathy}~\forcode{= 0}]: 
    554556  a flat-bottom domain is defined. 
    555557  The total depth $z_w (jpk)$ is given by the coordinate transformation. 
    556   The domain can either be a closed basin or a periodic channel depending on the parameter \np{jperio}.  
    557 \item[\np{nn\_bathy}\forcode{ = -1}]: 
     558  The domain can either be a closed basin or a periodic channel depending on the parameter \np{jperio}. 
     559\item[\np{nn\_bathy}~\forcode{= -1}]: 
    558560  a domain with a bump of topography one third of the domain width at the central latitude. 
    559   This is meant for the "EEL-R5" configuration, a periodic or open boundary channel with a seamount.  
    560 \item[\np{nn\_bathy}\forcode{ = 1}]: 
     561  This is meant for the "EEL-R5" configuration, a periodic or open boundary channel with a seamount. 
     562\item[\np{nn\_bathy}~\forcode{= 1}]: 
    561563  read a bathymetry and ice shelf draft (if needed). 
    562564  The \ifile{bathy\_meter} file (Netcdf format) provides the ocean depth (positive, in meters) at 
     
    569571  The \ifile{isfdraft\_meter} file (Netcdf format) provides the ice shelf draft (positive, in meters) at 
    570572  each grid point of the model grid. 
    571   This file is only needed if \np{ln\_isfcav}\forcode{ = .true.}. 
     573  This file is only needed if \np{ln\_isfcav}~\forcode{= .true.}. 
    572574  Defining the ice shelf draft will also define the ice shelf edge and the grounding line position. 
    573575\end{description} 
    574576 
    575577When a global ocean is coupled to an atmospheric model it is better to represent all large water bodies 
    576 (e.g, great lakes, Caspian sea...) 
    577 even if the model resolution does not allow their communication with the rest of the ocean. 
     578(\eg great lakes, Caspian sea...) even if the model resolution does not allow their communication with 
     579the rest of the ocean. 
    578580This is unnecessary when the ocean is forced by fixed atmospheric conditions, 
    579581so these seas can be removed from the ocean domain. 
    580582The user has the option to set the bathymetry in closed seas to zero (see \autoref{sec:MISC_closea}), 
    581 but the code has to be adapted to the user's configuration.  
     583but the code has to be adapted to the user's configuration. 
    582584 
    583585% ------------------------------------------------------------------------------------------------------------- 
    584586%        z-coordinate  and reference coordinate transformation 
    585587% ------------------------------------------------------------------------------------------------------------- 
    586 \subsection[$Z$-coordinate (\protect\np{ln\_zco}\forcode{ = .true.}) and ref. coordinate] 
    587             {$Z$-coordinate (\protect\np{ln\_zco}\forcode{ = .true.}) and reference coordinate} 
     588\subsection[$Z$-coordinate (\protect\np{ln\_zco}~\forcode{= .true.}) and ref. coordinate] 
     589            {$Z$-coordinate (\protect\np{ln\_zco}~\forcode{= .true.}) and reference coordinate} 
    588590\label{subsec:DOM_zco} 
    589591 
     
    591593\begin{figure}[!tb] 
    592594  \begin{center} 
    593     \includegraphics[width=0.90\textwidth]{Fig_zgr} 
     595    \includegraphics[]{Fig_zgr} 
    594596    \caption{ 
    595597      \protect\label{fig:zgr} 
     
    602604%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    603605 
    604 The reference coordinate transformation $z_0 (k)$ defines the arrays $gdept_0$ and $gdepw_0$ for 
    605 $t$- and $w$-points, respectively. 
    606 As indicated on \autoref{fig:index_vert} \jp{jpk} is the number of $w$-levels. $gdepw_0(1)$ is the ocean surface. 
     606The reference coordinate transformation $z_0(k)$ defines the arrays $gdept_0$ and $gdepw_0$ for $t$- and $w$-points, 
     607respectively. 
     608As indicated on \autoref{fig:index_vert} \jp{jpk} is the number of $w$-levels. 
     609$gdepw_0(1)$ is the ocean surface. 
    607610There are at most \jp{jpk}-1 $t$-points inside the ocean, 
    608 the additional $t$-point at $jk=jpk$ is below the sea floor and is not used. 
     611the additional $t$-point at $jk = jpk$ is below the sea floor and is not used. 
    609612The vertical location of $w$- and $t$-levels is defined from the analytic expression of the depth $z_0(k)$ whose 
    610613analytical derivative with respect to $k$ provides the vertical scale factors. 
     
    613616using parameters provided in the \ngn{namcfg} namelist. 
    614617 
    615 It is possible to define a simple regular vertical grid by giving zero stretching (\np{ppacr=0}). 
    616 In that case, 
    617 the parameters \jp{jpk} (number of $w$-levels) and \np{pphmax} (total ocean depth in meters) fully define the grid.  
     618It is possible to define a simple regular vertical grid by giving zero stretching (\np{ppacr}~\forcode{= 0}). 
     619In that case, the parameters \jp{jpk} (number of $w$-levels) and 
     620\np{pphmax} (total ocean depth in meters) fully define the grid. 
    618621 
    619622For climate-related studies it is often desirable to concentrate the vertical resolution near the ocean surface. 
    620623The following function is proposed as a standard for a $z$-coordinate (with either full or partial steps):  
    621 \begin{equation} 
     624\begin{gather} 
    622625  \label{eq:DOM_zgr_ana_1} 
    623   \begin{split} 
    624     z_0 (k)    &= h_{sur} -h_0 \;k-\;h_1 \;\log \left[ {\,\cosh \left( {{(k-h_{th} )} / {h_{cr} }} \right)\,} \right] \\ 
    625     e_3^0 (k)  &= \left| -h_0 -h_1 \;\tanh \left( {{(k-h_{th} )} / {h_{cr} }} \right) \right| 
    626   \end{split} 
    627 \end{equation} 
    628 where $k=1$ to \jp{jpk} for $w$-levels and $k=1$ to $k=1$ for $T-$levels. 
     626    z_0  (k) = h_{sur} - h_0 \; k - \; h_1 \; \log  \big[ \cosh ((k - h_{th}) / h_{cr}) \big] \\ 
     627    e_3^0(k) = \lt|    - h_0      -    h_1 \; \tanh \big[        (k - h_{th}) / h_{cr}  \big] \rt| 
     628\end{gather} 
     629where $k = 1$ to \jp{jpk} for $w$-levels and $k = 1$ to $k = 1$ for $T-$levels. 
    629630Such an expression allows us to define a nearly uniform vertical location of levels at the ocean top and bottom with 
    630631a smooth hyperbolic tangent transition in between (\autoref{fig:zgr}). 
    631632 
    632 If the ice shelf cavities are opened (\np{ln\_isfcav}\forcode{ = .true.}), the definition of $z_0$ is the same. 
     633If the ice shelf cavities are opened (\np{ln\_isfcav}~\forcode{= .true.}), the definition of $z_0$ is the same. 
    633634However, definition of $e_3^0$ at $t$- and $w$-points is respectively changed to: 
    634635\begin{equation} 
    635636  \label{eq:DOM_zgr_ana_2} 
    636637  \begin{split} 
    637     e_3^T(k) &= z_W (k+1) - z_W (k)  \\ 
    638     e_3^W(k) &= z_T (k)   - z_T (k-1) \\ 
     638    e_3^T(k) &= z_W (k + 1) - z_W (k    ) \\ 
     639    e_3^W(k) &= z_T (k    ) - z_T (k - 1) 
    639640  \end{split} 
    640641\end{equation} 
    641642This formulation decrease the self-generated circulation into the ice shelf cavity  
    642643(which can, in extreme case, leads to blow up).\\ 
    643  
    644644  
    645 The most used vertical grid for ORCA2 has $10~m$ ($500~m)$ resolution in the surface (bottom) layers and 
     645The most used vertical grid for ORCA2 has $10~m$ ($500~m$) resolution in the surface (bottom) layers and 
    646646a depth which varies from 0 at the sea surface to a minimum of $-5000~m$. 
    647647This leads to the following conditions: 
    648648\begin{equation} 
    649649  \label{eq:DOM_zgr_coef} 
    650   \begin{split} 
    651     e_3 (1+1/2)      &=10. \\ 
    652     e_3 (jpk-1/2) &=500. \\ 
    653     z(1)       &=0. \\ 
    654     z(jpk)        &=-5000. \\ 
    655   \end{split} 
     650  \begin{array}{ll} 
     651    e_3 (1   + 1/2) =  10. & z(1  ) =     0. \\ 
     652    e_3 (jpk - 1/2) = 500. & z(jpk) = -5000. 
     653  \end{array} 
    656654\end{equation} 
    657655 
    658 With the choice of the stretching $h_{cr} =3$ and the number of levels \jp{jpk}=$31$, 
    659 the four coefficients $h_{sur}$, $h_{0}$, $h_{1}$, and $h_{th}$ in 
     656With the choice of the stretching $h_{cr} = 3$ and the number of levels \jp{jpk}~$= 31$, 
     657the four coefficients $h_{sur}$, $h_0$, $h_1$, and $h_{th}$ in 
    660658\autoref{eq:DOM_zgr_ana_2} have been determined such that 
    661659\autoref{eq:DOM_zgr_coef} is satisfied, through an optimisation procedure using a bisection method. 
    662660For the first standard ORCA2 vertical grid this led to the following values: 
    663 $h_{sur} =4762.96$, $h_0 =255.58, h_1 =245.5813$, and $h_{th} =21.43336$. 
     661$h_{sur} = 4762.96$, $h_0 = 255.58, h_1 = 245.5813$, and $h_{th} = 21.43336$. 
    664662The resulting depths and scale factors as a function of the model levels are shown in 
    665663\autoref{fig:zgr} and given in \autoref{tab:orca_zgr}. 
    666 Those values correspond to the parameters \np{ppsur}, \np{ppa0}, \np{ppa1}, \np{ppkth} in \ngn{namcfg} namelist.  
    667  
    668 Rather than entering parameters $h_{sur}$, $h_{0}$, and $h_{1}$ directly, it is possible to recalculate them. 
    669 In that case the user sets \np{ppsur}\forcode{ = }\np{ppa0}\forcode{ = }\np{ppa1}\forcode{ = 999999}., 
     664Those values correspond to the parameters \np{ppsur}, \np{ppa0}, \np{ppa1}, \np{ppkth} in \ngn{namcfg} namelist. 
     665 
     666Rather than entering parameters $h_{sur}$, $h_0$, and $h_1$ directly, it is possible to recalculate them. 
     667In that case the user sets \np{ppsur}~$=$~\np{ppa0}~$=$~\np{ppa1}~$= 999999$., 
    670668in \ngn{namcfg} namelist, and specifies instead the four following parameters: 
    671669\begin{itemize} 
    672670\item 
    673   \np{ppacr}=$h_{cr} $: stretching factor (nondimensional). 
     671  \np{ppacr}~$= h_{cr}$: stretching factor (nondimensional). 
    674672  The larger \np{ppacr}, the smaller the stretching. 
    675673  Values from $3$ to $10$ are usual. 
    676674\item 
    677   \np{ppkth}=$h_{th} $: is approximately the model level at which maximum stretching occurs 
     675  \np{ppkth}~$= h_{th}$: is approximately the model level at which maximum stretching occurs 
    678676  (nondimensional, usually of order 1/2 or 2/3 of \jp{jpk}) 
    679677\item 
     
    683681\end{itemize} 
    684682As an example, for the $45$ layers used in the DRAKKAR configuration those parameters are: 
    685 \jp{jpk}\forcode{ = 46}, \np{ppacr}\forcode{ = 9}, \np{ppkth}\forcode{ = 23.563}, 
    686 \np{ppdzmin}\forcode{ = 6}m, \np{pphmax}\forcode{ = 5750}m. 
     683\jp{jpk}~$= 46$, \np{ppacr}~$= 9$, \np{ppkth}~$= 23.563$, \np{ppdzmin}~$= 6~m$, \np{pphmax}~$= 5750~m$. 
    687684 
    688685%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    691688    \begin{tabular}{c||r|r|r|r} 
    692689      \hline 
    693       \textbf{LEVEL}& \textbf{gdept\_1d}& \textbf{gdepw\_1d}& \textbf{e3t\_1d }& \textbf{e3w\_1d  } \\ \hline 
    694       1  &  \textbf{  5.00}   &       0.00 & \textbf{ 10.00} &  10.00 \\   \hline 
    695       2  &  \textbf{15.00} &    10.00 &   \textbf{ 10.00} &  10.00 \\   \hline 
    696       3  &  \textbf{25.00} &    20.00 &   \textbf{ 10.00} &     10.00 \\   \hline 
    697       4  &  \textbf{35.01} &    30.00 &   \textbf{ 10.01} &     10.00 \\   \hline 
    698       5  &  \textbf{45.01} &    40.01 &   \textbf{ 10.01} &  10.01 \\   \hline 
    699       6  &  \textbf{55.03} &    50.02 &   \textbf{ 10.02} &     10.02 \\   \hline 
    700       7  &  \textbf{65.06} &    60.04 &   \textbf{ 10.04} &  10.03 \\   \hline 
    701       8  &  \textbf{75.13} &    70.09 &   \textbf{ 10.09} &  10.06 \\   \hline 
    702       9  &  \textbf{85.25} &    80.18 &   \textbf{ 10.17} &  10.12 \\   \hline 
    703       10 &  \textbf{95.49} &    90.35 &   \textbf{ 10.33} &  10.24 \\   \hline 
    704       11 &  \textbf{105.97}   &   100.69 &   \textbf{ 10.65} &  10.47 \\   \hline 
    705       12 &  \textbf{116.90}   &   111.36 &   \textbf{ 11.27} &  10.91 \\   \hline 
    706       13 &  \textbf{128.70}   &   122.65 &   \textbf{ 12.47} &  11.77 \\   \hline 
    707       14 &  \textbf{142.20}   &   135.16 &   \textbf{ 14.78} &  13.43 \\   \hline 
    708       15 &  \textbf{158.96}   &   150.03 &   \textbf{ 19.23} &  16.65 \\   \hline 
    709       16 &  \textbf{181.96}   &   169.42 &   \textbf{ 27.66} &  22.78 \\   \hline 
    710       17 &  \textbf{216.65}   &   197.37 &   \textbf{ 43.26} &  34.30 \\ \hline 
    711       18 &  \textbf{272.48}   &   241.13 &   \textbf{ 70.88} &  55.21 \\ \hline 
    712       19 &  \textbf{364.30}   &   312.74 &   \textbf{116.11} &  90.99 \\ \hline 
    713       20 &  \textbf{511.53}   &   429.72 &   \textbf{181.55} &    146.43 \\ \hline 
    714       21 &  \textbf{732.20}   &   611.89 &   \textbf{261.03} &    220.35 \\ \hline 
    715       22 &  \textbf{1033.22}&  872.87 &   \textbf{339.39} &    301.42 \\ \hline 
    716       23 &  \textbf{1405.70}& 1211.59 & \textbf{402.26} &   373.31 \\ \hline 
    717       24 &  \textbf{1830.89}& 1612.98 & \textbf{444.87} &   426.00 \\ \hline 
    718       25 &  \textbf{2289.77}& 2057.13 & \textbf{470.55} &   459.47 \\ \hline 
    719       26 &  \textbf{2768.24}& 2527.22 & \textbf{484.95} &   478.83 \\ \hline 
    720       27 &  \textbf{3257.48}& 3011.90 & \textbf{492.70} &   489.44 \\ \hline 
    721       28 &  \textbf{3752.44}& 3504.46 & \textbf{496.78} &   495.07 \\ \hline 
    722       29 &  \textbf{4250.40}& 4001.16 & \textbf{498.90} &   498.02 \\ \hline 
    723       30 &  \textbf{4749.91}& 4500.02 & \textbf{500.00} &   499.54 \\ \hline 
    724       31 &  \textbf{5250.23}& 5000.00 &   \textbf{500.56} & 500.33 \\ \hline 
     690      \textbf{LEVEL} & \textbf{gdept\_1d} & \textbf{gdepw\_1d} & \textbf{e3t\_1d } & \textbf{e3w\_1d} \\ 
     691      \hline 
     692      1              & \textbf{     5.00} &               0.00 & \textbf{   10.00} &            10.00 \\ 
     693      \hline 
     694      2              & \textbf{    15.00} &              10.00 & \textbf{   10.00} &            10.00 \\ 
     695      \hline 
     696      3              & \textbf{    25.00} &              20.00 & \textbf{   10.00} &            10.00 \\ 
     697      \hline 
     698      4              & \textbf{    35.01} &              30.00 & \textbf{   10.01} &            10.00 \\ 
     699      \hline 
     700      5              & \textbf{    45.01} &              40.01 & \textbf{   10.01} &            10.01 \\ 
     701      \hline 
     702      6              & \textbf{    55.03} &              50.02 & \textbf{   10.02} &            10.02 \\ 
     703      \hline 
     704      7              & \textbf{    65.06} &              60.04 & \textbf{   10.04} &            10.03 \\ 
     705      \hline 
     706      8              & \textbf{    75.13} &              70.09 & \textbf{   10.09} &            10.06 \\ 
     707      \hline 
     708      9              & \textbf{    85.25} &              80.18 & \textbf{   10.17} &            10.12 \\ 
     709      \hline 
     710      10             & \textbf{    95.49} &              90.35 & \textbf{   10.33} &            10.24 \\ 
     711      \hline 
     712      11             & \textbf{   105.97} &             100.69 & \textbf{   10.65} &            10.47 \\ 
     713      \hline 
     714      12             & \textbf{   116.90} &             111.36 & \textbf{   11.27} &            10.91 \\ 
     715      \hline 
     716      13             & \textbf{   128.70} &             122.65 & \textbf{   12.47} &            11.77 \\ 
     717      \hline 
     718      14             & \textbf{   142.20} &             135.16 & \textbf{   14.78} &            13.43 \\ 
     719      \hline 
     720      15             & \textbf{   158.96} &             150.03 & \textbf{   19.23} &            16.65 \\ 
     721      \hline 
     722      16             & \textbf{   181.96} &             169.42 & \textbf{   27.66} &            22.78 \\ 
     723      \hline 
     724      17             & \textbf{   216.65} &             197.37 & \textbf{   43.26} &            34.30 \\ 
     725      \hline 
     726      18             & \textbf{   272.48} &             241.13 & \textbf{   70.88} &            55.21 \\ 
     727      \hline 
     728      19             & \textbf{   364.30} &             312.74 & \textbf{  116.11} &            90.99 \\ 
     729      \hline 
     730      20             & \textbf{   511.53} &             429.72 & \textbf{  181.55} &           146.43 \\ 
     731      \hline 
     732      21             & \textbf{   732.20} &             611.89 & \textbf{  261.03} &           220.35 \\ 
     733      \hline 
     734      22             & \textbf{  1033.22} &             872.87 & \textbf{  339.39} &           301.42 \\ 
     735      \hline 
     736      23             & \textbf{  1405.70} &            1211.59 & \textbf{  402.26} &           373.31 \\ 
     737      \hline 
     738      24             & \textbf{  1830.89} &            1612.98 & \textbf{  444.87} &           426.00 \\ 
     739      \hline 
     740      25             & \textbf{  2289.77} &            2057.13 & \textbf{  470.55} &           459.47 \\ 
     741      \hline 
     742      26             & \textbf{  2768.24} &            2527.22 & \textbf{  484.95} &           478.83 \\ 
     743      \hline 
     744      27             & \textbf{  3257.48} &            3011.90 & \textbf{  492.70} &           489.44 \\ 
     745      \hline 
     746      28             & \textbf{  3752.44} &            3504.46 & \textbf{  496.78} &           495.07 \\ 
     747      \hline 
     748      29             & \textbf{  4250.40} &            4001.16 & \textbf{  498.90} &           498.02 \\ 
     749      \hline 
     750      30             & \textbf{  4749.91} &            4500.02 & \textbf{  500.00} &           499.54 \\ 
     751      \hline 
     752      31             & \textbf{  5250.23} &            5000.00 & \textbf{  500.56} &           500.33 \\ 
     753      \hline 
    725754    \end{tabular} 
    726755  \end{center} 
     
    736765%        z-coordinate with partial step 
    737766% ------------------------------------------------------------------------------------------------------------- 
    738 \subsection{$Z$-coordinate with partial step (\protect\np{ln\_zps}\forcode{ = .true.})} 
     767\subsection{$Z$-coordinate with partial step (\protect\np{ln\_zps}~\forcode{= .true.})} 
    739768\label{subsec:DOM_zps} 
    740769%--------------------------------------------namdom------------------------------------------------------- 
     
    744773 
    745774In $z$-coordinate partial step, 
    746 the depths of the model levels are defined by the reference analytical function $z_0 (k)$ as described in 
    747 the previous section, \emph{except} in the bottom layer. 
     775the depths of the model levels are defined by the reference analytical function $z_0(k)$ as described in 
     776the previous section, \textit{except} in the bottom layer. 
    748777The thickness of the bottom layer is allowed to vary as a function of geographical location $(\lambda,\varphi)$ to 
    749778allow a better representation of the bathymetry, especially in the case of small slopes 
     
    752781With partial steps, layers from 1 to \jp{jpk}-2 can have a thickness smaller than $e_{3t}(jk)$. 
    753782The model deepest layer (\jp{jpk}-1) is allowed to have either a smaller or larger thickness than $e_{3t}(jpk)$: 
    754 the maximum thickness allowed is $2*e_{3t}(jpk-1)$. 
     783the maximum thickness allowed is $2*e_{3t}(jpk - 1)$. 
    755784This has to be kept in mind when specifying values in \ngn{namdom} namelist, 
    756785as the maximum depth \np{pphmax} in partial steps: 
    757 for example, with \np{pphmax}$=5750~m$ for the DRAKKAR 45 layer grid, 
    758 the maximum ocean depth allowed is actually $6000~m$ (the default thickness $e_{3t}(jpk-1)$ being $250~m$). 
     786for example, with \np{pphmax}~$= 5750~m$ for the DRAKKAR 45 layer grid, 
     787the maximum ocean depth allowed is actually $6000~m$ (the default thickness $e_{3t}(jpk - 1)$ being $250~m$). 
    759788Two variables in the namdom namelist are used to define the partial step vertical grid. 
    760789The mimimum water thickness (in meters) allowed for a cell partially filled with bathymetry at level jk is 
     
    767796%        s-coordinate 
    768797% ------------------------------------------------------------------------------------------------------------- 
    769 \subsection{$S$-coordinate (\protect\np{ln\_sco}\forcode{ = .true.})} 
     798\subsection{$S$-coordinate (\protect\np{ln\_sco}~\forcode{= .true.})} 
    770799\label{subsec:DOM_sco} 
    771800%------------------------------------------nam_zgr_sco--------------------------------------------------- 
     
    774803%-------------------------------------------------------------------------------------------------------------- 
    775804Options are defined in \ngn{namzgr\_sco}. 
    776 In $s$-coordinate (\np{ln\_sco}\forcode{ = .true.}), the depth and thickness of the model levels are defined from 
     805In $s$-coordinate (\np{ln\_sco}~\forcode{= .true.}), the depth and thickness of the model levels are defined from 
    777806the product of a depth field and either a stretching function or its derivative, respectively: 
    778807 
    779 \[ 
     808\begin{align*} 
    780809  % \label{eq:DOM_sco_ana} 
    781   \begin{split} 
    782     z(k)       &= h(i,j) \; z_0(k)  \\ 
    783     e_3(k)  &= h(i,j) \; z_0'(k) 
    784   \end{split} 
    785 \] 
     810  z(k)   &= h(i,j) \; z_0 (k) \\ 
     811  e_3(k) &= h(i,j) \; z_0'(k) 
     812\end{align*} 
    786813 
    787814where $h$ is the depth of the last $w$-level ($z_0(k)$) defined at the $t$-point location in the horizontal and 
     
    789816The depth field $h$ is not necessary the ocean depth, 
    790817since a mixed step-like and bottom-following representation of the topography can be used 
    791 (\autoref{fig:z_zps_s_sps}d-e) or an envelop bathymetry can be defined (\autoref{fig:z_zps_s_sps}f). 
     818(\autoref{fig:z_zps_s_sps}) or an envelop bathymetry can be defined (\autoref{fig:z_zps_s_sps}). 
    792819The namelist parameter \np{rn\_rmax} determines the slope at which 
    793 the terrain-following coordinate intersects the sea bed and becomes a pseudo z-coordinate.  
     820the terrain-following coordinate intersects the sea bed and becomes a pseudo z-coordinate. 
    794821The coordinate can also be hybridised by specifying \np{rn\_sbot\_min} and \np{rn\_sbot\_max} as 
    795822the minimum and maximum depths at which the terrain-following vertical coordinate is calculated. 
     
    799826 
    800827The original default NEMO s-coordinate stretching is available if neither of the other options are specified as true 
    801 (\np{ln\_s\_SH94}\forcode{ = .false.} and \np{ln\_s\_SF12}\forcode{ = .false.}).  
     828(\np{ln\_s\_SH94}~\forcode{= .false.} and \np{ln\_s\_SF12}~\forcode{= .false.}). 
    802829This uses a depth independent $\tanh$ function for the stretching \citep{Madec_al_JPO96}: 
    803830 
    804831\[ 
    805   z = s_{min}+C\left(s\right)\left(H-s_{min}\right) 
     832  z = s_{min} + C (s) (H - s_{min}) 
    806833  % \label{eq:SH94_1} 
    807834\] 
     
    810837allows a $z$-coordinate to placed on top of the stretched coordinate, 
    811838and $z$ is the depth (negative down from the asea surface). 
     839\begin{gather*} 
     840  s = - \frac{k}{n - 1} \quad \text{and} \quad 0 \leq k \leq n - 1 
     841  % \label{eq:DOM_s} 
     842 \\ 
     843  % \label{eq:DOM_sco_function} 
     844  C(s) = \frac{[\tanh(\theta \, (s + b)) - \tanh(\theta \, b)]}{2 \; \sinh(\theta)} 
     845\end{gather*} 
     846 
     847A stretching function, 
     848modified from the commonly used \citet{Song_Haidvogel_JCP94} stretching (\np{ln\_s\_SH94}~\forcode{= .true.}), 
     849is also available and is more commonly used for shelf seas modelling: 
    812850 
    813851\[ 
    814   s = -\frac{k}{n-1} \quad \text{ and } \quad 0 \leq k \leq n-1 
    815   % \label{eq:DOM_s} 
    816 \] 
    817  
    818 \[ 
    819   % \label{eq:DOM_sco_function} 
    820   \begin{split} 
    821     C(s) &=  \frac{ \left[   \tanh{ \left( \theta \, (s+b) \right)} 
    822         - \tanh{ \left(  \theta \, b      \right)}  \right]} 
    823     {2\;\sinh \left( \theta \right)} 
    824   \end{split} 
    825 \] 
    826  
    827 A stretching function, 
    828 modified from the commonly used \citet{Song_Haidvogel_JCP94} stretching (\np{ln\_s\_SH94}\forcode{ = .true.}), 
    829 is also available and is more commonly used for shelf seas modelling: 
    830  
    831 \[ 
    832   C\left(s\right) =   \left(1 - b \right)\frac{ \sinh\left( \theta s\right)}{\sinh\left(\theta\right)} +      \\ 
    833   b\frac{ \tanh \left[ \theta \left(s + \frac{1}{2} \right)\right] - \tanh\left(\frac{\theta}{2}\right)}{ 2\tanh\left (\frac{\theta}{2}\right)} 
     852  C(s) =   (1 - b) \frac{\sinh(\theta s)}{\sinh(\theta)} 
     853         + b       \frac{\tanh \lt[ \theta \lt(s + \frac{1}{2} \rt) \rt] -   \tanh \lt( \frac{\theta}{2} \rt)} 
     854                        {                                                  2 \tanh \lt( \frac{\theta}{2} \rt)} 
    834855  % \label{eq:SH94_2} 
    835856\] 
     
    838859\begin{figure}[!ht] 
    839860  \begin{center} 
    840     \includegraphics[width=1.0\textwidth]{Fig_sco_function} 
     861    \includegraphics[]{Fig_sco_function} 
    841862    \caption{ 
    842863      \protect\label{fig:sco_function} 
     
    848869%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    849870 
    850 where $H_c$ is the critical depth (\np{rn\_hc}) at which 
    851 the coordinate transitions from pure $\sigma$ to the stretched coordinate, 
    852 and $\theta$ (\np{rn\_theta}) and $b$ (\np{rn\_bb}) are the surface and bottom control parameters such that 
    853 $0\leqslant \theta \leqslant 20$, and $0\leqslant b\leqslant 1$. 
     871where $H_c$ is the critical depth (\np{rn\_hc}) at which the coordinate transitions from pure $\sigma$ to 
     872the stretched coordinate, and $\theta$ (\np{rn\_theta}) and $b$ (\np{rn\_bb}) are the surface and 
     873bottom control parameters such that $0 \leqslant \theta \leqslant 20$, and $0 \leqslant b \leqslant 1$. 
    854874$b$ has been designed to allow surface and/or bottom increase of the vertical resolution 
    855875(\autoref{fig:sco_function}). 
     
    859879In this case the a stretching function $\gamma$ is defined such that: 
    860880 
    861 \[ 
    862   z = -\gamma h \quad \text{ with } \quad 0 \leq \gamma \leq 1 
     881\begin{equation} 
     882  z = - \gamma h \quad \text{with} \quad 0 \leq \gamma \leq 1 
    863883  % \label{eq:z} 
    864 \] 
     884\end{equation} 
    865885 
    866886The function is defined with respect to $\sigma$, the unstretched terrain-following coordinate: 
    867887 
    868 \[ 
     888\begin{gather*} 
    869889  % \label{eq:DOM_gamma_deriv} 
    870   \gamma= A\left(\sigma-\frac{1}{2}\left(\sigma^{2}+f\left(\sigma\right)\right)\right)+B\left(\sigma^{3}-f\left(\sigma\right)\right)+f\left(\sigma\right) 
    871 \] 
    872  
    873 Where: 
    874 \[ 
     890  \gamma =   A \lt( \sigma   - \frac{1}{2} (\sigma^2     + f (\sigma)) \rt) 
     891           + B \lt( \sigma^3 - f           (\sigma) \rt) + f (\sigma)       \\ 
     892  \intertext{Where:} 
    875893  % \label{eq:DOM_gamma} 
    876   f\left(\sigma\right)=\left(\alpha+2\right)\sigma^{\alpha+1}-\left(\alpha+1\right)\sigma^{\alpha+2} \quad \text{ and } \quad \sigma = \frac{k}{n-1} 
    877 \] 
     894  f(\sigma) = (\alpha + 2) \sigma^{\alpha + 1} - (\alpha + 1) \sigma^{\alpha + 2} 
     895  \quad \text{and} \quad \sigma = \frac{k}{n - 1} 
     896\end{gather*} 
    878897 
    879898This gives an analytical stretching of $\sigma$ that is solvable in $A$ and $B$ as a function of 
     
    892911%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    893912\begin{figure}[!ht] 
    894    \includegraphics[width=1.0\textwidth]{Fig_DOM_compare_coordinates_surface} 
    895    \caption{ 
    896      A comparison of the \citet{Song_Haidvogel_JCP94} $S$-coordinate (solid lines), 
    897      a 50 level $Z$-coordinate (contoured surfaces) and 
    898      the \citet{Siddorn_Furner_OM12} $S$-coordinate (dashed lines) in 
    899      the surface 100m for a idealised bathymetry that goes from 50m to 5500m depth. 
    900      For clarity every third coordinate surface is shown. 
    901    } 
    902    \label{fig:fig_compare_coordinates_surface} 
     913  \includegraphics[]{Fig_DOM_compare_coordinates_surface} 
     914  \caption{ 
     915    A comparison of the \citet{Song_Haidvogel_JCP94} $S$-coordinate (solid lines), 
     916    a 50 level $Z$-coordinate (contoured surfaces) and 
     917    the \citet{Siddorn_Furner_OM12} $S$-coordinate (dashed lines) in the surface $100~m$ for 
     918    a idealised bathymetry that goes from $50~m$ to $5500~m$ depth. 
     919    For clarity every third coordinate surface is shown. 
     920  } 
     921  \label{fig:fig_compare_coordinates_surface} 
    903922\end{figure} 
    904 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     923 % >>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    905924 
    906925This gives a smooth analytical stretching in computational space that is constrained to 
     
    925944 
    926945% ------------------------------------------------------------------------------------------------------------- 
    927 %        \zstar- or \sstar-coordinate 
    928 % ------------------------------------------------------------------------------------------------------------- 
    929 \subsection{$Z^*$- or $S^*$-coordinate (\protect\np{ln\_linssh}\forcode{ = .false.}) } 
     946%        z*- or s*-coordinate 
     947% ------------------------------------------------------------------------------------------------------------- 
     948\subsection{\zstar- or \sstar-coordinate (\protect\np{ln\_linssh}~\forcode{= .false.})} 
    930949\label{subsec:DOM_zgr_star} 
    931950 
    932 This option is described in the Report by Levier \textit{et al.} (2007), available on the \NEMO web site.  
     951This option is described in the Report by Levier \textit{et al.} (2007), available on the \NEMO web site. 
    933952 
    934953%gm% key advantage: minimise the diffusion/dispertion associated with advection in response to high frequency surface disturbances 
     
    940959\label{subsec:DOM_msk} 
    941960 
    942 Whatever the vertical coordinate used, 
    943 the model offers the possibility of representing the bottom topography with steps that 
    944 follow the face of the model cells (step like topography) \citep{Madec_al_JPO96}. 
    945 The distribution of the steps in the horizontal is defined in a 2D integer array, mbathy, 
    946 which gives the number of ocean levels (\ie those that are not masked) at each $t$-point. 
    947 mbathy is computed from the meter bathymetry using the definiton of gdept as 
    948 the number of $t$-points which gdept $\leq$ bathy. 
     961Whatever the vertical coordinate used, the model offers the possibility of representing the bottom topography with 
     962steps that follow the face of the model cells (step like topography) \citep{Madec_al_JPO96}. 
     963The distribution of the steps in the horizontal is defined in a 2D integer array, mbathy, which 
     964gives the number of ocean levels (\ie those that are not masked) at each $t$-point. 
     965mbathy is computed from the meter bathymetry using the definiton of gdept as the number of $t$-points which 
     966gdept $\leq$ bathy. 
    949967 
    950968Modifications of the model bathymetry are performed in the \textit{bat\_ctl} routine (see \mdl{domzgr} module) after 
     
    954972As for the representation of bathymetry, a 2D integer array, misfdep, is created. 
    955973misfdep defines the level of the first wet $t$-point. 
    956 All the cells between $k=1$ and $misfdep(i,j)-1$ are masked. 
    957 By default, misfdep(:,:)=1 and no cells are masked. 
     974All the cells between $k = 1$ and $misfdep(i,j) - 1$ are masked. 
     975By default, $misfdep(:,:) = 1$ and no cells are masked. 
    958976 
    959977In case of ice shelf cavities, modifications of the model bathymetry and ice shelf draft into  
    960978the cavities are performed in the \textit{zgr\_isf} routine. 
    961 The compatibility between ice shelf draft and bathymetry is checked.  
    962 All the locations where the isf cavity is thinnest than \np{rn\_isfhmin} meters are grounded (\ie masked).  
     979The compatibility between ice shelf draft and bathymetry is checked. 
     980All the locations where the isf cavity is thinnest than \np{rn\_isfhmin} meters are grounded (\ie masked). 
    963981If only one cell on the water column is opened at $t$-, $u$- or $v$-points, 
    964982the bathymetry or the ice shelf draft is dug to fit this constrain. 
    965 If the incompatibility is too strong (need to dig more than 1 cell), the cell is masked.\\  
     983If the incompatibility is too strong (need to dig more than 1 cell), the cell is masked. 
    966984 
    967985From the \textit{mbathy} and \textit{misfdep} array, the mask fields are defined as follows: 
    968 \begin{align*} 
    969   tmask(i,j,k) &= \begin{cases}   \; 0&   \text{ if $k < misfdep(i,j) $ } \\ 
    970     \; 1&   \text{ if $misfdep(i,j) \leq k\leq mbathy(i,j)$  }    \\ 
    971     \; 0&   \text{ if $k > mbathy(i,j)$  }    \end{cases}     \\ 
    972   umask(i,j,k) &=         \; tmask(i,j,k) \ * \ tmask(i+1,j,k) \\ 
    973   vmask(i,j,k) &=         \; tmask(i,j,k) \ * \ tmask(i,j+1,k) \\ 
    974   fmask(i,j,k) &=         \; tmask(i,j,k) \ * \ tmask(i+1,j,k) \\ 
    975                &    \ \ \, * tmask(i,j,k) \ * \ tmask(i+1,j,k) \\ 
    976   wmask(i,j,k) &=         \; tmask(i,j,k) \ * \ tmask(i,j,k-1) \text{ with } wmask(i,j,1) = tmask(i,j,1) 
    977 \end{align*} 
     986\begin{alignat*}{2} 
     987  tmask(i,j,k) &= &  & 
     988    \begin{cases} 
     989                  0 &\text{if $                  k  <    misfdep(i,j)$} \\ 
     990                  1 &\text{if $misfdep(i,j) \leq k \leq   mbathy(i,j)$} \\ 
     991                  0 &\text{if $                  k  >     mbathy(i,j)$} 
     992    \end{cases} 
     993  \\ 
     994  umask(i,j,k) &= &  &tmask(i,j,k) * tmask(i + 1,j,    k) \\ 
     995  vmask(i,j,k) &= &  &tmask(i,j,k) * tmask(i    ,j + 1,k) \\ 
     996  fmask(i,j,k) &= &  &tmask(i,j,k) * tmask(i + 1,j,    k) \\ 
     997               &  &* &tmask(i,j,k) * tmask(i + 1,j,    k) \\ 
     998  wmask(i,j,k) &= &  &tmask(i,j,k) * tmask(i    ,j,k - 1) \\ 
     999  \text{with~} wmask(i,j,1) &= & &tmask(i,j,1) 
     1000\end{alignat*} 
    9781001 
    9791002Note that, without ice shelves cavities, 
    9801003masks at $t-$ and $w-$points are identical with the numerical indexing used (\autoref{subsec:DOM_Num_Index}). 
    9811004Nevertheless, $wmask$ are required with ocean cavities to deal with the top boundary (ice shelf/ocean interface)  
    982 exactly in the same way as for the bottom boundary.  
     1005exactly in the same way as for the bottom boundary. 
    9831006 
    9841007The specification of closed lateral boundaries requires that at least 
    9851008the first and last rows and columns of the \textit{mbathy} array are set to zero. 
    986 In the particular case of an east-west cyclical boundary condition, 
    987 \textit{mbathy} has its last column equal to the second one and its first column equal to the last but one  
    988 (and so too the mask arrays) (see \autoref{fig:LBC_jperio}). 
    989  
     1009In the particular case of an east-west cyclical boundary condition, \textit{mbathy} has its last column equal to 
     1010the second one and its first column equal to the last but one (and so too the mask arrays) 
     1011(see \autoref{fig:LBC_jperio}). 
    9901012 
    9911013% ================================================================ 
     
    10001022 
    10011023Options are defined in \ngn{namtsd}. 
    1002 By default, the ocean start from rest (the velocity field is set to zero) and the initialization of temperature and salinity fields is controlled through the \np{ln\_tsd\_ini} namelist parameter. 
     1024By default, the ocean start from rest (the velocity field is set to zero) and the initialization of temperature and 
     1025salinity fields is controlled through the \np{ln\_tsd\_ini} namelist parameter. 
    10031026\begin{description} 
    1004 \item[\np{ln\_tsd\_init}\forcode{ = .true.}] 
     1027\item[\np{ln\_tsd\_init}~\forcode{= .true.}] 
    10051028  use a T and S input files that can be given on the model grid itself or on their native input data grid. 
    10061029  In the latter case, 
     
    10091032  The information relative to the input files are given in the \np{sn\_tem} and \np{sn\_sal} structures. 
    10101033  The computation is done in the \mdl{dtatsd} module. 
    1011 \item[\np{ln\_tsd\_init}\forcode{ = .false.}] 
    1012   use constant salinity value of 35.5 psu and an analytical profile of temperature (typical of the tropical ocean), 
    1013   see \rou{istate\_t\_s} subroutine called from \mdl{istate} module. 
     1034\item[\np{ln\_tsd\_init}~\forcode{= .false.}] 
     1035  use constant salinity value of $35.5~psu$ and an analytical profile of temperature 
     1036  (typical of the tropical ocean), see \rou{istate\_t\_s} subroutine called from \mdl{istate} module. 
    10141037\end{description} 
    10151038 
Note: See TracChangeset for help on using the changeset viewer.