- Timestamp:
- 2019-11-26T15:11:43+01:00 (4 years ago)
- Location:
- NEMO/branches/2019/ENHANCE-02_ISF_nemo_TEST_MERGE/doc
- Files:
-
- 3 deleted
- 14 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2019/ENHANCE-02_ISF_nemo_TEST_MERGE/doc
-
Property
svn:externals
set to
^/utils/badges badges
^/utils/logos logos
-
Property
svn:externals
set to
-
NEMO/branches/2019/ENHANCE-02_ISF_nemo_TEST_MERGE/doc/latex
- Property svn:ignore deleted
-
NEMO/branches/2019/ENHANCE-02_ISF_nemo_TEST_MERGE/doc/latex/global
- Property svn:ignore deleted
-
NEMO/branches/2019/ENHANCE-02_ISF_nemo_TEST_MERGE/doc/latex/global/ametsoc.bst
r11128 r11967 9 9 %% *** Bibliography style file for ALL AMS Journals...version 1.0 *** 10 10 %% *** Brian Papa - American Meteorological Society *** 11 %% 11 %% 12 12 %% Copyright 1994-2004 Patrick W Daly 13 13 % =============================================================== … … 519 519 duplicate$ empty$ 'skip$ 520 520 { 521 "\href{http://dx.doi.org/" swap$ * "}{ DOI}" *521 "\href{http://dx.doi.org/" swap$ * "}{\aiDoi}" * 522 522 } 523 523 if$ … … 1192 1192 crossref missing$ 1193 1193 { format.in.ed.booktitle "booktitle" output.check 1194 format.publisher.address output 1194 format.publisher.address output 1195 1195 format.bvolume output 1196 1196 format.number.series output -
NEMO/branches/2019/ENHANCE-02_ISF_nemo_TEST_MERGE/doc/latex/global/annex_D.tex
r11299 r11967 31 31 - flexible. 32 32 33 To satisfy part of these aims, \NEMO is written with a coding standard which is close to the ECMWF rules,33 To satisfy part of these aims, \NEMO\ is written with a coding standard which is close to the ECMWF rules, 34 34 named DOCTOR \citep{gibson_rpt86}. 35 35 These rules present some advantages like: -
NEMO/branches/2019/ENHANCE-02_ISF_nemo_TEST_MERGE/doc/latex/global/coding_rules.tex
r11299 r11967 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 \label{apdx: coding}51 52 \ minitoc3 \label{apdx:CODING} 4 5 \chaptertoc 53 6 54 7 \newpage … … 61 14 Therefore, it is essential that the model development follows some rules: 62 15 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 75 To satisfy part of these aims, \NEMO is written with a coding standard which is close to the ECMWF rules, 76 named DOCTOR \citep{gibson_rpt86}. 16 \begin{itemize} 17 \item well planned and designed 18 \item well written 19 \item well documented (both on- and off-line) 20 \item maintainable 21 \item easily portable 22 \item flexible. 23 \end{itemize} 24 25 To satisfy part of these aims, \NEMO\ is written with a coding standard which is close to the ECMWF rules, 26 named DOCTOR \citep{gibson_rpt86}. 77 27 These rules present some advantages like: 78 28 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. ). 29 \begin{itemize} 30 \item to provide a well presented program 31 \item to use rules for variable names which allow recognition of their type (integer, real, parameter, local or shared variables, etc. ). 32 \end{itemize} 83 33 84 34 This facilitates both the understanding and the debugging of an algorithm. … … 86 36 \section{Introduction} 87 37 88 This document describes conventions \index{conventions} used in NEMOcoding and suggested for its development.89 The objectives are to offer a guide to all readers of the NEMOcode, and to facilitate the work of38 This document describes conventions used in \NEMO\ coding and suggested for its development. 39 The objectives are to offer a guide to all readers of the \NEMO\ code, and to facilitate the work of 90 40 all the developers, including the validation of their developments, and 91 eventually the implementation of these developments within the NEMOplatform.41 eventually the implementation of these developments within the \NEMO\ platform. 92 42 93 43 A first approach of these rules can be found in the code in \path{./src/OCE/module_example} where … … 96 46 97 47 This work is based on the coding conventions in use for the Community Climate System Model 98 \footnote {\href{http://www.cesm.ucar.edu/working_groups/Software/dev_guide/dev_guide/node7.html}{UCAR conventions}}, 48 \footnote {\href{http://www.cesm.ucar.edu/working_groups/Software/dev_guide/dev_guide/node7.html}{UCAR conventions}}, 99 49 the previous version of this document (``FORTRAN coding standard in the OPA System'') and 100 the expertise of the NEMOSystem Team.50 the expertise of the \NEMO\ System Team. 101 51 After a general overview below, this document will describe: 102 52 103 53 \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. 54 \item The style rules, $i.e.$ the syntax, appearance and naming conventions chosen to improve readability of the code; 55 \item The content rules, $i.e.$ the conventions to improve the reliability of the different parts of the code; 56 \item The package rules to go a step further by improving the reliability of the whole and 57 interfaces between routines and modules. 111 58 \end{itemize} 112 59 113 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%114 60 \section{Overview and general conventions} 115 61 116 NEMOhas 3 major components: ocean dynamics (\path{./src/OCE}), sea-ice (\path{./src/ICE}) and62 \NEMO\ has 3 major components: ocean dynamics (\path{./src/OCE}), sea-ice (\path{./src/ICE}) and 117 63 marine biogeochemistry (\path{./src/MBG}). 118 64 %, linear-tangent and adjoint of the dynamics ($TAM$) each of them corresponding to a directory. … … 126 72 See \path{.src/OCE/DOM/phycst.F90} files for conversions. 127 73 128 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%129 74 \section{Architecture} 130 75 131 Within each directory, organisation of files is driven by orthogonality \index{orthogonality},76 Within each directory, organisation of files is driven by orthogonality, 132 77 $i.e.$ one functionality of the code is intended to be in one and only one directory, and 133 78 one module and all its related routines are in one file. 134 The functional modules \index{module}are:79 The functional modules are: 135 80 136 81 \begin{itemize} … … 138 83 \item \path{IOM} management of the I/O 139 84 \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 85 \item \path{OBC}, \path{BDY} management of structured and unstructured open boundaries 141 86 \item \path{C1D} 1D (vertical) configuration for dynamics, sea-ice and biogeochemistry 142 87 \item \path{OFF} off-line module: passive tracer or biogeochemistry alone … … 147 92 this module (\texttt{dom\_init, dom\_nam, dom\_ctl}). 148 93 149 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%150 94 \section{Style rules} 151 95 152 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%153 96 \subsection{Argument list format} 154 97 155 Routine argument lists will contain a maximum 5 variables \index{variable}per line,98 Routine argument lists will contain a maximum 5 variables per line, 156 99 whilst continuation lines can be used. 157 100 This applies both to the calling routine and the dummy argument list in the routine being called. … … 164 107 \end{forlines} 165 108 166 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%167 109 \subsection{Array syntax} 168 110 … … 198 140 \end{forlines} 199 141 200 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%201 142 \subsection{Case} 202 143 203 144 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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 145 \forcode{NAMELIST}, ... All other parts of the \NEMO\ code will be written in lower case. 146 207 147 \subsection{Comments} 208 148 … … 248 188 \end{enumerate} 249 189 250 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%251 190 \subsection{Continuation lines} 252 191 … … 265 204 use a ``\&'' as first character of the continuing lines to maintain the alignment. 266 205 267 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%268 206 \subsection{Declaration of arguments and local variables} 269 207 … … 277 215 \end{forlines} 278 216 279 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%280 217 \subsection{F90 Standard} 281 218 282 NEMO software adheres to the FORTRAN 95language standard and does not rely on any specific language or219 \NEMO\ software adheres to the \fninety language standard and does not rely on any specific language or 283 220 vendor extensions. 284 221 285 286 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%287 222 \subsection{Free-Form Source} 288 223 … … 292 227 Multi-line comments that extend to column 100 are unacceptable. 293 228 294 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%295 229 \subsection{Indentation} 296 230 … … 310 244 \end{forlines} 311 245 312 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%313 246 \subsection{Loops} 314 247 … … 317 250 In the case of a long loop, a self-descriptive label can be used ($i.e.$ not just a number). 318 251 319 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%320 252 \subsection{Naming Conventions: files} 321 253 … … 331 263 } 332 264 333 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%334 265 \subsection{Naming Conventions: modules} 335 266 … … 338 269 For example, zdftke, where ``zdf'' stands for vertical diffusion, and ``tke'' for turbulent kinetic energy. \\ 339 270 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 in NEMOis strongly discouraged.271 The use of common blocks is deprecated in \fortran 90 and their use in \NEMO\ is strongly discouraged. 341 272 Modules are a better way to declare static data. 342 273 Among the advantages of modules is the ability to freely mix data of various types, and 343 274 to limit access to contained variables through the use of the \forcode{ONLY} and \forcode{PRIVATE} attributes. 344 275 345 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%346 276 \subsection{Naming Conventions: variables} 347 277 348 278 All variable should be named as explicitly as possible in English. 349 279 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. \\280 Never use a \fortran keyword as a routine or variable name. \\ 351 281 The table below lists the starting letter(s) to be used for variable naming, depending on their type and status: 352 282 %--------------------------------------------------TABLE-------------------------------------------------- … … 355 285 \begin{tabular}{|p{50pt}|p{50pt}|p{50pt}|p{50pt}|p{50pt}|p{50pt}|p{50pt}|} 356 286 \hline 357 Type \par / Status & integer& real& logical & character& double \par precision& complex \\ 287 Type \par / Status & 288 integer & 289 real & 290 logical & 291 character & 292 double \par precision & 293 complex \\ 358 294 \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} \\ 295 public \par or \par module variable & 296 \textbf{m n} \par \textit{but not} \par \textbf{nn\_} & 297 \textbf{a b e f g h o} \textbf{q} \textit{to} \textbf{x} \par but not \par \textbf{fs rn\_} & 298 \textbf{l} \par \textit{but not} \par \textbf{lp ld ll ln\_} & 299 \textbf{c} \par \textit{but not} \par \textbf{cp cd cl cn\_} & 300 \textbf{d} \par \textit{but not} \par \textbf{dp dd dl dn\_} & 301 \textbf{y} \par \textit{but not} \par \textbf{yp yd yl} \\ 360 302 \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} \\ 303 dummy \par argument & 304 \textbf{k} \par \textit{but not} \par \textbf{kf} & 305 \textbf{p} \par \textit{but not} \par \textbf{pp pf} & 306 \textbf{ld} & 307 \textbf{cd} & 308 \textbf{dd} & 309 \textbf{yd} \\ 362 310 \hline 363 local \par variable& \textbf{i}& \textbf{z}& \textbf{ll}& \textbf{cl}& \textbf{cd}& \textbf{yl} \\ 311 local \par variable & 312 \textbf{i} & 313 \textbf{z} & 314 \textbf{ll} & 315 \textbf{cl} & 316 \textbf{cd} & 317 \textbf{yl} \\ 364 318 \hline 365 loop \par control& \textbf{j} \par \textit{but not } \par \textbf{jp}& & & & & \\ 319 loop \par control & 320 \textbf{j} \par \textit{but not} \par \textbf{jp} & 321 & 322 & 323 & 324 & 325 \\ 366 326 \hline 367 parameter& \textbf{jp}& \textbf{pp}& \textbf{lp}& \textbf{cp}& \textbf{dp}& \textbf{yp} \\ 327 parameter & 328 \textbf{jp} & 329 \textbf{pp} & 330 \textbf{lp} & 331 \textbf{cp} & 332 \textbf{dp} & 333 \textbf{yp} \\ 368 334 \hline 369 namelist& \textbf{nn\_}& \textbf{rn\_}& \textbf{ln\_}& \textbf{cn\_}& \textbf{dn\_}& \\ 335 namelist & 336 \textbf{nn\_} & 337 \textbf{rn\_} & 338 \textbf{ln\_} & 339 \textbf{cn\_} & 340 \textbf{dn\_} & 341 \\ 370 342 \hline 371 CPP \par macro& \textbf{kf}& \textbf{sf} \par & & & & \\ 343 CPP \par macro & 344 \textbf{kf} & 345 \textbf{sf} & 346 & 347 & 348 & 349 \\ 372 350 \hline 373 351 \end{tabular} … … 377 355 %-------------------------------------------------------------------------------------------------------------- 378 356 379 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%380 357 \subsection{Operators} 381 358 … … 385 362 In general use the notation: \\ 386 363 $<Blank><Operator><Blank>$ 387 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 364 388 365 \subsection{Pre processor} 389 366 … … 412 389 Is to be used rather than the \#ifdef abbreviate form since it may have conflicts with some Unix scripts. 413 390 414 Tests on cpp keys included in NEMOat compilation step:391 Tests on cpp keys included in \NEMO\ at compilation step: 415 392 416 393 \begin{itemize} … … 421 398 If a change occurs in the CPP keys used for a given experiment, the whole compilation phase is done again. 422 399 \end{itemize} 423 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 400 424 401 \section{Content rules} 425 402 426 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%427 403 \subsection{Configurations} 428 404 429 The configuration defines the domain and the grid on which NEMOis running.430 It may be useful to associate a cppkey and some variables to a given configuration, although405 The configuration defines the domain and the grid on which \NEMO\ is running. 406 It may be useful to associate a CPP key and some variables to a given configuration, although 431 407 the part of the code changed under each of those keys should be minimized. 432 408 As an example, the "ORCA2" configuration (global ocean, 2 degrees grid size) is associated with … … 438 414 \end{forlines} 439 415 440 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%441 416 \subsection{Constants} 442 417 443 Physical constants ($e.g.$ $\pi$, gas constants) must never be hard wired into the executable portion of a code.418 Physical constants ($e.g.$ $\pi$, gas constants) must never be hard-wired into the executable portion of a code. 444 419 Instead, a mnemonically named variable or parameter should be set to the appropriate value, 445 in the setup routine for the package \index{package}.420 in the setup routine for the package. 446 421 We realize than many parameterizations rely on empirically derived constants or fudge factors, 447 422 which are not easy to name. … … 450 425 Hard-coded numbers should never be passed through argument lists. 451 426 452 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%453 427 \subsection{Declaration for variables and constants} 454 428 … … 512 486 improve control of variables in routine calls. 513 487 514 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%515 488 \subsection{Headers} 516 489 517 Prologues are not used in NEMOfor now, although it may become an interesting tool in combination with490 Prologues are not used in \NEMO\ for now, although it may become an interesting tool in combination with 518 491 ProTeX auto documentation script in the future. 519 492 Rules to code the headers and layout of a module or a routine are illustrated in the example module available with 520 493 the code: \path{./src/OCE/module_example} 521 494 522 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%523 495 \subsection{Interface blocks} 524 496 … … 528 500 FORTRAN 95 compilers can automatically provide explicit interface blocks for routines contained in a module. 529 501 530 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%531 502 \subsection{I/O Error Conditions} 532 503 … … 536 507 a negative value means the end of record or end of file was encountered. 537 508 538 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%539 509 \subsection{PRINT - ASCII output files} 540 510 … … 551 521 \end{forlines} 552 522 553 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%554 523 \subsection{Precision} 555 524 … … 570 539 \end{forlines} 571 540 572 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%573 541 \subsection{Structures} 574 542 575 The \forcode{TYPE} structure allowing to declare some variables is more often used in NEMO,543 The \forcode{TYPE} structure allowing to declare some variables is more often used in \NEMO, 576 544 especially in the modules dealing with reading fields, or interfaces. 577 545 For example: … … 592 560 Missing rule on structure name?? 593 561 594 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%595 562 \section{Packages coding rules} 596 563 597 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%598 564 \subsection{Bounds checking} 599 565 600 NEMOis able to run when an array bounds checking option is enabled566 \NEMO\ is able to run when an array bounds checking option is enabled 601 567 (provided the cpp key \texttt{key\_vectopt\_loop} is not defined). \\ 602 568 Thus, constructs of the following form are disallowed: … … 610 576 it effectively disables array bounds checking. 611 577 612 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%613 578 \subsection{Communication} 614 579 … … 624 589 } 625 590 626 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%627 591 \subsection{Error conditions} 628 592 … … 634 598 see \textit{stpctl.F90}. 635 599 636 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%637 600 \subsection{Memory management} 638 601 639 602 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.603 As of version 3.3.1 of \NEMO, the use of static arrays (size fixed at compile time) has been deprecated. 641 604 All module arrays are now declared \forcode{ALLOCATABLE} and 642 605 allocated in either the \texttt{<module\_name>\_alloc()} or \texttt{<module\_name>\_init()} routines. … … 644 607 the \texttt{stat=<integer\ variable>} optional argument. \\ 645 608 646 In addition to arrays contained within modules, many routines in NEMOrequire local, ``workspace'' arrays to609 In addition to arrays contained within modules, many routines in \NEMO\ require local, ``workspace'' arrays to 647 610 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 on611 In previous versions of \NEMO, these arrays were declared in such a way as to be automatically allocated on 649 612 the stack when the routine was called. 650 613 An example of an automatic array is: … … 735 698 It is then associated with a sub-array of \texttt{wrk\_3d\_5} once the call to 736 699 \texttt{wrk\_in\_use()} has completed successfully. 737 Note that in F95 (to which NEMOconforms) it is not possible for either the upper or lower array bounds of700 Note that in F95 (to which \NEMO\ conforms) it is not possible for either the upper or lower array bounds of 738 701 the pointer object to differ from those of the target array. \\ 739 702 … … 748 711 This should enable the developer to choose alternatives for use in the subroutine being worked on. \\ 749 712 750 When compiling NEMOfor production runs,713 When compiling \NEMO\ for production runs, 751 714 the calls to {\texttt{wrk\_in\_use()} / \texttt{wrk\_not\_released()} can be reduced to stubs that just 752 715 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 flags716 These stubs may then be in-lined (and thus effectively removed altogether) by setting appropriate compiler flags 754 717 ($e.g.$ ``-finline'' for the Intel compiler or ``-Q'' for the IBM compiler). 755 718 756 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%757 719 \subsection{Optimisation} 758 720 759 721 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.722 In \NEMO, portability is a priority, before any too specific optimisation. 761 723 762 724 Some tools are available to help: for vector computers, \texttt{key\_vectopt\_loop} allows to unroll a loop 763 725 764 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%765 726 \subsection{Package attribute: \forcode{PRIVATE}, \forcode{PUBLIC}, \forcode{USE}, \forcode{ONLY}} 766 727 … … 770 731 defined in a module are to be made available to the using routine. 771 732 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 733 \subsection{Parallelism using MPI} 734 735 \NEMO\ is written in order to be able to run on one processor, or on one or more using MPI 776 736 ($i.e.$ activating the cpp key $key\_mpp\_mpi$). 777 The domain decomposition divides the global domain in cubes (see NEMOreference manual).737 The domain decomposition divides the global domain in cubes (see \NEMO\ reference manual). 778 738 Whilst coding a new development, the MPI compatibility has to be taken in account 779 739 (see \path{./src/LBC/lib_mpp.F90}) and should be tested. 780 740 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 in741 However, this may be overriden by specifying the number of sub-domains in latitude and longitude in 782 742 the \texttt{nammpp} section of the namelist file. 783 743 784 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%785 744 \section{Features to be avoided} 786 745 … … 790 749 Below is a list of features to avoid: 791 750 \begin{itemize} 792 \item 793 \forcode{COMMON} block 751 \item \forcode{COMMON} block 794 752 (use the declaration part of \forcode{MODULE} instead) 795 \item 796 \forcode{EQUIVALENCE} 753 \item \forcode{EQUIVALENCE} 797 754 (use \forcode{POINTER} or derived data type instead to form data structure) 798 \item 799 Assigned and computed \forcode{GOTO} 755 \item Assigned and computed \forcode{GOTO} 800 756 (use the \forcode{CASE} construct instead) 801 \item 802 Arithmetic \forcode{IF} statement 757 \item Arithmetic \forcode{IF} statement 803 758 (use the block \forcode{IF}, \forcode{ELSE}, \forcode{ELSEIF}, \forcode{ENDIF} or 804 759 \forcode{SELECT CASE} construct instead) 805 \item 806 Labeled \forcode{DO} construct 807 (use unlabeled \forcode{END DO} instead) 808 \item 809 \forcode{FORMAT} statement 760 \item Labelled \forcode{DO} construct 761 (use unlabelled \forcode{END DO} instead) 762 \item \forcode{FORMAT} statement 810 763 (use character parameters or 811 764 explicit format- specifiers inside the \forcode{READ} or \forcode{WRITE} statement instead) 812 \item 813 \forcode{GOTO} and \forcode{CONTINUE} statements 765 \item \forcode{GOTO} and \forcode{CONTINUE} statements 814 766 (use \forcode{IF}, \forcode{CASE}, \forcode{DO WHILE}, \forcode{EXIT} or \forcode{CYCLE} statements or 815 767 a contained ?) 816 \item 817 \forcode{PAUSE} 818 \item 819 \forcode{ENTRY} statement: a subprogram must only have one entry point. 820 \item 821 \forcode{RETURN} is obsolete and so not necessary at the end of program units 822 \item 823 \forcode{FUNCTION} statement 824 \item 825 Avoid functions with side effects. 768 \item \forcode{PAUSE} 769 \item \forcode{ENTRY} statement: a sub-program must only have one entry point. 770 \item \forcode{RETURN} is obsolete and so not necessary at the end of program units 771 \item \forcode{FUNCTION} statement 772 \item Avoid functions with side effects. 826 773 \footnote{ 827 774 First, the code is easier to understand, if you can rely on … … 832 779 This is especially important on massive parallel and as well on vector machines. 833 780 } 834 \item 835 \forcode{DATA} and \forcode{BLOCK DATA} 781 \item \forcode{DATA} and \forcode{BLOCK DATA} 836 782 (use initialisers) 837 783 \end{itemize} 838 784 839 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 840 841 % \printindex 842 % \input NEMO_coding.conv.ind 843 844 %\end{document} 785 %% Imported from introduction 786 %%gm To be put somewhere else .... 787 %%nm We should consider creating a glossary for all this kind of stuff (terms, acronyms and symbols) 788 %% http://en.wikibooks.org/wiki/LaTeX/Glossary 789 %\noindent CPP keys and namelists are used as inputs to the code. 790 791 %\noindent \index{CPP keys} CPP keys 792 793 %Some CPP keys are implemented in the \fortran code to allow code selection at compiling step. 794 %This selection of code at compilation time reduces the reliability of the whole platform since 795 %it changes the code from one set of CPP keys to the other. 796 %It is used only when the addition/suppression of the part of code highly changes the amount of memory at run time. 797 %Usual coding looks like: 798 799 %\begin{forlines} 800 %#if defined key_option1 801 % ! This part of the \fortran code will be active 802 % ! only if key_option1 is activated at compiling step 803 %#endif 804 %\end{forlines} 805 806 %\noindent \index{Namelist} Namelists 807 808 %The namelist allows to input variables (character, logical, real and integer) into the code. 809 %There is one namelist file for each component of \NEMO\ (dynamics, sea-ice, biogeochemistry...) 810 %containing all the \fortran namelists needed. 811 %The implementation in \NEMO\ uses a 2-step process. 812 %For each \fortran namelist, two files are read: 813 814 %\begin{enumerate} 815 %\item 816 % A reference namelist (in \path{./cfgs/SHARED/namelist_ref}) is read first. 817 % This file contains all the namelist variables which are initialised to default values 818 %\item 819 % A configuration namelist (in \path{./cfgs/CFG_NAME/EXP00/namelist_cfg}) is read aferwards. 820 % This file contains only the namelist variables which are changed from default values, and overwrites those. 821 %\end{enumerate} 822 %A template can be found in \path{NEMO/OPA_SRC/module.example}. 823 %The effective namelist, taken in account during the run, is stored at execution time in 824 %an \texttt{output\_namelist\_dyn} (or \texttt{\_ice} or \texttt{\_top}) file. 825 %%gm end 826 827 %%nm: Add some words on the \NEMO\ dependencies 828 %The model is implemented in \fninety, with preprocessing (C pre-processor). 829 %It runs under UNIX. 830 %It is optimized for vector computers and parallelised by domain decomposition with MPI. 831 %All input and output is done in NetCDF (Network Common Data Format) with a optional direct access format for output. 832 %To ensure the clarity and readability of the code it is necessary to follow coding rules. 833 %The coding rules for OPA include conventions for naming variables, 834 %with different starting letters for different types of variables (real, integer, parameter\ldots). 835 %Those rules are briefly presented in \autoref{apdx:coding} and a more complete document is available . 836 837 %The model is organized with a high internal modularity based on physics. 838 %For example, each trend (\ie, a term in the RHS of the prognostic equation) for momentum and tracers 839 %is computed in a dedicated module. 840 %To make it easier for the user to find his way around the code, the module names follow a three-letter rule. 841 %For example, \mdl{traldf} is a module related to the TRAcers equation, computing the Lateral DiFfussion. 842 %The complete list of module names is presented in \autoref{apdx:coding}. %====>>>> to be done ! 843 %Furthermore, modules are organized in a few directories that correspond to their category, 844 %as indicated by the first three letters of their name (\autoref{tab:chapters}). -
NEMO/branches/2019/ENHANCE-02_ISF_nemo_TEST_MERGE/doc/latex/global/document.tex
r11299 r11967 1 1 2 %% ============================================================================== 3 %% Template structure for reference manual 4 %% ============================================================================== 2 %% ================================================================================================= 3 %% Template structure for reference manuals 4 %% ================================================================================================= 5 5 6 6 %% NEMO release version 7 \def \version{ 4.0rc~}7 \def \version{trunk} 8 8 9 9 %% Preamble 10 %% ============================================================================== 10 %% ================================================================================================= 11 11 12 12 %% Document layout 13 \documentclass[ draft]{scrreprt}13 \documentclass[fontsize = 10pt, twoside, abstract]{scrreprt} 14 14 15 %% Load the configuration of the manual 16 \input{../main/definitions} 17 18 %% Load global *.tex files 19 \input{../../global/preamble} 20 21 \dominitoc 22 23 %% Launch the creation of the indexes 24 \input{../../global/indexes} 25 15 %% Load manual configuration 16 \input{../../global/prologue} 26 17 27 18 %% End of common preamble between main and sub-files 28 19 %% Override custom cmds for full manual compilation 29 \newcommand{\ onlyinsubfile}[1]{#1}30 \newcommand{\ notinsubfile}[1]{}20 \newcommand{\subinc}[1]{#1} 21 \newcommand{\subexc}[1]{} 31 22 32 23 \begin{document} 33 24 34 \renewcommand{\onlyinsubfile}[1]{} 35 \renewcommand{\notinsubfile}[1]{#1} 36 37 \renewcommand{\biblio}{} 38 \renewcommand{\pindex}{} 25 \renewcommand{\subinc}[1]{} 26 \renewcommand{\subexc}[1]{#1} 39 27 40 28 41 29 %% Frontmatter 42 %% ============================================================================== 30 %% ================================================================================================= 43 31 44 \pagenumbering{gobble} 32 \pagenumbering{gobble} %% Disable page numbering temporarily 45 33 46 34 %% Title page 47 35 \input{../../global/frontpage} 48 36 49 \maketitle 50 \ emptythanks37 %% Footer for introductory parts (no header by cleaning default) 38 \ofoot[]{\engine\ Reference Manual} \ifoot[]{\pagemark} 51 39 52 40 %% Information page (2nd page) 53 41 \input{../../global/info_page} 54 42 55 %% Foreword 56 %\frontmatter %% Chapter numbering off and Roman numerals for page numbers 43 \listoffigures 44 \listoflistings 45 \listoftables 46 47 \clearpage 48 57 49 \pagenumbering{roman} 58 \input{foreword} 50 \ofoot[]{\engine\ Reference Manual} \ifoot[]{\pagemark} 51 52 \input{introduction} 59 53 60 54 %% Table of Contents 61 55 \tableofcontents 62 \listoffigures63 \listoftables64 \listoflistings65 56 66 57 \clearpage 67 %\end{document}68 58 69 59 70 60 %% Mainmatter 71 %% ============================================================================== 61 %% ================================================================================================= 72 62 73 % \mainmatter %% Chapter numbering on, page numbering is reset with Arabic numerals63 %% Headings for document body 74 64 \pagenumbering{arabic} 65 \lohead{Chap.\ \thechapter\ \leftmark} \rehead{Sect.\ \thesection\ \rightmark} 66 \ifoot[]{Page\ \pagemark\ of \pageref*{LastPage}} 75 67 76 68 \include{chapters} … … 78 70 79 71 %% Appendix 80 %% ============================================================================== 72 %% ================================================================================================= 81 73 82 %% Chapter numbering is reset with letters now 83 \appendix 84 74 \appendix %% Chapter numbering with letters by now 75 \lohead{Apdx\ \thechapter\ \leftmark} 85 76 \include{appendices} 86 77 … … 90 81 91 82 %% Backmatter 92 %% ============================================================================== 83 %% ================================================================================================= 93 84 94 %\backmatter %% Chapter numbering off 95 96 %% Bibliography 97 \phantomsection 98 \addcontentsline{toc}{chapter}{Bibliography} 99 \bibliography{../main/bibliography} 100 101 %% Index 102 \clearpage 103 \phantomsection 104 \addcontentsline{toc}{chapter}{Indexes} 105 \printindex[keys] 106 \printindex[modules] 107 \printindex[blocks] 108 \printindex[parameters] 109 \printindex[subroutines] 85 %% Bibliography and indexes 86 \input{../../global/epilogue} 110 87 111 88 \end{document} 112 -
NEMO/branches/2019/ENHANCE-02_ISF_nemo_TEST_MERGE/doc/latex/global/frontpage.tex
r11176 r11967 1 1 2 \ title{\heading}3 \author{\firstauthor \and \secondauthor\thanks{\protect\input{thanks}}}4 \date{\today}2 \begin{titlepage} 3 % \newgeometry{hmargin = 1.5cm, vmargin = 3cm} 4 \setlength{\parindent}{0pt} 5 5 6 \pretitle{7 6 \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}} 7 \begin{minipage}{0.3\textwidth} 8 \includegraphics[height=1.5cm]{logos/NEMO_grey} 9 \end{minipage}\begin{minipage}{0.6\textwidth} 10 \begin{center} 11 \Large\slshape 12 \textbf{N}ucleus for \textbf{E}uropean \textbf{M}odelling of the \textbf{O}cean \\ 13 \medskip 14 \hyperref[resources]{\textcolor{black}{ 15 \faWordpress \hspace{0.75cm} \faCodeFork \hspace{0.75cm} 16 \faGithub \hspace{0.75cm} \faCloudDownload \hspace{0.75cm} \faEnvelope 17 } 18 } 19 \end{center} 20 \end{minipage} 21 \end{center} 22 23 \spacetop 24 \textcolor{white}{\fontsize{0.8cm}{0.8cm}\selectfont\textbf{\heading}} 25 \ifdef{\subheading}{ 26 \medskip 27 \par 28 \textcolor{white}{\Huge \subheading} 29 }{} 30 \spacedown 31 32 \begin{center} 33 \LARGE Version \version\ -\ \today \\ 34 \medskip 35 \href{http://doi.org/10.5281/zenodo.\zid}{ \includegraphics{badges/zenodo.\zid} } 36 \end{center} 37 38 \vfill 39 40 \begin{minipage}{\authorswidth} 41 \raggedleft 42 \input{authors} 43 \end{minipage}\hspace{15pt}\begin{minipage}{0.02\linewidth} 44 \rule{1pt}{\rulelenght} 45 \end{minipage}\hspace{ 5pt}\begin{minipage}{\abstractwidth} 46 \begin{abstract} 47 \input{abstract} 48 \end{abstract} 11 49 \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 \Huge 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}} 24 \predate{ 50 25 51 \vfill 52 26 53 \begin{center} 27 \large Version \version --- 28 } 29 \postdate{ 30 \par~\\ 31 \href{http://doi.org/10.5281/zenodo.\zid}{\includegraphics{{badges/zenodo.\zid}.pdf}} 54 \Large 55 \href{http://www.cmcc.it }{ \includegraphics[height=1cm]{logos/CMCC} } \hspace{0.25cm} 56 \href{http://www.cnrs.fr }{ \includegraphics[height=1cm]{logos/CNRS} } \hspace{0.25cm} 57 \href{http://www.mercator-ocean.fr}{ \includegraphics[height=1cm]{logos/MOI} } \hspace{0.25cm} 58 \href{http://www.metoffice.gov.uk }{ \includegraphics[height=1cm]{logos/UKMO} } \hspace{0.25cm} 59 \href{http://nerc.ukri.org }{ \includegraphics[height=1cm]{logos/NERC} } \\ 60 \medskip 61 \slshape 62 {C}ommunity \hspace{1.5em} {O}cean \hspace{1.5em} {M}odel \\ 32 63 \end{center} 33 \vfill34 \begin{center}35 \href{http://www.cmcc.it}{ \includegraphics[height=0.055\textheight]{logos/CMCC}}36 \hspace{0.5em}37 \href{http://www.cnrs.fr}{ \includegraphics[height=0.055\textheight]{logos/CNRS}}38 \hspace{0.9em}39 \href{http://www.mercator-ocean.fr}{\includegraphics[height=0.055\textheight]{logos/MOI} }40 \hspace{0.45em}41 \href{http://www.metoffice.gov.uk}{ \includegraphics[height=0.055\textheight]{logos/UKMO}}42 \hspace{0.5em}43 \href{http://nerc.ukri.org}{ \includegraphics[height=0.055\textheight]{logos/NERC}} \\44 \large{{\em{C}ommunity \hspace{1.5em} {O}cean \hspace{1.5em} {M}odel}}45 \end{center}46 }47 64 48 \ thanksmarkseries{fnsymbol}65 \end{titlepage} 49 66 67 \restoregeometry -
NEMO/branches/2019/ENHANCE-02_ISF_nemo_TEST_MERGE/doc/latex/global/highlighting.tex
r11310 r11967 2 2 %% ============================================================================== 3 3 4 \usepackage[outputdir=../build ]{minted}4 \usepackage[outputdir=../build, chapter, newfloat]{minted} 5 5 6 6 %% Global highlighting style 7 7 \definecolor{bg}{HTML}{f8f8f8} 8 8 \usemintedstyle{emacs} 9 \setminted{bgcolor=bg, fontsize=\scriptsize, breaklines , frame=leftline}9 \setminted{bgcolor=bg, fontsize=\scriptsize, breaklines} 10 10 \setminted[xml]{style=borland} %% Specific per language 11 11 … … 22 22 23 23 %% File 24 \newmintedfile[forfile]{fortran}{} % \forfile{../namelists/nam...}24 \newmintedfile[forfile]{fortran}{} 25 25 26 26 %% Inline 27 \newmintinline[forcode]{fortran}{bgcolor=, fontsize=auto , frame=lines} % \forcode{...}28 \newmintinline[xmlcode]{xml}{ bgcolor=, fontsize=auto , frame=lines} % \xmlcode{...}29 \newmintinline[snippet]{console}{bgcolor=, fontsize=auto , frame=lines} % \snippet{...}27 \newmintinline[forcode]{fortran}{bgcolor=, fontsize=auto} % \forcode{...} 28 \newmintinline[xmlcode]{xml}{ bgcolor=, fontsize=auto} % \xmlcode{...} 29 \newmintinline[snippet]{console}{bgcolor=, fontsize=auto} % \snippet{...} 30 30 31 31 %% Namelists inclusion 32 32 \newcommand{\nlst}[1]{\forfile{../../../namelists/#1}} 33 -
NEMO/branches/2019/ENHANCE-02_ISF_nemo_TEST_MERGE/doc/latex/global/index.ist
r11176 r11967 1 1 headings_flag 1 2 heading_prefix "{\\medskip\\hfill\\large\\textsf{\\textbf{" 3 heading_suffix "}}\\hfill}\\medskip\\nopagebreak\n" 4 2 heading_prefix "\\medskip\\hfill\\textnormal{" 3 heading_suffix "}\\hfill\\smallskip\n" 5 4 delim_0 "\\dotfill~" 6 delim_1 "\\dotfill~"7 delim_2 "\\dotfill~"8 -
NEMO/branches/2019/ENHANCE-02_ISF_nemo_TEST_MERGE/doc/latex/global/info_page.tex
r11176 r11967 2 2 \thispagestyle{plain} 3 3 4 % ================================================================5 % Disclaimer6 % ================================================================4 %% ================================================================ 5 %% Disclaimer 6 %% ================================================================ 7 7 \subsubsection*{Disclaimer} 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 development 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. … … 18 18 Users are encouraged to bring them to our attention. 19 19 20 The authors assume no responsibility for problems, errors, or incorrect usage of NEMO.20 The authors assume no responsibility for problems, errors, or incorrect usage of \NEMO. 21 21 22 % ================================================================23 % External resources24 % ================================================================22 %% ================================================================ 23 %% External resources 24 %% ================================================================ 25 25 \subsubsection*{Other resources} 26 \label{resources} 26 27 27 28 Additional information can be found on: 28 29 \begin{itemize} 29 \item the \href{http://www.nemo-ocean.eu}{website} of the project detailing several30 \item \faWordpress\ the \href{http://www.nemo-ocean.eu}{website} of the project detailing several 30 31 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: 32 \item \faCodeFork\ the \href{http://forge.ipsl.jussieu.fr/nemo}{development platform} of 33 the model with the code repository for the shared reference and some main resources 34 (wiki, ticket system, forums, \ldots) \\ 35 \faGithub\ the \href{http://github.com/NEMO-ocean/NEMO-examples} 36 {repository of the demonstration cases} for research or training 37 \item \faCloudDownload\ the \href{http://zenodo.org/communities/nemo-ocean}{online archive} 38 delivering the publications issued by the consortium (manuals, reports, datasets, \ldots) 39 \item \faEnvelope\ two mailing lists: 36 40 the \href{http://listes.ipsl.fr/sympa/info/nemo-newsletter}{newsletter} for 37 41 top-down communications from the project … … 41 45 \end{itemize} 42 46 43 % ================================================================44 % Citation45 % ================================================================47 %% ================================================================ 48 %% Citation 49 %% ================================================================ 46 50 \subsubsection*{Citation} 47 51 48 52 Reference for papers and other publications is as follows: 49 53 50 \ vspace{0.5cm}54 \medskip 51 55 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), 58 \href{https://doi.org/10.5281/zenodo.\zid}{doi:10.5281/zenodo.\zid} 56 \begin{sloppypar} 57 ``{\bfseries \heading}\ifdef{\subheading}{ -- \subheading}{}'', 58 {\em Scientific Notes of Climate Modelling Center}, \textbf{\ipslnum} --- ISSN 1288-1619, 59 Institut Pierre-Simon Laplace (IPSL), 60 \href{https://doi.org/10.5281/zenodo.\zid}{doi:10.5281/zenodo.\zid} 61 \end{sloppypar} 59 62 60 63 \begin{figure}[b] 61 \begin{minipage}[c]{0.72\textwidth} 62 \small\ttfamily{Scientific Notes of Climate Modelling Center \\ 63 ISSN 1288-1619 \\ 64 \begin{minipage}[c]{0.7\textwidth} 65 \small 66 \ttfamily{ 67 Scientific Notes of Climate Modelling Center \\ 68 ISSN 1288-1619 \\ 64 69 Institut Pierre-Simon Laplace (IPSL) 65 70 } … … 70 75 \end{minipage} 71 76 \end{figure} 72 -
NEMO/branches/2019/ENHANCE-02_ISF_nemo_TEST_MERGE/doc/latex/global/new_cmds.tex
r11212 r11967 2 2 %% ============================================================================== 3 3 4 %% Include references and index for compilation of single subfile 5 \newcommand{\mtoc}{\minitoc} 6 \newcommand{\biblio}{\bibliography{../main/bibliography}} 7 \newcommand{\pindex}{\printindex} 4 %% Same slanted font for NEMO and its core engines 5 \newcommand{\NEMO }{\textsl{NEMO}} 6 \newcommand{\OPA }{\textsl{OPA}} 7 \newcommand{\SIcube}{\textsl{SI$^3$}} 8 \newcommand{\TOP }{\textsl{TOP}} 9 \newcommand{\PISCES}{\textsl{PISCES}} 10 \newcommand{\NEMOVAR}{\textsl{NEMOVAR}} 8 11 9 %% NEMO and Fortran in small capitals 10 \newcommand{\NEMO}{\textsc{nemo}~} 11 \newcommand{\fortran}{\textsc{Fortran}~} 12 \newcommand{\fninety}{\textsc{Fortran 90}~} 12 %% Links for external components 13 \newcommand{\AGRIF}{\href{http://agrif.imag.fr}{AGRIF}} 14 \newcommand{\CICE }{\href{http://github.com/CICE-Consortium/CICE}{CICE}} 15 \newcommand{\OASIS}{\href{http://portal.enes.org/oasis}{OASIS}} 16 \newcommand{\XIOS }{\href{http://forge.ipsl.jussieu.fr/ioserver}{XIOS}} 17 18 %% Fortran in small capitals 19 \newcommand{\fortran}{\textsc{Fortran}} 20 \newcommand{\fninety}{\textsc{Fortran 90}} 13 21 14 22 %% Common aliases … … 18 26 \newcommand{\ztilde}{\ensuremath{\tilde z}} 19 27 \newcommand{\stilde}{\ensuremath{\tilde s}} 20 \newcommand{\ie}{\ensuremath{i.e.} ~}21 \newcommand{\eg}{\ensuremath{e.g.} ~}28 \newcommand{\ie}{\ensuremath{i.e.}} 29 \newcommand{\eg}{\ensuremath{e.g.}} 22 30 23 31 %% Inline maths … … 25 33 \newcommand{\rdt}{\Delta t} 26 34 27 %% Text env. for Gurvan28 \newcommand{\ gmcomment}[1]{}35 %% Gurvan's comments 36 \newcommand{\cmtgm}[1]{} 29 37 30 38 %% Maths 31 39 \newcommand{\lt}{\left} 32 40 \newcommand{\rt}{\right} 33 \newcommand{\vect}[1]{\ensuremath{ \mathbf{#1}}}41 \newcommand{\vect}[1]{\ensuremath{ \mathbf{#1} }} 34 42 \newcommand{\pd}[2][]{\ensuremath{\frac{\partial #1}{\partial #2}}} 35 43 36 %% Workaround for issue with \listoffigures 37 \DeclareRobustCommand{\triad}[6][]{\ensuremath{{}_{#2}^{#3}{\mathbb{#4}_{#1}}_{#5}^{\,#6}}} 44 %% Convert chapter/section headings to lowercase 45 \renewcommand{\chaptermark}[1]{\markboth{#1}{}} 46 \renewcommand{\sectionmark}[1]{\markright{#1}{}} 47 48 %% Retrieve month name 49 \renewcommand{\today}{ 50 \ifcase \month\or January\or February\or March\or 51 April\or May\or June\or 52 July\or August\or September\or 53 October\or November\or December 54 \fi, \number \year 55 } 56 57 %% Link to orcid profile 58 \newcommand{\orcid}[1]{\href{http://orcid.org/#1}{\textcolor{orcidcolor}\aiOrcidSquare}} 59 60 %% Workaround for \listoffigures 61 \DeclareRobustCommand{\triad}[6][]{\ensuremath{ {}_{#2}^{#3} { \mathbb{#4}_{#1} }_{#5}^{\,#6} }} 62 63 %% New command for ToC 64 \newcommand{\chaptertoc}[1][Table of contents]{% 65 \thispagestyle{empty} 66 \etocsettocstyle{\addsec*{#1}}{}% 67 \localtableofcontents% 68 \vfill 69 } -
NEMO/branches/2019/ENHANCE-02_ISF_nemo_TEST_MERGE/doc/latex/global/packages.tex
r11189 r11967 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 for higher compatibility 16 6 17 %% Extensions in bundle package 18 \usepackage{amssymb, graphicx, tabularx, textcomp} 19 \usepackage[utf8]{inputenc} %% input encoding 7 %% KOMA-script 8 \usepackage[footsepline=0.25pt, headsepline=0.25pt]{scrlayer-scrpage} 9 10 %% customization (layout, header/footer styles & contents, background) 11 \usepackage{draftwatermark} 12 \usepackage[margin = 2cm]{geometry} 13 \usepackage[pages = some]{background} %% 'some' for title page 14 \usepackage[Bjornstrup]{fncychap} 15 16 %% Fonts 17 \usepackage{fontspec} 18 %% Issue with fontawesome pkg: path to FontAwesome.otf has to be hard-coded 19 \defaultfontfeatures{ 20 Path = /usr/local/texlive/2019/texmf-dist/fonts/opentype/public/fontawesome/ 21 } 22 \usepackage{academicons, fontawesome, newtxtext} 23 24 %% Formatting 25 \usepackage[inline]{enumitem} 26 \usepackage{etoc, tabularx, xcolor} 27 28 %% Graphics 29 \usepackage{caption, graphicx, grffile} 30 31 %% Labels 32 \usepackage{lastpage, natbib} 33 34 %% Mathematics 35 \usepackage{amsmath, amssymb, mathtools} 36 37 %% Versatility 38 \usepackage{subfiles} 20 39 21 40 %% Configuration 22 \graphicspath{ {../../figures/} {../../figures/\engine/} } 23 %\captionsetup{margin=10pt, font={small}, labelsep=colon, labelfont={bf}} 24 \renewcommand{\bibfont}{\small} 25 %\renewcommand{\bibsep}{3pt} 41 \graphicspath{ {../../../} {../figures/} } 26 42 43 %% Missing utmr8a font 44 \usepackage{times} -
NEMO/branches/2019/ENHANCE-02_ISF_nemo_TEST_MERGE/doc/latex/global/styles.tex
r11212 r11967 3 3 %% ============================================================================== 4 4 5 %\pagestyle{fancy} 6 \bibliographystyle{../../global/ametsoc} 7 \renewcommand{\bibpreamble}{\begin{multicols}{2}} 8 \renewcommand{\bibpostamble}{\end{multicols}} 9 10 %% Additional fonts 11 \DeclareMathAlphabet{\mathpzc}{OT1}{pzc}{m}{it} 5 %% Colors 6 \setmanualcolor 7 \colorlet{manualcolorshaded}{manualcolor!60} 8 \definecolor{orcidcolor}{HTML}{A6CE39} 12 9 13 10 %% 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} 11 \pagestyle{scrheadings} 12 \addtokomafont{pagehead}{ \sffamily } 13 \addtokomafont{pagefoot}{ \sffamily \footnotesize} 14 \addtokomafont{pagenumber}{\sffamily \slshape } 15 \addtokomafont{chapter}{\color{white}} 16 \ohead{} \ofoot{} %% Clear defaults 23 17 18 %% Caption 19 \captionsetup{font = footnotesize, justification = justified} 20 21 %% Footnote 22 \renewcommand{\thefootnote}{\fnsymbol{footnote}} 23 24 %% Bibliography 25 \bibliographystyle{../../global/ametsoc} 26 \renewcommand{\bibfont}{\small} 27 \renewcommand{\bibpreamble }{\begin{multicols}{2}} 28 \renewcommand{\bibpostamble}{ \end{multicols} } 24 29 25 30 %% 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 33 %} 34 %\def\@makechapterhead#1{ 35 % \hbox{ 36 % \huge\LignesVerticales\hspace{-0.5cm} 37 % \GrosCarreAvecUnChiffre{\thechapter}\hspace{0.2cm} 38 % \hbox{#1} 39 % } 40 % \par\vskip 41 %1cm 42 %} 43 %\def\@makeschapterhead#1{ 44 % \hbox{ 45 % \huge\LignesVerticales 46 % \hbox{#1} 47 % } 48 % \par\vskip 49 %2cm 50 %} 51 %\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else 52 % \hbox{} 53 % \vspace*{\fill} 54 % \vspace{\fill} 55 % \thispagestyle{empty} 56 % \newpage 57 % \if@twocolumn\hbox{}\newpage\fi\fi\fi} 58 %\def\@seccntformat#1{\protect\makebox[0pt][r]{\csname the#1\endcsname\quad}} 59 %\makeatother 31 \makeatletter 60 32 33 %% Prevent error with tikz and namelist inclusion 34 \global\let\tikz@ensure@dollar@catcode=\relax 61 35 36 %% First page 37 \backgroundsetup{ 38 firstpage = true, 39 scale = 1, angle = 0, opacity = 1, 40 contents = { 41 \begin{tikzpicture}[remember picture, overlay] 42 \path [fill = manualcolor] (-0.5\paperwidth, 7) rectangle (0.5\paperwidth, 10); 43 \end{tikzpicture} 44 } 45 } 46 47 %% Apply engine color for chapter headings: tweaking snippets from fncychap.sty 48 \renewcommand{\DOCH}{% 49 \settowidth{\py}{\CNoV\thechapter} 50 \addtolength{\py}{-10pt} % Amount of space by which the 51 % % number is shifted right 52 \fboxsep=0pt% 53 \colorbox{manualcolor}{\rule{0pt}{40pt}\parbox[b]{\textwidth}{\hfill}}% 54 \kern-\py\raise20pt% 55 \hbox{\color{manualcolorshaded}\CNoV\thechapter}\\% 56 } 57 \renewcommand{\DOTI}[1]{% 58 \nointerlineskip\raggedright% 59 \fboxsep=\myhi% 60 \vskip-1ex% 61 \colorbox{manualcolor}{\parbox[t]{\mylen}{\color{white}\CTV\FmTi{#1}}}\par\nobreak% 62 \vskip 40\p@% 63 } 64 \renewcommand{\DOTIS}[1]{% 65 \fboxsep=0pt 66 \colorbox{manualcolor}{\rule{0pt}{40pt}\parbox[b]{\textwidth}{\hfill}}\\% 67 \nointerlineskip\raggedright% 68 \fboxsep=\myhi% 69 \vskip-1ex% Remove white 1pt line 70 \colorbox{manualcolor}{\parbox[t]{\mylen}{\color{white}\CTV\FmTi{#1}}}\par\nobreak% 71 \vskip 40\p@% 72 } 73 74 %% Temporary fix 75 \def\set@curr@file#1{% 76 \begingroup 77 \escapechar\m@ne 78 \xdef\@curr@file{\expandafter\string\csname #1\endcsname}% 79 \endgroup 80 } 81 \def\quote@name#1{"\quote@@name#1\@gobble""} 82 \def\quote@@name#1"{#1\quote@@name} 83 \def\unquote@name#1{\quote@@name#1\@gobble"} 84 85 \makeatother
Note: See TracChangeset
for help on using the changeset viewer.