Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/main/chapters.tex
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/main/chapters.tex	(revision 11524)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/main/chapters.tex	(revision 11525)
@@ -1,3 +1,2 @@
-\subfile{../subfiles/introduction}        %% Introduction
 \subfile{../subfiles/chap_model_basics}
 \subfile{../subfiles/chap_time_domain}    %% Time discretisation (time stepping strategy)
@@ -15,2 +14,7 @@
 \subfile{../subfiles/chap_misc}           %% Miscellaneous topics
 \subfile{../subfiles/chap_CONFIG}         %% Predefined configurations
+
+%% Not included
+%\subfile{../subfiles/chap_model_basics_zstar}
+%\subfile{../subfiles/chap_DIU}
+%\subfile{../subfiles/chap_conservation}
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/main/definitions.tex
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/main/definitions.tex	(revision 11524)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/main/definitions.tex	(revision 11525)
@@ -2,15 +2,15 @@
 \def \engine{NEMO}
 
-%% Title and cover page settings
+%% Cover page settings
 \def \spacetop{  \vspace*{1.85cm} }
 \def \heading{NEMO ocean engine}
-\def \subheading{}
+%\def \subheading{}
 \def \spacedown{ \vspace*{0.75cm } }
-\def \authorswidth{ 0.3\linewidth}
+\def \authorswidth{  0.3\linewidth}
 \def \rulelenght{270pt}
 \def \abstractwidth{0.6\linewidth}
 
-%% Color for document (frontpage banner, links  and chapter boxes)
-\def \setcolor{ \definecolor{manualcolor}{cmyk}{1, .60, 0, .40} }
+%% Manual color (frontpage banner, links  and chapter boxes)
+\def \setmanualcolor{ \definecolor{manualcolor}{cmyk}{1, .60, 0, .40} }
 
 %% IPSL publication number
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/main/introduction.tex
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/main/introduction.tex	(revision 11525)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/main/introduction.tex	(revision 11525)
@@ -0,0 +1,141 @@
+
+\chapter*{Introduction}
+
+%\chaptertoc
+
+%\paragraph{Changes record} ~\\
+
+%\thispagestyle{plain}
+
+%{\footnotesize
+%  \begin{tabularx}{\textwidth}{l||X|X}
+%    Release & Author(s) & Modifications \\
+%    \hline
+%    {\em x.x} & {\em ...} & {\em ...}   \\
+%    {\em ...} & {\em ...} & {\em ...}   \\
+%  \end{tabularx}
+%}
+
+%\clearpage
+
+The \textbf{N}ucleus for \textbf{E}uropean \textbf{M}odelling of the \textbf{O}cean (\NEMO) is
+a framework of ocean related engines, namely the aforementioned for
+the ocean dynamics and thermodynamics,
+\SIcube \footnote{\textbf{S}ea-\textbf{I}ce modelling \textbf{I}ntegrated \textbf{I}nitiative}
+for the sea-ice dynamics and thermodynamics,
+\TOP \footnote{\textbf{T}racer in the \textbf{O}cean \textbf{P}aradigm} for
+the biogeochemistry (both transport and sources minus sinks
+(\PISCES \footnote{
+  \textbf{P}elagic \textbf{I}nteractions \textbf{S}cheme for
+  \textbf{C}arbon and \textbf{E}cosystem \textbf{S}tudies
+}
+)).
+The ocean component has been developed from the legacy of
+the \OPA \footnote{\textbf{O}c\'{e}an \textbf{PA}rall\'{e}lis\'{e} (French)}
+model, described in \citet{madec.delecluse.ea_NPM98}.
+This model has been used for a wide range of applications, both regional or global,
+as a forced ocean model and as a model coupled with the sea-ice and/or the atmosphere.
+
+This manual provides information about the physics represented by the ocean component of \NEMO\ and
+the rationale for the choice of numerical schemes and the model design.
+For the use of framework,
+a guide which gathers the \texttt{README} files spread out in the source code can be build and
+exported in a web or printable format (see \path{./doc/rst}).
+Also a online copy is available on the \href{http://forge.ipsl.jussieu.fr/nemo}{forge platform}.
+
+%% =================================================================================================
+\section*{Manual outline}
+
+\subsection*{Chapters}
+
+The manual mirrors the organization of the model and it is organised in as follows:
+after the presentation of the continuous equations
+(primitive equations with temperature and salinity, and an equation of seawater) in the next chapter,
+the following chapters refer to specific terms of the equations each associated with
+a group of modules.
+
+\begin{description}
+\item [\nameref{chap:PE}] presents the equations and their assumptions, the vertical coordinates used,
+and the subgrid scale physics.
+The equations are written in a curvilinear coordinate system, with a choice of vertical coordinates
+($z$, $s$, \zstar, \sstar, \ztilde, \stilde, and a mix of them).
+Momentum equations are formulated in vector invariant or flux form.
+Dimensional units in the meter, kilogram, second (MKS) international system are used throughout.
+The following chapters deal with the discrete equations.
+\item [\nameref{chap:STP}] presents the model time stepping environment.
+it is a three level scheme in which the tendency terms of the equations are evaluated either
+centered in time, or forward, or backward depending of the nature of the term.
+\item [\nameref{chap:DOM}] presents the model \textbf{DOM}ain.
+It is discretised on a staggered grid (Arakawa C grid) with masking of land areas.
+Vertical discretisation used depends on both how the bottom topography is represented and whether
+the free surface is linear or not.
+Full step or partial step $z$-coordinate or $s$- (terrain-following) coordinate is used with
+linear free surface (level position are then fixed in time).
+In non-linear free surface, the corresponding rescaled height coordinate formulation
+(\zstar or \sstar) is used
+(the level position then vary in time as a function of the sea surface heigh).
+\item [\nameref{chap:TRA} and \nameref{chap:DYN}] describe the discretisation of
+the prognostic equations for the active \textbf{TRA}cers (potential temperature and salinity) and
+the momentum (\textbf{DYN}amic).
+Explicit, split-explicit and filtered free surface formulations are implemented.
+A number of numerical schemes are available for momentum advection,
+for the computation of the pressure gradients, as well as for the advection of tracers
+(second or higher order advection schemes, including positive ones).
+\item [\nameref{chap:SBC}] can be implemented as prescribed fluxes,
+or bulk formulations for the surface fluxes (wind stress, heat, freshwater).
+The model allows penetration of solar radiation.
+There is an optional geothermal heating at the ocean bottom.
+Within the \NEMO\ system the ocean model is interactively coupled with
+a sea ice model (\SIcube) and a biogeochemistry model (\PISCES).
+Interactive coupling to Atmospheric models is possible via the \OASIS\ coupler.
+Two-way nesting is also available through an interface to the \AGRIF\ package,
+\ie\ \textbf{A}daptative \textbf{G}rid \textbf{R}efinement in \textbf{F}ortran
+\citep{debreu.vouland.ea_CG08}.
+The interface code for coupling to an alternative sea ice model (\CICE) has now been upgraded so that
+it works for both global and regional domains.
+\item [\nameref{chap:LBC}] presents the \textbf{L}ateral
+\textbf{B}oun\textbf{D}ar\textbf{Y} \textbf{C}onditions.
+Global configurations of the model make use of the ORCA tripolar grid,
+with special north fold boundary condition.
+Free-slip or no-slip boundary conditions are allowed at land boundaries.
+Closed basin geometries as well as periodic domains and open boundary conditions are possible.
+\item [\nameref{chap:LDF} and \nameref{chap:ZDF}] describe the physical parameterisations
+(\textbf{L}ateral \textbf{D}i\textbf{F}fusion and vertical \textbf{Z} \textbf{D}i\textbf{F}fusion)
+The model includes an implicit treatment of vertical viscosity and diffusivity.
+The lateral Laplacian and biharmonic viscosity and diffusion can be rotated following
+a geopotential or neutral direction.
+There is an optional eddy induced velocity \citep{gent.mcwilliams_JPO90} with
+a space and time variable coefficient \citet{treguier.held.ea_JPO97}.
+The model has vertical harmonic viscosity and diffusion with a space and time variable coefficient,
+with options to compute the coefficients with \citet{blanke.delecluse_JPO93},
+\citet{pacanowski.philander_JPO81}, or \citet{umlauf.burchard_JMR03} mixing schemes.
+\item [\nameref{chap:DIA}] describes model \textbf{I}n-\textbf{O}utputs \textbf{M}anagement and
+specific online \textbf{DIA}gnostics.
+The diagnostics includes the output of all the tendencies of the momentum and tracers equations,
+the output of tracers \textbf{TR}en\textbf{D}s averaged over the time evolving mixed layer,
+the output of the tendencies of the barotropic vorticity equation,
+the computation of on-line \textbf{FLO}ats trajectories...
+\item [\nameref{chap:OBS}] describes a tool which reads in \textbf{OBS}ervation files
+(profile temperature and salinity, sea surface temperature, sea level anomaly and
+sea ice concentration) and calculates an interpolated model equivalent value at
+the observation location and nearest model timestep.
+Originally developed of data assimilation, it is a fantastic tool for model and data comparison.
+\item [\nameref{chap:ASM}] describes how increments produced by
+data \textbf{A}s\textbf{S}i\textbf{M}ilation may be applied to the model equations.
+\item [\nameref{chap:MISC}] (including solvers)
+\item [\nameref{chap:CFG}] provides finally a brief introduction to
+the pre-defined model configurations
+(water column model \texttt{C1D}, ORCA and GYRE families of configurations).
+\end{description}
+
+%% =================================================================================================
+\subsection*{Appendices}
+
+\begin{description}
+\item [\nameref{apdx:s_coord}]
+\item [\nameref{apdx:diff_oper}]
+\item [\nameref{apdx:invariants}]
+\item [\nameref{apdx:triads}]
+\item [\nameref{apdx:DOMAINcfg}]
+\item [\nameref{apdx:coding}]
+\end{description}
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/main/thanks.tex
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/main/thanks.tex	(revision 11524)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/main/thanks.tex	(revision 11525)
@@ -47,3 +47,4 @@
                             George Nurser               \\
 \orcid{0000-0001-7481-6369} Guillaume Samson            \\
-                            Dave Storkey
+                            Dave Storkey                \\
+%% Don't forget the last break for the right alignment
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/chap_TRA.tex
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/chap_TRA.tex	(revision 11524)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/chap_TRA.tex	(revision 11525)
@@ -139,5 +139,5 @@
 two quantities that are not correlated \citep{roullet.madec_JGR00, griffies.pacanowski.ea_MWR01, campin.adcroft.ea_OM04}.
 
-The velocity field that appears in (\autoref{eq:tra_adv} is 
+The velocity field that appears in (\autoref{eq:tra_adv} is
 the centred (\textit{now}) \textit{effective} ocean velocity, \ie\ the \textit{eulerian} velocity
 (see \autoref{chap:DYN}) plus the eddy induced velocity (\textit{eiv}) and/or
@@ -471,5 +471,5 @@
 \item[\np{ln\_traldf\_lap}\forcode{ = .true.}:]
   a laplacian operator is selected.
-  This harmonic operator takes the following expression:  $\mathpzc{L}(T) = \nabla \cdot A_{ht} \; \nabla T $,
+  This harmonic operator takes the following expression:  $\mathcal{L}(T) = \nabla \cdot A_{ht} \; \nabla T $,
   where the gradient operates along the selected direction (see \autoref{subsec:TRA_ldf_dir}),
   and $A_{ht}$ is the eddy diffusivity coefficient expressed in $m^2/s$ (see \autoref{chap:LDF}).
@@ -477,5 +477,5 @@
   a bilaplacian operator is selected.
   This biharmonic operator takes the following expression:
-  $\mathpzc{B} = - \mathpzc{L}(\mathpzc{L}(T)) = - \nabla \cdot b \nabla (\nabla \cdot b \nabla T)$
+  $\mathcal{B} = - \mathcal{L}(\mathcal{L}(T)) = - \nabla \cdot b \nabla (\nabla \cdot b \nabla T)$
   where the gradient operats along the selected direction,
   and $b^2 = B_{ht}$ is the eddy diffusivity coefficient expressed in $m^4/s$ (see \autoref{chap:LDF}).
@@ -534,5 +534,5 @@
 where zero diffusive fluxes is assumed across solid boundaries,
 first (and third in bilaplacian case) horizontal tracer derivative are masked.
-It is implemented in the \rou{tra\_ldf\_lap} subroutine found in the \mdl{traldf\_lap\_blp}} module.
+It is implemented in the \rou{tra\_ldf\_lap} subroutine found in the \mdl{traldf\_lap\_blp} module.
 The module also contains \rou{tra\_ldf\_blp}, the subroutine calling twice \rou{tra\_ldf\_lap} in order to
 compute the iso-level bilaplacian operator.
@@ -1217,5 +1217,5 @@
 density in the World Ocean varies by no more than 2$\%$ from that value \citep{gill_bk82}.
 
-Options which control the EOS used are defined through the \ngn{nameos} namelist variables.
+Options which control the EOS used are defined through the \nam{eos} namelist variables.
 
 \begin{description}
Index: MO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/introduction.tex
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/introduction.tex	(revision 11524)
+++ 	(revision )
@@ -1,356 +1,0 @@
-\documentclass[../main/NEMO_manual]{subfiles}
-
-%% Remove section heading (no section here)
-\rehead{}
-
-\begin{document}
-
-% ================================================================
-% INTRODUCTION
-% ================================================================
-
-\chapter{Introduction}
-
-The Nucleus for European Modelling of the Ocean (\NEMO) is a framework of ocean related engines,
-namely OPA \footnote{OPA: Oc\'{e}an PArall\'{e}lis\'{e} (french)} for the ocean dynamics and thermodynamics,
-SI$^3$ \footnote{SI$^3$: Sea-Ice modelling Integrated Initiative} for the sea-ice dynamics and thermodynamics,
-TOP \footnote{TOP: Tracer in the Ocean Paradigm} for the biogeochemistry
-(both transport (TRP) and sources minus sinks
-(PISCES \footnote{PISCES: Pelagic Interactions Scheme for Carbon and Ecosystem Studies})).
-It is intended to be a flexible tool for studying the ocean and its interactions with the other components of
-the earth climate system (atmosphere, sea-ice, biogeochemical tracers, ...) over
-a wide range of space and time scales.
-This manual provides information about the physics represented by the ocean component of \NEMO\ and
-the rationale for the choice of numerical schemes and the model design.
-For the use of framework,
-a guide which gathers the \texttt{README} files spread out in the source code can be build and
-exported in web or printable format (see \path{./doc/rst}).
-An online version of the guide is also available on the
-\href{http://forge.ipsl.jussieu.fr/nemo}{\NEMO\ forge platform}.
-
-The ocean component of \NEMO\ has been developed from the legacy of the OPA model, release 8.2,
-described in \citet{madec.delecluse.ea_NPM98}.
-This model has been used for a wide range of applications, both regional or global, as a forced ocean model and
-as a model coupled with the sea-ice and/or the atmosphere.
-
-This manual is organised in as follows.
-\autoref{chap:PE} presents the model basics, \ie\ the equations and their assumptions,
-the vertical coordinates used, and the subgrid scale physics.
-This part deals with the continuous equations of the model
-(primitive equations, with temperature, salinity and an equation of seawater).
-The equations are written in a curvilinear coordinate system, with a choice of vertical coordinates
-($z$, $s$, \zstar, \sstar, \ztilde, \stilde, and a mix of them).
-Momentum equations are formulated in vector invariant or flux form.
-Dimensional units in the meter, kilogram, second (MKS) international system are used throughout.
-
-The following chapters deal with the discrete equations.
-\autoref{chap:STP} presents the time domain.
-The model time stepping environment is a three level scheme in which
-the tendency terms of the equations are evaluated either centered in time, or forward, or backward depending of
-the nature of the term.
-\autoref{chap:DOM} presents the space domain.
-The model is discretised on a staggered grid (Arakawa C grid) with masking of land areas.
-Vertical discretisation used depends on both how the bottom topography is represented and whether
-the free surface is linear or not.
-Full step or partial step $z$-coordinate or $s$- (terrain-following) coordinate is used with linear free surface
-(level position are then fixed in time).
-In non-linear free surface, the corresponding rescaled height coordinate formulation (\zstar or \sstar) is used
-(the level position then vary in time as a function of the sea surface heigh).
-The following two chapters (\autoref{chap:TRA} and \autoref{chap:DYN}) describe the discretisation of
-the prognostic equations for the active tracers and the momentum.
-Explicit, split-explicit and filtered free surface formulations are implemented.
-A number of numerical schemes are available for momentum advection,
-for the computation of the pressure gradients, as well as for the advection of tracers
-(second or higher order advection schemes, including positive ones).
-
-Surface boundary conditions (\autoref{chap:SBC}) can be implemented as prescribed fluxes, or bulk formulations for
-the surface fluxes (wind stress, heat, freshwater).
-The model allows penetration of solar radiation.
-There is an optional geothermal heating at the ocean bottom.
-Within the \NEMO\ system the ocean model is interactively coupled with a sea ice model (SI$^3$) and
-a biogeochemistry model (PISCES).
-Interactive coupling to Atmospheric models is possible via the \href{https://portal.enes.org/oasis}{OASIS coupler}.
-Two-way nesting is also available through an interface to the AGRIF package
-(Adaptative Grid Refinement in \fortran) \citep{debreu.vouland.ea_CG08}.
-% Needs to be reviewed
-%The interface code for coupling to an alternative sea ice model (CICE, \citet{Hunke2008}) has now been upgraded so
-%that it works for both global and regional domains, although AGRIF is still not available.
-
-Other model characteristics are the lateral boundary conditions (\autoref{chap:LBC}).
-Global configurations of the model make use of the ORCA tripolar grid, with special north fold boundary condition.
-Free-slip or no-slip boundary conditions are allowed at land boundaries.
-Closed basin geometries as well as periodic domains and open boundary conditions are possible.
-
-Physical parameterisations are described in \autoref{chap:LDF} and \autoref{chap:ZDF}.
-The model includes an implicit treatment of vertical viscosity and diffusivity.
-The lateral Laplacian and biharmonic viscosity and diffusion can be rotated following
-a geopotential or neutral direction.
-There is an optional eddy induced velocity \citep{gent.mcwilliams_JPO90} with a space and time variable coefficient
-\citet{treguier.held.ea_JPO97}.
-The model has vertical harmonic viscosity and diffusion with a space and time variable coefficient,
-with options to compute the coefficients with \citet{blanke.delecluse_JPO93}, \citet{pacanowski.philander_JPO81}, or
-\citet{umlauf.burchard_JMR03} mixing schemes.
-
-%%gm    To be put somewhere else ....
-%%nm    We should consider creating a glossary for all this kind of stuff (terms, acronyms and symbols)
-%%      http://en.wikibooks.org/wiki/LaTeX/Glossary
-\noindent CPP keys and namelists are used as inputs to the code.
-
-\noindent \index{CPP keys} CPP keys
-
-Some CPP keys are implemented in the \fortran code to allow code selection at compiling step.
-This selection of code at compilation time reduces the reliability of the whole platform since
-it changes the code from one set of CPP keys to the other.
-It is used only when the addition/suppression of the part of code highly changes the amount of memory at run time.
-Usual coding looks like:
-
-\begin{forlines}
-#if defined key_option1
-	! This part of the \fortran code will be active
-	! only if key_option1 is activated at compiling step
-#endif
-\end{forlines}
-
-\noindent \index{Namelist} Namelists
-
-The namelist allows to input variables (character, logical, real and integer) into the code.
-There is one namelist file for each component of \NEMO\ (dynamics, sea-ice, biogeochemistry...)
-containing all the \fortran namelists needed.
-The implementation in \NEMO\ uses a 2-step process.
-For each \fortran namelist, two files are read:
-
-\begin{enumerate}
-\item
-  A reference namelist (in \path{./cfgs/SHARED/namelist_ref}) is read first.
-  This file contains all the namelist variables which are initialised to default values
-\item
-  A configuration namelist (in \path{./cfgs/CFG_NAME/EXP00/namelist_cfg}) is read aferwards.
-  This file contains only the namelist variables which are changed from default values, and overwrites those.
-\end{enumerate}
-A template can be found in \path{NEMO/OPA_SRC/module.example}.
-The effective namelist, taken in account during the run, is stored at execution time in
-an \texttt{output\_namelist\_dyn} (or \texttt{\_ice} or \texttt{\_top}) file.
-%%gm  end
-
-Model outputs management and specific online diagnostics are described in \autoref{chap:DIA}.
-The diagnostics includes the output of all the tendencies of the momentum and tracers equations,
-the output of tracers tendencies averaged over the time evolving mixed layer,
-the output of the tendencies of the barotropic vorticity equation,
-the computation of on-line floats trajectories...
-\autoref{chap:OBS} describes a tool which reads in observation files
-(profile temperature and salinity, sea surface temperature, sea level anomaly and sea ice concentration)
-and calculates an interpolated model equivalent value at the observation location and nearest model timestep.
-Originally developed of data assimilation, it is a fantastic tool for model and data comparison.
-\autoref{chap:ASM} describes how increments produced by data assimilation may be applied to the model equations.
-Finally, \autoref{chap:CFG} provides a brief introduction to the pre-defined model configurations
-(water column model, ORCA and GYRE families of configurations).
-
-%%nm: Add some words on the \NEMO\ dependencies
-The model is implemented in \fninety, with preprocessing (C pre-processor).
-It runs under UNIX.
-It is optimized for vector computers and parallelised by domain decomposition with MPI.
-All input and output is done in NetCDF (Network Common Data Format) with a optional direct access format for output.
-To ensure the clarity and readability of the code it is necessary to follow coding rules.
-The coding rules for OPA include conventions for naming variables,
-with different starting letters for different types of variables (real, integer, parameter\ldots).
-Those rules are briefly presented in \autoref{apdx:coding} and a more complete document is available .
-
-The model is organized with a high internal modularity based on physics.
-For example, each trend (\ie, a term in the RHS of the prognostic equation) for momentum and tracers
-is computed in a dedicated module.
-To make it easier for the user to find his way around the code, the module names follow a three-letter rule.
-For example, \mdl{traldf} is a module related to the TRAcers equation, computing the Lateral DiFfussion.
-%The complete list of module names is presented in \autoref{apdx:coding}.      %====>>>> to be done !
-Furthermore, modules are organized in a few directories that correspond to their category,
-as indicated by the first three letters of their name (\autoref{tab:chapters}).
-
-The manual mirrors the organization of the model.
-After the presentation of the continuous equations (\autoref{chap:PE}),
-the following chapters refer to specific terms of the equations each associated with a group of modules
-(\autoref{tab:chapters}).
-
-%--------------------------------------------------TABLE--------------------------------------------------
-\begin{table}[!t]
-  \caption{
-    \protect\label{tab:chapters}
-    Organization of Chapters mimicking the one of the model directories.
-  }
-  \begin{center}
-    \begin{tabular}{|l|l|l|}
-      \hline
-      \autoref{chap:STP}  & -   & model time STePping environment \\
-      \hline
-      \autoref{chap:DOM}  & DOM & model DOMain \\
-      \hline
-      \autoref{chap:TRA}  & TRA & TRAcer equations (potential temperature and salinity) \\
-      \hline
-      \autoref{chap:DYN}  & DYN & DYNamic equations (momentum) \\
-      \hline
-      \autoref{chap:SBC}  & SBC & Surface Boundary Conditions \\
-      \hline
-      \autoref{chap:LBC}  & LBC & Lateral Boundary Conditions (also OBC and BDY)  \\
-      \hline
-      \autoref{chap:LDF}  & LDF & Lateral DiFfusion (parameterisations) \\
-      \hline
-      \autoref{chap:ZDF}  & ZDF & vertical (Z) DiFfusion (parameterisations)  \\
-      \hline
-      \autoref{chap:DIA}  & DIA & I/O and DIAgnostics (also IOM, FLO and TRD) \\
-      \hline
-      \autoref{chap:OBS}  & OBS & OBServation and model comparison  \\
-      \hline
-      \autoref{chap:ASM}  & ASM & ASsiMilation increment  \\
-      \hline
-      \autoref{chap:MISC} & SOL & Miscellaneous  topics (including solvers)  \\
-      \hline
-      \autoref{chap:CFG}  & -   & predefined configurations (including C1D) \\
-      \hline
-    \end{tabular}
-  \end{center}
-\end{table}
-%--------------------------------------------------------------------------------------------------------------
-
-%% nm: the following section has to vastly remodeled to focus only on well-identified versions of \NEMO
-%% (3.4, 3.6, 4.0 and further releases). Then its formatting must be improved too.
-\subsubsection{Changes between releases}
-
-\NEMO/OPA, like all research tools, is in perpetual evolution.
-The present document describes the OPA version include in the release 3.4 of \NEMO.
-This release differs significantly from version 8, documented in \citet{madec.delecluse.ea_NPM98}. \\
-
-The main modifications from OPA v8 and \NEMO/OPA v3.2 are :
-
-\begin{itemize}
-\item
-  transition to full native \fninety, deep code restructuring and drastic reduction of CPP keys;
-\item
-  introduction of partial step representation of bottom topography
-  \citep{barnier.madec.ea_OD06, le-sommer.penduff.ea_OM09, penduff.le-sommer.ea_OS07};
-\item
-  partial reactivation of a terrain-following vertical coordinate ($s$- and hybrid $s$-$z$) with
-  the addition of several options for pressure gradient computation
-  \footnote{
-    Partial support of $s$-coordinate: there is presently no support for neutral physics in
-    $s$-coordinate and for the new options for horizontal pressure gradient computation with
-    a non-linear equation of state.
-  }
-  ;
-\item
-  more choices for the treatment of the free surface: full explicit, split-explicit or filtered schemes,
-  and suppression of the rigid-lid option;
-\item
-  non linear free surface associated with the rescaled height coordinate \zstar or $s$;
-\item
-  additional schemes for vector and flux forms of the momentum advection;
-\item
-  additional advection schemes for tracers;
-\item
-  implementation of the AGRIF package (Adaptative Grid Refinement in \fortran) \citep{debreu.vouland.ea_CG08};
-\item
-  online diagnostics : tracers trend in the mixed layer and vorticity balance;
-\item
-  rewriting of the I/O management with the use of an I/O server;
-\item
-  generalized ocean-ice-atmosphere-CO2 coupling interface, interfaced with OASIS 3 coupler;
-\item
-  surface module (SBC) that simplify the way the ocean is forced and include two bulk formulea (CLIO and CORE) and
-  which includes an on-the-fly interpolation of input forcing fields;
-\item
-  RGB light penetration and optional use of ocean color
-\item
-  major changes in the TKE schemes: it now includes a Langmuir cell parameterization \citep{axell_JGR02},
-  the \citet{mellor.blumberg_JPO04} surface wave breaking parameterization, and has a time discretization which
-  is energetically consistent with the ocean model equations \citep{burchard_OM02, marsaleix.auclair.ea_OM08};
-\item
-  tidal mixing parametrisation (bottom intensification) + Indonesian specific tidal mixing
-  \citep{koch-larrouy.madec.ea_GRL07};
-\item
-  introduction of LIM-3, the new Louvain-la-Neuve sea-ice model
-  (C-grid rheology and new thermodynamics including bulk ice salinity)
-  \citep{vancoppenolle.fichefet.ea_OM09*a, vancoppenolle.fichefet.ea_OM09*b}
-\end{itemize}
-
-The main modifications from \NEMO/OPA v3.2 and v3.3 are:
-
-\begin{itemize}
-\item
-  introduction of a modified leapfrog-Asselin filter time stepping scheme
-  \citep{leclair.madec_OM09};
-\item
-  additional scheme for iso-neutral mixing \citep{griffies.gnanadesikan.ea_JPO98}, although it is still a "work in progress";
-\item
-  a rewriting of the bottom boundary layer scheme, following \citet{campin.goosse_T99};
-\item
-  addition of a Generic Length Scale vertical mixing scheme, following \citet{umlauf.burchard_JMR03};
-\item
-  addition of the atmospheric pressure as an external forcing on both ocean and sea-ice dynamics;
-\item
-  addition of a diurnal cycle on solar radiation \citep{bernie.guilyardi.ea_CD07};
-\item
-  river runoffs added through a non-zero depth, and having its own temperature and salinity;
-\item
-  CORE II normal year forcing set as the default forcing of ORCA2-LIM configuration;
-\item
-  generalisation of the use of \mdl{fldread} for all input fields (ocean climatology, sea-ice damping...);
-\item
-  addition of an on-line observation and model comparison (thanks to NEMOVAR project);
-\item
-  optional application of an assimilation increment (thanks to NEMOVAR project);
-\item
-  coupling interface adjusted for WRF atmospheric model;
-\item
-  C-grid ice rheology now available fro both LIM-2 and LIM-3 \citep{bouillon.maqueda.ea_OM09};
-\item
-  LIM-3 ice-ocean momentum coupling applied to LIM-2;
-\item
-  a deep re-writting and simplification of the off-line tracer component (OFF\_SRC);
-\item
-  the merge of passive and active advection and diffusion modules;
-\item
-  Use of the Flexible Configuration Manager (FCM) to build configurations,
-  generate the Makefile and produce the executable;
-\item
-  Linear-tangent and Adjoint component (TAM) added, phased with v3.0
-\end{itemize}
-
-\vspace{1cm}
-
-In addition, several minor modifications in the coding have been introduced with the constant concern of
-improving the model performance.
-
-The main modifications from \NEMO/OPA v3.3 and v3.4 are:
-
-\begin{itemize}
-\item finalisation of above iso-neutral mixing \citep{griffies.gnanadesikan.ea_JPO98}";
-\item "Neptune effect" parametrisation;
-\item horizontal pressure gradient suitable for s-coordinate;
-\item semi -implicit bottom friction;
-\item finalisation of the merge of passive and active tracers advection-diffusion modules;
-\item a new bulk formulae (so-called MFS);
-\item use fldread for the off-line tracer component (OFF\_SRC);
-\item use MPI point to point communications for north fold;
-\item diagnostic of transport;
-\end{itemize}
-
-The main modifications from \NEMO/OPA v3.4 and v3.6 are:
-
-\begin{itemize}
- \item ...;
-\end{itemize}
-
-The main modifications from \NEMO/OPA v3.6 and v4.0 are:
-
-\begin{itemize}
-\item new definition of configurations;
-\item bulk formulation;
-\item \NEMO-wave large scale interactions;
-\item ...;
-\end{itemize}
-
-\biblio
-
-\pindex
-
-%% Restore section heading
-\rehead{Sect.\ \thesection\ \rightmark}
-
-\end{document}
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/ametsoc.bst
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/ametsoc.bst	(revision 11524)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/ametsoc.bst	(revision 11525)
@@ -9,5 +9,5 @@
 %% *** Bibliography style file for ALL AMS Journals...version 1.0  ***
 %% *** Brian Papa - American Meteorological Society ***
-%% 
+%%
 %% Copyright 1994-2004 Patrick W Daly
  % ===============================================================
@@ -519,5 +519,5 @@
   duplicate$ empty$ 'skip$
     {
-      "\href{http://dx.doi.org/" swap$ * "}{DOI}" *
+      "\href{http://dx.doi.org/" swap$ * "}{\aiDoi}" *
     }
   if$
@@ -1192,5 +1192,5 @@
   crossref missing$
     { format.in.ed.booktitle "booktitle" output.check
-      format.publisher.address output      
+      format.publisher.address output
       format.bvolume output
       format.number.series output
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/coding_rules.tex
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/coding_rules.tex	(revision 11524)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/coding_rules.tex	(revision 11525)
@@ -3,5 +3,5 @@
 \label{apdx:coding}
 
-\minitoc
+\chaptertoc
 
 \newpage
@@ -13,20 +13,21 @@
 produces fewer bugs and is easier to maintain.
 Therefore, it is essential that the model development follows some rules:
+
 \begin{itemize}
-	\item well planned and designed
-	\item well written
-	\item well documented (both on- and off-line)
-	\item maintainable
-	\item easily portable
-	\item flexible.
+\item well planned and designed
+\item well written
+\item well documented (both on- and off-line)
+\item maintainable
+\item easily portable
+\item flexible.
 \end{itemize}
 
 To satisfy part of these aims, \NEMO is written with a coding standard which is close to the ECMWF rules,
-named DOCTOR \citep{gibson_rpt86}. 
+named DOCTOR \citep{gibson_rpt86}.
 These rules present some advantages like:
+
 \begin{itemize}
-	\item to provide a well presented program
-	\item to use rules for variable names which allow recognition of their type
-	(integer, real, parameter, local or shared variables, etc. ). 
+\item to provide a well presented program
+\item to use rules for variable names which allow recognition of their type 	(integer, real, parameter, local or shared variables, etc. ).
 \end{itemize}
 
@@ -45,5 +46,5 @@
 
 This work is based on the coding conventions in use for the Community Climate System Model
-\footnote {\href{http://www.cesm.ucar.edu/working_groups/Software/dev_guide/dev_guide/node7.html}{UCAR conventions}}, 
+\footnote {\href{http://www.cesm.ucar.edu/working_groups/Software/dev_guide/dev_guide/node7.html}{UCAR conventions}},
 the previous version of this document (``FORTRAN coding standard in the OPA System'') and
 the expertise of the \NEMO System Team.
@@ -51,7 +52,7 @@
 
 \begin{itemize}
-	\item The style rules, $i.e.$ the syntax, appearance and naming conventions chosen to improve readability of the code;
-	\item The content rules, $i.e.$ the conventions to improve the reliability of the different parts of the code;
-	\item The package rules to go a step further by improving the reliability of the whole and
+\item The style rules, $i.e.$ the syntax, appearance and naming conventions chosen to improve readability of the code;
+\item The content rules, $i.e.$ the conventions to improve the reliability of the different parts of the code;
+\item The package rules to go a step further by improving the reliability of the whole and
 	interfaces between routines and modules.
 \end{itemize}
@@ -79,11 +80,11 @@
 
 \begin{itemize}
-	\item \path{SBC}             surface module
-	\item \path{IOM}             management of the I/O
-	\item \path{NST}             interface to AGRIF (nesting model) for dynamics and biogeochemistry
-	\item \path{OBC}, \path{BDY} management of structured and unstructured open boundaries 
-	\item \path{C1D}             1D (vertical) configuration for dynamics, sea-ice and biogeochemistry
-	\item \path{OFF}             off-line module: passive tracer or biogeochemistry alone
-	\item \path{...}
+\item \path{SBC}             surface module
+\item \path{IOM}             management of the I/O
+\item \path{NST}             interface to AGRIF (nesting model) for dynamics and biogeochemistry
+\item \path{OBC}, \path{BDY} management of structured and unstructured open boundaries
+\item \path{C1D}             1D (vertical) configuration for dynamics, sea-ice and biogeochemistry
+\item \path{OFF}             off-line module: passive tracer or biogeochemistry alone
+\item \path{...}
 \end{itemize}
 
@@ -292,6 +293,6 @@
       complex                                                                                     \\
       \hline
-      public \par or \par module variable                                                         & 
-      \textbf{m n} \par \textit{but not} \par \textbf{nn\_}                                       & 
+      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\_}                                &
@@ -301,6 +302,6 @@
       \hline
       dummy \par argument                                                                         &
-      \textbf{k} \par \textit{but not} \par \textbf{kf}                                           & 
-      \textbf{p} \par \textit{but not} \par \textbf{pp pf}                                        & 
+      \textbf{k} \par \textit{but not} \par \textbf{kf}                                           &
+      \textbf{p} \par \textit{but not} \par \textbf{pp pf}                                        &
       \textbf{ld}                                                                                 &
       \textbf{cd}                                                                                 &
@@ -309,5 +310,5 @@
       \hline
       local \par variable                                                                         &
-      \textbf{i}                                                                                  & 
+      \textbf{i}                                                                                  &
       \textbf{z}                                                                                  &
       \textbf{ll}                                                                                 &
@@ -333,5 +334,5 @@
       \hline
       namelist                                                                                    &
-      \textbf{nn\_}                                                                               & 
+      \textbf{nn\_}                                                                               &
       \textbf{rn\_}                                                                               &
       \textbf{ln\_}                                                                               &
@@ -748,38 +749,26 @@
 Below is a list of features to avoid:
 \begin{itemize}
-\item
-  \forcode{COMMON} block
+\item \forcode{COMMON} block
   (use the declaration part of \forcode{MODULE} instead)
-\item
-  \forcode{EQUIVALENCE}
+\item \forcode{EQUIVALENCE}
   (use \forcode{POINTER} or derived data type instead to form data structure)
-\item
-  Assigned and computed \forcode{GOTO}
+\item Assigned and computed \forcode{GOTO}
   (use the \forcode{CASE} construct instead)
-\item
-  Arithmetic \forcode{IF} statement
+\item Arithmetic \forcode{IF} statement
   (use the block \forcode{IF}, \forcode{ELSE}, \forcode{ELSEIF}, \forcode{ENDIF} or
   \forcode{SELECT CASE} construct instead)
-\item
-  Labelled \forcode{DO} construct
+\item Labelled \forcode{DO} construct
   (use unlabelled \forcode{END DO} instead)
-\item
-  \forcode{FORMAT} statement
+\item \forcode{FORMAT} statement
   (use character parameters or
   explicit format- specifiers inside the \forcode{READ} or \forcode{WRITE} statement instead)
-\item
-  \forcode{GOTO} and \forcode{CONTINUE} statements
+\item \forcode{GOTO} and \forcode{CONTINUE} statements
   (use \forcode{IF}, \forcode{CASE}, \forcode{DO WHILE}, \forcode{EXIT} or \forcode{CYCLE} statements or
   a contained ?)
-\item
-  \forcode{PAUSE}
-\item
-  \forcode{ENTRY} statement: a sub-program must only have one entry point.
-\item
-  \forcode{RETURN} is obsolete and so not necessary at the end of program units
-\item
-  \forcode{FUNCTION} statement
-\item
-  Avoid functions with side effects.
+\item \forcode{PAUSE}
+\item \forcode{ENTRY} statement: a sub-program must only have one entry point.
+\item \forcode{RETURN} is obsolete and so not necessary at the end of program units
+\item \forcode{FUNCTION} statement
+\item Avoid functions with side effects.
   \footnote{
     First, the code is easier to understand, if you can rely on
@@ -790,7 +779,66 @@
     This is especially important on massive parallel and as well on vector machines.
   }
-\item
-  \forcode{DATA} and \forcode{BLOCK DATA}
+\item \forcode{DATA} and \forcode{BLOCK DATA}
   (use initialisers)
 \end{itemize}
 
+%% Imported from introduction
+%%gm    To be put somewhere else ....
+%%nm    We should consider creating a glossary for all this kind of stuff (terms, acronyms and symbols)
+%%      http://en.wikibooks.org/wiki/LaTeX/Glossary
+%\noindent CPP keys and namelists are used as inputs to the code.
+
+%\noindent \index{CPP keys} CPP keys
+
+%Some CPP keys are implemented in the \fortran code to allow code selection at compiling step.
+%This selection of code at compilation time reduces the reliability of the whole platform since
+%it changes the code from one set of CPP keys to the other.
+%It is used only when the addition/suppression of the part of code highly changes the amount of memory at run time.
+%Usual coding looks like:
+
+%\begin{forlines}
+%#if defined key_option1
+%	! This part of the \fortran code will be active
+%	! only if key_option1 is activated at compiling step
+%#endif
+%\end{forlines}
+
+%\noindent \index{Namelist} Namelists
+
+%The namelist allows to input variables (character, logical, real and integer) into the code.
+%There is one namelist file for each component of \NEMO\ (dynamics, sea-ice, biogeochemistry...)
+%containing all the \fortran namelists needed.
+%The implementation in \NEMO\ uses a 2-step process.
+%For each \fortran namelist, two files are read:
+
+%\begin{enumerate}
+%\item
+%  A reference namelist (in \path{./cfgs/SHARED/namelist_ref}) is read first.
+%  This file contains all the namelist variables which are initialised to default values
+%\item
+%  A configuration namelist (in \path{./cfgs/CFG_NAME/EXP00/namelist_cfg}) is read aferwards.
+%  This file contains only the namelist variables which are changed from default values, and overwrites those.
+%\end{enumerate}
+%A template can be found in \path{NEMO/OPA_SRC/module.example}.
+%The effective namelist, taken in account during the run, is stored at execution time in
+%an \texttt{output\_namelist\_dyn} (or \texttt{\_ice} or \texttt{\_top}) file.
+%%gm  end
+
+%%nm: Add some words on the \NEMO\ dependencies
+%The model is implemented in \fninety, with preprocessing (C pre-processor).
+%It runs under UNIX.
+%It is optimized for vector computers and parallelised by domain decomposition with MPI.
+%All input and output is done in NetCDF (Network Common Data Format) with a optional direct access format for output.
+%To ensure the clarity and readability of the code it is necessary to follow coding rules.
+%The coding rules for OPA include conventions for naming variables,
+%with different starting letters for different types of variables (real, integer, parameter\ldots).
+%Those rules are briefly presented in \autoref{apdx:coding} and a more complete document is available .
+
+%The model is organized with a high internal modularity based on physics.
+%For example, each trend (\ie, a term in the RHS of the prognostic equation) for momentum and tracers
+%is computed in a dedicated module.
+%To make it easier for the user to find his way around the code, the module names follow a three-letter rule.
+%For example, \mdl{traldf} is a module related to the TRAcers equation, computing the Lateral DiFfussion.
+%The complete list of module names is presented in \autoref{apdx:coding}.      %====>>>> to be done !
+%Furthermore, modules are organized in a few directories that correspond to their category,
+%as indicated by the first three letters of their name (\autoref{tab:chapters}).
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/document.tex
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/document.tex	(revision 11524)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/document.tex	(revision 11525)
@@ -1,6 +1,6 @@
 
-%% ==============================================================================
-%% Template structure for reference manual
-%% ==============================================================================
+%% =================================================================================================
+%% Template structure for reference manuals
+%% =================================================================================================
 
 %% NEMO release version
@@ -8,13 +8,13 @@
 
 %% Preamble
-%% ==============================================================================
+%% =================================================================================================
 
 %% Document layout
-\documentclass[twoside = semi, abstract = on]{scrreprt}
+\documentclass[draft, fontsize = 10pt,
+twoside = semi, abstract = on,
+open = right]{scrreprt}
 
 %% Load configurations
 \input{../../global/preamble}
-
-\dominitoc
 
 %% End of common preamble between main and sub-files
@@ -33,31 +33,25 @@
 
 %% Frontmatter
-%% ==============================================================================
+%% =================================================================================================
 
-%% Disable page numbering temporarily
-\pagenumbering{gobble}
+\pagenumbering{gobble}   %% Disable page numbering temporarily
 
 %% Title page
-%\input{../../global/frontpage}
-\input{../../global/frontpage_new}
+\input{../../global/frontpage}
 
-%\maketitle
-%\emptythanks
+%% Footer for introductory parts (no header by cleaning default)
+\ofoot[]{\engine\ Reference Manual} \ifoot[]{\pagemark}
 
 %% Information page (2nd page)
 \input{../../global/info_page}
 
-%% Headings for introductory parts (no header, simple footer)
-\ofoot{\engine\ Reference Manual}\ifoot{\pagemark}
+\clearpage
+
 \pagenumbering{roman}
-
-%% Foreword
-%\input{foreword}
+\input{introduction}
 
 %% Table of Contents
 \tableofcontents
-%\listoffigures
-%\listoftables
-%\listoflistings
+\listoffigures \listoftables \listoflistings
 
 \clearpage
@@ -65,10 +59,10 @@
 
 %% Mainmatter
-%% ==============================================================================
+%% =================================================================================================
 
 %% Headings for document body
-\lohead{Chap.\ \thechapter\ \leftmark}\rehead{Sect.\ \thesection\ \rightmark}
-\ifoot{Page\ \pagemark\ of \pageref*{LastPage}}
 \pagenumbering{arabic}
+\lohead{Chap.\ \thechapter\ \leftmark} \rehead{Sect.\ \thesection\ \rightmark}
+\ifoot[]{Page\ \pagemark\ of \pageref*{LastPage}}
 
 \include{chapters}
@@ -76,9 +70,7 @@
 
 %% Appendix
-%% ==============================================================================
+%% =================================================================================================
 
-%% Chapter numbering is reset with letters now
-\appendix
-
+\appendix   %% Chapter numbering with letters by now
 \include{appendices}
 
@@ -88,17 +80,18 @@
 
 %% Backmatter
-%% ==============================================================================
-
-%\backmatter   %% Chapter numbering off
+%% =================================================================================================
 
 %% Bibliography
 \phantomsection
 \addcontentsline{toc}{chapter}{Bibliography}
+\lohead{Bibliography} \rehead{Bibliography}
 \bibliography{../main/bibliography}
 
-%% Index
 \clearpage
+
+%% Indexes
 \phantomsection
 \addcontentsline{toc}{chapter}{Indexes}
+\lohead{Indexes} \rehead{Indexes}
 \printindex[keys]
 \printindex[modules]
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/frontpage.tex
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/frontpage.tex	(revision 11524)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/frontpage.tex	(revision 11525)
@@ -1,62 +1,67 @@
 
-\title{\heading}
-\date{\today}
-\author{\protect\input{thanks}}
+\begin{titlepage}
+  \newgeometry{hmargin = 1.5cm, vmargin = 3cm}
+  \setlength{\parindent}{0pt}
 
-\pretitle{
   \begin{center}
-    \begin{figure}[H]
-      \begin{minipage}[c]{0.35\textwidth}
-        \href{http://www.nemo-ocean.eu}{\includegraphics[width=0.7\textwidth]{logos/NEMO_grey}}
-      \end{minipage}
-      \hfill
-      \begin{minipage}[c]{0.65\textwidth}
-        \centering
-        \large{\em{{N}ucleus for {E}uropean {M}odelling of the {O}cean}}
-      \end{minipage}
-    \end{figure}
-    \vfill
-    \Huge
-}
-\posttitle{
-  \par
+    \begin{minipage}{0.3\textwidth}
+      \includegraphics[height=1.5cm]{logos/NEMO_grey}
+    \end{minipage}\begin{minipage}{0.6\textwidth}
+      \begin{center}
+      \Large\slshape
+      \textbf{N}ucleus for \textbf{E}uropean \textbf{M}odelling of the \textbf{O}cean \\
+      \medskip
+      \hyperref[resources]{\textcolor{black}{
+          \faWordpress \hspace{0.75cm} \faCodeFork      \hspace{0.75cm}
+          \faGithub    \hspace{0.75cm} \faCloudDownload \hspace{0.75cm} \faEnvelope
+        }
+      }
+      \end{center}
+    \end{minipage}
   \end{center}
-  \vskip 0.5em
-}
-\predate{
+
+  \spacetop
+  \textcolor{white}{\fontsize{0.8cm}{0.8cm}\selectfont\textbf{\heading}}
+  \ifdef{\subheading}{
+    \medskip
+    \par
+    \textcolor{white}{\Huge \subheading}
+  }{}
+  \spacedown
+
+  \begin{center}
+    \LARGE Version \version\ -\ \today \\
+    \medskip
+    \href{http://doi.org/10.5281/zenodo.\zid}{ \includegraphics{{badges/zenodo.\zid}.pdf} }
+  \end{center}
+
   \vfill
-  \begin{center}
-    \large Version \version ---
-}
-\postdate{
-    \par~\\
-    \href{http://doi.org/10.5281/zenodo.\zid}{\includegraphics{{badges/zenodo.\zid}.pdf}}
-  \end{center}
+
+  \begin{minipage}{\authorswidth}
+    \raggedleft
+    \input{thanks}
+  \end{minipage}\hspace{15pt}\begin{minipage}{0.02\linewidth}
+    \rule{1pt}{\rulelenght}
+  \end{minipage}\hspace{ 5pt}\begin{minipage}{\abstractwidth}
+    \begin{abstract}
+      \input{foreword}
+    \end{abstract}
+  \end{minipage}
+
   \vfill
-  \begin{center}
-    \href{http://www.cmcc.it}{          \includegraphics[height=0.055\textheight]{logos/CMCC}}
-    \hspace{0.5em}
-    \href{http://www.cnrs.fr}{          \includegraphics[height=0.055\textheight]{logos/CNRS}}
-    \hspace{0.9em}
-    \href{http://www.mercator-ocean.fr}{\includegraphics[height=0.055\textheight]{logos/MOI} }
-    \hspace{0.45em}
-    \href{http://www.metoffice.gov.uk}{ \includegraphics[height=0.055\textheight]{logos/UKMO}}
-    \hspace{0.5em}
-    \href{http://nerc.ukri.org}{        \includegraphics[height=0.055\textheight]{logos/NERC}} \\
-    \large{{\em{C}ommunity \hspace{1.5em} {O}cean \hspace{1.5em} {M}odel}}
-  \end{center}
-}
 
-\preauthor{
   \begin{center}
     \Large
-    \lineskip 0.5em
-    \begin{tabular}[t]{c c c}
-}
-\postauthor{
-    \end{tabular}
-    \par
+    \href{http://www.cmcc.it          }{ \includegraphics[height=1cm]{logos/CMCC} } \hspace{0.25cm}
+    \href{http://www.cnrs.fr          }{ \includegraphics[height=1cm]{logos/CNRS} } \hspace{0.25cm}
+    \href{http://www.mercator-ocean.fr}{ \includegraphics[height=1cm]{logos/MOI}  } \hspace{0.25cm}
+    \href{http://www.metoffice.gov.uk }{ \includegraphics[height=1cm]{logos/UKMO} } \hspace{0.25cm}
+    \href{http://nerc.ukri.org        }{ \includegraphics[height=1cm]{logos/NERC} } \\
+    \medskip
+    \slshape
+    {C}ommunity \hspace{1.5em} {O}cean \hspace{1.5em} {M}odel \\
   \end{center}
-}
 
-\thanksmarkseries{fnsymbol}
+\end{titlepage}
+
+\restoregeometry
Index: MO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/frontpage_new.tex
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/frontpage_new.tex	(revision 11524)
+++ 	(revision )
@@ -1,72 +1,0 @@
-
-\begin{titlepage}
-  \newgeometry{hmargin = 1.5cm, vmargin = 2cm}
-
-  \begin{center}
-    \begin{minipage}{0.3\textwidth}
-      \includegraphics[height=1.5cm]{logos/NEMO_grey}
-    \end{minipage}
-    \begin{minipage}{0.6\textwidth}
-      \begin{center}
-      \Large
-      \textbf{N}ucleus for \textbf{E}uropean \textbf{M}odelling of the \textbf{O}cean \\[0.25cm]
-        \href{http://www.nemo-ocean.eu                        }{\textcolor{black} \faWordpress    }
-        \hspace{1cm}
-        \href{http://forge.ipsl.jussieu.fr/nemo               }{\textcolor{black} \faCodeFork     }
-        \hspace{1cm}
-        \href{http://github.com/NEMO-ocean                    }{\textcolor{black} \faGithub       }
-        \hspace{1cm}
-        \href{http://zenodo.org/communities/nemo-ocean        }{\textcolor{black} \faCloudDownload}
-        \hspace{1cm}
-        \href{http://listes.ipsl.fr/sympa/info/nemo-newsletter}{\textcolor{black} \faEnvelope     }
-      \end{center}
-    \end{minipage}
-  \end{center}
-
-  \spacetop
-  \noindent
-  \textcolor{white}{\fontsize{1cm}{1cm} \selectfont \heading   }\\[0.25cm]
-  \noindent
-  \textcolor{white}{\Huge \subheading}
-  \spacedown
-
-  \begin{center}
-    \LARGE Version \version\ -\ \today \\[0.25cm]
-    \href{http://doi.org/10.5281/zenodo.\zid}{ \includegraphics{{badges/zenodo.\zid}.pdf} }
-  \end{center}
-
-  \vfill
-
-  \begin{minipage}{\authorswidth}
-    \begin{flushright}
-      \input{thanks}
-    \end{flushright}
-  \end{minipage}
-  \hspace{15pt}
-  \begin{minipage}{0.02\linewidth}
-    \rule{1pt}{\rulelenght}
-  \end{minipage}
-  \hspace{5pt}
-  \begin{minipage}{\abstractwidth}
-    \begin{abstract}
-      \input{foreword}
-    \end{abstract}
-  \end{minipage}
-
-  \vfill
-
-  \begin{center}
-    \Large
-    {C}ommunity \hspace{1.5em} {O}cean \hspace{1.5em} {M}odel \\[0.25cm]
-    \href{http://www.cmcc.it          }{ \includegraphics[height=1cm]{logos/CMCC} } \hspace{0.25cm}
-    \href{http://www.cnrs.fr          }{ \includegraphics[height=1cm]{logos/CNRS} } \hspace{0.25cm}
-    \href{http://www.mercator-ocean.fr}{ \includegraphics[height=1cm]{logos/MOI}  } \hspace{0.25cm}
-    \href{http://www.metoffice.gov.uk }{ \includegraphics[height=1cm]{logos/UKMO} } \hspace{0.25cm}
-    \href{http://nerc.ukri.org        }{ \includegraphics[height=1cm]{logos/NERC} } \\
-  \end{center}
-
-\end{titlepage}
-
-\restoregeometry
-
-%\end{document}
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/highlighting.tex
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/highlighting.tex	(revision 11524)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/highlighting.tex	(revision 11525)
@@ -7,5 +7,5 @@
 \definecolor{bg}{HTML}{f8f8f8}
 \usemintedstyle{emacs}
-\setminted{bgcolor=bg, fontsize=\scriptsize, breaklines, frame=leftline}
+\setminted{bgcolor=bg, fontsize=\scriptsize, breaklines}
 \setminted[xml]{style=borland} %% Specific per language
 
@@ -25,9 +25,8 @@
 
 %% Inline
-\newmintinline[forcode]{fortran}{bgcolor=, fontsize=auto, frame=lines}   % \forcode{...}
-\newmintinline[xmlcode]{xml}{    bgcolor=, fontsize=auto, frame=lines}   % \xmlcode{...}
-\newmintinline[snippet]{console}{bgcolor=, fontsize=auto, frame=lines}   % \snippet{...}
+\newmintinline[forcode]{fortran}{bgcolor=, fontsize=auto}   % \forcode{...}
+\newmintinline[xmlcode]{xml}{    bgcolor=, fontsize=auto}   % \xmlcode{...}
+\newmintinline[snippet]{console}{bgcolor=, fontsize=auto}   % \snippet{...}
 
 %% Namelists inclusion
 \newcommand{\nlst}[1]{\forfile{../../../namelists/#1}}
-
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/info_page.tex
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/info_page.tex	(revision 11524)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/info_page.tex	(revision 11525)
@@ -2,7 +2,7 @@
 \thispagestyle{plain}
 
-% ================================================================
-% Disclaimer
-% ================================================================
+%% ================================================================
+%% Disclaimer
+%% ================================================================
 \subsubsection*{Disclaimer}
 
@@ -11,5 +11,5 @@
 which is a French adaptation of the GNU GPL (\textbf{G}eneral \textbf{P}ublic \textbf{L}icense).
 Anyone may use it freely for research purposes, and is encouraged to
-communicate back to the \NEMO\ team its own developments and improvements.
+communicate back to the development team its own developments and improvements.
 
 The model and the present document have been made available as a service to the community.
@@ -18,10 +18,11 @@
 Users are encouraged to bring them to our attention.
 
-The authors assume no responsibility for problems, errors, or incorrect usage of NEMO.
+The authors assume no responsibility for problems, errors, or incorrect usage of \NEMO.
 
-% ================================================================
-% External resources
-% ================================================================
+%% ================================================================
+%% External resources
+%% ================================================================
 \subsubsection*{Other resources}
+\label{resources}
 
 Additional information can be found on:
@@ -44,16 +45,19 @@
 \end{itemize}
 
-% ================================================================
-% Citation
-% ================================================================
+%% ================================================================
+%% Citation
+%% ================================================================
 \subsubsection*{Citation}
 
 Reference for papers and other publications is as follows:
 
-``{\bfseries \heading}'',
-%\firstauthor and \secondauthor,
-{\em Scientific Notes of Climate Modelling Center}, \textbf{\ipslnum} --- ISSN 1288-1619,
-Institut Pierre-Simon Laplace (IPSL),
-\href{https://doi.org/10.5281/zenodo.\zid}{doi:10.5281/zenodo.\zid}
+\medskip
+
+\begin{sloppypar}
+  ``{\bfseries \heading}\ifdef{\subheading}{ -- \subheading}{}'',
+  {\em Scientific Notes of Climate Modelling Center}, \textbf{\ipslnum} --- ISSN 1288-1619,
+  Institut Pierre-Simon Laplace (IPSL),
+  \href{https://doi.org/10.5281/zenodo.\zid}{doi:10.5281/zenodo.\zid}
+\end{sloppypar}
 
 \begin{figure}[b]
@@ -71,4 +75,2 @@
   \end{minipage}
 \end{figure}
-
-\end{document}
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/new_cmds.tex
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/new_cmds.tex	(revision 11524)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/new_cmds.tex	(revision 11525)
@@ -3,12 +3,23 @@
 
 %% Include references and index for compilation of single subfile
-\newcommand{\mtoc}{\minitoc}
+%\newcommand{\mtoc}{\minitoc}
 \newcommand{\biblio}{ \bibliography{../main/bibliography} }
 \newcommand{\pindex}{\printindex}
 
-%% NEMO and Fortran in small capitals
-\newcommand{\NEMO   }{\textsc{nemo}}
-\newcommand{\SIcube }{\textsc{si$^3$}}
-\newcommand{\TOP    }{\textsc{top}}
+%% Same slanted font for NEMO and its core engines
+\newcommand{\NEMO  }{\textsl{NEMO}}
+\newcommand{\OPA   }{\textsl{OPA}}
+\newcommand{\SIcube}{\textsl{SI$^3$}}
+\newcommand{\TOP   }{\textsl{TOP}}
+\newcommand{\PISCES}{\textsl{PISCES}}
+\newcommand{\NEMOVAR}{\textsl{NEMOVAR}}
+
+%% Links for external components
+\newcommand{\AGRIF}{\href{http://agrif.imag.fr}{AGRIF}}
+\newcommand{\CICE }{\href{http://github.com/CICE-Consortium/CICE}{CICE}}
+\newcommand{\OASIS}{\href{http://portal.enes.org/oasis}{OASIS}}
+\newcommand{\XIOS }{\href{http://forge.ipsl.jussieu.fr/ioserver}{XIOS}}
+
+%% Fortran in small capitals
 \newcommand{\fortran}{\textsc{Fortran}}
 \newcommand{\fninety}{\textsc{Fortran 90}}
@@ -54,2 +65,9 @@
 %% Workaround for issue with \listoffigures
 \DeclareRobustCommand{\triad}[6][]{\ensuremath{ {}_{#2}^{#3} { \mathbb{#4}_{#1} }_{#5}^{\,#6} }}
+
+\newcommand{\chaptertoc}[1][Table of contents]{%
+  \thispagestyle{empty}
+  \etocsettocstyle{\addsec*{#1}}{}%
+  \localtableofcontents%
+  \vfill
+}
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/packages.tex
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/packages.tex	(revision 11524)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/packages.tex	(revision 11525)
@@ -3,34 +3,43 @@
 %% ==============================================================================
 
-%% 'hyperref' pkg is loaded at the end of the preamble
-\usepackage{natbib}                 %% bibtex
-\usepackage{caption}                %% caption
-\usepackage{xcolor}                 %% colour
-\usepackage{times}                  %% font
-\usepackage{enumitem}               %% list
-\usepackage{amsmath}                %% maths
-\usepackage{minitoc}                %% toc
-\usepackage{subfiles}               %% subdocs
-\usepackage{draftwatermark}         %% watermark
-\usepackage[Bjornstrup]{fncychap}   %% headings
+%% 'hyperref' pkg is loaded at the end of the preamble for higher compatibility
+
+%% KOMA-script
+%\usepackage{scrhack}
+\usepackage[footsepline=0.25pt,
+headsepline=0.25pt]{scrlayer-scrpage}
+
+%% customization (layout, header/footer styles & contents, background)
+\usepackage{draftwatermark}
+\usepackage[pass]{geometry}             %% 'pass' to enable \restoregeometry only
+\usepackage[pages = some]{background}   %% 'some' for title page
+\usepackage[Bjornstrup]{fncychap}
+
+%% fonts
 \usepackage{fontspec}
-%\setmainfont[Ligatures=TeX]{Georgia}
-%\setsansfont[Ligatures=TeX]{Arial}
+%% Issue with fontawesome pkg: path to FontAwesome.otf has to be hard-coded
 \defaultfontfeatures{
     Path = /home/ntmlod/.local/texlive2019/texmf-dist/fonts/opentype/public/fontawesome/
 }
-\usepackage{academicons}            %% font
-\usepackage{fontawesome}            %% font
-\usepackage{lastpage}               %% label
-\usepackage[pages = some]{background}             %% decoration
-\usepackage{geometry}               %% margin
+\usepackage{academicons, fontawesome, newtxtext}
 
-%% Extensions in bundle package
-\usepackage{amssymb, graphicx, tabularx, textcomp}
-%\usepackage[utf8]{inputenc}         %% encoding
-\usepackage[footsepline=0.25pt,
-headsepline=0.25pt]{scrlayer-scrpage}   %% page layout
+%% formatting
+\usepackage{tabularx, etoc, xcolor}
+
+%% graphics
+\usepackage{caption, graphicx}
+
+%% labels
+\usepackage{bookmark, lastpage, natbib}
+
+%% mathematics
+\usepackage{amsmath, amssymb}
+
+%% versatility
+\usepackage{subfiles}
 
 %% Configuration
 \graphicspath{ {../../figures/} {../../figures/\engine/} }
-\geometry{showframe}
+
+%% Missing utmr8a font
+\usepackage{times}
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/preamble.tex
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/preamble.tex	(revision 11524)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/preamble.tex	(revision 11525)
@@ -8,4 +8,15 @@
 \input{../../global/indexes}
 \input{../../global/styles}
+\input{../../global/new_cmds}
+%\input{../../global/todonotes}
+
+%% Load hyperref at the end of the preamble to make it work with other pkgs
+\usepackage{hyperref}   %% links
+\hypersetup{
+  colorlinks,
+  citecolor = manualcolor, linkcolor = manualcolor, urlcolor = manualcolor,
+  final = true  %% Links even with draft building
+}
+
 \backgroundsetup{
   firstpage = true,
@@ -17,12 +28,2 @@
   }
 }
-\input{../../global/new_cmds}
-%\input{../../global/todonotes}
-
-%% Load hyperref at the end of the preamble to make it work with other pkgs
-\usepackage{hyperref}   %% links
-\hypersetup{
-  colorlinks,
-  citecolor = manualcolor, linkcolor = manualcolor, urlcolor = manualcolor,
-  final   %% Links even with draft building
-}
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/styles.tex
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/styles.tex	(revision 11524)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/styles.tex	(revision 11525)
@@ -3,8 +3,8 @@
 %% ==============================================================================
 
-\setcolor
-%\definecolor{ghcolor}{HTML}{000333}
+%% Colors
+\setmanualcolor
+\colorlet{manualcolorshaded}{manualcolor!60}
 \definecolor{orcidcolor}{HTML}{A6CE39}
-%\definecolor{wpcolor}{HTML}{464646}
 
 %% Page layout
@@ -13,11 +13,9 @@
 \addtokomafont{pagefoot}{  \sffamily \footnotesize}
 \addtokomafont{pagenumber}{\sffamily \slshape     }
+\addtokomafont{chapter}{\color{white}}
 \ohead{} \ofoot{}   %% Clear defaults
 
 %% Caption
 \captionsetup{font = footnotesize, justification = justified}
-
-%% Additional fonts
-\DeclareMathAlphabet{\mathpzc}{OT1}{pzc}{m}{it}
 
 %% Bibliography
@@ -33,12 +31,30 @@
 \global\let\tikz@ensure@dollar@catcode=\relax
 
-%% Apply engine color for chapter boxes (code from fncychap.sty)
-%\renewcommand{\DOTI}[1]{
-%  \nointerlineskip\raggedright
-%  \fboxsep=\myhi
-%  \vskip-1ex
-%  \colorbox[manualcolor]{.85}{\parbox[t]{\mylen}{\CTV\FmTi{#1}}}\par\nobreak
-%  \vskip 40\p@
-%}
+%% Apply engine color for chapter headings: tweaking snippets from fncychap.sty
+\renewcommand{\DOCH}{%
+  \settowidth{\py}{\CNoV\thechapter}
+  \addtolength{\py}{-10pt}      % Amount of space by which the
+%                                  % number is shifted right
+  \fboxsep=0pt%
+  \colorbox{manualcolor}{\rule{0pt}{40pt}\parbox[b]{\textwidth}{\hfill}}%
+  \kern-\py\raise20pt%
+  \hbox{\color{manualcolorshaded}\CNoV\thechapter}\\%
+}
+\renewcommand{\DOTI}[1]{%
+  \nointerlineskip\raggedright%
+  \fboxsep=\myhi%
+  \vskip-1ex%
+  \colorbox{manualcolor}{\parbox[t]{\mylen}{\color{white}\CTV\FmTi{#1}}}\par\nobreak%
+  \vskip 40\p@%
+}
+\renewcommand{\DOTIS}[1]{%
+  \fboxsep=0pt
+  \colorbox{manualcolor}{\rule{0pt}{40pt}\parbox[b]{\textwidth}{\hfill}}\\%
+  \nointerlineskip\raggedright%
+  \fboxsep=\myhi%
+  \vskip-1ex% Remove white 1pt line
+  \colorbox{manualcolor}{\parbox[t]{\mylen}{\color{white}\CTV\FmTi{#1}}}\par\nobreak%
+  \vskip 40\p@%
+}
 
 \makeatother
