- Timestamp:
- 2010-10-15T16:42:00+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/nemo_v3_3_beta/DOC/TexFiles/Chapters/Annex_D.tex
r1223 r2282 5 5 \label{Apdx_D} 6 6 \minitoc 7 8 \newpage 9 $\ $\newline % force a new ligne 10 $\ $\newline % force a new ligne 7 11 8 12 … … 33 37 34 38 - to use rules for variable names which allow recognition of their type 35 (integer, real, parameter, local or shared variables, etc. ) so that debugging is 36 facilitated. 39 (integer, real, parameter, local or shared variables, etc. ). 40 41 This facilitates both the understanding and the debugging of an algorithm. 37 42 38 43 % ================================================================ … … 63 68 - A program has not more than 200 to 300 lines. 64 69 70 A template of a module style can be found on the NEMO depository 71 in the following file : NEMO/OPA\_SRC/module\_example. 65 72 % ================================================================ 66 73 % Coding conventions … … 72 79 features like statement functions, do not use GO TO and EQUIVALENCE statements. 73 80 74 - A continuation line begins with the character {\$} indented by three spaces 75 compared to the previous line. 81 - A continuation line begins with the character {\&} indented by three spaces 82 compared to the previous line, while the previous line ended with the character {\&}. 83 84 - All the variables must be declared. The code is usually compiled with implicit none. 85 86 - Never use continuation lines in the declaration of a variable. When searching a 87 variable in the code through a \textit{grep} command, the declaration line will be found. 88 89 - In the declaration of a PUBLIC variable, the comment part at the end of the line 90 should start with the two characters "\verb?!:?". the following UNIX command, 91 \verb?grep var_name *90 \ grep \!: ? 92 will display the module name and the line where the var\_name declaration is. 76 93 77 94 - Always use a three spaces indentation in DO loop, CASE, or IF-ELSEIF-ELSE-ENDIF 78 95 statements. 79 96 97 - use a space after a comma, except when it appears to separate the indices of an array. 98 80 99 - use call to ctl\_stop routine instead of just a STOP. 81 100 101 102 \newpage 82 103 % ================================================================ 83 104 % Naming Conventions … … 87 108 88 109 The purpose of the naming conventions is to use prefix letters to classify 89 model variables. These conventions allow the variable type to be easily known 90 and rapidly identified: 110 model variables. These conventions allow the variable type to be easily 111 known and rapidly identified. The naming conventions are summarised 112 in the Table below: 113 91 114 92 115 %--------------------------------------------------TABLE-------------------------------------------------- 93 \begin{table}[htbp] 116 \begin{table}[htbp] \label{Tab_VarName} 94 117 \begin{center} 95 \begin{tabular}{|p{ 50pt}|p{50pt}|p{50pt}|p{50pt}|p{50pt}|p{50pt}|p{50pt}|}96 \hline Type \par / Status & integer& real& logical & character & double \par precision& complex \\118 \begin{tabular}{|p{45pt}|p{35pt}|p{45pt}|p{40pt}|p{40pt}|p{40pt}|p{40pt}|p{40pt}|} 119 \hline Type \par / Status & integer& real& logical & character & structure & double \par precision& complex \\ 97 120 \hline 98 121 public \par or \par module variable& 99 \textbf{m n} \par \textit{but not } \par \textbf{nn\_}& 100 \textbf{a b e f g h o} \textbf{q} \textit{to} \textbf{x} \par but not \par \textbf{fs rn\_}& 101 \textbf{l} \par \textit{but not} \par \textbf{lp ld ll ln\_}& 102 \textbf{c} \par \textit{but not} \par \textbf{cp cd cl cn\_}& 103 \textbf{d} \par \textit{but not} \par \textbf{dp dd dl dn\_}& 104 \textbf{y} \par \textit{but not} \par \textbf{yp yd yl} \\ 122 \textbf{m n} \par \textit{but not} \par \textbf{nn\_}& 123 \textbf{a b e f g h o q r} \par \textbf{t} \textit{to} \textbf{x} \par but not \par \textbf{fs rn\_}& 124 \textbf{l} \par \textit{but not} \par \textbf{lp ld} \par \textbf{ ll ln\_}& 125 \textbf{c} \par \textit{but not} \par \textbf{cp cd} \par \textbf{cl cn\_}& 126 \textbf{s} \par \textit{but not} \par \textbf{sd sd} \par \textbf{sl sn\_}& 127 \textbf{d} \par \textit{but not} \par \textbf{dp dd} \par \textbf{dl dn\_}& 128 \textbf{y} \par \textit{but not} \par \textbf{yp yd} \par \textbf{yl yn} \\ 105 129 \hline 106 130 dummy \par argument& 107 131 \textbf{k} \par \textit{but not} \par \textbf{kf}& 108 \textbf{p} \par \textit{but not} 132 \textbf{p} \par \textit{but not} \par \textbf{pp pf}& 109 133 \textbf{ld}& 110 134 \textbf{cd}& 135 \textbf{sd}& 111 136 \textbf{dd}& 112 137 \textbf{yd} \\ … … 117 142 \textbf{ll}& 118 143 \textbf{cl}& 119 \textbf{cd}& 144 \textbf{sl}& 145 \textbf{dl}& 120 146 \textbf{yl} \\ 121 147 \hline 122 148 loop \par control& 123 \textbf{j} \par \textit{but not 149 \textbf{j} \par \textit{but not} \par \textbf{jp}& 124 150 & 125 151 & 152 & 126 153 & 127 154 & … … 133 160 \textbf{lp}& 134 161 \textbf{cp}& 162 \textbf{sp}& 135 163 \textbf{dp}& 136 164 \textbf{yp} \\ … … 142 170 \textbf{ln\_}& 143 171 \textbf{cn\_}& 172 \textbf{sn\_}& 144 173 \textbf{dn\_}& 174 \textbf{yn\_} 145 175 \\ 146 176 \hline 147 177 CPP \par macro& 148 178 \textbf{kf}& 149 \textbf{ sf} \par &179 \textbf{fs} \par & 150 180 & 181 & 151 182 & 152 183 &
Note: See TracChangeset
for help on using the changeset viewer.