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

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 9393 for branches/2017/dev_merge_2017/DOC/tex_sub/chap_DOM.tex – NEMO

Ignore:
Timestamp:
2018-03-13T15:00:56+01:00 (6 years ago)
Author:
nicolasmartin
Message:

Cleaning of section headings, reinstating the index by mixing \np and \forcode macros, continued conversion of source code inclusions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_merge_2017/DOC/tex_sub/chap_DOM.tex

    r9392 r9393  
    44% Chapter 2 ——— Space and Time Domain (DOM) 
    55% ================================================================ 
    6 \chapter{Space Domain (DOM) } 
     6\chapter{Space Domain (DOM)} 
    77\label{DOM} 
    88\minitoc 
     
    3131% Fundamentals of the Discretisation 
    3232% ================================================================ 
    33 \section{Fundamentals of the Discretisation} 
     33\section{Fundamentals of the discretisation} 
    3434\label{DOM_basics} 
    3535 
     
    3737%        Arrangement of Variables  
    3838% ------------------------------------------------------------------------------------------------------------- 
    39 \subsection{Arrangement of Variables} 
     39\subsection{Arrangement of variables} 
    4040\label{DOM_cell} 
    4141 
     
    107107%        Vector Invariant Formulation  
    108108% ------------------------------------------------------------------------------------------------------------- 
    109 \subsection{Discrete Operators} 
     109\subsection{Discrete operators} 
    110110\label{DOM_operators} 
    111111 
     
    198198%        Numerical Indexing  
    199199% ------------------------------------------------------------------------------------------------------------- 
    200 \subsection{Numerical Indexing} 
     200\subsection{Numerical indexing} 
    201201\label{DOM_Num_Index} 
    202202 
     
    221221%        Horizontal Indexing  
    222222% ----------------------------------- 
    223 \subsubsection{Horizontal Indexing} 
     223\subsubsection{Horizontal indexing} 
    224224\label{DOM_Num_Index_hor} 
    225225 
     
    232232%        Vertical indexing  
    233233% ----------------------------------- 
    234 \subsubsection{Vertical Indexing} 
     234\subsubsection{Vertical indexing} 
    235235\label{DOM_Num_Index_vertical} 
    236236 
     
    264264%        Domain Size 
    265265% ----------------------------------- 
    266 \subsubsection{Domain Size} 
     266\subsubsection{Domain size} 
    267267\label{DOM_size} 
    268268 
     
    281281% Domain: List of fields needed 
    282282% ================================================================ 
    283 \section  [Domain: Needed fields] 
    284       {Domain: Needed fields} 
     283\section{Needed fields} 
    285284\label{DOM_fields} 
    286285The ocean mesh ($i.e.$ the position of all the scalar and vector points) is defined  
     
    309308ie1e2u\_v is a flag to flag set u and  v surfaces are neither read nor computed.\\ 
    310309  
    311 These fields can be read in an domain input file which name is setted in \np{cn_domcfg} parameter specified in \ngn{namcfg}. 
     310These fields can be read in an domain input file which name is setted in \np{cn\_domcfg} parameter specified in \ngn{namcfg}. 
    312311\forfile{../namelists/namcfg} 
    313312or they can be defined in an analytical way in MY\_SRC directory of the configuration. 
     
    323322% Domain: Horizontal Grid (mesh)  
    324323% ================================================================ 
    325 \section  [Domain: Horizontal Grid (mesh) (\textit{domhgr})]                
    326       {Domain: Horizontal Grid (mesh) \small{(\protect\mdl{domhgr} module)} } 
     324\section{Horizontal grid mesh (\protect\mdl{domhgr})} 
    327325\label{DOM_hgr} 
    328326 
     
    409407%        Grid files 
    410408% ------------------------------------------------------------------------------------------------------------- 
    411 \subsection{Output Grid files} 
     409\subsection{Output grid files} 
    412410\label{DOM_hgr_files} 
    413411 
    414412All the arrays relating to a particular ocean model configuration (grid-point  
    415 position, scale factors, masks) can be saved in files if $nn\_msh \not= 0$  
     413position, scale factors, masks) can be saved in files if \np{nn\_msh} $\not= 0$  
    416414(namelist variable in \ngn{namdom}). This can be particularly useful for plots and off-line  
    417415diagnostics. In some cases, the user may choose to make a local modification  
     
    420418happens to be too wide due to insufficient model resolution). An example  
    421419is Gibraltar Strait in the ORCA2 configuration. When such modifications are done,  
    422 the output grid written when $nn\_msh \not= 0$ is no more equal to the input grid. 
     420the output grid written when \np{nn\_msh} $\not= 0$ is no more equal to the input grid. 
    423421 
    424422$\ $\newline    % force a new line 
     
    427425% Domain: Vertical Grid (domzgr) 
    428426% ================================================================ 
    429 \section  [Domain: Vertical Grid (\textit{domzgr})] 
    430       {Domain: Vertical Grid \small{(\protect\mdl{domzgr} module)} } 
     427\section{Vertical grid (\protect\mdl{domzgr})} 
    431428\label{DOM_zgr} 
    432429%-----------------------------------------nam_zgr & namdom------------------------------------------- 
     
    454451(d) hybrid $s-z$ coordinate,  
    455452(e) hybrid $s-z$ coordinate with partial step, and  
    456 (f) same as (e) but in the non-linear free surface (\protect\forcode{ln_linssh = .false.}).  
     453(f) same as (e) but in the non-linear free surface (\np{ln\_linssh}\forcode{ = .false.}).  
    457454Note that the non-linear free surface can be used with any of the  
    4584555 coordinates (a) to (e).} 
     
    464461option which can be enabled or disabled in the middle of an experiment. Three main  
    465462choices are offered (Fig.~\ref{Fig_z_zps_s_sps}a to c): $z$-coordinate with full step  
    466 bathymetry (\np{ln_zco}~=~true), $z$-coordinate with partial step bathymetry  
    467 (\np{ln_zps}~=~true), or generalized, $s$-coordinate (\np{ln_sco}~=~true).  
     463bathymetry (\np{ln\_zco}\forcode{ = .true.}), $z$-coordinate with partial step bathymetry  
     464(\np{ln\_zps}\forcode{ = .true.}), or generalized, $s$-coordinate (\np{ln\_sco}\forcode{ = .true.}).  
    468465Hybridation of the three main coordinates are available: $s-z$ or $s-zps$ coordinate  
    469466(Fig.~\ref{Fig_z_zps_s_sps}d and \ref{Fig_z_zps_s_sps}e). By default a non-linear free surface is used: 
    470467the coordinate follow the time-variation of the free surface so that the transformation is time dependent:  
    471 $z(i,j,k,t)$ (Fig.~\ref{Fig_z_zps_s_sps}f). When a linear free surface is assumed (\forcode{ln_linssh = .true.}),  
     468$z(i,j,k,t)$ (Fig.~\ref{Fig_z_zps_s_sps}f). When a linear free surface is assumed (\np{ln\_linssh}\forcode{ = .true.}),  
    472469the vertical coordinate are fixed in time, but the seawater can move up and down across the z=0 surface  
    473470(in other words, the top of the ocean in not a rigid-lid).  
    474471The last choice in terms of vertical coordinate concerns the presence (or not) in the model domain  
    475 of ocean cavities beneath ice shelves. Setting \np{ln_isfcav} to true allows to manage ocean cavities,  
     472of ocean cavities beneath ice shelves. Setting \np{ln\_isfcav} to true allows to manage ocean cavities,  
    476473otherwise they are filled in. This option is currently only available in $z$- or $zps$-coordinate, 
    477474and partial step are also applied at the ocean/ice shelf interface.  
     
    483480\ifile{bathy\_meter} file, so that the computation of the number of wet ocean point  
    484481in each water column is by-passed}.  
    485 If \np{ln_isfcav}~=~true, an extra file input file describing the ice shelf draft  
     482If \np{ln\_isfcav}\forcode{ = .true.}, an extra file input file describing the ice shelf draft  
    486483(in meters) (\ifile{isf\_draft\_meter}) is needed. 
    487484 
     
    503500%%% 
    504501 
    505 Unless a linear free surface is used (\forcode{ln_linssh = .false.}), the arrays describing  
     502Unless a linear free surface is used (\np{ln\_linssh}\forcode{ = .false.}), the arrays describing  
    506503the grid point depths and vertical scale factors are three set of three dimensional arrays $(i,j,k)$  
    507504defined at \textit{before}, \textit{now} and \textit{after} time step. The time at which they are 
    508505defined is indicated by a suffix:$\_b$, $\_n$, or $\_a$, respectively. They are updated at each model time step 
    509506using a fixed reference coordinate system which computer names have a $\_0$ suffix.  
    510 When the linear free surface option is used (\forcode{ln_linssh = .true.}), \textit{before}, \textit{now}  
     507When the linear free surface option is used (\np{ln\_linssh}\forcode{ = .true.}), \textit{before}, \textit{now}  
    511508and \textit{after} arrays are simply set one for all to their reference counterpart.  
    512509 
     
    515512%        Meter Bathymetry 
    516513% ------------------------------------------------------------------------------------------------------------- 
    517 \subsection{Meter Bathymetry} 
     514\subsection{Meter bathymetry} 
    518515\label{DOM_bathy} 
    519516 
    520517Three options are possible for defining the bathymetry, according to the  
    521 namelist variable \np{nn_bathy} (found in \ngn{namdom} namelist):  
     518namelist variable \np{nn\_bathy} (found in \ngn{namdom} namelist):  
    522519\begin{description} 
    523 \item[\np{nn_bathy} = 0] a flat-bottom domain is defined. The total depth $z_w (jpk)$  
     520\item[\np{nn\_bathy}\forcode{ = 0}]: a flat-bottom domain is defined. The total depth $z_w (jpk)$  
    524521is given by the coordinate transformation. The domain can either be a closed  
    525522basin or a periodic channel depending on the parameter \np{jperio}.  
    526 \item[\np{nn_bathy} = -1] a domain with a bump of topography one third of the  
     523\item[\np{nn\_bathy}\forcode{ = -1}]: a domain with a bump of topography one third of the  
    527524domain width at the central latitude. This is meant for the "EEL-R5" configuration,  
    528525a periodic or open boundary channel with a seamount.  
    529 \item[\np{nn_bathy} = 1] read a bathymetry and ice shelf draft (if needed). 
     526\item[\np{nn\_bathy}\forcode{ = 1}]: read a bathymetry and ice shelf draft (if needed). 
    530527 The \ifile{bathy\_meter} file (Netcdf format) provides the ocean depth (positive, in meters) 
    531528 at each grid point of the model grid. The bathymetry is usually built by interpolating a standard bathymetry product  
     
    535532 
    536533The \ifile{isfdraft\_meter} file (Netcdf format) provides the ice shelf draft (positive, in meters) 
    537  at each grid point of the model grid. This file is only needed if \np{ln_isfcav}~=~true.  
     534 at each grid point of the model grid. This file is only needed if \np{ln\_isfcav}\forcode{ = .true.}.  
    538535Defining the ice shelf draft will also define the ice shelf edge and the grounding line position. 
    539536\end{description} 
     
    550547%        z-coordinate  and reference coordinate transformation 
    551548% ------------------------------------------------------------------------------------------------------------- 
    552 \subsection[$z$-coordinate (\protect\np{ln_zco}] 
    553         {$z$-coordinate (\protect\forcode{ln_zco = .true.}) and reference coordinate} 
     549\subsection[$Z$-coordinate (\protect\np{ln\_zco}\forcode{ = .true.}) and ref. coordinate] 
     550            {$Z$-coordinate (\protect\np{ln\_zco}\forcode{ = .true.}) and reference coordinate} 
    554551\label{DOM_zco} 
    555552 
     
    593590(Fig.~\ref{Fig_zgr}). 
    594591 
    595 If the ice shelf cavities are opened (\np{ln_isfcav}=~true~), the definition of $z_0$ is the same.  
     592If the ice shelf cavities are opened (\np{ln\_isfcav}\forcode{ = .true.}), the definition of $z_0$ is the same.  
    596593However, definition of $e_3^0$ at $t$- and $w$-points is respectively changed to: 
    597594\begin{equation} \label{DOM_zgr_ana} 
     
    629626Rather than entering parameters $h_{sur}$, $h_{0}$, and $h_{1}$ directly, it is  
    630627possible to recalculate them. In that case the user sets  
    631 \np{ppsur}=\np{ppa0}=\forcode{ppa1 = 999999}., in \ngn{namcfg} namelist,  
     628\np{ppsur}\forcode{ = }\np{ppa0}\forcode{ = }\np{ppa1}\forcode{ = 999999}., in \ngn{namcfg} namelist,  
    632629and specifies instead the four following parameters: 
    633630\begin{itemize} 
     
    640637\end{itemize} 
    641638As an example, for the $45$ layers used in the DRAKKAR configuration those  
    642 parameters are: \jp{jpk}=46, \forcode{ppacr = 9}, \forcode{ppkth = 23}.563, \forcode{ppdzmin = 6}m,  
    643 \forcode{pphmax = 5750}m. 
     639parameters are: \jp{jpk}\forcode{ = 46}, \np{ppacr}\forcode{ = 9}, \np{ppkth}\forcode{ = 23.563}, \np{ppdzmin}\forcode{ = 6}m, \np{pphmax}\forcode{ = 5750}m. 
    644640 
    645641%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    688684%        z-coordinate with partial step 
    689685% ------------------------------------------------------------------------------------------------------------- 
    690 \subsection   [$z$-coordinate with partial step (\protect\np{ln_zps})] 
    691          {$z$-coordinate with partial step (\protect\np{ln_zps}=.true.)} 
     686\subsection{$Z$-coordinate with partial step (\protect\np{ln\_zps}\forcode{ = .true.})} 
    692687\label{DOM_zps} 
    693688%--------------------------------------------namdom------------------------------------------------------- 
     
    712707Two variables in the namdom namelist are used to define the partial step  
    713708vertical grid. The mimimum water thickness (in meters) allowed for a cell  
    714 partially filled with bathymetry at level jk is the minimum of \np{rn_e3zps_min}  
    715 (thickness in meters, usually $20~m$) or $e_{3t}(jk)*rn\_e3zps\_rat$ (a fraction,  
     709partially filled with bathymetry at level jk is the minimum of \np{rn\_e3zps\_min}  
     710(thickness in meters, usually $20~m$) or $e_{3t}(jk)*$\np{rn\_e3zps\_rat} (a fraction,  
    716711usually 10\%, of the default thickness $e_{3t}(jk)$). 
    717712 
     
    721716%        s-coordinate 
    722717% ------------------------------------------------------------------------------------------------------------- 
    723 \subsection   [$s$-coordinate (\protect\np{ln_sco})] 
    724            {$s$-coordinate (\protect\forcode{ln_sco = .true.})} 
     718\subsection{$S$-coordinate (\protect\np{ln\_sco}\forcode{ = .true.})} 
    725719\label{DOM_sco} 
    726720%------------------------------------------nam_zgr_sco--------------------------------------------------- 
     
    728722%-------------------------------------------------------------------------------------------------------------- 
    729723Options are defined in \ngn{namzgr\_sco}. 
    730 In $s$-coordinate (\np{ln_sco}~=~true), the depth and thickness of the model  
     724In $s$-coordinate (\np{ln\_sco}\forcode{ = .true.}), the depth and thickness of the model  
    731725levels are defined from the product of a depth field and either a stretching  
    732726function or its derivative, respectively: 
     
    744738depth, since a mixed step-like and bottom-following representation of the  
    745739topography can be used (Fig.~\ref{Fig_z_zps_s_sps}d-e) or an envelop bathymetry can be defined (Fig.~\ref{Fig_z_zps_s_sps}f). 
    746 The namelist parameter \np{rn_rmax} determines the slope at which the terrain-following coordinate intersects  
     740The namelist parameter \np{rn\_rmax} determines the slope at which the terrain-following coordinate intersects  
    747741the sea bed and becomes a pseudo z-coordinate.  
    748 The coordinate can also be hybridised by specifying \np{rn_sbot_min} and \np{rn_sbot_max}  
     742The coordinate can also be hybridised by specifying \np{rn\_sbot\_min} and \np{rn\_sbot\_max}  
    749743as the minimum and maximum depths at which the terrain-following vertical coordinate is calculated. 
    750744 
     
    753747 
    754748The original default NEMO s-coordinate stretching is available if neither of the other options  
    755 are specified as true (\np{ln_s_SH94}~=~false and \np{ln_s_SF12}~=~false).  
     749are specified as true (\np{ln\_s\_SH94}\forcode{ = .false.} and \np{ln\_s\_SF12}\forcode{ = .false.}).  
    756750This uses a depth independent $\tanh$ function for the stretching \citep{Madec_al_JPO96}: 
    757751 
     
    779773 
    780774A stretching function, modified from the commonly used \citet{Song_Haidvogel_JCP94}  
    781 stretching (\np{ln_s_SH94}~=~true), is also available and is more commonly used for shelf seas modelling: 
     775stretching (\np{ln\_s\_SH94}\forcode{ = .true.}), is also available and is more commonly used for shelf seas modelling: 
    782776 
    783777\begin{equation} 
     
    796790%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    797791 
    798 where $H_c$ is the critical depth (\np{rn_hc}) at which the coordinate transitions from  
    799 pure $\sigma$ to the stretched coordinate,  and $\theta$ (\np{rn_theta}) and $b$ (\np{rn_bb})  
     792where $H_c$ is the critical depth (\np{rn\_hc}) at which the coordinate transitions from  
     793pure $\sigma$ to the stretched coordinate,  and $\theta$ (\np{rn\_theta}) and $b$ (\np{rn\_bb})  
    800794are the surface and bottom control parameters such that $0\leqslant \theta \leqslant 20$, and  
    801795$0\leqslant b\leqslant 1$. $b$ has been designed to allow surface and/or bottom  
    802796increase of the vertical resolution (Fig.~\ref{Fig_sco_function}). 
    803797 
    804 Another example has been provided at version 3.5 (\np{ln_s_SF12}) that allows  
     798Another example has been provided at version 3.5 (\np{ln\_s\_SF12}) that allows  
    805799a fixed surface resolution in an analytical terrain-following stretching \citet{Siddorn_Furner_OM12}.  
    806800In this case the a stretching function $\gamma$ is defined such that: 
     
    823817 
    824818This gives an analytical stretching of $\sigma$ that is solvable in $A$ and $B$ as a function of  
    825 the user prescribed stretching parameter $\alpha$ (\np{rn_alpha}) that stretches towards  
    826 the surface ($\alpha > 1.0$) or the bottom ($\alpha < 1.0$) and user prescribed surface (\np{rn_zs})  
     819the user prescribed stretching parameter $\alpha$ (\np{rn\_alpha}) that stretches towards  
     820the surface ($\alpha > 1.0$) or the bottom ($\alpha < 1.0$) and user prescribed surface (\np{rn\_zs})  
    827821and bottom depths. The bottom cell depth in this example is given as a function of water depth: 
    828822 
     
    831825\end{equation} 
    832826 
    833 where the namelist parameters \np{rn_zb_a} and \np{rn_zb_b} are $a$ and $b$ respectively. 
     827where the namelist parameters \np{rn\_zb\_a} and \np{rn\_zb\_b} are $a$ and $b$ respectively. 
    834828 
    835829%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    843837This gives a smooth analytical stretching in computational space that is constrained to given specified surface and bottom grid cell thicknesses in real space. This is not to be confused with the hybrid schemes that superimpose geopotential coordinates on terrain following coordinates thus creating a non-analytical vertical coordinate that therefore may suffer from large gradients in the vertical resolutions. This stretching is less straightforward to implement than the \citet{Song_Haidvogel_JCP94} stretching, but has the advantage of resolving diurnal processes in deep water and has generally flatter slopes. 
    844838 
    845 As with the \citet{Song_Haidvogel_JCP94} stretching the stretch is only applied at depths greater than the critical depth $h_c$. In this example two options are available in depths shallower than $h_c$, with pure sigma being applied if the \np{ln_sigcrit} is true and pure z-coordinates if it is false (the z-coordinate being equal to the depths of the stretched coordinate at $h_c$. 
     839As with the \citet{Song_Haidvogel_JCP94} stretching the stretch is only applied at depths greater than the critical depth $h_c$. In this example two options are available in depths shallower than $h_c$, with pure sigma being applied if the \np{ln\_sigcrit} is true and pure z-coordinates if it is false (the z-coordinate being equal to the depths of the stretched coordinate at $h_c$. 
    846840 
    847841Minimising the horizontal slope of the vertical coordinate is important in terrain-following systems as large slopes lead to hydrostatic consistency. A hydrostatic consistency parameter diagnostic following \citet{Haney1991} has been implemented, and is output as part of the model mesh file at the start of the run. 
     
    850844%        z*- or s*-coordinate 
    851845% ------------------------------------------------------------------------------------------------------------- 
    852 \subsection{$z^*$- or $s^*$-coordinate (\protect\forcode{ln_linssh = .false.}) } 
     846\subsection{$Z^*$- or $S^*$-coordinate (\protect\np{ln\_linssh}\forcode{ = .false.}) } 
    853847\label{DOM_zgr_star} 
    854848 
     
    860854%        level bathymetry and mask  
    861855% ------------------------------------------------------------------------------------------------------------- 
    862 \subsection{level bathymetry and mask} 
     856\subsection{Level bathymetry and mask} 
    863857\label{DOM_msk} 
    864858 
     
    881875In case of ice shelf cavities, modifications of the model bathymetry and ice shelf draft into  
    882876the cavities are performed in the \textit{zgr\_isf} routine. The compatibility between ice shelf draft and bathymetry is checked.  
    883 All the locations where the isf cavity is thinnest than \np{rn_isfhmin} meters are grounded ($i.e.$ masked).  
     877All the locations where the isf cavity is thinnest than \np{rn\_isfhmin} meters are grounded ($i.e.$ masked).  
    884878If only one cell on the water column is opened at $t$-, $u$- or $v$-points, the bathymetry or the ice shelf draft is dug to fit this constrain. 
    885879If the incompatibility is too strong (need to dig more than 1 cell), the cell is masked.\\  
     
    912906% Domain: Initial State (dtatsd & istate) 
    913907% ================================================================ 
    914 \section  [Domain: Initial State (\textit{istate and dtatsd})] 
    915       {Domain: Initial State \small{(\protect\mdl{istate} and \protect\mdl{dtatsd} modules)} } 
     908\section{Initial state (\protect\mdl{istate} and \protect\mdl{dtatsd})} 
    916909\label{DTA_tsd} 
    917910%-----------------------------------------namtsd------------------------------------------- 
     
    921914Options are defined in \ngn{namtsd}. 
    922915By default, the ocean start from rest (the velocity field is set to zero) and the initialization of  
    923 temperature and salinity fields is controlled through the \np{ln_tsd_ini} namelist parameter. 
     916temperature and salinity fields is controlled through the \np{ln\_tsd\_ini} namelist parameter. 
    924917\begin{description} 
    925 \item[ln\_tsd\_init = .true.] use a T and S input files that can be given on the model grid itself or  
     918\item[\np{ln\_tsd\_init}\forcode{ = .true.}] use a T and S input files that can be given on the model grid itself or  
    926919on their native input data grid. In the latter case, the data will be interpolated on-the-fly both in the  
    927920horizontal and the vertical to the model grid (see \S~\ref{SBC_iof}). The information relative to the  
    928 input files are given in the \np{sn_tem} and \np{sn_sal} structures.  
     921input files are given in the \np{sn\_tem} and \np{sn\_sal} structures.  
    929922The computation is done in the \mdl{dtatsd} module. 
    930 \item[ln\_tsd\_init = .false.] use constant salinity value of 35.5 psu and an analytical profile of temperature 
     923\item[\np{ln\_tsd\_init}\forcode{ = .false.}] use constant salinity value of 35.5 psu and an analytical profile of temperature 
    931924(typical of the tropical ocean), see \rou{istate\_t\_s} subroutine called from \mdl{istate} module. 
    932925\end{description} 
Note: See TracChangeset for help on using the changeset viewer.