Changeset 11433 for NEMO/trunk/doc/latex/global
- Timestamp:
- 2019-08-12T21:44:18+02:00 (5 years ago)
- Location:
- NEMO/trunk/doc/latex/global
- Files:
-
- 1 added
- 10 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 49 2 \chapter{Coding Rules} 50 3 \label{apdx:coding} … … 60 13 produces fewer bugs and is easier to maintain. 61 14 Therefore, 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} 74 23 75 24 To satisfy part of these aims, \NEMO is written with a coding standard which is close to the ECMWF rules, 76 25 named DOCTOR \citep{gibson_rpt86}. 77 26 These rules present some advantages like: 78 79 -to provide a well presented program80 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} 83 32 84 33 This facilitates both the understanding and the debugging of an algorithm. … … 86 35 \section{Introduction} 87 36 88 This document describes conventions \index{conventions} used inNEMO 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 of37 This document describes conventions used in \NEMO coding and suggested for its development. 38 The objectives are to offer a guide to all readers of the \NEMO code, and to facilitate the work of 90 39 all the developers, including the validation of their developments, and 91 eventually the implementation of these developments within the NEMO platform.40 eventually the implementation of these developments within the \NEMO platform. 92 41 93 42 A first approach of these rules can be found in the code in \path{./src/OCE/module_example} where … … 98 47 \footnote {\href{http://www.cesm.ucar.edu/working_groups/Software/dev_guide/dev_guide/node7.html}{UCAR conventions}}, 99 48 the previous version of this document (``FORTRAN coding standard in the OPA System'') and 100 the expertise of the NEMO System Team.49 the expertise of the \NEMO System Team. 101 50 After a general overview below, this document will describe: 102 51 103 52 \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. 111 57 \end{itemize} 112 58 113 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%114 59 \section{Overview and general conventions} 115 60 116 NEMO has 3 major components: ocean dynamics (\path{./src/OCE}), sea-ice (\path{./src/ICE}) and61 \NEMO has 3 major components: ocean dynamics (\path{./src/OCE}), sea-ice (\path{./src/ICE}) and 117 62 marine biogeochemistry (\path{./src/MBG}). 118 63 %, linear-tangent and adjoint of the dynamics ($TAM$) each of them corresponding to a directory. … … 126 71 See \path{.src/OCE/DOM/phycst.F90} files for conversions. 127 72 128 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%129 73 \section{Architecture} 130 74 131 Within each directory, organisation of files is driven by orthogonality \index{orthogonality},75 Within each directory, organisation of files is driven by orthogonality, 132 76 $i.e.$ one functionality of the code is intended to be in one and only one directory, and 133 77 one module and all its related routines are in one file. 134 The functional modules \index{module}are:78 The functional modules are: 135 79 136 80 \begin{itemize} 137 \item \path{SBC} surface module138 \item \path{IOM} management of the I/O139 \item \path{NST} interface to AGRIF (nesting model) for dynamics and biogeochemistry140 \item \path{OBC}, \path{BDY} management of structured and unstructured open boundaries141 \item \path{C1D} 1D (vertical) configuration for dynamics, sea-ice and biogeochemistry142 \item \path{OFF} off-line module: passive tracer or biogeochemistry alone143 \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{...} 144 88 \end{itemize} 145 89 … … 147 91 this module (\texttt{dom\_init, dom\_nam, dom\_ctl}). 148 92 149 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%150 93 \section{Style rules} 151 94 152 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%153 95 \subsection{Argument list format} 154 96 155 Routine argument lists will contain a maximum 5 variables \index{variable}per line,97 Routine argument lists will contain a maximum 5 variables per line, 156 98 whilst continuation lines can be used. 157 99 This applies both to the calling routine and the dummy argument list in the routine being called. … … 164 106 \end{forlines} 165 107 166 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%167 108 \subsection{Array syntax} 168 109 … … 198 139 \end{forlines} 199 140 200 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%201 141 \subsection{Case} 202 142 203 143 All 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 207 146 \subsection{Comments} 208 147 … … 248 187 \end{enumerate} 249 188 250 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%251 189 \subsection{Continuation lines} 252 190 … … 265 203 use a ``\&'' as first character of the continuing lines to maintain the alignment. 266 204 267 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%268 205 \subsection{Declaration of arguments and local variables} 269 206 … … 277 214 \end{forlines} 278 215 279 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%280 216 \subsection{F90 Standard} 281 217 282 NEMO software adheres to the FORTRAN 95language standard and does not rely on any specific language or218 \NEMO software adheres to the \fninety language standard and does not rely on any specific language or 283 219 vendor extensions. 284 220 285 286 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%287 221 \subsection{Free-Form Source} 288 222 … … 292 226 Multi-line comments that extend to column 100 are unacceptable. 293 227 294 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%295 228 \subsection{Indentation} 296 229 … … 310 243 \end{forlines} 311 244 312 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%313 245 \subsection{Loops} 314 246 … … 317 249 In the case of a long loop, a self-descriptive label can be used ($i.e.$ not just a number). 318 250 319 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%320 251 \subsection{Naming Conventions: files} 321 252 … … 331 262 } 332 263 333 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%334 264 \subsection{Naming Conventions: modules} 335 265 … … 338 268 For example, zdftke, where ``zdf'' stands for vertical diffusion, and ``tke'' for turbulent kinetic energy. \\ 339 269 Note 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 inNEMO is strongly discouraged.270 The use of common blocks is deprecated in \fortran 90 and their use in \NEMO is strongly discouraged. 341 271 Modules are a better way to declare static data. 342 272 Among the advantages of modules is the ability to freely mix data of various types, and 343 273 to limit access to contained variables through the use of the \forcode{ONLY} and \forcode{PRIVATE} attributes. 344 274 345 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%346 275 \subsection{Naming Conventions: variables} 347 276 348 277 All variable should be named as explicitly as possible in English. 349 278 The naming convention concerns prefix letters of these name, in order to identify the variable type and status. \\ 350 Never use a FORTRANkeyword as a routine or variable name. \\279 Never use a \fortran keyword as a routine or variable name. \\ 351 280 The table below lists the starting letter(s) to be used for variable naming, depending on their type and status: 352 281 %--------------------------------------------------TABLE-------------------------------------------------- … … 355 284 \begin{tabular}{|p{50pt}|p{50pt}|p{50pt}|p{50pt}|p{50pt}|p{50pt}|p{50pt}|} 356 285 \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 \\ 372 349 \hline 373 350 \end{tabular} … … 377 354 %-------------------------------------------------------------------------------------------------------------- 378 355 379 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%380 356 \subsection{Operators} 381 357 … … 385 361 In general use the notation: \\ 386 362 $<Blank><Operator><Blank>$ 387 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 363 388 364 \subsection{Pre processor} 389 365 … … 412 388 Is to be used rather than the \#ifdef abbreviate form since it may have conflicts with some Unix scripts. 413 389 414 Tests on cpp keys included in NEMO at compilation step:390 Tests on cpp keys included in \NEMO at compilation step: 415 391 416 392 \begin{itemize} … … 421 397 If a change occurs in the CPP keys used for a given experiment, the whole compilation phase is done again. 422 398 \end{itemize} 423 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 399 424 400 \section{Content rules} 425 401 426 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%427 402 \subsection{Configurations} 428 403 429 The configuration defines the domain and the grid on which NEMO is running.430 It may be useful to associate a cppkey and some variables to a given configuration, although404 The configuration defines the domain and the grid on which \NEMO is running. 405 It may be useful to associate a CPP key and some variables to a given configuration, although 431 406 the part of the code changed under each of those keys should be minimized. 432 407 As an example, the "ORCA2" configuration (global ocean, 2 degrees grid size) is associated with … … 438 413 \end{forlines} 439 414 440 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%441 415 \subsection{Constants} 442 416 443 Physical constants ($e.g.$ $\pi$, gas constants) must never be hard wired into the executable portion of a code.417 Physical constants ($e.g.$ $\pi$, gas constants) must never be hard-wired into the executable portion of a code. 444 418 Instead, a mnemonically named variable or parameter should be set to the appropriate value, 445 in the setup routine for the package \index{package}.419 in the setup routine for the package. 446 420 We realize than many parameterizations rely on empirically derived constants or fudge factors, 447 421 which are not easy to name. … … 450 424 Hard-coded numbers should never be passed through argument lists. 451 425 452 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%453 426 \subsection{Declaration for variables and constants} 454 427 … … 512 485 improve control of variables in routine calls. 513 486 514 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%515 487 \subsection{Headers} 516 488 517 Prologues are not used in NEMO for now, although it may become an interesting tool in combination with489 Prologues are not used in \NEMO for now, although it may become an interesting tool in combination with 518 490 ProTeX auto documentation script in the future. 519 491 Rules to code the headers and layout of a module or a routine are illustrated in the example module available with 520 492 the code: \path{./src/OCE/module_example} 521 493 522 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%523 494 \subsection{Interface blocks} 524 495 … … 528 499 FORTRAN 95 compilers can automatically provide explicit interface blocks for routines contained in a module. 529 500 530 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%531 501 \subsection{I/O Error Conditions} 532 502 … … 536 506 a negative value means the end of record or end of file was encountered. 537 507 538 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%539 508 \subsection{PRINT - ASCII output files} 540 509 … … 551 520 \end{forlines} 552 521 553 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%554 522 \subsection{Precision} 555 523 … … 570 538 \end{forlines} 571 539 572 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%573 540 \subsection{Structures} 574 541 575 The \forcode{TYPE} structure allowing to declare some variables is more often used in NEMO,542 The \forcode{TYPE} structure allowing to declare some variables is more often used in \NEMO, 576 543 especially in the modules dealing with reading fields, or interfaces. 577 544 For example: … … 592 559 Missing rule on structure name?? 593 560 594 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%595 561 \section{Packages coding rules} 596 562 597 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%598 563 \subsection{Bounds checking} 599 564 600 NEMO is able to run when an array bounds checking option is enabled565 \NEMO is able to run when an array bounds checking option is enabled 601 566 (provided the cpp key \texttt{key\_vectopt\_loop} is not defined). \\ 602 567 Thus, constructs of the following form are disallowed: … … 610 575 it effectively disables array bounds checking. 611 576 612 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%613 577 \subsection{Communication} 614 578 … … 624 588 } 625 589 626 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%627 590 \subsection{Error conditions} 628 591 … … 634 597 see \textit{stpctl.F90}. 635 598 636 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%637 599 \subsection{Memory management} 638 600 639 601 The 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.602 As of version 3.3.1 of \NEMO, the use of static arrays (size fixed at compile time) has been deprecated. 641 603 All module arrays are now declared \forcode{ALLOCATABLE} and 642 604 allocated in either the \texttt{<module\_name>\_alloc()} or \texttt{<module\_name>\_init()} routines. … … 644 606 the \texttt{stat=<integer\ variable>} optional argument. \\ 645 607 646 In addition to arrays contained within modules, many routines in NEMO require local, ``workspace'' arrays to608 In addition to arrays contained within modules, many routines in \NEMO require local, ``workspace'' arrays to 647 609 hold the intermediate results of calculations. 648 In previous versions of NEMO, these arrays were declared in such a way as to be automatically allocated on610 In previous versions of \NEMO, these arrays were declared in such a way as to be automatically allocated on 649 611 the stack when the routine was called. 650 612 An example of an automatic array is: … … 735 697 It is then associated with a sub-array of \texttt{wrk\_3d\_5} once the call to 736 698 \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 of699 Note that in F95 (to which \NEMO conforms) it is not possible for either the upper or lower array bounds of 738 700 the pointer object to differ from those of the target array. \\ 739 701 … … 748 710 This should enable the developer to choose alternatives for use in the subroutine being worked on. \\ 749 711 750 When compiling NEMO for production runs,712 When compiling \NEMO for production runs, 751 713 the calls to {\texttt{wrk\_in\_use()} / \texttt{wrk\_not\_released()} can be reduced to stubs that just 752 714 return \forcode{.false.} by setting the cpp key \texttt{key\_no\_workspace\_check}. 753 These stubs may then be in lined (and thus effectively removed altogether) by setting appropriate compiler flags715 These stubs may then be in-lined (and thus effectively removed altogether) by setting appropriate compiler flags 754 716 ($e.g.$ ``-finline'' for the Intel compiler or ``-Q'' for the IBM compiler). 755 717 756 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%757 718 \subsection{Optimisation} 758 719 759 720 Considering 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.721 In \NEMO, portability is a priority, before any too specific optimisation. 761 722 762 723 Some tools are available to help: for vector computers, \texttt{key\_vectopt\_loop} allows to unroll a loop 763 724 764 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%765 725 \subsection{Package attribute: \forcode{PRIVATE}, \forcode{PUBLIC}, \forcode{USE}, \forcode{ONLY}} 766 726 … … 770 730 defined in a module are to be made available to the using routine. 771 731 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 776 735 ($i.e.$ activating the cpp key $key\_mpp\_mpi$). 777 The domain decomposition divides the global domain in cubes (see NEMO reference manual).736 The domain decomposition divides the global domain in cubes (see \NEMO reference manual). 778 737 Whilst coding a new development, the MPI compatibility has to be taken in account 779 738 (see \path{./src/LBC/lib_mpp.F90}) and should be tested. 780 739 By 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 sub domains in latitude and longitude in740 However, this may be overriden by specifying the number of sub-domains in latitude and longitude in 782 741 the \texttt{nammpp} section of the namelist file. 783 742 784 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%785 743 \section{Features to be avoided} 786 744 … … 804 762 \forcode{SELECT CASE} construct instead) 805 763 \item 806 Label ed \forcode{DO} construct807 (use unlabel ed \forcode{END DO} instead)764 Labelled \forcode{DO} construct 765 (use unlabelled \forcode{END DO} instead) 808 766 \item 809 767 \forcode{FORMAT} statement … … 817 775 \forcode{PAUSE} 818 776 \item 819 \forcode{ENTRY} statement: a sub program must only have one entry point.777 \forcode{ENTRY} statement: a sub-program must only have one entry point. 820 778 \item 821 779 \forcode{RETURN} is obsolete and so not necessary at the end of program units … … 837 795 \end{itemize} 838 796 839 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%840 841 % \printindex842 % \input NEMO_coding.conv.ind843 844 %\end{document} -
NEMO/trunk/doc/latex/global/document.tex
r11299 r11433 5 5 6 6 %% NEMO release version 7 \def \version{ 4.0rc~}7 \def \version{trunk} 8 8 9 9 %% Preamble … … 11 11 12 12 %% Document layout 13 \documentclass[ draft]{scrreprt}13 \documentclass[twoside = semi, abstract = on]{scrreprt} 14 14 15 %% Load the configuration of the manual 16 \input{../main/definitions} 17 18 %% Load global *.tex files 15 %% Load configurations 19 16 \input{../../global/preamble} 20 17 21 18 \dominitoc 22 23 %% Launch the creation of the indexes24 \input{../../global/indexes}25 26 19 27 20 %% End of common preamble between main and sub-files … … 42 35 %% ============================================================================== 43 36 37 %% Disable page numbering temporarily 44 38 \pagenumbering{gobble} 45 39 46 40 %% Title page 47 \input{../../global/frontpage} 41 %\input{../../global/frontpage} 42 \input{../../global/frontpage_new} 48 43 49 \maketitle50 \emptythanks44 %\maketitle 45 %\emptythanks 51 46 52 47 %% Information page (2nd page) 53 48 \input{../../global/info_page} 54 49 50 %% Headings for introductory parts (no header, simple footer) 51 \ofoot{\engine\ Reference Manual}\ifoot{\pagemark} 52 \pagenumbering{roman} 53 55 54 %% Foreword 56 %\frontmatter %% Chapter numbering off and Roman numerals for page numbers 57 \pagenumbering{roman} 58 \input{foreword} 55 %\input{foreword} 59 56 60 57 %% Table of Contents 61 58 \tableofcontents 62 \listoffigures63 \listoftables64 \listoflistings59 %\listoffigures 60 %\listoftables 61 %\listoflistings 65 62 66 63 \clearpage 67 %\end{document}68 64 69 65 … … 71 67 %% ============================================================================== 72 68 73 %\mainmatter %% Chapter numbering on, page numbering is reset with Arabic numerals 69 %% Headings for document body 70 \lohead{Chap.\ \thechapter\ \leftmark}\rehead{Sect.\ \thesection\ \rightmark} 71 \ifoot{Page\ \pagemark\ of \pageref*{LastPage}} 74 72 \pagenumbering{arabic} 75 73 … … 81 79 82 80 %% Chapter numbering is reset with letters now 83 \appendix 81 \appendix 84 82 85 83 \include{appendices} … … 110 108 111 109 \end{document} 112 -
NEMO/trunk/doc/latex/global/frontpage.tex
r11176 r11433 1 1 2 2 \title{\heading} 3 \author{\firstauthor \and \secondauthor\thanks{\protect\input{thanks}}}4 3 \date{\today} 4 \author{\protect\input{thanks}} 5 5 6 6 \pretitle{ 7 7 \begin{center} 8 \begin{figure}[H]9 \begin{minipage}[c]{0.35\textwidth}10 \href{http://www.nemo-ocean.eu}{\includegraphics[width=0.7\textwidth]{logos/NEMO_grey}}11 \end{minipage}12 \hfill13 \begin{minipage}[c]{0.65\textwidth}14 \centering15 \large{\em{{N}ucleus for {E}uropean {M}odelling of the {O}cean}}16 \end{minipage}17 \end{figure}18 \vfill8 \begin{figure}[H] 9 \begin{minipage}[c]{0.35\textwidth} 10 \href{http://www.nemo-ocean.eu}{\includegraphics[width=0.7\textwidth]{logos/NEMO_grey}} 11 \end{minipage} 12 \hfill 13 \begin{minipage}[c]{0.65\textwidth} 14 \centering 15 \large{\em{{N}ucleus for {E}uropean {M}odelling of the {O}cean}} 16 \end{minipage} 17 \end{figure} 18 \vfill 19 19 \Huge 20 20 } 21 \posttitle{\par\end{center}\vskip 0.5em} 22 \preauthor{\begin{center}\Large\lineskip0.5em\begin{tabular}[t]{c}} 23 \postauthor{\end{tabular}\par\end{center}} 21 \posttitle{ 22 \par 23 \end{center} 24 \vskip 0.5em 25 } 24 26 \predate{ 25 27 \vfill … … 46 48 } 47 49 50 \preauthor{ 51 \begin{center} 52 \Large 53 \lineskip 0.5em 54 \begin{tabular}[t]{c c c} 55 } 56 \postauthor{ 57 \end{tabular} 58 \par 59 \end{center} 60 } 61 48 62 \thanksmarkseries{fnsymbol} 49 -
NEMO/trunk/doc/latex/global/indexes.tex
r11212 r11433 8 8 \newcommand{\key}[1]{\index[keys]{#1} \texttt{\textbf{key\_#1}}} 9 9 \newcommand{\mdl}[1]{\index[modules]{#1} \textit{#1.F90} } 10 \newcommand{\n gn}[1]{\index[blocks]{#1} \texttt{#1}}10 \newcommand{\nam}[1]{\index[blocks]{#1} \texttt{nam#1} } 11 11 \newcommand{\np}[1]{ \index[parameters]{#1} \texttt{#1} } 12 12 \newcommand{\rou}[1]{\index[subroutines]{#1} \texttt{#1} } … … 14 14 \indexsetup{toclevel=section, othercode=\small} 15 15 16 \makeindex[intoc=true, name=keys , title=CPP keys ] 17 \makeindex[intoc=true, name=modules , title=Modules ] 18 \makeindex[intoc=true, name=blocks , title=Namelist blocks ] 19 \makeindex[intoc=true, name=parameters , title=Namelist parameters, columns=3] 20 \makeindex[intoc=true, name=subroutines, title=Subroutines ] 21 22 23 %% Load hyperref at the end of the preamble to make it work with other pkgs 24 \usepackage{hyperref} %% hyper 25 \hypersetup{ 26 % pdftitle={\heading}, 27 % pdfauthor={\firstauthor and \secondauthor}, 28 colorlinks, 29 citecolor=olive, 30 linkcolor=blue, 31 urlcolor=gray 32 } 16 \makeindex[intoc=true, name=keys , title=CPP keys ({\em key\_ } prefix) ] 17 \makeindex[intoc=true, name=modules , title=\fortran modules ] 18 \makeindex[intoc=true, name=blocks , title=Namelist blocks ({\em nam } prefix), columns=3] 19 \makeindex[intoc=true, name=parameters , title=Namelist parameters ({\em [cdlnr]n\_} ), columns=3] 20 \makeindex[intoc=true, name=subroutines, title=Subroutines ] -
NEMO/trunk/doc/latex/global/info_page.tex
r11176 r11433 8 8 9 9 Like all components of the modelling framework, 10 the \engine ~core engine is developed under the \href{http://www.cecill.info}{CECILL license},11 which is a French adaptation of the GNU GPL ( General Public License).10 the \engine\ core engine is developed under the \href{http://www.cecill.info}{CECILL license}, 11 which is a French adaptation of the GNU GPL (\textbf{G}eneral \textbf{P}ublic \textbf{L}icense). 12 12 Anyone may use it freely for research purposes, and is encouraged to 13 communicate back to the NEMOteam its own developments and improvements.13 communicate back to the \NEMO\ team its own developments and improvements. 14 14 15 15 The model and the present document have been made available as a service to the community. … … 27 27 Additional information can be found on: 28 28 \begin{itemize} 29 \item the \href{http://www.nemo-ocean.eu}{website} of the project detailing several29 \item \faWordpress\ the \href{http://www.nemo-ocean.eu}{website} of the project detailing several 30 30 associated applications and an exhaustive users bibliography 31 \item the \href{http://forge.ipsl.jussieu.fr/nemo}{development platform} of the model with 32 the code repository and some main resources (wiki, ticket system, forums, \ldots) 33 \item the \href{http://zenodo.org/communities/nemo-ocean}{online archive} 34 delivering the publications issued by the consortium 35 \item two mailing lists: 31 \item \faCodeFork\ the \href{http://forge.ipsl.jussieu.fr/nemo}{development platform} of 32 the model with the code repository for the shared reference and some main resources 33 (wiki, ticket system, forums, \ldots) \\ 34 \faGithub\ the \href{http://github.com/NEMO-ocean/NEMO-examples} 35 {repository of the demonstration cases} for research or training 36 \item \faCloudDownload\ the \href{http://zenodo.org/communities/nemo-ocean}{online archive} 37 delivering the publications issued by the consortium (manuals, reports, datasets, \ldots) 38 \item \faEnvelope\ two mailing lists: 36 39 the \href{http://listes.ipsl.fr/sympa/info/nemo-newsletter}{newsletter} for 37 40 top-down communications from the project … … 48 51 Reference for papers and other publications is as follows: 49 52 50 \vspace{0.5cm} 51 52 %% \sloppy: workaround for breaking DOI URL 53 \sloppy 54 ``{\bfseries \heading}'', 55 \firstauthor and \secondauthor, 56 {\em Scientific Notes of Climate Modelling Center}, \textbf{\ipslnum} --- ISSN 1288-1619, 57 Institut Pierre-Simon Laplace (IPSL), 53 ``{\bfseries \heading}'', 54 %\firstauthor and \secondauthor, 55 {\em Scientific Notes of Climate Modelling Center}, \textbf{\ipslnum} --- ISSN 1288-1619, 56 Institut Pierre-Simon Laplace (IPSL), 58 57 \href{https://doi.org/10.5281/zenodo.\zid}{doi:10.5281/zenodo.\zid} 59 58 60 59 \begin{figure}[b] 61 \begin{minipage}[c]{0.72\textwidth} 62 \small\ttfamily{Scientific Notes of Climate Modelling Center \\ 63 ISSN 1288-1619 \\ 60 \begin{minipage}[c]{0.7\textwidth} 61 \small 62 \ttfamily{ 63 Scientific Notes of Climate Modelling Center \\ 64 ISSN 1288-1619 \\ 64 65 Institut Pierre-Simon Laplace (IPSL) 65 66 } … … 71 72 \end{figure} 72 73 74 \end{document} -
NEMO/trunk/doc/latex/global/latexmkrc
r11212 r11433 10 10 ## Custom cmds 11 11 $makeindex = 'makeindex -s %R.ist %O -o %D %S'; 12 $pdflatex = 'pdflatex -shell-escape %O %S'; 12 #$pdflatex = 'pdflatex -shell-escape %O %S'; 13 $pdflatex = 'xelatex -shell-escape %O %S'; 13 14 14 15 #@BIBINPUTS=('.', '../main'); 15 16 #$bibtex = 'bibtex %O ../main/bibliography.bib'; 16 17 #$kpsewhich = 'kpsewhich bibliography.bib' 17 -
NEMO/trunk/doc/latex/global/new_cmds.tex
r11212 r11433 2 2 %% ============================================================================== 3 3 4 %% Include references and index for compilation of single subfile 4 %% Include references and index for compilation of single subfile 5 5 \newcommand{\mtoc}{\minitoc} 6 \newcommand{\biblio}{ \bibliography{../main/bibliography}}6 \newcommand{\biblio}{ \bibliography{../main/bibliography} } 7 7 \newcommand{\pindex}{\printindex} 8 8 9 9 %% NEMO and Fortran in small capitals 10 \newcommand{\NEMO}{\textsc{nemo}~} 11 \newcommand{\fortran}{\textsc{Fortran}~} 12 \newcommand{\fninety}{\textsc{Fortran 90}~} 10 \newcommand{\NEMO }{\textsc{nemo}} 11 \newcommand{\SIcube }{\textsc{si$^3$}} 12 \newcommand{\TOP }{\textsc{top}} 13 \newcommand{\fortran}{\textsc{Fortran}} 14 \newcommand{\fninety}{\textsc{Fortran 90}} 13 15 14 16 %% Common aliases … … 18 20 \newcommand{\ztilde}{\ensuremath{\tilde z}} 19 21 \newcommand{\stilde}{\ensuremath{\tilde s}} 20 \newcommand{\ie}{\ensuremath{i.e.} ~}21 \newcommand{\eg}{\ensuremath{e.g.} ~}22 \newcommand{\ie}{\ensuremath{i.e.}} 23 \newcommand{\eg}{\ensuremath{e.g.}} 22 24 23 25 %% Inline maths … … 25 27 \newcommand{\rdt}{\Delta t} 26 28 27 %% Text env. for Gurvan29 %% Gurvan's comments 28 30 \newcommand{\gmcomment}[1]{} 29 31 … … 31 33 \newcommand{\lt}{\left} 32 34 \newcommand{\rt}{\right} 33 \newcommand{\vect}[1]{\ensuremath{ \mathbf{#1}}}35 \newcommand{\vect}[1]{\ensuremath{ \mathbf{#1} }} 34 36 \newcommand{\pd}[2][]{\ensuremath{\frac{\partial #1}{\partial #2}}} 35 37 38 %% Convert chapter/section headings to lowercase 39 \renewcommand{\chaptermark}[1]{\markboth{#1}{}} 40 \renewcommand{\sectionmark}[1]{\markright{#1}{}} 41 42 %% Retrieve month name 43 \renewcommand{\today}{ 44 \ifcase \month\or January\or February\or March\or 45 April\or May\or June\or 46 July\or August\or September\or 47 October\or November\or December 48 \fi, \number \year 49 } 50 51 %% Macro for link to orcid profile 52 \newcommand{\orcid}[1]{ \href{http://orcid.org/#1}{\textcolor{orcidcolor} \aiOrcidSquare} } 53 36 54 %% Workaround for issue with \listoffigures 37 \DeclareRobustCommand{\triad}[6][]{\ensuremath{ {}_{#2}^{#3}{\mathbb{#4}_{#1}}_{#5}^{\,#6}}}55 \DeclareRobustCommand{\triad}[6][]{\ensuremath{ {}_{#2}^{#3} { \mathbb{#4}_{#1} }_{#5}^{\,#6} }} -
NEMO/trunk/doc/latex/global/packages.tex
r11189 r11433 3 3 %% ============================================================================== 4 4 5 \usepackage{natbib} %% bib 6 \usepackage{caption} %% caption 7 \usepackage{xcolor} %% color 8 \usepackage{times} %% font 9 \usepackage{enumitem} %% list 10 \usepackage{amsmath} %% maths 11 %\usepackage{fancyhdr} %% page 12 \usepackage{minitoc} %% toc 13 \usepackage{subfiles} %% subdocs 14 \usepackage{draftwatermark} %% watermark 15 \usepackage{titling} %% titlepage 5 %% 'hyperref' pkg is loaded at the end of the preamble 6 \usepackage{natbib} %% bibtex 7 \usepackage{caption} %% caption 8 \usepackage{xcolor} %% colour 9 \usepackage{times} %% font 10 \usepackage{enumitem} %% list 11 \usepackage{amsmath} %% maths 12 \usepackage{minitoc} %% toc 13 \usepackage{subfiles} %% subdocs 14 \usepackage{draftwatermark} %% watermark 15 \usepackage[Bjornstrup]{fncychap} %% headings 16 \usepackage{fontspec} 17 %\setmainfont[Ligatures=TeX]{Georgia} 18 %\setsansfont[Ligatures=TeX]{Arial} 19 \defaultfontfeatures{ 20 Path = /home/ntmlod/.local/texlive2019/texmf-dist/fonts/opentype/public/fontawesome/ 21 } 22 \usepackage{academicons} %% font 23 \usepackage{fontawesome} %% font 24 \usepackage{lastpage} %% label 25 \usepackage[pages = some]{background} %% decoration 26 \usepackage{geometry} %% margin 16 27 17 28 %% Extensions in bundle package 18 29 \usepackage{amssymb, graphicx, tabularx, textcomp} 19 \usepackage[utf8]{inputenc} %% input encoding 30 %\usepackage[utf8]{inputenc} %% encoding 31 \usepackage[footsepline=0.25pt, 32 headsepline=0.25pt]{scrlayer-scrpage} %% page layout 20 33 21 34 %% Configuration 22 35 \graphicspath{ {../../figures/} {../../figures/\engine/} } 23 %\captionsetup{margin=10pt, font={small}, labelsep=colon, labelfont={bf}} 24 \renewcommand{\bibfont}{\small} 25 %\renewcommand{\bibsep}{3pt} 26 36 \geometry{showframe} -
NEMO/trunk/doc/latex/global/preamble.tex
r11187 r11433 1 1 2 %% Specific configuration 3 \input{../main/definitions} 4 5 %% Global configuration 2 6 \input{../../global/packages} 3 7 \input{../../global/highlighting} 8 \input{../../global/indexes} 9 \input{../../global/styles} 10 \backgroundsetup{ 11 firstpage = true, 12 scale = 1, angle = 0, opacity = 1, 13 contents = { 14 \begin{tikzpicture}[remember picture, overlay] 15 \path [fill = manualcolor] (-0.5\paperwidth, 7) rectangle (0.5\paperwidth, 10); 16 \end{tikzpicture} 17 } 18 } 4 19 \input{../../global/new_cmds} 5 \input{../../global/styles}6 20 %\input{../../global/todonotes} 7 21 22 %% Load hyperref at the end of the preamble to make it work with other pkgs 23 \usepackage{hyperref} %% links 24 \hypersetup{ 25 colorlinks, 26 citecolor = manualcolor, linkcolor = manualcolor, urlcolor = manualcolor, 27 final %% Links even with draft building 28 } -
NEMO/trunk/doc/latex/global/styles.tex
r11212 r11433 3 3 %% ============================================================================== 4 4 5 %\pagestyle{fancy} 6 \bibliographystyle{../../global/ametsoc} 7 \renewcommand{\bibpreamble}{\begin{multicols}{2}} 8 \renewcommand{\bibpostamble}{\end{multicols}} 5 \setcolor 6 %\definecolor{ghcolor}{HTML}{000333} 7 \definecolor{orcidcolor}{HTML}{A6CE39} 8 %\definecolor{wpcolor}{HTML}{464646} 9 10 %% Page layout 11 \pagestyle{scrheadings} 12 \addtokomafont{pagehead}{ \sffamily } 13 \addtokomafont{pagefoot}{ \sffamily \footnotesize} 14 \addtokomafont{pagenumber}{\sffamily \slshape } 15 \ohead{} \ofoot{} %% Clear defaults 16 17 %% Caption 18 \captionsetup{font = footnotesize, justification = justified} 9 19 10 20 %% Additional fonts 11 21 \DeclareMathAlphabet{\mathpzc}{OT1}{pzc}{m}{it} 12 22 13 %% Page layout 14 %\fancyhf{} 15 %\fancyhead[LE,RO]{\bfseries\thepage} 16 %\fancyhead[LO]{\bfseries\hspace{-0em}\rightmark} 17 %\renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}} 18 %\fancyhead[RE]{\bfseries\leftmark} 19 %\renewcommand{\chaptermark}[1]{\markboth{#1}{}} 20 %\renewcommand{\headrulewidth}{0.5pt} 21 %\renewcommand{\footrulewidth}{0pt } 22 %\addtolength{\headheight}{2.6pt} 23 23 %% Bibliography 24 \bibliographystyle{../../global/ametsoc} 25 \renewcommand{\bibfont}{\small} 26 \renewcommand{\bibpreamble }{\begin{multicols}{2}} 27 \renewcommand{\bibpostamble}{ \end{multicols} } 24 28 25 29 %% Catcodes 26 %\makeatletter 27 %\def\LigneVerticale{\vrule height 5cm depth 2cm\hspace{0.1cm}\relax} 28 %\def\LignesVerticales{\let\LV\LigneVerticale\LV\LV\LV\LV\LV\LV\LV\LV\LV\LV} 29 %\def\GrosCarreAvecUnChiffre#1{ 30 % \rlap{\vrule height 0.8cm width 1cm depth 0.2cm} 31 % \rlap{\hbox to 1cm{\hss\mbox{\color{white} #1}\hss}} 32 % \vrule height 0pt width 1cm depth 0pt 30 \makeatletter 31 32 %% Prevent error with tikz and namelist inclusion 33 \global\let\tikz@ensure@dollar@catcode=\relax 34 35 %% Apply engine color for chapter boxes (code from fncychap.sty) 36 %\renewcommand{\DOTI}[1]{ 37 % \nointerlineskip\raggedright 38 % \fboxsep=\myhi 39 % \vskip-1ex 40 % \colorbox[manualcolor]{.85}{\parbox[t]{\mylen}{\CTV\FmTi{#1}}}\par\nobreak 41 % \vskip 40\p@ 33 42 %} 34 %\def\@makechapterhead#1{35 % \hbox{36 % \huge\LignesVerticales\hspace{-0.5cm}37 % \GrosCarreAvecUnChiffre{\thechapter}\hspace{0.2cm}38 % \hbox{#1}39 % }40 % \par\vskip41 %1cm42 %}43 %\def\@makeschapterhead#1{44 % \hbox{45 % \huge\LignesVerticales46 % \hbox{#1}47 % }48 % \par\vskip49 %2cm50 %}51 %\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else52 % \hbox{}53 % \vspace*{\fill}54 % \vspace{\fill}55 % \thispagestyle{empty}56 % \newpage57 % \if@twocolumn\hbox{}\newpage\fi\fi\fi}58 %\def\@seccntformat#1{\protect\makebox[0pt][r]{\csname the#1\endcsname\quad}}59 %\makeatother60 43 61 44 \makeatother
Note: See TracChangeset
for help on using the changeset viewer.