- Timestamp:
- 2010-10-15T16:42:00+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/nemo_v3_3_beta/DOC/TexFiles/Chapters/Chap_DOM.tex
r1224 r2282 3 3 % Chapter 2 Ñ Space and Time Domain (DOM) 4 4 % ================================================================ 5 \chapter{Space and TimeDomain (DOM) }5 \chapter{Space Domain (DOM) } 6 6 \label{DOM} 7 7 \minitoc … … 12 12 % should be put outside of DOM routine (better with TRC staff and off-line 13 13 % tracers) 14 % - daymod: definition of the time domain (nit000, nitend andd the calendar)15 14 % -geo2ocean: how to switch from geographic to mesh coordinate 16 % - domclo: closed sea and lakes.... management of closea sea area : specific to global configuration, both forced and coupled 17 18 \gmcomment{STEVEN :maybe a picture of the directory structure in the introduction 19 which could be referred to here, would help ==> to be added} 20 %%%% 15 % - domclo: closed sea and lakes.... management of closea sea area : specific to global configuration, both forced and coupled 21 16 22 17 … … 24 19 $\ $\newline % force a new ligne 25 20 26 27 Having defined the continuous equations in Chap.~\ref{PE}, we need to choose a 28 discretization on a grid, and numerical algorithms. In the present chapter, we 29 provide a general description of the staggered grid used in \NEMO, and other 30 information relevant to the main directory routines (time stepping, main program) 31 as well as the DOM (DOMain) directory. 21 Having defined the continuous equations in Chap.~\ref{PE} and chosen a time 22 discretization Chap.~\ref{STP}, we need to choose a discretization on a grid, 23 and numerical algorithms. In the present chapter, we provide a general description 24 of the staggered grid used in \NEMO, and other information relevant to the main 25 directory routines as well as the DOM (DOMain) directory. 26 27 $\ $\newline % force a new ligne 32 28 33 29 % ================================================================ … … 46 42 \begin{figure}[!tb] \label{Fig_cell} \begin{center} 47 43 \includegraphics[width=0.90\textwidth]{./TexFiles/Figures/Fig_cell.pdf} 48 \caption{Arrangement of variables. $ T$ indicates scalar points where temperature,44 \caption{Arrangement of variables. $t$ indicates scalar points where temperature, 49 45 salinity, density, pressure and horizontal divergence are defined. ($u$,$v$,$w$) 50 46 indicates vector points, and $f$ indicates vorticity points where both relative and … … 57 53 Special attention has been given to the homogeneity of the solution in the three 58 54 space directions. The arrangement of variables is the same in all directions. 59 It consists of cells centred on scalar points ($ T$, $S$, $p$, $\rho$) with vector55 It consists of cells centred on scalar points ($t$, $S$, $p$, $\rho$) with vector 60 56 points $(u, v, w)$ defined in the centre of each face of the cells (Fig. \ref{Fig_cell}). 61 57 This is the generalisation to three dimensions of the well-known ``C'' grid in … … 120 116 Similar operators are defined with respect to $i+1/2$, $j$, $j+1/2$, $k$, and 121 117 $k+1/2$. Following \eqref{Eq_PE_grad} and \eqref{Eq_PE_lap}, the gradient of a 122 variable $q$ defined at a $ T$-point has its three components defined at $u$-, $v$-123 and $w$-points while its Laplacien is defined at $ T$-point. These operators have118 variable $q$ defined at a $t$-point has its three components defined at $u$-, $v$- 119 and $w$-points while its Laplacien is defined at $t$-point. These operators have 124 120 the following discrete forms in the curvilinear $s$-coordinate system: 125 121 \begin{equation} \label{Eq_DOM_grad} 126 \nabla q\equiv \frac{1}{e_{1u} } \delta _{i+1/2} \left[ q \right]\;\,{\rm {\bf i}}127 + \frac{1}{e_{2v} }\delta _{j+1/2} \left[ q \right]\;\,{\rm {\bf j}}128 + \frac{1}{e_{3w} }\delta _{k+1/2} \left[ q \right]\;\,{\rm {\bf k}}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}} 129 125 \end{equation} 130 126 \begin{multline} \label{Eq_DOM_lap} 131 \Delta q\equiv \frac{1}{e_{1T} {\kern 1pt}e_{2T} {\kern 1pt}e_{3T} }\;\left( 132 {\delta _i \left[ {\frac{e_{2u} e_{3u} }{e_{1u} }\;\delta _{i+1/2} 133 \left[ q \right]} \right] 134 +\delta _j \left[ {\frac{e_{1v} e_{3v} }{e_{2v} 135 }\;\delta _{j+1/2} \left[ q \right]} \right]\;} \right) \\ 136 +\frac{1}{e_{3T} }\delta _k \left[ {\frac{1}{e_{3w} }\;\delta _{k+1/2} 137 \left[ q \right]} \right] 127 \Delta q\equiv \frac{1}{e_{1t}\,e_{2t}\,e_{3t} } 128 \;\left( \delta_i \left[ \frac{e_{2u}\,e_{3u}} {e_{1u}} \;\delta_{i+1/2} [q] \right] 129 + \delta_j \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] 138 131 \end{multline} 139 132 140 Following \eqref{Eq_PE_curl} and \eqref{Eq_PE_div}, a vector ${\rm {\bf A}}=\left( a_1,a_2,a_3\right)$ defined at vector points $(u,v,w)$ has its three curl 141 components defined at $vw$-, $uw$, and $f$-points, and its divergence defined 142 at $T$-points: 143 \begin{equation} \label{Eq_DOM_curl} 144 \begin{split} 145 \nabla \times {\rm {\bf A}}\equiv \frac{1}{e_{2v} {\kern 1pt}e_{3vw} 146 }{\kern 1pt}\,\;\left( {\delta _{j+1/2} \left[ {e_{3w} a_3 } \right]-\delta 147 _{k+1/2} \left[ {e_{2v} a_2 } \right]} \right) &\;\;{\rm {\bf i}} \\ 148 +\frac{1}{e_{2u} {\kern 1pt}e_{3uw} }\;\left( {\delta _{k+1/2} \left[ {e_{1u} a_1 } 149 \right]-\delta _{i+1/2} \left[ {e_{3w} a_3 } \right]} \right) &\;\;{\rm{\bf j}} \\ 150 +\frac{e_{3f} }{e_{1f} {\kern 1pt}e_{2f} }\,{\kern 1pt}\;\left( {\delta 151 _{i+1/2} \left[ {e_{2v} a_2 } \right]-\delta _{j+12} \left[ {e_{1u} a_1 } \right]} 152 \right) &\;\;{\rm {\bf k}} 153 \end{split} 154 \end{equation} 133 Following \eqref{Eq_PE_curl} and \eqref{Eq_PE_div}, a vector ${\rm {\bf A}}=\left( a_1,a_2,a_3\right)$ 134 defined at vector points $(u,v,w)$ has its three curl components defined at $vw$-, $uw$, 135 and $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} 155 142 \begin{equation} \label{Eq_DOM_div} 156 \nabla \cdot {\rm {\bf A}}=\frac{1}{e_{1T} e_{2T} e_{3T} }\left( {\delta 157 _i \left[ {e_{2u} e_{3u} a_1 } \right]+\delta _j \left[ {e_{1v} e_{3v} a_2 } 158 \right]} \right)+\frac{1}{e_{3T} }\delta _k \left[ {a_3 } \right] 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] 159 145 \end{equation} 160 146 … … 164 150 horizontal location of a grid point. For example \eqref{Eq_DOM_div} reduces to: 165 151 \begin{equation*} 166 \nabla \cdot {\rm {\bf A}}=\frac{1}{e_{1T} e_{2T} }\left( {\delta167 _i \left[ {e_{2u} a_1 } \right]+\delta _j \left[ {e_{1v} a_2 } 168 \right]} \right)+\frac{1}{e_{3T} }\delta _k \left[ {a_3 }\right]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] 169 155 \end{equation*} 170 156 … … 172 158 for a quantity $q$ which is a masked field (i.e. equal to zero inside solid area): 173 159 \begin{equation} \label{DOM_bar} 174 \bar q = \frac{1}{H}\int_{k^b}^{k^o} {q\;e_{3q} \,dk}160 \bar q = \frac{1}{H} \int_{k^b}^{k^o} {q\;e_{3q} \,dk} 175 161 \equiv \frac{1}{H_q }\sum\limits_k {q\;e_{3q} } 176 162 \end{equation} … … 189 175 190 176 It is straightforward to demonstrate that these properties are verified locally in 191 discrete form as soon as the scalar $q$ is taken at $ T$-points and the vector177 discrete form as soon as the scalar $q$ is taken at $t$-points and the vector 192 178 \textbf{A} has its components defined at vector points $(u,v,w)$. 193 179 … … 230 216 The array representation used in the \textsc{Fortran} code requires an integer 231 217 indexing while the analytical definition of the mesh (see \S\ref{DOM_cell}) is 232 associated with the use of integer values for $ T$-points and both integer and218 associated with the use of integer values for $t$-points and both integer and 233 219 integer and a half values for all the other points. Therefore a specific integer 234 indexing must be defined for points other than $ T$-points ($i.e.$ velocity and220 indexing must be defined for points other than $t$-points ($i.e.$ velocity and 235 221 vorticity grid-points). Furthermore, the direction of the vertical indexing has 236 222 been changed so that the surface level is at $k=1$. … … 242 228 \label{DOM_Num_Index_hor} 243 229 244 The indexing in the horizontal plane has been chosen as shown in Fig.\ref{Fig_index_hor}. For an increasing $i$ index ($j$ index), the $T$-point245 and the eastward $u$-point (northward $v$-point) have the same index246 ( see the dashed area in Fig.\ref{Fig_index_hor}). A $T$-point and its247 nearest northeast $f$-point have the same $i$-and $j$-indices.230 The indexing in the horizontal plane has been chosen as shown in Fig.\ref{Fig_index_hor}. 231 For 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}). 233 A $t$-point and its nearest northeast $f$-point have the same $i$-and $j$-indices. 248 234 249 235 % ----------------------------------- … … 257 243 to the indexing used in the semi-discrete equations and given in \S\ref{DOM_cell}. 258 244 The sea surface corresponds to the $w$-level $k=1$ which is the same index 259 as $ T$-level just below (Fig.\ref{Fig_index_vert}). The last $w$-level ($k=jpk$)245 as $t$-level just below (Fig.\ref{Fig_index_vert}). The last $w$-level ($k=jpk$) 260 246 either corresponds to the ocean floor or is inside the bathymetry while the last 261 $ T$-level is always inside the bathymetry (Fig.\ref{Fig_index_vert}). Note that262 for an increasing $k$ index, a $w$-point and the $ T$-point just below have the247 $t$-level is always inside the bathymetry (Fig.\ref{Fig_index_vert}). Note that 248 for an increasing $k$ index, a $w$-point and the $t$-point just below have the 263 249 same $k$ index, in opposition to what is done in the horizontal plane where 264 it is the $ T$-point and the nearest velocity points in the direction of the horizontal250 it is the $t$-point and the nearest velocity points in the direction of the horizontal 265 251 axis that have the same $i$ or $j$ index (compare the dashed area in 266 252 Fig.\ref{Fig_index_hor} and \ref{Fig_index_vert}). Since the scale factors are … … 309 295 \S\ref{LBC_mpp}). 310 296 297 298 $\ $\newline % force a new ligne 299 311 300 % ================================================================ 312 301 % Domain: Horizontal Grid (mesh) … … 341 330 factors in the horizontal plane as follows: 342 331 \begin{flalign*} 343 \lambda_ T &\equiv \text{glamt}= \lambda(i) & \varphi_T&\equiv \text{gphit} = \varphi(j)\\332 \lambda_t &\equiv \text{glamt}= \lambda(i) & \varphi_t &\equiv \text{gphit} = \varphi(j)\\ 344 333 \lambda_u &\equiv \text{glamu}= \lambda(i+1/2)& \varphi_u &\equiv \text{gphiu}= \varphi(j)\\ 345 334 \lambda_v &\equiv \text{glamv}= \lambda(i) & \varphi_v &\equiv \text{gphiv} = \varphi(j+1/2)\\ … … 347 336 \end{flalign*} 348 337 \begin{flalign*} 349 e_{1 T} &\equiv \text{e1t} = r_a |\lambda'(i) \; \cos\varphi(j) |&350 e_{2 T} &\equiv \text{e2t} = r_a |\varphi'(j)| \\338 e_{1t} &\equiv \text{e1t} = r_a |\lambda'(i) \; \cos\varphi(j) |& 339 e_{2t} &\equiv \text{e2t} = r_a |\varphi'(j)| \\ 351 340 e_{1u} &\equiv \text{e1t} = r_a |\lambda'(i+1/2) \; \cos\varphi(j) |& 352 341 e_{2u} &\equiv \text{e2t} = r_a |\varphi'(j)|\\ … … 359 348 considered and $r_a$ is the earth radius (defined in \mdl{phycst} along with 360 349 all universal constants). Note that the horizontal position of and scale factors 361 at $w$-points are exactly equal to those of $ T$-points, thus no specific arrays350 at $w$-points are exactly equal to those of $t$-points, thus no specific arrays 362 351 are defined at $w$-points. 363 352 364 353 Note that the definition of the scale factors ($i.e.$ as the analytical first derivative 365 354 of the transformation that gives $(\lambda,\varphi,z)$ as a function of $(i,j,k)$) is 366 specific to the \NEMO model \citep{Marti 1992}. As an example, $e_{1T}$ is defined367 locally at a $ T$-point, whereas many other models on a C grid choose to define355 specific to the \NEMO model \citep{Marti_al_JGR92}. As an example, $e_{1t}$ is defined 356 locally at a $t$-point, whereas many other models on a C grid choose to define 368 357 such a scale factor as the distance between the $U$-points on each side of the 369 $ T$-point. Relying on an analytical transformation has two advantages: firstly, there358 $t$-point. Relying on an analytical transformation has two advantages: firstly, there 370 359 is no ambiguity in the scale factors appearing in the discrete equations, since they 371 360 are first introduced in the continuous equations; secondly, analytical transformations … … 380 369 in the vertical, and (b) analytically derived grid-point position and scale factors. For 381 370 both grids here, the same $w$-point depth has been chosen but in (a) the 382 $ T$-points are set half way between $w$-points while in (b) they are defined from371 $t$-points are set half way between $w$-points while in (b) they are defined from 383 372 an analytical function: $z(k)=5\,(i-1/2)^3 - 45\,(i-1/2)^2 + 140\,(i-1/2) - 150$. 384 373 Note the resulting difference between the value of the grid-size $\Delta_k$ and … … 397 386 \begin{description} 398 387 \item[\jp{jphgr\_mesh}=0] The most general curvilinear orthogonal grids. 399 The coordinates and their first derivatives with respect to $i$ and $j$ are 400 provided in a file, read in \rou{hgr\_read} subroutine of the domhgr module.388 The coordinates and their first derivatives with respect to $i$ and $j$ are provided 389 in a input file (\ifile{coordinates}), read in \rou{hgr\_read} subroutine of the domhgr module. 401 390 \item[\jp{jphgr\_mesh}=1 to 5] A few simple analytical grids are provided (see below). 402 391 For other analytical grids, the \mdl{domhgr} module must be modified by the user. … … 422 411 and \pp{ppgphi0}). Note that for the Mercator grid the user need only provide 423 412 an approximate starting latitude: the real latitude will be recalculated analytically, 424 in order to ensure that the equator corresponds to line passing through $ T$-413 in order to ensure that the equator corresponds to line passing through $t$- 425 414 and $u$-points. 426 415 … … 431 420 and given by the parameters \pp{ppe1\_m} and \pp{ppe2\_m} respectively. 432 421 The zonal grid coordinate (\textit{glam} arrays) is in kilometers, starting at zero 433 with the first $ T$-point. The meridional coordinate (gphi. arrays) is in kilometers,434 and the second $ T$-point corresponds to coordinate $gphit=0$. The input422 with the first $t$-point. The meridional coordinate (gphi. arrays) is in kilometers, 423 and the second $t$-point corresponds to coordinate $gphit=0$. The input 435 424 parameter \pp{ppglam0} is ignored. \pp{ppgphi0} is used to set the reference 436 425 latitude for computation of the Coriolis parameter. In the case of the beta plane, … … 447 436 % Grid files 448 437 % ------------------------------------------------------------------------------------------------------------- 449 \subsection{ Grid files}438 \subsection{Output Grid files} 450 439 \label{DOM_hgr_files} 451 440 452 441 All the arrays relating to a particular ocean model configuration (grid-point 453 position, scale factors, masks) can be saved in files if $\np{n msh} \not= 0$442 position, scale factors, masks) can be saved in files if $\np{nn\_msh} \not= 0$ 454 443 (namelist parameter). This can be particularly useful for plots and off-line 455 444 diagnostics. In some cases, the user may choose to make a local modification … … 458 447 happens to be too wide due to insufficient model resolution). An example 459 448 is Gibraltar Strait in the ORCA2 configuration. When such modifications are done, 460 the output grid written when $\np{nmsh} \not=0$ is no more equal to the input grid. 449 the output grid written when $\np{nn\_msh} \not=0$ is no more equal to the input grid. 450 451 $\ $\newline % force a new ligne 461 452 462 453 % ================================================================ … … 467 458 \label{DOM_zgr} 468 459 %-----------------------------------------nam_zgr & namdom------------------------------------------- 469 \namdisplay{nam _zgr}460 \namdisplay{namzgr} 470 461 \namdisplay{namdom} 471 462 %------------------------------------------------------------------------------------------------------------- … … 510 501 Contrary to the horizontal grid, the vertical grid is computed in the code and no 511 502 provision is made for reading it from a file. The only input file is the bathymetry 512 (in meters)\footnote{N.B. in full step $z$-coordinate, a \textit{bathy\_level} file can 513 replace the \textit{bathy\_meter} file, so that the computation of the number of 514 wet ocean point in each water column is by-passed}. After reading the bathymetry, 515 the algorithm for vertical grid definition differs between the different options: 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 506 in each water column is by-passed}. 507 After reading the bathymetry, the algorithm for vertical grid definition differs 508 between the different options: 516 509 \begin{description} 517 510 \item[\textit{zco}] set a reference coordinate transformation $z_0 (k)$, and set $z(i,j,k,t)=z_0 (k)$. … … 535 528 C-Pre-Processor (CPP) key. To improve the code readability while providing this 536 529 flexibility, the vertical coordinate and scale factors are defined as functions of 537 $(i,j,k)$ with "fs" as prefix (examples: \textit{fsdept ht, fse3t,} etc) that can be either530 $(i,j,k)$ with "fs" as prefix (examples: \textit{fsdept, fse3t,} etc) that can be either 538 531 three-dimensional arrays, or a one dimensional array when \key{zco} is defined. 539 532 These functions are defined in the file \hf{domzgr\_substitute} of the DOM directory. … … 548 541 549 542 Three options are possible for defining the bathymetry, according to the 550 namelist variable \np{n topo}:543 namelist variable \np{nn\_bathy}: 551 544 \begin{description} 552 \item[\np{n topo} = 0] a flat-bottom domain is defined. The total depth $z_w (jpk)$545 \item[\np{nn\_bathy} = 0] a flat-bottom domain is defined. The total depth $z_w (jpk)$ 553 546 is given by the coordinate transformation. The domain can either be a closed 554 547 basin or a periodic channel depending on the parameter \jp{jperio}. 555 \item[\np{n topo} = -1] a domain with a bump of topography one third of the548 \item[\np{nn\_bathy} = -1] a domain with a bump of topography one third of the 556 549 domain width at the central latitude. This is meant for the "EEL-R5" configuration, 557 550 a periodic or open boundary channel with a seamount. 558 \item[\np{n topo} = 1] read a bathymetry. The bathymetryfile (Netcdf format)551 \item[\np{nn\_bathy} = 1] read a bathymetry. The \ifile{bathy\_meter} file (Netcdf format) 559 552 provides the ocean depth (positive, in meters) at each grid point of the model grid. 560 553 The bathymetry is usually built by interpolating a standard bathymetry product … … 563 556 (all levels are masked). 564 557 \end{description} 565 566 When using the rigid lid approximation (\key{dynspg\_rl} is defined) isolated land567 masses (islands) must be identified by negative integers in the input bathymetry file568 (see \S\ref{MISC_solisl}).569 558 570 559 When a global ocean is coupled to an atmospheric model it is better to represent … … 593 582 594 583 The reference coordinate transformation $z_0 (k)$ defines the arrays $gdept_0$ 595 and $gdepw_0$ for $ T$- and $w$-points, respectively. As indicated on584 and $gdepw_0$ for $t$- and $w$-points, respectively. As indicated on 596 585 Fig.\ref{Fig_index_vert} \jp{jpk} is the number of $w$-levels. $gdepw_0(1)$ is the 597 ocean surface. There are at most \jp{jpk}-1 $ T$-points inside the ocean, the598 additional $ T$-point at $jk=jpk$ is below the sea floor and is not used.599 The vertical location of $w$- and $ T$-levels is defined from the analytic expression586 ocean surface. There are at most \jp{jpk}-1 $t$-points inside the ocean, the 587 additional $t$-point at $jk=jpk$ is below the sea floor and is not used. 588 The vertical location of $w$- and $t$-levels is defined from the analytic expression 600 589 of the depth $z_0(k)$ whose analytical derivative with respect to $k$ provides the 601 590 vertical scale factors. The user must provide the analytical expression of both … … 663 652 \begin{center} \begin{tabular}{c||r|r|r|r} 664 653 \hline 665 \textbf{LEVEL}& \textbf{ GDEPT}& \textbf{GDEPW}& \textbf{E3T }& \textbf{E3W} \\ \hline654 \textbf{LEVEL}& \textbf{gdept}& \textbf{gdepw}& \textbf{e3t }& \textbf{e3w } \\ \hline 666 655 1 & \textbf{ 5.00} & 0.00 & \textbf{ 10.00} & 10.00 \\ \hline 667 656 2 & \textbf{15.00} & 10.00 & \textbf{ 10.00} & 10.00 \\ \hline … … 728 717 Two variables in the namdom namelist are used to define the partial step 729 718 vertical grid. The mimimum water thickness (in meters) allowed for a cell 730 partially filled with bathymetry at level jk is the minimum of \np{ e3zpsmin}731 (thickness in meters, usually $20~m$) or $e_{3t}(jk)*\np{ e3zps\_rat}$ (a fraction,719 partially filled with bathymetry at level jk is the minimum of \np{rn\_e3zps\_min} 720 (thickness in meters, usually $20~m$) or $e_{3t}(jk)*\np{rn\_e3zps\_rat}$ (a fraction, 732 721 usually 10\%, of the default thickness $e_{3t}(jk)$). 733 722 … … 738 727 % ------------------------------------------------------------------------------------------------------------- 739 728 \subsection [$s$-coordinate (\np{ln\_sco})] 740 729 {$s$-coordinate (\np{ln\_sco}=true)} 741 730 \label{DOM_sco} 742 731 %------------------------------------------nam_zgr_sco--------------------------------------------------- 743 \namdisplay{nam _zgr_sco}732 \namdisplay{namzgr_sco} 744 733 %-------------------------------------------------------------------------------------------------------------- 745 734 In $s$-coordinate (\key{sco} is defined), the depth and thickness of the model … … 752 741 \end{split} 753 742 \end{equation} 754 where $h$ is the depth of the last $w$-level ($z_0(k)$) defined at the $ T$-point743 where $h$ is the depth of the last $w$-level ($z_0(k)$) defined at the $t$-point 755 744 location in the horizontal and $z_0(k)$ is a function which varies from $0$ at the sea 756 745 surface to $1$ at the ocean bottom. The depth field $h$ is not necessary the ocean 757 746 depth, since a mixed step-like and bottom-following representation of the 758 747 topography can be used (Fig.~\ref{Fig_z_zps_s_sps}d-e). In the example provided 759 (\ hf{zgr\_s} file) $h$ is a smooth envelope bathymetry and steps are used to represent760 sharp bathymetric gradients.761 762 A new flexible stretching function, modified from \citet{Song 1994} is provided as an example:748 (\rou{zgr\_sco} routine, see \mdl{domzgr}) $h$ is a smooth envelope bathymetry 749 and steps are used to represent sharp bathymetric gradients. 750 751 A new flexible stretching function, modified from \citet{Song_Haidvogel_JCP94} is provided as an example: 763 752 \begin{equation} \label{DOM_sco_function} 764 753 \begin{split} … … 801 790 Whatever the vertical coordinate used, the model offers the possibility of 802 791 representing the bottom topography with steps that follow the face of the 803 model cells (step like topography) \citep{Madec 1996}. The distribution of792 model cells (step like topography) \citep{Madec_al_JPO96}. The distribution of 804 793 the steps in the horizontal is defined in a 2D integer array, mbathy, which 805 794 gives the number of ocean levels ($i.e.$ those that are not masked) at each 806 $T$-point. mbathy is computed from the meter bathymetry using the definiton of 807 gdept as the number of $T$-points which gdept $\leq$ bathy. Note that in version 808 NEMO v2.3, the user still has to provide the "level" bathymetry in a NetCDF 809 file when using the full step option (\np{ln\_zco}), rather than the bathymetry 810 in meters: both will be allowed in future versions. 795 $t$-point. mbathy is computed from the meter bathymetry using the definiton of 796 gdept as the number of $t$-points which gdept $\leq$ bathy. 811 797 812 798 Modifications of the model bathymetry are performed in the \textit{bat\_ctl} 813 799 routine (see \mdl{domzgr} module) after mbathy is computed. Isolated grid points 814 800 that do not communicate with another ocean point at the same level are eliminated. 815 816 In the case of the rigid-lid approximation when islands occur in the computational817 domain (\np{ln\_dynspg\_rl}=.true. and \key{island} is defined), the \textit{mbathy}818 array must be provided and takes values from $-N$ to \jp{jpk}-1. It provides the819 following information: $mbathy(i,j) = -n, \ n \in \left] 0,N \right]$, $T$-points are820 land points on the $n^{th}$ island ; $mbathy(i,j) =0$, $T$-points are land points821 on the main land (continent) ; $mbathy(i,j) =k$, the first $k$ $T$- and $w$-points822 are ocean points, the others are points below the ocean floor.823 824 This is used to compute the island barotropic stream function used in the rigid lid825 computation (see \S\ref{MISC_solisl}).826 801 827 802 From the \textit{mbathy} array, the mask fields are defined as follows: … … 848 823 \gmcomment{ \colorbox{yellow}{Add one word on tricky trick !} mbathy in further modified in zdfbfr{\ldots}. } 849 824 %%% 850 851 % ================================================================852 % Time Discretisation853 % ================================================================854 \section{Time Discretisation}855 \label{DOM_nxt}856 857 The time stepping used in \NEMO is a three level scheme that can be858 represented as follows:859 \begin{equation} \label{Eq_DOM_nxt}860 x^{t+\Delta t} = x^{t-\Delta t} + 2 \, \Delta t \ \text{RHS}_x^{t-\Delta t,t,t+\Delta t}861 \end{equation}862 where $x$ stands for $u$, $v$, $T$ or $S$; RHS is the Right-Hand-Side of the863 corresponding time evolution equation; $\Delta t$ is the time step; and the864 superscripts indicate the time at which a quantity is evaluated. Each term of the865 RHS is evaluated at a specific time step(s) depending on the physics with which866 it is associated.867 868 The choice of the time step used for this evaluation is discussed below as869 well as the implications in terms of starting or restarting a model870 simulation. Note that the time stepping is generally performed in a one step871 operation. With such a complex and nonlinear system of equations it would be872 dangerous to let a prognostic variable evolve in time for each term separately.873 874 The three level scheme requires three arrays for each prognostic variables.875 For each variable $x$ there is $x_b$ (before) and $x_n$ (now). The third array,876 although referred to as $x_a$ (after) in the code, is usually not the variable at877 the next time step; but rather it is used to store the time derivative (RHS in878 \eqref{Eq_DOM_nxt}) prior to time-stepping the equation. Generally, the time879 stepping is performed once at each time step in \mdl{tranxt} and \mdl{dynnxt}880 modules, except for implicit vertical diffusion or sea surface height when881 time-splitting options are used.882 883 % -------------------------------------------------------------------------------------------------------------884 % Non-Diffusive Part---Leapfrog Scheme885 % -------------------------------------------------------------------------------------------------------------886 \subsection{Non-Diffusive Part --- Leapfrog Scheme}887 \label{DOM_nxt_leap_frog}888 889 The time stepping used for non-diffusive processes is the well-known890 leapfrog scheme. It is a time centred scheme, i.e. the RHS is evaluated at891 time step $t$, the now time step. It is only used for non-diffusive terms,892 that is momentum and tracer advection, pressure gradient, and Coriolis893 terms. This scheme is widely used for advective processes in low-viscosity894 fluids. It is an efficient method that achieves second-order accuracy with895 just one right hand side evaluation per time step. Moreover, it does not896 artificially damp linear oscillatory motion nor does it produce instability897 by amplifying the oscillations. These advantages are somewhat diminished by898 the large phase-speed error of the leapfrog scheme, and the unsuitability of899 leapfrog differencing for the representation of diffusive and Rayleigh900 damping processes. However, the most serious problem associated with the901 leapfrog scheme is a high-frequency computational noise called902 "time-splitting" \citep{Haltiner1980} that develops when the method903 is used to model non linear fluid dynamics: the even and odd time steps tend904 to diverge into a physical and a computational mode. Time splitting can905 be controlled through the use of an Asselin time filter (first designed by906 \citep{Robert1966} and more comprehensively studied by \citet{Asselin1972}),907 or by periodically reinitialising the leapfrog solution through a single908 integration step with a two-level scheme. In \NEMO we follow the first909 strategy:910 \begin{equation} \label{Eq_DOM_nxt_asselin}911 x_F^t = x^t + \gamma \, \left[ x_f^{t-\Delta t} - 2 x^t + x^{t+\Delta t} \right]912 \end{equation}913 where the subscript $f$ denotes filtered values and $\gamma$ is the Asselin914 coefficient. $\gamma$ is initialized as \np{atfp} (namelist parameter).915 Its default value is \np{atfp}=0.1. This default value causes a significant dissipation916 of high frequency motions. Recommended values in idealized studies of shallow917 water turbulence are two orders of magnitude smaller (\citep{Farge1987}).918 Both strategies do, nevertheless, degrade the accuracy of the calculation from919 second to first order. The leapfrog scheme combined with a Robert-Asselin920 time filter has been preferred to other time differencing schemes such as921 predictor corrector or trapezoidal schemes, because the user has an explicit922 and simple control of the magnitude of the time diffusion of the scheme.923 In association with the 2nd order centred space discretisation of the924 advective terms in the momentum and tracer equations, it avoids implicit925 numerical diffusion in both the time and space discretisations of the926 advective term: they are both set explicitly by the user through the Robert-Asselin927 filter parameter and the viscous and diffusive coefficients.928 929 \gmcomment{930 %gm - reflexion about leapfrog: ongoing work with Matthieu Leclair931 % to be updated latter with addition of new time stepping strategy932 \colorbox{yellow}{Note}:933 The Robert-Asselin time filter slightly departs from a simple second order time934 diffusive operator computed with a forward time stepping due to the presence of935 $x_f^{t-\Delta t}$ in the right hand side of \ref{Eq_DOM_nxt_asselin}. The original936 willing of Robert1966 and Asselin1972 was to design a time filter that allow much937 larger parameter than 0.5. is due to computer saving consideration. In the original938 asselin filter, $x^{t-\Delta t}$ is used instead:939 \begin{equation} \label{Eq_DOM_nxt_asselin_true}940 x_f^t = x^t + \gamma \, \left[ x^{t-\Delta t} - 2 x^t + x^{t+\Delta t} \right]941 \end{equation}942 Applying a "true" Asselin time filter is nothing more than adding a harmonic943 diffusive operator in time. Indeed, equations \ref{Eq_DOM_nxt} and944 \ref{Eq_DOM_nxt_asselin_true} can be rewritten together as:945 \begin{equation} \label{Eq_DOM_nxt2}946 \begin{split}947 \frac{ x^{t+\Delta t} - x^{t-\Delta t} } { 2 \,\Delta t }948 &= \text{RHS}_x^{t-\Delta t,t,t+\Delta t} + \frac{ x_f^t - x^t }{2 \,\Delta t} \\949 &= \text{RHS}_x^{t-\Delta t,t,t+\Delta t}950 + \gamma\ \frac{ \, \left[ x^{t-\Delta t} - 2 x^t + x^{t+\Delta t} \right] }{2 \,\Delta t} \\951 &= \text{RHS}_x^{t-\Delta t,t,t+\Delta t}952 + 2 \Delta t \ \gamma \ \frac{1}{{2 \Delta t}^2}953 \,\delta_{t-1}\,\left[ \delta_{t+1/2}\left[ x^t \right] \right]954 \end{split}955 \end{equation}956 expressing this again in a continuous form, one finds that the Asselin filter leads to :957 \begin{equation} \label{Eq_DOM_nxt3}958 \frac{ \partial x} { \partial t } = \text{RHS} + 2 \,\Delta t \ \gamma \ \frac{ {\partial}^2 x}{ \partial t ^2 }959 \end{equation}960 961 Equations \ref{Eq_DOM_nxt2} and \ref{Eq_DOM_nxt3} suggest several remarks.962 First the Asselin filter is definitively a second order time diffusive operator which is963 evaluated at centered time step. The magnitude of this diffusion is proportional to964 the time step (with $\gamma$ usually taken between $10^{-1}$ to $10^{-3}$).965 Second, this term has to be taken into account in all budgets of the equations966 (mass, heat content, salt content, kinetic energy...). Nevertheless,we stress here967 that it is small and does not create systematic biases. Indeed let us evaluate how968 it contributes to the time evolution of $x$ between $t_o$ and $t_1$:969 \begin{equation} \label{Eq_DOM_nxt4}970 \begin{split}971 t_1-t_o &= \int_{t_o}^{t_1} \frac{ \partial x} { \partial t } dt \\972 &= \int_{t_o}^{t_1} \text{RHS} dt + 2 \,\Delta t \ \gamma \left(973 \left. \frac{ \partial x}{ \partial t } \right|_1974 - \left. \frac{ \partial x}{ \partial t } \right|_o \right)975 \end{split}976 \end{equation}977 }978 979 Alternative time stepping schemes are currently under investigation.980 981 % -------------------------------------------------------------------------------------------------------------982 % Diffusive Part---Forward or Backward Scheme983 % -------------------------------------------------------------------------------------------------------------984 \subsection{Diffusive Part --- Forward or Backward Scheme}985 \label{DOM_nxt_forward_imp}986 987 The leapfrog differencing scheme is unsuitable for the representation of988 diffusive and damping processes. For a tendancy $D_x$, representing a989 diffusive term or a restoring term to a tracer climatology990 (when present, see \S~\ref{TRA_dmp}), a forward time differencing scheme991 is used :992 \begin{equation} \label{Eq_DOM_nxt_euler}993 x^{t+\Delta t} = x^{t-\Delta t} + 2 \, \Delta t \ {D_x}^{t-\Delta t}994 \end{equation}995 996 This is diffusive in time and conditionally stable. For example, the997 conditions for stability of second and fourth order horizontal diffusion schemes are \citep{Griffies2004}:998 \begin{equation} \label{Eq_DOM_nxt_euler_stability}999 A^h < \left\{1000 \begin{aligned}1001 &\frac{e^2}{ 8 \; \Delta t } &&\quad \text{laplacian diffusion} \\1002 &\frac{e^4}{64 \; \Delta t } &&\quad \text{bilaplacian diffusion}1003 \end{aligned}1004 \right.1005 \end{equation}1006 where $e$ is the smallest grid size in the two horizontal directions and $A^h$ is1007 the mixing coefficient. The linear constraint \eqref{Eq_DOM_nxt_euler_stability}1008 is a necessary condition, but not sufficient. If it is not satisfied, even mildly,1009 then the model soon becomes wildly unstable. The instability can be removed1010 by either reducing the length of the time steps or reducing the mixing coefficient.1011 1012 For the vertical diffusion terms, a forward time differencing scheme can be1013 used, but usually the numerical stability condition implies a strong1014 constraint on the time step. Two solutions are available in \NEMO to overcome1015 the stability constraint: $(a)$ a forward time differencing scheme using a1016 time splitting technique (\np{ln\_zdfexp}=.true.) or $(b)$ a backward (or implicit)1017 time differencing scheme by \np{ln\_zdfexp}=.false.). In $(a)$, the master1018 time step $\Delta $t is cut into $N$ fractional time steps so that the1019 stability criterion is reduced by a factor of $N$. The computation is done as1020 follows:1021 \begin{equation} \label{Eq_DOM_nxt_ts}1022 \begin{split}1023 & u_\ast ^{t-\Delta t} = u^{t-\Delta t} \\1024 & u_\ast ^{t-\Delta t+L\frac{2\Delta t}{N}}=u_\ast ^{t-\Delta t+\left( {L-1}1025 \right)\frac{2\Delta t}{N}}+\frac{2\Delta t}{N}\;\text{DF}^{t-\Delta t+\left( {L-1} \right)\frac{2\Delta t}{N}}1026 \quad \text{for $L=1$ to $N$} \\1027 & u^{t+\Delta t} = u_\ast^{t+\Delta t}1028 \end{split}1029 \end{equation}1030 with DF a vertical diffusion term. The number of fractional time steps, $N$, is given1031 by setting \np{n\_zdfexp}, (namelist parameter). The scheme $(b)$ is unconditionally1032 stable but diffusive. It can be written as follows:1033 \begin{equation} \label{Eq_DOM_nxt_imp}1034 x^{t+\Delta t} = x^{t-\Delta t} + 2 \, \Delta t \ \text{RHS}_x^{t+\Delta t}1035 \end{equation}1036 1037 This scheme is rather time consuming since it requires a matrix inversion,1038 but it becomes attractive since a splitting factor of 3 or more is needed1039 for the forward time differencing scheme. For example, the finite difference1040 approximation of the temperature equation is:1041 \begin{equation} \label{Eq_DOM_nxt_imp_zdf}1042 \frac{T(k)^{t+1}-T(k)^{t-1}}{2\;\Delta t}\equiv \text{RHS}+\frac{1}{e_{3T} }\delta1043 _k \left[ {\frac{A_w^{vT} }{e_{3w} }\delta _{k+1/2} \left[ {T^{t+1}} \right]}1044 \right]1045 \end{equation}1046 where RHS is the right hand side of the equation except for the vertical diffusion term.1047 We rewrite \eqref{Eq_DOM_nxt_imp} as:1048 \begin{equation} \label{Eq_DOM_nxt_imp_mat}1049 -c(k+1)\;u^{t+1}(k+1)+d(k)\;u^{t+1}(k)-\;c(k)\;u^{t+1}(k-1) \equiv b(k)1050 \end{equation}1051 where1052 \begin{align*}1053 c(k) &= A_w^{vm} (k) \, / \, e_{3uw} (k) \\1054 d(k) &= e_{3u} (k) \, / \, (2\Delta t) + c_k + c_{k+1} \\1055 b(k) &= e_{3u} (k) \; \left( u^{t-1}(k) \, / \, (2\Delta t) + \text{RHS} \right)1056 \end{align*}1057 1058 \eqref{Eq_DOM_nxt_imp_mat} is a linear system of equations which associated1059 matrix is tridiagonal. Moreover, $c(k)$ and $d(k)$ are positive and the diagonal1060 term is greater than the sum of the two extra-diagonal terms, therefore a special1061 adaptation of the Gauss elimination procedure is used to find the solution1062 (see for example \citet{Richtmyer1967}).1063 1064 % -------------------------------------------------------------------------------------------------------------1065 % Start/Restart strategy1066 % -------------------------------------------------------------------------------------------------------------1067 \subsection{Start/Restart strategy}1068 \label{DOM_nxt_rst}1069 %--------------------------------------------namrun-------------------------------------------1070 \namdisplay{namrun}1071 %--------------------------------------------------------------------------------------------------------------1072 1073 The first time step of this three level scheme when starting from initial conditions1074 is a forward step (Euler time integration):1075 \begin{equation} \label{Eq_DOM_euler}1076 x^1 = x^0 + \Delta t \ \text{RHS}^01077 \end{equation}1078 1079 It is also possible to restart from a previous computation, by using a1080 restart file. The restart strategy is designed to ensure perfect1081 restartability of the code: the user should obtain the same results to1082 machine precision either by running the model for $2N$ time steps in one go,1083 or by performing two consecutive experiments of $N$ steps with a restart.1084 This requires saving two time levels and many auxiliary data in the restart1085 files in machine precision.1086 1087 Note that when a semi-implicit scheme is used to evaluate the hydrostatic pressure1088 gradient (see \S\ref{DYN_hpg_imp}), an extra three-dimensional field has to be1089 added in the restart file to ensure an exact restartability. This is done only optionally1090 via the namelist parameter \np{nn\_dynhpg\_rst}, so that a reduction of the size of1091 restart file can be obtained when the restartability is not a key issue (operational1092 oceanography or ensemble simulation for seasonal forcast).1093 %%%1094 \gmcomment{add here how to force the restart to contain only one time step for operational purposes}1095 %%%1096 1097 \gmcomment{ % add a subsection here1098 1099 %-------------------------------------------------------------------------------------------------------------1100 % Time Domain1101 % -------------------------------------------------------------------------------------------------------------1102 \subsection{Time domain}1103 \label{DOM_nxt_time}1104 1105 \colorbox{yellow}{add here a few word on nit000 and nitend}1106 1107 \colorbox{yellow}{Write documentation on the calendar and the key variable adatrj}1108 1109 } %% end add1110
Note: See TracChangeset
for help on using the changeset viewer.