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.
apdx_DOMAINcfg.tex in NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles – NEMO

source: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/apdx_DOMAINcfg.tex @ 14644

Last change on this file since 14644 was 14644, checked in by sparonuz, 3 years ago

Merge trunk -r14642:HEAD

File size: 44.0 KB
Line 
1\documentclass[../main/NEMO_manual]{subfiles}
2
3\begin{document}
4
5\chapter{A brief guide to the DOMAINcfg tool}
6\label{apdx:DOMCFG}
7
8\chaptertoc
9
10\paragraph{Changes record} ~\\
11
12{\footnotesize
13  \begin{tabularx}{\textwidth}{l||X|X}
14    Release     & Author(s)            & Modifications                                                 \\
15    \hline
16    {\em  next} & {\em Pierre Mathiot} & {\em Add ice shelf and closed sea option description        } \\
17    {\em   4.0} & {\em  Andrew Coward} & {\em Creation from materials removed from \autoref{chap:DOM}
18                                              that are still relevant to the DOMAINcfg tool
19                                              when setting up new domains                            }
20  \end{tabularx}
21}
22
23\clearpage
24
25This appendix briefly describes some of the options available in the
26\forcode{DOMAINcfg} tool mentioned in \autoref{chap:DOM}.
27
28This tool will evolve into an independent utility with its own documentation but its
29current manifestation is mostly a wrapper for \NEMO\ \forcode{DOM} modules more aligned to
30those in the previous versions of \NEMO. These versions allowed the user to define some
31horizontal and vertical grids through additional namelist parameters. Explanations of
32these parameters are retained here for reference pending better documentation for
33\forcode{DOMAINcfg}. Please note that the namelist blocks named in this appendix refer to
34those read by \forcode{DOMAINcfg} via its own \forcode{namelist_ref} and
35\forcode{namelist_cfg} files. Although, due to their origins, these namelists share names
36with those used by \NEMO, they are not interchangeable and should be considered independent
37of those described elsewhere in this manual.
38
39%% =================================================================================================
40\section{Choice of horizontal grid}
41\label{sec:DOMCFG_hor}
42
43\begin{listing}
44  \begin{forlines}
45!-----------------------------------------------------------------------
46&namdom        !   space and time domain (bathymetry, mesh, timestep)
47!-----------------------------------------------------------------------
48   nn_bathy    =    1      !  compute analyticaly (=0) or read (=1) the bathymetry file
49                           !  or compute (2) from external bathymetry
50   nn_interp   =    1                          ! type of interpolation (nn_bathy =2)                       
51   cn_topo     =  'bathymetry_ORCA12_V3.3.nc'  ! external topo file (nn_bathy =2)
52   cn_bath     =  'Bathymetry'                 ! topo name in file  (nn_bathy =2)
53   cn_lon      =  'nav_lon'                    ! lon  name in file  (nn_bathy =2)
54   cn_lat      =  'nav_lat'                    ! lat  name in file  (nn_bathy =2)
55   rn_scale    = 1
56   rn_bathy    =    0.     !  value of the bathymetry. if (=0) bottom flat at jpkm1
57   jphgr_msh   =       0               !  type of horizontal mesh
58   ppglam0     =  999999.0             !  longitude of first raw and column T-point (jphgr_msh = 1)
59   ppgphi0     =  999999.0             ! latitude  of first raw and column T-point (jphgr_msh = 1)
60   ppe1_deg    =  999999.0             !  zonal      grid-spacing (degrees)
61   ppe2_deg    =  999999.0             !  meridional grid-spacing (degrees)
62   ppe1_m      =  999999.0             !  zonal      grid-spacing (degrees)
63   ppe2_m      =  999999.0             !  meridional grid-spacing (degrees)
64   ppsur       =   -4762.96143546300   !  ORCA r4, r2 and r05 coefficients
65   ppa0        =     255.58049070440   ! (default coefficients)
66   ppa1        =     245.58132232490   !
67   ppkth       =      21.43336197938   !
68   ppacr       =       3.0             !
69   ppdzmin     =  999999.              !  Minimum vertical spacing
70   pphmax      =  999999.              !  Maximum depth
71   ldbletanh   =  .FALSE.              !  Use/do not use double tanf function for vertical coordinates
72   ppa2        =  999999.              !  Double tanh function parameters
73   ppkth2      =  999999.              !
74   ppacr2      =  999999.              !
75/
76  \end{forlines}
77  \caption{\forcode{&namdom_domcfg}}
78  \label{lst:namdom_domcfg}
79\end{listing}
80
81The user has three options available in defining a horizontal grid, which involve the
82namelist variable \np{jphgr_mesh}{jphgr\_mesh} of the \nam{dom}{dom} (\texttt{DOMAINcfg} variant only)
83namelist.
84
85\begin{description}
86 \item [{\np{jphgr_mesh}{jphgr\_mesh}=0}]  The most general curvilinear orthogonal grids.
87  The coordinates and their first derivatives with respect to $i$ and $j$ are provided
88  in a input file (\textit{coordinates.nc}), read in \rou{hgr\_read} subroutine of the domhgr module.
89  This is now the only option available within \NEMO\ itself from v4.0 onwards.
90\item [{\np{jphgr_mesh}{jphgr\_mesh}=1 to 5}] A few simple analytical grids are provided (see below).
91  For other analytical grids, the \mdl{domhgr} module (\texttt{DOMAINcfg} variant) must be
92  modified by the user. In most cases, modifying the \mdl{usrdef\_hgr} module of \NEMO\ is
93  a better alternative since this is designed to allow simple analytical domains to be
94  configured and used without the need for external data files.
95\end{description}
96
97There are two simple cases of geographical grids on the sphere. With
98\np{jphgr_mesh}{jphgr\_mesh}=1, the grid (expressed in degrees) is regular in space,
99with grid sizes specified by parameters \np{ppe1_deg}{ppe1\_deg} and \np{ppe2_deg}{ppe2\_deg},
100respectively. Such a geographical grid can be very anisotropic at high latitudes
101because of the convergence of meridians (the zonal scale factors $e_1$
102become much smaller than the meridional scale factors $e_2$). The Mercator
103grid (\np{jphgr_mesh}{jphgr\_mesh}=4) avoids this anisotropy by refining the meridional scale
104factors in the same way as the zonal ones. In this case, meridional scale factors
105and latitudes are calculated analytically using the formulae appropriate for
106a Mercator projection, based on \np{ppe1_deg}{ppe1\_deg} which is a reference grid spacing
107at the equator (this applies even when the geographical equator is situated outside
108the model domain).
109
110In these two cases (\np{jphgr_mesh}{jphgr\_mesh}=1 or 4), the grid position is defined by the
111longitude and latitude of the south-westernmost point (\np{ppglamt0}
112and \np{ppgphi0}{ppgphi0}). Note that for the Mercator grid the user need only provide
113an approximate starting latitude: the real latitude will be recalculated analytically,
114in order to ensure that the equator corresponds to line passing through $t$-
115and $u$-points.
116
117Rectangular grids ignoring the spherical geometry are defined with
118\np{jphgr_mesh}{jphgr\_mesh} = 2, 3, 5. The domain is either an $f$-plane (\np{jphgr_mesh}{jphgr\_mesh} = 2,
119Coriolis factor is constant) or a beta-plane (\np{jphgr_mesh}{jphgr\_mesh} = 3, the Coriolis factor
120is linear in the $j$-direction). The grid size is uniform in meter in each direction,
121and given by the parameters \np{ppe1_m}{ppe1\_m} and \np{ppe2_m}{ppe2\_m} respectively.
122The zonal grid coordinate (\textit{glam} arrays) is in kilometers, starting at zero
123with the first $t$-point. The meridional coordinate (gphi. arrays) is in kilometers,
124and the second $t$-point corresponds to coordinate $gphit=0$. The input
125variable \np{ppglam0}{ppglam0} is ignored. \np{ppgphi0}{ppgphi0} is used to set the reference
126latitude for computation of the Coriolis parameter. In the case of the beta plane,
127\np{ppgphi0}{ppgphi0} corresponds to the center of the domain. Finally, the special case
128\np{jphgr_mesh}{jphgr\_mesh}=5 corresponds to a beta plane in a rotated domain for the
129GYRE configuration, representing a classical mid-latitude double gyre system.
130The rotation allows us to maximize the jet length relative to the gyre areas
131(and the number of grid points).
132
133%% =================================================================================================
134\section{Vertical grid}
135\label{sec:DOMCFG_vert}
136
137%% =================================================================================================
138\subsection{Vertical reference coordinate}
139\label{sec:DOMCFG_zref}
140
141\begin{figure}[!tb]
142  \centering
143  \includegraphics[width=0.66\textwidth]{DOMCFG_zgr}
144  \caption[DOMAINcfg: default vertical mesh for ORCA2]{
145    Default vertical mesh for ORCA2: 30 ocean levels (L30).
146    Vertical level functions for (a) T-point depth and (b) the associated scale factor for
147    the $z$-coordinate case.}
148  \label{fig:DOMCFG_zgr}
149\end{figure}
150
151The reference coordinate transformation $z_0(k)$ defines the arrays $gdept_0$ and
152$gdepw_0$ for $t$- and $w$-points, respectively. See \autoref{sec:DOMCFG_sco} for the
153S-coordinate options.  As indicated on \autoref{fig:DOM_index_vert} \texttt{jpk} is the number of
154$w$-levels.  $gdepw_0(1)$ is the ocean surface.  There are at most \texttt{jpk}-1 $t$-points
155inside the ocean, the additional $t$-point at $jk = jpk$ is below the sea floor and is not
156used.  The vertical location of $w$- and $t$-levels is defined from the analytic
157expression of the depth $z_0(k)$ whose analytical derivative with respect to $k$ provides
158the vertical scale factors.  The user must provide the analytical expression of both $z_0$
159and its first derivative with respect to $k$.  This is done in routine \mdl{domzgr}
160through statement functions, using parameters provided in the \nam{dom}{dom} namelist
161(\texttt{DOMAINcfg} variant).
162
163It is possible to define a simple regular vertical grid by giving zero stretching
164(\np[=0]{ppacr}{ppacr}).  In that case, the parameters \texttt{jpk} (number of $w$-levels)
165and \np{pphmax}{pphmax} (total ocean depth in meters) fully define the grid.
166
167For climate-related studies it is often desirable to concentrate the vertical resolution
168near the ocean surface.  The following function is proposed as a standard for a
169$z$-coordinate (with either full or partial steps):
170\begin{gather}
171  \label{eq:DOMCFG_zgr_ana_1}
172    z_0  (k) = h_{sur} - h_0 \; k - \; h_1 \; \log  \big[ \cosh ((k - h_{th}) / h_{cr}) \big] \\
173    e_3^0(k) = \lt|    - h_0      -    h_1 \; \tanh \big[        (k - h_{th}) / h_{cr}  \big] \rt|
174\end{gather}
175
176where $k = 1$ to \texttt{jpk} for $w$-levels and $k = 1$ to $k = 1$ for $t-$levels.  Such an
177expression allows us to define a nearly uniform vertical location of levels at the ocean
178top and bottom with a smooth hyperbolic tangent transition in between (\autoref{fig:DOMCFG_zgr}).
179
180A double hyperbolic tangent version (\np[=.true.]{ldbletanh}{ldbletanh}) is also available
181which permits finer control and is used, typically, to obtain a well resolved upper ocean
182without compromising on resolution at depth using a moderate number of levels.
183
184\begin{gather}
185  \label{eq:DOMCFG_zgr_ana_1b}
186    \begin{split}
187    z_0  (k) = h_{sur} - h_0 \; k &- \; h_1 \; \log  \big[ \cosh ((k - h_{th}) / h_{cr}) \big] \\
188                             \;   &- \; h2_1 \; \log  \big[ \cosh ((k - h2_{th}) / h2_{cr}) \big]
189    \end{split}
190\end{gather}
191\begin{gather}
192    \begin{split}
193    e_3^0(k) = \big|    - h_0    &-   h_1 \; \tanh \big[       (k - h_{th})  / h_{cr}   \big]  \\
194                                 &-  h2_1 \; \tanh \big[       (k - h2_{th}) / h2_{cr}  \big] \big|
195    \end{split}
196\end{gather}
197
198If the ice shelf cavities are opened (\np[=.true.]{ln_isfcav}{ln\_isfcav}), the definition
199of $z_0$ is the same.  However, definition of $e_3^0$ at $t$- and $w$-points is
200respectively changed to:
201\begin{equation}
202  \label{eq:DOMCFG_zgr_ana_2}
203  \begin{split}
204    e_3^T(k) &= z_W (k + 1) - z_W (k    ) \\
205    e_3^W(k) &= z_T (k    ) - z_T (k - 1)
206  \end{split}
207\end{equation}
208
209This formulation decreases the self-generated circulation into the ice shelf cavity
210(which can, in extreme case, leads to numerical instability). This is now the recommended formulation for all configurations using v4.0 onwards. The analytical derivation of thicknesses is maintained for backwards compatibility.
211
212The most used vertical grid for ORCA2 has $10~m$ ($500~m$) resolution in the surface
213(bottom) layers and a depth which varies from 0 at the sea surface to a minimum of
214$-5000~m$.  This leads to the following conditions:
215
216\begin{equation}
217  \label{eq:DOMCFG_zgr_coef}
218  \begin{array}{ll}
219    e_3 (1   + 1/2) =  10. & z(1  ) =     0. \\
220    e_3 (jpk - 1/2) = 500. & z(jpk) = -5000.
221  \end{array}
222\end{equation}
223
224With the choice of the stretching $h_{cr} = 3$ and the number of levels \texttt{jpk}~$= 31$,
225the four coefficients $h_{sur}$, $h_0$, $h_1$, and $h_{th}$ in
226\autoref{eq:DOMCFG_zgr_ana_2} have been determined such that \autoref{eq:DOMCFG_zgr_coef}
227is satisfied, through an optimisation procedure using a bisection method.
228For the first standard ORCA2 vertical grid this led to the following values:
229$h_{sur} = 4762.96$, $h_0 = 255.58, h_1 = 245.5813$, and $h_{th} = 21.43336$.
230The resulting depths and scale factors as a function of the model levels are shown in
231\autoref{fig:DOMCFG_zgr} and given in \autoref{tab:DOMCFG_orca_zgr}.
232Those values correspond to the parameters \np{ppsur}{ppsur}, \np{ppa0}{ppa0}, \np{ppa1}{ppa1}, \np{ppkth}{ppkth} in \nam{cfg}{cfg} namelist.
233
234Rather than entering parameters $h_{sur}$, $h_0$, and $h_1$ directly, it is possible to
235recalculate them.  In that case the user sets \np{ppsur}{ppsur}~$=$~\np{ppa0}{ppa0}~$=$~\np{ppa1}{ppa1}~$=
236999999$., in \nam{cfg}{cfg} namelist, and specifies instead the four following parameters:
237\begin{itemize}
238\item \np{ppacr}{ppacr}~$= h_{cr}$: stretching factor (nondimensional).
239  The larger \np{ppacr}{ppacr}, the smaller the stretching.
240  Values from $3$ to $10$ are usual.
241\item \np{ppkth}{ppkth}~$= h_{th}$: is approximately the model level at which maximum stretching occurs
242  (nondimensional, usually of order 1/2 or 2/3 of \texttt{jpk})
243\item \np{ppdzmin}{ppdzmin}: minimum thickness for the top layer (in meters).
244\item \np{pphmax}{pphmax}: total depth of the ocean (meters).
245\end{itemize}
246
247As an example, for the $45$ layers used in the DRAKKAR configuration those parameters are:
248\texttt{jpk}~$= 46$, \np{ppacr}{ppacr}~$= 9$, \np{ppkth}{ppkth}~$= 23.563$, \np{ppdzmin}{ppdzmin}~$= 6~m$,
249\np{pphmax}{pphmax}~$= 5750~m$.
250
251\begin{table}
252  \centering
253  \begin{tabular}{c||r|r|r|r}
254    \hline
255    \textbf{LEVEL} & \textbf{gdept\_1d} & \textbf{gdepw\_1d} & \textbf{e3t\_1d } & \textbf{e3w\_1d} \\
256    \hline
257    1              & \textbf{     5.00} &               0.00 & \textbf{   10.00} &            10.00 \\
258    \hline
259    2              & \textbf{    15.00} &              10.00 & \textbf{   10.00} &            10.00 \\
260    \hline
261    3              & \textbf{    25.00} &              20.00 & \textbf{   10.00} &            10.00 \\
262    \hline
263    4              & \textbf{    35.01} &              30.00 & \textbf{   10.01} &            10.00 \\
264    \hline
265    5              & \textbf{    45.01} &              40.01 & \textbf{   10.01} &            10.01 \\
266    \hline
267    6              & \textbf{    55.03} &              50.02 & \textbf{   10.02} &            10.02 \\
268    \hline
269    7              & \textbf{    65.06} &              60.04 & \textbf{   10.04} &            10.03 \\
270    \hline
271    8              & \textbf{    75.13} &              70.09 & \textbf{   10.09} &            10.06 \\
272    \hline
273    9              & \textbf{    85.25} &              80.18 & \textbf{   10.17} &            10.12 \\
274    \hline
275    10             & \textbf{    95.49} &              90.35 & \textbf{   10.33} &            10.24 \\
276    \hline
277    11             & \textbf{   105.97} &             100.69 & \textbf{   10.65} &            10.47 \\
278    \hline
279    12             & \textbf{   116.90} &             111.36 & \textbf{   11.27} &            10.91 \\
280    \hline
281    13             & \textbf{   128.70} &             122.65 & \textbf{   12.47} &            11.77 \\
282    \hline
283    14             & \textbf{   142.20} &             135.16 & \textbf{   14.78} &            13.43 \\
284    \hline
285    15             & \textbf{   158.96} &             150.03 & \textbf{   19.23} &            16.65 \\
286    \hline
287    16             & \textbf{   181.96} &             169.42 & \textbf{   27.66} &            22.78 \\
288    \hline
289    17             & \textbf{   216.65} &             197.37 & \textbf{   43.26} &            34.30 \\
290    \hline
291    18             & \textbf{   272.48} &             241.13 & \textbf{   70.88} &            55.21 \\
292    \hline
293    19             & \textbf{   364.30} &             312.74 & \textbf{  116.11} &            90.99 \\
294    \hline
295    20             & \textbf{   511.53} &             429.72 & \textbf{  181.55} &           146.43 \\
296    \hline
297    21             & \textbf{   732.20} &             611.89 & \textbf{  261.03} &           220.35 \\
298    \hline
299    22             & \textbf{  1033.22} &             872.87 & \textbf{  339.39} &           301.42 \\
300    \hline
301    23             & \textbf{  1405.70} &            1211.59 & \textbf{  402.26} &           373.31 \\
302    \hline
303    24             & \textbf{  1830.89} &            1612.98 & \textbf{  444.87} &           426.00 \\
304    \hline
305    25             & \textbf{  2289.77} &            2057.13 & \textbf{  470.55} &           459.47 \\
306    \hline
307    26             & \textbf{  2768.24} &            2527.22 & \textbf{  484.95} &           478.83 \\
308    \hline
309    27             & \textbf{  3257.48} &            3011.90 & \textbf{  492.70} &           489.44 \\
310    \hline
311    28             & \textbf{  3752.44} &            3504.46 & \textbf{  496.78} &           495.07 \\
312    \hline
313    29             & \textbf{  4250.40} &            4001.16 & \textbf{  498.90} &           498.02 \\
314    \hline
315    30             & \textbf{  4749.91} &            4500.02 & \textbf{  500.00} &           499.54 \\
316    \hline
317    31             & \textbf{  5250.23} &            5000.00 & \textbf{  500.56} &           500.33 \\
318    \hline
319  \end{tabular}
320  \caption[Default vertical mesh in $z$-coordinate for 30 layers ORCA2 configuration]{
321    Default vertical mesh in $z$-coordinate for 30 layers ORCA2 configuration as
322    computed from \autoref{eq:DOMCFG_zgr_ana_2} using
323    the coefficients given in \autoref{eq:DOMCFG_zgr_coef}}
324  \label{tab:DOMCFG_orca_zgr}
325\end{table}
326%%%YY
327%% % -------------------------------------------------------------------------------------------------------------
328%% %        Meter Bathymetry
329%% % -------------------------------------------------------------------------------------------------------------
330%% =================================================================================================
331\subsection{Model bathymetry}
332\label{subsec:DOMCFG_bathy}
333
334Three options are possible for defining the bathymetry, according to the namelist variable
335\np{nn_bathy}{nn\_bathy} (found in \nam{dom}{dom} namelist (\texttt{DOMAINCFG} variant) ):
336\begin{description}
337\item [{\np[=0]{nn_bathy}{nn\_bathy}}]: a flat-bottom domain is defined.
338  The total depth $z_w (jpk)$ is given by the coordinate transformation.
339  The domain can either be a closed basin or a periodic channel depending on the parameter \np{jperio}{jperio}.
340\item [{\np[=-1]{nn_bathy}{nn\_bathy}}]: a domain with a bump of topography one third of the domain width at the central latitude.
341  This is meant for the "EEL-R5" configuration, a periodic or open boundary channel with a seamount.
342\item [{\np[=1]{nn_bathy}{nn\_bathy}}]: read a bathymetry and ice shelf draft (if needed).
343  The \textit{bathy\_meter.nc} file (Netcdf format) provides the ocean depth (positive, in meters) at
344  each grid point of the model grid.
345  The bathymetry is usually built by interpolating a standard bathymetry product (\eg\ ETOPO2) onto
346  the horizontal ocean mesh.
347  Defining the bathymetry also defines the coastline: where the bathymetry is zero,
348  no wet levels are defined (all levels are masked).
349\end{description}
350
351%% =================================================================================================
352\subsection{Choice of vertical grid}
353\label{sec:DOMCFG_vgrd}
354
355After reading the bathymetry, the algorithm for vertical grid definition differs between the different options:
356\begin{description}
357\item [\forcode{ln_zco = .true.}] set a reference coordinate transformation $z_0(k)$, and set $z(i,j,k,t) = z_0(k)$ where $z_0(k)$ is the closest match to the depth at $(i,j)$.
358\item [\forcode{ln_zps = .true.}] set a reference coordinate transformation $z_0(k)$, and calculate the thickness of the deepest level at
359  each $(i,j)$ point using the bathymetry, to obtain the final three-dimensional depth and scale factor arrays.
360\item [\forcode{ln_sco = .true.}] smooth the bathymetry to fulfill the hydrostatic consistency criteria and
361  set the three-dimensional transformation.
362\item [\forcode{s-z and s-zps}] smooth the bathymetry to fulfill the hydrostatic consistency criteria and
363  set the three-dimensional transformation $z(i,j,k)$,
364  and possibly introduce masking of extra land points to better fit the original bathymetry file.
365\end{description}
366
367%% =================================================================================================
368\subsubsection[$Z$-coordinate with uniform thickness levels (\forcode{ln_zco})]{$Z$-coordinate with uniform thickness levels (\protect\np{ln_zco}{ln\_zco})}
369\label{subsec:DOMCFG_zco}
370
371With this option the model topography can be fully described by the reference vertical
372coordinate and a 2D integer field giving the number of wet levels at each location
373(\forcode{bathy_level}). The resulting match to the real topography is likely to be poor
374though (especially with thick, deep levels) and slopes poorly represented. This option is
375rarely used in modern simulations but it can be useful for testing purposes.
376
377%% =================================================================================================
378\subsubsection[$Z$-coordinate with partial step (\forcode{ln_zps})]{$Z$-coordinate with partial step (\protect\np{ln_zps}{ln\_zps})}
379\label{subsec:DOMCFG_zps}
380
381In $z$-coordinate partial step, the depths of the model levels are defined by the
382reference analytical function $z_0(k)$ as described in \autoref{sec:DOMCFG_zref},
383\textit{except} in the bottom layer.  The thickness of the bottom layer is allowed to vary
384as a function of geographical location $(\lambda,\varphi)$ to allow a better
385representation of the bathymetry, especially in the case of small slopes (where the
386bathymetry varies by less than one level thickness from one grid point to the next).  The
387reference layer thicknesses $e_{3t}^0$ have been defined in the absence of bathymetry.
388With partial steps, layers from 1 to \texttt{jpk-2} can have a thickness smaller than
389$e_{3t}(jk)$.
390
391The model deepest layer (\texttt{jpk-1}) is allowed to have either a smaller or larger
392thickness than $e_{3t}(jpk)$: the maximum thickness allowed is $2*e_{3t}(jpk - 1)$.
393
394This has to be kept in mind when specifying values in \nam{dom}{dom} namelist
395(\texttt{DOMAINCFG} variant), such as the maximum depth \np{pphmax}{pphmax} in partial steps.
396
397For example, with \np{pphmax}{pphmax}~$= 5750~m$ for the DRAKKAR 45 layer grid, the maximum ocean
398depth allowed is actually $6000~m$ (the default thickness $e_{3t}(jpk - 1)$ being
399$250~m$).  Two variables in the namdom namelist are used to define the partial step
400vertical grid.  The mimimum water thickness (in meters) allowed for a cell partially
401filled with bathymetry at level jk is the minimum of \np{rn_e3zps_min}{rn\_e3zps\_min} (thickness in
402meters, usually $20~m$) or $e_{3t}(jk)*$\np{rn_e3zps_rat}{rn\_e3zps\_rat} (a fraction, usually 10\%, of
403the default thickness $e_{3t}(jk)$).
404
405%% =================================================================================================
406\subsubsection[$S$-coordinate (\forcode{ln_sco})]{$S$-coordinate (\protect\np{ln_sco}{ln\_sco})}
407\label{sec:DOMCFG_sco}
408
409\begin{listing}
410  \caption{\forcode{&namzgr_sco_domcfg}}
411  \label{lst:namzgr_sco_domcfg}
412  \begin{forlines}
413!-----------------------------------------------------------------------
414&namzgr_sco    !   s-coordinate or hybrid z-s-coordinate                (default: OFF)
415!-----------------------------------------------------------------------
416   ln_s_sh94   = .false.    !  Song & Haidvogel 1994 hybrid S-sigma   (T)|
417   ln_s_sf12   = .false.   !  Siddorn & Furner 2012 hybrid S-z-sigma (T)| if both are false the NEMO tanh stretching is applied
418   ln_sigcrit  = .false.   !  use sigma coordinates below critical depth (T) or Z coordinates (F) for Siddorn & Furner stretch
419                           !  stretching coefficients for all functions
420   rn_sbot_min =   10.0    !  minimum depth of s-bottom surface (>0) (m)
421   rn_sbot_max = 7000.0    !  maximum depth of s-bottom surface (= ocean depth) (>0) (m)
422   rn_hc       =  150.0    !  critical depth for transition to stretched coordinates
423                        !!!!!!!  Envelop bathymetry
424   rn_rmax     =    0.3    !  maximum cut-off r-value allowed (0<r_max<1)
425                        !!!!!!!  SH94 stretching coefficients  (ln_s_sh94 = .true.)
426   rn_theta    =    6.0    !  surface control parameter (0<=theta<=20)
427   rn_bb       =    0.8    !  stretching with SH94 s-sigma
428                        !!!!!!!  SF12 stretching coefficient  (ln_s_sf12 = .true.)
429   rn_alpha    =    4.4    !  stretching with SF12 s-sigma
430   rn_efold    =    0.0    !  efold length scale for transition to stretched coord
431   rn_zs       =    1.0    !  depth of surface grid box
432                           !  bottom cell depth (Zb) is a linear function of water depth Zb = H*a + b
433   rn_zb_a     =    0.024  !  bathymetry scaling factor for calculating Zb
434   rn_zb_b     =   -0.2    !  offset for calculating Zb
435                        !!!!!!!! Other stretching (not SH94 or SF12) [also uses rn_theta above]
436   rn_thetb    =    1.0    !  bottom control parameter  (0<=thetb<= 1)
437/
438  \end{forlines}
439\end{listing}
440
441Options are defined in \forcode{&zgr_sco} (\texttt{DOMAINcfg} only).
442In $s$-coordinate (\np[=.true.]{ln_sco}{ln\_sco}), the depth and thickness of the model levels are defined from
443the product of a depth field and either a stretching function or its derivative, respectively:
444
445\begin{align*}
446  % \label{eq:DOMCFG_sco_ana}
447  z(k)   &= h(i,j) \; z_0 (k) \\
448  e_3(k) &= h(i,j) \; z_0'(k)
449\end{align*}
450
451where $h$ is the depth of the last $w$-level ($z_0(k)$) defined at the $t$-point location in the horizontal and
452$z_0(k)$ is a function which varies from $0$ at the sea surface to $1$ at the ocean bottom.
453The depth field $h$ is not necessary the ocean depth,
454since a mixed step-like and bottom-following representation of the topography can be used
455(\autoref{fig:DOM_z_zps_s_sps}) or an envelop bathymetry can be defined (\autoref{fig:DOM_z_zps_s_sps}).
456The namelist parameter \np{rn_rmax}{rn\_rmax} determines the slope at which
457the terrain-following coordinate intersects the sea bed and becomes a pseudo z-coordinate.
458The coordinate can also be hybridised by specifying \np{rn_sbot_min}{rn\_sbot\_min} and \np{rn_sbot_max}{rn\_sbot\_max} as
459the minimum and maximum depths at which the terrain-following vertical coordinate is calculated.
460
461Options for stretching the coordinate are provided as examples,
462but care must be taken to ensure that the vertical stretch used is appropriate for the application.
463
464The original default \NEMO\ s-coordinate stretching is available if neither of the other options are specified as true
465(\np[=.false.]{ln_s_SH94}{ln\_s\_SH94} and \np[=.false.]{ln_s_SF12}{ln\_s\_SF12}).
466This uses a depth independent $\tanh$ function for the stretching \citep{madec.delecluse.ea_JPO96}:
467
468\[
469  z = s_{min} + C (s) (H - s_{min})
470  % \label{eq:DOMCFG_SH94_1}
471\]
472
473where $s_{min}$ is the depth at which the $s$-coordinate stretching starts and
474allows a $z$-coordinate to placed on top of the stretched coordinate,
475and $z$ is the depth (negative down from the asea surface).
476\begin{gather*}
477  s = - \frac{k}{n - 1} \quad \text{and} \quad 0 \leq k \leq n - 1
478  % \label{eq:DOMCFG_s}
479 \\
480 \label{eq:DOMCFG_sco_function}
481  C(s) = \frac{[\tanh(\theta \, (s + b)) - \tanh(\theta \, b)]}{2 \; \sinh(\theta)}
482\end{gather*}
483
484A stretching function,
485modified from the commonly used \citet{song.haidvogel_JCP94} stretching (\np[=.true.]{ln_s_SH94}{ln\_s\_SH94}),
486is also available and is more commonly used for shelf seas modelling:
487
488\[
489  C(s) =   (1 - b) \frac{\sinh(\theta s)}{\sinh(\theta)}
490         + b       \frac{\tanh \lt[ \theta \lt(s + \frac{1}{2} \rt) \rt] -   \tanh \lt( \frac{\theta}{2} \rt)}
491                        {                                                  2 \tanh \lt( \frac{\theta}{2} \rt)}
492 \label{eq:DOMCFG_SH94_2}
493\]
494
495\begin{figure}[!ht]
496  \centering
497  \includegraphics[width=0.66\textwidth]{DOMCFG_sco_function}
498  \caption[DOMAINcfg: examples of the stretching function applied to a seamount]{
499    Examples of the stretching function applied to a seamount;
500    from left to right: surface, surface and bottom, and bottom intensified resolutions}
501  \label{fig:DOMCFG_sco_function}
502\end{figure}
503
504where $H_c$ is the critical depth (\np{rn_hc}{rn\_hc}) at which the coordinate transitions from pure $\sigma$ to
505the stretched coordinate, and $\theta$ (\np{rn_theta}{rn\_theta}) and $b$ (\np{rn_bb}{rn\_bb}) are the surface and
506bottom control parameters such that $0 \leqslant \theta \leqslant 20$, and $0 \leqslant b \leqslant 1$.
507$b$ has been designed to allow surface and/or bottom increase of the vertical resolution
508(\autoref{fig:DOMCFG_sco_function}).
509
510Another example has been provided at version 3.5 (\np{ln_s_SF12}{ln\_s\_SF12}) that allows a fixed surface resolution in
511an analytical terrain-following stretching \citet{siddorn.furner_OM13}.
512In this case the a stretching function $\gamma$ is defined such that:
513
514\begin{equation}
515  z = - \gamma h \quad \text{with} \quad 0 \leq \gamma \leq 1
516  % \label{eq:DOMCFG_z}
517\end{equation}
518
519The function is defined with respect to $\sigma$, the unstretched terrain-following coordinate:
520
521\begin{gather*}
522  % \label{eq:DOMCFG_gamma_deriv}
523  \gamma =   A \lt( \sigma   - \frac{1}{2} (\sigma^2     + f (\sigma)) \rt)
524           + B \lt( \sigma^3 - f           (\sigma) \rt) + f (\sigma)       \\
525  \intertext{Where:}
526 \label{eq:DOMCFG_gamma}
527  f(\sigma) = (\alpha + 2) \sigma^{\alpha + 1} - (\alpha + 1) \sigma^{\alpha + 2}
528  \quad \text{and} \quad \sigma = \frac{k}{n - 1}
529\end{gather*}
530
531This gives an analytical stretching of $\sigma$ that is solvable in $A$ and $B$ as a function of
532the user prescribed stretching parameter $\alpha$ (\np{rn_alpha}{rn\_alpha}) that stretches towards
533the surface ($\alpha > 1.0$) or the bottom ($\alpha < 1.0$) and
534user prescribed surface (\np{rn_zs}{rn\_zs}) and bottom depths.
535The bottom cell depth in this example is given as a function of water depth:
536
537\[
538  % \label{eq:DOMCFG_zb}
539  Z_b = h a + b
540\]
541
542where the namelist parameters \np{rn_zb_a}{rn\_zb\_a} and \np{rn_zb_b}{rn\_zb\_b} are $a$ and $b$ respectively.
543
544\begin{figure}[!ht]
545  \centering
546  \includegraphics[width=0.66\textwidth]{DOMCFG_compare_coordinates_surface}
547  \caption[DOMAINcfg: comparison of $s$- and $z$-coordinate]{
548    A comparison of the \citet{song.haidvogel_JCP94} $S$-coordinate (solid lines),
549    a 50 level $Z$-coordinate (contoured surfaces) and
550    the \citet{siddorn.furner_OM13} $S$-coordinate (dashed lines) in the surface $100~m$ for
551    a idealised bathymetry that goes from $50~m$ to $5500~m$ depth.
552    For clarity every third coordinate surface is shown.}
553  \label{fig:DOMCFG_fig_compare_coordinates_surface}
554\end{figure}
555 % >>>>>>>>>>>>>>>>>>>>>>>>>>>>
556
557This gives a smooth analytical stretching in computational space that is constrained to
558given specified surface and bottom grid cell thicknesses in real space.
559This is not to be confused with the hybrid schemes that
560superimpose geopotential coordinates on terrain following coordinates thus
561creating a non-analytical vertical coordinate that
562therefore may suffer from large gradients in the vertical resolutions.
563This stretching is less straightforward to implement than the \citet{song.haidvogel_JCP94} stretching,
564but has the advantage of resolving diurnal processes in deep water and has generally flatter slopes.
565
566As with the \citet{song.haidvogel_JCP94} stretching the stretch is only applied at depths greater than
567the critical depth $h_c$.
568In this example two options are available in depths shallower than $h_c$,
569with pure sigma being applied if the \np{ln_sigcrit}{ln\_sigcrit} is true and pure z-coordinates if it is false
570(the z-coordinate being equal to the depths of the stretched coordinate at $h_c$).
571
572Minimising the horizontal slope of the vertical coordinate is important in terrain-following systems as
573large slopes lead to hydrostatic consistency.
574A hydrostatic consistency parameter diagnostic following \citet{haney_JPO91} has been implemented,
575and is output as part of the model mesh file at the start of the run.
576
577%% =================================================================================================
578\subsubsection[\zstar- or \sstar-coordinate (\forcode{ln_linssh})]{\zstar- or \sstar-coordinate (\protect\np{ln_linssh}{ln\_linssh})}
579\label{subsec:DOMCFG_zgr_star}
580
581This option is described in the Report by Levier \textit{et al.} (2007), available on the \NEMO\ web site.
582
583\section{Ice shelf cavity definition}
584\label{subsec:zgrisf}
585
586  If the under ice shelf seas are opened (\np{ln_isfcav}{ln\_isfcav}), the depth of the ice shelf/ocean interface has to be include in
587  the \textit{isfdraft\_meter} file (Netcdf format). This file need to include the \textit{isf\_draft} variable.
588  A positive value will mean ice shelf/ocean or ice shelf bedrock interface below the reference 0m ssh.
589  The exact shape of the ice shelf cavity (grounding line position and minimum thickness of the water column under an ice shelf, ...) can be specify in \nam{zgr_isf}{zgr\_isf}.
590
591\begin{listing}
592  \caption{\forcode{&namzgr_isf}}
593  \label{lst:namzgr_isf}
594  \begin{forlines}
595!-----------------------------------------------------------------------
596&namzgr_isf    !   isf cavity geometry definition                       (default: OFF)
597!-----------------------------------------------------------------------
598   rn_isfdep_min    = 10.         ! minimum isf draft tickness (if lower, isf draft set to this value)
599   rn_glhw_min      = 1.e-3       ! minimum water column thickness to define the grounding line
600   rn_isfhw_min     = 10          ! minimum water column thickness in the cavity once the grounding line defined.
601   ln_isfchannel    = .false.     ! remove channel (based on 2d mask build from isfdraft-bathy)
602   ln_isfconnect    = .false.     ! force connection under the ice shelf (based on 2d mask build from isfdraft-bathy)
603      nn_kisfmax       = 999         ! limiter in level on the previous condition. (if change larger than this number, get back to value before we enforce the connection)
604      rn_zisfmax       = 7000.       ! limiter in m     on the previous condition. (if change larger than this number, get back to value before we enforce the connection)
605   ln_isfcheminey   = .false.     ! close cheminey
606   ln_isfsubgl      = .false.     ! remove subglacial lake created by the remapping process
607      rn_isfsubgllon   =    0.0      !  longitude of the seed to determine the open ocean
608      rn_isfsubgllat   =    0.0      !  latitude  of the seed to determine the open ocean
609/
610  \end{forlines}
611\end{listing}
612
613   The options available to define the shape of the under ice shelf cavities are listed in \nam{zgr_isf}{zgr\_isf} (\texttt{DOMAINcfg} only, \autoref{lst:namzgr_isf}).
614
615\subsection{Model ice shelf draft definition}
616\label{subsec:zgrisf_isfd}
617
618First of all, the tool make sure, the ice shelf draft ($h_{isf}$) is sensible and compatible with the bathymetry.
619There are 3 compulsory steps to achieve this:
620
621\begin{description}
622\item{\np{rn_isfdep_min}{rn\_isfdep\_min}:} this is the minimum ice shelf draft. This is to make sure there is no ridiculous thin ice shelf. If \np{rn_isfdep_min}{rn\_isfdep\_min} is smaller than the surface level, \np{rn_isfdep_min}{rn\_isfdep\_min} is set to $e3t\_1d(1)$.
623  Where $h_{isf} < MAX(e3t\_1d(1),rn\_isfdep\_min)$, $h_{isf}$ is set to \np{rn_isfdep_min}{rn\_isfdep\_min}.
624
625\item{\np{rn_glhw_min}{rn\_glhw\_min}:} This parameter is used to define the grounding line position.
626  Where the difference between the bathymetry and the ice shelf draft is smaller than \np{rn_glhw_min}{rn\_glhw\_min}, the cell are grounded (ie masked).
627  This step is needed to take into account possible small mismatch between ice shelf draft value and bathymetry value (sources are coming from different grid, different data processes, rounding error, ...).
628
629\item{\np{rn_isfhw_min}{rn\_isfhw\_min}:} This parameter is the minimum water column thickness in the cavity.
630  Where the water column thickness is lower than \np{rn_isfhw_min}{rn\_isfhw\_min}, the ice shelf draft is adjusted to match this criterion.
631  If for any reason, this adjustement break the minimum ice shelf draft allowed (\np{rn_isfdep_min}{rn\_isfdep\_min}), the cell is masked.
632\end{description}
633
634Once all these adjustements are made, if the water column thickness contains one cell wide channels, these channels can be closed using \np{ln_isfchannel}{ln\_isfchannel}
635 
636\subsection{Model top level definition}
637After the definition of the ice shelf draft, the tool defines the top level.
638The compulsory criterion is that the water column needs at least 2 wet cells in the water column at U- and V-points.
639To do so, if there one cell wide water column, the tools adjust the ice shelf draft to fillful the requierement.\\
640
641The process is the following:
642\begin{description}
643\item{step 1:} The top level is defined in the same way as the bottom level is defined.
644\item{step 2:} The isolated grid point in the bathymetry are filled (as it is done in a domain without ice shelf)
645\item{step 3:} The tools make sure, the top level is above or equal to the bottom level
646\item{step 4:} If the water column at a U- or V- point is one wet cell wide, the ice shelf draft is adjusted. So the actual top cell become fully open and the new
647  top cell thickness is set to the minimum cell thickness allowed (following the same logic as for the bottom partial cell). This step is iterated 4 times to ensure the condition is fullfill along the 4 sides of the cell.
648\end{description}
649
650In case of steep slope and shallow water column, it likely that 2 cells are disconnected (bathymetry above its neigbourging ice shelf draft).
651The option \np{ln_isfconnect}{ln\_isfconnect} allow the tool to force the connection between these 2 cells.
652Some limiters in meter or levels on the digging allowed by the tool are available (respectively, \np{rn_zisfmax}{rn\_zisfmax} or \np{rn_kisfmax}{rn\_kisfmax}).
653This will prevent the formation of subglacial lakes at the expense of long vertical pipe to connect cells at very different levels.
654
655\subsection{Subglacial lakes}
656Despite careful setting of your ice shelf draft and bathymetry input file as well as setting described in \autoref{subsec:zgrisf_isfd}, some situation are unavoidable.
657For exemple if you setup your ice shelf draft and bathymetry to do ocean/ice sheet coupling,
658you may decide to fill the whole antarctic with a bathymetry and an ice shelf draft value (ice/bedrock interface depth when grounded).
659If you do so, the subglacial lakes will show up (Vostock for example). An other possibility is with coarse vertical resolution, some ice shelves could be cut in 2 parts:
660one connected to the main ocean and an other one closed which can be considered as a subglacial sea be the model.\\
661
662The namelist option \np{ln_isfsubgl}{ln\_isfsubgl} allow you to remove theses subglacial lakes.
663This may be useful for esthetical reason or for stability reasons:
664
665\begin{description}
666\item $\bullet$ In a subglacial lakes, in case of very weak circulation (often the case), the only heat flux is the conductive heat flux through the ice sheet.
667  This will lead to constant freezing until water reaches -20C.
668  This is one of the defitiency of the 3 equation melt formulation (for details on this formulation, see: \autoref{sec:isf}).
669\item $\bullet$ In case of coupling with an ice sheet model,
670  the ssh in the subglacial lakes and the main ocean could be very different (ssh initial adjustement for example),
671  and so if for any reason both a connected at some point, the model is likely to fall over.\\
672\end{description}
673
674\section{Closed sea definition}
675\label{sec:clocfg}
676
677\begin{listing}
678  \caption{\forcode{&namclo}}
679  \label{lst:namdom_clo}
680  \begin{forlines}
681!-----------------------------------------------------------------------
682&namclo ! (closed sea : need ln_domclo = .true. in namcfg)
683!-----------------------------------------------------------------------
684   rn_lon_opnsea = -2.0     ! longitude seed of open ocean
685   rn_lat_opnsea = -2.0     ! latitude  seed of open ocean
686   nn_closea = 8           ! number of closed seas ( = 0; only the open_sea mask will be computed)
687   !                name   ! lon_src ! lat_src ! lon_trg ! lat_trg ! river mouth area   ! net evap/precip correction scheme ! radius tgt   ! id trg
688   !                       ! (degree)! (degree)! (degree)! (degree)! local/coast/global ! (glo/rnf/emp)                     !     (m)      !
689   ! North American lakes
690   sn_lake(1) = 'superior' ,  -86.57 ,  47.30  , -66.49  , 50.45   , 'local'            , 'rnf'                             ,   550000.0 , 2   
691   sn_lake(2) = 'michigan' ,  -87.06 ,  42.74  , -66.49  , 50.45   , 'local'            , 'rnf'                             ,   550000.0 , 2   
692   sn_lake(3) = 'huron'    ,  -82.51 ,  44.74  , -66.49  , 50.45   , 'local'            , 'rnf'                             ,   550000.0 , 2   
693   sn_lake(4) = 'erie'     ,  -81.13 ,  42.25  , -66.49  , 50.45   , 'local'            , 'rnf'                             ,   550000.0 , 2   
694   sn_lake(5) = 'ontario'  ,  -77.72 ,  43.62  , -66.49  , 50.45   , 'local'            , 'rnf'                             ,   550000.0 , 2   
695   ! African Lake
696   sn_lake(6) = 'victoria' ,   32.93 ,  -1.08  ,  30.44  , 31.37   , 'coast'            , 'emp'                             ,   100000.0 , 3   
697   ! Asian Lakes
698   sn_lake(7) = 'caspian'  ,   50.0  ,  44.0   ,   0.0   ,  0.0    , 'global'           , 'glo'                             ,        0.0 , 1     
699   sn_lake(8) = 'aral'     ,   60.0  ,  45.0   ,   0.0   ,  0.0    , 'global'           , 'glo'                             ,        0.0 , 1   
700/
701   \end{forlines}
702\end{listing}
703
704The options available to define the closed seas and how closed sea net fresh water input will be redistributed by NEMO are listed in \nam{dom_clo}{dom\_clo} (\texttt{DOMAINcfg} only).
705The individual definition of each closed sea is managed by \np{sn_lake}{sn\_lake}. In this fields the user needs to define:\\
706   \begin{description}
707   \item $\bullet$    the name of the closed sea (print output purposes).
708   \item $\bullet$    the seed location to define the area of the closed sea (if seed on land because not present in this configuration, this closed sea will be ignored).\\
709   \item $\bullet$    the seed location for the target area.
710   \item $\bullet$    the type of target area ('local','coast' or 'global'). See point 6 for definition of these cases.
711   \item $\bullet$    the type of redistribution scheme for the net fresh water flux over the closed sea (as a runoff in a target area, as emp in a target area, as emp globally). For the runoff case, if the net fwf is negative, it will be redistribut globally.
712   \item $\bullet$    the radius of the target area (not used for the 'global' case). So the target defined by a 'local' target area of a radius of 100km, for example, correspond to all the wet points within this radius. The coastal case will return only the coastal point within the specifid radius.
713   \item $\bullet$    the target id. This target id is used to group multiple lakes into the same river ouflow (Great Lakes for example).
714   \end{description}
715
716The closed sea module defines a number of masks in the \textit{domain\_cfg} output:
717   \begin{description}
718   \item[\textit{mask\_opensea}:] a mask of the main ocean without all the closed seas closed. This mask is defined by a flood filling algorithm with an initial seed (localisation defined by \np{rn_lon_opnsea}{rn\_lon\_opnsea} and \np{rn_lat_opnsea}{rn\_lat\_opnsea}).
719   \item[\textit{mask\_csglo}, \textit{mask\_csrnf}, \textit{mask\_csemp}:] a mask of all the closed seas defined in the namelist by \np{sn_lake}{sn\_lake} for each redistribution scheme. The total number of defined closed seas has to be defined in \np{nn_closea}{nn\_closea}.
720   \item[\textit{mask\_csgrpglo}, \textit{mask\_csgrprnf}, \textit{mask\_csgrpemp}:] a mask of all the closed seas and targets grouped by target id for each type of redistribution scheme.
721   \item[\textit{mask\_csundef}:] a mask of all the closed sea not defined in \np{sn_lake}{sn\_lake}. This will allows NEMO to mask them if needed or to inform the user of potential minor issues in its bathymetry.
722   \end{description}
723   
724\subinc{\input{../../global/epilogue}}
725
726\end{document}
Note: See TracBrowser for help on using the repository browser.