Ignore:
Timestamp:
2019-07-18T16:27:43+02:00 (14 months 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
File:
1 moved

Legend:

Unmodified
Added
Removed
  • 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} 
Note: See TracChangeset for help on using the changeset viewer.