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.
Chap_DOM.tex in branches/nemo_v3_3_beta/DOC/TexFiles/Chapters – NEMO

source: branches/nemo_v3_3_beta/DOC/TexFiles/Chapters/Chap_DOM.tex @ 2349

Last change on this file since 2349 was 2349, checked in by gm, 13 years ago

v3.3beta: #658 phasing of the doc - key check + many minor changes

  • Property svn:executable set to *
File size: 46.8 KB
Line 
1
2% ================================================================
3% Chapter 2 Ñ Space and Time Domain (DOM)
4% ================================================================
5\chapter{Space Domain (DOM) }
6\label{DOM}
7\minitoc
8
9% Missing things:
10%  - istate: description of the initial state   ==> this has to be put elsewhere..
11%                  perhaps in MISC ?  By the way the initialisation of T S and dynamics
12%                  should be put outside of DOM routine (better with TRC staff and off-line
13%                  tracers)
14%  -geo2ocean:  how to switch from geographic to mesh coordinate
15%     - domclo:  closed sea and lakes.... management of closea sea area : specific to global configuration, both forced and coupled
16
17
18\newpage
19$\ $\newline    % force a new ligne
20
21Having defined the continuous equations in Chap.~\ref{PE} and chosen a time
22discretization Chap.~\ref{STP}, we need to choose a discretization on a grid,
23and numerical algorithms. In the present chapter, we provide a general description
24of the staggered grid used in \NEMO, and other information relevant to the main
25directory routines as well as the DOM (DOMain) directory.
26
27$\ $\newline    % force a new ligne
28
29% ================================================================
30% Fundamentals of the Discretisation
31% ================================================================
32\section{Fundamentals of the Discretisation}
33\label{DOM_basics}
34
35% -------------------------------------------------------------------------------------------------------------
36%        Arrangement of Variables
37% -------------------------------------------------------------------------------------------------------------
38\subsection{Arrangement of Variables}
39\label{DOM_cell}
40
41%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
42\begin{figure}[!tb] \label{Fig_cell}  \begin{center}
43\includegraphics[width=0.90\textwidth]{./TexFiles/Figures/Fig_cell.pdf}
44\caption{Arrangement of variables. $t$ indicates scalar points where temperature,
45salinity, density, pressure and horizontal divergence are defined. ($u$,$v$,$w$)
46indicates vector points, and $f$ indicates vorticity points where both relative and
47planetary vorticities are defined}
48\end{center}   \end{figure}
49%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
50
51The numerical techniques used to solve the Primitive Equations in this model are
52based on the traditional, centred second-order finite difference approximation.
53Special attention has been given to the homogeneity of the solution in the three
54space directions. The arrangement of variables is the same in all directions.
55It consists of cells centred on scalar points ($t$, $S$, $p$, $\rho$) with vector
56points $(u, v, w)$ defined in the centre of each face of the cells (Fig. \ref{Fig_cell}).
57This is the generalisation to three dimensions of the well-known ``C'' grid in
58Arakawa's classification \citep{Mesinger_Arakawa_Bk76}. The relative and
59planetary vorticity, $\zeta$ and $f$, are defined in the centre of each vertical edge
60and the barotropic stream function $\psi$ is defined at horizontal points overlying
61the $\zeta$ and $f$-points.
62
63The ocean mesh ($i.e.$ the position of all the scalar and vector points) is defined
64by the transformation that gives ($\lambda$ ,$\varphi$ ,$z$) as a function of $(i,j,k)$.
65The grid-points are located at integer or integer and a half value of $(i,j,k)$ as
66indicated on Table \ref{Tab_cell}. In all the following, subscripts $u$, $v$, $w$,
67$f$, $uw$, $vw$ or $fw$ indicate the position of the grid-point where the scale
68factors are defined. Each scale factor is defined as the local analytical value
69provided by \eqref{Eq_scale_factors}. As a result, the mesh on which partial
70derivatives $\frac{\partial}{\partial \lambda}, \frac{\partial}{\partial \varphi}$, and
71$\frac{\partial}{\partial z} $ are evaluated is a uniform mesh with a grid size of unity.
72Discrete partial derivatives are formulated by the traditional, centred second order
73finite difference approximation while the scale factors are chosen equal to their
74local analytical value. An important point here is that the partial derivative of the
75scale factors must be evaluated by centred finite difference approximation, not
76from their analytical expression. This preserves the symmetry of the discrete set
77of equations and therefore satisfies many of the continuous properties (see
78Appendix~\ref{Apdx_C}). A similar, related remark can be made about the domain
79size: when needed, an area, volume, or the total ocean depth must be evaluated
80as the sum of the relevant scale factors (see \eqref{DOM_bar}) in the next section).
81
82\begin{table}[!tb] \label{Tab_cell}
83\begin{center} \begin{tabular}{|p{46pt}|p{56pt}|p{56pt}|p{56pt}|}
84\hline
85&$i$     & $j$    & $k$     \\ \hline
86& $i+1/2$   & $j$    & $k$    \\ \hline
87& $i$    & $j+1/2$   & $k$    \\ \hline
88& $i$    & $j$    & $k+1/2$   \\ \hline
89& $i+1/2$   & $j+1/2$   & $k$    \\ \hline
90uw & $i+1/2$   & $j$    & $k+1/2$   \\ \hline
91vw & $i$    & $j+1/2$   & $k+1/2$   \\ \hline
92fw & $i+1/2$   & $j+1/2$   & $k+1/2$   \\ \hline
93\end{tabular}
94\caption{Location of grid-points as a function of integer or integer and a half value
95of the column, line or level. This indexing is only used for the writing of the semi-
96discrete equation. In the code, the indexing uses integer values only and has a
97reverse direction in the vertical (see \S\ref{DOM_Num_Index})}
98\end{center}
99\end{table}
100
101% -------------------------------------------------------------------------------------------------------------
102%        Vector Invariant Formulation
103% -------------------------------------------------------------------------------------------------------------
104\subsection{Discrete Operators}
105\label{DOM_operators}
106
107Given the values of a variable $q$ at adjacent points, the differencing and
108averaging operators at the midpoint between them are:
109\begin{subequations} \label{Eq_di_mi}
110\begin{align}
111 \delta _i [q]       &\  \    q(i+1/2)  - q(i-1/2)    \\
112 \overline q^{\,i} &= \left\{ q(i+1/2) + q(i-1/2) \right\} \; / \; 2
113\end{align}
114\end{subequations}
115
116Similar operators are defined with respect to $i+1/2$, $j$, $j+1/2$, $k$, and
117$k+1/2$. Following \eqref{Eq_PE_grad} and \eqref{Eq_PE_lap}, the gradient of a
118variable $q$ defined at a $t$-point has its three components defined at $u$-, $v$-
119and $w$-points while its Laplacien is defined at $t$-point. These operators have
120the following discrete forms in the curvilinear $s$-coordinate system:
121\begin{equation} \label{Eq_DOM_grad}
122\nabla q\equiv    \frac{1}{e_{1u} } \delta _{i+1/2 } [q] \;\,{\rm {\bf i}}
123      +  \frac{1}{e_{2v} } \delta _{j+1/2 } [q] \;\,{\rm {\bf j}}
124      +  \frac{1}{e_{3w}} \delta _{k+1/2} [q] \;\,{\rm {\bf k}}
125\end{equation}
126\begin{multline} \label{Eq_DOM_lap}
127\Delta q\equiv \frac{1}{e_{1t}\,e_{2t}\,e_{3t} } 
128       \;\left(          \delta_\left[ \frac{e_{2u}\,e_{3u}} {e_{1u}} \;\delta_{i+1/2} [q] \right]
129+                        \delta_\left[ \frac{e_{1v}\,e_{3v}}  {e_{2v}} \;\delta_{j+1/2} [q] \right] \;  \right)      \\
130+\frac{1}{e_{3t}} \delta_k \left[ \frac{1}{e_{3w} }                     \;\delta_{k+1/2} [q] \right]
131\end{multline}
132
133Following \eqref{Eq_PE_curl} and \eqref{Eq_PE_div}, a vector ${\rm {\bf A}}=\left( a_1,a_2,a_3\right)$ 
134defined at vector points $(u,v,w)$ has its three curl components defined at $vw$-, $uw$,
135and $f$-points, and its divergence defined at $t$-points:
136\begin{eqnarray}  \label{Eq_DOM_curl}
137 \nabla \times {\rm {\bf A}}\equiv &
138      \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&\ \rm{\bf i} \\ 
139 +& \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&\ \rm{\bf j} \\ 
140 +& \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&\ \rm{\bf k}
141 \end{eqnarray}
142\begin{equation} \label{Eq_DOM_div}
143\nabla \cdot \rm{\bf A}=\frac{1}{e_{1t}\,e_{2t}\,e_{3t}}\left( \delta_i \left[e_{2u}\,e_{3u}\,a_1 \right]
144                                                                                         +\delta_j \left[e_{1v}\,e_{3v}\,a_2 \right] \right)+\frac{1}{e_{3t} }\delta_k \left[a_3 \right]
145\end{equation}
146
147In the special case of a pure $z$-coordinate system, \eqref{Eq_DOM_lap} and
148\eqref{Eq_DOM_div} can be simplified. In this case, the vertical scale factor
149becomes a function of the single variable $k$ and thus does not depend on the
150horizontal location of a grid point. For example \eqref{Eq_DOM_div} reduces to:
151\begin{equation*}
152\nabla \cdot \rm{\bf A}=\frac{1}{e_{1t}\,e_{2t}} \left( \delta_i \left[e_{2u}\,a_1 \right] 
153                                                                              +\delta_j \left[e_{1v}\, a_2 \right]  \right)
154                                                     +\frac{1}{e_{3t}} \delta_k \left[             a_3 \right]
155\end{equation*}
156
157The vertical average over the whole water column denoted by an overbar becomes
158for a quantity $q$ which is a masked field (i.e. equal to zero inside solid area):
159\begin{equation} \label{DOM_bar}
160\bar q   =         \frac{1}{H}    \int_{k^b}^{k^o} {q\;e_{3q} \,dk} 
161      \equiv \frac{1}{H_q }\sum\limits_k {q\;e_{3q} }
162\end{equation}
163where $H_q$  is the ocean depth, which is the masked sum of the vertical scale
164factors at $q$ points, $k^b$ and $k^o$ are the bottom and surface $k$-indices,
165and the symbol $k^o$ refers to a summation over all grid points of the same type
166in the direction indicated by the subscript (here $k$).
167
168In continuous form, the following properties are satisfied:
169\begin{equation} \label{Eq_DOM_curl_grad}
170\nabla \times \nabla q ={\rm {\bf {0}}}
171\end{equation}
172\begin{equation} \label{Eq_DOM_div_curl}
173\nabla \cdot \left( {\nabla \times {\rm {\bf A}}} \right)=0
174\end{equation}
175
176It is straightforward to demonstrate that these properties are verified locally in
177discrete form as soon as the scalar $q$ is taken at $t$-points and the vector
178\textbf{A} has its components defined at vector points $(u,v,w)$.
179
180Let $a$ and $b$ be two fields defined on the mesh, with value zero inside
181continental area. Using integration by parts it can be shown that the differencing
182operators ($\delta_i$, $\delta_j$ and $\delta_k$) are anti-symmetric linear
183operators, and further that the averaging operators $\overline{\,\cdot\,}^{\,i}$,
184$\overline{\,\cdot\,}^{\,k}$ and $\overline{\,\cdot\,}^{\,k}$) are symmetric linear
185operators, $i.e.$
186\begin{align} 
187\label{DOM_di_adj}
188\sum\limits_i { a_i \;\delta _i \left[ b \right]} 
189   &\equiv -\sum\limits_i {\delta _{i+1/2} \left[ a \right]\;b_{i+1/2} }      \\
190\label{DOM_mi_adj}
191\sum\limits_i { a_i \;\overline b^{\,i}} 
192   & \equiv \quad \sum\limits_i {\overline a ^{\,i+1/2}\;b_{i+1/2} } 
193\end{align}
194
195In other words, the adjoint of the differencing and averaging operators are
196$\delta_i^*=\delta_{i+1/2}$ and
197${(\overline{\,\cdot \,}^{\,i})}^*= \overline{\,\cdot\,}^{\,i+1/2}$, respectively.
198These two properties will be used extensively in the Appendix~\ref{Apdx_C} to
199demonstrate integral conservative properties of the discrete formulation chosen.
200
201% -------------------------------------------------------------------------------------------------------------
202%        Numerical Indexing
203% -------------------------------------------------------------------------------------------------------------
204\subsection{Numerical Indexing}
205\label{DOM_Num_Index}
206
207%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
208\begin{figure}[!tb] \label{Fig_index_hor}  \begin{center}
209\includegraphics[width=0.90\textwidth]{./TexFiles/Figures/Fig_index_hor.pdf}
210\caption{Horizontal integer indexing used in the \textsc{Fortran} code. The dashed
211area indicates the cell in which variables contained in arrays have the same
212$i$- and $j$-indices}
213\end{center}   \end{figure}
214%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
215
216The array representation used in the \textsc{Fortran} code requires an integer
217indexing while the analytical definition of the mesh (see \S\ref{DOM_cell}) is
218associated with the use of integer values for $t$-points and both integer and
219integer and a half values for all the other points. Therefore a specific integer
220indexing must be defined for points other than $t$-points ($i.e.$ velocity and
221vorticity grid-points). Furthermore, the direction of the vertical indexing has
222been changed so that the surface level is at $k=1$.
223
224% -----------------------------------
225%        Horizontal Indexing
226% -----------------------------------
227\subsubsection{Horizontal Indexing}
228\label{DOM_Num_Index_hor}
229
230The indexing in the horizontal plane has been chosen as shown in Fig.\ref{Fig_index_hor}.
231For an increasing $i$ index ($j$ index), the $t$-point and the eastward $u$-point
232(northward $v$-point) have the same index (see the dashed area in Fig.\ref{Fig_index_hor}).
233A $t$-point and its nearest northeast $f$-point have the same $i$-and $j$-indices.
234
235% -----------------------------------
236%        Vertical indexing
237% -----------------------------------
238\subsubsection{Vertical Indexing}
239\label{DOM_Num_Index_vertical}
240
241In the vertical, the chosen indexing requires special attention since the
242$k$-axis is re-orientated downward in the \textsc{Fortran} code compared
243to the indexing used in the semi-discrete equations and given in \S\ref{DOM_cell}.
244The sea surface corresponds to the $w$-level $k=1$ which is the same index
245as $t$-level just below (Fig.\ref{Fig_index_vert}). The last $w$-level ($k=jpk$)
246either corresponds to the ocean floor or is inside the bathymetry while the last
247$t$-level is always inside the bathymetry (Fig.\ref{Fig_index_vert}). Note that
248for an increasing $k$ index, a $w$-point and the $t$-point just below have the
249same $k$ index, in opposition to what is done in the horizontal plane where
250it is the $t$-point and the nearest velocity points in the direction of the horizontal
251axis that have the same $i$ or $j$ index (compare the dashed area in
252Fig.\ref{Fig_index_hor} and \ref{Fig_index_vert}). Since the scale factors are
253chosen to be strictly positive, a \emph{minus sign} appears in the \textsc{Fortran} 
254code \emph{before all the vertical derivatives} of the discrete equations given in
255this documentation.
256
257%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
258\begin{figure}[!pt] \label{Fig_index_vert}  \begin{center}
259\includegraphics[width=.90\textwidth]{./TexFiles/Figures/Fig_index_vert.pdf}
260\caption{Vertical integer indexing used in the \textsc{Fortran } code. Note that
261the $k$-axis is orientated downward. The dashed area indicates the cell in
262which variables contained in arrays have the same $k$-index.}
263\end{center}   \end{figure}
264%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
265
266% -----------------------------------
267%        Domain Size
268% -----------------------------------
269\subsubsection{Domain Size}
270\label{DOM_size}
271
272The total size of the computational domain is set by the parameters \jp{jpiglo},
273\jp{jpjglo} and \jp{jpk} in the $i$, $j$ and $k$ directions respectively. They are
274given as parameters in the \mdl{par\_oce} module\footnote{When a specific
275configuration is used (ORCA2 global ocean, etc...) the parameter are actually
276defined in additional files introduced by \mdl{par\_oce} module via CPP
277\textit{include} command. For example, ORCA2 parameters are set in
278\textit{par\_ORCA\_R2.h90} file}. The use of parameters rather than variables
279(together with dynamic allocation of arrays) was chosen because it ensured that
280the compiler would optimize the executable code efficiently, especially on vector
281machines (optimization may be less efficient when the problem size is unknown
282at the time of compilation). Nevertheless, it is possible to set up the code with full
283dynamical allocation by using the AGRIF packaged \citep{Debreu_al_CG2008}.
284%
285\gmcomment{  add the following ref
286\colorbox{yellow}{(ref part of the doc)} } 
287%
288Note that are other parameters in \mdl{par\_oce} that refer to the domain size.
289The two parameters $jpidta$ and $jpjdta$ may be larger than $jpiglo$, $jpjglo$ 
290when the user wants to use only a sub-region of a given configuration. This is
291the "zoom" capability described in \S\ref{MISC_zoom}. In most applications of
292the model, $jpidta=jpiglo$, $jpjdta=jpjglo$, and $jpizoom=jpjzoom=1$. Parameters
293$jpi$ and $jpj$ refer to the size of each processor subdomain when the code is
294run in parallel using domain decomposition (\key{mpp\_mpi} defined, see
295\S\ref{LBC_mpp}).
296
297
298$\ $\newline    % force a new ligne
299
300% ================================================================
301% Domain: Horizontal Grid (mesh)
302% ================================================================
303\section  [Domain: Horizontal Grid (mesh) (\textit{domhgr})]               
304      {Domain: Horizontal Grid (mesh) \small{(\mdl{domhgr} module)} }
305\label{DOM_hgr}
306
307% -------------------------------------------------------------------------------------------------------------
308%        Coordinates and scale factors
309% -------------------------------------------------------------------------------------------------------------
310\subsection{Coordinates and scale factors}
311\label{DOM_hgr_coord_e}
312
313The ocean mesh ($i.e.$ the position of all the scalar and vector points) is defined
314by the transformation that gives $(\lambda,\varphi,z)$ as a function of $(i,j,k)$.
315The grid-points are located at integer or integer and a half values of as indicated
316in Table~\ref{Tab_cell}. The associated scale factors are defined using the
317analytical first derivative of the transformation \eqref{Eq_scale_factors}. These
318definitions are done in two modules, \mdl{domhgr} and \mdl{domzgr}, which
319provide the horizontal and vertical meshes, respectively. This section deals with
320the horizontal mesh parameters.
321
322In a horizontal plane, the location of all the model grid points is defined from the
323analytical expressions of the longitude $\lambda$ and  latitude $\varphi$ as a
324function of  $(i,j)$. The horizontal scale factors are calculated using
325\eqref{Eq_scale_factors}. For example, when the longitude and latitude are
326function of a single value ($i$ and $j$, respectively) (geographical configuration
327of the mesh), the horizontal mesh definition reduces to define the wanted
328$\lambda(i)$, $\varphi(j)$, and their derivatives $\lambda'(i)$ $\varphi'(j)$ in the
329\mdl{domhgr} module. The model computes the grid-point positions and scale
330factors in the horizontal plane as follows:
331\begin{flalign*}
332\lambda_t &\equiv \text{glamt}= \lambda(i)     & \varphi_t &\equiv \text{gphit} = \varphi(j)\\
333\lambda_u &\equiv \text{glamu}= \lambda(i+1/2)& \varphi_u &\equiv \text{gphiu}= \varphi(j)\\
334\lambda_v &\equiv \text{glamv}= \lambda(i)       & \varphi_v &\equiv \text{gphiv} = \varphi(j+1/2)\\
335\lambda_f &\equiv \text{glamf }= \lambda(i+1/2)& \varphi_f &\equiv \text{gphif }= \varphi(j+1/2)
336\end{flalign*}
337\begin{flalign*}
338e_{1t} &\equiv \text{e1t} = r_a |\lambda'(i)    \; \cos\varphi(j)  |&
339e_{2t} &\equiv \text{e2t} = r_a |\varphi'(j)|  \\
340e_{1u} &\equiv \text{e1t} = r_a |\lambda'(i+1/2)   \; \cos\varphi(j)  |&
341e_{2u} &\equiv \text{e2t} = r_a |\varphi'(j)|\\
342e_{1v} &\equiv \text{e1t} = r_a |\lambda'(i)    \; \cos\varphi(j+1/2)  |&
343e_{2v} &\equiv \text{e2t} = r_a |\varphi'(j+1/2)|\\
344e_{1f} &\equiv \text{e1t} = r_a |\lambda'(i+1/2)\; \cos\varphi(j+1/2)  |&
345e_{2f} &\equiv \text{e2t} = r_a |\varphi'(j+1/2)|
346\end{flalign*}
347where the last letter of each computational name indicates the grid point
348considered and $r_a$ is the earth radius (defined in \mdl{phycst} along with
349all universal constants). Note that the horizontal position of and scale factors
350at $w$-points are exactly equal to those of $t$-points, thus no specific arrays
351are defined at $w$-points.
352
353Note that the definition of the scale factors ($i.e.$ as the analytical first derivative
354of the transformation that gives $(\lambda,\varphi,z)$ as a function of $(i,j,k)$) is
355specific to the \NEMO model \citep{Marti_al_JGR92}. As an example, $e_{1t}$ is defined
356locally at a $t$-point, whereas many other models on a C grid choose to define
357such a scale factor as the distance between the $U$-points on each side of the
358$t$-point. Relying on an analytical transformation has two advantages: firstly, there
359is no ambiguity in the scale factors appearing in the discrete equations, since they
360are first introduced in the continuous equations; secondly, analytical transformations
361encourage good practice by the definition of smoothly varying grids (rather than
362allowing the user to set arbitrary jumps in thickness between adjacent layers)
363\citep{Treguier1996}. An example of the effect of such a choice is shown in
364Fig.~\ref{Fig_zgr_e3}.
365%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
366\begin{figure}[!t] \label{Fig_zgr_e3}  \begin{center}
367\includegraphics[width=0.90\textwidth]{./TexFiles/Figures/Fig_zgr_e3.pdf}
368\caption{Comparison of (a) traditional definitions of grid-point position and grid-size
369in the vertical, and (b) analytically derived grid-point position and scale factors. For
370both grids here,  the same $w$-point depth has been chosen but in (a) the
371$t$-points are set half way between $w$-points while in (b) they are defined from
372an analytical function: $z(k)=5\,(i-1/2)^3 - 45\,(i-1/2)^2 + 140\,(i-1/2) - 150$.
373Note the resulting difference between the value of the grid-size $\Delta_k$ and
374those of the scale factor $e_k$. }
375\end{center}   \end{figure}
376%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
377
378% -------------------------------------------------------------------------------------------------------------
379%        Choice of horizontal grid
380% -------------------------------------------------------------------------------------------------------------
381\subsection{Choice of horizontal grid}
382\label{DOM_hgr_msh_choice}
383
384The user has three options available in defining a horizontal grid, which involve
385the parameter $jphgr\_mesh$ of the \mdl{par\_oce} module.
386\begin{description}
387\item[\jp{jphgr\_mesh}=0]  The most general curvilinear orthogonal grids.
388The coordinates and their first derivatives with respect to $i$ and $j$ are provided
389in a input file (\ifile{coordinates}), read in \rou{hgr\_read} subroutine of the domhgr module.
390\item[\jp{jphgr\_mesh}=1 to 5] A few simple analytical grids are provided (see below).
391For other analytical grids, the \mdl{domhgr} module must be modified by the user.
392\end{description}
393
394There are two simple cases of geographical grids on the sphere. With
395\jp{jphgr\_mesh}=1, the grid (expressed in degrees) is regular in space,
396with grid sizes specified by parameters \pp{ppe1\_deg} and \pp{ppe2\_deg},
397respectively. Such a geographical grid can be very anisotropic at high latitudes
398because of the convergence of meridians (the zonal scale factors $e_1$ 
399become much smaller than the meridional scale factors $e_2$). The Mercator
400grid (\jp{jphgr\_mesh}=4) avoids this anisotropy by refining the meridional scale
401factors in the same way as the zonal ones. In this case, meridional scale factors
402and latitudes are calculated analytically using the formulae appropriate for
403a Mercator projection, based on \pp{ppe1\_deg} which is a reference grid spacing
404at the equator (this applies even when the geographical equator is situated outside
405the model domain).
406%%%
407\gmcomment{ give here the analytical expression of the Mercator mesh}
408%%%
409In these two cases (\jp{jphgr\_mesh}=1 or 4), the grid position is defined by the
410longitude and latitude of the south-westernmost point (\pp{ppglamt0} 
411and \pp{ppgphi0}). Note that for the Mercator grid the user need only provide
412an approximate starting latitude: the real latitude will be recalculated analytically,
413in order to ensure that the equator corresponds to line passing through $t$-
414and $u$-points. 
415
416Rectangular grids ignoring the spherical geometry are defined with
417\jp{jphgr\_mesh} = 2, 3, 5. The domain is either an $f$-plane (\jp{jphgr\_mesh} = 2,
418Coriolis factor is constant) or a beta-plane (\jp{jphgr\_mesh} = 3, the Coriolis factor
419is linear in the $j$-direction). The grid size is uniform in meter in each direction,
420and given by the parameters \pp{ppe1\_m} and \pp{ppe2\_m} respectively.
421The zonal grid coordinate (\textit{glam} arrays) is in kilometers, starting at zero
422with the first $t$-point. The meridional coordinate (gphi. arrays) is in kilometers,
423and the second $t$-point corresponds to coordinate $gphit=0$. The input
424parameter \pp{ppglam0} is ignored. \pp{ppgphi0} is used to set the reference
425latitude for computation of the Coriolis parameter. In the case of the beta plane,
426\pp{ppgphi0} corresponds to the center of the domain. Finally, the special case
427\jp{jphgr\_mesh}=5 corresponds to a beta plane in a rotated domain for the
428GYRE configuration, representing a classical mid-latitude double gyre system.
429The rotation allows us to maximize the jet length relative to the gyre areas
430(and the number of grid points).
431
432The choice of the grid must be consistent with the boundary conditions specified
433by the parameter \jp{jperio} (see {\S\ref{LBC}).
434
435% -------------------------------------------------------------------------------------------------------------
436%        Grid files
437% -------------------------------------------------------------------------------------------------------------
438\subsection{Output Grid files}
439\label{DOM_hgr_files}
440
441All the arrays relating to a particular ocean model configuration (grid-point
442position, scale factors, masks) can be saved in files if $\np{nn\_msh} \not= 0$ 
443(namelist parameter). This can be particularly useful for plots and off-line
444diagnostics. In some cases, the user may choose to make a local modification
445of a scale factor in the code. This is the case in global configurations when
446restricting the width of a specific strait (usually a one-grid-point strait that
447happens to be too wide due to insufficient model resolution). An example
448is Gibraltar Strait in the ORCA2 configuration. When such modifications are done,
449the output grid written when $\np{nn\_msh} \not=0$ is no more equal to the input grid.
450
451$\ $\newline    % force a new ligne
452
453% ================================================================
454% Domain: Vertical Grid (domzgr)
455% ================================================================
456\section  [Domain: Vertical Grid (\textit{domzgr})]
457      {Domain: Vertical Grid \small{(\mdl{domzgr} module)} }
458\label{DOM_zgr}
459%-----------------------------------------nam_zgr & namdom-------------------------------------------
460\namdisplay{namzgr} 
461\namdisplay{namdom} 
462%-------------------------------------------------------------------------------------------------------------
463
464In the vertical, the model mesh is determined by four things:
465(1) the bathymetry given in meters ;
466(2) the number of levels of the model (\jp{jpk}) ;
467(3) the analytical transformation $z(i,j,k)$ and the vertical scale factors
468(derivatives of the transformation) ;
469and (4) the masking system, $i.e.$ the number of wet model levels at each
470$(i,j)$ column of points.
471
472%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
473\begin{figure}[!tb] \label{Fig_z_zps_s_sps}  \begin{center}
474\includegraphics[width=1.0\textwidth]{./TexFiles/Figures/Fig_z_zps_s_sps.pdf}
475\caption{The ocean bottom as seen by the model:
476(a) $z$-coordinate with full step,
477(b) $z$-coordinate with partial step,
478(c) $s$-coordinate: terrain following representation,
479(d) hybrid $s-z$ coordinate,
480(e) hybrid $s-z$ coordinate with partial step, and
481(f) same as (e) but with variable volume associated with the non-linear free surface.
482Note that the variable volume option (\key{vvl}) can be used with any of the
4835 coordinates (a) to (e).}
484\end{center}   \end{figure}
485%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
486
487The choice of a vertical coordinate, even if it is made through a namelist parameter,
488must be done once of all at the beginning of an experiment. It is not intended as an
489option which can be enabled or disabled in the middle of an experiment. Three main
490choices are offered (Fig.~\ref{Fig_z_zps_s_sps}a to c): $z$-coordinate with full step
491bathymetry (\np{ln\_zco}~=~true), $z$-coordinate with partial step bathymetry
492(\np{ln\_zps}~=~true), or generalized, $s$-coordinate (\np{ln\_sco}~=~true).
493Hybridation of the three main coordinates are available: $s-z$ or $s-zps$ coordinate
494(Fig.~\ref{Fig_z_zps_s_sps}d and \ref{Fig_z_zps_s_sps}e). When using the variable
495volume option \key{vvl}) ($i.e.$ non-linear free surface), the coordinate follow the
496time-variation of the free surface so that the transformation is time dependent:
497$z(i,j,k,t)$ (Fig.~\ref{Fig_z_zps_s_sps}f). This option can be used with full step
498bathymetry or $s$-coordinate (hybride and partial step coordinates have not
499yet been tested in NEMO v2.3).
500
501Contrary to the horizontal grid, the vertical grid is computed in the code and no
502provision is made for reading it from a file. The only input file is the bathymetry
503(in meters) (\ifile{bathy\_meter})
504\footnote{N.B. in full step $z$-coordinate, a \ifile{bathy\_level} file can replace the
505\ifile{bathy\_meter} file, so that the computation of the number of wet ocean point
506in each water column is by-passed}.
507After reading the bathymetry, the algorithm for vertical grid definition differs
508between the different options:
509\begin{description}
510\item[\textit{zco}] set a reference coordinate transformation $z_0 (k)$, and set $z(i,j,k,t)=z_0 (k)$.
511\item[\textit{zps}] set a reference coordinate transformation $z_0 (k)$, and
512calculate the thickness of the deepest level at each $(i,j)$ point using the
513bathymetry, to obtain the final three-dimensional depth and scale factor arrays.
514\item[\textit{sco}] smooth the bathymetry to fulfil the hydrostatic consistency
515criteria and set the three-dimensional transformation.
516\item[\textit{s-z} and \textit{s-zps}] smooth the bathymetry to fulfil the hydrostatic
517consistency criteria and set the three-dimensional transformation $z(i,j,k)$, and
518possibly introduce masking of extra land points to better fit the original bathymetry file
519\end{description}
520%%%
521\gmcomment{   add the description of the smoothing:  envelop topography...}
522%%%
523
524The arrays describing the grid point depths and vertical scale factors
525are three dimensional arrays $(i,j,k)$ even in the case of $z$-coordinate with
526full step bottom topography. In non-linear free surface (\key{vvl}), their knowledge
527is required at \textit{before}, \textit{now} and \textit{after} time step, while they
528do not vary in time in linear free surface case.
529To improve the code readability while providing this flexibility, the vertical coordinate
530and scale factors are defined as functions of
531$(i,j,k)$ with "fs" as prefix (examples: \textit{fse3t\_b, fse3t\_n, fse3t\_a,} 
532for the  \textit{before}, \textit{now} and \textit{after} scale factors at $t$-point)
533that can be either three different arrays when \key{vvl} is defined, or a single fixed arrays.
534These functions are defined in the file \hf{domzgr\_substitute} of the DOM directory.
535They are used throughout the code, and replaced by the corresponding arrays at
536the time of pre-processing (CPP capability).
537
538% -------------------------------------------------------------------------------------------------------------
539%        Meter Bathymetry
540% -------------------------------------------------------------------------------------------------------------
541\subsection{Meter Bathymetry}
542\label{DOM_bathy}
543
544Three options are possible for defining the bathymetry, according to the
545namelist variable \np{nn\_bathy}:
546\begin{description}
547\item[\np{nn\_bathy} = 0] a flat-bottom domain is defined. The total depth $z_w (jpk)$ 
548is given by the coordinate transformation. The domain can either be a closed
549basin or a periodic channel depending on the parameter \jp{jperio}.
550\item[\np{nn\_bathy} = -1] a domain with a bump of topography one third of the
551domain width at the central latitude. This is meant for the "EEL-R5" configuration,
552a periodic or open boundary channel with a seamount.
553\item[\np{nn\_bathy} = 1] read a bathymetry. The \ifile{bathy\_meter} file (Netcdf format)
554provides the ocean depth (positive, in meters) at each grid point of the model grid.
555The bathymetry is usually built by interpolating a standard bathymetry product
556($e.g.$ ETOPO2) onto the horizontal ocean mesh. Defining the bathymetry also
557defines the coastline: where the bathymetry is zero, no model levels are defined
558(all levels are masked).
559\end{description}
560
561When a global ocean is coupled to an atmospheric model it is better to represent
562all large water bodies (e.g, great lakes, Caspian sea...) even if the model
563resolution does not allow their communication with the rest of the ocean.
564This is unnecessary when the ocean is forced by fixed atmospheric conditions,
565so these seas can be removed from the ocean domain. The user has the option
566to set the bathymetry in closed seas to zero (see \S\ref{MISC_closea}), but the
567code has to be adapted to the user's configuration.
568
569% -------------------------------------------------------------------------------------------------------------
570%        z-coordinate  and reference coordinate transformation
571% -------------------------------------------------------------------------------------------------------------
572\subsection[$z$-coordinate (\np{ln\_zco}]
573        {$z$-coordinate (\np{ln\_zco}=true) and reference coordinate}
574\label{DOM_zco}
575
576%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
577\begin{figure}[!tb] \label{Fig_zgr}  \begin{center}
578\includegraphics[width=0.90\textwidth]{./TexFiles/Figures/Fig_zgr.pdf}
579\caption{Default vertical mesh for ORCA2: 30 ocean levels (L30). Vertical level
580functions for (a) T-point depth and (b) the associated scale factor as computed
581from \eqref{DOM_zgr_ana} using \eqref{DOM_zgr_coef} in $z$-coordinate.}
582\end{center}   \end{figure}
583%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
584
585The reference coordinate transformation $z_0 (k)$ defines the arrays $gdept_0$ 
586and $gdepw_0$ for $t$- and $w$-points, respectively. As indicated on
587Fig.\ref{Fig_index_vert} \jp{jpk} is the number of $w$-levels. $gdepw_0(1)$ is the
588ocean surface. There are at most \jp{jpk}-1 $t$-points inside the ocean, the
589additional $t$-point at $jk=jpk$ is below the sea floor and is not used.
590The vertical location of $w$- and $t$-levels is defined from the analytic expression
591of the depth $z_0(k)$ whose analytical derivative with respect to $k$ provides the
592vertical scale factors. The user must provide the analytical expression of both
593$z_0$ and its first derivative with respect to $k$. This is done in routine \mdl{domzgr} 
594through statement functions, using parameters provided in the \textit{par\_oce.h90} file.
595
596It is possible to define a simple regular vertical grid by giving zero stretching (\pp{ppacr=0}).
597In that case, the parameters \jp{jpk} (number of $w$-levels) and \pp{pphmax} 
598(total ocean depth in meters) fully define the grid.
599
600For climate-related studies it is often desirable to concentrate the vertical resolution
601near the ocean surface. The following function is proposed as a standard for a
602$z$-coordinate (with either full or partial steps):
603\begin{equation} \label{DOM_zgr_ana}
604\begin{split}
605 z_0 (k)    &= h_{sur} -h_0 \;k-\;h_1 \;\log \left[ {\,\cosh \left( {{(k-h_{th} )} / {h_{cr} }} \right)\,} \right] \\ 
606 e_3^0 (k)  &= \left| -h_0 -h_1 \;\tanh \left( {{(k-h_{th} )} / {h_{cr} }} \right) \right|
607\end{split}
608\end{equation}
609where $k=1$ to \jp{jpk} for $w$-levels and $k=1$ to $k=1$ for $T-$levels. Such an
610expression allows us to define a nearly uniform vertical location of levels at the
611ocean top and bottom with a smooth hyperbolic tangent transition in between
612(Fig.~\ref{Fig_zgr}).
613
614The most used vertical grid for ORCA2 has $10~m$ ($500~m)$ resolution in the
615surface (bottom) layers and a depth which varies from 0 at the sea surface to a
616minimum of $-5000~m$. This leads to the following conditions:
617\begin{equation} \label{DOM_zgr_coef}
618\begin{split}
619 e_3 (1+1/2)      &=10. \\ 
620 e_3 (jpk-1/2) &=500. \\ 
621 z(1)       &=0. \\ 
622 z(jpk)        &=-5000. \\ 
623\end{split}
624\end{equation}
625
626With the choice of the stretching $h_{cr} =3$ and the number of levels
627\jp{jpk}=$31$, the four coefficients $h_{sur}$, $h_{0}$, $h_{1}$, and $h_{th}$ in
628\eqref{DOM_zgr_ana} have been determined such that \eqref{DOM_zgr_coef} is
629satisfied, through an optimisation procedure using a bisection method. For the first
630standard ORCA2 vertical grid this led to the following values: $h_{sur} =4762.96$,
631$h_0 =255.58, h_1 =245.5813$, and $h_{th} =21.43336$. The resulting depths and
632scale factors as a function of the model levels are shown in Fig.~\ref{Fig_zgr} and
633given in Table \ref{Tab_orca_zgr}. Those values correspond to the parameters
634\pp{ppsur}, \pp{ppa0}, \pp{ppa1}, \pp{ppkth} in the parameter file \mdl{par\_oce}.
635
636Rather than entering parameters $h_{sur}$, $h_{0}$, and $h_{1}$ directly, it is
637possible to recalculate them. In that case the user sets
638\pp{ppsur}=\pp{ppa0}=\pp{ppa1}=\pp{pp\_to\_be\_computed}, in \mdl{par\_oce},
639and specifies instead the four following parameters:
640\begin{itemize}
641\item    \pp{ppacr}=$h_{cr} $: stretching factor (nondimensional). The larger
642\pp{ppacr}, the smaller the stretching. Values from $3$ to $10$ are usual.
643\item    \pp{ppkth}=$h_{th} $: is approximately the model level at which maximum
644stretching occurs (nondimensional, usually of order 1/2 or 2/3 of \jp{jpk})
645\item    \pp{ppdzmin}: minimum thickness for the top layer (in meters)
646\item    \pp{pphmax}: total depth of the ocean (meters).
647\end{itemize}
648As an example, for the $45$ layers used in the DRAKKAR configuration those
649parameters are: \jp{jpk}=46, \pp{ppacr}=9, \pp{ppkth}=23.563, \pp{ppdzmin}=6m,
650\pp{pphmax}=5750m.
651
652%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
653\begin{table} \label{Tab_orca_zgr}
654\begin{center} \begin{tabular}{c||r|r|r|r}
655\hline
656\textbf{LEVEL}& \textbf{gdept}& \textbf{gdepw}& \textbf{e3t }& \textbf{e3w  } \\ \hline
657&  \textbf{  5.00}   &       0.00 & \textbf{ 10.00} &  10.00 \\   \hline
658&  \textbf{15.00} &    10.00 &   \textbf{ 10.00} &  10.00 \\   \hline
659&  \textbf{25.00} &    20.00 &   \textbf{ 10.00} &     10.00 \\   \hline
660&  \textbf{35.01} &    30.00 &   \textbf{ 10.01} &     10.00 \\   \hline
661&  \textbf{45.01} &    40.01 &   \textbf{ 10.01} &  10.01 \\   \hline
662&  \textbf{55.03} &    50.02 &   \textbf{ 10.02} &     10.02 \\   \hline
663&  \textbf{65.06} &    60.04 &   \textbf{ 10.04} &  10.03 \\   \hline
664&  \textbf{75.13} &    70.09 &   \textbf{ 10.09} &  10.06 \\   \hline
665&  \textbf{85.25} &    80.18 &   \textbf{ 10.17} &  10.12 \\   \hline
66610 &  \textbf{95.49} &    90.35 &   \textbf{ 10.33} &  10.24 \\   \hline
66711 &  \textbf{105.97}   &   100.69 &   \textbf{ 10.65} &  10.47 \\   \hline
66812 &  \textbf{116.90}   &   111.36 &   \textbf{ 11.27} &  10.91 \\   \hline
66913 &  \textbf{128.70}   &   122.65 &   \textbf{ 12.47} &  11.77 \\   \hline
67014 &  \textbf{142.20}   &   135.16 &   \textbf{ 14.78} &  13.43 \\   \hline
67115 &  \textbf{158.96}   &   150.03 &   \textbf{ 19.23} &  16.65 \\   \hline
67216 &  \textbf{181.96}   &   169.42 &   \textbf{ 27.66} &  22.78 \\   \hline
67317 &  \textbf{216.65}   &   197.37 &   \textbf{ 43.26} &  34.30 \\ \hline
67418 &  \textbf{272.48}   &   241.13 &   \textbf{ 70.88} &  55.21 \\ \hline
67519 &  \textbf{364.30}   &   312.74 &   \textbf{116.11} &  90.99 \\ \hline
67620 &  \textbf{511.53}   &   429.72 &   \textbf{181.55} &    146.43 \\ \hline
67721 &  \textbf{732.20}   &   611.89 &   \textbf{261.03} &    220.35 \\ \hline
67822 &  \textbf{1033.22}&  872.87 &   \textbf{339.39} &    301.42 \\ \hline
67923 &  \textbf{1405.70}& 1211.59 & \textbf{402.26} &   373.31 \\ \hline
68024 &  \textbf{1830.89}& 1612.98 & \textbf{444.87} &   426.00 \\ \hline
68125 &  \textbf{2289.77}& 2057.13 & \textbf{470.55} &   459.47 \\ \hline
68226 &  \textbf{2768.24}& 2527.22 & \textbf{484.95} &   478.83 \\ \hline
68327 &  \textbf{3257.48}& 3011.90 & \textbf{492.70} &   489.44 \\ \hline
68428 &  \textbf{3752.44}& 3504.46 & \textbf{496.78} &   495.07 \\ \hline
68529 &  \textbf{4250.40}& 4001.16 & \textbf{498.90} &   498.02 \\ \hline
68630 &  \textbf{4749.91}& 4500.02 & \textbf{500.00} &   499.54 \\ \hline
68731 &  \textbf{5250.23}& 5000.00 &   \textbf{500.56} & 500.33 \\ \hline
688\end{tabular} \end{center} 
689\caption{Default vertical mesh in $z$-coordinate for 30 layers ORCA2 configuration
690as computed from \eqref{DOM_zgr_ana} using the coefficients given in
691\eqref{DOM_zgr_coef}}
692\end{table}
693%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
694
695% -------------------------------------------------------------------------------------------------------------
696%        z-coordinate with partial step
697% -------------------------------------------------------------------------------------------------------------
698\subsection   [$z$-coordinate with partial step (\np{ln\_zps})]
699         {$z$-coordinate with partial step (\np{ln\_zps}=.true.)}
700\label{DOM_zps}
701%--------------------------------------------namdom-------------------------------------------------------
702\namdisplay{namdom} 
703%--------------------------------------------------------------------------------------------------------------
704
705In $z$-coordinate partial step, the depths of the model levels are defined by the
706reference analytical function $z_0 (k)$ as described in the previous
707section, \emph{except} in the bottom layer. The thickness of the bottom layer is
708allowed to vary as a function of geographical location $(\lambda,\varphi)$ to allow a
709better representation of the bathymetry, especially in the case of small
710slopes (where the bathymetry varies by less than one level thickness from
711one grid point to the next). The reference layer thicknesses $e_{3t}^0$ have been
712defined in the absence of bathymetry. With partial steps, layers from 1 to
713\jp{jpk}-2 can have a thickness smaller than $e_{3t}(jk)$. The model deepest layer (\jp{jpk}-1)
714is allowed to have either a smaller or larger thickness than $e_{3t}(jpk)$: the
715maximum thickness allowed is $2*e_{3t}(jpk-1)$. This has to be kept in mind when
716specifying the maximum depth \pp{pphmax} in partial steps: for example, with
717\pp{pphmax}$=5750~m$ for the DRAKKAR 45 layer grid, the maximum ocean depth
718allowed is actually $6000~m$ (the default thickness $e_{3t}(jpk-1)$ being $250~m$).
719Two variables in the namdom namelist are used to define the partial step
720vertical grid. The mimimum water thickness (in meters) allowed for a cell
721partially filled with bathymetry at level jk is the minimum of \np{rn\_e3zps\_min} 
722(thickness in meters, usually $20~m$) or $e_{3t}(jk)*\np{rn\_e3zps\_rat}$ (a fraction,
723usually 10\%, of the default thickness $e_{3t}(jk)$).
724
725 \colorbox{yellow}{Add a figure here of pstep especially at last ocean level }
726
727% -------------------------------------------------------------------------------------------------------------
728%        s-coordinate
729% -------------------------------------------------------------------------------------------------------------
730\subsection   [$s$-coordinate (\np{ln\_sco})]
731           {$s$-coordinate (\np{ln\_sco}=true)}
732\label{DOM_sco}
733%------------------------------------------nam_zgr_sco---------------------------------------------------
734\namdisplay{namzgr_sco} 
735%--------------------------------------------------------------------------------------------------------------
736In $s$-coordinate (\np{ln\_sco}~=~true), the depth and thickness of the model
737levels are defined from the product of a depth field and either a stretching
738function or its derivative, respectively:
739\begin{equation} \label{DOM_sco_ana}
740\begin{split}
741 z(k)       &= h(i,j) \; z_0(k)  \\
742 e_3(k)  &= h(i,j) \; z_0'(k)
743\end{split}
744\end{equation}
745where $h$ is the depth of the last $w$-level ($z_0(k)$) defined at the $t$-point
746location in the horizontal and $z_0(k)$ is a function which varies from $0$ at the sea
747surface to $1$ at the ocean bottom. The depth field $h$ is not necessary the ocean
748depth, since a mixed step-like and bottom-following representation of the
749topography can be used (Fig.~\ref{Fig_z_zps_s_sps}d-e). In the example provided
750(\rou{zgr\_sco} routine, see \mdl{domzgr}) $h$ is a smooth envelope bathymetry
751and steps are used to represent sharp bathymetric gradients.
752
753A new flexible stretching function, modified from \citet{Song_Haidvogel_JCP94} is provided as an example:
754\begin{equation} \label{DOM_sco_function}
755\begin{split}
756&= h_c +( h-h_c)\;c s)  \\
757c(s)  &\frac{ \left[   \tanh{ \left( \theta \, (s+b) \right)} 
758               - \tanh{ \left\theta \, b      \right)}  \right]}
759            {2\;\sinh \left( \theta \right)}
760\end{split}
761\end{equation}
762where $h_c$ is the thermocline depth and $\theta$ and $b$ are the surface and
763bottom control parameters such that $0\leqslant \theta \leqslant 20$, and
764$0\leqslant b\leqslant 1$. $b$ has been designed to allow surface and/or bottom
765increase of the vertical resolution (Fig.~\ref{Fig_sco_function}).
766
767%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
768\begin{figure}[!tb] \label{Fig_sco_function}  \begin{center}
769\includegraphics[width=1.0\textwidth]{./TexFiles/Figures/Fig_sco_function.pdf}
770\caption{Examples of the stretching function applied to a sea mont; from left to right:
771surface, surface and bottom, and bottom intensified resolutions}
772\end{center}   \end{figure}
773%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
774
775% -------------------------------------------------------------------------------------------------------------
776%        z*- or s*-coordinate
777% -------------------------------------------------------------------------------------------------------------
778\subsection{$z^*$- or $s^*$-coordinate (add \key{vvl}) }
779\label{DOM_zgr_vvl}
780
781This option is described in the Report by Levier \textit{et al.} (2007), available on
782the \NEMO web site.
783
784%gm% key advantage: minimise the diffusion/dispertion associated with advection in response to high frequency surface disturbances
785
786% -------------------------------------------------------------------------------------------------------------
787%        level bathymetry and mask
788% -------------------------------------------------------------------------------------------------------------
789\subsection{level bathymetry and mask}
790\label{DOM_msk}
791
792Whatever the vertical coordinate used, the model offers the possibility of
793representing the bottom topography with steps that follow the face of the
794model cells (step like topography) \citep{Madec_al_JPO96}. The distribution of
795the steps in the horizontal is defined in a 2D integer array, mbathy, which
796gives the number of ocean levels ($i.e.$ those that are not masked) at each
797$t$-point. mbathy is computed from the meter bathymetry using the definiton of
798gdept as the number of $t$-points which gdept $\leq$ bathy.
799
800Modifications of the model bathymetry are performed in the \textit{bat\_ctl} 
801routine (see \mdl{domzgr} module) after mbathy is computed. Isolated grid points
802that do not communicate with another ocean point at the same level are eliminated.
803
804From the \textit{mbathy} array, the mask fields are defined as follows:
805\begin{align*}
806tmask(i,j,k) &= \begin{cases}   \; 1&   \text{ if $k\leq mbathy(i,j)$  }    \\
807                                                \; 0&   \text{ if $k\leq mbathy(i,j)$  }    \end{cases}     \\
808umask(i,j,k) &=         \; tmask(i,j,k) \ * \ tmask(i+1,j,k)   \\
809vmask(i,j,k) &=         \; tmask(i,j,k) \ * \ tmask(i,j+1,k)   \\
810fmask(i,j,k) &=         \; tmask(i,j,k) \ * \ tmask(i+1,j,k)   \\
811                   & \ \ \, * tmask(i,j,k) \ * \ tmask(i+1,j,k)
812\end{align*}
813
814\gmcomment{ STEVEN: are the dots multiplications?}     
815
816Note that \textit{wmask} is not defined as it is exactly equal to \textit{tmask} with
817the numerical indexing used (\S~\ref{DOM_Num_Index}). Moreover, the
818specification of closed lateral boundaries requires that at least the first and last
819rows and columns of the \textit{mbathy} array are set to zero. In the particular
820case of an east-west cyclical boundary condition, \textit{mbathy} has its last
821column equal to the second one and its first column equal to the last but one
822(and so too the mask arrays) (see \S~\ref{LBC_jperio}).
823
824%%%
825\gmcomment{   \colorbox{yellow}{Add one word on tricky trick !} mbathy in further modified in zdfbfr{\ldots}}
826%%%
Note: See TracBrowser for help on using the repository browser.