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

    r11567 r11577  
    3232The OBS code is called from \mdl{nemogcm} for model initialisation and to calculate the model equivalent values for observations on the 0th time step. 
    3333The code is then called again after each time step from \mdl{step}. 
    34 The code is only activated if the \nam{obs} namelist logical \np{ln\_diaobs} is set to true. 
     34The code is only activated if the \nam{obs} namelist logical \np{ln_diaobs}{ln\_diaobs} is set to true. 
    3535 
    3636For all data types a 2D horizontal interpolator or averager is needed to 
     
    4242Some profile observation types (\eg\ tropical moored buoys) are made available as daily averaged quantities. 
    4343The observation operator code can be set-up to calculate the equivalent daily average model temperature fields using 
    44 the \np{nn\_profdavtypes} namelist array. 
     44the \np{nn_profdavtypes}{nn\_profdavtypes} namelist array. 
    4545Some SST observations are equivalent to a night-time average value and 
    4646the observation operator code can calculate equivalent night-time average model SST fields by 
    47 setting the namelist value \np{ln\_sstnight} to true. 
     47setting the namelist value \np{ln_sstnight}{ln\_sstnight} to true. 
    4848Otherwise (by default) the model value from the nearest time step to the observation time is used. 
    4949 
     
    9393 
    9494Options are defined through the \nam{obs} namelist variables. 
    95 The options \np{ln\_t3d} and \np{ln\_s3d} switch on the temperature and salinity profile observation operator code. 
    96 The filename or array of filenames are specified using the \np{cn\_profbfiles} variable. 
     95The options \np{ln_t3d}{ln\_t3d} and \np{ln_s3d}{ln\_s3d} switch on the temperature and salinity profile observation operator code. 
     96The filename or array of filenames are specified using the \np{cn_profbfiles}{cn\_profbfiles} variable. 
    9797The model grid points for a particular observation latitude and longitude are found using 
    9898the grid searching part of the code. 
    9999This can be expensive, particularly for large numbers of observations, 
    100 setting \np{ln\_grid\_search\_lookup} allows the use of a lookup table which 
    101 is saved into an \np{cn\_gridsearch} file (or files). 
     100setting \np{ln_grid_search_lookup}{ln\_grid\_search\_lookup} allows the use of a lookup table which 
     101is saved into an \np{cn_gridsearch}{cn\_gridsearch} file (or files). 
    102102This will need to be generated the first time if it does not exist in the run directory. 
    103103However, once produced it will significantly speed up future grid searches. 
    104 Setting \np{ln\_grid\_global} means that the code distributes the observations evenly between processors. 
     104Setting \np{ln_grid_global}{ln\_grid\_global} means that the code distributes the observations evenly between processors. 
    105105Alternatively each processor will work with observations located within the model subdomain 
    106106(see \autoref{subsec:OBS_parallel}). 
     
    565565(for surface observation types only). 
    566566 
    567 The main namelist option associated with the interpolation/averaging is \np{nn\_2dint}. 
     567The main namelist option associated with the interpolation/averaging is \np{nn_2dint}{nn\_2dint}. 
    568568This default option can be set to values from 0 to 6. 
    569569Values between 0 to 4 are associated with interpolation while values 5 or 6 are associated with averaging. 
    570570\begin{itemize} 
    571 \item \np{nn\_2dint}\forcode{ = 0}: Distance-weighted interpolation 
    572 \item \np{nn\_2dint}\forcode{ = 1}: Distance-weighted interpolation (small angle) 
    573 \item \np{nn\_2dint}\forcode{ = 2}: Bilinear interpolation (geographical grid) 
    574 \item \np{nn\_2dint}\forcode{ = 3}: Bilinear remapping interpolation (general grid) 
    575 \item \np{nn\_2dint}\forcode{ = 4}: Polynomial interpolation 
    576 \item \np{nn\_2dint}\forcode{ = 5}: Radial footprint averaging with diameter specified in the namelist as 
     571\item \np{nn_2dint}{nn\_2dint}\forcode{ = 0}: Distance-weighted interpolation 
     572\item \np{nn_2dint}{nn\_2dint}\forcode{ = 1}: Distance-weighted interpolation (small angle) 
     573\item \np{nn_2dint}{nn\_2dint}\forcode{ = 2}: Bilinear interpolation (geographical grid) 
     574\item \np{nn_2dint}{nn\_2dint}\forcode{ = 3}: Bilinear remapping interpolation (general grid) 
     575\item \np{nn_2dint}{nn\_2dint}\forcode{ = 4}: Polynomial interpolation 
     576\item \np{nn_2dint}{nn\_2dint}\forcode{ = 5}: Radial footprint averaging with diameter specified in the namelist as 
    577577  \texttt{rn\_[var]\_avglamscl} in degrees or metres (set using \texttt{ln\_[var]\_fp\_indegs}) 
    578 \item \np{nn\_2dint}\forcode{ = 6}: Rectangular footprint averaging with E/W and N/S size specified in 
     578\item \np{nn_2dint}{nn\_2dint}\forcode{ = 6}: Rectangular footprint averaging with E/W and N/S size specified in 
    579579  the namelist as \texttt{rn\_[var]\_avglamscl} and \texttt{rn\_[var]\_avgphiscl} in degrees or metres 
    580580  (set using \texttt{ln\_[var]\_fp\_indegs}) 
     
    582582Replace \texttt{[var]} in the last two options with the observation type (sla, sst, sss or sic) for 
    583583which the averaging is to be performed (see namelist example above). 
    584 The \np{nn\_2dint} default option can be overridden for surface observation types using 
     584The \np{nn_2dint}{nn\_2dint} default option can be overridden for surface observation types using 
    585585namelist values \texttt{nn\_2dint\_[var]} where \texttt{[var]} is the observation type. 
    586586 
Note: See TracChangeset for help on using the changeset viewer.