Index: NEMO/trunk/doc/latex/.svnignore
===================================================================
--- NEMO/trunk/doc/latex/.svnignore	(revision 12206)
+++ NEMO/trunk/doc/latex/.svnignore	(revision 12377)
@@ -8,5 +8,7 @@
 *.ilg
 *.ind
-*.lo*
+*.lof
+*.log
+*.lot
 *.maf
 *.mtc*
@@ -14,4 +16,3 @@
 *.pdf
 *.toc
-*.xdv
 _minted-*
Index: NEMO/trunk/doc/latex/NEMO/main/NEMO_manual.ist
===================================================================
--- NEMO/trunk/doc/latex/NEMO/main/NEMO_manual.ist	(revision 12377)
+++ NEMO/trunk/doc/latex/NEMO/main/NEMO_manual.ist	(revision 12377)
@@ -0,0 +1,1 @@
+link ../../global/index.ist
Index: NEMO/trunk/doc/latex/NEMO/main/appendices.tex
===================================================================
--- NEMO/trunk/doc/latex/NEMO/main/appendices.tex	(revision 12206)
+++ NEMO/trunk/doc/latex/NEMO/main/appendices.tex	(revision 12377)
@@ -1,8 +1,8 @@
 
-\subfile{../subfiles/apdx_s_coord}      %% A. Generalised vertical coordinate
-\subfile{../subfiles/apdx_diff_opers}   %% B. Diffusive operators
-\subfile{../subfiles/apdx_invariants}   %% C. Discrete invariants of the eqs.
-\subfile{../subfiles/apdx_triads}       %% D. Isoneutral diffusion using triads
-\subfile{../subfiles/apdx_DOMAINcfg}    %% E. Brief notes on DOMAINcfg
+\subfile{../subfiles/annex_A}             %% Generalised vertical coordinate
+\subfile{../subfiles/annex_B}             %% Diffusive operator
+\subfile{../subfiles/annex_C}             %% Discrete invariants of the eqs.
+\subfile{../subfiles/annex_iso}	          %% Isoneutral diffusion using triads
+\subfile{../subfiles/annex_D}             %% Coding rules
 
 %% Not included
@@ -10,3 +10,4 @@
 %\subfile{../subfiles/chap_DIU}
 %\subfile{../subfiles/chap_conservation}
-%\subfile{../subfiles/apdx_algos}   %% Notes on some on going staff
+%\subfile{../subfiles/annex_E}				%% Notes on some on going staff
+
Index: NEMO/trunk/doc/latex/NEMO/main/bibliography.bib
===================================================================
--- NEMO/trunk/doc/latex/NEMO/main/bibliography.bib	(revision 12206)
+++ NEMO/trunk/doc/latex/NEMO/main/bibliography.bib	(revision 12377)
@@ -400,6 +400,6 @@
 }
 
-@article{         brodeau.barnier.ea_JPO16,
-  title         = "Climatologically Significant Effects of Some Approximations in the Bulk Parameterizations of Turbulent Air–Sea Fluxes",
+@article{         brodeau.barnier.ea_JPO17,
+  title         = "Climatologically Significant Effects of Some Approximations in the Bulk Parameterizations of Turbulent Air{\textendash}Sea Fluxes",
   pages         = "5--28",
   journal       = "Journal of Physical Oceanography",
@@ -407,5 +407,5 @@
   number        = "1",
   author        = "Brodeau, Laurent and Barnier, Bernard and Gulev, Sergey K. and Woods, Cian",
-  year          = "2016",
+  year          = "2017",
   month         = "jan",
   publisher     = "American Meteorological Society",
@@ -3134,2 +3134,73 @@
   doi           = "10.1029/92jc00911"
 }
+
+@article{large.yeager_CD09,
+author="Large, W. G. and Yeager, S. G.",
+title="The Global Climatology of an Interannually Varying Air-Sea Flux Data Set",
+pages = "341--364",
+journal="Climate Dynamics",
+volume = "33",
+number = "2-3",
+year="2009",
+month = "aug",
+publisher = "Springer Science and Business Media LLC",
+doi="10.1007/s00382-008-0441-3"
+}
+
+@book{sverdrup.johnson.ea_1942,
+author = {H. U. Sverdrup and Martin W. Johnson and Richard H. Fleming},
+title = {The Oceans, Their Physics, Chemistry, and General Biology},
+publisher = {Prentice-Hall},
+address = {New York},
+year = {1942},
+pages = {1087},
+}
+
+@article{kraus.businger_QJRMS96,
+author = "E. B. Kraus and J. A. Businger",
+title = "Atmosphere-ocean interaction.",
+journal="Quarterly Journal of the Royal Meteorological Society",,
+year = "1996",
+volume = "122",
+number = "529",
+pages = "324-325",
+publisher = "John Wiley & Sons, Ltd",
+issn = "1477-870X",
+doi = "10.1002/qj.49712252914"
+}
+
+@article{josey.gulev.ea_2013,
+title = "Exchanges through the ocean surface",
+journal = "Ocean Circulation and Climate - A 21st Century Perspective, Int. Geophys. Ser.",
+year = "2013",
+author = "S. A. Josey and S. Gulev and L. Yu",
+pages = "115-140, edited by G. Siedler et al., Academic Press, Oxford",
+volume = "103",
+doi = "10.1016/B978-0-12-391851-2.00005-2"
+}
+
+@article{fairall.bradley.ea_JGR96,
+  year = "1996",
+ journal = "Journal of Geophysical Research: Oceans",
+  month = "jan",
+  publisher = "American Geophysical Union",
+  volume = "101",
+  number = "C1",
+  pages = "1295-1308",
+  author = "C. W. Fairall and E. F. Bradley and J. S. Godfrey and G. A. Wick and J. B. Edson and G. S. Young",
+  title = "Cool-skin and warm-layer effects on sea surface temperature",
+  doi = "10.1029/95jc03190"
+}
+
+@article{zeng.beljaars_GRL05,
+  year = "2005",
+  month = "jul",
+  publisher = "American Geophysical Union",
+  volume = "32",
+  number = "14",
+  author = "Xubin Zeng and Anton Beljaars",
+  title = "A prognostic scheme of sea surface skin temperature for modeling and data assimilation",
+  journal = "Geophysical Research Letters",
+  doi = "10.1029/2005gl023030"
+}
+
Index: NEMO/trunk/doc/latex/NEMO/main/chapters.tex
===================================================================
--- NEMO/trunk/doc/latex/NEMO/main/chapters.tex	(revision 12206)
+++ NEMO/trunk/doc/latex/NEMO/main/chapters.tex	(revision 12377)
@@ -1,20 +1,16 @@
-\subfile{../subfiles/chap_model_basics}   %% 1.
-\subfile{../subfiles/chap_time_domain}    %% 2.  Time discretisation (time stepping strategy)
-\subfile{../subfiles/chap_DOM}            %% 3.  Space discretisation
-\subfile{../subfiles/chap_TRA}            %% 4.  Tracer advection/diffusion equation
-\subfile{../subfiles/chap_DYN}            %% 5.  Dynamics : momentum equation
-\subfile{../subfiles/chap_SBC}            %% 6.  Surface Boundary Conditions
-\subfile{../subfiles/chap_LBC}            %% 7.  Lateral Boundary Conditions
-\subfile{../subfiles/chap_LDF}            %% 8.  Lateral diffusion
-\subfile{../subfiles/chap_ZDF}            %% 9.  Vertical diffusion
-\subfile{../subfiles/chap_DIA}            %% 10. Outputs and Diagnostics
-\subfile{../subfiles/chap_OBS}            %% 11. Observation operator
-\subfile{../subfiles/chap_ASM}            %% 12. Assimilation increments
-\subfile{../subfiles/chap_STO}            %% 13. Stochastic param.
-\subfile{../subfiles/chap_misc}           %% 14. Miscellaneous topics
-\subfile{../subfiles/chap_cfgs}           %% 15. Predefined configurations
-
-%% Not included
-%\subfile{../subfiles/chap_model_basics_zstar}
-%\subfile{../subfiles/chap_DIU}
-%\subfile{../subfiles/chap_conservation}
+\subfile{../subfiles/introduction}        %% Introduction
+\subfile{../subfiles/chap_model_basics}
+\subfile{../subfiles/chap_time_domain}    %% Time discretisation (time stepping strategy)
+\subfile{../subfiles/chap_DOM}            %% Space discretisation
+\subfile{../subfiles/chap_TRA}            %% Tracer advection/diffusion equation
+\subfile{../subfiles/chap_DYN}            %% Dynamics : momentum equation
+\subfile{../subfiles/chap_SBC}            %% Surface Boundary Conditions
+\subfile{../subfiles/chap_LBC}            %% Lateral Boundary Conditions
+\subfile{../subfiles/chap_LDF}            %% Lateral diffusion
+\subfile{../subfiles/chap_ZDF}            %% Vertical diffusion
+\subfile{../subfiles/chap_DIA}            %% Outputs and Diagnostics
+\subfile{../subfiles/chap_OBS}            %% Observation operator
+\subfile{../subfiles/chap_ASM}            %% Assimilation increments
+\subfile{../subfiles/chap_STO}            %% Stochastic param.
+\subfile{../subfiles/chap_misc}           %% Miscellaneous topics
+\subfile{../subfiles/chap_CONFIG}         %% Predefined configurations
Index: NEMO/trunk/doc/latex/NEMO/main/definitions.tex
===================================================================
--- NEMO/trunk/doc/latex/NEMO/main/definitions.tex	(revision 12377)
+++ NEMO/trunk/doc/latex/NEMO/main/definitions.tex	(revision 12377)
@@ -0,0 +1,15 @@
+%% Engine (folder name)
+\def \engine{NEMO}
+
+%% Title (variable name already use by 'titling' pkg)
+\def \heading{NEMO ocean engine}
+
+%% Authors (thanks will apply to the second author)
+\def \firstauthor{Gurvan Madec~}
+\def \secondauthor{NEMO System Team}
+
+%% IPSL publication number
+\def \ipslnum{27}
+
+%% Zenodo ID, i.e. doi:10.5281/zenodo.\([0-9]*\)
+\def \zid{1464816}
Index: NEMO/trunk/doc/latex/NEMO/main/foreword.tex
===================================================================
--- NEMO/trunk/doc/latex/NEMO/main/foreword.tex	(revision 12377)
+++ NEMO/trunk/doc/latex/NEMO/main/foreword.tex	(revision 12377)
@@ -0,0 +1,22 @@
+% ================================================================
+% Foreword
+% ================================================================
+\chapter*{Foreword}
+
+The ocean engine of NEMO (Nucleus for European Modelling of the Ocean) is a primitive equation model adapted to
+regional and global ocean circulation problems.
+It is intended to be a flexible tool for studying the ocean and its interactions with the others components of
+the earth climate system over a wide range of space and time scales.
+
+Prognostic variables are the three-dimensional velocity field, a non-linear sea surface height,
+the \textit{Conservative} Temperature and the \textit{Absolute} Salinity.
+In the horizontal direction, the model uses a curvilinear orthogonal grid and in the vertical direction,
+a full or partial step $z$-coordinate, or $s$-coordinate, or a mixture of the two.
+The distribution of variables is a three-dimensional Arakawa C-type grid.
+Various physical choices are available to describe ocean physics, including TKE, and GLS vertical physics.
+
+Within NEMO, the ocean is interfaced with a sea-ice model (SI$^3$)
+ %or \href{https://github.com/CICE-Consortium/CICE}{CICE}),
+passive tracer and biogeochemical models (TOP-PISCES) and,
+via the \href{https://portal.enes.org/oasis}{OASIS} coupler, with several atmospheric general circulation models.
+It also support two-way grid embedding via the \href{http://agrif.imag.fr}{AGRIF} software.
Index: NEMO/trunk/doc/latex/NEMO/main/thanks.tex
===================================================================
--- NEMO/trunk/doc/latex/NEMO/main/thanks.tex	(revision 12377)
+++ NEMO/trunk/doc/latex/NEMO/main/thanks.tex	(revision 12377)
@@ -0,0 +1,2 @@
+J\'{e}r\^{o}me Chanut,
+Silvia Mocavero
Index: NEMO/trunk/doc/latex/NEMO/subfiles/chap_DIA.tex
===================================================================
--- NEMO/trunk/doc/latex/NEMO/subfiles/chap_DIA.tex	(revision 12206)
+++ NEMO/trunk/doc/latex/NEMO/subfiles/chap_DIA.tex	(revision 12377)
@@ -1580,50 +1580,4 @@
 
 %% =================================================================================================
-\section[Harmonic analysis of tidal constituents (\texttt{\textbf{key\_diaharm}})]{Harmonic analysis of tidal constituents (\protect\key{diaharm})}
-\label{sec:DIA_diag_harm}
-
-\begin{listing}
-  \nlst{nam_diaharm}
-  \caption{\forcode{&nam_diaharm}}
-  \label{lst:nam_diaharm}
-\end{listing}
-
-A module is available to compute the amplitude and phase of tidal waves.
-This on-line Harmonic analysis is actived with \key{diaharm}.
-
-Some parameters are available in namelist \nam{_diaharm}{\_diaharm}:
-
- - \np{nit000_han}{nit000\_han} is the first time step used for harmonic analysis
-
- - \np{nitend_han}{nitend\_han} is the  last time step used for harmonic analysis
-
- - \np{nstep_han}{nstep\_han}  is the  time step frequency for harmonic analysis
-
-% - \np{nb_ana}{nb\_ana}     is the number of harmonics to analyse
-
- - \np{tname}{tname}       is an array with names of tidal constituents to analyse
-
- \np{nit000_han}{nit000\_han} and \np{nitend_han}{nitend\_han} must be between \np{nit000}{nit000} and \np{nitend}{nitend} of the simulation.
- The restart capability is not implemented.
-
- The Harmonic analysis solve the following equation:
-
- \[
-   h_{i} - A_{0} + \sum^{nb\_ana}_{j=1}[A_{j}cos(\nu_{j}t_{j}-\phi_{j})] = e_{i}
- \]
-
-With $A_{j}$, $\nu_{j}$, $\phi_{j}$, the amplitude, frequency and phase for each wave and $e_{i}$ the error.
-$h_{i}$ is the sea level for the time $t_{i}$ and $A_{0}$ is the mean sea level. \\
-We can rewrite this equation:
-
-\[
-  h_{i} - A_{0} + \sum^{nb\_ana}_{j=1}[C_{j}cos(\nu_{j}t_{j})+S_{j}sin(\nu_{j}t_{j})] = e_{i}
-\]
-
-with $A_{j}=\sqrt{C^{2}_{j}+S^{2}_{j}}$ and $\phi_{j}=arctan(S_{j}/C_{j})$.
-
-We obtain in output $C_{j}$ and $S_{j}$ for each tidal wave.
-
-%% =================================================================================================
 \section[Transports across sections (\texttt{\textbf{key\_diadct}})]{Transports across sections (\protect\key{diadct})}
 \label{sec:DIA_diag_dct}
Index: NEMO/trunk/doc/latex/NEMO/subfiles/chap_SBC.tex
===================================================================
--- NEMO/trunk/doc/latex/NEMO/subfiles/chap_SBC.tex	(revision 12206)
+++ NEMO/trunk/doc/latex/NEMO/subfiles/chap_SBC.tex	(revision 12377)
@@ -1,3 +1,5 @@
 \documentclass[../main/NEMO_manual]{subfiles}
+\usepackage{fontspec}
+\usepackage{fontawesome}
 
 \begin{document}
@@ -45,5 +47,5 @@
 
 \begin{itemize}
-\item a bulk formulation (\np[=.true.]{ln_blk}{ln\_blk} with four possible bulk algorithms),
+\item a bulk formulation (\np[=.true.]{ln_blk}{ln\_blk}), featuring a selection of four bulk parameterization algorithms,
 \item a flux formulation (\np[=.true.]{ln_flx}{ln\_flx}),
 \item a coupled or mixed forced/coupled formulation (exchanges with a atmospheric model via the OASIS coupler),
@@ -504,4 +506,7 @@
 \label{sec:SBC_flx}
 
+% Laurent: DO NOT mix up ``bulk formulae'' (the classic equation) and the ``bulk
+% parameterization'' (i.e NCAR, COARE, ECMWF...)
+
 \begin{listing}
   \nlst{namsbc_flx}
@@ -520,7 +525,17 @@
 See \autoref{subsec:SBC_ssr} for its specification.
 
-%% =================================================================================================
+
+
+
+
+
+
+%% =================================================================================================
+\pagebreak
+\newpage
 \section[Bulk formulation (\textit{sbcblk.F90})]{Bulk formulation (\protect\mdl{sbcblk})}
 \label{sec:SBC_blk}
+
+% L. Brodeau, December 2019... %
 
 \begin{listing}
@@ -530,17 +545,263 @@
 \end{listing}
 
-In the bulk formulation, the surface boundary condition fields are computed with bulk formulae using atmospheric fields
-and ocean (and sea-ice) variables averaged over \np{nn_fsbc}{nn\_fsbc} time-step.
-
-The atmospheric fields used depend on the bulk formulae used.
-In forced mode, when a sea-ice model is used, a specific bulk formulation is used.
-Therefore, different bulk formulae are used for the turbulent fluxes computation
-over the ocean and over sea-ice surface.
-For the ocean, four bulk formulations are available thanks to the \href{https://brodeau.github.io/aerobulk/}{Aerobulk} package (\citet{brodeau.barnier.ea_JPO16}):
-the NCAR (formerly named CORE), COARE 3.0, COARE 3.5 and ECMWF bulk formulae.
-The choice is made by setting to true one of the following namelist variable:
- \np{ln_NCAR}{ln\_NCAR}, \np{ln_COARE_3p0}{ln\_COARE\_3p0},  \np{ln_COARE_3p5}{ln\_COARE\_3p5} and  \np{ln_ECMWF}{ln\_ECMWF}.
-For sea-ice, three possibilities can be selected:
-a constant transfer coefficient (1.4e-3; default value), \citet{lupkes.gryanik.ea_JGR12} (\np{ln_Cd_L12}{ln\_Cd\_L12}), and \citet{lupkes.gryanik_JGR15} (\np{ln_Cd_L15}{ln\_Cd\_L15}) parameterizations
+If the bulk formulation is selected (\np[=.true.]{ln_blk}{ln\_blk}), the air-sea
+fluxes associated with surface boundary conditions are estimated by means of the
+traditional \emph{bulk formulae}. As input, bulk formulae rely on a prescribed
+near-surface atmosphere state (typically extracted from a weather reanalysis)
+and the prognostic sea (-ice) surface state averaged over \np{nn_fsbc}{nn\_fsbc}
+time-step(s).
+
+% Turbulent air-sea fluxes are computed using the sea surface properties and
+% atmospheric SSVs at height $z$ above the sea surface, with the traditional
+% aerodynamic bulk formulae:
+
+Note: all the NEMO Fortran routines involved in the present section have been
+ initially developed (and are still developed in parallel) in
+ the \href{https://brodeau.github.io/aerobulk/}{\texttt{AeroBulk}} open-source project
+\citep{brodeau.barnier.ea_JPO17}.
+
+%%% Bulk formulae are this:
+\subsection{Bulk formulae}\label{subsec:SBC_blkform}
+%
+In NEMO, the set of equations that relate each component of the surface fluxes
+to the near-surface atmosphere and sea surface states writes
+%
+\begin{subequations}\label{eq_bulk}
+  \label{eq:SBC_bulk_form}
+  \begin{eqnarray}
+    \mathbf{\tau} &=& \rho~ C_D ~ \mathbf{U}_z  ~ U_B \\
+    Q_H           &=& \rho~C_H~C_P~\big[ \theta_z - T_s \big] ~ U_B \\
+    E             &=& \rho~C_E    ~\big[    q_s   - q_z \big] ~ U_B \\
+    Q_L           &=& -L_v \, E \\
+    %
+    Q_{sr}        &=& (1 - a) Q_{sw\downarrow} \\
+    Q_{ir}        &=& \delta (Q_{lw\downarrow} -\sigma T_s^4)
+  \end{eqnarray}
+\end{subequations}
+%
+with
+   \[ \theta_z \simeq T_z+\gamma z \]
+   \[  q_s \simeq 0.98\,q_{sat}(T_s,p_a ) \]
+%
+from which, the the non-solar heat flux is \[ Q_{ns} = Q_L + Q_H + Q_{ir} \]
+%
+where $\mathbf{\tau}$ is the wind stress vector, $Q_H$ the sensible heat flux,
+$E$ the evaporation, $Q_L$ the latent heat flux, and $Q_{ir}$ the net longwave
+flux.
+%
+$Q_{sw\downarrow}$ and $Q_{lw\downarrow}$ are the surface downwelling shortwave
+and longwave radiative fluxes, respectively.
+%
+Note: a positive sign for $\mathbf{\tau}$, $Q_H$, $Q_L$, $Q_{sr}$ or $Q_{ir}$
+implies a gain of the relevant quantity for the ocean, while a positive $E$
+implies a freshwater loss for the ocean.
+%
+$\rho$ is the density of air. $C_D$, $C_H$ and $C_E$ are the bulk transfer
+coefficients for momentum, sensible heat, and moisture, respectively.
+%
+$C_P$ is the heat capacity of moist air, and $L_v$ is the latent heat of
+vaporization of water.
+%
+$\theta_z$, $T_z$ and $q_z$ are the potential temperature, absolute temperature,
+and specific humidity of air at height $z$ above the sea surface,
+respectively. $\gamma z$ is a temperature correction term which accounts for the
+adiabatic lapse rate and approximates the potential temperature at height
+$z$ \citep{josey.gulev.ea_2013}.
+%
+$\mathbf{U}_z$ is the wind speed vector at height $z$ above the sea surface
+(possibly referenced to the surface current $\mathbf{u_0}$,
+section \ref{s_res1}.\ref{ss_current}).
+%
+The bulk scalar wind speed, namely $U_B$, is the scalar wind speed,
+$|\mathbf{U}_z|$, with the potential inclusion of a gustiness contribution.
+%
+$a$ and $\delta$ are the albedo and emissivity of the sea surface, respectively.\\
+%
+%$p_a$ is the mean sea-level pressure (SLP).
+%
+$T_s$ is the sea surface temperature. $q_s$ is the saturation specific humidity
+of air at temperature $T_s$; it includes a 2\% reduction to account for the
+presence of salt in seawater \citep{sverdrup.johnson.ea_1942,kraus.businger_QJRMS96}.
+Depending on the bulk parametrization used, $T_s$ can either be the temperature
+at the air-sea interface (skin temperature, hereafter SSST) or at typically a
+few tens of centimeters below the surface (bulk sea surface temperature,
+hereafter SST).
+%
+The SSST differs from the SST due to the contributions of two effects of
+opposite sign, the \emph{cool skin} and \emph{warm layer} (hereafter CS and WL,
+respectively, see section\,\ref{subsec:SBC_skin}).
+%
+Technically, when the ECMWF or COARE* bulk parametrizations are selected
+(\np[=.true.]{ln_ECMWF}{ln\_ECMWF} or \np[=.true.]{ln_COARE*}{ln\_COARE\*}),
+$T_s$ is the SSST, as opposed to the NCAR bulk parametrization
+(\np[=.true.]{ln_NCAR}{ln\_NCAR}) for which $T_s$ is the bulk SST (\ie~temperature
+at first T-point level).
+
+For more details on all these aspects the reader is invited to refer
+to \citet{brodeau.barnier.ea_JPO17}.
+
+
+
+\subsection{Bulk parametrizations}\label{subsec:SBC_blk_ocean}
+%%%\label{subsec:SBC_param}
+
+Accuracy of the estimate of surface turbulent fluxes by means of bulk formulae
+strongly relies on that of the bulk transfer coefficients: $C_D$, $C_H$ and
+$C_E$. They are estimated with what we refer to as a \emph{bulk
+parametrization} algorithm. When relevant, these algorithms also perform the
+height adjustment of humidity and temperature to the wind reference measurement
+height (from \np{rn_zqt}{rn\_zqt} to \np{rn_zu}{rn\_zu}).
+
+
+
+For the open ocean, four bulk parametrization algorithms are available in NEMO:
+\begin{itemize}
+\item NCAR, formerly known as CORE, \citep{large.yeager_rpt04,large.yeager_CD09}
+\item COARE 3.0 \citep{fairall.bradley.ea_JC03}
+\item COARE 3.6 \citep{edson.jampana.ea_JPO13}
+\item ECMWF (IFS documentation, cy45)
+\end{itemize}
+
+
+With respect to version 3, the principal advances in version 3.6 of the COARE
+bulk parametrization are built around improvements in the representation of the
+effects of waves on
+fluxes \citep{edson.jampana.ea_JPO13,brodeau.barnier.ea_JPO17}. This includes
+improved relationships of surface roughness, and whitecap fraction on wave
+parameters. It is therefore recommended to chose version 3.6 over 3.
+
+
+
+
+\subsection{Cool-skin and warm-layer parametrizations}\label{subsec:SBC_skin}
+%\subsection[Cool-skin and warm-layer parameterizations
+%(\forcode{ln_skin_cs} \& \forcode{ln_skin_wl})]{Cool-skin and warm-layer parameterizations (\protect\np{ln_skin_cs}{ln\_skin\_cs} \& \np{ln_skin_wl}{ln\_skin\_wl})}
+%\label{subsec:SBC_skin}
+%
+As opposed to the NCAR bulk parametrization, more advanced bulk
+parametrizations such as COARE3.x and ECMWF are meant to be used with the skin
+temperature $T_s$ rather than the bulk SST (which, in NEMO is the temperature at
+the first T-point level, see section\,\ref{subsec:SBC_blkform}).
+%
+As such, the relevant cool-skin and warm-layer parametrization must be
+activated through \np[=T]{ln_skin_cs}{ln\_skin\_cs}
+and \np[=T]{ln_skin_wl}{ln\_skin\_wl} to use COARE3.x or ECMWF in a consistent
+way.
+
+\texttt{\#LB: ADD BLBLA ABOUT THE TWO CS/WL PARAMETRIZATIONS (ECMWF and COARE) !!!}
+
+For the cool-skin scheme parametrization COARE and ECMWF algorithms share the same
+basis: \citet{fairall.bradley.ea_JGR96}. With some minor updates based
+on \citet{zeng.beljaars_GRL05} for ECMWF, and \citet{fairall.ea_19} for COARE
+3.6.
+
+For the warm-layer scheme, ECMWF is based on \citet{zeng.beljaars_GRL05} with a
+recent update from \citet{takaya.bidlot.ea_JGR10} (consideration of the
+turbulence input from Langmuir circulation).
+
+Importantly, COARE warm-layer scheme \citep{fairall.ea_19} includes a prognostic
+equation for the thickness of the warm-layer, while it is considered as constant
+in the ECWMF algorithm.
+
+
+\subsection{Appropriate use of each bulk parametrization}
+
+\subsubsection{NCAR}
+
+NCAR bulk parametrizations (formerly known as CORE) is meant to be used with the
+CORE II atmospheric forcing \citep{large.yeager_CD09}. The expected sea surface
+temperature is the bulk SST. Hence the following namelist parameters must be
+set:
+%
+\begin{verbatim}
+  ...
+  ln_NCAR    = .true.
+  ...
+  rn_zqt     = 10.     ! Air temperature & humidity reference height (m)
+  rn_zu      = 10.     ! Wind vector reference height (m)
+  ...
+  ln_skin_cs = .false. ! use the cool-skin parameterization
+  ln_skin_wl = .false. ! use the warm-layer parameterization
+  ...
+  ln_humi_sph = .true. ! humidity "sn_humi" is specific humidity  [kg/kg]
+\end{verbatim}
+
+
+\subsubsection{ECMWF}
+%
+With an atmospheric forcing based on a reanalysis of the ECMWF, such as the
+Drakkar Forcing Set \citep{brodeau.barnier.ea_OM10}, we strongly recommend to
+use the ECMWF bulk parametrizations with the cool-skin and warm-layer
+parametrizations activated. In ECMWF reanalyzes, since air temperature and
+humidity are provided at the 2\,m height, and given that the humidity is
+distributed as the dew-point temperature, the namelist must be tuned as follows:
+%
+\begin{verbatim}
+  ...
+  ln_ECMWF   = .true.
+  ...     
+  rn_zqt     =  2.     ! Air temperature & humidity reference height (m)
+  rn_zu      = 10.     ! Wind vector reference height (m)
+  ...
+  ln_skin_cs = .true. ! use the cool-skin parameterization
+  ln_skin_wl = .true. ! use the warm-layer parameterization
+  ...
+  ln_humi_dpt = .true. !  humidity "sn_humi" is dew-point temperature [K]
+  ...
+\end{verbatim}
+%
+Note: when \np{ln_ECMWF}{ln\_ECMWF} is selected, the selection
+of \np{ln_skin_cs}{ln\_skin\_cs} and \np{ln_skin_wl}{ln\_skin\_wl} implicitly
+triggers the use of the ECMWF cool-skin and warm-layer parametrizations,
+respectively (found in \textit{sbcblk\_skin\_ecmwf.F90}).
+
+
+\subsubsection{COARE 3.x}
+%
+Since the ECMWF parametrization is largely based on the COARE* parametrization,
+the two algorithms are very similar in terms of structure and closure
+approach. As such, the namelist tuning for COARE 3.x is identical to that of
+ECMWF:
+%
+\begin{verbatim}
+  ...
+  ln_COARE3p6 = .true.
+  ...     
+  ln_skin_cs = .true. ! use the cool-skin parameterization
+  ln_skin_wl = .true. ! use the warm-layer parameterization
+  ...
+\end{verbatim}
+
+Note: when \np[=T]{ln_COARE3p0}{ln\_COARE3p0} is selected, the selection
+of \np{ln_skin_cs}{ln\_skin\_cs} and \np{ln_skin_wl}{ln\_skin\_wl} implicitly
+triggers the use of the COARE cool-skin and warm-layer parametrizations,
+respectively (found in \textit{sbcblk\_skin\_coare.F90}).
+
+
+%lulu
+
+
+
+% In a typical bulk algorithm, the BTCs under neutral stability conditions are
+% defined using \emph{in-situ} flux measurements while their dependence on the
+% stability is accounted through the \emph{Monin-Obukhov Similarity Theory} and
+% the \emph{flux-profile} relationships \citep[\eg{}][]{Paulson_1970}. BTCs are
+% functions of the wind speed and the near-surface stability of the atmospheric
+% surface layer (hereafter ASL), and hence, depend on $U_B$, $T_s$, $T_z$, $q_s$
+% and $q_z$.
+
+
+
+\subsection{Prescribed near-surface atmospheric state}
+
+The atmospheric fields used depend on the bulk formulae used.  In forced mode,
+when a sea-ice model is used, a specific bulk formulation is used.  Therefore,
+different bulk formulae are used for the turbulent fluxes computation over the
+ocean and over sea-ice surface.
+%
+
+%The choice is made by setting to true one of the following namelist
+%variable: \np{ln_NCAR}{ln\_NCAR}, \np{ln_COARE_3p0}{ln\_COARE\_3p0}, \np{ln_COARE_3p6}{ln\_COARE\_3p6}
+%and \np{ln_ECMWF}{ln\_ECMWF}. 
 
 Common options are defined through the \nam{sbc_blk}{sbc\_blk} namelist variables.
@@ -553,15 +814,17 @@
     Variable description                 & Model variable & Units              & point \\
     \hline
-    i-component of the 10m air velocity  & utau           & $m.s^{-1}$         & T     \\
+    i-component of the 10m air velocity  & wndi           & $m.s^{-1}$         & T     \\
     \hline
-    j-component of the 10m air velocity  & vtau           & $m.s^{-1}$         & T     \\
+    j-component of the 10m air velocity  & wndj           & $m.s^{-1}$         & T     \\
     \hline
-    10m air temperature                  & tair           & \r{}$K$            & T     \\
+    10m air temperature                  & tair           & $K$               & T     \\
     \hline
-    Specific humidity                    & humi           & \%                 & T     \\
+    Specific humidity                    & humi           & $-$               & T     \\
+    Relative humidity                    & ~              & $\%$              & T     \\
+    Dew-point temperature                & ~              & $K$               & T     \\    
     \hline
-    Incoming long wave radiation         & qlw            & $W.m^{-2}$         & T     \\
+    Downwelling longwave radiation       & qlw            & $W.m^{-2}$         & T     \\
     \hline
-    Incoming short wave radiation        & qsr            & $W.m^{-2}$         & T     \\
+    Downwelling shortwave radiation      & qsr            & $W.m^{-2}$         & T     \\
     \hline
     Total precipitation (liquid + solid) & precip         & $Kg.m^{-2}.s^{-1}$ & T     \\
@@ -584,5 +847,5 @@
 
 \np{cn_dir}{cn\_dir} is the directory of location of bulk files
-\np{ln_taudif}{ln\_taudif} is the flag to specify if we use Hight Frequency (HF) tau information (.true.) or not (.false.)
+%\np{ln_taudif}{ln\_taudif} is the flag to specify if we use High Frequency (HF) tau information (.true.) or not (.false.)
 \np{rn_zqt}{rn\_zqt}: is the height of humidity and temperature measurements (m)
 \np{rn_zu}{rn\_zu}: is the height of wind measurements (m)
@@ -595,32 +858,63 @@
 Its range must be between zero and one, and it is recommended to set it to 0 at low-resolution (ORCA2 configuration).
 
-As for the flux formulation, information about the input data required by the model is provided in
+As for the flux parametrization, information about the input data required by the model is provided in
 the namsbc\_blk namelist (see \autoref{subsec:SBC_fldread}).
 
-%% =================================================================================================
-\subsection[Ocean-Atmosphere Bulk formulae (\textit{sbcblk\_algo\_coare.F90, sbcblk\_algo\_coare3p5.F90, sbcblk\_algo\_ecmwf.F90, sbcblk\_algo\_ncar.F90})]{Ocean-Atmosphere Bulk formulae (\mdl{sbcblk\_algo\_coare}, \mdl{sbcblk\_algo\_coare3p5}, \mdl{sbcblk\_algo\_ecmwf}, \mdl{sbcblk\_algo\_ncar})}
-\label{subsec:SBC_blk_ocean}
-
-Four different bulk algorithms are available to compute surface turbulent momentum and heat fluxes over the ocean.
-COARE 3.0, COARE 3.5 and ECMWF schemes mainly differ by their roughness lenghts computation and consequently
-their neutral transfer coefficients relationships with neutral wind.
-\begin{itemize}
-\item NCAR (\np[=.true.]{ln_NCAR}{ln\_NCAR}): The NCAR bulk formulae have been developed by \citet{large.yeager_rpt04}.
-  They have been designed to handle the NCAR forcing, a mixture of NCEP reanalysis and satellite data.
-  They use an inertial dissipative method to compute the turbulent transfer coefficients
-  (momentum, sensible heat and evaporation) from the 10m wind speed, air temperature and specific humidity.
-  This \citet{large.yeager_rpt04} dataset is available through
-  the \href{http://nomads.gfdl.noaa.gov/nomads/forms/mom4/NCAR.html}{GFDL web site}.
-  Note that substituting ERA40 to NCEP reanalysis fields does not require changes in the bulk formulea themself.
-  This is the so-called DRAKKAR Forcing Set (DFS) \citep{brodeau.barnier.ea_OM10}.
-\item COARE 3.0 (\np[=.true.]{ln_COARE_3p0}{ln\_COARE\_3p0}): See \citet{fairall.bradley.ea_JC03} for more details
-\item COARE 3.5 (\np[=.true.]{ln_COARE_3p5}{ln\_COARE\_3p5}): See \citet{edson.jampana.ea_JPO13} for more details
-\item ECMWF (\np[=.true.]{ln_ECMWF}{ln\_ECMWF}): Based on \href{https://www.ecmwf.int/node/9221}{IFS (Cy31)} implementation and documentation.
-  Surface roughness lengths needed for the Obukhov length are computed following \citet{beljaars_QJRMS95}.
-\end{itemize}
+
+\subsubsection{Air humidity}
+
+Air humidity can be provided as three different parameters: specific humidity
+[kg/kg], relative humidity [\%], or dew-point temperature [K] (LINK to namelist
+parameters)...
+
+
+~\\
+
+
+
+
+
+
+
+
+
+
+%% =================================================================================================
+%\subsection[Ocean-Atmosphere Bulk formulae (\textit{sbcblk\_algo\_coare3p0.F90, sbcblk\_algo\_coare3p6.F90, %sbcblk\_algo\_ecmwf.F90, sbcblk\_algo\_ncar.F90})]{Ocean-Atmosphere Bulk formulae (\mdl{sbcblk\_algo\_coare3p0}, %\mdl{sbcblk\_algo\_coare3p6}, \mdl{sbcblk\_algo\_ecmwf}, \mdl{sbcblk\_algo\_ncar})}
+%\label{subsec:SBC_blk_ocean}
+
+%Four different bulk algorithms are available to compute surface turbulent momentum and heat fluxes over the ocean.
+%COARE 3.0, COARE 3.6 and ECMWF schemes mainly differ by their roughness lenghts computation and consequently
+%their neutral transfer coefficients relationships with neutral wind.
+%\begin{itemize}
+%\item NCAR (\np[=.true.]{ln_NCAR}{ln\_NCAR}): The NCAR bulk formulae have been developed by \citet{large.yeager_rpt04}.
+%  They have been designed to handle the NCAR forcing, a mixture of NCEP reanalysis and satellite data.
+%  They use an inertial dissipative method to compute the turbulent transfer coefficients
+%  (momentum, sensible heat and evaporation) from the 10m wind speed, air temperature and specific humidity.
+%  This \citet{large.yeager_rpt04} dataset is available through
+%  the \href{http://nomads.gfdl.noaa.gov/nomads/forms/mom4/NCAR.html}{GFDL web site}.
+%  Note that substituting ERA40 to NCEP reanalysis fields does not require changes in the bulk formulea themself.
+%  This is the so-called DRAKKAR Forcing Set (DFS) \citep{brodeau.barnier.ea_OM10}.
+%\item COARE 3.0 (\np[=.true.]{ln_COARE_3p0}{ln\_COARE\_3p0}): See \citet{fairall.bradley.ea_JC03} for more details
+%\item COARE 3.6 (\np[=.true.]{ln_COARE_3p6}{ln\_COARE\_3p6}): See \citet{edson.jampana.ea_JPO13} for more details
+%\item ECMWF (\np[=.true.]{ln_ECMWF}{ln\_ECMWF}): Based on \href{https://www.ecmwf.int/node/9204}{IFS (Cy40r1)} %implementation and documentation.
+%  Surface roughness lengths needed for the Obukhov length are computed
+%  following \citet{beljaars_QJRMS95}.
+%\end{itemize}
 
 %% =================================================================================================
 \subsection{Ice-Atmosphere Bulk formulae}
 \label{subsec:SBC_blk_ice}
+
+
+\texttt{\#out\_of\_place:}
+ For sea-ice, three possibilities can be selected:
+a constant transfer coefficient (1.4e-3; default
+value), \citet{lupkes.gryanik.ea_JGR12} (\np{ln_Cd_L12}{ln\_Cd\_L12}),
+and \citet{lupkes.gryanik_JGR15} (\np{ln_Cd_L15}{ln\_Cd\_L15}) parameterizations
+\texttt{\#out\_of\_place.}
+
+
+
 
 Surface turbulent fluxes between sea-ice and the atmosphere can be computed in three different ways:
Index: NEMO/trunk/doc/latex/NEMO/subfiles/chap_misc.tex
===================================================================
--- NEMO/trunk/doc/latex/NEMO/subfiles/chap_misc.tex	(revision 12206)
+++ NEMO/trunk/doc/latex/NEMO/subfiles/chap_misc.tex	(revision 12377)
@@ -362,56 +362,140 @@
 
 %% =================================================================================================
-\subsection{Control print}
-
-The \np{ln_ctl}{ln\_ctl} switch was originally used as a debugging option in two modes:
-
-\begin{enumerate}
-\item {\np{ln_ctl}{ln\_ctl}: compute and print the trends averaged over the interior domain in all TRA, DYN, LDF and
-ZDF modules.
-This option is very helpful when diagnosing the origin of an undesired change in model results. }
-
-\item {also \np{ln_ctl}{ln\_ctl} but using the nictl and njctl namelist parameters to check the source of differences between
-mono and multi processor runs.}
+\subsection{Status and debugging information output}
+
+
+NEMO can produce a range of text information output either: in the main output
+file (ocean.output) written by the normal reporting processor (narea == 1) or various
+specialist output files (e.g. layout.dat, run.stat, tracer.stat etc.). Some, for example
+run.stat and tracer.stat, contain globally collected values for which a single file is
+sufficient. Others, however, contain information that could, potentially, be different
+for each processing region. For computational efficiency, the default volume of text
+information produced is reduced to just a few files from the narea=1 processor.
+
+When more information is required for monitoring or debugging purposes, the various
+forms of output can be selected via the \np{sn\_cfctl} structure. As well as simple
+on-off switches this structure also allows selection of a range of processors for
+individual reporting (where appropriate) and a time-increment option to restrict
+globally collected values to specified time-step increments.
+
+Most options within the structure are influenced by the top-level switches shown here
+with their default settings:
+
+\begin{verbatim}
+   sn_cfctl%l_allon  = .FALSE.    ! IF T activate all options. If F deactivate all unless l_config is T
+     sn_cfctl%l_config = .TRUE.     ! IF .true. then control which reports are written with the following
+\end{verbatim}
+
+The first switch is a convenience option which can be used to switch on and off all
+sub-options. However, if it is false then switching off all sub-options is only done
+if \texttt{sn_cfctl%l\_config} is also false. Specifically, the logic is:
+
+\begin{verbatim}
+  IF ( sn_cfctl%l_allon ) THEN
+    set all suboptions .TRUE.
+    and set procmin, procmax and procincr so that all regions are selected ([0,10000000,1], respectively)
+  ELSEIF ( sn_cfctl%l_config ) THEN
+    honour individual settings of the suboptions from the namelist
+  ELSE
+    set all suboptions .FALSE.
+  ENDIF
+\end{verbatim}
+
+Details of the suboptions follow but first an explanation of the stand-alone option:
+\texttt{sn_cfctl%l_glochk}.  This option modifies the action of the early warning checks
+carried out in \textt{stpctl.F90}. These checks detect probable numerical instabilites
+by searching for excessive sea surface heights or velocities and salinity values
+outside a sensible physical range. If breaches are detected then the default behaviour
+is to locate and report the local indices of the grid-point in breach. These indices
+are included in the error message that precedes the model shutdown. When true,
+\texttt{sn_cfctl%l_glochk} modifies this action by performing a global location of
+the various minimum and maximum values and the global indices are reported. This has
+some value in locating the most severe error in cases where the first detected error
+may not be the worst culprit.
+
+\subsubsection{Control print suboptions}
+
+The options that can be individually selected fall into three categories:
+
+\begin{enumerate} \item{Time step progress information} This category includes
+\texttt{run.stat} and \texttt{tracer.stat} files which record certain physical and
+passive tracer metrics (respectively). Typical contents of \texttt{run.stat} include
+global maximums of ssh, velocity; and global minimums and maximums of temperature
+and salinity.  A netCDF version of \texttt{run.stat} (\texttt{run.stat.nc}) is also
+produced with the same time-series data and this can easily be expanded to include
+extra monitoring information.  \texttt{tracer.stat} contains the volume-weighted
+average tracer value for each passive tracer. Collecting these metrics involves
+global communications and will impact on model efficiency so both these options are
+disabled by default by setting the respective options, \texttt{sn\_cfctl%runstat} and
+\texttt{sn\_cfctl%trcstat} to false. A compromise can be made by activating either or
+both of these options and setting the \texttt{sn\_cfctl%timincr} entry to an integer
+value greater than one. This increment determines the time-step frequency at which
+the global metrics are collected and reported.  This increment also applies to the
+time.step file which is otherwise updated every timestep.
+\item{One-time configuration information/progress logs}
+
+Some run-time configuration information and limited progress information is always
+produced by the first ocean process. This includes the \texttt{ocean.output} file
+which reports on all the namelist options read by the model and remains open to catch
+any warning or error messages generated during execution. A \texttt{layout.dat}
+file is also produced which details the MPI-decomposition used by the model. The
+suboptions: \texttt{sn\_cfctl%oceout} and \texttt{sn\_cfctl%layout} can be used
+to activate the creation of these files by all ocean processes.  For example,
+when \texttt{sn\_cfctl%oceout} is true all processors produce their own version of
+\texttt{ocean.output}.  All files, beyond the the normal reporting processor (narea == 1), are
+named with a \_XXXX extension to their name, where XXXX is a 4-digit area number (with
+leading zeros, if required). This is useful as a debugging aid since all processes can
+report their local conditions. Note though that these files are buffered on most UNIX
+systems so bug-hunting efforts using this facility should also utilise the \fortran:
+
+\begin{verbatim} 
+   CALL FLUSH(numout)
+\end{verbatim}
+
+statement after any additional write statements to ensure that file contents reflect
+the last model state. Associated with the \texttt{sn\_cfctl%oceout} option is the
+additional \texttt{sn\_cfctl%oasout} suboption. This does not activate its own output
+file but rather activates the writing of addition information regarding the OASIS
+configuration when coupling via oasis and the sbccpl routine. This information is
+written to any active \texttt{ocean.output} files.
+\item{Control sums of trends for debugging}
+
+NEMO includes an option for debugging reproducibility differences between
+a MPP and mono-processor runs.  This is somewhat dated and clearly only
+useful for this purpose when dealing with configurations that can be run
+on a single processor. The full details can be found in this report: \href{
+http://forge.ipsl.jussieu.fr/nemo/attachment/wiki/Documentation/prtctl_NEMO_doc_v2.pdf}{The
+control print option in NEMO} The switches to activate production of the control sums
+of trends for either the physics or passive tracers are the \texttt{sn\_cfctl%prtctl}
+and \texttt{sn\_cfctl%prttrc} suboptions, respectively. Although, perhaps, of limited use for its
+original intention, the ability to produce these control sums of trends in specific
+areas provides another tool for diagnosing model behaviour.  If only the output from a
+select few regions is required then additional options are available to activate options
+for only a simple subset of processing regions. These are: \texttt{sn\_cfctl%procmin},
+\texttt{sn\_cfctl%procmax} and \texttt{sn\_cfctl%procincr} which can be used to specify
+the minimum and maximum active areas and the increment. The default values are set
+such that all regions will be active. Note this subsetting can also be used to limit
+which additional \texttt{ocean.output} and \texttt{layout.dat} files are produced if
+those suboptions are active.
+
 \end{enumerate}
 
-However, in recent versions it has also been used to force all processors to assume the
-reporting role. Thus when \np{ln_ctl}{ln\_ctl} is true all processors produce their own versions
-of files such as: ocean.output, layout.dat, etc.  All such files, beyond the the normal
-reporting processor (narea == 1), are named with a \_XXXX extension to their name, where
-XXXX is a 4-digit area number (with leading zeros, if required). Other reporting files
-such as run.stat (and its netCDF counterpart: run.stat.nc) and tracer.stat contain global
-information and are only ever produced by the reporting master (narea == 1). For version
-4.0 a start has been made to return \np{ln_ctl}{ln\_ctl} to its original function by introducing
-a new control structure which allows finer control over which files are produced. This
-feature is still evolving but it does already allow the user to: select individually the
-production of run.stat and tracer.stat files and to toggle the production of other files
-on processors other than the reporting master. These other reporters can be a simple
-subset of processors as defined by a minimum, maximum and incremental processor number.
-
-Note, that production of the run.stat and tracer.stat files require global communications.
-For run.stat, these are global min and max operations to find metrics such as the gloabl
-maximum velocity. For tracer.stat these are global sums of tracer fields. To improve model
-performance these operations are disabled by default and, where necessary, any use of the
-global values have been replaced with local calculations. For example, checks on the CFL
-criterion are now done on the local domain and only reported if a breach is detected.
-
-Experienced users may wish to still monitor this information as a check on model progress.
-If so, the best compromise will be to activate the files with:
-
-\begin{verbatim}
-     sn_cfctl%l_config = .TRUE.
-       sn_cfctl%l_runstat = .TRUE.
-       sn_cfctl%l_trcstat = .TRUE.
-\end{verbatim}
-
-and to use the new time increment setting to ensure the values are collected and reported
-at a suitably long interval. For example:
-
-\begin{verbatim}
-       sn_cfctl%ptimincr  = 25
-\end{verbatim}
-
-will carry out the global communications and write the information every 25 timesteps. This
-increment also applies to the time.step file which is otherwise updated every timestep.
+
+   sn_cfctl%l_glochk = .FALSE.    ! Range sanity checks are local (F) or global (T). Set T for debugging only
+   sn_cfctl%l_allon  = .FALSE.    ! IF T activate all options. If F deactivate all unless l_config is T
+     sn_cfctl%l_config = .TRUE.     ! IF .true. then control which reports are written with the following
+       sn_cfctl%l_runstat = .FALSE. ! switches and which areas produce reports with the proc integer settings.
+       sn_cfctl%l_trcstat = .FALSE. ! The default settings for the proc integers should ensure
+       sn_cfctl%l_oceout  = .FALSE. ! that  all areas report.
+       sn_cfctl%l_layout  = .FALSE. !
+       sn_cfctl%l_prtctl  = .FALSE. !
+       sn_cfctl%l_prttrc  = .FALSE. !
+       sn_cfctl%l_oasout  = .FALSE. !
+       sn_cfctl%procmin   = 0       ! Minimum area number for reporting [default:0]
+       sn_cfctl%procmax   = 1000000 ! Maximum area number for reporting [default:1000000]
+       sn_cfctl%procincr  = 1       ! Increment for optional subsetting of areas [default:1]
+       sn_cfctl%ptimincr  = 1       ! Timestep increment for writing time step progress info
+
+
 
 \subinc{\input{../../global/epilogue}}
Index: NEMO/trunk/doc/latex/NEMO/subfiles/introduction.tex
===================================================================
--- NEMO/trunk/doc/latex/NEMO/subfiles/introduction.tex	(revision 12377)
+++ NEMO/trunk/doc/latex/NEMO/subfiles/introduction.tex	(revision 12377)
@@ -0,0 +1,350 @@
+\documentclass[../main/NEMO_manual]{subfiles}
+
+\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:D} 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:D}.      %====>>>> 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
+
+\end{document}
Index: NEMO/trunk/doc/latex/SI3/build/SI3_manual.ist
===================================================================
--- NEMO/trunk/doc/latex/SI3/build/SI3_manual.ist	(revision 12377)
+++ NEMO/trunk/doc/latex/SI3/build/SI3_manual.ist	(revision 12377)
@@ -0,0 +1,1 @@
+link ../../global/index.ist
Index: NEMO/trunk/doc/latex/SI3/main/SI3_manual.ist
===================================================================
--- NEMO/trunk/doc/latex/SI3/main/SI3_manual.ist	(revision 12377)
+++ NEMO/trunk/doc/latex/SI3/main/SI3_manual.ist	(revision 12377)
@@ -0,0 +1,1 @@
+link ../../global/index.ist
Index: NEMO/trunk/doc/latex/SI3/main/chapters.tex
===================================================================
--- NEMO/trunk/doc/latex/SI3/main/chapters.tex	(revision 12206)
+++ NEMO/trunk/doc/latex/SI3/main/chapters.tex	(revision 12377)
@@ -1,3 +1,5 @@
 \subfile{../subfiles/todolist}
+
+\subfile{../subfiles/introduction}               % Introduction
 
 \subfile{../subfiles/chap_model_basics}
Index: NEMO/trunk/doc/latex/SI3/main/definitions.tex
===================================================================
--- NEMO/trunk/doc/latex/SI3/main/definitions.tex	(revision 12377)
+++ NEMO/trunk/doc/latex/SI3/main/definitions.tex	(revision 12377)
@@ -0,0 +1,15 @@
+%% Engine (folder name)
+\def \engine{SI3}
+
+%% Title (variable name already use by 'titling' pkg)
+\def \heading{Sea Ice modelling Integrated Initiative (SI$^3$) \\ The NEMO sea ice engine}
+
+%% Authors (thanks will apply to the second author)
+\def \firstauthor{}
+\def \secondauthor{NEMO Sea Ice Working Group}
+
+%% IPSL publication number
+\def \ipslnum{31}
+
+%% Zenodo ID, i.e. doi:10.5281/zenodo.\([0-9]*\)
+\def \zid{1471689}
Index: NEMO/trunk/doc/latex/SI3/main/routines.idx
===================================================================
--- NEMO/trunk/doc/latex/SI3/main/routines.idx	(revision 12377)
+++ NEMO/trunk/doc/latex/SI3/main/routines.idx	(revision 12377)
@@ -0,0 +1,1 @@
+link ../build/routines.idx
Index: NEMO/trunk/doc/latex/SI3/main/thanks.tex
===================================================================
--- NEMO/trunk/doc/latex/SI3/main/thanks.tex	(revision 12377)
+++ NEMO/trunk/doc/latex/SI3/main/thanks.tex	(revision 12377)
@@ -0,0 +1,1 @@
+TBD
Index: NEMO/trunk/doc/latex/TOP/build/TOP_manual.ist
===================================================================
--- NEMO/trunk/doc/latex/TOP/build/TOP_manual.ist	(revision 12377)
+++ NEMO/trunk/doc/latex/TOP/build/TOP_manual.ist	(revision 12377)
@@ -0,0 +1,1 @@
+link ../../global/index.ist
Index: NEMO/trunk/doc/latex/TOP/main/TOP_manual.ist
===================================================================
--- NEMO/trunk/doc/latex/TOP/main/TOP_manual.ist	(revision 12377)
+++ NEMO/trunk/doc/latex/TOP/main/TOP_manual.ist	(revision 12377)
@@ -0,0 +1,1 @@
+link ../../global/index.ist
Index: NEMO/trunk/doc/latex/TOP/main/chapters.tex
===================================================================
--- NEMO/trunk/doc/latex/TOP/main/chapters.tex	(revision 12206)
+++ NEMO/trunk/doc/latex/TOP/main/chapters.tex	(revision 12377)
@@ -1,2 +1,3 @@
+\subfile{../subfiles/introduction}
 \subfile{../subfiles/model_description}
 \subfile{../subfiles/model_setup}
Index: NEMO/trunk/doc/latex/TOP/main/definitions.tex
===================================================================
--- NEMO/trunk/doc/latex/TOP/main/definitions.tex	(revision 12377)
+++ NEMO/trunk/doc/latex/TOP/main/definitions.tex	(revision 12377)
@@ -0,0 +1,15 @@
+%% Engine (folder name)
+\def \engine{TOP}
+
+%% Title (variable name already use by 'titling' pkg)
+\def \heading{Tracers in Ocean Paradigm (TOP) \\ The NEMO passive tracers engine}
+
+%% Authors (thanks will apply to the second author)
+\def \firstauthor{}
+\def \secondauthor{NEMO TOP Working Group}
+
+%% IPSL publication number
+\def \ipslnum{28}
+
+%% Zenodo ID, i.e. doi:10.5281/zenodo.\([0-9]*\)
+\def \zid{1471700}
Index: NEMO/trunk/doc/latex/TOP/main/routines.idx
===================================================================
--- NEMO/trunk/doc/latex/TOP/main/routines.idx	(revision 12377)
+++ NEMO/trunk/doc/latex/TOP/main/routines.idx	(revision 12377)
@@ -0,0 +1,1 @@
+link ../build/routines.idx
Index: NEMO/trunk/doc/latex/TOP/main/thanks.tex
===================================================================
--- NEMO/trunk/doc/latex/TOP/main/thanks.tex	(revision 12377)
+++ NEMO/trunk/doc/latex/TOP/main/thanks.tex	(revision 12377)
@@ -0,0 +1,8 @@
+\'{E}th\'{e} Christian, 
+Lovato Tomas, 
+Aumont Olivier, 
+Palmi\'{e}ri Julien, 
+Mouchet Anne, 
+Nurser Georges, 
+Yool Andrew
+
Index: NEMO/trunk/doc/latex/global/annex_D.tex
===================================================================
--- NEMO/trunk/doc/latex/global/annex_D.tex	(revision 12206)
+++ 	(revision )
@@ -1,207 +1,0 @@
-\documentclass[../main/NEMO_manual]{subfiles}
-
-\begin{document}
-% ================================================================
-% Appendix D Coding Rules
-% ================================================================
-\chapter{Coding Rules}
-\label{apdx:D}
-
-\minitoc
-
-\newpage
-
-A "model life" is more than ten years.
-Its software, composed of a few hundred modules, is used by many people who are scientists or students and
-do not necessarily know every aspect of computing very well.
-Moreover, a well thought-out program is easier to read and understand, less difficult to modify,
-produces fewer bugs and is easier to maintain.
-Therefore, it is essential that the model development follows some rules:
-
-- well planned and designed
-
-- well written
-
-- well documented (both on- and off-line)
-
-- maintainable
-
-- easily portable
-
-- flexible.
-
-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}. 
-These rules present some advantages like:
-
-- to provide a well presented program
-
-- to use rules for variable names which allow recognition of their type
-(integer, real, parameter, local or shared variables, etc. ). 
-
-This facilitates both the understanding and the debugging of an algorithm.
-
-% ================================================================
-% The program structure
-% ================================================================
-\section{Program structure}
-\label{sec:D_structure}
-
-Each program begins with a set of headline comments containing:
-
-- the program title
-
-- the purpose of the routine
-
-- the method and algorithms used
-
-- the detail of input and output interfaces
-
-- the external routines and functions used (if they exist)
-
-- references (if they exist)
-
-- the author name(s), the date of creation and any updates.
-
-- Each program is split into several well separated sections and
-sub-sections with an underlined title and specific labelled statements.
-
-- A program has not more than 200 to 300 lines.
-
-A template of a module style can be found on the NEMO depository in the following file:
-NEMO/OPA\_SRC/module\_example.
-% ================================================================
-% Coding conventions
-% ================================================================
-\section{Coding conventions}
-\label{sec:D_coding}
-
-- Use of the universal language \fninety, and try to avoid obsolescent features like statement functions,
-do not use GO TO and EQUIVALENCE statements.
-
-- A continuation line begins with the character {\&} indented by three spaces compared to the previous line,
-while the previous line ended with the character {\&}.
-
-- All the variables must be declared.
-The code is usually compiled with implicit none.
- 
-- Never use continuation lines in the declaration of a variable.
-When searching a variable in the code through a \textit{grep} command, the declaration line will be found.
-
-- In the declaration of a PUBLIC variable, the comment part at the end of the line should start with
-the two characters "\verb?!:?".
-The following UNIX command, \\
-\verb?grep var_name *90 \ grep \!: ? \\
-will display the module name and the line where the var\_name declaration is.
-
-- Always use a three spaces indentation in DO loop, CASE, or IF-ELSEIF-ELSE-ENDIF statements.
-
-- use a space after a comma, except when it appears to separate the indices of an array.
-
-- use call to ctl\_stop routine instead of just a STOP.
-
-\newpage
-
-% ================================================================
-% Naming Conventions
-% ================================================================
-\section{Naming conventions}
-\label{sec:D_naming}
-
-The purpose of the naming conventions is to use prefix letters to classify model variables.
-These conventions allow the variable type to be easily known and rapidly identified.
-The naming conventions are summarised in the Table below:
-
-
-%--------------------------------------------------TABLE--------------------------------------------------
-\begin{table}[htbp]
-  \label{tab:VarName}
-  \begin{center}
-    \begin{tabular}{|p{45pt}|p{35pt}|p{45pt}|p{40pt}|p{40pt}|p{40pt}|p{40pt}|p{40pt}|}
-      \hline
-      Type \par / Status
-      & integer
-      & real
-      & logical
-      & character
-      & structure
-      & double \par precision
-      & complex \\
-      \hline
-      public  \par or  \par module variable
-      & \textbf{m n} \par \textit{but not} \par \textbf{nn\_ np\_}
-      & \textbf{a b e f g h o q r} \par \textbf{t} \textit{to} \textbf{x} \par but not \par \textbf{fs rn\_}
-      & \textbf{l} \par \textit{but not} \par \textbf{lp ld} \par \textbf{ ll ln\_}
-      & \textbf{c} \par \textit{but not} \par \textbf{cp cd} \par \textbf{cl cn\_}
-      & \textbf{s} \par \textit{but not} \par \textbf{sd sd} \par \textbf{sl sn\_}
-      & \textbf{d} \par \textit{but not} \par \textbf{dp dd} \par \textbf{dl dn\_}
-      & \textbf{y} \par \textit{but not} \par \textbf{yp yd} \par \textbf{yl yn} \\
-      \hline
-      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{sd}
-      & \textbf{dd}
-      & \textbf{yd} \\
-      \hline
-      local \par variable
-      & \textbf{i}
-      & \textbf{z}
-      & \textbf{ll}
-      & \textbf{cl}
-      & \textbf{sl}
-      & \textbf{dl}
-      & \textbf{yl} \\
-      \hline
-      loop \par control
-      & \textbf{j} \par \textit{but not} \par \textbf{jp} &&&&&& \\
-      \hline
-      parameter
-      & \textbf{jp np\_}
-      & \textbf{pp}
-      & \textbf{lp}
-      & \textbf{cp}
-      & \textbf{sp}
-      & \textbf{dp}
-      & \textbf{yp} \\
-      \hline
-      namelist
-      & \textbf{nn\_}
-      & \textbf{rn\_}
-      & \textbf{ln\_}
-      & \textbf{cn\_}
-      & \textbf{sn\_}
-      & \textbf{dn\_}
-      & \textbf{yn\_}
-      \\
-      \hline
-      CPP \par macro
-      & \textbf{kf}
-      & \textbf{fs} \par &&&&& \\
-      \hline
-    \end{tabular}
-    \label{tab:tab1}
-  \end{center}
-\end{table}
-%--------------------------------------------------------------------------------------------------------------
-
-N.B. Parameter here, in not only parameter in the \fortran acceptation,
-it is also used for code variables that are read in namelist and should never been modified during a simulation. 
-It is the case, for example, for the size of a domain (jpi,jpj,jpk).
-
-\newpage
-
-% ================================================================
-% The program structure
-% ================================================================
-%\section{Program structure}
-%\label{sec:Apdx_D_structure}
-
-%To be done....
-\biblio
-
-\pindex
-
-\end{document}
Index: NEMO/trunk/doc/latex/global/coding_rules.tex
===================================================================
--- NEMO/trunk/doc/latex/global/coding_rules.tex	(revision 12206)
+++ 	(revision )
@@ -1,844 +1,0 @@
-
-\chapter{Coding Rules}
-\label{apdx:CODING}
-
-\chaptertoc
-
-\newpage
-
-A "model life" is more than ten years.
-Its software, composed of a few hundred modules, is used by many people who are scientists or students and
-do not necessarily know every aspect of computing very well.
-Moreover, a well thought-out program is easier to read and understand, less difficult to modify,
-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.
-\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}.
-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. ).
-\end{itemize}
-
-This facilitates both the understanding and the debugging of an algorithm.
-
-\section{Introduction}
-
-This document describes conventions used in \NEMO\ coding and suggested for its development.
-The objectives are to offer a guide to all readers of the \NEMO\ code, and to facilitate the work of
-all the developers, including the validation of their developments, and
-eventually the implementation of these developments within the \NEMO\ platform.
-
-A first approach of these rules can be found in the code in \path{./src/OCE/module_example} where
-all the basics coding conventions are illustrated.
-More details can be found below.
-
-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}},
-the previous version of this document (``FORTRAN coding standard in the OPA System'') and
-the expertise of the \NEMO\ System Team.
-After a general overview below, this document will describe:
-
-\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
-	interfaces between routines and modules.
-\end{itemize}
-
-\section{Overview and general conventions}
-
-\NEMO\ has 3 major components: ocean dynamics (\path{./src/OCE}), sea-ice (\path{./src/ICE}) and
-marine biogeochemistry (\path{./src/MBG}).
-%, linear-tangent and adjoint of the dynamics ($TAM$) each of them corresponding to a directory.
-In each directory, one will find some FORTRAN files and/or subdirectories, one per functionality of the code:
-\path{./src/OCE/BDY} (boundaries), \path{./src/OCE/DIA} (diagnostics), \path{./src/OCE/DOM} (domain),
-\path{./src/OCE/DYN} (dynamics), \path{./src/OCE/LDF} (lateral diffusion), etc... \\
-All name are chosen to be as self-explanatory as possible, in English, all prefixes are 3 digits. \\
-English is used for all variables names, comments, and documentation. \\
-Physical units are MKS. The only exception to this is the temperature, which is expressed in degrees Celsius,
-except in bulk formulae and part of SI$^3$ sea-ice model where it is in Kelvin.
-See \path{.src/OCE/DOM/phycst.F90} files for conversions.
-
-\section{Architecture}
-
-Within each directory, organisation of files is driven by orthogonality,
-$i.e.$ one functionality of the code is intended to be in one and only one directory, and
-one module and all its related routines are in one file.
-The functional modules are:
-
-\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{...}
-\end{itemize}
-
-For example, the file \textit{domain.F90} contains the module \texttt{domain} and all the subroutines related to
-this module (\texttt{dom\_init, dom\_nam, dom\_ctl}).
-
-\section{Style rules}
-
-\subsection{Argument list format}
-
-Routine argument lists will contain a maximum 5 variables per line,
-whilst continuation lines can be used.
-This applies both to the calling routine and the dummy argument list in the routine being called.
-The purpose is to simplify matching up the arguments between caller and callee.
-
-\begin{forlines}
-SUBROUTINE tra_adv_eiv( kt, pun, pvn, pwn )
-
-      CALL tra_adv_eiv( kt, zun, zvn, zwn )
-\end{forlines}
-
-\subsection{Array syntax}
-
-Except for long loops (see below), array notation should be used if possible.
-To improve readability the array shape must be shown in brackets, $e.g.$:
-
-\begin{forlines}
-onedarraya(:)   = onedarrayb(:) + onedarrayc(:)
-twodarray (:,:) = scalar * anothertwodarray(:,:)
-\end{forlines}
-
-When accessing sections of arrays, for example in finite difference equations,
-do so by using the triplet notation on the full array, $e.g.$:
-
-\begin{forlines}
-twodarray(:,2:len2) =   scalar                      &
-   &                  * ( twodarray2(:,1:len2-1 )   &
-   &                  -   twodarray2(:,2:len2 ) )
-\end{forlines}
-
-For long, complicated loops, explicitly indexed loops should be preferred.
-In general when using this syntax, the order of the loops indices should reflect the following scheme
-(for best usage of data locality):
-
-\begin{forlines}
-DO jk = 1, jpk
-   DO jj = 1, jpj
-      DO ji = 1, jpi
-         threedarray(ji,jj,jk) = ...
-      END DO
-   END DO
-END DO
-\end{forlines}
-
-\subsection{Case}
-
-All FORTRAN keywords are in capital: \forcode{DIMENSION}, \forcode{WRITE}, \forcode{DO}, \forcode{END DO},
-\forcode{NAMELIST}, ... All other parts of the \NEMO\ code will be written in lower case.
-
-\subsection{Comments}
-
-Comments in the code are useful when reading the code and changing or developing it. \\
-The full documentation and detailed explanations are to be added in the reference manual
-(TeX files, aside from the code itself). \\
-In the code, the comments should explain variable content and describe each computational step. \\
-Comments in the header start with ``!!''.
-For more details on the content of the headers, see Content rules/Headers in this document. \\
-Comments in the code start with ``!''. \\
-All comments are indented (3, 6, or 9 blank spaces). \\
-Short comments may be included on the same line as executable code, and an additional line can be used with
-proper alignment.
-For example:
-
-\begin{forlines}
-zx = zx *zzy   ! Describe what is going on and if it is
-!              ! too long use another ! for proper
-!              ! alignment with automatic indentation
-\end{forlines}
-
-More in-depth comments should be written in the form:
-
-\begin{forlines}
-   !  Check of some namelist values
-\end{forlines}
-
-or
-
-\begin{forlines}
-!
-!     !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-!     !  Bottom boundary condition on tke
-!     !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-!
-\end{forlines}
-
-Key features of this style are
-
-\begin{enumerate}
-\item it starts with a "!" in the column required for proper indentation,
-\item the text is offset above and below by a blank line or a content line built for underlying.
-\end{enumerate}
-
-\subsection{Continuation lines}
-
-Continuation lines can be used with precise alignment for readability. For example:
-
-\begin{forlines}
-avmu(ji,jj,jk) =   avmu(ji,jj,jk) * ( un(ji,jj,jk-1) - un(ji,jj,jk) )   &
-   &                              * ( ub(ji,jj,jk-1) - ub(ji,jj,jk) )   &
-   &             / (   fse3uw_n(ji,jj,jk)                               &
-   &                 * fse3uw_b(ji,jj,jk) )
-\end{forlines}
-
-Code lines, which are continuation lines of assignment statements, must begin to the right of the column of
-the assignment operator.
-Due to the possibility of automatic indentation in some editor (emacs for example),
-use a ``\&'' as first character of the continuing lines to maintain the alignment.
-
-\subsection{Declaration of arguments and local variables}
-
-In a routine, input arguments and local variables are declared 1 per line,
-with a comment field on the same line as the declaration.
-Multiple comment lines describing a single variable are acceptable if needed.
-For example:
-
-\begin{forlines}
-INTEGER             ::   kstp   ! ocean time-step index
-\end{forlines}
-
-\subsection{F90 Standard}
-
-\NEMO\ software adheres to the \fninety language standard and does not rely on any specific language or
-vendor extensions.
-
-\subsection{Free-Form Source}
-
-Free-form source will be used.
-The F90/95 standard allows lines of up to 132 characters, but a self-imposed limit of 80 should enhance readability,
-or print source files with two columns per page.
-Multi-line comments that extend to column 100 are unacceptable.
-
-\subsection{Indentation}
-
-Code as well as comment lines within loops, if-blocks, continuation lines, \forcode{MODULE} or
-\forcode{SUBROUTINE} statements will be indented 3 characters for readability
-(except for \forcode{CONTAINS} that remains at first column).
-
-\begin{forlines}
-MODULE mod1
-   REAL(wp) xx
-CONTAINS
-   SUBROUTINE sub76( px, py, pz, pw, pa,   &
-      &              pb, pc, pd, pe          )
-      <instruction>
-   END SUBROUTINE sub76
-END MODULE mod1
-\end{forlines}
-
-\subsection{Loops}
-
-Loops, if explicit, should be structured with the do-end do construct as opposed to numbered loops.
-Nevertheless non-numeric labels can be used for a big iterative loop of a recursive algorithm.
-In the case of a long loop, a self-descriptive label can be used ($i.e.$ not just a number).
-
-\subsection{Naming Conventions: files}
-
-A file containing a module will have the same name as the module it contains
-(because dependency rules used by "make" programs are based on file names).
-\footnote{
-  For example, if routine A "\forcode{USE}"s module B, then "make" must be told of the dependency relation which
-  requires B to be compiled before A.
-  If one can assume that module B resides in file B.o,
-  building a tool to generate this dependency rule ($e.g.$ A.o: B.o) is quite simple.
-  Put another way, it is difficult (to say nothing of CPU-intensive) to search an entire source tree to
-  find the file in which module B resides for each routine or module which "\forcode{USE}"s B.
-}
-
-\subsection{Naming Conventions: modules}
-
-Use a meaningful English name and the ``3 letters'' naming convention:
-first 3 letters for the code section, and last 3 to describe the module.
-For example, zdftke, where ``zdf'' stands for vertical diffusion, and ``tke'' for turbulent kinetic energy. \\
-Note that by implication multiple modules are not allowed in a single file.
-The use of common blocks is deprecated in \fortran 90 and their use in \NEMO\ is strongly discouraged.
-Modules are a better way to declare static data.
-Among the advantages of modules is the ability to freely mix data of various types, and
-to limit access to contained variables through the use of the \forcode{ONLY} and \forcode{PRIVATE} attributes.
-
-\subsection{Naming Conventions: variables}
-
-All variable should be named as explicitly as possible in English.
-The naming convention concerns prefix letters of these name, in order to identify the variable type and status. \\
-Never use a \fortran keyword as a routine or variable name. \\
-The table below lists the starting letter(s) to be used for variable naming, depending on their type and status:
-%--------------------------------------------------TABLE--------------------------------------------------
-\begin{table}[htbp]
-  \begin{center}
-    \begin{tabular}{|p{50pt}|p{50pt}|p{50pt}|p{50pt}|p{50pt}|p{50pt}|p{50pt}|}
-      \hline
-      Type \par / Status                                                                          &
-      integer                                                                                     &
-      real                                                                                        &
-      logical                                                                                     &
-      character                                                                                   &
-      double \par precision                                                                       &
-      complex                                                                                     \\
-      \hline
-      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}                                     \\
-      \hline
-      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}                                                                                 \\
-      \hline
-      local \par variable                                                                         &
-      \textbf{i}                                                                                  &
-      \textbf{z}                                                                                  &
-      \textbf{ll}                                                                                 &
-      \textbf{cl}                                                                                 &
-      \textbf{cd}                                                                                 &
-      \textbf{yl}                                                                                 \\
-      \hline
-      loop \par control                                                                           &
-      \textbf{j} \par \textit{but not} \par \textbf{jp}                                           &
-                                                                                                  &
-                                                                                                  &
-                                                                                                  &
-                                                                                                  &
-                                                                                                  \\
-      \hline
-      parameter                                                                                   &
-      \textbf{jp}                                                                                 &
-      \textbf{pp}                                                                                 &
-      \textbf{lp}                                                                                 &
-      \textbf{cp}                                                                                 &
-      \textbf{dp}                                                                                 &
-      \textbf{yp}                                                                                 \\
-      \hline
-      namelist                                                                                    &
-      \textbf{nn\_}                                                                               &
-      \textbf{rn\_}                                                                               &
-      \textbf{ln\_}                                                                               &
-      \textbf{cn\_}                                                                               &
-      \textbf{dn\_}                                                                               &
-                                                                                                  \\
-      \hline
-      CPP \par macro                                                                              &
-      \textbf{kf}                                                                                 &
-      \textbf{sf}                                                                                 &
-                                                                                                  &
-                                                                                                  &
-                                                                                                  &
-                                                                                                  \\
-      \hline
-    \end{tabular}
-    \label{tab1}
-  \end{center}
-\end{table}
-%--------------------------------------------------------------------------------------------------------------
-
-\subsection{Operators}
-
-Use of the operators \texttt{<, >, <=, >=, ==, /=} is strongly recommended instead of their deprecated counterparts
-(\texttt{.lt., .gt., .le., .ge., .eq., .ne.}).
-The motivation is readability.
-In general use the notation: \\
-$<Blank><Operator><Blank>$
-
-\subsection{Pre processor}
-
-Where the use of a language pre-processor is required, it will be the C pre-processor (cpp). \\
-The cpp key is the main feature used, allowing to ignore some useless parts of the code at compilation step. \\
-The advantage is to reduce the memory use; the drawback is that compilation of this part of the code isn't checked. \\
-The cpp key feature should only be used for a few limited options, if it reduces the memory usage.
-In all cases, a logical variable and a FORTRAN \forcode{IF} should be preferred.
-When using a cpp key \textit{key\_optionname},
-a corresponding logical variable \textit{lk\_optionname} should be declared to
-allow FORTRAN \forcode{IF} tests in the code and
-a FORTRAN module with the same name ($i.e.$ \textit{optionname.F90}) should be defined.
-This module is the only place where a \``\#if defined'' command appears, selecting either the whole FORTRAN code or
-a dummy module.
-For example, the TKE vertical physics, the module name is \textit{zdftke.F90},
-the CPP key is \textit{key\_zdftke} and the associated logical is \textit{lk\_zdftke}.
-
-The following syntax:
-
-\begin{forlines}
-#if defined key_optionname
-!! Part of code conditionally compiled if cpp key key_optionname is active
-#endif
-\end{forlines}
-
-Is to be used rather than the \#ifdef abbreviate form since it may have conflicts with some Unix scripts.
-
-Tests on cpp keys included in \NEMO\ at compilation step:
-
-\begin{itemize}
-\item
-  The CPP keys used are compared to the previous list of cpp keys
-  (the compilation will stop if trying to specify a non-existing key)
-\item
-  If a change occurs in the CPP keys used for a given experiment, the whole compilation phase is done again.
-\end{itemize}
-
-\section{Content rules}
-
-\subsection{Configurations}
-
-The configuration defines the domain and the grid on which \NEMO\ is running.
-It may be useful to associate a CPP key and some variables to a given configuration, although
-the part of the code changed under each of those keys should be minimized.
-As an example, the "ORCA2" configuration (global ocean, 2 degrees grid size) is associated with
-the cpp key \texttt{key\_orca2} for which
-
-\begin{forlines}
-cp_cfg = "orca"
-jp_cfg = 2
-\end{forlines}
-
-\subsection{Constants}
-
-Physical constants ($e.g.$ $\pi$, gas constants) must never be hard-wired into the executable portion of a code.
-Instead, a mnemonically named variable or parameter should be set to the appropriate value,
-in the setup routine for the package.
-We realize than many parameterizations rely on empirically derived constants or fudge factors,
-which are not easy to name.
-In these cases it is not forbidden to leave such factors coded as "magic numbers" buried in executable code, but
-comments should be included referring to the source of the empirical formula.
-Hard-coded numbers should never be passed through argument lists.
-
-\subsection{Declaration for variables and constants}
-
-\subsubsection{Rules}
-
-Variables used as constants should be declared with attribute \forcode{PARAMETER} and
-used always without copying to local variables, in order to
-prevent from using different values for the same constant or changing it accidentally.
-
-\begin{itemize}
-\item
-  Usage of the \forcode{DIMENSION} statement or attribute is required in declaration statements
-\item
-  The ``::'' notation is quite useful to show that this program unit declaration part is written in
-  standard FORTRAN syntax, even if there are no attributes to clarify the declaration section.
-  Always use the notation $<$blank$>$::$<$three blanks$>$ to improve readability.
-\item
-  Declare the length of a character variable using the \forcode{CHARACTER} (len=xxx) syntax
-  \footnote {
-    The len specifier is important because it is possible to have several kinds for characters
-    ($e.g.$ Unicode using two bytes per character, or there might be a different kind for Japanese $e.g.$ NEC).
-  }
-\item
-  For all global data (in contrast to module data, that is all data that can be access by other module)
-  must be accompanied with a comment field on the same line
-  \footnote {
-    This allows a easy research of where and how a variable is declared using the unix command:
-    ``grep var *90 | grep !:''.
-  }.
-  For example:
-  \begin{forlines}
-  REAL(wp), DIMENSION(jpi,jpj,jpk) ::  ua   ! i-horizontal velocity (m/s)
-  \end{forlines}
-\end{itemize}
-
-\subsubsection{Implicit None}
-
-All subroutines and functions will include an \forcode{IMPLICIT NONE} statement.
-Thus all variables must be explicitly typed.
-It also allows the compiler to detect typographical errors in variable names.
-For modules, one \forcode{IMPLICIT NONE} statement in the modules definition section is needed.
-This also removes the need to have \forcode{IMPLICIT NONE} statements in
-any routines that are \forcode{CONTAINS}'ed in the module.
-Improper data initialisation is another common source of errors
-\footnote{
-  A variable could contain an initial value you did not expect.
-  This can happen for several reasons, $e.g.$ the variable has never been assigned a value, its value is outdated,
-  memory has been allocated for a pointer but you have forgotten to initialise the variable pointed to.
-}.
-To avoid problems, initialise variables as close as possible to where they are first used.
-
-\subsubsection{Attributes}
-
-\forcode{PRIVATE} / \forcode{PUBLIC}:
-All resources of a module are \forcode{PUBLIC} by default.
-A reason to store multiple routines and their data in a single module is that
-the scope of the data defined in the module can be limited to the routines which are in the same module.
-This is accomplished with the \forcode{PRIVATE} attribute. \\
-\forcode{INTENT}:
-All dummy arguments of a routine must include the \forcode{INTENT} clause in their declaration in order to
-improve control of variables in routine calls.
-
-\subsection{Headers}
-
-Prologues are not used in \NEMO\ for now, although it may become an interesting tool in combination with
-ProTeX auto documentation script in the future.
-Rules to code the headers and layout of a module or a routine are illustrated in the example module available with
-the code: \path{./src/OCE/module_example}
-
-\subsection{Interface blocks}
-
-Explicit interface blocks are required between routines if optional or keyword arguments are to be used.
-They also allow the compiler to check that the type, shape and number of arguments specified in the \forcode{CALL}
-are the same as those specified in the subprogram itself.
-FORTRAN 95 compilers can automatically provide explicit interface blocks for routines contained in a module.
-
-\subsection{I/O Error Conditions}
-
-I/O statements which need to check an error condition will use the \texttt{iostat=<integer variable>} construct
-instead of the outmoded \texttt{end=} and \forcode{err=}. \\
-Note that a 0 value means success, a positive value means an error has occurred, and
-a negative value means the end of record or end of file was encountered.
-
-\subsection{PRINT - ASCII output files}
-
-Output listing and errors are directed to \texttt{numout} logical unit =6 and
-produces a file called \textit{ocean.output} (use \texttt{ln\_prt} to have one output per process in MPP).
-Logical \texttt{lwp} variable allows for less verbose outputs.
-To output an error from a routine, one can use the following template:
-
-\begin{forlines}
-IF( nstop /= 0 .AND. lwp ) THEN   ! error print
-   WRITE(numout,cform_err)
-   WRITE(numout,*) nstop, ' error have been found'
-ENDIF
-\end{forlines}
-
-\subsection{Precision}
-
-Parameterizations should not rely on vendor-supplied flags to supply a default floating point precision or
-integer size.
-The F95 \forcode{KIND} feature should be used instead.
-In order to improve portability between 32 and 64 bit platforms,
-it is necessary to make use of kinds by using a specific module \path{./src/OCE/par_kind.F90}
-declaring the "kind definitions" to obtain the required numerical precision and range as well as
-the size of \forcode{INTEGER}.
-It should be noted that numerical constants need to have a suffix of \texttt{\_kindvalue} to
-have the according size. \\
-Thus \forcode{wp} being the "working precision" as declared in \path{./src/OCE/par_kind.F90},
-declaring real array \forcode{zpc} will take the form:
-
-\begin{forlines}
-REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zpc      ! power consumption
-\end{forlines}
-
-\subsection{Structures}
-
-The \forcode{TYPE} structure allowing to declare some variables is more often used in \NEMO,
-especially in the modules dealing with reading fields, or interfaces.
-For example:
-
-\begin{forlines}
-! Definition of a tracer as a structure
-TYPE PTRACER
-   CHARACTER(len = 20)  :: sname  ! short name
-   CHARACTER(len = 80 ) :: lname  ! long name
-   CHARACTER(len = 20 ) :: unit   ! unit
-   LOGICAL              :: lini   ! read in a file or not
-   LOGICAL              :: lsav   ! ouput the tracer or not
-END TYPE PTRACER
-
-TYPE(PTRACER) , DIMENSION(jptra) :: tracer
-\end{forlines}
-
-Missing rule on structure name??
-
-\section{Packages coding rules}
-
-\subsection{Bounds checking}
-
-\NEMO\ is able to run when an array bounds checking option is enabled
-(provided the cpp key \texttt{key\_vectopt\_loop} is not defined). \\
-Thus, constructs of the following form are disallowed:
-
-\begin{forlines}
-REAL(wp) :: arr(1)
-\end{forlines}
-
-where "arr" is an input argument into which the user wishes to index beyond 1.
-Use of the (*) construct in array dimensioning is forbidden also because
-it effectively disables array bounds checking.
-
-\subsection{Communication}
-
-A package should refer only to its own modules and subprograms and to those intrinsic functions included in
-the Fortran standard. \\
-All communication with the package will be through the argument list or namelist input.
-\footnote{
-  The point behind this rule is that packages should not have to know details of
-  the surrounding model data structures, or the names of variables outside of the package.
-  A notable exception to this rule is model resolution parameters.
-  The reason for the exception is to allow compile-time array sizing inside the package.
-  This is often important for efficiency.
-}
-
-\subsection{Error conditions}
-
-When an error condition occurs inside a package, a message describing what went wrong will be printed
-(see PRINT - ASCII output files).
-The name of the routine in which the error occurred must be included.
-It is acceptable to terminate execution within a package, but
-the developer may instead wish to return an error flag through the argument list,
-see \textit{stpctl.F90}.
-
-\subsection{Memory management}
-
-The main action is to identify and declare which arrays are \forcode{PUBLIC} and which are \forcode{PRIVATE}. \\
-As of version 3.3.1 of \NEMO, the use of static arrays (size fixed at compile time) has been deprecated.
-All module arrays are now declared \forcode{ALLOCATABLE} and
-allocated in either the \texttt{<module\_name>\_alloc()} or \texttt{<module\_name>\_init()} routines.
-The success or otherwise of each \forcode{ALLOCATE} must be checked using
-the \texttt{stat=<integer\ variable>} optional argument. \\
-
-In addition to arrays contained within modules, many routines in \NEMO\ require local, ``workspace'' arrays to
-hold the intermediate results of calculations.
-In previous versions of \NEMO, these arrays were declared in such a way as to be automatically allocated on
-the stack when the routine was called.
-An example of an automatic array is:
-
-\begin{forlines}
-SUBROUTINE sub(n)
-   REAL :: a(n)
-   ...
-END SUBROUTINE sub
-\end{forlines}
-
-The downside of this approach is that the program will crash if it runs out of stack space and
-the reason for the crash might not be obvious to the user.
-
-Therefore, as of version 3.3.1, the use of automatic arrays is deprecated.
-Instead, a new module, \textit{wrk\_nemo.F90}, has been introduced which
-contains 1-,2-,3- and 4-dimensional workspace arrays for use in subroutines.
-These workspace arrays should be used in preference to declaring new, local (allocatable) arrays whenever possible.
-The only exceptions to this are when workspace arrays with lower bounds other than 1 and/or
-with extent(s) greater than those in the \textit{wrk\_nemo.F90} module are required. \\
-
-The 2D, 3D and 4D workspace arrays in \textit{wrk\_nemo.F90} have extents \texttt{jpi}, \texttt{jpj},
-\texttt{jpk} and \texttt{jpts} ($x$, $y$, $z$ and tracers) in the first, second, third and fourth dimensions,
-respectively.
-The 1D arrays are allocated with extent MAX($jpi \times jpj, jpk \times jpj, jpi \times jpk$). \\
-
-The \forcode{REAL (KIND = wp)} workspace arrays in \textit{wrk\_nemo.F90}
-are named $e.g.$ \texttt{wrk\_1d\_1, wrk\_4d\_2} etc. and
-should be accessed by USE'ing the \textit{wrk\_nemo.F90} module.
-Since these arrays are available to any routine,
-some care must be taken that a given workspace array is not already being used somewhere up the call stack.
-To help with this, \textit{wrk\_nemo.F90} also contains some utility routines;
-\texttt{wrk\_in\_use()} and \texttt{wrk\_not\_released()}.
-The former first checks that the requested arrays are not already in use and then sets internal flags to show that
-they are now in use.
-The \texttt{wrk\_not\_released()} routine un-sets those internal flags.
-A subroutine using this functionality for two, 3D workspace arrays named \texttt{zwrk1} and
-\texttt{zwrk2} will look something like:
-
-\begin{forlines}
-SUBROUTINE sub()
-   USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
-   USE wrk_nemo, ONLY: zwrk1 => wrk_3d_5, zwrk2 => wrk_3d_6
-   !
-   IF(wrk_in_use(3, 5,6)THEN
-      CALL ctl_stop('sub: requested workspace arrays unavailable.')
-      RETURN
-   END IF
-   ...
-   ...
-   IF(wrk_not_released(3, 5,6)THEN
-      CALL ctl_stop('sub: failed to release workspace arrays.')
-   END IF
-   !
-END SUBROUTINE sub
-\end{forlines}
-
-The first argument to each of the utility routines is the dimensionality of the required workspace (1--4).
-Following this there must be one or more integers identifying which workspaces are to be used/released.
-Note that, in the interests of keeping the code as simple as possible,
-there is no use of \forcode{POINTER}s etc. in the \textit{wrk\_nemo.F90} module.
-Therefore it is the responsibility of the developer to ensure that the arguments to \texttt{wrk\_in\_use()} and
-\texttt{wrk\_not\_released()} match the workspace arrays actually being used by the subroutine. \\
-
-If a workspace array is required that has extent(s) less than those of the arrays in
-the \textit{wrk\_nemo.F90} module then the advantages of implicit loops and bounds checking may be retained by
-defining a pointer to a sub-array as follows:
-
-\begin{forlines}
-SUBROUTINE sub()
-   USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
-   USE wrk_nemo, ONLY: wrk_3d_5
-   !
-   REAL(wp), DIMENSION(:,:,:), POINTER :: zwrk1
-   !
-   IF(wrk_in_use(3, 5)THEN
-      CALL ctl_stop('sub: requested workspace arrays unavailable.')
-      RETURN
-   END IF
-   !
-   zwrk1 => wrk_3d_5(1:10,1:10,1:10)
-   ...
-END SUBROUTINE sub
-\end{forlines}
-
-Here, instead of ``use associating'' the variable \texttt{zwrk1} with the array \texttt{wrk\_3d\_5}
-(as in the first example), it is explicitly declared as a pointer to a 3D array.
-It is then associated with a sub-array of \texttt{wrk\_3d\_5} once the call to
-\texttt{wrk\_in\_use()} has completed successfully.
-Note that in F95 (to which \NEMO\ conforms) it is not possible for either the upper or lower array bounds of
-the pointer object to differ from those of the target array. \\
-
-In addition to the \forcode{REAL (KIND = wp)} workspace arrays,
-\textit{wrk\_nemo.F90} also contains 2D integer arrays and 2D REAL arrays with extent (\texttt{jpi}, \texttt{jpk}),
-$i.e.$ $xz$.
-The utility routines for the integer workspaces are \texttt{iwrk\_in\_use()} and \texttt{iwrk\_not\_released()} while
-those for the $xz$ workspaces are \texttt{wrk\_in\_use\_xz()} and \texttt{wrk\_not\_released\_xz()}.
-
-Should a call to one of the \texttt{wrk\_in\_use()} family of utilities fail,
-an error message is printed along with a table showing which of the workspace arrays are currently in use.
-This should enable the developer to choose alternatives for use in the subroutine being worked on. \\
-
-When compiling \NEMO\ for production runs,
-the calls to {\texttt{wrk\_in\_use()} / \texttt{wrk\_not\_released()} can be reduced to stubs that just
-return \forcode{.false.} by setting the cpp key \texttt{key\_no\_workspace\_check}.
-These stubs may then be in-lined (and thus effectively removed altogether) by setting appropriate compiler flags
-($e.g.$ ``-finline'' for the Intel compiler or ``-Q'' for the IBM compiler).
-
-\subsection{Optimisation}
-
-Considering the new computer architecture, optimisation cannot be considered independently from the computer type.
-In \NEMO, portability is a priority, before any too specific optimisation.
-
-Some tools are available to help: for vector computers, \texttt{key\_vectopt\_loop} allows to unroll a loop
-
-\subsection{Package attribute: \forcode{PRIVATE}, \forcode{PUBLIC}, \forcode{USE}, \forcode{ONLY}}
-
-Module variables and routines should be encapsulated by using the \forcode{PRIVATE} attribute.
-What shall be used outside the module can be declared \forcode{PUBLIC} instead.
-Use \forcode{USE} with the \forcode{ONLY} attribute to specify which of the variables, type definitions etc...
-defined in a module are to be made available to the using routine.
-
-\subsection{Parallelism using MPI}
-
-\NEMO\ is written in order to be able to run on one processor, or on one or more using MPI
-($i.e.$ activating the cpp key $key\_mpp\_mpi$).
-The domain decomposition divides the global domain in cubes (see \NEMO\ reference manual).
-Whilst coding a new development, the MPI compatibility has to be taken in account
-(see \path{./src/LBC/lib_mpp.F90}) and should be tested.
-By default, the $x$-$z$ part of the decomposition is chosen to be as square as possible.
-However, this may be overriden by specifying the number of sub-domains in latitude and longitude in
-the \texttt{nammpp} section of the namelist file.
-
-\section{Features to be avoided}
-
-The code must follow the current standards of FORTRAN and ANSI C.
-In particular, the code should not produce any WARNING at compiling phase, so that
-users can be easily alerted of potential bugs when some appear in their new developments.
-Below is a list of features to avoid:
-\begin{itemize}
-\item \forcode{COMMON} block
-  (use the declaration part of \forcode{MODULE} instead)
-\item \forcode{EQUIVALENCE}
-  (use \forcode{POINTER} or derived data type instead to form data structure)
-\item Assigned and computed \forcode{GOTO}
-  (use the \forcode{CASE} construct instead)
-\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
-  (use unlabelled \forcode{END DO} instead)
-\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
-  (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.
-  \footnote{
-    First, the code is easier to understand, if you can rely on
-    the rule that functions don't change their arguments.
-    Second, some compilers generate more efficient code for PURE functions
-    (in FORTRAN 95 there are the attributes PURE and ELEMENTAL), because
-    they can store the arguments in different places.
-    This is especially important on massive parallel and as well on vector machines.
-  }
-\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/trunk/doc/latex/global/document.tex
===================================================================
--- NEMO/trunk/doc/latex/global/document.tex	(revision 12206)
+++ NEMO/trunk/doc/latex/global/document.tex	(revision 12377)
@@ -1,68 +1,76 @@
 
-%% =================================================================================================
-%% Template structure for reference manuals
-%% =================================================================================================
+%% ==============================================================================
+%% Template structure for reference manual
+%% ==============================================================================
 
 %% NEMO release version
-\def \version{trunk}
+\def \version{4.0rc~}
 
 %% Preamble
-%% =================================================================================================
+%% ==============================================================================
 
 %% Document layout
-\documentclass[fontsize = 10pt, twoside, abstract]{scrreprt}
+\documentclass[draft]{scrreprt}
 
-%% Load manual configuration
-\input{../../global/prologue}
+%% Load the configuration of the manual
+\input{../main/definitions}
+
+%% Load global *.tex files
+\input{../../global/preamble}
+
+\dominitoc
+
+%% Launch the creation of the indexes
+\input{../../global/indexes}
+
 
 %% End of common preamble between main and sub-files
 %% Override custom cmds for full manual compilation
-\newcommand{\subinc}[1]{#1}
-\newcommand{\subexc}[1]{}
+\newcommand{\onlyinsubfile}[1]{#1}
+\newcommand{\notinsubfile}[1]{}
 
 \begin{document}
 
-\renewcommand{\subinc}[1]{}
-\renewcommand{\subexc}[1]{#1}
+\renewcommand{\onlyinsubfile}[1]{}
+\renewcommand{\notinsubfile}[1]{#1}
+
+\renewcommand{\biblio}{}
+\renewcommand{\pindex}{}
 
 
 %% Frontmatter
-%% =================================================================================================
+%% ==============================================================================
 
-\pagenumbering{gobble}   %% Disable page numbering temporarily
+\pagenumbering{gobble}
 
 %% Title page
 \input{../../global/frontpage}
 
-%% Footer for introductory parts (no header by cleaning default)
-\ofoot[]{\engine\ Reference Manual} \ifoot[]{\pagemark}
+\maketitle
+\emptythanks
 
 %% Information page (2nd page)
 \input{../../global/info_page}
 
-\listoffigures
-\listoflistings
-\listoftables
-
-\clearpage
-
+%% Foreword
+%\frontmatter   %% Chapter numbering off and Roman numerals for page numbers
 \pagenumbering{roman}
-\ofoot[]{\engine\ Reference Manual} \ifoot[]{\pagemark}
-
-\input{introduction}
+\input{foreword}
 
 %% Table of Contents
 \tableofcontents
+\listoffigures
+\listoftables
+\listoflistings
 
 \clearpage
+%\end{document}
 
 
 %% Mainmatter
-%% =================================================================================================
+%% ==============================================================================
 
-%% Headings for document body
+%\mainmatter   %% Chapter numbering on, page numbering is reset with Arabic numerals
 \pagenumbering{arabic}
-\lohead{Chap.\ \thechapter\ \leftmark} \rehead{Sect.\ \thesection\ \rightmark}
-\ifoot[]{Page\ \pagemark\ of \pageref*{LastPage}}
 
 \include{chapters}
@@ -70,19 +78,32 @@
 
 %% Appendix
-%% =================================================================================================
+%% ==============================================================================
 
-\appendix   %% Chapter numbering with letters by now
-\lohead{Apdx\ \thechapter\ \leftmark}
+%% Chapter numbering is reset with letters now
+\appendix   
+
 \include{appendices}
-
-%% Append coding rules for every manual
-\input{../../global/coding_rules}
 
 
 %% Backmatter
-%% =================================================================================================
+%% ==============================================================================
 
-%% Bibliography and indexes
-\input{../../global/epilogue}
+%\backmatter   %% Chapter numbering off
+
+%% Bibliography
+\phantomsection
+\addcontentsline{toc}{chapter}{Bibliography}
+\bibliography{../main/bibliography}
+
+%% Index
+\clearpage
+\phantomsection
+\addcontentsline{toc}{chapter}{Indexes}
+\printindex[keys]
+\printindex[modules]
+\printindex[blocks]
+\printindex[parameters]
+\printindex[subroutines]
 
 \end{document}
+
Index: NEMO/trunk/doc/latex/global/epilogue.tex
===================================================================
--- NEMO/trunk/doc/latex/global/epilogue.tex	(revision 12206)
+++ 	(revision )
@@ -1,20 +1,0 @@
-
-\clearpage
-
-%% Bibliography
-\phantomsection
-\addcontentsline{toc}{chapter}{Bibliography}
-\lohead{Bibliography} \rehead{Bibliography}
-\bibliography{../main/bibliography}
-
-\clearpage
-
-%% Indexes
-\phantomsection
-\addcontentsline{toc}{chapter}{Indexes}
-\lohead{Indexes} \rehead{Indexes}
-\printindex[blocks]
-\printindex[keys]
-\printindex[modules]
-\printindex[parameters]
-\printindex[subroutines]
Index: NEMO/trunk/doc/latex/global/frontpage.tex
===================================================================
--- NEMO/trunk/doc/latex/global/frontpage.tex	(revision 12206)
+++ NEMO/trunk/doc/latex/global/frontpage.tex	(revision 12377)
@@ -1,67 +1,49 @@
 
-\begin{titlepage}
-%  \newgeometry{hmargin = 1.5cm, vmargin = 3cm}
-  \setlength{\parindent}{0pt}
+\title{\heading}
+\author{\firstauthor \and \secondauthor\thanks{\protect\input{thanks}}}
+\date{\today}
 
+\pretitle{
   \begin{center}
-    \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}
+\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\end{center}\vskip 0.5em}
+\preauthor{\begin{center}\Large\lineskip0.5em\begin{tabular}[t]{c}}
+\postauthor{\end{tabular}\par\end{center}}
+\predate{
+  \vfill
+  \begin{center}
+    \large Version \version ---
+}
+\postdate{
+    \par~\\
+    \href{http://doi.org/10.5281/zenodo.\zid}{\includegraphics{{badges/zenodo.\zid}.pdf}}
   \end{center}
+  \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}
+}
 
-  \spacetop
-  \textcolor{white}{\fontsize{0.8cm}{0.8cm}\selectfont\textbf{\heading}}
-  \ifdef{\subheading}{
-    \medskip
-    \par
-    \textcolor{white}{\Huge \subheading}
-  }{}
-  \spacedown
+\thanksmarkseries{fnsymbol}
 
-  \begin{center}
-    \LARGE Version \version\ -\ \today \\
-    \medskip
-    \href{http://doi.org/10.5281/zenodo.\zid}{ \includegraphics{badges/zenodo.\zid} }
-  \end{center}
-
-  \vfill
-
-  \begin{minipage}{\authorswidth}
-    \raggedleft
-    \input{authors}
-  \end{minipage}\hspace{15pt}\begin{minipage}{0.02\linewidth}
-    \rule{1pt}{\rulelenght}
-  \end{minipage}\hspace{ 5pt}\begin{minipage}{\abstractwidth}
-    \begin{abstract}
-      \input{abstract}
-    \end{abstract}
-  \end{minipage}
-
-  \vfill
-
-  \begin{center}
-    \Large
-    \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}
-
-\end{titlepage}
-
-\restoregeometry
Index: NEMO/trunk/doc/latex/global/highlighting.tex
===================================================================
--- NEMO/trunk/doc/latex/global/highlighting.tex	(revision 12206)
+++ NEMO/trunk/doc/latex/global/highlighting.tex	(revision 12377)
@@ -2,10 +2,10 @@
 %% ==============================================================================
 
-\usepackage[outputdir=../build, chapter, newfloat]{minted}
+\usepackage[outputdir=../build]{minted}
 
 %% Global highlighting style
 \definecolor{bg}{HTML}{f8f8f8}
 \usemintedstyle{emacs}
-\setminted{bgcolor=bg, fontsize=\scriptsize, breaklines}
+\setminted{bgcolor=bg, fontsize=\scriptsize, breaklines, frame=leftline}
 \setminted[xml]{style=borland} %% Specific per language
 
@@ -22,11 +22,12 @@
 
 %% File
-\newmintedfile[forfile]{fortran}{}
+\newmintedfile[forfile]{fortran}{}   % \forfile{../namelists/nam...}
 
 %% Inline
-\newmintinline[forcode]{fortran}{bgcolor=, fontsize=auto}   % \forcode{...}
-\newmintinline[xmlcode]{xml}{    bgcolor=, fontsize=auto}   % \xmlcode{...}
-\newmintinline[snippet]{console}{bgcolor=, fontsize=auto}   % \snippet{...}
+\newmintinline[forcode]{fortran}{fontsize=auto, frame=lines}   % \forcode{...}
+\newmintinline[xmlcode]{xml}{    fontsize=auto, frame=lines}   % \xmlcode{...}
+\newmintinline[snippet]{console}{fontsize=auto, frame=lines}   % \snippet{...}
 
 %% Namelists inclusion
 \newcommand{\nlst}[1]{\forfile{../../../namelists/#1}}
+
Index: NEMO/trunk/doc/latex/global/index.ist
===================================================================
--- NEMO/trunk/doc/latex/global/index.ist	(revision 12206)
+++ NEMO/trunk/doc/latex/global/index.ist	(revision 12377)
@@ -1,4 +1,8 @@
 headings_flag 1
-heading_prefix "\\medskip\\hfill\\textnormal{"
-heading_suffix "}\\hfill\\smallskip\n"
+heading_prefix "{\\medskip\\hfill\\large\\textsf{\\textbf{"
+heading_suffix "}}\\hfill}\\medskip\\nopagebreak\n"
+
 delim_0 "\\dotfill~"
+delim_1 "\\dotfill~"
+delim_2 "\\dotfill~"
+
Index: NEMO/trunk/doc/latex/global/index.tex
===================================================================
--- NEMO/trunk/doc/latex/global/index.tex	(revision 12206)
+++ 	(revision )
@@ -1,25 +1,0 @@
-
-\usepackage{imakeidx}
-
-%% Naming customization
-\renewcommand{\listingname}{namelist}
-\renewcommand{\listlistingname}{List of Namelists}
-
-%% Index entries (italic font for files, preformat for code)
-\newcommand{\hf}[1]{   \index{h90 files!#1}             \textit{#1.h90}          }
-\newcommand{\ifile}[1]{\index{Input NetCDF files!#1.nc} \textit{#1.nc}           }
-\newcommand{\jp}[1]{   \index{Model parameters!#1}      \texttt{#1}              }
-\newcommand{\key}[1]{  \index[keys]{#1@\texttt{\textbf{key\_#1}}} \texttt{\textbf{key\_#1}}}
-\newcommand{\mdl}[1]{  \index[modules]{#1@\textit{#1.F90}}        \textit{#1.F90}          }
-\newcommand{\nam}[2]{  \index[blocks]{#1@\texttt{\&nam#2}}        \forcode{&nam#1} (\autoref{lst:nam#1})}
-\newcommand{\np}[3][]{ \index[parameters]{#3@\texttt{#3}}         \forcode{#2#1}           }
-\newcommand{\rou}[1]{  \index[subroutines]{#1@\texttt{#1}}        \texttt{#1}              }
-
-
-\indexsetup{toclevel=section, othercode=\small}
-
-\makeindex[intoc=true, name=blocks     , title=Namelist blocks      , columns=3]
-\makeindex[intoc=true, name=keys       , title=CPP keys                        ]
-\makeindex[intoc=true, name=modules    , title=\fortran\ modules    , columns=3]
-\makeindex[intoc=true, name=parameters , title=Namelist parameters  , columns=3]
-\makeindex[intoc=true, name=subroutines, title=\fortran\ subroutines           ]
Index: NEMO/trunk/doc/latex/global/indexes.tex
===================================================================
--- NEMO/trunk/doc/latex/global/indexes.tex	(revision 12377)
+++ NEMO/trunk/doc/latex/global/indexes.tex	(revision 12377)
@@ -0,0 +1,32 @@
+
+\usepackage{imakeidx}
+
+%% Index entries (italic font for files, preformat for code)
+\newcommand{\hf}[1]{\textit{#1.h90}   \index{h90 files!#1}}
+\newcommand{\ifile}[1]{\textit{#1.nc} \index{Input NetCDF files!#1.nc}}
+\newcommand{\jp}[1]{\texttt{#1}       \index{Model parameters!#1}}
+\newcommand{\key}[1]{\index[keys]{#1}        \texttt{\textbf{key\_#1}}}
+\newcommand{\mdl}[1]{\index[modules]{#1}     \textit{#1.F90}          }
+\newcommand{\ngn}[1]{\index[blocks]{#1}      \texttt{#1}              }
+\newcommand{\np}[1]{ \index[parameters]{#1}  \texttt{#1}              }
+\newcommand{\rou}[1]{\index[subroutines]{#1} \texttt{#1}              }
+
+\indexsetup{toclevel=section, othercode=\small}
+
+\makeindex[intoc=true, name=keys       , title=CPP keys                      ]
+\makeindex[intoc=true, name=modules    , title=Modules                       ]
+\makeindex[intoc=true, name=blocks     , title=Namelist blocks               ]
+\makeindex[intoc=true, name=parameters , title=Namelist parameters, columns=3]
+\makeindex[intoc=true, name=subroutines, title=Subroutines                   ]
+
+
+%% Load hyperref at the end of the preamble to make it work with other pkgs
+\usepackage{hyperref}                    %% hyper
+\hypersetup{
+%  pdftitle={\heading},
+%  pdfauthor={\firstauthor and \secondauthor},
+  colorlinks,
+  citecolor=olive,
+  linkcolor=blue,
+  urlcolor=gray
+}
Index: NEMO/trunk/doc/latex/global/info_page.tex
===================================================================
--- NEMO/trunk/doc/latex/global/info_page.tex	(revision 12206)
+++ NEMO/trunk/doc/latex/global/info_page.tex	(revision 12377)
@@ -2,14 +2,14 @@
 \thispagestyle{plain}
 
-%% ================================================================
-%% Disclaimer
-%% ================================================================
+% ================================================================
+% Disclaimer
+% ================================================================
 \subsubsection*{Disclaimer}
 
 Like all components of the modelling framework,
-the \engine\ core engine is developed under the \href{http://www.cecill.info}{CECILL license},
-which is a French adaptation of the GNU GPL (\textbf{G}eneral \textbf{P}ublic \textbf{L}icense).
+the \engine~core engine is developed under the \href{http://www.cecill.info}{CECILL license},
+which is a French adaptation of the GNU GPL (General Public License).
 Anyone may use it freely for research purposes, and is encouraged to
-communicate back to the development team its own developments and improvements.
+communicate back to the NEMO team its own developments and improvements.
 
 The model and the present document have been made available as a service to the community.
@@ -18,24 +18,20 @@
 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:
 \begin{itemize}
-\item \faWordpress\ the \href{http://www.nemo-ocean.eu}{website} of the project detailing several
+\item the \href{http://www.nemo-ocean.eu}{website} of the project detailing several
   associated applications and an exhaustive users bibliography
-\item \faCodeFork\ the \href{http://forge.ipsl.jussieu.fr/nemo}{development platform} of
-  the model with the code repository for the shared reference and some main resources
-  (wiki, ticket system, forums, \ldots) \\
-  \faGithub\ the \href{http://github.com/NEMO-ocean/NEMO-examples}
-  {repository of the demonstration cases} for research or training
-\item \faCloudDownload\ the \href{http://zenodo.org/communities/nemo-ocean}{online archive}
-  delivering the publications issued by the consortium (manuals, reports, datasets, \ldots)
-\item \faEnvelope\ two mailing lists:
+\item the \href{http://forge.ipsl.jussieu.fr/nemo}{development platform} of the model with
+  the code repository and some main resources (wiki, ticket system, forums, \ldots)
+\item the \href{http://zenodo.org/communities/nemo-ocean}{online archive}
+  delivering the publications issued by the consortium
+\item two mailing lists:
   the \href{http://listes.ipsl.fr/sympa/info/nemo-newsletter}{newsletter} for
   top-down communications from the project
@@ -45,26 +41,25 @@
 \end{itemize}
 
-%% ================================================================
-%% Citation
-%% ================================================================
+% ================================================================
+% Citation
+% ================================================================
 \subsubsection*{Citation}
 
 Reference for papers and other publications is as follows:
 
-\medskip
+\vspace{0.5cm}
 
-\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}
+%% \sloppy: workaround for breaking DOI URL
+\sloppy
+``{\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}
 
 \begin{figure}[b]
-  \begin{minipage}[c]{0.7\textwidth}
-    \small
-    \ttfamily{
-      Scientific Notes of Climate Modelling Center \\
-      ISSN 1288-1619                               \\
+  \begin{minipage}[c]{0.72\textwidth}
+    \small\ttfamily{Scientific Notes of Climate Modelling Center \\
+      ISSN 1288-1619                                             \\
       Institut Pierre-Simon Laplace (IPSL)
     }
@@ -75,2 +70,3 @@
   \end{minipage}
 \end{figure}
+
Index: NEMO/trunk/doc/latex/global/latexmk.pl
===================================================================
--- NEMO/trunk/doc/latex/global/latexmk.pl	(revision 12206)
+++ 	(revision )
@@ -1,13 +1,0 @@
-
-## Defaults
-$do_cd    = 1;   ## Change to the directory of the main source file
-$silent   = 1;   ## Less verbosity
-
-## Use of 'build' relative directory
-$ENV{'openout_any'}='a';
-$out_dir = '../build';
-
-## Global option
-set_tex_cmds( '-shell-escape' );
-
-$makeindex = "makeindex %O -s ../../global/index -o $out_dir/%D $out_dir/%S";
Index: NEMO/trunk/doc/latex/global/latexmkrc
===================================================================
--- NEMO/trunk/doc/latex/global/latexmkrc	(revision 12377)
+++ NEMO/trunk/doc/latex/global/latexmkrc	(revision 12377)
@@ -0,0 +1,17 @@
+
+## Defaults
+$silent   = 1;
+$pdf_mode = 1;
+
+## Using relative paths
+$ENV{'openout_any'}='a';
+$out_dir = '../build';
+
+## Custom cmds
+$makeindex = 'makeindex -s %R.ist %O -o %D %S';
+$pdflatex  = 'pdflatex -shell-escape %O %S';
+
+#@BIBINPUTS=('.', '../main');
+#$bibtex    = 'bibtex %O ../main/bibliography.bib';
+#$kpsewhich = 'kpsewhich bibliography.bib'
+
Index: NEMO/trunk/doc/latex/global/new_cmds.tex
===================================================================
--- NEMO/trunk/doc/latex/global/new_cmds.tex	(revision 12206)
+++ NEMO/trunk/doc/latex/global/new_cmds.tex	(revision 12377)
@@ -2,21 +2,13 @@
 %% ==============================================================================
 
-%% 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}}
+%% Include references and index for compilation of single subfile 
+\newcommand{\mtoc}{\minitoc}
+\newcommand{\biblio}{\bibliography{../main/bibliography}}
+\newcommand{\pindex}{\printindex}
 
-%% 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}}
+%% NEMO and Fortran in small capitals
+\newcommand{\NEMO}{\textsc{nemo}~}
+\newcommand{\fortran}{\textsc{Fortran}~}
+\newcommand{\fninety}{\textsc{Fortran 90}~}
 
 %% Common aliases
@@ -26,6 +18,6 @@
 \newcommand{\ztilde}{\ensuremath{\tilde z}}
 \newcommand{\stilde}{\ensuremath{\tilde s}}
-\newcommand{\ie}{\ensuremath{i.e.}}
-\newcommand{\eg}{\ensuremath{e.g.}}
+\newcommand{\ie}{\ensuremath{i.e.}~}
+\newcommand{\eg}{\ensuremath{e.g.}~}
 
 %% Inline maths
@@ -33,37 +25,13 @@
 \newcommand{\rdt}{\Delta t}
 
-%% Gurvan's comments
-\newcommand{\cmtgm}[1]{}
+%% Text env. for Gurvan
+\newcommand{\gmcomment}[1]{}
 
 %% Maths
 \newcommand{\lt}{\left}
 \newcommand{\rt}{\right}
-\newcommand{\vect}[1]{\ensuremath{ \mathbf{#1} }}
+\newcommand{\vect}[1]{\ensuremath{\mathbf{#1}}}
 \newcommand{\pd}[2][]{\ensuremath{\frac{\partial #1}{\partial #2}}}
 
-%% Convert chapter/section headings to lowercase
-\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
-\renewcommand{\sectionmark}[1]{\markright{#1}{}}
-
-%% Retrieve month name
-\renewcommand{\today}{
-  \ifcase \month\or January\or February\or March\or
-                    April\or   May\or      June\or
-                    July\or    August\or   September\or
-                    October\or November\or December
-  \fi, \number \year
-}
-
-%% Link to orcid profile
-\newcommand{\orcid}[1]{\href{http://orcid.org/#1}{\textcolor{orcidcolor}\aiOrcidSquare}}
-
-%% Workaround for \listoffigures
-\DeclareRobustCommand{\triad}[6][]{\ensuremath{ {}_{#2}^{#3} { \mathbb{#4}_{#1} }_{#5}^{\,#6} }}
-
-%% New command for ToC
-\newcommand{\chaptertoc}[1][Table of contents]{%
-  \thispagestyle{empty}
-  \etocsettocstyle{\addsec*{#1}}{}%
-  \localtableofcontents%
-  \vfill
-}
+%% Workaround for issue with \listoffigures
+\DeclareRobustCommand{\triad}[6][]{\ensuremath{{}_{#2}^{#3}{\mathbb{#4}_{#1}}_{#5}^{\,#6}}}
Index: NEMO/trunk/doc/latex/global/packages.tex
===================================================================
--- NEMO/trunk/doc/latex/global/packages.tex	(revision 12206)
+++ NEMO/trunk/doc/latex/global/packages.tex	(revision 12377)
@@ -3,42 +3,24 @@
 %% ==============================================================================
 
-%% 'hyperref' pkg is loaded at the end of the preamble for higher compatibility
+\usepackage{natbib}                      %% bib
+\usepackage{caption}                     %% caption
+\usepackage{xcolor}                      %% color
+\usepackage{times}                       %% font
+\usepackage{enumitem}                    %% list
+\usepackage{amsmath}                     %% maths
+%\usepackage{fancyhdr}                    %% page
+\usepackage{minitoc}                     %% toc
+\usepackage{subfiles}                    %% subdocs
+\usepackage{draftwatermark}              %% watermark
+\usepackage{titling}                     %% titlepage
 
-%% KOMA-script
-\usepackage[footsepline=0.25pt, headsepline=0.25pt]{scrlayer-scrpage}
-
-%% customization (layout, header/footer styles & contents, background)
-\usepackage{draftwatermark}
-\usepackage[margin = 2cm]{geometry}
-\usepackage[pages = some]{background}   %% 'some' for title page
-\usepackage[Bjornstrup]{fncychap}
-
-%% Fonts
-\usepackage{fontspec}
-%% Issue with fontawesome pkg: path to FontAwesome.otf has to be hard-coded
-\defaultfontfeatures{
-    Path = /usr/local/texlive/2019/texmf-dist/fonts/opentype/public/fontawesome/
-}
-\usepackage{academicons, fontawesome, newtxtext}
-
-%% Formatting
-\usepackage[inline]{enumitem}
-\usepackage{etoc, tabularx, xcolor}
-
-%% Graphics
-\usepackage{caption, graphicx, grffile}
-
-%% Labels
-\usepackage{lastpage, natbib}
-
-%% Mathematics
-\usepackage{amsmath, amssymb, mathtools}
-
-%% Versatility
-\usepackage{subfiles}
+%% Extensions in bundle package
+\usepackage{amssymb, graphicx, tabularx, textcomp}
+\usepackage[utf8]{inputenc}              %% input encoding
 
 %% Configuration
-\graphicspath{ {../../../} {../figures/} }
+\graphicspath{ {../../figures/} {../../figures/\engine/} }
+%\captionsetup{margin=10pt, font={small}, labelsep=colon, labelfont={bf}}
+\renewcommand{\bibfont}{\small}
+%\renewcommand{\bibsep}{3pt}
 
-%% Missing utmr8a font
-\usepackage{times}
Index: NEMO/trunk/doc/latex/global/preamble.tex
===================================================================
--- NEMO/trunk/doc/latex/global/preamble.tex	(revision 12377)
+++ NEMO/trunk/doc/latex/global/preamble.tex	(revision 12377)
@@ -0,0 +1,7 @@
+
+\input{../../global/packages}
+\input{../../global/highlighting}
+\input{../../global/new_cmds}
+\input{../../global/styles}
+%\input{../../global/todonotes}
+
Index: NEMO/trunk/doc/latex/global/prologue.tex
===================================================================
--- NEMO/trunk/doc/latex/global/prologue.tex	(revision 12206)
+++ 	(revision )
@@ -1,25 +1,0 @@
-
-%% Specific configuration
-\input{../main/settings}
-
-%% Global configuration
-\input{../../global/packages}
-\input{../../global/highlighting}
-\input{../../global/index}
-\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   %% Links even in draft mode
-}
-
-%% `\autoref` uncapitalization
-\renewcommand{\appendixautorefname}{appendix}
-\renewcommand{\equationautorefname}{equation}
-\renewcommand{\figureautorefname}{figure}
-\renewcommand{\tableautorefname}{table}
Index: NEMO/trunk/doc/latex/global/styles.tex
===================================================================
--- NEMO/trunk/doc/latex/global/styles.tex	(revision 12206)
+++ NEMO/trunk/doc/latex/global/styles.tex	(revision 12377)
@@ -3,83 +3,59 @@
 %% ==============================================================================
 
-%% Colors
-\setmanualcolor
-\colorlet{manualcolorshaded}{manualcolor!60}
-\definecolor{orcidcolor}{HTML}{A6CE39}
+%\pagestyle{fancy}
+\bibliographystyle{../../global/ametsoc}
+\renewcommand{\bibpreamble}{\begin{multicols}{2}}
+\renewcommand{\bibpostamble}{\end{multicols}}
+
+%% Additional fonts
+\DeclareMathAlphabet{\mathpzc}{OT1}{pzc}{m}{it}
 
 %% Page layout
-\pagestyle{scrheadings}
-\addtokomafont{pagehead}{  \sffamily              }
-\addtokomafont{pagefoot}{  \sffamily \footnotesize}
-\addtokomafont{pagenumber}{\sffamily \slshape     }
-\addtokomafont{chapter}{\color{white}}
-\ohead{} \ofoot{}   %% Clear defaults
+%\fancyhf{}
+%\fancyhead[LE,RO]{\bfseries\thepage}
+%\fancyhead[LO]{\bfseries\hspace{-0em}\rightmark}
+%\renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}}
+%\fancyhead[RE]{\bfseries\leftmark}
+%\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
+%\renewcommand{\headrulewidth}{0.5pt}
+%\renewcommand{\footrulewidth}{0pt  }
+%\addtolength{\headheight}{2.6pt}
 
-%% Caption
-\captionsetup{font = footnotesize, justification = justified}
-
-%% Footnote
-\renewcommand{\thefootnote}{\fnsymbol{footnote}}
-
-%% Bibliography
-\bibliographystyle{../../global/ametsoc}
-\renewcommand{\bibfont}{\small}
-\renewcommand{\bibpreamble }{\begin{multicols}{2}}
-\renewcommand{\bibpostamble}{  \end{multicols}   }
 
 %% Catcodes
-\makeatletter
+%\makeatletter
+%\def\LigneVerticale{\vrule height 5cm depth 2cm\hspace{0.1cm}\relax}
+%\def\LignesVerticales{\let\LV\LigneVerticale\LV\LV\LV\LV\LV\LV\LV\LV\LV\LV}
+%\def\GrosCarreAvecUnChiffre#1{
+%	\rlap{\vrule height 0.8cm width 1cm depth 0.2cm}
+%	\rlap{\hbox to 1cm{\hss\mbox{\color{white} #1}\hss}}
+% 	\vrule height 0pt width 1cm depth 0pt
+%}
+%\def\@makechapterhead#1{
+%	\hbox{
+%		\huge\LignesVerticales\hspace{-0.5cm}
+%		\GrosCarreAvecUnChiffre{\thechapter}\hspace{0.2cm}
+%		\hbox{#1}
+%	}
+%	\par\vskip
+%1cm
+%}
+%\def\@makeschapterhead#1{
+%	\hbox{
+%		\huge\LignesVerticales
+%		\hbox{#1}
+%	}
+%	\par\vskip
+%2cm
+%}
+%\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
+%  \hbox{}
+%  \vspace*{\fill}
+%  \vspace{\fill}
+%  \thispagestyle{empty}
+%  \newpage
+%  \if@twocolumn\hbox{}\newpage\fi\fi\fi}
+%\def\@seccntformat#1{\protect\makebox[0pt][r]{\csname the#1\endcsname\quad}}
+%\makeatother
 
-%% Prevent error with tikz and namelist inclusion
-\global\let\tikz@ensure@dollar@catcode=\relax
 
-%% First page
-\backgroundsetup{
-  firstpage = true,
-  scale = 1, angle = 0, opacity = 1,
-  contents = {
-    \begin{tikzpicture}[remember picture, overlay]
-      \path [fill = manualcolor] (-0.5\paperwidth, 7) rectangle (0.5\paperwidth, 10);
-    \end{tikzpicture}
-  }
-}
-
-%% 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@%
-}
-
-%% Temporary fix
-\def\set@curr@file#1{%
-  \begingroup
-    \escapechar\m@ne
-    \xdef\@curr@file{\expandafter\string\csname #1\endcsname}%
-  \endgroup
-}
-\def\quote@name#1{"\quote@@name#1\@gobble""}
-\def\quote@@name#1"{#1\quote@@name}
-\def\unquote@name#1{\quote@@name#1\@gobble"}
-
-\makeatother
