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 11299 – NEMO

Changeset 11299


Ignore:
Timestamp:
2019-07-18T16:27:43+02:00 (5 years ago)
Author:
nicolasmartin
Message:

Review of the coding rules chapter: convert it to a shared file for 3 manuals

  • Move annex_D.tex and NEMO_coding_conv.tex to ./latex/global
  • Rename NEMO_coding_conv.tex to coding_rules.tex and redesign it as a chapter and not a standalone document
  • Edit document.tex to include the coding rules by default at the end of the appendix
Location:
NEMO/trunk/doc/latex
Files:
3 edited
2 moved

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/doc/latex/NEMO/main/appendices.tex

    r11187 r11299  
    44\subfile{../subfiles/annex_C}             %% Discrete invariants of the eqs. 
    55\subfile{../subfiles/annex_iso}            %% Isoneutral diffusion using triads 
    6 \subfile{../subfiles/annex_D}             %% Coding rules 
    76 
    87%% Not included 
  • NEMO/trunk/doc/latex/NEMO/subfiles/introduction.tex

    r11123 r11299  
    151151The coding rules for OPA include conventions for naming variables, 
    152152with different starting letters for different types of variables (real, integer, parameter\ldots). 
    153 Those rules are briefly presented in \autoref{apdx:D} and a more complete document is available . 
     153Those rules are briefly presented in \autoref{apdx:coding} and a more complete document is available . 
    154154 
    155155The model is organized with a high internal modularity based on physics. 
     
    158158To make it easier for the user to find his way around the code, the module names follow a three-letter rule. 
    159159For example, \mdl{traldf} is a module related to the TRAcers equation, computing the Lateral DiFfussion. 
    160 %The complete list of module names is presented in \autoref{apdx:D}.      %====>>>> to be done ! 
     160%The complete list of module names is presented in \autoref{apdx:coding}.      %====>>>> to be done ! 
    161161Furthermore, modules are organized in a few directories that correspond to their category, 
    162162as indicated by the first three letters of their name (\autoref{tab:chapters}). 
  • NEMO/trunk/doc/latex/global/coding_rules.tex

    r11290 r11299  
    1 \documentclass{article} 
    2  
    3 \usepackage{fancyhdr} 
    4 \usepackage{times} 
    5 \usepackage{graphicx} 
    6 \usepackage{hyperref} 
    7 \usepackage{minted} 
     1%\documentclass{article} 
     2 
     3%\usepackage{fancyhdr} 
     4%\usepackage{times} 
     5%\usepackage{graphicx} 
     6%\usepackage{hyperref} 
     7%\usepackage{minted} 
    88%\usepackage[normalem]{ulem}   % striketrough style with \sout{...} 
    99 
    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 } 
     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%} 
    3030%\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 
     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%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     49\chapter{Coding Rules} 
     50\label{apdx:coding} 
     51 
     52\minitoc 
    4153 
    4254\newpage 
    4355 
    44 \tableofcontents 
    45  
    46 \newpage 
    47  
    48 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     56A "model life" is more than ten years. 
     57Its software, composed of a few hundred modules, is used by many people who are scientists or students and 
     58do not necessarily know every aspect of computing very well. 
     59Moreover, a well thought-out program is easier to read and understand, less difficult to modify, 
     60produces fewer bugs and is easier to maintain. 
     61Therefore, 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. 
     74 
     75To satisfy part of these aims, \NEMO is written with a coding standard which is close to the ECMWF rules, 
     76named DOCTOR \citep{gibson_rpt86}.  
     77These 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. ).  
     83 
     84This facilitates both the understanding and the debugging of an algorithm. 
     85 
    4986\section{Introduction} 
    5087 
     
    805842% \input NEMO_coding.conv.ind 
    806843 
    807 \end{document} 
     844%\end{document} 
  • NEMO/trunk/doc/latex/global/document.tex

    r11212 r11299  
    8585\include{appendices} 
    8686 
     87%% Append coding rules for every manual 
     88\input{../../global/coding_rules} 
     89 
    8790 
    8891%% Backmatter 
Note: See TracChangeset for help on using the changeset viewer.