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 11577 for NEMO/trunk/doc/latex/NEMO/subfiles/chap_DOM.tex – NEMO

Ignore:
Timestamp:
2019-09-19T19:01:38+02:00 (5 years ago)
Author:
nicolasmartin
Message:

New LaTeX commands \nam and \np to mention namelist content
(Partial commit to serve as a backup before other large edits)
In order to benefit of the syntax highlighting and to have a simpler syntax for
citing namelist block (\nam) and parameter (\np) with an optional variable assignment (\forcode{...}),
at this time the only viable solution I found is to require a double marker for
what it looks like the same item:

  1. Marker with the real name: 'tra_adv' block or 'ln_flx' parameter
  2. Marker with underscore character escaping: 'tra\_adv' block or 'ln\_flx' parameter

Despite many searches and attempts, I did not find a workaround to edit on-the-fly one or
the other marker.
In fact, the problem is on one side that the LaTeX index interprets '_' as a switch for lowering like
in math mode while on the other hand the backslash is considered for Pygments as a typo in Fortran
(red box).

For instance, \nam and \np have as of now the aforementioned 2 mandatory arguments in
the previous order (between braces) + an optional argument for \np when the parameter is defined
(between brackets at the first position):

  • \nam: LaTeX code in the \nam{tra_adv}{tra\_adv} -> PDF ' in the &namtra_adv (namelist X.X) ' with syntax highlighting, the hyperlink and the index entry
  • \np: LaTeX code \np[=.true.]{ln_flx}{ln\_flx} -> PDF ln_flux=.true. with syntax highlighting for the whole string and the entry in the 'parameters' index
File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/doc/latex/NEMO/subfiles/chap_DOM.tex

    r11571 r11577  
    335335 
    336336Two typical methods are available to specify the spatial domain configuration; 
    337 they can be selected using parameter \np{ln\_read\_cfg} parameter in namelist \nam{cfg}. 
    338  
    339 If \np{ln\_read\_cfg} is set to \forcode{.true.}, 
     337they can be selected using parameter \np{ln_read_cfg}{ln\_read\_cfg} parameter in namelist \nam{cfg}. 
     338 
     339If \np{ln_read_cfg}{ln\_read\_cfg} is set to \forcode{.true.}, 
    340340the domain-specific parameters and fields are read from a netCDF input file, 
    341 whose name (without its .nc suffix) can be specified as the value of the \np{cn\_domcfg} parameter in namelist \nam{cfg}. 
    342  
    343 If \np{ln\_read\_cfg} is set to \forcode{.false.}, 
     341whose name (without its .nc suffix) can be specified as the value of the \np{cn_domcfg}{cn\_domcfg} parameter in namelist \nam{cfg}. 
     342 
     343If \np{ln_read_cfg}{ln\_read\_cfg} is set to \forcode{.false.}, 
    344344the domain-specific parameters and fields can be provided (\eg\ analytically computed) by 
    345345subroutines \mdl{usrdef\_hgr} and \mdl{usrdef\_zgr}. 
     
    359359 
    360360The next subsections summarise the parameter and fields related to the configuration of the whole model domain. 
    361 These represent the minimum information that must be provided either via the \np{cn\_domcfg} file or set by code 
     361These represent the minimum information that must be provided either via the \np{cn_domcfg}{cn\_domcfg} file or set by code 
    362362inserted into user-supplied versions of the \texttt{usrdef\_*} subroutines. 
    363363The requirements are presented in three sections: 
     
    377377see \autoref{sec:LBC_mpp}). 
    378378 
    379 The name of the configuration is set through parameter \np{cn\_cfg}, 
    380 and the nominal resolution through parameter \np{nn\_cfg} 
     379The name of the configuration is set through parameter \np{cn_cfg}{cn\_cfg}, 
     380and the nominal resolution through parameter \np{nn_cfg}{nn\_cfg} 
    381381(unless in the input file both of variables \texttt{ORCA} and \texttt{ORCA\_index} are present, 
    382 in which case \np{cn\_cfg} and \np{nn\_cfg} are set from these values accordingly). 
     382in which case \np{cn_cfg}{cn\_cfg} and \np{nn_cfg}{nn\_cfg} are set from these values accordingly). 
    383383 
    384384The global lateral boundary condition type is selected from 8 options using parameter \jp{jperio}. 
     
    436436the unaltered surface areas at $u$ and $v$ grid points (\texttt{e1e2u} and \texttt{e1e2v}, respectively) must be read or 
    437437pre-computed in \mdl{usrdef\_hgr}. 
    438 If these arrays are present in the \np{cn\_domcfg} file they are read and the internal computation is suppressed. 
     438If these arrays are present in the \np{cn_domcfg}{cn\_domcfg} file they are read and the internal computation is suppressed. 
    439439Versions of \mdl{usrdef\_hgr} which set their own values of \texttt{e1e2u} and \texttt{e1e2v} should set 
    440440the surface-area computation flag: 
     
    487487    (d) hybrid $s-z$ coordinate, 
    488488    (e) hybrid $s-z$ coordinate with partial step, and 
    489     (f) same as (e) but in the non-linear free surface (\protect\np{ln\_linssh}\forcode{=.false.}). 
     489    (f) same as (e) but in the non-linear free surface (\protect\np{ln_linssh}{ln\_linssh}\forcode{=.false.}). 
    490490    Note that the non-linear free surface can be used with any of the 5 coordinates (a) to (e).} 
    491491  \label{fig:DOM_z_zps_s_sps} 
     
    502502a single configuration file can support both options. 
    503503 
    504 By default a non-linear free surface is used (\np{ln\_linssh} set to \forcode{=.false.} in \nam{dom}): 
     504By default a non-linear free surface is used (\np{ln_linssh}{ln\_linssh} set to \forcode{=.false.} in \nam{dom}): 
    505505the coordinate follow the time-variation of the free surface so that the transformation is time dependent: 
    506506$z(i,j,k,t)$ (\eg\ \autoref{fig:DOM_z_zps_s_sps}f). 
    507 When a linear free surface is assumed (\np{ln\_linssh} set to \forcode{=.true.} in \nam{dom}), 
     507When a linear free surface is assumed (\np{ln_linssh}{ln\_linssh} set to \forcode{=.true.} in \nam{dom}), 
    508508the vertical coordinates are fixed in time, but the seawater can move up and down across the $z_0$ surface 
    509509(in other words, the top of the ocean in not a rigid lid). 
    510510 
    511511Note that settings: 
    512 \np{ln\_zco}, \np{ln\_zps}, \np{ln\_sco} and \np{ln\_isfcav} mentioned in the following sections 
     512\np{ln_zco}{ln\_zco}, \np{ln_zps}{ln\_zps}, \np{ln_sco}{ln\_sco} and \np{ln_isfcav}{ln\_isfcav} mentioned in the following sections 
    513513appear to be namelist options but they are no longer truly namelist options for \NEMO. 
    514514Their value is written to and read from the domain configuration file and 
     
    517517serve both to provide a record of the choices made whilst building the configuration and 
    518518to trigger appropriate code blocks within \NEMO. 
    519 These values should not be altered in the \np{cn\_domcfg} file. 
     519These values should not be altered in the \np{cn_domcfg}{cn\_domcfg} file. 
    520520 
    521521\medskip 
    522 The decision on these choices must be made when the \np{cn\_domcfg} file is constructed. 
     522The decision on these choices must be made when the \np{cn_domcfg}{cn\_domcfg} file is constructed. 
    523523Three main choices are offered (\autoref{fig:DOM_z_zps_s_sps}a-c): 
    524524 
    525525\begin{itemize} 
    526 \item $z$-coordinate with full step bathymetry (\np{ln\_zco}\forcode{=.true.}), 
    527 \item $z$-coordinate with partial step ($zps$) bathymetry (\np{ln\_zps}\forcode{=.true.}), 
    528 \item Generalized, $s$-coordinate (\np{ln\_sco}\forcode{=.true.}). 
     526\item $z$-coordinate with full step bathymetry (\np{ln_zco}{ln\_zco}\forcode{=.true.}), 
     527\item $z$-coordinate with partial step ($zps$) bathymetry (\np{ln_zps}{ln\_zps}\forcode{=.true.}), 
     528\item Generalized, $s$-coordinate (\np{ln_sco}{ln\_sco}\forcode{=.true.}). 
    529529\end{itemize} 
    530530 
     
    534534A further choice related to vertical coordinate concerns 
    535535the presence (or not) of ocean cavities beneath ice shelves within the model domain. 
    536 A setting of \np{ln\_isfcav} as \forcode{.true.} indicates that the domain contains ocean cavities, 
     536A setting of \np{ln_isfcav}{ln\_isfcav} as \forcode{.true.} indicates that the domain contains ocean cavities, 
    537537otherwise the top, wet layer of the ocean will always be at the ocean surface. 
    538538This option is currently only available for $z$- or $zps$-coordinates. 
     
    544544They are updated at each model time step. 
    545545The initial fixed reference coordinate system is held in variable names with a $\_0$ suffix. 
    546 When the linear free surface option is used (\np{ln\_linssh}\forcode{=.true.}), 
     546When the linear free surface option is used (\np{ln_linssh}{ln\_linssh}\forcode{=.true.}), 
    547547\textit{before}, \textit{now} and \textit{after} arrays are initially set to 
    548548their reference counterpart and remain fixed. 
     
    652652(grid-point position, scale factors) 
    653653can be saved in a file if 
    654 namelist parameter \np{ln\_write\_cfg} (namelist \nam{cfg}) is set to \forcode{.true.}; 
    655 the output filename is set through parameter \np{cn\_domcfg\_out}. 
     654namelist parameter \np{ln_write_cfg}{ln\_write\_cfg} (namelist \nam{cfg}) is set to \forcode{.true.}; 
     655the output filename is set through parameter \np{cn_domcfg_out}{cn\_domcfg\_out}. 
    656656This is only really useful if 
    657657the fields are computed in subroutines \mdl{usrdef\_hgr} or \mdl{usrdef\_zgr} and 
     
    661661(grid-point position, scale factors, depths and masks) 
    662662can be saved in a file called \texttt{mesh\_mask} if 
    663 namelist parameter \np{ln\_meshmask} (namelist \nam{dom}) is set to \forcode{.true.}. 
     663namelist parameter \np{ln_meshmask}{ln\_meshmask} (namelist \nam{dom}) is set to \forcode{.true.}. 
    664664This file contains additional fields that can be useful for post-processing applications. 
    665665 
     
    679679Basic initial state options are defined in \nam{tsd}. 
    680680By default, the ocean starts from rest (the velocity field is set to zero) and 
    681 the initialization of temperature and salinity fields is controlled through the \np{ln\_tsd\_init} namelist parameter. 
     681the initialization of temperature and salinity fields is controlled through the \np{ln_tsd_init}{ln\_tsd\_init} namelist parameter. 
    682682 
    683683\begin{description} 
    684 \item[\np{ln\_tsd\_init}\forcode{= .true.}] 
     684\item[\np{ln_tsd_init}{ln\_tsd\_init}\forcode{= .true.}] 
    685685  Use T and S input files that can be given on the model grid itself or on their native input data grids. 
    686686  In the latter case, the data will be interpolated on-the-fly both in the horizontal and the vertical to the model grid 
    687687  (see \autoref{subsec:SBC_iof}). 
    688   The information relating to the input files are specified in the \np{sn\_tem} and \np{sn\_sal} structures. 
     688  The information relating to the input files are specified in the \np{sn_tem}{sn\_tem} and \np{sn_sal}{sn\_sal} structures. 
    689689  The computation is done in the \mdl{dtatsd} module. 
    690 \item[\np{ln\_tsd\_init}\forcode{= .false.}] 
     690\item[\np{ln_tsd_init}{ln\_tsd\_init}\forcode{= .false.}] 
    691691  Initial values for T and S are set via a user supplied \rou{usr\_def\_istate} routine contained in \mdl{userdef\_istate}. 
    692692  The default version sets horizontally uniform T and profiles as used in the GYRE configuration 
Note: See TracChangeset for help on using the changeset viewer.