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 11433 for NEMO/trunk/doc/latex/global/coding_rules.tex – NEMO

Ignore:
Timestamp:
2019-08-12T21:44:18+02:00 (5 years ago)
Author:
nicolasmartin
Message:

Pre-implementation of new cover page and new headings style for reference manuals

Cover page

The layout of the frontpage has been completely redesigned,
a coloured banner has been added to emphasize the title and easily identify each manual
between them.
The chosen color for each document (blue for NEMO, gray for SI3 and green for TOP) will be
used throughout the manual for the links and in the chapter headings.
The list of authors (writers/editors/reviewers) for the version of the manual is given next to
the abstract, which is now included in the frontpage.
A link to an existing ORCID profile for the author precedes its name.
Few settings have been added to each definitions.tex in order to adjust the rendering of the cover page (vertical spaces above and below the title, a subtitle, the width for authors list and
abstract section)

Headings

  • header: chapter number and title for even pages, same infos for section otherwise
  • footer: name of the manual and page numbering with the total number of pages (reverse order between odd/even pages)

For the chapter heading, a new style 'Bjornstrup' from fncychap package is now use.

Abstract

Split the section in two paragraphs for all manuals

  1. Common description with almost the same sentences only customized by the general infos of the model
  2. Specific part for the characteristics of the model

Troubleshooting

As announced, I have introduced some icons from academicons and fontawesome packages.
It required to switch from pdflatex to xelatex for the compilation and it prevents from now
the building of the whole document.
Also the PDF generated does not look nice due to the font

Work in progress...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/doc/latex/global/coding_rules.tex

    r11299 r11433  
    1 %\documentclass{article} 
    2  
    3 %\usepackage{fancyhdr} 
    4 %\usepackage{times} 
    5 %\usepackage{graphicx} 
    6 %\usepackage{hyperref} 
    7 %\usepackage{minted} 
    8 %\usepackage[normalem]{ulem}   % striketrough style with \sout{...} 
    9  
    10 %\hypersetup{pdftitle={NEMO coding conventions}, pdfauthor={NEMO System Team}, colorlinks} 
    11 %\setminted{style=emacs, breaklines, frame=leftline} 
    12 %\newmintinline[forcode]{fortran}{fontsize=auto, frame=lines}   % \forcode{...} 
    13 %\newminted[forlines]{fortran}{}                                % \begin{forlines} 
    14  
    15 %\pagestyle{empty} 
    16 %\setlength{\leftmargin}{1 cm} 
    17 %\setlength{\rightmargin}{1 cm} 
    18 %\setlength{\oddsidemargin}{0 cm} 
    19 %\setlength{\evensidemargin}{0 cm} 
    20 %\setlength{\topmargin}{-1cm} 
    21 %\setlength{\textwidth}{16 cm} 
    22 %\setlength{\textheight}{25cm} 
    23 %\pagestyle{fancy} 
    24  
    25 %\title{ 
    26 %  \includegraphics[width=0.3\textwidth]{../../../figures/NEMO_grey} \\ 
    27 %  \vspace{1.0cm} \rule{345pt}{1.5pt} \\ 
    28 %  \vspace{0.45cm} {\Huge NEMO coding conventions} \rule{345pt}{1.5pt} \\ 
    29 %} 
    30 %\title{NEMO coding conventions} 
    31 %\author{\Large NEMO System Team 
    32 %  \thanks{ 
    33 %    To be completed 
    34 %  } 
    35 %} 
    36 %\date{version X.X -- month year} 
    37  
    38 %\begin{document} 
    39  
    40 %\maketitle 
    41  
    42 %\newpage 
    43  
    44 %\tableofcontents 
    45  
    46 %\newpage 
    47  
    48 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     1 
    492\chapter{Coding Rules} 
    503\label{apdx:coding} 
     
    6013produces fewer bugs and is easier to maintain. 
    6114Therefore, it is essential that the model development follows some rules: 
    62  
    63 - well planned and designed 
    64  
    65 - well written 
    66  
    67 - well documented (both on- and off-line) 
    68  
    69 - maintainable 
    70  
    71 - easily portable 
    72  
    73 - flexible. 
     15\begin{itemize} 
     16   \item well planned and designed 
     17   \item well written 
     18   \item well documented (both on- and off-line) 
     19   \item maintainable 
     20   \item easily portable 
     21   \item flexible. 
     22\end{itemize} 
    7423 
    7524To satisfy part of these aims, \NEMO is written with a coding standard which is close to the ECMWF rules, 
    7625named DOCTOR \citep{gibson_rpt86}.  
    7726These rules present some advantages like: 
    78  
    79 - to provide a well presented program 
    80  
    81 - to use rules for variable names which allow recognition of their type 
    82 (integer, real, parameter, local or shared variables, etc. ).  
     27\begin{itemize} 
     28   \item to provide a well presented program 
     29   \item to use rules for variable names which allow recognition of their type 
     30   (integer, real, parameter, local or shared variables, etc. ).  
     31\end{itemize} 
    8332 
    8433This facilitates both the understanding and the debugging of an algorithm. 
     
    8635\section{Introduction} 
    8736 
    88 This document describes conventions\index{conventions} used in NEMO coding and suggested for its development. 
    89 The objectives are to offer a guide to all readers of the NEMO code, and to facilitate the work of 
     37This document describes conventions used in \NEMO coding and suggested for its development. 
     38The objectives are to offer a guide to all readers of the \NEMO code, and to facilitate the work of 
    9039all the developers, including the validation of their developments, and 
    91 eventually the implementation of these developments within the NEMO platform. 
     40eventually the implementation of these developments within the \NEMO platform. 
    9241 
    9342A first approach of these rules can be found in the code in \path{./src/OCE/module_example} where 
     
    9847\footnote {\href{http://www.cesm.ucar.edu/working_groups/Software/dev_guide/dev_guide/node7.html}{UCAR conventions}},  
    9948the previous version of this document (``FORTRAN coding standard in the OPA System'') and 
    100 the expertise of the NEMO System Team. 
     49the expertise of the \NEMO System Team. 
    10150After a general overview below, this document will describe: 
    10251 
    10352\begin{itemize} 
    104 \item 
    105   The style rules, $i.e.$ the syntax, appearance and naming conventions chosen to improve readability of the code; 
    106 \item 
    107   The content rules, $i.e.$ the conventions to improve the reliability of the different parts of the code; 
    108 \item 
    109   The package rules to go a step further by improving the reliability of the whole and 
    110   interfaces between routines and modules. 
     53   \item The style rules, $i.e.$ the syntax, appearance and naming conventions chosen to improve readability of the code; 
     54   \item The content rules, $i.e.$ the conventions to improve the reliability of the different parts of the code; 
     55   \item The package rules to go a step further by improving the reliability of the whole and 
     56   interfaces between routines and modules. 
    11157\end{itemize} 
    11258 
    113 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    11459\section{Overview and general conventions} 
    11560 
    116 NEMO has 3 major components: ocean dynamics (\path{./src/OCE}), sea-ice (\path{./src/ICE}) and 
     61\NEMO has 3 major components: ocean dynamics (\path{./src/OCE}), sea-ice (\path{./src/ICE}) and 
    11762marine biogeochemistry (\path{./src/MBG}). 
    11863%, linear-tangent and adjoint of the dynamics ($TAM$) each of them corresponding to a directory. 
     
    12671See \path{.src/OCE/DOM/phycst.F90} files for conversions. 
    12772 
    128 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    12973\section{Architecture} 
    13074 
    131 Within each directory, organisation of files is driven by orthogonality\index{orthogonality}, 
     75Within each directory, organisation of files is driven by orthogonality, 
    13276$i.e.$ one functionality of the code is intended to be in one and only one directory, and 
    13377one module and all its related routines are in one file. 
    134 The functional modules\index{module} are: 
     78The functional modules are: 
    13579 
    13680\begin{itemize} 
    137 \item \path{SBC}             surface module 
    138 \item \path{IOM}             management of the I/O 
    139 \item \path{NST}             interface to AGRIF (nesting model) for dynamics and biogeochemistry 
    140 \item \path{OBC}, \path{BDY} management of structured and unstructured open boundaries  
    141 \item \path{C1D}             1D (vertical) configuration for dynamics, sea-ice and biogeochemistry 
    142 \item \path{OFF}             off-line module: passive tracer or biogeochemistry alone 
    143 \item \path{...} 
     81   \item \path{SBC}             surface module 
     82   \item \path{IOM}             management of the I/O 
     83   \item \path{NST}             interface to AGRIF (nesting model) for dynamics and biogeochemistry 
     84   \item \path{OBC}, \path{BDY} management of structured and unstructured open boundaries  
     85   \item \path{C1D}             1D (vertical) configuration for dynamics, sea-ice and biogeochemistry 
     86   \item \path{OFF}             off-line module: passive tracer or biogeochemistry alone 
     87   \item \path{...} 
    14488\end{itemize} 
    14589 
     
    14791this module (\texttt{dom\_init, dom\_nam, dom\_ctl}). 
    14892 
    149 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    15093\section{Style rules} 
    15194 
    152 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    15395\subsection{Argument list format} 
    15496 
    155 Routine argument lists will contain a maximum 5 variables\index{variable} per line, 
     97Routine argument lists will contain a maximum 5 variables per line, 
    15698whilst continuation lines can be used. 
    15799This applies both to the calling routine and the dummy argument list in the routine being called. 
     
    164106\end{forlines} 
    165107 
    166 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    167108\subsection{Array syntax} 
    168109 
     
    198139\end{forlines} 
    199140 
    200 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    201141\subsection{Case} 
    202142 
    203143All FORTRAN keywords are in capital: \forcode{DIMENSION}, \forcode{WRITE}, \forcode{DO}, \forcode{END DO}, 
    204 \forcode{NAMELIST}, ... All other parts of the NEMO code will be written in lower case. 
    205  
    206 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     144\forcode{NAMELIST}, ... All other parts of the \NEMO code will be written in lower case. 
     145 
    207146\subsection{Comments} 
    208147 
     
    248187\end{enumerate} 
    249188 
    250 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    251189\subsection{Continuation lines} 
    252190 
     
    265203use a ``\&'' as first character of the continuing lines to maintain the alignment. 
    266204 
    267 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    268205\subsection{Declaration of arguments and local variables} 
    269206 
     
    277214\end{forlines} 
    278215 
    279 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    280216\subsection{F90 Standard} 
    281217 
    282 NEMO software adheres to the FORTRAN 95 language standard and does not rely on any specific language or 
     218\NEMO software adheres to the \fninety language standard and does not rely on any specific language or 
    283219vendor extensions. 
    284220 
    285  
    286 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    287221\subsection{Free-Form Source} 
    288222 
     
    292226Multi-line comments that extend to column 100 are unacceptable. 
    293227 
    294 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    295228\subsection{Indentation} 
    296229 
     
    310243\end{forlines} 
    311244 
    312 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    313245\subsection{Loops} 
    314246 
     
    317249In the case of a long loop, a self-descriptive label can be used ($i.e.$ not just a number). 
    318250 
    319 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    320251\subsection{Naming Conventions: files} 
    321252 
     
    331262} 
    332263 
    333 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    334264\subsection{Naming Conventions: modules} 
    335265 
     
    338268For example, zdftke, where ``zdf'' stands for vertical diffusion, and ``tke'' for turbulent kinetic energy. \\ 
    339269Note that by implication multiple modules are not allowed in a single file. 
    340 The use of common blocks is deprecated in Fortran 90 and their use in NEMO is strongly discouraged. 
     270The use of common blocks is deprecated in \fortran 90 and their use in \NEMO is strongly discouraged. 
    341271Modules are a better way to declare static data. 
    342272Among the advantages of modules is the ability to freely mix data of various types, and 
    343273to limit access to contained variables through the use of the \forcode{ONLY} and \forcode{PRIVATE} attributes. 
    344274 
    345 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    346275\subsection{Naming Conventions: variables} 
    347276 
    348277All variable should be named as explicitly as possible in English. 
    349278The naming convention concerns prefix letters of these name, in order to identify the variable type and status. \\ 
    350 Never use a FORTRAN keyword as a routine or variable name. \\ 
     279Never use a \fortran keyword as a routine or variable name. \\ 
    351280The table below lists the starting letter(s) to be used for variable naming, depending on their type and status: 
    352281%--------------------------------------------------TABLE-------------------------------------------------- 
     
    355284    \begin{tabular}{|p{50pt}|p{50pt}|p{50pt}|p{50pt}|p{50pt}|p{50pt}|p{50pt}|} 
    356285      \hline 
    357       Type \par / Status &   integer&   real&   logical &   character&   double \par precision&   complex \\ 
    358       \hline 
    359       public  \par or  \par module variable& \textbf{m n} \par \textit{but not } \par \textbf{nn\_}& \textbf{a b e f g h o} \textbf{q} \textit{to} \textbf{x} \par but not \par \textbf{fs rn\_}& \textbf{l} \par \textit{but not} \par \textbf{lp ld ll ln\_}& \textbf{c} \par \textit{but not} \par \textbf{cp cd cl cn\_}& \textbf{d} \par \textit{but not} \par \textbf{dp dd dl dn\_}& \textbf{y} \par \textit{but not} \par \textbf{yp yd yl} \\ 
    360       \hline 
    361       dummy \par argument& \textbf{k} \par \textit{but not} \par \textbf{kf}& \textbf{p} \par \textit{but not}  \par \textbf{pp pf}& \textbf{ld}& \textbf{cd}& \textbf{dd}& \textbf{yd} \\ 
    362       \hline 
    363       local \par variable& \textbf{i}& \textbf{z}& \textbf{ll}& \textbf{cl}& \textbf{cd}& \textbf{yl} \\ 
    364       \hline 
    365       loop \par control& \textbf{j} \par \textit{but not } \par \textbf{jp}& & & & &  \\ 
    366       \hline 
    367       parameter& \textbf{jp}& \textbf{pp}& \textbf{lp}& \textbf{cp}& \textbf{dp}& \textbf{yp} \\ 
    368       \hline 
    369       namelist& \textbf{nn\_}& \textbf{rn\_}& \textbf{ln\_}& \textbf{cn\_}& \textbf{dn\_}& \\ 
    370       \hline 
    371       CPP \par macro& \textbf{kf}& \textbf{sf} \par & & & & \\ 
     286      Type \par / Status                                                                          & 
     287      integer                                                                                     & 
     288      real                                                                                        & 
     289      logical                                                                                     & 
     290      character                                                                                   & 
     291      double \par precision                                                                       & 
     292      complex                                                                                     \\ 
     293      \hline 
     294      public \par or \par module variable                                                         &  
     295      \textbf{m n} \par \textit{but not} \par \textbf{nn\_}                                       &  
     296      \textbf{a b e f g h o} \textbf{q} \textit{to} \textbf{x} \par but not \par \textbf{fs rn\_} & 
     297      \textbf{l} \par \textit{but not} \par \textbf{lp ld ll ln\_}                                & 
     298      \textbf{c} \par \textit{but not} \par \textbf{cp cd cl cn\_}                                & 
     299      \textbf{d} \par \textit{but not} \par \textbf{dp dd dl dn\_}                                & 
     300      \textbf{y} \par \textit{but not} \par \textbf{yp yd yl}                                     \\ 
     301      \hline 
     302      dummy \par argument                                                                         & 
     303      \textbf{k} \par \textit{but not} \par \textbf{kf}                                           &  
     304      \textbf{p} \par \textit{but not} \par \textbf{pp pf}                                        &  
     305      \textbf{ld}                                                                                 & 
     306      \textbf{cd}                                                                                 & 
     307      \textbf{dd}                                                                                 & 
     308      \textbf{yd}                                                                                 \\ 
     309      \hline 
     310      local \par variable                                                                         & 
     311      \textbf{i}                                                                                  &  
     312      \textbf{z}                                                                                  & 
     313      \textbf{ll}                                                                                 & 
     314      \textbf{cl}                                                                                 & 
     315      \textbf{cd}                                                                                 & 
     316      \textbf{yl}                                                                                 \\ 
     317      \hline 
     318      loop \par control                                                                           & 
     319      \textbf{j} \par \textit{but not} \par \textbf{jp}                                           & 
     320                                                                                                  & 
     321                                                                                                  & 
     322                                                                                                  & 
     323                                                                                                  & 
     324                                                                                                  \\ 
     325      \hline 
     326      parameter                                                                                   & 
     327      \textbf{jp}                                                                                 & 
     328      \textbf{pp}                                                                                 & 
     329      \textbf{lp}                                                                                 & 
     330      \textbf{cp}                                                                                 & 
     331      \textbf{dp}                                                                                 & 
     332      \textbf{yp}                                                                                 \\ 
     333      \hline 
     334      namelist                                                                                    & 
     335      \textbf{nn\_}                                                                               &  
     336      \textbf{rn\_}                                                                               & 
     337      \textbf{ln\_}                                                                               & 
     338      \textbf{cn\_}                                                                               & 
     339      \textbf{dn\_}                                                                               & 
     340                                                                                                  \\ 
     341      \hline 
     342      CPP \par macro                                                                              & 
     343      \textbf{kf}                                                                                 & 
     344      \textbf{sf}                                                                                 & 
     345                                                                                                  & 
     346                                                                                                  & 
     347                                                                                                  & 
     348                                                                                                  \\ 
    372349      \hline 
    373350    \end{tabular} 
     
    377354%-------------------------------------------------------------------------------------------------------------- 
    378355 
    379 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    380356\subsection{Operators} 
    381357 
     
    385361In general use the notation: \\ 
    386362$<Blank><Operator><Blank>$ 
    387 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     363 
    388364\subsection{Pre processor} 
    389365 
     
    412388Is to be used rather than the \#ifdef abbreviate form since it may have conflicts with some Unix scripts. 
    413389 
    414 Tests on cpp keys included in NEMO at compilation step: 
     390Tests on cpp keys included in \NEMO at compilation step: 
    415391 
    416392\begin{itemize} 
     
    421397  If a change occurs in the CPP keys used for a given experiment, the whole compilation phase is done again. 
    422398\end{itemize} 
    423 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     399 
    424400\section{Content rules} 
    425401 
    426 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    427402\subsection{Configurations} 
    428403 
    429 The configuration defines the domain and the grid on which NEMO is running. 
    430 It may be useful to associate a cpp key and some variables to a given configuration, although 
     404The configuration defines the domain and the grid on which \NEMO is running. 
     405It may be useful to associate a CPP key and some variables to a given configuration, although 
    431406the part of the code changed under each of those keys should be minimized. 
    432407As an example, the "ORCA2" configuration (global ocean, 2 degrees grid size) is associated with 
     
    438413\end{forlines} 
    439414 
    440 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    441415\subsection{Constants} 
    442416 
    443 Physical constants ($e.g.$ $\pi$, gas constants) must never be hardwired into the executable portion of a code. 
     417Physical constants ($e.g.$ $\pi$, gas constants) must never be hard-wired into the executable portion of a code. 
    444418Instead, a mnemonically named variable or parameter should be set to the appropriate value, 
    445 in the setup routine for the package\index{package}. 
     419in the setup routine for the package. 
    446420We realize than many parameterizations rely on empirically derived constants or fudge factors, 
    447421which are not easy to name. 
     
    450424Hard-coded numbers should never be passed through argument lists. 
    451425 
    452 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    453426\subsection{Declaration for variables and constants} 
    454427 
     
    512485improve control of variables in routine calls. 
    513486 
    514 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    515487\subsection{Headers} 
    516488 
    517 Prologues are not used in NEMO for now, although it may become an interesting tool in combination with 
     489Prologues are not used in \NEMO for now, although it may become an interesting tool in combination with 
    518490ProTeX auto documentation script in the future. 
    519491Rules to code the headers and layout of a module or a routine are illustrated in the example module available with 
    520492the code: \path{./src/OCE/module_example} 
    521493 
    522 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    523494\subsection{Interface blocks} 
    524495 
     
    528499FORTRAN 95 compilers can automatically provide explicit interface blocks for routines contained in a module. 
    529500 
    530 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    531501\subsection{I/O Error Conditions} 
    532502 
     
    536506a negative value means the end of record or end of file was encountered. 
    537507 
    538 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    539508\subsection{PRINT - ASCII output files} 
    540509 
     
    551520\end{forlines} 
    552521 
    553 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    554522\subsection{Precision} 
    555523 
     
    570538\end{forlines} 
    571539 
    572 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    573540\subsection{Structures} 
    574541 
    575 The \forcode{TYPE} structure allowing to declare some variables is more often used in NEMO, 
     542The \forcode{TYPE} structure allowing to declare some variables is more often used in \NEMO, 
    576543especially in the modules dealing with reading fields, or interfaces. 
    577544For example: 
     
    592559Missing rule on structure name?? 
    593560 
    594 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    595561\section{Packages coding rules} 
    596562 
    597 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    598563\subsection{Bounds checking} 
    599564 
    600 NEMO is able to run when an array bounds checking option is enabled 
     565\NEMO is able to run when an array bounds checking option is enabled 
    601566(provided the cpp key \texttt{key\_vectopt\_loop} is not defined). \\ 
    602567Thus, constructs of the following form are disallowed: 
     
    610575it effectively disables array bounds checking. 
    611576 
    612 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    613577\subsection{Communication} 
    614578 
     
    624588} 
    625589 
    626 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    627590\subsection{Error conditions} 
    628591 
     
    634597see \textit{stpctl.F90}. 
    635598 
    636 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    637599\subsection{Memory management} 
    638600 
    639601The main action is to identify and declare which arrays are \forcode{PUBLIC} and which are \forcode{PRIVATE}. \\ 
    640 As of version 3.3.1 of NEMO, the use of static arrays (size fixed at compile time) has been deprecated. 
     602As of version 3.3.1 of \NEMO, the use of static arrays (size fixed at compile time) has been deprecated. 
    641603All module arrays are now declared \forcode{ALLOCATABLE} and 
    642604allocated in either the \texttt{<module\_name>\_alloc()} or \texttt{<module\_name>\_init()} routines. 
     
    644606the \texttt{stat=<integer\ variable>} optional argument. \\ 
    645607 
    646 In addition to arrays contained within modules, many routines in NEMO require local, ``workspace'' arrays to 
     608In addition to arrays contained within modules, many routines in \NEMO require local, ``workspace'' arrays to 
    647609hold the intermediate results of calculations. 
    648 In previous versions of NEMO, these arrays were declared in such a way as to be automatically allocated on 
     610In previous versions of \NEMO, these arrays were declared in such a way as to be automatically allocated on 
    649611the stack when the routine was called. 
    650612An example of an automatic array is: 
     
    735697It is then associated with a sub-array of \texttt{wrk\_3d\_5} once the call to 
    736698\texttt{wrk\_in\_use()} has completed successfully. 
    737 Note that in F95 (to which NEMO conforms) it is not possible for either the upper or lower array bounds of 
     699Note that in F95 (to which \NEMO conforms) it is not possible for either the upper or lower array bounds of 
    738700the pointer object to differ from those of the target array. \\ 
    739701 
     
    748710This should enable the developer to choose alternatives for use in the subroutine being worked on. \\ 
    749711 
    750 When compiling NEMO for production runs, 
     712When compiling \NEMO for production runs, 
    751713the calls to {\texttt{wrk\_in\_use()} / \texttt{wrk\_not\_released()} can be reduced to stubs that just 
    752714return \forcode{.false.} by setting the cpp key \texttt{key\_no\_workspace\_check}. 
    753 These stubs may then be inlined (and thus effectively removed altogether) by setting appropriate compiler flags 
     715These stubs may then be in-lined (and thus effectively removed altogether) by setting appropriate compiler flags 
    754716($e.g.$ ``-finline'' for the Intel compiler or ``-Q'' for the IBM compiler). 
    755717 
    756 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    757718\subsection{Optimisation} 
    758719 
    759720Considering the new computer architecture, optimisation cannot be considered independently from the computer type. 
    760 In NEMO, portability is a priority, before any too specific optimisation. 
     721In \NEMO, portability is a priority, before any too specific optimisation. 
    761722 
    762723Some tools are available to help: for vector computers, \texttt{key\_vectopt\_loop} allows to unroll a loop 
    763724 
    764 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    765725\subsection{Package attribute: \forcode{PRIVATE}, \forcode{PUBLIC}, \forcode{USE}, \forcode{ONLY}} 
    766726 
     
    770730defined in a module are to be made available to the using routine. 
    771731 
    772 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    773 \subsection {Parallelism using MPI} 
    774  
    775 NEMO is written in order to be able to run on one processor, or on one or more using MPI 
     732\subsection{Parallelism using MPI} 
     733 
     734\NEMO is written in order to be able to run on one processor, or on one or more using MPI 
    776735($i.e.$ activating the cpp key $key\_mpp\_mpi$). 
    777 The domain decomposition divides the global domain in cubes (see NEMO reference manual). 
     736The domain decomposition divides the global domain in cubes (see \NEMO reference manual). 
    778737Whilst coding a new development, the MPI compatibility has to be taken in account 
    779738(see \path{./src/LBC/lib_mpp.F90}) and should be tested. 
    780739By default, the $x$-$z$ part of the decomposition is chosen to be as square as possible. 
    781 However, this may be overriden by specifying the number of subdomains in latitude and longitude in 
     740However, this may be overriden by specifying the number of sub-domains in latitude and longitude in 
    782741the \texttt{nammpp} section of the namelist file. 
    783742 
    784 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    785743\section{Features to be avoided} 
    786744 
     
    804762  \forcode{SELECT CASE} construct instead) 
    805763\item 
    806   Labeled \forcode{DO} construct 
    807   (use unlabeled \forcode{END DO} instead) 
     764  Labelled \forcode{DO} construct 
     765  (use unlabelled \forcode{END DO} instead) 
    808766\item 
    809767  \forcode{FORMAT} statement 
     
    817775  \forcode{PAUSE} 
    818776\item 
    819   \forcode{ENTRY} statement: a subprogram must only have one entry point. 
     777  \forcode{ENTRY} statement: a sub-program must only have one entry point. 
    820778\item 
    821779  \forcode{RETURN} is obsolete and so not necessary at the end of program units 
     
    837795\end{itemize} 
    838796 
    839 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    840  
    841 % \printindex 
    842 % \input NEMO_coding.conv.ind 
    843  
    844 %\end{document} 
Note: See TracChangeset for help on using the changeset viewer.