Changeset 11435 for NEMO/trunk/doc/latex/NEMO/subfiles/chap_DOM.tex
- Timestamp:
- 2019-08-14T14:45:08+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/trunk/doc/latex/NEMO/subfiles/chap_DOM.tex
r11330 r11435 8 8 \label{chap:DOM} 9 9 10 \minitoc10 %\chaptertoc 11 11 12 12 % Missing things: 13 13 % - istate: description of the initial state ==> this has to be put elsewhere.. 14 % perhaps in MISC ? By the way the initialisation of T S and dynamics 14 % perhaps in MISC ? By the way the initialisation of T S and dynamics 15 15 % should be put outside of DOM routine (better with TRC staff and off-line 16 16 % tracers) … … 19 19 20 20 \vfill 21 \begin{figure}[b] 22 \subsubsection*{Changes record} 23 \begin{tabular}{m{0.08\linewidth}||m{0.32\linewidth}|m{0.6\linewidth}} 24 Release & Author(s) & Modifications \\ 25 \hline 26 {\em 4.0} & {\em Simon M{\"u}ller \& Andrew Coward} & {\em Compatibility changes for v4.0. Major simplication has moved many of the options to external domain configuration tools. For now this information has been retained in \autoref{apdx:DOMAINcfg} } \\ 27 {\em 3.x} & {\em Sebastien Masson, Gurvan Madec \& Rashid Benshila } & {\em } \\ 28 \end{tabular} 29 \end{figure} 21 22 \begin{table}[b] 23 \footnotesize 24 \caption*{Changes record} 25 \begin{tabularx}{\textwidth}{l||X|X} 26 Release & Author(s) & Modifications \\ 27 \hline 28 {\em 4.0} & {\em Simon M\"{u}ller \& Andrew Coward} & 29 {\em 30 Compatibility changes Major simplification has moved many of the options to external domain configuration tools. 31 (see \autoref{apdx:DOMAINcfg}) 32 } \\ 33 {\em 3.x} & {\em Rachid Benshila, Gurvan Madec \& S\'{e}bastien Masson} & 34 {\em First version} \\ 35 \end{tabularx} 36 \end{table} 30 37 31 38 \newpage 32 39 33 Having defined the continuous equations in \autoref{chap:PE} and chosen a time discreti zation \autoref{chap:STP},34 we need to choose a grid for spatial discreti zation and related numerical algorithms.40 Having defined the continuous equations in \autoref{chap:PE} and chosen a time discretisation \autoref{chap:STP}, 41 we need to choose a grid for spatial discretisation and related numerical algorithms. 35 42 In the present chapter, we provide a general description of the staggered grid used in \NEMO, 36 and other relevant information about the DOM (DOMain) source -code modules.43 and other relevant information about the DOM (DOMain) source code modules. 37 44 38 45 % ================================================================ … … 43 50 44 51 % ------------------------------------------------------------------------------------------------------------- 45 % Arrangement of Variables 52 % Arrangement of Variables 46 53 % ------------------------------------------------------------------------------------------------------------- 47 54 \subsection{Arrangement of variables} … … 75 82 the barotropic stream function $\psi$ is defined at horizontal points overlying the $\zeta$ and $f$-points. 76 83 77 The ocean mesh (\ie the position of all the scalar and vector points) is defined by the transformation that84 The ocean mesh (\ie\ the position of all the scalar and vector points) is defined by the transformation that 78 85 gives $(\lambda,\varphi,z)$ as a function of $(i,j,k)$. 79 86 The grid-points are located at integer or integer and a half value of $(i,j,k)$ as indicated on \autoref{tab:cell}. … … 127 134 128 135 Note that the definition of the scale factors 129 (\ie as the analytical first derivative of the transformation that136 (\ie\ as the analytical first derivative of the transformation that 130 137 results in $(\lambda,\varphi,z)$ as a function of $(i,j,k)$) 131 is specific to the \NEMO model \citep{marti.madec.ea_JGR92}.138 is specific to the \NEMO\ model \citep{marti.madec.ea_JGR92}. 132 139 As an example, a scale factor in the $i$ direction is defined locally at a $t$-point, 133 140 whereas many other models on a C grid choose to define such a scale factor as … … 159 166 160 167 % ------------------------------------------------------------------------------------------------------------- 161 % Vector Invariant Formulation 168 % Vector Invariant Formulation 162 169 % ------------------------------------------------------------------------------------------------------------- 163 170 \subsection{Discrete operators} … … 173 180 174 181 Similar operators are defined with respect to $i + 1/2$, $j$, $j + 1/2$, $k$, and $k + 1/2$. 175 Following \autoref{eq:PE_grad} and \autoref{eq:PE_lap}, the gradient of a variable $q$ defined at 176 a $t$-point has its three components defined at $u$-, $v$- and $w$-points while 177 its Laplacian is defined at the $t$-point. 182 Following \autoref{eq:PE_grad} and \autoref{eq:PE_lap}, the gradient of a variable $q$ defined at a $t$-point has 183 its three components defined at $u$-, $v$- and $w$-points while its Laplacian is defined at the $t$-point. 178 184 These operators have the following discrete forms in the curvilinear $s$-coordinates system: 179 185 \[ … … 215 221 216 222 The vertical average over the whole water column is denoted by an overbar and is for 217 a masked field $q$ (\ie a quantity that is equal to zero inside solid areas):223 a masked field $q$ (\ie\ a quantity that is equal to zero inside solid areas): 218 224 \begin{equation} 219 225 \label{eq:DOM_bar} … … 247 253 \end{alignat} 248 254 249 In other words, the adjoint of the differencing and averaging operators are $\delta_i^* = \delta_{i + 1/2}$ and 255 In other words, the adjoint of the differencing and averaging operators are $\delta_i^* = \delta_{i + 1/2}$ and 250 256 $(\overline{\cdots}^{\, i})^* = \overline{\cdots}^{\, i + 1/2}$, respectively. 251 257 These two properties will be used extensively in the \autoref{apdx:C} to … … 253 259 254 260 % ------------------------------------------------------------------------------------------------------------- 255 % Numerical Indexing 261 % Numerical Indexing 256 262 % ------------------------------------------------------------------------------------------------------------- 257 263 \subsection{Numerical indexing} … … 275 281 integer values for $t$-points only while all the other points involve integer and a half values. 276 282 Therefore, a specific integer indexing has been defined for points other than $t$-points 277 (\ie velocity and vorticity grid-points).283 (\ie\ velocity and vorticity grid-points). 278 284 Furthermore, the direction of the vertical indexing has been reversed and the surface level set at $k = 1$. 279 285 280 286 % ----------------------------------- 281 % Horizontal Indexing 287 % Horizontal Indexing 282 288 % ----------------------------------- 283 289 \subsubsection{Horizontal indexing} … … 288 294 the $t$-point and the eastward $u$-point (northward $v$-point) have the same index 289 295 (see the dashed area in \autoref{fig:index_hor}). 290 A $t$-point and its nearest north east $f$-point have the same $i$-and $j$-indices.296 A $t$-point and its nearest north-east $f$-point have the same $i$-and $j$-indices. 291 297 292 298 % ----------------------------------- 293 % Vertical indexing 299 % Vertical indexing 294 300 % ----------------------------------- 295 301 \subsubsection{Vertical indexing} … … 303 309 The last $w$-level ($k = jpk$) either corresponds to or is below the ocean floor while 304 310 the last $t$-level is always outside the ocean domain (\autoref{fig:index_vert}). 305 Note that a $w$-point and the directly underlaying $t$-point have a common $k$ index (\ie $t$-points and their 306 nearest $w$-point neighbour in negative index direction), in contrast to the indexing on the horizontal plane where 307 the $t$-point has the same index as the nearest velocity points in the positive direction of the respective horizontal axis index 311 Note that a $w$-point and the directly underlaying $t$-point have a common $k$ index 312 (\ie\ $t$-points and their nearest $w$-point neighbour in negative index direction), 313 in contrast to the indexing on the horizontal plane where the $t$-point has the same index as 314 the nearest velocity points in the positive direction of the respective horizontal axis index 308 315 (compare the dashed area in \autoref{fig:index_hor} and \autoref{fig:index_vert}). 309 316 Since the scale factors are chosen to be strictly positive, 310 a \textit{minus sign} is included in the \fortran implementations of \textit{all the vertical derivatives} of 311 the discrete equations given in this manual in order to accommodate the opposing vertical index directions in implementation and documentation. 317 a \textit{minus sign} is included in the \fortran implementations of 318 \textit{all the vertical derivatives} of the discrete equations given in this manual in order to 319 accommodate the opposing vertical index directions in implementation and documentation. 312 320 313 321 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> … … 333 341 \nlst{namcfg} 334 342 335 Two typical methods are available to specify the spatial domain 336 configuration; they can be selected using parameter \np{ln\_read\_cfg} 337 parameter in namelist \ngn{namcfg}. 338 339 If \np{ln\_read\_cfg} is set to \forcode{.true.}, the domain-specific parameters 340 and fields are read from a netCDF input file, whose name (without its .nc 341 suffix) can be specified as the value of the \np{cn\_domcfg} parameter in 342 namelist \ngn{namcfg}. 343 344 If \np{ln\_read\_cfg} is set to \forcode{.false.}, the domain-specific 345 parameters and fields can be provided (\eg analytically computed) by subroutines 346 \mdl{usrdef\_hgr} and \mdl{usrdef\_zgr}. These subroutines can be supplied in 347 the \path{MY_SRC} directory of the configuration, and default versions that 348 configure the spatial domain for the GYRE reference configuration are present in 349 the \path{src/OCE/USR} directory. 350 351 In version 4.0 there are no longer any options for reading complex bathmetries and 352 performing a vertical discretization at run-time. Whilst it is occasionally convenient 353 to have a common bathymetry file and, for example, to run similar models with and 354 without partial bottom boxes and/or sigma-coordinates, supporting such choices leads to 355 overly complex code. Worse still is the difficulty of ensuring the model configurations 356 intended to be identical are indeed so when the model domain itself can be altered by runtime 357 selections. The code previously used to perform vertical discretization has be incorporated 358 into an external tool (\path{tools/DOMAINcfg}) which is briefly described in \autoref{apdx:DOMAINcfg}. 359 360 The next subsections summarise the parameter and fields related to the 361 configuration of the whole model domain. These represent the minimum information 362 that must be provided either via the \np{cn\_domcfg} file or set by code 363 inserted into user-supplied versions of the \mdl{usrdef\_*} subroutines. The 364 requirements are presented in three sections: the domain size 365 (\autoref{subsec:DOM_size}), the horizontal mesh 366 (\autoref{subsec:DOM_hgr}), and the vertical grid 367 (\autoref{subsec:DOM_zgr}). 343 Two typical methods are available to specify the spatial domain configuration; 344 they can be selected using parameter \np{ln\_read\_cfg} parameter in namelist \nam{cfg}. 345 346 If \np{ln\_read\_cfg} is set to \forcode{.true.}, 347 the domain-specific parameters and fields are read from a netCDF input file, 348 whose name (without its .nc suffix) can be specified as the value of the \np{cn\_domcfg} parameter in namelist \nam{cfg}. 349 350 If \np{ln\_read\_cfg} is set to \forcode{.false.}, 351 the domain-specific parameters and fields can be provided (\eg\ analytically computed) by 352 subroutines \mdl{usrdef\_hgr} and \mdl{usrdef\_zgr}. 353 These subroutines can be supplied in the \path{MY_SRC} directory of the configuration, 354 and default versions that configure the spatial domain for the GYRE reference configuration are present in 355 the \path{./src/OCE/USR} directory. 356 357 In version 4.0 there are no longer any options for reading complex bathymetries and 358 performing a vertical discretisation at run-time. 359 Whilst it is occasionally convenient to have a common bathymetry file and, for example, 360 to run similar models with and without partial bottom boxes and/or sigma-coordinates, 361 supporting such choices leads to overly complex code. 362 Worse still is the difficulty of ensuring the model configurations intended to be identical are indeed so when 363 the model domain itself can be altered by runtime selections. 364 The code previously used to perform vertical discretisation has been incorporated into an external tool 365 (\path{./tools/DOMAINcfg}) which is briefly described in \autoref{apdx:DOMAINcfg}. 366 367 The next subsections summarise the parameter and fields related to the configuration of the whole model domain. 368 These represent the minimum information that must be provided either via the \np{cn\_domcfg} file or set by code 369 inserted into user-supplied versions of the \texttt{usrdef\_*} subroutines. 370 The requirements are presented in three sections: 371 the domain size (\autoref{subsec:DOM_size}), the horizontal mesh (\autoref{subsec:DOM_hgr}), 372 and the vertical grid (\autoref{subsec:DOM_zgr}). 368 373 369 374 % ----------------------------------- … … 373 378 \label{subsec:DOM_size} 374 379 375 The total size of the computational domain is set by the parameters 376 \np{jpiglo}, \np{jpjglo} and \np{jpkglo} for the $i$, $j$ and $k$ 377 directions, respectively. Note, that the variables \forcode{jpi} and \forcode{jpj} 378 refer to the size of each processor subdomain when the code is run in 379 parallel using domain decomposition (\key{mpp\_mpi} defined, see 380 \autoref{sec:LBC_mpp}). 380 The total size of the computational domain is set by the parameters \jp{jpiglo}, \jp{jpjglo} and \jp{jpkglo} for 381 the $i$, $j$ and $k$ directions, respectively. 382 Note, that the variables \texttt{jpi} and \texttt{jpj} refer to the size of each processor subdomain when 383 the code is run in parallel using domain decomposition (\key{mpp\_mpi} defined, 384 see \autoref{sec:LBC_mpp}). 381 385 382 386 The name of the configuration is set through parameter \np{cn\_cfg}, 383 and the nominal resolution through parameter \np{nn\_cfg} (unless in 384 the input file both of variables \forcode{ORCA} and \forcode{ORCA_index} 385 are present, in which case \np{cn\_cfg} and \np{nn\_cfg} are set from these 386 values accordingly). 387 388 The global lateral boundary condition type is selected from 8 options 389 using parameter \np{jperio}. See \autoref{sec:LBC_jperio} for 390 details on the available options and the corresponding values for 391 \np{jperio}. 392 393 % ================================================================ 394 % Domain: Horizontal Grid (mesh) 387 and the nominal resolution through parameter \np{nn\_cfg} 388 (unless in the input file both of variables \texttt{ORCA} and \texttt{ORCA\_index} are present, 389 in which case \np{cn\_cfg} and \np{nn\_cfg} are set from these values accordingly). 390 391 The global lateral boundary condition type is selected from 8 options using parameter \jp{jperio}. 392 See \autoref{sec:LBC_jperio} for details on the available options and the corresponding values for \jp{jperio}. 393 394 % ================================================================ 395 % Domain: Horizontal Grid (mesh) 395 396 % ================================================================ 396 397 \subsection{Horizontal grid mesh (\protect\mdl{domhgr})} … … 402 403 \subsubsection{Required fields} 403 404 \label{sec:DOM_hgr_fields} 404 The explicit specification of a range of mesh-related fields are required for the definition of a configuration. These include: 405 406 \begin{Verbatim}[fontsize=\tiny] 405 406 The explicit specification of a range of mesh-related fields are required for the definition of a configuration. 407 These include: 408 409 \begin{clines} 407 410 int jpiglo, jpjglo, jpkglo /* global domain sizes */ 408 411 int jperio /* lateral global domain b.c. */ … … 411 414 double e1t, e1u, e1v, e1f /* horizontal scale factors */ 412 415 double e2t, e2u, e2v, e2f /* horizontal scale factors */ 413 \end{Verbatim} 414 415 The values of the geographic longitude and latitude arrays at indices $i,j$ correspond to the analytical expressions of the longitude $\lambda$ and latitude $\varphi$ as a function of $(i,j)$, evaluated at the values as specified in Table \autoref{tab:cell} for the respective grid-point position. The calculation of the values of the horizontal scale factor arrays in general additionally involves partial derivatives of $\lambda$ and $\varphi$ with respect to $i$ and $j$, evaluated for the same arguments as $\lambda$ and $\varphi$. 416 \end{clines} 417 418 The values of the geographic longitude and latitude arrays at indices $i,j$ correspond to 419 the analytical expressions of the longitude $\lambda$ and latitude $\varphi$ as a function of $(i,j)$, 420 evaluated at the values as specified in \autoref{tab:cell} for the respective grid-point position. 421 The calculation of the values of the horizontal scale factor arrays in general additionally involves 422 partial derivatives of $\lambda$ and $\varphi$ with respect to $i$ and $j$, 423 evaluated for the same arguments as $\lambda$ and $\varphi$. 416 424 417 425 \subsubsection{Optional fields} 418 \begin{Verbatim}[fontsize=\tiny] 426 427 \begin{clines} 419 428 /* Optional: */ 420 429 int ORCA, ORCA_index /* configuration name, configuration resolution */ 421 430 double e1e2u, e1e2v /* U and V surfaces (if grid size reduction in some straits) */ 422 431 double ff_f, ff_t /* Coriolis parameter (if not on the sphere) */ 423 \end{Verbatim} 424 425 NEMO can support the local reduction of key strait widths by altering individual values of 426 e2u or e1v at the appropriate locations. This is particularly useful for locations such as 427 Gibraltar or Indonesian Throughflow pinch-points (see \autoref{sec:MISC_strait} for 428 illustrated examples). The key is to reduce the faces of $T$-cell (\ie change the value of 429 the horizontal scale factors at $u$- or $v$-point) but not the volume of the cells. Doing 430 otherwise can lead to numerical instability issues. In normal operation the surface areas 431 are computed from $\texttt{e1u} * \texttt{e2u}$ and $\texttt{e1v} * \texttt{e2v}$ but in 432 cases where a gridsize reduction is required, the unaltered surface areas at $u$ and $v$ 433 grid points (\texttt{e1e2u} and \texttt{e1e2v}, respectively) must be read or pre-computed 434 in \mdl{usrdef\_hgr}. If these arrays are present in the \np{cn\_domcfg} file they are 435 read and the internal computation is suppressed. Versions of \mdl{usrdef\_hgr} which set 436 their own values of \texttt{e1e2u} and \texttt{e1e2v} should set the surface-area 437 computation flag: \texttt{ie1e2u\_v} to a non-zero value to suppress their re-computation. 432 \end{clines} 433 434 \NEMO\ can support the local reduction of key strait widths by 435 altering individual values of e2u or e1v at the appropriate locations. 436 This is particularly useful for locations such as Gibraltar or Indonesian Throughflow pinch-points 437 (see \autoref{sec:MISC_strait} for illustrated examples). 438 The key is to reduce the faces of $T$-cell (\ie\ change the value of the horizontal scale factors at $u$- or $v$-point) but 439 not the volume of the cells. 440 Doing otherwise can lead to numerical instability issues. 441 In normal operation the surface areas are computed from $e1u * e2u$ and $e1v * e2v$ but 442 in cases where a gridsize reduction is required, 443 the unaltered surface areas at $u$ and $v$ grid points (\texttt{e1e2u} and \texttt{e1e2v}, respectively) must be read or 444 pre-computed in \mdl{usrdef\_hgr}. 445 If these arrays are present in the \np{cn\_domcfg} file they are read and the internal computation is suppressed. 446 Versions of \mdl{usrdef\_hgr} which set their own values of \texttt{e1e2u} and \texttt{e1e2v} should set 447 the surface-area computation flag: 448 \texttt{ie1e2u\_v} to a non-zero value to suppress their re-computation. 438 449 439 450 \smallskip 440 Similar logic applies to the other optional fields: \texttt{ff\_f} and \texttt{ff\_t} 441 which can be used to provide the Coriolis parameter at F- and T-points respectively if the 442 mesh is not on a sphere. If present these fields will be read and used and the normal 443 calculation ($2*\Omega*\sin(\varphi)$) suppressed. Versions of \mdl{usrdef\_hgr} which set 444 their own values of \texttt{ff\_f} and \texttt{ff\_t} should set the Coriolis computation 445 flag: \texttt{iff} to a non-zero value to suppress their re-computation. 446 447 Note that longitudes, latitudes, and scale factors at $w$ points are exactly 448 equal to those of $t$ points, thus no specific arrays are defined at $w$ points. 451 Similar logic applies to the other optional fields: 452 \texttt{ff\_f} and \texttt{ff\_t} which can be used to provide the Coriolis parameter at F- and T-points respectively if 453 the mesh is not on a sphere. 454 If present these fields will be read and used and the normal calculation ($2 * \Omega * \sin(\varphi)$) suppressed. 455 Versions of \mdl{usrdef\_hgr} which set their own values of \texttt{ff\_f} and \texttt{ff\_t} should set 456 the Coriolis computation flag: 457 \texttt{iff} to a non-zero value to suppress their re-computation. 458 459 Note that longitudes, latitudes, and scale factors at $w$ points are exactly equal to those of $t$ points, 460 thus no specific arrays are defined at $w$ points. 449 461 450 462 … … 459 471 %------------------------------------------------------------------------------------------------------------- 460 472 461 In the vertical, the model mesh is determined by four things: 473 In the vertical, the model mesh is determined by four things: 462 474 \begin{enumerate} 463 \item the bathymetry given in meters; 464 \item the number of levels of the model (\jp{jpk}); 475 \item the bathymetry given in meters; 476 \item the number of levels of the model (\jp{jpk}); 465 477 \item the analytical transformation $z(i,j,k)$ and the vertical scale factors (derivatives of the transformation); and 466 \item the masking system, \ie the number of wet model levels at each478 \item the masking system, \ie\ the number of wet model levels at each 467 479 $(i,j)$ location of the horizontal grid. 468 480 \end{enumerate} … … 488 500 489 501 The choice of a vertical coordinate is made when setting up the configuration; 490 it is not intended to be an option which can be changed in the middle of an 491 experiment. The one exception to this statement being the choice of linear or 492 non-linear free surface. In v4.0 the linear free surface option is implemented 493 as a special case of the non-linear free surface. This is computationally 494 wasteful since it uses the structures for time-varying 3D metrics for fields 495 that (in the linear free surface case) are fixed. However, the linear 496 free-surface is rarely used and implementing it this way means a single configuration 497 file can support both options. 498 499 By default a non-linear free surface is used (\np{ln\_linssh} set to \forcode{ = 500 .false.} in \ngn{namdom}): the coordinate follow the time-variation of the free 501 surface so that the transformation is time dependent: $z(i,j,k,t)$ 502 (\eg \autoref{fig:z_zps_s_sps}f). When a linear free surface is assumed 503 (\np{ln\_linssh} set to \forcode{ = .true.} in \ngn{namdom}), the vertical 504 coordinates are fixed in time, but the seawater can move up and down across the 505 $z_0$ surface (in other words, the top of the ocean in not a rigid lid). 506 507 Note that settings: \np{ln\_zco}, \np{ln\_zps}, \np{ln\_sco} and \np{ln\_isfcav} mentioned 508 in the following sections appear to be namelist options but they are no longer truly 509 namelist options for NEMO. Their value is written to and read from the domain configuration file 510 and they should be treated as fixed parameters for a particular configuration. They are 511 namelist options for the \forcode{DOMAINcfg} tool that can be used to build the 512 configuration file and serve both to provide a record of the choices made whilst building the 513 configuration and to trigger appropriate code blocks within NEMO. 502 it is not intended to be an option which can be changed in the middle of an experiment. 503 The one exception to this statement being the choice of linear or non-linear free surface. 504 In v4.0 the linear free surface option is implemented as a special case of the non-linear free surface. 505 This is computationally wasteful since it uses the structures for time-varying 3D metrics 506 for fields that (in the linear free surface case) are fixed. 507 However, the linear free-surface is rarely used and implementing it this way means 508 a single configuration file can support both options. 509 510 By default a non-linear free surface is used (\np{ln\_linssh} set to \forcode{ = .false.} in \nam{dom}): 511 the coordinate follow the time-variation of the free surface so that the transformation is time dependent: 512 $z(i,j,k,t)$ (\eg\ \autoref{fig:z_zps_s_sps}f). 513 When a linear free surface is assumed (\np{ln\_linssh} set to \forcode{ = .true.} in \nam{dom}), 514 the vertical coordinates are fixed in time, but the seawater can move up and down across the $z_0$ surface 515 (in other words, the top of the ocean in not a rigid lid). 516 517 Note that settings: 518 \np{ln\_zco}, \np{ln\_zps}, \np{ln\_sco} and \np{ln\_isfcav} mentioned in the following sections 519 appear to be namelist options but they are no longer truly namelist options for \NEMO. 520 Their value is written to and read from the domain configuration file and 521 they should be treated as fixed parameters for a particular configuration. 522 They are namelist options for the \texttt{DOMAINcfg} tool that can be used to build the configuration file and 523 serve both to provide a record of the choices made whilst building the configuration and 524 to trigger appropriate code blocks within \NEMO. 514 525 These values should not be altered in the \np{cn\_domcfg} file. 515 526 … … 527 538 $s-z$ or $s-zps$ coordinate (\autoref{fig:z_zps_s_sps}d and \autoref{fig:z_zps_s_sps}e). 528 539 529 A further choice related to vertical coordinate concerns the presence (or not) of ocean530 cavities beneath ice shelves within the model domain. A setting of \np{ln\_isfcav} as 531 \forcode{.true.} indicates that the domain contains ocean cavities, otherwise the top,532 wet layer of the ocean will always be at the ocean surface. This option is currently only 533 available for $z$- or $zps$-coordinates. In the latter case, partial steps are also applied 534 at the ocean/ice shelf interface.535 536 Within the model, the arrays describing the grid point depths and vertical scale factors 537 are three set of three dimensional arrays $(i,j,k)$ defined at \textit{before}, 538 \textit{now} and \textit{after} time step. The time at which they are defined is 539 indicated by a suffix: $\_b$, $\_n$, or $\_a$, respectively. They are updated at each 540 model time step. The initial fixed reference coordinate system is held in variable names 541 with a $\_0$ suffix. When the linear free surface option is used 542 (\np{ln\_linssh}\forcode{ = .true.}), \textit{before}, \textit{now} and \textit{after} 543 arrays are initially set totheir reference counterpart and remain fixed.540 A further choice related to vertical coordinate concerns 541 the presence (or not) of ocean cavities beneath ice shelves within the model domain. 542 A setting of \np{ln\_isfcav} as \forcode{.true.} indicates that the domain contains ocean cavities, 543 otherwise the top, wet layer of the ocean will always be at the ocean surface. 544 This option is currently only available for $z$- or $zps$-coordinates. 545 In the latter case, partial steps are also applied at the ocean/ice shelf interface. 546 547 Within the model, the arrays describing the grid point depths and vertical scale factors are three set of 548 three dimensional arrays $(i,j,k)$ defined at \textit{before}, \textit{now} and \textit{after} time step. 549 The time at which they are defined is indicated by a suffix: $\_b$, $\_n$, or $\_a$, respectively. 550 They are updated at each model time step. 551 The initial fixed reference coordinate system is held in variable names with a $\_0$ suffix. 552 When the linear free surface option is used (\np{ln\_linssh}\forcode{ = .true.}), 553 \textit{before}, \textit{now} and \textit{after} arrays are initially set to 554 their reference counterpart and remain fixed. 544 555 545 556 \subsubsection{Required fields} 546 557 \label{sec:DOM_zgr_fields} 547 The explicit specification of a range of fields related to the vertical grid are required for the definition of a configuration. These include: 548 549 \begin{Verbatim}[fontsize=\tiny] 558 559 The explicit specification of a range of fields related to the vertical grid are required for 560 the definition of a configuration. 561 These include: 562 563 \begin{clines} 550 564 int ln_zco, ln_zps, ln_sco /* flags for z-coord, z-coord with partial steps and s-coord */ 551 565 int ln_isfcav /* flag for ice shelf cavities */ … … 556 570 /* For reference: */ 557 571 float bathy_metry /* bathymetry used in setting top and bottom levels */ 558 \end{Verbatim} 559 560 This set of vertical metrics is sufficient to describe the initial depth and thickness of 561 every gridcell in the model regardless of the choice of vertical coordinate. With constant 562 z-levels, e3 metrics will be uniform across each horizontal level. In the partial step 563 case each e3 at the \np{bottom\_level} (and, possibly, \np{top\_level} if ice cavities are 564 present) may vary from its horizontal neighbours. And, in s-coordinates, variations can 565 occur throughout the water column. With the non-linear free-surface, all the coordinates 566 behave more like the s-coordinate in that variations occurr throughout the water column 567 with displacements related to the sea surface height. These variations are typically much 568 smaller than those arising from bottom fitted coordinates. The values for vertical metrics 569 supplied in the domain configuration file can be considered as those arising from a flat 570 sea surface with zero elevation. 571 572 The \np{bottom\_level} and \np{top\_level} 2D arrays define the \np{bottom\_level} and top 573 wet levels in each grid column. Without ice cavities, \np{top\_level} is essentially a land 574 mask (0 on land; 1 everywhere else). With ice cavities, \np{top\_level} determines the 575 first wet point below the overlying ice shelf. 576 577 578 579 % ------------------------------------------------------------------------------------------------------------- 580 % level bathymetry and mask 572 \end{clines} 573 574 This set of vertical metrics is sufficient to describe the initial depth and thickness of every gridcell in 575 the model regardless of the choice of vertical coordinate. 576 With constant z-levels, e3 metrics will be uniform across each horizontal level. 577 In the partial step case each e3 at the \jp{bottom\_level} 578 (and, possibly, \jp{top\_level} if ice cavities are present) 579 may vary from its horizontal neighbours. 580 And, in s-coordinates, variations can occur throughout the water column. 581 With the non-linear free-surface, all the coordinates behave more like the s-coordinate in 582 that variations occur throughout the water column with displacements related to the sea surface height. 583 These variations are typically much smaller than those arising from bottom fitted coordinates. 584 The values for vertical metrics supplied in the domain configuration file can be considered as 585 those arising from a flat sea surface with zero elevation. 586 587 The \jp{bottom\_level} and \jp{top\_level} 2D arrays define the \jp{bottom\_level} and top wet levels in each grid column. 588 Without ice cavities, \jp{top\_level} is essentially a land mask (0 on land; 1 everywhere else). 589 With ice cavities, \jp{top\_level} determines the first wet point below the overlying ice shelf. 590 591 592 % ------------------------------------------------------------------------------------------------------------- 593 % level bathymetry and mask 581 594 % ------------------------------------------------------------------------------------------------------------- 582 595 \subsubsection{Level bathymetry and mask} … … 584 597 585 598 586 From \ np{top\_level} and \np{bottom\_level} fields, the mask fields are defined as follows:599 From \jp{top\_level} and \jp{bottom\_level} fields, the mask fields are defined as follows: 587 600 \begin{alignat*}{2} 588 601 tmask(i,j,k) &= & & … … 603 616 Note that, without ice shelves cavities, 604 617 masks at $t-$ and $w-$points are identical with the numerical indexing used (\autoref{subsec:DOM_Num_Index}). 605 Nevertheless, $wmask$ are required with ocean cavities to deal with the top boundary (ice shelf/ocean interface) 618 Nevertheless, $wmask$ are required with ocean cavities to deal with the top boundary (ice shelf/ocean interface) 606 619 exactly in the same way as for the bottom boundary. 607 620 … … 614 627 615 628 %------------------------------------------------------------------------------------------------- 616 % Closed seas 629 % Closed seas 617 630 %------------------------------------------------------------------------------------------------- 618 \subsection{Closed seas} \label{subsec:DOM_closea} 619 620 When a global ocean is coupled to an atmospheric model it is better to represent all large 621 water bodies (\eg great lakes, Caspian sea...) even if the model resolution does not allow 622 their communication with the rest of the ocean. This is unnecessary when the ocean is 623 forced by fixed atmospheric conditions, so these seas can be removed from the ocean 624 domain. The user has the option to set the bathymetry in closed seas to zero (see 625 \autoref{sec:MISC_closea}) and to optionally decide on the fate of any freshwater 626 imbalance over the area. The options are explained in \autoref{sec:MISC_closea} but it 627 should be noted here that a successful use of these options requires appropriate mask 628 fields to be present in the domain configuration file. Among the possibilities are: 629 630 \begin{Verbatim}[fontsize=\tiny] 631 \subsection{Closed seas} \label{subsec:DOM_closea} 632 633 When a global ocean is coupled to an atmospheric model it is better to represent all large water bodies 634 (\eg\ Great Lakes, Caspian sea \dots) even if the model resolution does not allow their communication with 635 the rest of the ocean. 636 This is unnecessary when the ocean is forced by fixed atmospheric conditions, 637 so these seas can be removed from the ocean domain. 638 The user has the option to set the bathymetry in closed seas to zero (see \autoref{sec:MISC_closea}) and 639 to optionally decide on the fate of any freshwater imbalance over the area. 640 The options are explained in \autoref{sec:MISC_closea} but it should be noted here that 641 a successful use of these options requires appropriate mask fields to be present in the domain configuration file. 642 Among the possibilities are: 643 644 \begin{clines} 631 645 int closea_mask /* non-zero values in closed sea areas for optional masking */ 632 646 int closea_mask_rnf /* non-zero values in closed sea areas with runoff locations (precip only) */ 633 647 int closea_mask_emp /* non-zero values in closed sea areas with runoff locations (total emp) */ 634 \end{ Verbatim}648 \end{clines} 635 649 636 650 % ------------------------------------------------------------------------------------------------------------- … … 642 656 \nlst{namcfg} 643 657 644 Most of the arrays relating to a particular ocean model configuration dicussed in this 645 chapter (grid-point position, scale factors) can be saved in a file if namelist parameter 646 \np{ln\_write\_cfg} (namelist \ngn{namcfg}) is set to \forcode{.true.}; the output 647 filename is set thorugh parameter \np{cn\_domcfg\_out}. This is only really useful 648 if the fields are computed in subroutines \mdl{usrdef\_hgr} or \mdl{usrdef\_zgr} and 658 Most of the arrays relating to a particular ocean model configuration discussed in this chapter 659 (grid-point position, scale factors) 660 can be saved in a file if 661 namelist parameter \np{ln\_write\_cfg} (namelist \nam{cfg}) is set to \forcode{.true.}; 662 the output filename is set through parameter \np{cn\_domcfg\_out}. 663 This is only really useful if 664 the fields are computed in subroutines \mdl{usrdef\_hgr} or \mdl{usrdef\_zgr} and 649 665 checking or confirmation is required. 650 666 … … 652 668 653 669 Alternatively, all the arrays relating to a particular ocean model configuration 654 (grid-point position, scale factors, depths and masks) can be saved in a file called655 \texttt{mesh\_mask} if namelist parameter \np{ln\_meshmask} (namelist \ngn{namdom}) is set 656 to \forcode{.true.}. This file contains additional fields that can be useful for 657 post-processing applications 670 (grid-point position, scale factors, depths and masks) 671 can be saved in a file called \texttt{mesh\_mask} if 672 namelist parameter \np{ln\_meshmask} (namelist \nam{dom}) is set to \forcode{.true.}. 673 This file contains additional fields that can be useful for post-processing applications. 658 674 659 675 % ================================================================ … … 664 680 \label{sec:DTA_tsd} 665 681 %-----------------------------------------namtsd------------------------------------------- 666 \nlst{namtsd} 682 \nlst{namtsd} 667 683 %------------------------------------------------------------------------------------------ 668 684 669 Basic initial state options are defined in \n gn{namtsd}. By default, the ocean starts670 from rest (the velocity field is set to zero) and the initialization of temperatureand671 salinity fields is controlled through the \np{ln\_tsd\_init} namelist parameter.685 Basic initial state options are defined in \nam{tsd}. 686 By default, the ocean starts from rest (the velocity field is set to zero) and 687 the initialization of temperature and salinity fields is controlled through the \np{ln\_tsd\_init} namelist parameter. 672 688 673 689 \begin{description} 674 690 \item[\np{ln\_tsd\_init}\forcode{= .true.}] 675 Use T and S input files that can be given on the model grid itself or on their native 676 input data grids. In the latter case, the data will be interpolated on-the-fly both in677 the horizontal and the vertical to the model grid (see \autoref{subsec:SBC_iof}). The678 information relating to the input files are specified in the \np{sn\_tem} and679 \np{sn\_sal} structures.The computation is done in the \mdl{dtatsd} module.691 Use T and S input files that can be given on the model grid itself or on their native input data grids. 692 In the latter case, the data will be interpolated on-the-fly both in the horizontal and the vertical to the model grid 693 (see \autoref{subsec:SBC_iof}). 694 The information relating to the input files are specified in the \np{sn\_tem} and \np{sn\_sal} structures. 695 The computation is done in the \mdl{dtatsd} module. 680 696 \item[\np{ln\_tsd\_init}\forcode{= .false.}] 681 Initial values for T and S are set via a user supplied \rou{usr\_def\_istate} routine 682 contained in \mdl{userdef\_istate}. The default version sets horizontally uniform T and683 profiles as used in the GYRE configuration(see \autoref{sec:CFG_gyre}).697 Initial values for T and S are set via a user supplied \rou{usr\_def\_istate} routine contained in \mdl{userdef\_istate}. 698 The default version sets horizontally uniform T and profiles as used in the GYRE configuration 699 (see \autoref{sec:CFG_gyre}). 684 700 \end{description} 685 701
Note: See TracChangeset
for help on using the changeset viewer.