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_misc.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_misc.tex

    r11571 r11577  
    5353\begin{itemize} 
    5454 
    55 \item Add \texttt{e1e2u} and \texttt{e1e2v} arrays to the \np{cn\_domcfg} file. These 2D 
     55\item Add \texttt{e1e2u} and \texttt{e1e2v} arrays to the \np{cn_domcfg}{cn\_domcfg} file. These 2D 
    5656arrays should contain the products of the unaltered values of: $\texttt{e1u}*\texttt{e2u}$ 
    5757and $\texttt{e1u}*\texttt{e2v}$ respectively. That is the original surface areas of $u$- 
    5858and $v$- cells respectively.  These areas are usually defined by the corresponding product 
    5959within the \NEMO\ code but the presence of \texttt{e1e2u} and \texttt{e1e2v} in the 
    60 \np{cn\_domcfg} file will suppress this calculation and use the supplied fields instead. 
     60\np{cn_domcfg}{cn\_domcfg} file will suppress this calculation and use the supplied fields instead. 
    6161If the model domain is provided by user-supplied code in \mdl{usrdef\_hgr}, then this 
    6262routine should also return \texttt{e1e2u} and \texttt{e1e2v} and set the integer return 
     
    6464will suppress the calculation of the areas. 
    6565 
    66 \item Change values of \texttt{e2u} or \texttt{e1v} (either in the \np{cn\_domcfg} file or 
     66\item Change values of \texttt{e2u} or \texttt{e1v} (either in the \np{cn_domcfg}{cn\_domcfg} file or 
    6767via code in  \mdl{usrdef\_hgr}), whereever a Strait reduction is required. The choice of 
    6868whether to alter \texttt{e2u} or \texttt{e1v} depends. respectively,  on whether the 
     
    198198maintain different sets of input fields for use with or without active ice cavities.  This 
    199199subsetting operates for the j-direction only and works by optionally looking for and using 
    200 a global file attribute (named: \np{open\_ocean\_jstart}) to determine the starting j-row 
     200a global file attribute (named: \np{open_ocean_jstart}{open\_ocean\_jstart}) to determine the starting j-row 
    201201for input.  The use of this option is best explained with an example: 
    202202\medskip 
     
    206206This file define a horizontal domain of 362x332.  The first row with 
    207207open ocean wet points in the non-isf bathymetry for this set is row 42 (\fortran\ indexing) 
    208 then the formally correct setting for \np{open\_ocean\_jstart} is 41.  Using this value as 
     208then the formally correct setting for \np{open_ocean_jstart}{open\_ocean\_jstart} is 41.  Using this value as 
    209209the first row to be read will result in a 362x292 domain which is the same size as the 
    210210original ORCA1 domain.  Thus the extended domain configuration file can be used with all 
     
    218218\end{cmds} 
    219219 
    220 \item Add the logical switch \np{ln\_use\_jattr} to \nam{cfg} in the configuration 
    221 namelist (if it is not already there) and set \np{.true.} 
     220\item Add the logical switch \np{ln_use_jattr}{ln\_use\_jattr} to \nam{cfg} in the configuration 
     221namelist (if it is not already there) and set \forcode{.true.} 
    222222\end{itemize} 
    223223 
    224224\noindent Note that with this option, the j-size of the global domain is (extended 
    225 j-size minus \np{open\_ocean\_jstart} + 1 ) and this must match the \texttt{jpjglo} value 
     225j-size minus \np{open_ocean_jstart}{open\_ocean\_jstart} + 1 ) and this must match the \texttt{jpjglo} value 
    226226for the configuration. This means an alternative version of \ifile{eORCA1\_domcfg.nc} must 
    227 be created for when \np{ln\_use\_jattr} is active. The \texttt{ncap2} tool provides a 
     227be created for when \np{ln_use_jattr}{ln\_use\_jattr} is active. The \texttt{ncap2} tool provides a 
    228228convenient way of achieving this: 
    229229 
     
    237237\texttt{open\_ocean\_jstart} attribute to the file's global attributes. 
    238238In particular this is true for any field that is read by \NEMO\ using the following optional argument to 
    239 the appropriate call to \np{iom\_get}. 
     239the appropriate call to \np{iom_get}{iom\_get}. 
    240240 
    241241\begin{forlines} 
     
    332332This alternative method should give identical results to the default \textsc{ALLGATHER} method and 
    333333is recommended for large values of \np{jpni}. 
    334 The new method is activated by setting \np{ln\_nnogather} to be true (\nam{mpp}). 
     334The new method is activated by setting \np{ln_nnogather}{ln\_nnogather} to be true (\nam{mpp}). 
    335335The reproducibility of results using the two methods should be confirmed for each new, 
    336336non-reference configuration. 
     
    364364\subsection{Control print} 
    365365 
    366 The \np{ln\_ctl} switch was originally used as a debugging option in two modes: 
     366The \np{ln_ctl}{ln\_ctl} switch was originally used as a debugging option in two modes: 
    367367 
    368368\begin{enumerate} 
    369 \item{\np{ln\_ctl}: compute and print the trends averaged over the interior domain in all TRA, DYN, LDF and 
     369\item{\np{ln_ctl}{ln\_ctl}: compute and print the trends averaged over the interior domain in all TRA, DYN, LDF and 
    370370ZDF modules. 
    371371This option is very helpful when diagnosing the origin of an undesired change in model results. } 
    372372 
    373 \item{also \np{ln\_ctl} but using the nictl and njctl namelist parameters to check the source of differences between 
     373\item{also \np{ln_ctl}{ln\_ctl} but using the nictl and njctl namelist parameters to check the source of differences between 
    374374mono and multi processor runs.} 
    375375\end{enumerate} 
    376376 
    377377However, in recent versions it has also been used to force all processors to assume the 
    378 reporting role. Thus when \np{ln\_ctl} is true all processors produce their own versions 
     378reporting role. Thus when \np{ln_ctl}{ln\_ctl} is true all processors produce their own versions 
    379379of files such as: ocean.output, layout.dat, etc.  All such files, beyond the the normal 
    380380reporting processor (narea == 1), are named with a \_XXXX extension to their name, where 
     
    382382such as run.stat (and its netCDF counterpart: run.stat.nc) and tracer.stat contain global 
    383383information and are only ever produced by the reporting master (narea == 1). For version 
    384 4.0 a start has been made to return \np{ln\_ctl} to its original function by introducing 
     3844.0 a start has been made to return \np{ln_ctl}{ln\_ctl} to its original function by introducing 
    385385a new control structure which allows finer control over which files are produced. This 
    386386feature is still evolving but it does already allow the user to: select individually the 
Note: See TracChangeset for help on using the changeset viewer.