Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/NEMO_manual_state.txt
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/NEMO_manual_state.txt	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/NEMO_manual_state.txt	(revision 14644)
@@ -15,6 +15,6 @@
 chap_misc.tex: key{mpp\_mpi} key{nosignedzero} key{vectopt\_loop} np{iom\_get} np{jpjdta} np{jpjglo} np{nn\_bench} np{nn\_bit\_cmp} np{open\_ocean\_jstart} 
 chap_LDF.tex: hf{dynldf\_cNd} hf{ldfdyn\_substitute} hf{ldftra\_substitute} hf{traldf\_c1d} hf{traldf\_cNd} key{dynldf\_c1d} key{dynldf\_c2d} key{dynldf\_c3d} key{traldf\_c1d} key{traldf\_c2d} key{traldf\_c3d} key{traldf\_cNd} key{traldf\_eiv} mdl{ldfdyn\_c2d} mdl{ldfeiv} mdl{traadv\_eiv} np{ln\_dynldf\_bilap} np{ln\_sco} np{nn\_eos} np{rn\_aeih\_0} np{rn\_aeiv} np{rn\_aeiv\_0} np{rn\_ahm0} np{rn\_ahmb0} np{rn\_aht0} np{rn\_ahtb0} np{traldf\_grif} np{traldf\_grif\_iso} rou{ldf\_dyn\_c2d\_orca} rou{ldfslp\_init} 
-chap_LBC.tex: jp{jpreci} key{mpp\_mpi} np{jperio} np{jpiglo} np{jpindt} np{jpinft} np{jpjglo} np{jpjnob} np{nbdysegn} np{nn\_bdy\_jpk} np{nn\_msh} np{nn\_tra} rou{inimpp2} 
-chap_DOM.tex: key{mpp\_mpi} ngn{namzgr} ngn{namzgr\_sco} nlst{namzgr} nlst{namzgr_sco} np{jperio} np{jpiglo} np{jpjglo} np{jpkglo} np{ln\_sco} np{ln\_sigcrit} np{ln\_s\_SF12} np{ln\_s\_SH94} np{ln\_tsd\_ini} np{ln\_zco} np{ln\_zps} np{nn\_bathy} np{nn\_msh} np{ppa0} np{ppa1} np{ppacr} np{ppdzmin} np{pphmax} np{ppkth} np{ppsur} np{rn\_alpha} np{rn\_bb} np{rn\_e3zps\_min} np{rn\_e3zps\_rat} np{rn\_hc} np{rn\_rmax} np{rn\_sbot\_max} np{rn\_sbot\_min} np{rn\_theta} np{rn\_zb\_a} np{rn\_zb\_b} np{rn\_zs} rou{istate\_t\_s} 
+chap_LBC.tex: jp{jpreci} key{mpp\_mpi} np{jpiglo} np{jpindt} np{jpinft} np{jpjglo} np{jpjnob} np{nbdysegn} np{nn\_bdy\_jpk} np{nn\_msh} np{nn\_tra} rou{inimpp2} 
+chap_DOM.tex: key{mpp\_mpi} ngn{namzgr} ngn{namzgr\_sco} nlst{namzgr} nlst{namzgr_sco} np{jpiglo} np{jpjglo} np{jpkglo} np{ln\_sco} np{ln\_sigcrit} np{ln\_s\_SF12} np{ln\_s\_SH94} np{ln\_tsd\_ini} np{ln\_zco} np{ln\_zps} np{nn\_bathy} np{nn\_msh} np{ppa0} np{ppa1} np{ppacr} np{ppdzmin} np{pphmax} np{ppkth} np{ppsur} np{rn\_alpha} np{rn\_bb} np{rn\_e3zps\_min} np{rn\_e3zps\_rat} np{rn\_hc} np{rn\_rmax} np{rn\_sbot\_max} np{rn\_sbot\_min} np{rn\_theta} np{rn\_zb\_a} np{rn\_zb\_b} np{rn\_zs} rou{istate\_t\_s} 
 chap_conservation.tex: key{\_} 
 annex_iso.tex: key{trabbl} key{traldf\_eiv} np{ln\_traldf\_eiv} np{ln\_traldf\_gdia} 
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/.svnignore
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/.svnignore	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/.svnignore	(revision 14644)
@@ -9,5 +9,8 @@
 *.lo*
 *.out
+*.pdf
+*.pyg
+*.tdo
 *.toc
 *.xdv
-_minted-*
+cache*
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/main/NEMO_manual.ist
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/main/NEMO_manual.ist	(revision 14644)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/main/NEMO_manual.ist	(revision 14644)
@@ -0,0 +1,1 @@
+link ../../global/index.ist
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/main/abstract.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/main/abstract.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/main/abstract.tex	(revision 14644)
@@ -1,17 +1,8 @@
-%% ================================================================
-%% Abstract
-%% ================================================================
+%% =================================================================================================
+%% Specific abstract
+%% =================================================================================================
 
-%% Common part between NEMO-SI3-TOP
-\NEMO\ (``Nucleus for European Modelling of the Ocean'') is a framework of ocean-related engines.
-It is intended to be a flexible tool for studying the ocean dynamics and thermodynamics (``blue ocean''),
-as well as its interactions with the components of the Earth climate system over
-a wide range of space and time scales.
-Within \NEMO, the ocean engine is interfaced with a sea-ice model (\SIcube\ or
-\href{http://github.com/CICE-Consortium/CICE}{CICE}),
-passive tracers and biogeochemical models (\TOP) and,
-via the \href{http://portal.enes.org/oasis}{OASIS} coupler,
-with several atmospheric general circulation models.
-It also supports two-way grid embedding by means of the \href{http://agrif.imag.fr}{AGRIF} software.
+%% Common part
+\input{../../global/nemo}
 
 %% Specific part
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/main/appendices.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/main/appendices.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/main/appendices.tex	(revision 14644)
@@ -1,2 +1,5 @@
+%% =================================================================================================
+%% Appendices
+%% =================================================================================================
 
 \subfile{../subfiles/apdx_s_coord}      %% A. Generalised vertical coordinate
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/main/authors.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/main/authors.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/main/authors.tex	(revision 14644)
@@ -1,34 +1,9 @@
-%Romain Bourdall\'{e}-Badie
-%\orcid{0000-0002-8742-3289} \\
-%Mike Bell                   \\
-%J\'{e}r\^{o}me Chanut       \\
-%Emanuela Clementi
-%\orcid{0000-0002-5752-1849} \\
-%Andrew Coward
-%\orcid{0000-0002-0456-129X} \\
-%Massimiliano Drudi
-%\orcid{0000-0002-9951-740X} \\
-%Christian \'{E}th\'{e}      \\
-%Doroteaciro Iovino
-%\orcid{0000-0001-5132-7255} \\
-%Dan Lea                     \\
-%Claire L\'{e}vy
-%\orcid{0000-0003-2518-6692} \\
-%Gurvan Madec
-%\orcid{0000-0002-6447-4198} \\
-%Nicolas Martin              \\
-%S\'{e}bastien Masson
-%\orcid{0000-0002-1694-8117} \\
-%Pierre Mathiot              \\
-%Silvia Mocavero
-%\orcid{0000-0002-6309-8282} \\
-%Simon M\"{u}ller            \\
-%George Nurser               \\
-%Guillaume Samson
-%\orcid{0000-0001-7481-6369} \\
-%Dave Storkey
+%% =================================================================================================
+%% Authors
+%% =================================================================================================
 
+\orcid{0000-0002-6447-4198} Gurvan Madec                \\
+                            Mike Bell                   \\
 \orcid{0000-0002-8742-3289} Romain Bourdall\'{e}-Badie  \\
-                            Mike Bell                   \\
                             J\'{e}r\^{o}me Chanut       \\
 \orcid{0000-0002-5752-1849} Emanuela Clementi           \\
@@ -39,5 +14,4 @@
                             Dan Lea                     \\
 \orcid{0000-0003-2518-6692} Claire L\'{e}vy             \\
-\orcid{0000-0002-6447-4198} Gurvan Madec                \\
                             Nicolas Martin              \\
 \orcid{0000-0002-1694-8117} S\'{e}bastien Masson        \\
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/main/bibliography.bib
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/main/bibliography.bib	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/main/bibliography.bib	(revision 14644)
@@ -119,4 +119,16 @@
   issn          = "0148-0227",
   doi           = "10.1029/2001jc000922"
+}
+
+@Article{         Asaydavis2016,
+  author        = {Asay-Davis, X. S. and Cornford, S. L. and Durand, G. and Galton-Fenzi, B. K. and Gladstone, R. M. and Gudmundsson, G. H. and Hattermann, T. and Holland, D. M. and Holland, D. and Holland, P. R. and Martin, D. F. and Mathiot, P. and Pattyn, F. and Seroussi, H.},
+  title         = {Experimental design for three interrelated marine ice sheet and ocean model intercomparison projects: MISMIP v. 3 (MISMIP$+$), ISOMIP v. 2 (ISOMIP$+$) and MISOMIP v. 1 (MISOMIP1)},
+  journal       = {Geoscientific Model Development},
+  volume        = {9},
+  year          = {2016},
+  number        = {7},
+  pages         = {2471--2497},
+  url           = {https://www.geosci-model-dev.net/9/2471/2016/},
+  doi           = {10.5194/gmd-9-2471-2016}
 }
 
@@ -878,4 +890,16 @@
 }
 
+@Article{         favier2019,
+  author        = {Favier, L. and Jourdain, N. C. and Jenkins, A. and Merino, N. and Durand, G. and Gagliardini, O. and Gillet-Chaulet, F. and Mathiot, P.},
+  title         = {Assessment of sub-shelf melting parameterisations using the ocean--ice-sheet coupled model NEMO(v3.6)--Elmer/Ice(v8.3)},
+  journal       = {Geoscientific Model Development},
+  volume        = {12},
+  year          = {2019},
+  number        = {6},
+  pages         = {2255--2283},
+  url           = {https://www.geosci-model-dev.net/12/2255/2019/},
+  doi           = {10.5194/gmd-12-2255-2019}
+}
+
 @article{         flather_JPO94,
   title         = "A storm surge prediction model for the northern Bay of
@@ -1186,4 +1210,17 @@
 }
 
+@article{         grosfeld1997,
+author          = {Grosfeld, K. and Gerdes, R. and Determann, J.},
+title           = {Thermohaline circulation and interaction between ice shelf cavities and the adjacent open ocean},
+journal         = {Journal of Geophysical Research: Oceans},
+
+volume          = {102},
+number          = {C7},
+pages           = {15595-15610},
+doi             = {10.1029/97JC00891},
+url             = {https://agupubs.onlinelibrary.wiley.com/doi/abs/10.1029/97JC00891},
+year            = {1997}
+}
+
 @article{         guilyardi.madec.ea_CD01,
   title         = "The role of lateral ocean physics in the upper ocean
@@ -1414,4 +1451,29 @@
   issn          = "0148-0227",
   doi           = "10.1029/91jc01842"
+}
+
+@article{         jenkins2001,
+  author        = {Jenkins, Adrian and Hellmer, Hartmut H. and Holland, David M.},
+  title         = {The Role of Meltwater Advection in the Formulation of Conservative Boundary Conditions at an Ice–Ocean Interface},
+  journal       = {Journal of Physical Oceanography},
+  volume        = {31},
+  number        = {1},
+  pages         = {285-296},
+  year          = {2001},
+  doi           = {10.1175/1520-0485(2001)031<0285:TROMAI>2.0.CO;2},
+  url           = {https://doi.org/10.1175/1520-0485(2001)031<0285:TROMAI>2.0.CO;2}
+}
+
+@article{         jourdain2017,
+  author        = {Jourdain, Nicolas C. and Mathiot, Pierre and Merino, Nacho and Durand, Gaël and Le Sommer, Julien and Spence, Paul and Dutrieux, Pierre and Madec, Gurvan},
+  title         = {Ocean circulation and sea-ice thinning induced by melting ice shelves in the Amundsen Sea},
+  journal       = {Journal of Geophysical Research: Oceans},
+  volume        = {122},
+  number        = {3},
+  pages         = {2550-2573},
+  keywords      = {Amundsen Sea, ice shelf, efficiency, circumpolar deep water, ocean circulation, sea ice},
+  doi           = {10.1002/2016JC012509},
+  url           = {https://agupubs.onlinelibrary.wiley.com/doi/abs/10.1002/2016JC012509},
+  year          = {2017}
 }
 
@@ -2226,4 +2288,18 @@
 }
 
+@article{Merino_OM2016,
+title = "Antarctic icebergs melt over the Southern Ocean: Climatology and impact on sea ice",
+journal = "Ocean Modelling",
+volume = "104",
+pages = "99 - 110",
+year = "2016",
+issn = "1463-5003",
+doi = "https://doi.org/10.1016/j.ocemod.2016.05.001",
+url = "http://www.sciencedirect.com/science/article/pii/S1463500316300300",
+author = "Nacho Merino and Julien {Le Sommer} and Gael Durand and Nicolas C. Jourdain and Gurvan Madec and Pierre Mathiot and Jean Tournadre",
+keywords = "Icebergs, Southern Ocean, Sea ice, Freshwater fluxes",
+abstract = "Recent increase in Antarctic freshwater release to the Southern Ocean is suggested to contribute to change in water masses and sea ice. However, climate models differ in their representation of the freshwater sources. Recent improvements in altimetry-based detection of small icebergs and in estimates of the mass loss of Antarctica may help better constrain the values of Antarctic freshwater releases. We propose a model-based seasonal climatology of iceberg melt over the Southern Ocean using state-of-the-art observed glaciological estimates of the Antarctic mass loss. An improved version of a Lagrangian iceberg model is coupled with a global, eddy-permitting ocean/sea ice model and compared to small icebergs observations. Iceberg melt increases sea ice cover, about 10% in annual mean sea ice volume, and decreases sea surface temperature over most of the Southern Ocean, but with distinctive regional patterns. Our results underline the importance of improving the representation of Antarctic freshwater sources. This can be achieved by forcing ocean/sea ice models with a climatological iceberg fresh-water flux."
+}
+
 @article{         merryfield.holloway.ea_JPO99,
   title         = "A Global Ocean Model with Double-Diffusive Mixing",
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/main/chapters.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/main/chapters.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/main/chapters.tex	(revision 14644)
@@ -1,17 +1,21 @@
-\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
+%% =================================================================================================
+%% Chapters
+%% =================================================================================================
+
+\subfile{../subfiles/chap_model_basics} %% Continuous equations and assumptions
+\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_cfgs}         %% Predefined configurations
 
 %% Not included
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/main/introduction.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/main/introduction.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/main/introduction.tex	(revision 14644)
@@ -1,21 +1,3 @@
-
 \chapter*{Introduction}
-
-%\chaptertoc
-
-%\paragraph{Changes record} ~\\
-
-%\thispagestyle{plain}
-
-%{\footnotesize
-%  \begin{tabularx}{\textwidth}{l||X|X}
-%    Release & Author(s) & Modifications \\
-%    \hline
-%    {\em x.x} & {\em ...} & {\em ...}   \\
-%    {\em ...} & {\em ...} & {\em ...}   \\
-%  \end{tabularx}
-%}
-
-%\clearpage
 
 The \textbf{N}ucleus for \textbf{E}uropean \textbf{M}odelling of the \textbf{O}cean (\NEMO) is
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/main/settings.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/main/settings.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/main/settings.tex	(revision 14644)
@@ -1,20 +1,18 @@
-%% Engine (subfolder name)
-\def \engine{NEMO}
+%% Engine
+\def\eng{NEMO}
 
-%% Cover page settings
-\def \spacetop{  \vspace*{1.85cm} }
-\def \heading{NEMO ocean engine}
-%\def \subheading{}
-\def \spacedown{ \vspace*{0.75cm } }
-\def \authorswidth{ 0.3\linewidth}
-\def \rulelenght{270pt}
-\def \abstractwidth{0.6\linewidth}
+%% Cover page
+\def\spcup{\vspace*{2.15cm}}
+\def\hdg{NEMO ocean engine}
+%\def\shdg{} %% No subheading
+\def\spcdn{\vspace*{1.00cm}}
+\def\autwd{0.25\linewidth}\def\lnlg{270pt}\def\abswd{0.65\linewidth}
 
-%% Manual color (frontpage banner, links  and chapter boxes)
-\def \setmanualcolor{ \definecolor{manualcolor}{cmyk}{1, .60, 0, .4} }
+%% Color in cmyk model for manual theme (frontpage banner, links and chapter boxes)
+\def\clr{1.0,0.6,0.0,0.4}
 
 %% IPSL publication number
-\def \ipslnum{27}
+\def\ipsl{27}
 
-%% Zenodo ID, i.e. doi:10.5281/zenodo.\([0-9]*\)
-\def \zid{1464816}
+%% Zenodo ID, i.e. doi:10.5281/zenodo.\zid
+\def\zid{1464816}
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/apdx_DOMAINcfg.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/apdx_DOMAINcfg.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/apdx_DOMAINcfg.tex	(revision 14644)
@@ -6,8 +6,4 @@
 \label{apdx:DOMCFG}
 
-%    {\em 4.0} & {\em Andrew Coward} & {\em Created at v4.0 from materials removed from chap\_DOM that are still relevant to the \forcode{DOMAINcfg} tool and which illustrate and explain the choices to be made by the user when setting up new domains }  \\
-
-\thispagestyle{plain}
-
 \chaptertoc
 
@@ -16,10 +12,10 @@
 {\footnotesize
   \begin{tabularx}{\textwidth}{l||X|X}
-    Release & Author(s) & Modifications \\
-    \hline
-    {\em   4.0} & {\em ...} & {\em ...} \\
-    {\em   3.6} & {\em ...} & {\em ...} \\
-    {\em   3.4} & {\em ...} & {\em ...} \\
-    {\em <=3.4} & {\em ...} & {\em ...}
+    Release     & Author(s)            & Modifications                                                 \\
+    \hline
+    {\em  next} & {\em Pierre Mathiot} & {\em Add ice shelf and closed sea option description        } \\
+    {\em   4.0} & {\em  Andrew Coward} & {\em Creation from materials removed from \autoref{chap:DOM}
+                                              that are still relevant to the DOMAINcfg tool
+                                              when setting up new domains                            }
   \end{tabularx}
 }
@@ -46,5 +42,4 @@
 
 \begin{listing}
-%  \nlst{namdom_domcfg}
   \begin{forlines}
 !-----------------------------------------------------------------------
@@ -91,5 +86,5 @@
  \item [{\np{jphgr_mesh}{jphgr\_mesh}=0}]  The most general curvilinear orthogonal grids.
   The coordinates and their first derivatives with respect to $i$ and $j$ are provided
-  in a input file (\ifile{coordinates}), read in \rou{hgr\_read} subroutine of the domhgr module.
+  in a input file (\textit{coordinates.nc}), read in \rou{hgr\_read} subroutine of the domhgr module.
   This is now the only option available within \NEMO\ itself from v4.0 onwards.
 \item [{\np{jphgr_mesh}{jphgr\_mesh}=1 to 5}] A few simple analytical grids are provided (see below).
@@ -156,6 +151,6 @@
 The reference coordinate transformation $z_0(k)$ defines the arrays $gdept_0$ and
 $gdepw_0$ for $t$- and $w$-points, respectively. See \autoref{sec:DOMCFG_sco} for the
-S-coordinate options.  As indicated on \autoref{fig:DOM_index_vert} \jp{jpk} is the number of
-$w$-levels.  $gdepw_0(1)$ is the ocean surface.  There are at most \jp{jpk}-1 $t$-points
+S-coordinate options.  As indicated on \autoref{fig:DOM_index_vert} \texttt{jpk} is the number of
+$w$-levels.  $gdepw_0(1)$ is the ocean surface.  There are at most \texttt{jpk}-1 $t$-points
 inside the ocean, the additional $t$-point at $jk = jpk$ is below the sea floor and is not
 used.  The vertical location of $w$- and $t$-levels is defined from the analytic
@@ -167,5 +162,5 @@
 
 It is possible to define a simple regular vertical grid by giving zero stretching
-(\np[=0]{ppacr}{ppacr}).  In that case, the parameters \jp{jpk} (number of $w$-levels)
+(\np[=0]{ppacr}{ppacr}).  In that case, the parameters \texttt{jpk} (number of $w$-levels)
 and \np{pphmax}{pphmax} (total ocean depth in meters) fully define the grid.
 
@@ -179,5 +174,5 @@
 \end{gather}
 
-where $k = 1$ to \jp{jpk} for $w$-levels and $k = 1$ to $k = 1$ for $t-$levels.  Such an
+where $k = 1$ to \texttt{jpk} for $w$-levels and $k = 1$ to $k = 1$ for $t-$levels.  Such an
 expression allows us to define a nearly uniform vertical location of levels at the ocean
 top and bottom with a smooth hyperbolic tangent transition in between (\autoref{fig:DOMCFG_zgr}).
@@ -227,5 +222,5 @@
 \end{equation}
 
-With the choice of the stretching $h_{cr} = 3$ and the number of levels \jp{jpk}~$= 31$,
+With the choice of the stretching $h_{cr} = 3$ and the number of levels \texttt{jpk}~$= 31$,
 the four coefficients $h_{sur}$, $h_0$, $h_1$, and $h_{th}$ in
 \autoref{eq:DOMCFG_zgr_ana_2} have been determined such that \autoref{eq:DOMCFG_zgr_coef}
@@ -245,5 +240,5 @@
   Values from $3$ to $10$ are usual.
 \item \np{ppkth}{ppkth}~$= h_{th}$: is approximately the model level at which maximum stretching occurs
-  (nondimensional, usually of order 1/2 or 2/3 of \jp{jpk})
+  (nondimensional, usually of order 1/2 or 2/3 of \texttt{jpk})
 \item \np{ppdzmin}{ppdzmin}: minimum thickness for the top layer (in meters).
 \item \np{pphmax}{pphmax}: total depth of the ocean (meters).
@@ -251,5 +246,5 @@
 
 As an example, for the $45$ layers used in the DRAKKAR configuration those parameters are:
-\jp{jpk}~$= 46$, \np{ppacr}{ppacr}~$= 9$, \np{ppkth}{ppkth}~$= 23.563$, \np{ppdzmin}{ppdzmin}~$= 6~m$,
+\texttt{jpk}~$= 46$, \np{ppacr}{ppacr}~$= 9$, \np{ppkth}{ppkth}~$= 23.563$, \np{ppdzmin}{ppdzmin}~$= 6~m$,
 \np{pphmax}{pphmax}~$= 5750~m$.
 
@@ -346,5 +341,5 @@
   This is meant for the "EEL-R5" configuration, a periodic or open boundary channel with a seamount.
 \item [{\np[=1]{nn_bathy}{nn\_bathy}}]: read a bathymetry and ice shelf draft (if needed).
-  The \ifile{bathy\_meter} file (Netcdf format) provides the ocean depth (positive, in meters) at
+  The \textit{bathy\_meter.nc} file (Netcdf format) provides the ocean depth (positive, in meters) at
   each grid point of the model grid.
   The bathymetry is usually built by interpolating a standard bathymetry product (\eg\ ETOPO2) onto
@@ -352,9 +347,4 @@
   Defining the bathymetry also defines the coastline: where the bathymetry is zero,
   no wet levels are defined (all levels are masked).
-
-  The \ifile{isfdraft\_meter} file (Netcdf format) provides the ice shelf draft (positive, in meters) at
-  each grid point of the model grid.
-  This file is only needed if \np[=.true.]{ln_isfcav}{ln\_isfcav}.
-  Defining the ice shelf draft will also define the ice shelf edge and the grounding line position.
 \end{description}
 
@@ -396,8 +386,8 @@
 bathymetry varies by less than one level thickness from one grid point to the next).  The
 reference layer thicknesses $e_{3t}^0$ have been defined in the absence of bathymetry.
-With partial steps, layers from 1 to \jp{jpk}-2 can have a thickness smaller than
+With partial steps, layers from 1 to \texttt{jpk-2} can have a thickness smaller than
 $e_{3t}(jk)$.
 
-The model deepest layer (\jp{jpk}-1) is allowed to have either a smaller or larger
+The model deepest layer (\texttt{jpk-1}) is allowed to have either a smaller or larger
 thickness than $e_{3t}(jpk)$: the maximum thickness allowed is $2*e_{3t}(jpk - 1)$.
 
@@ -418,5 +408,4 @@
 
 \begin{listing}
-%  \nlst{namzgr_sco_domcfg}
   \caption{\forcode{&namzgr_sco_domcfg}}
   \label{lst:namzgr_sco_domcfg}
@@ -592,4 +581,145 @@
 This option is described in the Report by Levier \textit{et al.} (2007), available on the \NEMO\ web site.
 
+\section{Ice shelf cavity definition}
+\label{subsec:zgrisf}
+
+  If the under ice shelf seas are opened (\np{ln_isfcav}{ln\_isfcav}), the depth of the ice shelf/ocean interface has to be include in 
+  the \textit{isfdraft\_meter} file (Netcdf format). This file need to include the \textit{isf\_draft} variable. 
+  A positive value will mean ice shelf/ocean or ice shelf bedrock interface below the reference 0m ssh. 
+  The exact shape of the ice shelf cavity (grounding line position and minimum thickness of the water column under an ice shelf, ...) can be specify in \nam{zgr_isf}{zgr\_isf}.
+
+\begin{listing}
+  \caption{\forcode{&namzgr_isf}}
+  \label{lst:namzgr_isf}
+  \begin{forlines}
+!-----------------------------------------------------------------------
+&namzgr_isf    !   isf cavity geometry definition                       (default: OFF)
+!-----------------------------------------------------------------------
+   rn_isfdep_min    = 10.         ! minimum isf draft tickness (if lower, isf draft set to this value)
+   rn_glhw_min      = 1.e-3       ! minimum water column thickness to define the grounding line
+   rn_isfhw_min     = 10          ! minimum water column thickness in the cavity once the grounding line defined.
+   ln_isfchannel    = .false.     ! remove channel (based on 2d mask build from isfdraft-bathy)
+   ln_isfconnect    = .false.     ! force connection under the ice shelf (based on 2d mask build from isfdraft-bathy)
+      nn_kisfmax       = 999         ! limiter in level on the previous condition. (if change larger than this number, get back to value before we enforce the connection)
+      rn_zisfmax       = 7000.       ! limiter in m     on the previous condition. (if change larger than this number, get back to value before we enforce the connection)
+   ln_isfcheminey   = .false.     ! close cheminey
+   ln_isfsubgl      = .false.     ! remove subglacial lake created by the remapping process
+      rn_isfsubgllon   =    0.0      !  longitude of the seed to determine the open ocean
+      rn_isfsubgllat   =    0.0      !  latitude  of the seed to determine the open ocean
+/
+  \end{forlines}
+\end{listing}
+
+   The options available to define the shape of the under ice shelf cavities are listed in \nam{zgr_isf}{zgr\_isf} (\texttt{DOMAINcfg} only, \autoref{lst:namzgr_isf}).
+
+\subsection{Model ice shelf draft definition}
+\label{subsec:zgrisf_isfd}
+
+First of all, the tool make sure, the ice shelf draft ($h_{isf}$) is sensible and compatible with the bathymetry.
+There are 3 compulsory steps to achieve this:
+
+\begin{description}
+\item{\np{rn_isfdep_min}{rn\_isfdep\_min}:} this is the minimum ice shelf draft. This is to make sure there is no ridiculous thin ice shelf. If \np{rn_isfdep_min}{rn\_isfdep\_min} is smaller than the surface level, \np{rn_isfdep_min}{rn\_isfdep\_min} is set to $e3t\_1d(1)$. 
+  Where $h_{isf} < MAX(e3t\_1d(1),rn\_isfdep\_min)$, $h_{isf}$ is set to \np{rn_isfdep_min}{rn\_isfdep\_min}.
+
+\item{\np{rn_glhw_min}{rn\_glhw\_min}:} This parameter is used to define the grounding line position.
+  Where the difference between the bathymetry and the ice shelf draft is smaller than \np{rn_glhw_min}{rn\_glhw\_min}, the cell are grounded (ie masked). 
+  This step is needed to take into account possible small mismatch between ice shelf draft value and bathymetry value (sources are coming from different grid, different data processes, rounding error, ...).
+
+\item{\np{rn_isfhw_min}{rn\_isfhw\_min}:} This parameter is the minimum water column thickness in the cavity. 
+  Where the water column thickness is lower than \np{rn_isfhw_min}{rn\_isfhw\_min}, the ice shelf draft is adjusted to match this criterion. 
+  If for any reason, this adjustement break the minimum ice shelf draft allowed (\np{rn_isfdep_min}{rn\_isfdep\_min}), the cell is masked.
+\end{description}
+
+Once all these adjustements are made, if the water column thickness contains one cell wide channels, these channels can be closed using \np{ln_isfchannel}{ln\_isfchannel}.  
+ 
+\subsection{Model top level definition}
+After the definition of the ice shelf draft, the tool defines the top level. 
+The compulsory criterion is that the water column needs at least 2 wet cells in the water column at U- and V-points.
+To do so, if there one cell wide water column, the tools adjust the ice shelf draft to fillful the requierement.\\
+
+The process is the following:
+\begin{description}
+\item{step 1:} The top level is defined in the same way as the bottom level is defined.
+\item{step 2:} The isolated grid point in the bathymetry are filled (as it is done in a domain without ice shelf)
+\item{step 3:} The tools make sure, the top level is above or equal to the bottom level
+\item{step 4:} If the water column at a U- or V- point is one wet cell wide, the ice shelf draft is adjusted. So the actual top cell become fully open and the new
+  top cell thickness is set to the minimum cell thickness allowed (following the same logic as for the bottom partial cell). This step is iterated 4 times to ensure the condition is fullfill along the 4 sides of the cell.
+\end{description}
+
+In case of steep slope and shallow water column, it likely that 2 cells are disconnected (bathymetry above its neigbourging ice shelf draft). 
+The option \np{ln_isfconnect}{ln\_isfconnect} allow the tool to force the connection between these 2 cells.
+Some limiters in meter or levels on the digging allowed by the tool are available (respectively, \np{rn_zisfmax}{rn\_zisfmax} or \np{rn_kisfmax}{rn\_kisfmax}).
+This will prevent the formation of subglacial lakes at the expense of long vertical pipe to connect cells at very different levels.
+
+\subsection{Subglacial lakes}
+Despite careful setting of your ice shelf draft and bathymetry input file as well as setting described in \autoref{subsec:zgrisf_isfd}, some situation are unavoidable.
+For exemple if you setup your ice shelf draft and bathymetry to do ocean/ice sheet coupling, 
+you may decide to fill the whole antarctic with a bathymetry and an ice shelf draft value (ice/bedrock interface depth when grounded). 
+If you do so, the subglacial lakes will show up (Vostock for example). An other possibility is with coarse vertical resolution, some ice shelves could be cut in 2 parts: 
+one connected to the main ocean and an other one closed which can be considered as a subglacial sea be the model.\\
+
+The namelist option \np{ln_isfsubgl}{ln\_isfsubgl} allow you to remove theses subglacial lakes.
+This may be useful for esthetical reason or for stability reasons:
+
+\begin{description}
+\item $\bullet$ In a subglacial lakes, in case of very weak circulation (often the case), the only heat flux is the conductive heat flux through the ice sheet. 
+  This will lead to constant freezing until water reaches -20C. 
+  This is one of the defitiency of the 3 equation melt formulation (for details on this formulation, see: \autoref{sec:isf}).
+\item $\bullet$ In case of coupling with an ice sheet model, 
+  the ssh in the subglacial lakes and the main ocean could be very different (ssh initial adjustement for example), 
+  and so if for any reason both a connected at some point, the model is likely to fall over.\\
+\end{description}
+
+\section{Closed sea definition}
+\label{sec:clocfg}
+
+\begin{listing}
+  \caption{\forcode{&namclo}}
+  \label{lst:namdom_clo}
+  \begin{forlines}
+!-----------------------------------------------------------------------
+&namclo ! (closed sea : need ln_domclo = .true. in namcfg)
+!-----------------------------------------------------------------------
+   rn_lon_opnsea = -2.0     ! longitude seed of open ocean
+   rn_lat_opnsea = -2.0     ! latitude  seed of open ocean
+   nn_closea = 8           ! number of closed seas ( = 0; only the open_sea mask will be computed)
+   !                name   ! lon_src ! lat_src ! lon_trg ! lat_trg ! river mouth area   ! net evap/precip correction scheme ! radius tgt   ! id trg
+   !                       ! (degree)! (degree)! (degree)! (degree)! local/coast/global ! (glo/rnf/emp)                     !     (m)      !
+   ! North American lakes
+   sn_lake(1) = 'superior' ,  -86.57 ,  47.30  , -66.49  , 50.45   , 'local'            , 'rnf'                             ,   550000.0 , 2    
+   sn_lake(2) = 'michigan' ,  -87.06 ,  42.74  , -66.49  , 50.45   , 'local'            , 'rnf'                             ,   550000.0 , 2    
+   sn_lake(3) = 'huron'    ,  -82.51 ,  44.74  , -66.49  , 50.45   , 'local'            , 'rnf'                             ,   550000.0 , 2    
+   sn_lake(4) = 'erie'     ,  -81.13 ,  42.25  , -66.49  , 50.45   , 'local'            , 'rnf'                             ,   550000.0 , 2    
+   sn_lake(5) = 'ontario'  ,  -77.72 ,  43.62  , -66.49  , 50.45   , 'local'            , 'rnf'                             ,   550000.0 , 2    
+   ! African Lake
+   sn_lake(6) = 'victoria' ,   32.93 ,  -1.08  ,  30.44  , 31.37   , 'coast'            , 'emp'                             ,   100000.0 , 3    
+   ! Asian Lakes
+   sn_lake(7) = 'caspian'  ,   50.0  ,  44.0   ,   0.0   ,  0.0    , 'global'           , 'glo'                             ,        0.0 , 1     
+   sn_lake(8) = 'aral'     ,   60.0  ,  45.0   ,   0.0   ,  0.0    , 'global'           , 'glo'                             ,        0.0 , 1    
+/
+   \end{forlines}
+\end{listing}
+
+The options available to define the closed seas and how closed sea net fresh water input will be redistributed by NEMO are listed in \nam{dom_clo}{dom\_clo} (\texttt{DOMAINcfg} only).
+The individual definition of each closed sea is managed by \np{sn_lake}{sn\_lake}. In this fields the user needs to define:\\
+   \begin{description}
+   \item $\bullet$    the name of the closed sea (print output purposes).
+   \item $\bullet$    the seed location to define the area of the closed sea (if seed on land because not present in this configuration, this closed sea will be ignored).\\
+   \item $\bullet$    the seed location for the target area.
+   \item $\bullet$    the type of target area ('local','coast' or 'global'). See point 6 for definition of these cases.
+   \item $\bullet$    the type of redistribution scheme for the net fresh water flux over the closed sea (as a runoff in a target area, as emp in a target area, as emp globally). For the runoff case, if the net fwf is negative, it will be redistribut globally.
+   \item $\bullet$    the radius of the target area (not used for the 'global' case). So the target defined by a 'local' target area of a radius of 100km, for example, correspond to all the wet points within this radius. The coastal case will return only the coastal point within the specifid radius.
+   \item $\bullet$    the target id. This target id is used to group multiple lakes into the same river ouflow (Great Lakes for example).
+   \end{description}
+
+The closed sea module defines a number of masks in the \textit{domain\_cfg} output:
+   \begin{description}
+   \item[\textit{mask\_opensea}:] a mask of the main ocean without all the closed seas closed. This mask is defined by a flood filling algorithm with an initial seed (localisation defined by \np{rn_lon_opnsea}{rn\_lon\_opnsea} and \np{rn_lat_opnsea}{rn\_lat\_opnsea}).
+   \item[\textit{mask\_csglo}, \textit{mask\_csrnf}, \textit{mask\_csemp}:] a mask of all the closed seas defined in the namelist by \np{sn_lake}{sn\_lake} for each redistribution scheme. The total number of defined closed seas has to be defined in \np{nn_closea}{nn\_closea}.
+   \item[\textit{mask\_csgrpglo}, \textit{mask\_csgrprnf}, \textit{mask\_csgrpemp}:] a mask of all the closed seas and targets grouped by target id for each type of redistribution scheme.
+   \item[\textit{mask\_csundef}:] a mask of all the closed sea not defined in \np{sn_lake}{sn\_lake}. This will allows NEMO to mask them if needed or to inform the user of potential minor issues in its bathymetry.
+   \end{description}
+   
 \subinc{\input{../../global/epilogue}}
 
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/apdx_algos.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/apdx_algos.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/apdx_algos.tex	(revision 14644)
@@ -5,6 +5,4 @@
 \chapter{Note on some algorithms}
 \label{apdx:ALGOS}
-
-\thispagestyle{plain}
 
 \chaptertoc
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/apdx_diff_opers.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/apdx_diff_opers.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/apdx_diff_opers.tex	(revision 14644)
@@ -5,6 +5,4 @@
 \chapter{Diffusive Operators}
 \label{apdx:DIFFOPERS}
-
-\thispagestyle{plain}
 
 \chaptertoc
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/apdx_invariants.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/apdx_invariants.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/apdx_invariants.tex	(revision 14644)
@@ -5,6 +5,4 @@
 \chapter{Discrete Invariants of the Equations}
 \label{apdx:INVARIANTS}
-
-\thispagestyle{plain}
 
 \chaptertoc
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/apdx_s_coord.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/apdx_s_coord.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/apdx_s_coord.tex	(revision 14644)
@@ -8,6 +8,4 @@
 %    {\em 4.0} & {\em Mike Bell} & {\em review}  \\
 %    {\em 3.x} & {\em Gurvan Madec} & {\em original}  \\
-
-\thispagestyle{plain}
 
 \chaptertoc
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/apdx_triads.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/apdx_triads.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/apdx_triads.tex	(revision 14644)
@@ -2,19 +2,7 @@
 
 \begin{document}
-
-%% Local cmds
-\newcommand{\rML}[1][i]{\ensuremath{_{\mathrm{ML}\,#1}}}
-\newcommand{\rMLt}[1][i]{\tilde{r}_{\mathrm{ML}\,#1}}
-%% Move to ../../global/new_cmds.tex to avoid error with \listoffigures
-%\newcommand{\triad}[6][]{\ensuremath{{}_{#2}^{#3}{\mathbb{#4}_{#1}}_{#5}^{\,#6}}
-\newcommand{\triadd}[5]{\ensuremath{{}_{#1}^{#2}{\mathbb{#3}}_{#4}^{\,#5}}}
-\newcommand{\triadt}[5]{\ensuremath{{}_{#1}^{#2}{\tilde{\mathbb{#3}}}_{#4}^{\,#5}}}
-\newcommand{\rtriad}[2][]{\ensuremath{\triad[#1]{i}{k}{#2}{i_p}{k_p}}}
-\newcommand{\rtriadt}[1]{\ensuremath{\triadt{i}{k}{#1}{i_p}{k_p}}}
 
 \chapter{Iso-Neutral Diffusion and Eddy Advection using Triads}
 \label{apdx:TRIADS}
-
-\thispagestyle{plain}
 
 \chaptertoc
@@ -36,5 +24,5 @@
 
 %% =================================================================================================
-\section[Choice of \forcode{namtra\_ldf} namelist parameters]{Choice of \protect\nam{tra_ldf}{tra\_ldf} namelist parameters}
+\section[Choice of \forcode{namtra_ldf} namelist parameters]{Choice of \protect\nam{tra_ldf}{tra\_ldf} namelist parameters}
 
 Two scheme are available to perform the iso-neutral diffusion.
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_ASM.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_ASM.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_ASM.tex	(revision 14644)
@@ -8,6 +8,4 @@
 %    {\em 4.0} & {\em D. J. Lea} & {\em \NEMO\ 4.0 updates}  \\
 %    {\em 3.4} & {\em D. J. Lea, M. Martin, K. Mogensen, A. Weaver} & {\em Initial version}  \\
-
-\thispagestyle{plain}
 
 \chaptertoc
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_DIA.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_DIA.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_DIA.tex	(revision 14644)
@@ -11,6 +11,4 @@
 %    {\em 3.4} & {\em Gurvan Madec, Rachid Benshila, Andrew Coward } & {\em }  \\
 %    {\em }      & {\em Christian Ethe, Sebastien Masson } & {\em }  \\
-
-\thispagestyle{plain}
 
 \chaptertoc
@@ -666,5 +664,5 @@
 \end{forlines}
 
-\noindent will give the following file name radical: \ifile{myfile\_ORCA2\_19891231\_freq1d}
+\noindent will give the following file name radical: \textit{myfile\_ORCA2\_19891231\_freq1d}
 
 %% =================================================================================================
@@ -1942,9 +1940,9 @@
 When \np[=.true.]{ln_subbas}{ln\_subbas}, transports and stream function are computed for the Atlantic, Indian,
 Pacific and Indo-Pacific Oceans (defined north of 30\deg{S}) as well as for the World Ocean.
-The sub-basin decomposition requires an input file (\ifile{subbasins}) which contains three 2D mask arrays,
+The sub-basin decomposition requires an input file (\textit{subbasins}) which contains three 2D mask arrays,
 the Indo-Pacific mask been deduced from the sum of the Indian and Pacific mask (\autoref{fig:DIA_mask_subasins}).
 
 \begin{listing}
-  \nlst{namptr}
+%  \nlst{namptr}
   \caption{\forcode{&namptr}}
   \label{lst:namptr}
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_DIU.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_DIU.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_DIU.tex	(revision 14644)
@@ -5,6 +5,4 @@
 \chapter{Diurnal SST Models (DIU)}
 \label{chap:DIU}
-
-\thispagestyle{plain}
 
 \chaptertoc
@@ -52,4 +50,5 @@
 
 This namelist contains only two variables:
+
 \begin{description}
 \item [{\np{ln_diurnal}{ln\_diurnal}}] A logical switch for turning on/off both the cool skin and warm layer.
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_DOM.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_DOM.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_DOM.tex	(revision 14644)
@@ -14,6 +14,4 @@
 % -    domclo: closed sea and lakes....
 %              management of closea sea area: specific to global cfg, both forced and coupled
-
-\thispagestyle{plain}
 
 \chaptertoc
@@ -368,6 +366,6 @@
 \label{subsec:DOM_size}
 
-The total size of the computational domain is set by the parameters \jp{jpiglo}, \jp{jpjglo} and
-\jp{jpkglo} for the $i$, $j$ and $k$ directions, respectively.
+The total size of the computational domain is set by the parameters \texttt{jpiglo}, \texttt{jpjglo} and
+\texttt{jpkglo} for the $i$, $j$ and $k$ directions, respectively.
 Note, that the variables \texttt{jpi} and \texttt{jpj} refer to
 the size of each processor subdomain when the code is run in parallel using domain decomposition
@@ -379,7 +377,7 @@
 in which case \np{cn_cfg}{cn\_cfg} and \np{nn_cfg}{nn\_cfg} are set from these values accordingly).
 
-The global lateral boundary condition type is selected from 8 options using parameter \jp{jperio}.
+The global lateral boundary condition type is selected from 8 options using parameters \texttt{l\_Iperio}, \texttt{l\_Jperio}, \texttt{l\_NFold} and \texttt{c\_NFtype}.
 See \autoref{sec:LBC_jperio} for details on the available options and
-the corresponding values for \jp{jperio}.
+the corresponding values for \texttt{l\_Iperio}, \texttt{l\_Jperio}, \texttt{l\_NFold} and \texttt{c\_NFtype}.
 
 %% =================================================================================================
@@ -396,10 +394,12 @@
 
 \begin{clines}
-int    jpiglo, jpjglo, jpkglo     /* global domain sizes                                    */
-int    jperio                     /* lateral global domain b.c.                             */
-double glamt, glamu, glamv, glamf /* geographic longitude (t,u,v and f points respectively) */
-double gphit, gphiu, gphiv, gphif /* geographic latitude                                    */
-double e1t, e1u, e1v, e1f         /* horizontal scale factors                               */
-double e2t, e2u, e2v, e2f         /* horizontal scale factors                               */
+integer   Ni0glo, NjOglo, jpkglo       /* global domain sizes (without MPI halos)                */
+logical   l\_Iperio, l\_Jperio         /* lateral global domain b.c.: i- j-periodicity           */
+logical   l\_NFold                     /* lateral global domain b.c.: North Pole folding         */
+char(1)   c\_NFtype                    /*    type of North pole Folding: T or F point            */
+real      glamt, glamu, glamv, glamf   /* geographic longitude (t,u,v and f points respectively) */
+real      gphit, gphiu, gphiv, gphif   /* geographic latitude                                    */
+real      e1t, e1u, e1v, e1f           /* horizontal scale factors                               */
+real      e2t, e2u, e2v, e2f           /* horizontal scale factors                               */
 \end{clines}
 
@@ -465,5 +465,5 @@
 \begin{enumerate}
 \item the bathymetry given in meters;
-\item the number of levels of the model (\jp{jpk});
+\item the number of levels of the model (\texttt{jpk});
 \item the analytical transformation $z(i,j,k)$ and the vertical scale factors
   (derivatives of the transformation); and
@@ -575,6 +575,6 @@
 every gridcell in the model regardless of the choice of vertical coordinate.
 With constant z-levels, e3 metrics will be uniform across each horizontal level.
-In the partial step case each e3 at the \jp{bottom\_level}
-(and, possibly, \jp{top\_level} if ice cavities are present)
+In the partial step case each e3 at the \texttt{bottom\_level}
+(and, possibly, \texttt{top\_level} if ice cavities are present)
 may vary from its horizontal neighbours.
 And, in s-coordinates, variations can occur throughout the water column.
@@ -585,8 +585,8 @@
 those arising from a flat sea surface with zero elevation.
 
-The \jp{bottom\_level} and \jp{top\_level} 2D arrays define
-the \jp{bottom\_level} and top wet levels in each grid column.
-Without ice cavities, \jp{top\_level} is essentially a land mask (0 on land; 1 everywhere else).
-With ice cavities, \jp{top\_level} determines the first wet point below the overlying ice shelf.
+The \texttt{bottom\_level} and \texttt{top\_level} 2D arrays define
+the \texttt{bottom\_level} and top wet levels in each grid column.
+Without ice cavities, \texttt{top\_level} is essentially a land mask (0 on land; 1 everywhere else).
+With ice cavities, \texttt{top\_level} determines the first wet point below the overlying ice shelf.
 
 %% =================================================================================================
@@ -594,5 +594,5 @@
 \label{subsec:DOM_msk}
 
-From \jp{top\_level} and \jp{bottom\_level} fields, the mask fields are defined as follows:
+From \texttt{top\_level} and \texttt{bottom\_level} fields, the mask fields are defined as follows:
 \begin{align*}
   tmask(i,j,k) &=
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_DYN.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_DYN.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_DYN.tex	(revision 14644)
@@ -5,6 +5,4 @@
 \chapter{Ocean Dynamics (DYN)}
 \label{chap:DYN}
-
-\thispagestyle{plain}
 
 \chaptertoc
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_LBC.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_LBC.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_LBC.tex	(revision 14644)
@@ -5,6 +5,4 @@
 \chapter{Lateral Boundary Condition (LBC)}
 \label{chap:LBC}
-
-\thispagestyle{plain}
 
 \chaptertoc
@@ -161,5 +159,5 @@
 
 %% =================================================================================================
-\section[Model domain boundary condition (\forcode{jperio})]{Model domain boundary condition (\protect\jp{jperio})}
+\section{Model domain boundary condition}
 \label{sec:LBC_jperio}
 
@@ -170,9 +168,9 @@
 
 %% =================================================================================================
-\subsection[Closed, cyclic (\forcode{=0,1,2,7})]{Closed, cyclic (\protect\jp{jperio}\forcode{=0,1,2,7})}
+\subsection{Closed, cyclic (\forcode{l_Iperio,l_jperio})}
 \label{subsec:LBC_jperio012}
 
 The choice of closed or cyclic model domain boundary condition is made by
-setting \jp{jperio} to 0, 1, 2 or 7 in namelist \nam{cfg}{cfg}.
+setting \forcode{l_Iperio,l_jperio} to true or false in namelist \nam{cfg}{cfg}.
 Each time such a boundary condition is needed, it is set by a call to routine \mdl{lbclnk}.
 The computation of momentum and tracer trends proceeds from $i=2$ to $i=jpi-1$ and from $j=2$ to $j=jpj-1$,
@@ -183,18 +181,18 @@
 \begin{description}
 
-\item [For closed boundary (\jp{jperio}\forcode{=0})], solid walls are imposed at all model boundaries:
+\item [For closed boundary (\forcode{l_Iperio = .false.,l_jperio = .false.})], solid walls are imposed at all model boundaries:
   first and last rows and columns are set to zero.
 
-\item [For cyclic east-west boundary (\jp{jperio}\forcode{=1})], first and last rows are set to zero (closed) whilst the first column is set to
+\item [For cyclic east-west boundary (\forcode{l_Iperio = .true.,l_jperio = .false.})], first and last rows are set to zero (closed) whilst the first column is set to
   the value of the last-but-one column and the last column to the value of the second one
   (\autoref{fig:LBC_jperio}-a).
   Whatever flows out of the eastern (western) end of the basin enters the western (eastern) end.
 
-\item [For cyclic north-south boundary (\jp{jperio}\forcode{=2})], first and last columns are set to zero (closed) whilst the first row is set to
+\item [For cyclic north-south boundary (\forcode{l_Iperio = .false.,l_jperio = .true.})], first and last columns are set to zero (closed) whilst the first row is set to
   the value of the last-but-one row and the last row to the value of the second one
   (\autoref{fig:LBC_jperio}-a).
   Whatever flows out of the northern (southern) end of the basin enters the southern (northern) end.
 
-\item [Bi-cyclic east-west and north-south boundary (\jp{jperio}\forcode{=7})] combines cases 1 and 2.
+\item [Bi-cyclic east-west and north-south boundary (\forcode{l_Iperio = .true.,l_jperio = .true.})] combines cases 1 and 2.
 
 \end{description}
@@ -209,5 +207,5 @@
 
 %% =================================================================================================
-\subsection[North-fold (\forcode{=3,6})]{North-fold (\protect\jp{jperio}\forcode{=3,6})}
+\subsection{North-fold (\forcode{l_NFold = .true.})}
 \label{subsec:LBC_north_fold}
 
@@ -222,5 +220,5 @@
   \includegraphics[width=0.66\textwidth]{LBC_North_Fold_T}
   \caption[North fold boundary in ORCA 2\deg, 1/4\deg and 1/12\deg]{
-    North fold boundary with a $T$-point pivot and cyclic east-west boundary condition ($jperio=4$),
+    North fold boundary with a $T$-point pivot and cyclic east-west boundary condition ($c\_NFtype='T'$),
     as used in ORCA 2\deg, 1/4\deg and 1/12\deg.
     Pink shaded area corresponds to the inner domain mask (see text).}
@@ -288,9 +286,9 @@
 Each processor is independent and without message passing or synchronous process, programs run alone and access just its own local memory.
 For this reason,
-the main model dimensions are now the local dimensions of the subdomain (pencil) that are named \jp{jpi}, \jp{jpj}, \jp{jpk}.
+the main model dimensions are now the local dimensions of the subdomain (pencil) that are named \texttt{jpi}, \texttt{jpj}, \texttt{jpk}.
 These dimensions include the internal domain and the overlapping rows.
-The number of rows to exchange (known as the halo) is usually set to one (nn\_hls=1, in \mdl{par\_oce},
+The number of rows to exchange (known as the halo) is usually set to one (\forcode{nn_hls=1}, in \mdl{par\_oce},
 and must be kept to one until further notice).
-The whole domain dimensions are named \jp{jpiglo}, \jp{jpjglo} and \jp{jpk}.
+The whole domain dimensions are named \texttt{jpiglo}, \texttt{jpjglo} and \texttt{jpk}.
 The relationship between the whole domain and a sub-domain is:
 \begin{gather*}
@@ -299,5 +297,5 @@
 \end{gather*}
 
-One also defines variables nldi and nlei which correspond to the internal domain bounds, and the variables nimpp and njmpp which are the position of the (1,1) grid-point in the global domain (\autoref{fig:LBC_mpp}). Note that since the version 4, there is no more extra-halo area as defined in \autoref{fig:LBC_mpp} so \jp{jpi} is now always equal to nlci and \jp{jpj} equal to nlcj.
+One also defines variables nldi and nlei which correspond to the internal domain bounds, and the variables nimpp and njmpp which are the position of the (1,1) grid-point in the global domain (\autoref{fig:LBC_mpp}). Note that since the version 4, there is no more extra-halo area as defined in \autoref{fig:LBC_mpp} so \texttt{jpi} is now always equal to nlci and \texttt{jpj} equal to nlcj.
 
 An element of $T_{l}$, a local array (subdomain) corresponds to an element of $T_{g}$,
@@ -309,5 +307,5 @@
 with $1 \leq i \leq jpi$, $1  \leq j \leq jpj $ , and  $1  \leq k \leq jpk$.
 
-The 1-d arrays $mig(1:\jp{jpi})$ and $mjg(1:\jp{jpj})$, defined in \rou{dom\_glo} routine (\mdl{domain} module), should be used to get global domain indices from local domain indices. The 1-d arrays, $mi0(1:\jp{jpiglo})$, $mi1(1:\jp{jpiglo})$ and $mj0(1:\jp{jpjglo})$, $mj1(1:\jp{jpjglo})$ have the reverse purpose and should be used to define loop indices expressed in global domain indices (see examples in \mdl{dtastd} module).\\
+The 1-d arrays $mig(1:\texttt{jpi})$ and $mjg(1:\texttt{jpj})$, defined in \rou{dom\_glo} routine (\mdl{domain} module), should be used to get global domain indices from local domain indices. The 1-d arrays, $mi0(1:\texttt{jpiglo})$, $mi1(1:\texttt{jpiglo})$ and $mj0(1:\texttt{jpjglo})$, $mj1(1:\texttt{jpjglo})$ have the reverse purpose and should be used to define loop indices expressed in global domain indices (see examples in \mdl{dtastd} module).\\
 
 The \NEMO\ model computes equation terms with the help of mask arrays (0 on land points and 1 on sea points). It is therefore possible that an MPI subdomain contains only land points. To save ressources, we try to supress from the computational domain as much land subdomains as possible. For example if $N_{mpi}$ processes are allocated to NEMO, the domain decomposition will be given by the following equation:
@@ -372,6 +370,6 @@
 The number of boundary sets is defined by \np{nb_bdy}{nb\_bdy}.
 Each boundary set can be either defined as a series of straight line segments directly in the namelist
-(\np[=.false.]{ln_coords_file}{ln\_coords\_file}, and a namelist block \forcode{&nambdy_index} must be included for each set) or read in from a file (\np[=.true.]{ln_coords_file}{ln\_coords\_file}, and a ``\ifile{coordinates.bdy}'' file must be provided).
-The coordinates.bdy file is analagous to the usual \NEMO\ ``\ifile{coordinates}'' file.
+(\np[=.false.]{ln_coords_file}{ln\_coords\_file}, and a namelist block \forcode{&nambdy_index} must be included for each set) or read in from a file (\np[=.true.]{ln_coords_file}{ln\_coords\_file}, and a ``\textit{coordinates.bdy.nc}'' file must be provided).
+The coordinates.bdy file is analagous to the usual \NEMO\ ``\textit{coordinates.nc}'' file.
 In the example above, there are two boundary sets, the first of which is defined via a file and
 the second is defined in the namelist.
@@ -570,14 +568,14 @@
 
 The boundary geometry for each set may be defined in a namelist \forcode{&nambdy_index} or
-by reading in a ``\ifile{coordinates.bdy}'' file.
-The \texttt{nambdy\_index} namelist defines a series of straight-line segments for north, east, south and west boundaries.
-One \texttt{nambdy\_index} namelist block is needed for each boundary condition defined by indexes.
+by reading in a ``\textit{coordinates.bdy.nc}'' file.
+The \forcode{&nambdy_index} namelist defines a series of straight-line segments for north, east, south and west boundaries.
+One \forcode{&nambdy_index} namelist block is needed for each boundary condition defined by indexes.
 For the northern boundary, \texttt{nbdysegn} gives the number of segments,
-\jp{jpjnob} gives the $j$ index for each segment and \jp{jpindt} and
-\jp{jpinft} give the start and end $i$ indices for each segment with similar for the other boundaries.
+\texttt{jpjnob} gives the $j$ index for each segment and \texttt{jpindt} and
+\texttt{jpinft} give the start and end $i$ indices for each segment with similar for the other boundaries.
 These segments define a list of $T$ grid points along the outermost row of the boundary ($nbr\,=\, 1$).
 The code deduces the $U$ and $V$ points and also the points for $nbr\,>\, 1$ if \np[>1]{nn_rimwidth}{nn\_rimwidth}.
 
-The boundary geometry may also be defined from a ``\ifile{coordinates.bdy}'' file.
+The boundary geometry may also be defined from a ``\textit{coordinates.bdy.nc}'' file.
 \autoref{fig:LBC_nc_header} gives an example of the header information from such a file, based on the description of geometrical setup given above.
 The file should contain the index arrays for each of the $T$, $U$ and $V$ grids.
@@ -633,6 +631,6 @@
   \centering
   \includegraphics[width=0.66\textwidth]{LBC_nc_header}
-  \caption[Header for a \protect\ifile{coordinates.bdy} file]{
-    Example of the header for a \protect\ifile{coordinates.bdy} file}
+  \caption[Header for a \textit{coordinates.bdy.nc} file]{
+    Example of the header for a \textit{coordinates.bdy.nc} file}
   \label{fig:LBC_nc_header}
 \end{figure}
@@ -684,15 +682,15 @@
 \texttt{<constituent>\_z1} and \texttt{<constituent>\_z2} for the real and imaginary parts of
 SSH, respectively, are expected to be available in file
-\ifile{<input>\_grid\_T}, variables \texttt{<constituent>\_u1} and
+\textit{<input>\_grid\_T.nc}, variables \texttt{<constituent>\_u1} and
 \texttt{<constituent>\_u2} for the real and imaginary parts of u, respectively, in file
-\ifile{<input>\_grid\_U}, and \texttt{<constituent>\_v1} and
+\textit{<input>\_grid\_U.nc}, and \texttt{<constituent>\_v1} and
 \texttt{<constituent>\_v2} for the real and imaginary parts of v, respectively, in file
-\ifile{<input>\_grid\_V}; when data along open boundary segments is used,
+\textit{<input>\_grid\_V.nc}; when data along open boundary segments is used,
 variables \texttt{z1} and \texttt{z2} (real and imaginary part of SSH) are
-expected to be available in file \ifile{<input><constituent>\_grid\_T},
+expected to be available in file \textit{<input><constituent>\_grid\_T.nc},
 variables \texttt{u1} and \texttt{u2} (real and imaginary part of u) in file
-\ifile{<input><constituent>\_grid\_U}, and variables \texttt{v1} and \texttt{v2}
+\textit{<input><constituent>\_grid\_U.nc}, and variables \texttt{v1} and \texttt{v2}
 (real and imaginary part of v) in file
-\ifile{<input><constituent>\_grid\_V}.\par
+\textit{<input><constituent>\_grid\_V.nc}.\par
 
 Note that the barotropic velocity components are assumed to be defined
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_LDF.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_LDF.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_LDF.tex	(revision 14644)
@@ -5,6 +5,4 @@
 \chapter{Lateral Ocean Physics (LDF)}
 \label{chap:LDF}
-
-\thispagestyle{plain}
 
 \chaptertoc
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_OBS.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_OBS.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_OBS.tex	(revision 14644)
@@ -14,6 +14,4 @@
 %    {\em --\texttt{"}--} & {\em ... K. Mogensen, A. Vidard, A. Weaver} & {\em ---\texttt{"}---}  \\
 %\end{tabular}
-
-\thispagestyle{plain}
 
 \chaptertoc
@@ -420,5 +418,5 @@
 
 To use Sea Level Anomaly (SLA) data the mean dynamic topography (MDT) must be provided in a separate file defined on
-the model grid called \ifile{slaReferenceLevel}.
+the model grid called \textit{slaReferenceLevel.nc}.
 The MDT is required in order to produce the model equivalent sea level anomaly from the model sea surface height.
 Below is an example header for this file (on the ORCA025 grid).
@@ -915,5 +913,4 @@
 
 \begin{listing}
-%  \nlst{namsao}
   \begin{forlines}
 !----------------------------------------------------------------------
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_SBC.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_SBC.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_SBC.tex	(revision 14644)
@@ -5,6 +5,4 @@
 \chapter{Surface Boundary Condition (SBC, SAS, ISF, ICB, TDE)}
 \label{chap:SBC}
-
-\thispagestyle{plain}
 
 \chaptertoc
@@ -17,4 +15,5 @@
     \hline
     {\em  next} & {\em Simon M{\" u}ller} & {\em Update of \autoref{sec:SBC_TDE}; revision of \autoref{subsec:SBC_fwb}}\\[2mm]
+    {\em  next} & {\em Pierre Mathiot} & {\em update of the ice shelf section (2019 developments)}\\[2mm]  
     {\em   4.0} & {\em ...} & {\em ...} \\
     {\em   3.6} & {\em ...} & {\em ...} \\
@@ -74,6 +73,4 @@
   (\np[=0..3]{nn_ice}{nn\_ice}),
 \item the addition of river runoffs as surface freshwater fluxes or lateral inflow (\np[=.true.]{ln_rnf}{ln\_rnf}),
-\item the addition of ice-shelf melting as lateral inflow (parameterisation) or
-  as fluxes applied at the land-ice ocean interface (\np[=.true.]{ln_isf}{ln\_isf}),
 \item the addition of a freshwater flux adjustment in order to avoid a mean sea-level drift
   (\np[=0..2]{nn_fwb}{nn\_fwb}),
@@ -99,6 +96,4 @@
 One of these is modification by icebergs (see \autoref{sec:SBC_ICB_icebergs}),
 which act as drifting sources of fresh water.
-Another example of modification is that due to the ice shelf melting/freezing (see \autoref{sec:SBC_isf}),
-which provides additional sources of fresh water.
 
 %% =================================================================================================
@@ -646,6 +641,6 @@
 parameters. It is therefore recommended to chose version 3.6 over 3.
 
-\subsection{Cool-skin and warm-layer parametrizations}
-%\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})}
+\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}
 
@@ -979,9 +974,9 @@
   ocean tide model}: Mf, Mm, Ssa, Mtm, Msf, Msqm, Sa, K1, O1, P1, Q1, J1, S1,
 M2, S2, N2, K2, nu2, mu2, 2N2, L2, T2, eps2, lam2, R2, M3, MKS2, MN4, MS4, M4,
-N4, S4, M6, and M8; see file \hf{tide} and \mdl{tide\_mod} for further
-information and references\footnote{As a legacy option \np{ln_tide_var} can be
+N4, S4, M6, and M8; see file \textit{tide.h90} and \mdl{tide\_mod} for further
+information and references\footnote{As a legacy option \np{ln_tide_var}{ln\_tide\_var} can be
   set to \forcode{0}, in which case the 19 tidal constituents (M2, N2, 2N2, S2,
   K2, K1, O1, Q1, P1, M4, Mf, Mm, Msqm, Mtm, S1, MU2, NU2, L2, and T2; see file
-  \hf{tide}) and associated parameters that have been available in NEMO version
+  \textit{tide.h90}) and associated parameters that have been available in NEMO version
   4.0 and earlier are available}. Constituents to be included in the tidal forcing
 (surface and lateral boundaries) are selected by enumerating their respective
@@ -1013,5 +1008,5 @@
 potential). The tidal tilt factor $\gamma = 1 + k - h$ includes the
 Love numbers $k$ and $h$ \citep{love_PRSL09}; this factor is
-configurable using \np{rn_tide_gamma} (default value 0.7). Optionally,
+configurable using \np{rn_tide_gamma}{rn\_tide\_gamma} (default value 0.7). Optionally,
 when \np[=.true.]{ln_tide_ramp}{ln\_tide\_ramp}, the equilibrium tidal
 forcing can be ramped up linearly from zero during the initial
@@ -1183,146 +1178,295 @@
 
 %% =================================================================================================
-\section[Ice shelf melting (\textit{sbcisf.F90})]{Ice shelf melting (\protect\mdl{sbcisf})}
+\section[Ice Shelf (ISF)]{Interaction with ice shelves (ISF)}
 \label{sec:SBC_isf}
 
 \begin{listing}
-  \nlst{namsbc_isf}
-  \caption{\forcode{&namsbc_isf}}
-  \label{lst:namsbc_isf}
+  \nlst{namisf}
+  \caption{\forcode{&namisf}}
+  \label{lst:namisf}
 \end{listing}
 
-The namelist variable in \nam{sbc}{sbc}, \np{nn_isf}{nn\_isf}, controls the ice shelf representation.
-Description and result of sensitivity test to \np{nn_isf}{nn\_isf} are presented in \citet{mathiot.jenkins.ea_GMD17}.
-The different options are illustrated in \autoref{fig:SBC_isf}.
-
+The namelist variable in \nam{isf}{isf}, \np{ln_isf}{ln\_isf}, controls the ice shelf interactions:
 \begin{description}
-  \item [{\np[=1]{nn_isf}{nn\_isf}}]: The ice shelf cavity is represented (\np[=.true.]{ln_isfcav}{ln\_isfcav} needed).
-  The fwf and heat flux are depending of the local water properties.
-
-  Two different bulk formulae are available:
+   \item $\bullet$ representation of the ice shelf/ocean melting/freezing for opened cavity (cav, \np{ln_isfcav_mlt}{ln\_isfcav\_mlt}).
+   \item $\bullet$ parametrisation of the ice shelf/ocean melting/freezing for closed cavities (par, \np{ln_isfpar_mlt}{ln\_isfpar\_mlt}).
+   \item $\bullet$ coupling with an ice sheet model (\np{ln_isfcpl}{ln\_isfcpl}).
+\end{description}
+
+  \subsection{Ocean/Ice shelf fluxes in opened cavities}
+
+     \np{ln_isfcav_mlt}{ln\_isfcav\_mlt}\forcode{ = .true.} activates the ocean/ice shelf thermodynamics interactions at the ice shelf/ocean interface. 
+     If \np{ln_isfcav_mlt}{ln\_isfcav\_mlt}\forcode{ = .false.}, thermodynamics interactions are desctivated but the ocean dynamics inside the cavity is still active.
+     The logical flag \np{ln_isfcav}{ln\_isfcav} control whether or not the ice shelf cavities are closed. \np{ln_isfcav}{ln\_isfcav} is not defined in the namelist but in the domcfg.nc input file.\\
+
+     3 options are available to represent to ice-shelf/ocean fluxes at the interface:
+     \begin{description}
+        \item[\np{cn_isfcav_mlt}{cn\_isfcav\_mlt}\forcode{ = 'spe'}]:
+        The fresh water flux is specified by a forcing fields \np{sn_isfcav_fwf}{sn\_isfcav\_fwf}. Convention of the input file is: positive toward the ocean (i.e. positive for melting and negative for freezing).
+        The latent heat fluxes is derived from the fresh water flux. 
+        The heat content flux is derived from the fwf flux assuming a temperature set to the freezing point in the top boundary layer (\np{rn_htbl}{rn\_htbl})
+
+        \item[\np{cn_isfcav_mlt}{cn\_isfcav\_mlt}\forcode{ = 'oasis'}]:
+        The \forcode{'oasis'} is a prototype of what could be a method to spread precipitation on Antarctic ice sheet as ice shelf melt inside the cavity when a coupled model Atmosphere/Ocean is used. 
+        It has not been tested and therefore the model will stop if you try to use it. 
+        Actions will be undertake in 2020 to build a comprehensive interface to do so for Greenland, Antarctic and ice shelf (cav), ice shelf (par), icebergs, subglacial runoff and runoff.
+
+        \item[\np{cn_isfcav_mlt}{cn\_isfcav\_mlt}\forcode{ = '2eq'}]:
+        The heat flux and the fresh water flux (negative for melting) resulting from ice shelf melting/freezing are parameterized following \citet{Grosfeld1997}. 
+        This formulation is based on a balance between the vertical diffusive heat flux across the ocean top boundary layer (\autoref{eq:ISOMIP1}) 
+        and the latent heat due to melting/freezing (\autoref{eq:ISOMIP2}):
+
+        \begin{equation}
+        \label{eq:ISOMIP1}
+        \mathcal{Q}_h = \rho c_p \gamma (T_w - T_f)
+        \end{equation}
+        \begin{equation}
+        \label{eq:ISOMIP2}
+        q = \frac{-\mathcal{Q}_h}{L_f}
+        \end{equation}
+        
+        where $\mathcal{Q}_h$($W.m^{-2}$) is the heat flux,q($kg.s^{-1}m^{-2}$) the fresh-water flux, 
+        $L_f$ the specific latent heat, $T_w$ the temperature averaged over a boundary layer below the ice shelf (explained below), 
+        $T_f$ the freezing point using  the  pressure  at  the  ice  shelf  base  and  the  salinity  of the water in the boundary layer, 
+        and $\gamma$ the thermal exchange coefficient.
+
+        \item[\np{cn_isfcav_mlt}{cn\_isfcav\_mlt}\forcode{ = '3eq'}]:
+        For realistic studies, the heat and freshwater fluxes are parameterized following \citep{Jenkins2001}. This formulation is based on three equations: 
+        a balance between the vertical diffusive heat flux across the boundary layer 
+        , the latent heat due to melting/freezing of ice and the vertical diffusive heat flux into the ice shelf (\autoref{eq:3eq1}); 
+        a balance between the vertical diffusive salt flux across the boundary layer and the salt source or sink represented by the melting/freezing (\autoref{eq:3eq2}); 
+        and a linear equation for the freezing temperature of sea water (\autoref{eq:3eq3}, detailed of the linearisation coefficient in \citet{AsayDavis2016}):
+
+        \begin{equation}
+        \label{eq:3eq1}
+        c_p \rho \gamma_T (T_w-T_b) = -L_f q - \rho_i c_{p,i} \kappa \frac{T_s - T_b}{h_{isf}}
+        \end{equation}
+        \begin{equation}
+        \label{eq:3eq2}
+        \rho \gamma_S (S_w - S_b) = (S_i - S_b)q
+        \end{equation}
+        \begin{equation}
+        \label{eq:3eq3}
+        T_b = \lambda_1 S_b + \lambda_2 +\lambda_3 z_{isf}
+        \end{equation}
+
+        where $T_b$ is the temperature at the interface, $S_b$ the salinity at the interface, $\gamma_T$ and $\gamma_S$ the exchange coefficients for temperature and salt, respectively, 
+        $S_i$ the salinity of the ice (assumed to be 0), $h_{isf}$ the ice shelf thickness, $z_{isf}$ the ice shelf draft, $\rho_i$ the density of the iceshelf, 
+        $c_{p,i}$ the specific heat capacity of the ice, $\kappa$ the thermal diffusivity of the ice 
+        and $T_s$ the atmospheric surface temperature (at the ice/air interface, assumed to be -20C). 
+        The Liquidus slope ($\lambda_1$), the liquidus intercept ($\lambda_2$) and the Liquidus pressure coefficient ($\lambda_3$) 
+        for TEOS80 and TEOS10 are described in \citep{AsayDavis2016} and in \citep{Jourdain2017}.
+        The linear system formed by \autoref{eq:3eq1}, \autoref{eq:3eq2} and the linearised equation for the freezing temperature of sea water (\autoref{eq:3eq3}) can be solved for $S_b$ or $T_b$. 
+        Afterward, the freshwater flux ($q$) and the heat flux ($\mathcal{Q}_h$) can be computed.
+
+     \end{description}
+
+     \begin{table}[h]
+        \centering
+        \caption{Description of the parameters hard coded into the ISF module}
+        \label{tab:isf}
+        \begin{tabular}{|l|l|l|l|}
+        \hline
+        Symbol    & Description               & Value              & Unit               \\
+        \hline
+        $C_p$     & Ocean specific heat       & 3992               & $J.kg^{-1}.K^{-1}$ \\
+        $L_f$     & Ice latent heat of fusion & $3.34 \times 10^5$ & $J.kg^{-1}$        \\
+        $C_{p,i}$ & Ice specific heat         & 2000               & $J.kg^{-1}.K^{-1}$ \\
+        $\kappa$  & Heat diffusivity          & $1.54 \times 10^{-6}$& $m^2.s^{-1}$     \\
+        $\rho_i$  & Ice density               & 920                & $kg.m^3$           \\
+        \hline
+        \end{tabular}
+     \end{table}
+
+     Temperature and salinity used to compute the fluxes in \autoref{eq:ISOMIP1}, \autoref{eq:3eq1} and \autoref{eq:3eq2} are the average temperature in the top boundary layer \citep{losch_JGR08}. 
+     Its thickness is defined by \np{rn_htbl}{rn\_htbl}.
+     The fluxes and friction velocity are computed using the mean temperature, salinity and velocity in the first \np{rn_htbl}{rn\_htbl} m.
+     Then, the fluxes are spread over the same thickness (ie over one or several cells).
+     If \np{rn_htbl}{rn\_htbl} is larger than top $e_{3}t$, there is no more direct feedback between the freezing point at the interface and the top cell temperature.
+     This can lead to super-cool temperature in the top cell under melting condition.
+     If \np{rn_htbl}{rn\_htbl} smaller than top $e_{3}t$, the top boundary layer thickness is set to the top cell thickness.\\
+
+     Each melt formula (\np{cn_isfcav_mlt}{cn\_isfcav\_mlt}\forcode{ = '3eq'} or \np{cn_isfcav_mlt}{cn\_isfcav\_mlt}\forcode{ = '2eq'}) depends on an exchange coeficient ($\Gamma^{T,S}$) between the ocean and the ice.
+     Below, the exchange coeficient $\Gamma^{T}$ and $\Gamma^{S}$ are respectively defined by \np{rn_gammat0}{rn\_gammat0} and \np{rn_gammas0}{rn\_gammas0}. 
+     There are 3 different ways to compute the exchange velocity:
+
+     \begin{description}
+        \item[\np{cn_gammablk}{cn\_gammablk}\forcode{='spe'}]:
+        The salt and heat exchange coefficients are constant and defined by:
+\[
+\gamma^{T} = \Gamma^{T}
+\]
+\[
+\gamma^{S} = \Gamma^{S}
+\] 
+        This is the recommended formulation for ISOMIP.
+
+	\item[\np{cn_gammablk}{cn\_gammablk}\forcode{='vel'}]:
+        The salt and heat exchange coefficients are velocity dependent and defined as
+\[
+\gamma^{T} = \Gamma^{T} \times u_{*} 
+\]
+\[
+\gamma^{S} = \Gamma^{S} \times u_{*}
+\]
+        where $u_{*}$ is the friction velocity in the top boundary layer (ie first \np{rn_htbl}{rn\_htbl} meters).
+        See \citet{jenkins.nicholls.ea_JPO10} for all the details on this formulation. It is the recommended formulation for realistic application and ISOMIP+/MISOMIP configuration.
+
+	\item[\np{cn_gammablk}{cn\_gammablk}\forcode{'vel\_stab'}]:
+        The salt and heat exchange coefficients are velocity and stability dependent and defined as:
+\[
+\gamma^{T,S} = \frac{u_{*}}{\Gamma_{Turb} + \Gamma^{T,S}_{Mole}} 
+\]
+        where $u_{*}$ is the friction velocity in the top boundary layer (ie first \np{rn_tbl}{rn\_htbl} meters),
+        $\Gamma_{Turb}$ the contribution of the ocean stability and
+        $\Gamma^{T,S}_{Mole}$ the contribution of the molecular diffusion.
+        See \citet{holland.jenkins_JPO99} for all the details on this formulation. 
+        This formulation has not been extensively tested in NEMO (not recommended).
+     \end{description}
+
+\subsection{Ocean/Ice shelf fluxes in parametrised cavities}
 
   \begin{description}
-  \item [{\np[=1]{nn_isfblk}{nn\_isfblk}}]: The melt rate is based on a balance between the upward ocean heat flux and
-    the latent heat flux at the ice shelf base. A complete description is available in \citet{hunter_trpt06}.
-  \item [{\np[=2]{nn_isfblk}{nn\_isfblk}}]: The melt rate and the heat flux are based on a 3 equations formulation
-    (a heat flux budget at the ice base, a salt flux budget at the ice base and a linearised freezing point temperature equation).
-    A complete description is available in \citet{jenkins_JGR91}.
+
+     \item[\np{cn_isfpar_mlt}{cn\_isfpar\_mlt}\forcode{ = 'bg03'}]:
+     The ice shelf cavities are not represented.
+     The fwf and heat flux are computed using the \citet{beckmann.goosse_OM03} parameterisation of isf melting.
+     The fluxes are distributed along the ice shelf edge between the depth of the average grounding line (GL)
+     (\np{sn_isfpar_zmax}{sn\_isfpar\_zmax}) and the base of the ice shelf along the calving front
+     (\np{sn_isfpar_zmin}{sn\_isfpar\_zmin}) as in (\np{cn_isfpar_mlt}{cn\_isfpar\_mlt}\forcode{ = 'spe'}).
+     The effective melting length (\np{sn_isfpar_Leff}{sn\_isfpar\_Leff}) is read from a file.
+     This parametrisation has not been tested since a while and based on \citet{Favier2019}, 
+     this parametrisation should probably not be used.
+
+     \item[\np{cn_isfpar_mlt}{cn\_isfpar\_mlt}\forcode{ = 'spe'}]:
+     The ice shelf cavity is not represented.
+     The fwf (\np{sn_isfpar_fwf}{sn\_isfpar\_fwf}) is prescribed and distributed along the ice shelf edge between
+     the depth of the average grounding line (GL) (\np{sn_isfpar_zmax}{sn\_isfpar\_zmax}) and
+     the base of the ice shelf along the calving front (\np{sn_isfpar_zmin}{sn\_isfpar\_min}). Convention of the input file is positive toward the ocean (i.e. positive for melting and negative for freezing).
+     The heat flux ($Q_h$) is computed as $Q_h = fwf \times L_f$.
+
+     \item[\np{cn_isfpar_mlt}{cn\_isfpar\_mlt}\forcode{ = 'oasis'}]:
+     The \forcode{'oasis'} is a prototype of what could be a method to spread precipitation on Antarctic ice sheet as ice shelf melt inside the cavity when a coupled model Atmosphere/Ocean is used. 
+     It has not been tested and therefore the model will stop if you try to use it. 
+     Action will be undertake in 2020 to build a comprehensive interface to do so for Greenland, Antarctic and ice shelf (cav), ice shelf (par), icebergs, subglacial runoff and runoff.
+
   \end{description}
 
-  Temperature and salinity used to compute the melt are the average temperature in the top boundary layer \citet{losch_JGR08}.
-  Its thickness is defined by \np{rn_hisf_tbl}{rn\_hisf\_tbl}.
-  The fluxes and friction velocity are computed using the mean temperature, salinity and velocity in the the first \np{rn_hisf_tbl}{rn\_hisf\_tbl} m.
-  Then, the fluxes are spread over the same thickness (ie over one or several cells).
-  If \np{rn_hisf_tbl}{rn\_hisf\_tbl} larger than top $e_{3}t$, there is no more feedback between the freezing point at the interface and the the top cell temperature.
-  This can lead to super-cool temperature in the top cell under melting condition.
-  If \np{rn_hisf_tbl}{rn\_hisf\_tbl} smaller than top $e_{3}t$, the top boundary layer thickness is set to the top cell thickness.\\
-
-  Each melt bulk formula depends on a exchange coeficient ($\Gamma^{T,S}$) between the ocean and the ice.
-  There are 3 different ways to compute the exchange coeficient:
-  \begin{description}
-  \item [{\np[=0]{nn_gammablk}{nn\_gammablk}}]: The salt and heat exchange coefficients are constant and defined by \np{rn_gammas0}{rn\_gammas0} and \np{rn_gammat0}{rn\_gammat0}.
-    \begin{gather*}
-       % \label{eq:SBC_isf_gamma_iso}
-      \gamma^{T} = rn\_gammat0 \\
-      \gamma^{S} = rn\_gammas0
-    \end{gather*}
-    This is the recommended formulation for ISOMIP.
-  \item [{\np[=1]{nn_gammablk}{nn\_gammablk}}]: The salt and heat exchange coefficients are velocity dependent and defined as
-    \begin{gather*}
-      \gamma^{T} = rn\_gammat0 \times u_{*} \\
-      \gamma^{S} = rn\_gammas0 \times u_{*}
-    \end{gather*}
-    where $u_{*}$ is the friction velocity in the top boundary layer (ie first \np{rn_hisf_tbl}{rn\_hisf\_tbl} meters).
-    See \citet{jenkins.nicholls.ea_JPO10} for all the details on this formulation. It is the recommended formulation for realistic application.
-  \item [{\np[=2]{nn_gammablk}{nn\_gammablk}}]: The salt and heat exchange coefficients are velocity and stability dependent and defined as:
-    \[
-      \gamma^{T,S} = \frac{u_{*}}{\Gamma_{Turb} + \Gamma^{T,S}_{Mole}}
-    \]
-    where $u_{*}$ is the friction velocity in the top boundary layer (ie first \np{rn_hisf_tbl}{rn\_hisf\_tbl} meters),
-    $\Gamma_{Turb}$ the contribution of the ocean stability and
-    $\Gamma^{T,S}_{Mole}$ the contribution of the molecular diffusion.
-    See \citet{holland.jenkins_JPO99} for all the details on this formulation.
-    This formulation has not been extensively tested in \NEMO\ (not recommended).
-  \end{description}
-\item [{\np[=2]{nn_isf}{nn\_isf}}]: The ice shelf cavity is not represented.
-  The fwf and heat flux are computed using the \citet{beckmann.goosse_OM03} parameterisation of isf melting.
-  The fluxes are distributed along the ice shelf edge between the depth of the average grounding line (GL)
-  (\np{sn_depmax_isf}{sn\_depmax\_isf}) and the base of the ice shelf along the calving front
-  (\np{sn_depmin_isf}{sn\_depmin\_isf}) as in (\np[=3]{nn_isf}{nn\_isf}).
-  The effective melting length (\np{sn_Leff_isf}{sn\_Leff\_isf}) is read from a file.
-\item [{\np[=3]{nn_isf}{nn\_isf}}]: The ice shelf cavity is not represented.
-  The fwf (\np{sn_rnfisf}{sn\_rnfisf}) is prescribed and distributed along the ice shelf edge between
-  the depth of the average grounding line (GL) (\np{sn_depmax_isf}{sn\_depmax\_isf}) and
-  the base of the ice shelf along the calving front (\np{sn_depmin_isf}{sn\_depmin\_isf}).
-  The heat flux ($Q_h$) is computed as $Q_h = fwf \times L_f$.
-\item [{\np[=4]{nn_isf}{nn\_isf}}]: The ice shelf cavity is opened (\np[=.true.]{ln_isfcav}{ln\_isfcav} needed).
-  However, the fwf is not computed but specified from file \np{sn_fwfisf}{sn\_fwfisf}).
-  The heat flux ($Q_h$) is computed as $Q_h = fwf \times L_f$.
-  As in \np[=1]{nn_isf}{nn\_isf}, the fluxes are spread over the top boundary layer thickness (\np{rn_hisf_tbl}{rn\_hisf\_tbl})
-\end{description}
-
-$\bullet$ \np[=1]{nn_isf}{nn\_isf} and \np[=2]{nn_isf}{nn\_isf} compute a melt rate based on
+\np{cn_isfcav_mlt}{cn\_isfcav\_mlt}\forcode{ = '2eq'}, \np{cn_isfcav_mlt}{cn\_isfcav\_mlt}\forcode{ = '3eq'} and \np{cn_isfpar_mlt}{cn\_isfpar\_mlt}\forcode{ = 'bg03'} compute a melt rate based on
 the water mass properties, ocean velocities and depth.
-This flux is thus highly dependent of the model resolution (horizontal and vertical),
-realism of the water masses onto the shelf ...\\
-
-$\bullet$ \np[=3]{nn_isf}{nn\_isf} and \np[=4]{nn_isf}{nn\_isf} read the melt rate from a file.
+The resulting fluxes are thus highly dependent of the model resolution (horizontal and vertical) and 
+realism of the water masses onto the shelf.\\
+
+\np{cn_isfcav_mlt}{cn\_isfcav\_mlt}\forcode{ = 'spe'} and \np{cn_isfpar_mlt}{cn\_isfpar\_mlt}\forcode{ = 'spe'} read the melt rate from a file.
 You have total control of the fwf forcing.
 This can be useful if the water masses on the shelf are not realistic or
 the resolution (horizontal/vertical) are too coarse to have realistic melting or
-for studies where you need to control your heat and fw input.\\
-
-The ice shelf melt is implemented as a volume flux as for the runoff.
-The fw addition due to the ice shelf melting is, at each relevant depth level, added to
-the horizontal divergence (\textit{hdivn}) in the subroutine \rou{sbc\_isf\_div}, called from \mdl{divhor}.
-See \autoref{sec:SBC_rnf} for all the details about the divergence correction.
+for studies where you need to control your heat and fw input. 
+However, if your forcing is not consistent with the dynamics below you can reach unrealistic low water temperature.\\
+
+The ice shelf fwf is implemented as a volume flux as for the runoff.
+The fwf addition due to the ice shelf melting is, at each relevant depth level, added to
+the horizontal divergence (\textit{hdivn}) in the subroutine \rou{isf\_hdiv}, called from \mdl{divhor}.
+See the runoff section \autoref{sec:SBC_rnf} for all the details about the divergence correction.\\
+
+Description and result of sensitivity tests to \np{ln_isfcav_mlt}{ln\_isfcav\_mlt} and \np{ln_isfpar_mlt}{ln\_isfpar\_mlt} are presented in \citet{mathiot.jenkins.ea_GMD17}. 
+The different options are illustrated in \autoref{fig:ISF}.
 
 \begin{figure}[!t]
   \centering
-  \includegraphics[width=0.66\textwidth]{SBC_isf}
+  \includegraphics[width=0.66\textwidth]{SBC_isf_v4.2}
   \caption[Ice shelf location and fresh water flux definition]{
     Illustration of the location where the fwf is injected and
-    whether or not the fwf is interactif or not depending of \protect\np{nn_isf}{nn\_isf}.}
-  \label{fig:SBC_isf}
+    whether or not the fwf is interactive or not.}
+  \label{fig:ISF}
 \end{figure}
 
-%% =================================================================================================
-\section{Ice sheet coupling}
-\label{sec:SBC_iscpl}
-
-\begin{listing}
-  \nlst{namsbc_iscpl}
-  \caption{\forcode{&namsbc_iscpl}}
-  \label{lst:namsbc_iscpl}
-\end{listing}
+\subsection{Available outputs}
+The following outputs are availables via XIOS:
+\begin{description}
+   \item[for parametrised cavities]:
+      \begin{xmllines}
+ <field id="isftfrz_par"     long_name="freezing point temperature in the parametrization boundary layer" unit="degC"     />
+ <field id="fwfisf_par"      long_name="Ice shelf melt rate"                           unit="kg/m2/s"  />
+ <field id="qoceisf_par"     long_name="Ice shelf ocean  heat flux"                    unit="W/m2"     />
+ <field id="qlatisf_par"     long_name="Ice shelf latent heat flux"                    unit="W/m2"     />
+ <field id="qhcisf_par"      long_name="Ice shelf heat content flux of injected water" unit="W/m2"     />
+ <field id="fwfisf3d_par"    long_name="Ice shelf melt rate"                           unit="kg/m2/s"  grid_ref="grid_T_3D" />
+ <field id="qoceisf3d_par"   long_name="Ice shelf ocean  heat flux"                    unit="W/m2"     grid_ref="grid_T_3D" />
+ <field id="qlatisf3d_par"   long_name="Ice shelf latent heat flux"                    unit="W/m2"     grid_ref="grid_T_3D" />
+ <field id="qhcisf3d_par"    long_name="Ice shelf heat content flux of injected water" unit="W/m2"     grid_ref="grid_T_3D" />
+ <field id="ttbl_par"        long_name="temperature in the parametrisation boundary layer" unit="degC" />
+ <field id="isfthermald_par" long_name="thermal driving of ice shelf melting"          unit="degC"     />
+      \end{xmllines}
+   \item[for open cavities]:
+      \begin{xmllines}
+ <field id="isftfrz_cav"     long_name="freezing point temperature at ocean/isf interface"                unit="degC"     />
+ <field id="fwfisf_cav"      long_name="Ice shelf melt rate"                           unit="kg/m2/s"  />
+ <field id="qoceisf_cav"     long_name="Ice shelf ocean  heat flux"                    unit="W/m2"     />
+ <field id="qlatisf_cav"     long_name="Ice shelf latent heat flux"                    unit="W/m2"     />
+ <field id="qhcisf_cav"      long_name="Ice shelf heat content flux of injected water" unit="W/m2"     />
+ <field id="fwfisf3d_cav"    long_name="Ice shelf melt rate"                           unit="kg/m2/s"  grid_ref="grid_T_3D" />
+ <field id="qoceisf3d_cav"   long_name="Ice shelf ocean  heat flux"                    unit="W/m2"     grid_ref="grid_T_3D" />
+ <field id="qlatisf3d_cav"   long_name="Ice shelf latent heat flux"                    unit="W/m2"     grid_ref="grid_T_3D" />
+ <field id="qhcisf3d_cav"    long_name="Ice shelf heat content flux of injected water" unit="W/m2"     grid_ref="grid_T_3D" />
+ <field id="ttbl_cav"        long_name="temperature in Losch tbl"                      unit="degC"     />
+ <field id="isfthermald_cav" long_name="thermal driving of ice shelf melting"          unit="degC"     />
+ <field id="isfgammat"       long_name="Ice shelf heat-transfert velocity"             unit="m/s"      />
+ <field id="isfgammas"       long_name="Ice shelf salt-transfert velocity"             unit="m/s"      />
+ <field id="stbl"            long_name="salinity in the Losh tbl"                      unit="1e-3"     />
+ <field id="utbl"            long_name="zonal current in the Losh tbl at T point"      unit="m/s"      />
+ <field id="vtbl"            long_name="merid current in the Losh tbl at T point"      unit="m/s"      />
+ <field id="isfustar"        long_name="ustar at T point used in ice shelf melting"    unit="m/s"      />
+ <field id="qconisf"         long_name="Conductive heat flux through the ice shelf"    unit="W/m2"     />
+      \end{xmllines}
+\end{description}
+
+%% =================================================================================================
+\subsection{Ice sheet coupling}
+\label{subsec:ISF_iscpl}
 
 Ice sheet/ocean coupling is done through file exchange at the restart step.
-At each restart step:
-
-\begin{enumerate}
-\item the ice sheet model send a new bathymetry and ice shelf draft netcdf file.
-\item a new domcfg.nc file is built using the DOMAINcfg tools.
-\item \NEMO\ run for a specific period and output the average melt rate over the period.
-\item the ice sheet model run using the melt rate outputed in step 4.
-\item go back to 1.
-\end{enumerate}
-
-If \np[=.true.]{ln_iscpl}{ln\_iscpl}, the isf draft is assume to be different at each restart step with
+At each restart step, the procedure is this one:
+
+\begin{description}
+\item[Step 1]: the ice sheet model send a new bathymetry and ice shelf draft netcdf file.
+\item[Step 2]: a new domcfg.nc file is built using the DOMAINcfg tools.
+\item[Step 3]: NEMO run for a specific period and output the average melt rate over the period.
+\item[Step 4]: the ice sheet model run using the melt rate outputed in step 3.
+\item[Step 5]: go back to 1.
+\end{description}
+
+If \np{ln_iscpl}{ln\_iscpl}\forcode{ = .true.}, the isf draft is assume to be different at each restart step with
 potentially some new wet/dry cells due to the ice sheet dynamics/thermodynamics.
-The wetting and drying scheme applied on the restart is very simple and described below for the 6 different possible cases:
+The wetting and drying scheme, applied on the restart, is very simple. The 6 different possible cases for the tracer and ssh are:
 
 \begin{description}
-\item [Thin a cell down]: T/S/ssh are unchanged and U/V in the top cell are corrected to keep the barotropic transport (bt) constant
-  ($bt_b=bt_n$).
-\item [Enlarge  a cell]: See case "Thin a cell down"
-\item [Dry a cell]: mask, T/S, U/V and ssh are set to 0.
-  Furthermore, U/V into the water column are modified to satisfy ($bt_b=bt_n$).
-\item [Wet a cell]: mask is set to 1, T/S is extrapolated from neighbours, $ssh_n = ssh_b$ and U/V set to 0.
-  If no neighbours, T/S is extrapolated from old top cell value.
-  If no neighbours along i,j and k (both previous test failed), T/S/U/V/ssh and mask are set to 0.
-\item [Dry a column]: mask, T/S, U/V are set to 0 everywhere in the column and ssh set to 0.
-\item [Wet a column]: set mask to 1, T/S is extrapolated from neighbours, ssh is extrapolated from neighbours and U/V set to 0.
-  If no neighbour, T/S/U/V and mask set to 0.
+   \item[Thin a cell]:
+   T/S/ssh are unchanged.
+
+   \item[Enlarge  a cell]:
+   See case "Thin a cell down"
+
+   \item[Dry a cell]:
+   Mask, T/S, U/V and ssh are set to 0.
+
+   \item[Wet a cell]: 
+   Mask is set to 1, T/S is extrapolated from neighbours, $ssh_n = ssh_b$.
+   If no neighbours, T/S is extrapolated from old top cell value. 
+   If no neighbours along i,j and k (both previous tests failed), T/S/ssh and mask are set to 0.
+
+   \item[Dry a column]:
+   mask, T/S and ssh are set to 0.
+
+   \item[Wet a column]:
+   set mask to 1, T/S/ssh are extrapolated from neighbours.
+   If no neighbour, T/S/ssh and mask set to 0.
 \end{description}
+
+The method described above will strongly affect the barotropic transport under an ice shelf when the geometry change.
+In order to keep the model stable, an adjustment of the dynamics at the initialisation after the coupling step is needed. 
+The idea behind this is to keep $\pd[\eta]{t}$ as it should be without change in geometry at the initialisation. 
+This will prevent any strong velocity due to large pressure gradient. 
+To do so, we correct the horizontal divergence before $\pd[\eta]{t}$ is computed in the first time step.\\
 
 Furthermore, as the before and now fields are not compatible (modification of the geometry),
@@ -1331,16 +1475,15 @@
 The horizontal extrapolation to fill new cell with realistic value is called \np{nn_drown}{nn\_drown} times.
 It means that if the grounding line retreat by more than \np{nn_drown}{nn\_drown} cells between 2 coupling steps,
-the code will be unable to fill all the new wet cells properly.
+the code will be unable to fill all the new wet cells properly and the model is likely to blow up at the initialisation.
 The default number is set up for the MISOMIP idealised experiments.
 This coupling procedure is able to take into account grounding line and calving front migration.
-However, it is a non-conservative processe.
+However, it is a non-conservative proccess. 
 This could lead to a trend in heat/salt content and volume.\\
 
 In order to remove the trend and keep the conservation level as close to 0 as possible,
-a simple conservation scheme is available with \np[=.true.]{ln_hsb}{ln\_hsb}.
-The heat/salt/vol. gain/loss is diagnosed, as well as the location.
-A correction increment is computed and apply each time step during the next \np{rn_fiscpl}{rn\_fiscpl} time steps.
-For safety, it is advised to set \np{rn_fiscpl}{rn\_fiscpl} equal to the coupling period (smallest increment possible).
-The corrective increment is apply into the cell itself (if it is a wet cell), the neigbouring cells or the closest wet cell (if the cell is now dry).
+a simple conservation scheme is available with \np{ln_isfcpl_cons}{ln\_isfcpl\_cons}\forcode{ = .true.}.
+The heat/salt/vol. gain/loss are diagnosed, as well as the location.
+A correction increment is computed and applied each time step during the model run.
+The corrective increment are applied into the cells itself (if it is a wet cell), the neigbouring cells or the closest wet cell (if the cell is now dry).
 
 %% =================================================================================================
@@ -1390,4 +1533,11 @@
 which are assumed to propagate with their larger parent and thus delay fluxing into the ocean.
 Melt water (and other variables on the configuration grid) are written into the main \NEMO\ model output files.
+
+By default, iceberg thermodynamic and dynamic are computed using ocean surface variable (sst, ssu, ssv) and the icebergs are not sensible to the bathymetry (only to land) whatever the iceberg draft. 
+\citet{Merino_OM2016} developed an option to use vertical profiles of ocean currents and temperature instead (\np{ln_M2016}{ln\_M2016}).
+Full details on the sensitivity to this parameter in done in \citet{Merino_OM2016}. 
+If \np{ln_M2016}{ln\_M2016} activated, \np{ln_icb_grd}{ln\_icb\_grd} activate (or not) an option to prevent thick icebergs to move across shallow bank (ie shallower than the iceberg draft).
+This option need to be used with care as it could required to either change the distribution to prevent generation of icebergs with draft larger than the bathymetry 
+or to build a variable \forcode{maxclass} to prevent NEMO filling the icebergs classes too thick for the local bathymetry.
 
 Extensive diagnostics can be produced.
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_STO.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_STO.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_STO.tex	(revision 14644)
@@ -5,6 +5,4 @@
 \chapter{Stochastic Parametrization of EOS (STO)}
 \label{chap:STO}
-
-\thispagestyle{plain}
 
 \chaptertoc
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_TRA.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_TRA.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_TRA.tex	(revision 14644)
@@ -5,6 +5,4 @@
 \chapter{Ocean Tracers (TRA)}
 \label{chap:TRA}
-
-\thispagestyle{plain}
 
 \chaptertoc
@@ -930,5 +928,5 @@
 When \np{nn_geoflx}{nn\_geoflx} is set to 2,
 a spatially varying geothermal heat flux is introduced which is provided in
-the \ifile{geothermal\_heating} NetCDF file
+the \textit{geothermal\_heating.nc} NetCDF file
 (\autoref{fig:TRA_geothermal}) \citep{emile-geay.madec_OS09}.
 
@@ -1151,5 +1149,5 @@
 \citep{madec.delecluse.ea_JPO96}.
 
-For generating \ifile{resto},
+For generating \textit{resto.nc},
 see the documentation for the DMP tools provided with the source code under \path{./tools/DMP_TOOLS}.
 
@@ -1175,5 +1173,5 @@
 $\gamma$ is initialized as \np{rn_atfp}{rn\_atfp}, its default value is \forcode{10.e-3}.
 Note that the forcing correction term in the filter is not applied in linear free surface
-(\jp{ln\_linssh}\forcode{=.true.}) (see \autoref{subsec:TRA_sbc}).
+(\np[=.true.]{ln_linssh}{ln\_linssh}) (see \autoref{subsec:TRA_sbc}).
 Not also that in constant volume case, the time stepping is performed on $T$,
 not on its content, $e_{3t}T$.
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_ZDF.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_ZDF.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_ZDF.tex	(revision 14644)
@@ -2,12 +2,7 @@
 
 \begin{document}
-
-%% Custom aliases
-\newcommand{\cf}{\ensuremath{C\kern-0.14em f}}
 
 \chapter{Vertical Ocean Physics (ZDF)}
 \label{chap:ZDF}
-
-\thispagestyle{plain}
 
 \chaptertoc
@@ -1085,4 +1080,5 @@
   \label{lst:namdrg}
 \end{listing}
+
 \begin{listing}
   \nlst{namdrg_top}
@@ -1090,4 +1086,5 @@
   \label{lst:namdrg_top}
 \end{listing}
+
 \begin{listing}
   \nlst{namdrg_bot}
@@ -1181,5 +1178,5 @@
 These values are assigned in \mdl{zdfdrg}.
 Note that there is support for local enhancement of these values via an externally defined 2D mask array
-(\np[=.true.]{ln_boost}{ln\_boost}) given in the \ifile{bfr\_coef} input NetCDF file.
+(\np[=.true.]{ln_boost}{ln\_boost}) given in the \textit{bfr\_coef.nc} input NetCDF file.
 The mask values should vary from 0 to 1.
 Locations with a non-zero mask value will have the friction coefficient increased by
@@ -1564,5 +1561,5 @@
 by only a few extra physics choices namely:
 
-\begin{verbatim}
+\begin{forlines}
      ln_dynldf_OFF = .false.
      ln_dynldf_lap = .true.
@@ -1572,5 +1569,5 @@
         nn_fct_h   =  2
         nn_fct_v   =  2
-\end{verbatim}
+\end{forlines}
 
 \noindent which were chosen to provide a slightly more stable and less noisy solution. The
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_cfgs.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_cfgs.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_cfgs.tex	(revision 14644)
@@ -5,6 +5,4 @@
 \chapter{Configurations}
 \label{chap:CFGS}
-
-\thispagestyle{plain}
 
 \chaptertoc
@@ -85,5 +83,5 @@
 the SI3 model (ORCA-ICE) and possibly with PISCES biogeochemical model (ORCA-ICE-PISCES).
 An appropriate namelist is available in \path{./cfgs/ORCA2_ICE_PISCES/EXPREF/namelist_cfg} for ORCA2.
-The domain of ORCA2 configuration is defined in \ifile{ORCA\_R2\_zps\_domcfg} file,
+The domain of ORCA2 configuration is defined in \textit{ORCA\_R2\_zps\_domcfg.nc} file,
 this file is available in tar file on the \NEMO\ community zenodo platform: \\
 https://doi.org/10.5281/zenodo.2640723
@@ -152,5 +150,5 @@
 Each of configuration is set through the \textit{domain\_cfg} domain configuration file,
 which sets the grid size and configuration name parameters.
-The \NEMO\ System Team provides only ORCA2 domain input file "\ifile{ORCA\_R2\_zps\_domcfg}" file
+The \NEMO\ System Team provides only ORCA2 domain input file "\textit{ORCA\_R2\_zps\_domcfg.nc}" file
 (\autoref{tab:CFGS_ORCA}).
 
@@ -158,5 +156,5 @@
   \centering
   \begin{tabular}{p{4cm} c c c c}
-    Horizontal Grid & \jp{ORCA\_index} & \jp{jpiglo} & \jp{jpjglo} \\
+    Horizontal Grid & \texttt{ORCA\_index} & \texttt{jpiglo} & \texttt{jpjglo} \\
     \hline \hline
     % 4   \deg\ &              4   &          92 &          76 \\
@@ -246,12 +244,13 @@
 Its horizontal resolution (and thus the size of the domain) is determined by
 setting \np{nn_GYRE}{nn\_GYRE} in \nam{usr_def}{usr\_def}:
+
 \begin{align*}
-  \jp{jpiglo} = 30 \times \text{\np{nn_GYRE}{nn\_GYRE}} + 2 + 2 \times \text{\np{nn_hls}{nn\_hls}} \\
-  \jp{jpjglo} = 20 \times \text{\np{nn_GYRE}{nn\_GYRE}} + 2 + 2 \times \text{\np{nn_hls}{nn\_hls}}
+   jpiglo = 30 \times \text{\np{nn_GYRE}{nn\_GYRE}} + 2 + 2 \times \text{\np{nn_hls}{nn\_hls}} \\
+   jpjglo = 20 \times \text{\np{nn_GYRE}{nn\_GYRE}} + 2 + 2 \times \text{\np{nn_hls}{nn\_hls}}
 \end{align*}
 
 Obviously, the namelist parameters have to be adjusted to the chosen resolution,
 see the Configurations pages on the \NEMO\ web site (\NEMO\ Configurations).
-In the vertical, GYRE uses the default 30 ocean levels (\jp{jpk}\forcode{ = 31}) (\autoref{fig:DOM_zgr_e3}).
+In the vertical, GYRE uses the default 30 ocean levels (\forcode{jpk = 31}, \autoref{fig:DOM_zgr_e3}).
 
 \begin{listing}
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_conservation.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_conservation.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_conservation.tex	(revision 14644)
@@ -5,6 +5,4 @@
 \chapter{Invariants of the Primitive Equations}
 \label{chap:CONS}
-
-\thispagestyle{plain}
 
 \chaptertoc
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_misc.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_misc.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_misc.tex	(revision 14644)
@@ -6,6 +6,4 @@
 \label{chap:MISC}
 
-\thispagestyle{plain}
-
 \chaptertoc
 
@@ -14,10 +12,11 @@
 {\footnotesize
   \begin{tabularx}{\textwidth}{l||X|X}
-    Release & Author(s) & Modifications \\
+    Release     & Author(s)            & Modifications                      \\
     \hline
-    {\em   4.0} & {\em ...} & {\em ...} \\
-    {\em   3.6} & {\em ...} & {\em ...} \\
-    {\em   3.4} & {\em ...} & {\em ...} \\
-    {\em <=3.4} & {\em ...} & {\em ...}
+    {\em   X.X} & {\em Pierre Mathiot} & {Update of the closed sea section} \\
+    {\em   4.0} & {\em ...           } & {\em ...                         } \\
+    {\em   3.6} & {\em ...           } & {\em ...                         } \\
+    {\em   3.4} & {\em ...           } & {\em ...                         } \\
+    {\em <=3.4} & {\em ...           } & {\em ...                         }
   \end{tabularx}
 }
@@ -109,21 +108,13 @@
 \end{figure}
 
-\begin{figure}[!tbp]
-  \centering
-  \includegraphics[width=0.66\textwidth]{MISC_closea_mask_example}
-  \caption[Mask fields for the \protect\mdl{closea} module]{
-    Example of mask fields for the \protect\mdl{closea} module.
-    \textit{Left}: a closea\_mask field;
-    \textit{Right}: a closea\_mask\_rnf field.
-    In this example, if \protect\np{ln_closea}{ln\_closea} is set to \forcode{.true.},
-    the mean freshwater flux over each of the American Great Lakes will be set to zero,
-    and the total residual for all the lakes, if negative, will be put into
-    the St Laurence Seaway in the area shown.}
-  \label{fig:MISC_closea_mask_example}
-\end{figure}
-
 %% =================================================================================================
 \section[Closed seas (\textit{closea.F90})]{Closed seas (\protect\mdl{closea})}
 \label{sec:MISC_closea}
+
+\begin{listing}
+  \nlst{namclo}
+  \caption{\forcode{&namclo}}
+  \label{lst:namclo}
+\end{listing}
 
 Some configurations include inland seas and lakes as ocean
@@ -138,53 +129,50 @@
 to zero and put the residual flux into the ocean.
 
-Prior to \NEMO\ 4 the locations of inland seas and lakes was set via
-hardcoded indices for various ORCA configurations. From \NEMO\ 4 onwards
-the inland seas and lakes are defined using mask fields in the
-domain configuration file. The options are as follows.
-
-\begin{enumerate}
-\item {{\bfseries No ``closea\_mask'' field is included in domain configuration
-  file.} In this case the closea module does nothing.}
-
-\item {{\bfseries A field called closea\_mask is included in the domain
-configuration file and ln\_closea=.false. in namelist namcfg.} In this
-case the inland seas defined by the closea\_mask field are filled in
-(turned to land points) at run time. That is every point in
-closea\_mask that is nonzero is set to be a land point.}
-
-\item {{\bfseries A field called closea\_mask is included in the domain
-configuration file and ln\_closea=.true. in namelist namcfg.} Each
-inland sea or group of inland seas is set to a positive integer value
-in the closea\_mask field (see \autoref{fig:MISC_closea_mask_example}
-for an example). The net surface flux over each inland sea or group of
+The inland seas and lakes are defined using mask fields in the
+domain configuration file. Special treatment of the closed sea (redistribution of net freshwater or mask those), are defined in \autoref{lst:namclo} and
+can be trigger by \np{ln_closea}{ln\_closea}\forcode{=.true.} in namelist namcfg.
+
+The options available are the following:
+\begin{description}
+\item[\np{ln_maskcs}{ln\_maskcs}\forcode{ = .true.}] All the closed seas are masked using \textit{mask\_opensea} variable.
+\item[\np{ln_maskcs}{ln\_maskcs}\forcode{ = .false.}] The net surface flux over each inland sea or group of
 inland seas is set to zero each timestep and the residual flux is
-distributed over the global ocean (ie. all ocean points where
-closea\_mask is zero).}
-
-\item {{\bfseries Fields called closea\_mask and closea\_mask\_rnf are
-included in the domain configuration file and ln\_closea=.true. in
-namelist namcfg.} This option works as for option 3, except that if
-the net surface flux over an inland sea is negative (net
-precipitation) it is put into the ocean at specified runoff points. A
-net positive surface flux (net evaporation) is still spread over the
-global ocean. The mapping from inland seas to runoff points is defined
-by the closea\_mask\_rnf field. Each mapping is defined by a positive
-integer value for the inland sea(s) and the corresponding runoff
-points. An example is given in
-\autoref{fig:MISC_closea_mask_example}. If no mapping is provided for a
-particular inland sea then the residual is spread over the global
-ocean.}
-
-\item {{\bfseries Fields called closea\_mask and closea\_mask\_emp are
-included in the domain configuration file and ln\_closea=.true. in
-namelist namcfg.} This option works the same as option 4 except that
-the nonzero net surface flux is sent to the ocean at the specified
-runoff points regardless of whether it is positive or negative. The
-mapping from inland seas to runoff points in this case is defined by
-the closea\_mask\_emp field.}
-\end{enumerate}
-
-There is a python routine to create the closea\_mask fields and append
-them to the domain configuration file in the utils/tools/DOMAINcfg directory.
+distributed over a target area.
+\end{description}
+
+When \np{ln_maskcs}{ln\_maskcs}\forcode{ = .false.}, 
+3 options are available for the redistribution (set up of these options is done in the tool DOMAINcfg):
+\begin{description}[font=$\bullet$ ]
+\item[ glo]: The residual flux is redistributed globally.
+\item[ emp]: The residual flux is redistributed as emp in a river outflow.
+\item[ rnf]: The residual flux is redistributed as rnf in a river outflow if negative. If there is a net evaporation, the residual flux is redistributed globally.
+\end{description}
+
+For each case, 2 masks are needed (\autoref{fig:MISC_closea_mask_example}): 
+\begin{description}
+\item $\bullet$ one describing the 'sources' (ie the closed seas concerned by each options) called \textit{mask\_csglo}, \textit{mask\_csrnf}, \textit{mask\_csemp}. 
+\item $\bullet$ one describing each group of inland seas (the Great Lakes for example) and the target area (river outflow or world ocean) for each group of inland seas (St Laurence for the Great Lakes for example) called
+\textit{mask\_csgrpglo}, \textit{mask\_csgrprnf}, \textit{mask\_csgrpemp}.
+\end{description}
+
+\begin{figure}[!tbp]
+  \centering
+  \includegraphics[width=0.66\textwidth]{MISC_closea_mask_example}
+  \caption[Mask fields for the \protect\mdl{closea} module]{
+    Example of mask fields for the \protect\mdl{closea} module.
+    \textit{Left}: a \textit{mask\_csrnf} field;
+    \textit{Right}: a \textit{mask\_csgrprnf} field.
+    In this example, if \protect\np{ln_closea}{ln\_closea} is set to \forcode{.true.},
+    the mean freshwater flux over each of the American Great Lakes will be set to zero,
+    and the total residual for all the lakes, if negative, will be put into
+    the St Laurence Seaway in the area shown.}
+  \label{fig:MISC_closea_mask_example}
+\end{figure}
+
+Closed sea not defined (because too small, issue in the bathymetry definition ...) are defined in \textit{mask\_csundef}.
+These points can be masked using the namelist option \np{ln_mask_csundef}{ln\_mask\_csundef}\forcode{= .true.} or used to correct the bathymetry input file.\\
+
+The masks needed for the closed sea can be created using the DOMAINcfg tool in the utils/tools/DOMAINcfg directory.
+See \autoref{sec:clocfg} for details on the usage of definition of the closed sea masks.
 
 %% =================================================================================================
@@ -205,5 +193,5 @@
 
 \noindent Consider an ORCA1
-configuration using the extended grid domain configuration file: \ifile{eORCA1\_domcfg.nc}
+configuration using the extended grid domain configuration file: \textit{eORCA1\_domcfg.nc}
 This file define a horizontal domain of 362x332.  The first row with
 open ocean wet points in the non-isf bathymetry for this set is row 42 (\fortran\ indexing)
@@ -226,5 +214,5 @@
 \noindent Note that with this option, the j-size of the global domain is (extended
 j-size minus \np{open_ocean_jstart}{open\_ocean\_jstart} + 1 ) and this must match the \texttt{jpjglo} value
-for the configuration. This means an alternative version of \ifile{eORCA1\_domcfg.nc} must
+for the configuration. This means an alternative version of \textit{eORCA1\_domcfg.nc} must
 be created for when \np{ln_use_jattr}{ln\_use\_jattr} is active. The \texttt{ncap2} tool provides a
 convenient way of achieving this:
@@ -234,5 +222,5 @@
 \end{cmds}
 
-The domain configuration file is unique in this respect since it also contains the value of \jp{jpjglo}
+The domain configuration file is unique in this respect since it also contains the value of \texttt{jpjglo}
 that is read and used by the model.
 Any other global, 2D and 3D, netcdf, input field can be prepared for use in a reduced domain by adding the
@@ -374,5 +362,5 @@
 
 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
+forms of output can be selected via the \np{sn_cfctl}{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
@@ -449,7 +437,5 @@
 systems so bug-hunting efforts using this facility should also utilise the \fortran:
 
-\begin{forlines} 
-   CALL FLUSH(numout)
-\end{forlines}
+\forline|CALL FLUSH(numout)|
 
 statement after any additional write statements to ensure that file contents reflect
@@ -482,18 +468,18 @@
 
 \begin{forlines}
-   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
+   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
 \end{forlines}
 
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_model_basics.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_model_basics.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_model_basics.tex	(revision 14644)
@@ -5,6 +5,4 @@
 \chapter{Model Basics}
 \label{chap:MB}
-
-\thispagestyle{plain}
 
 \chaptertoc
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_model_basics_zstar.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_model_basics_zstar.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_model_basics_zstar.tex	(revision 14644)
@@ -4,6 +4,4 @@
 
 \chapter{ essai \zstar \sstar}
-
-\thispagestyle{plain}
 
 \chaptertoc
@@ -85,4 +83,5 @@
 
 %\nlst{nam_dynspg}
+
 Options are defined through the \nam{_dynspg}{\_dynspg} namelist variables.
 The surface pressure gradient term is related to the representation of the free surface (\autoref{sec:MB_hor_pg}).
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_time_domain.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_time_domain.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/NEMO/subfiles/chap_time_domain.tex	(revision 14644)
@@ -6,6 +6,4 @@
 \label{chap:TD}
 
-\thispagestyle{plain}
-
 \chaptertoc
 
@@ -14,12 +12,12 @@
 {\footnotesize
   \begin{tabularx}{0.5\textwidth}{l||X|X}
-    Release          & Author(s)                                       &
+    Release          & Author(s)                                       & 
     Modifications                                                      \\
     \hline
-    {\em        4.0} & {\em J\'{e}r\^{o}me Chanut \newline Tim Graham} &
+    {\em        4.0} & {\em J\'{e}r\^{o}me Chanut \newline Tim Graham} & 
     {\em Review \newline Update                                      } \\
-    {\em        3.6} & {\em Christian \'{E}th\'{e}                   } &
+    {\em        3.6} & {\em Christian \'{E}th\'{e}                   } & 
     {\em Update                                                      } \\
-    {\em $\leq$ 3.4} & {\em Gurvan Madec                             } &
+    {\em $\leq$ 3.4} & {\em Gurvan Madec                             } & 
     {\em First version                                               } \\
   \end{tabularx}
@@ -46,8 +44,10 @@
 
 The time stepping used in \NEMO\ is a three level scheme that can be represented as follows:
+
 \begin{equation}
   \label{eq:TD}
   x^{t + \rdt} = x^{t - \rdt} + 2 \, \rdt \ \text{RHS}_x^{t - \rdt, \, t, \, t + \rdt}
 \end{equation}
+
 where $x$ stands for $u$, $v$, $T$ or $S$;
 RHS is the \textbf{R}ight-\textbf{H}and-\textbf{S}ide of the corresponding time evolution equation;
@@ -99,8 +99,10 @@
 first designed by \citet{robert_JMSJ66} and more comprehensively studied by \citet{asselin_MWR72},
 is a kind of laplacian diffusion in time that mixes odd and even time steps:
+
 \begin{equation}
   \label{eq:TD_asselin}
   x_F^t = x^t + \gamma \, \lt[ x_F^{t - \rdt} - 2 x^t + x^{t + \rdt} \rt]
 \end{equation}
+
 where the subscript $F$ denotes filtered values and $\gamma$ is the Asselin coefficient.
 $\gamma$ is initialized as \np{rn_atfp}{rn\_atfp} (namelist parameter).
@@ -134,4 +136,5 @@
 The conditions for stability of second and fourth order horizontal diffusion schemes are
 \citep{griffies_bk04}:
+
 \begin{equation}
   \label{eq:TD_euler_stability}
@@ -142,4 +145,5 @@
   \end{cases}
 \end{equation}
+
 where $e$ is the smallest grid size in the two horizontal directions and
 $A^h$ is the mixing coefficient.
@@ -153,4 +157,5 @@
 To overcome the stability constraint, a backward (or implicit) time differencing scheme is used.
 This scheme is unconditionally stable but diffusive and can be written as follows:
+
 \begin{equation}
   \label{eq:TD_imp}
@@ -170,9 +175,12 @@
 where RHS is the right hand side of the equation except for the vertical diffusion term.
 We rewrite \autoref{eq:TD_imp} as:
+
 \begin{equation}
   \label{eq:TD_imp_mat}
   -c(k + 1) \; T^{t + 1}(k + 1) + d(k) \; T^{t + 1}(k) - \; c(k) \; T^{t + 1}(k - 1) \equiv b(k)
 \end{equation}
+
 where
+
 \[
   c(k) = A_w^{vT} (k) \, / \, e_{3w} (k) \text{,} \quad
@@ -241,4 +249,5 @@
 $Q$ is redistributed over several time step.
 In the modified LF-RA environment, these two formulations have been replaced by:
+
 \begin{gather}
   \label{eq:TD_forcing}
@@ -248,4 +257,5 @@
                     - \gamma \, \rdt \, \lt( Q^{t + \rdt / 2} - Q^{t - \rdt / 2} \rt)
 \end{gather}
+
 The change in the forcing formulation given by \autoref{eq:TD_forcing}
 (see \autoref{fig:TD_MLF_forcing}) has a significant effect:
@@ -377,4 +387,5 @@
   %
 \end{flalign*}
+
 \begin{flalign*}
   \allowdisplaybreaks
@@ -389,4 +400,5 @@
   %
 \end{flalign*}
+
 \begin{flalign*}
   \allowdisplaybreaks
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/SI3/main/SI3_manual.ist
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/SI3/main/SI3_manual.ist	(revision 14644)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/SI3/main/SI3_manual.ist	(revision 14644)
@@ -0,0 +1,1 @@
+link ../../global/index.ist
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/SI3/main/settings.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/SI3/main/settings.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/SI3/main/settings.tex	(revision 14644)
@@ -1,20 +1,18 @@
-%% Engine (folder name)
-\def \engine{SI3}
+%% Engine
+\def\eng{SI3}
 
-%% Title and cover page settings
-\def \spacetop{  \vspace*{1.2cm} }
-\def \heading{Sea Ice modelling Integrated Initiative (SI$^3$)}
-\def \subheading{The NEMO sea ice engine}
-\def \spacedown{ \vspace*{  1cm} }
-\def \authorswidth{0.2\linewidth}
-\def \rulelenght{230pt}
-\def \abstractwidth{0.65\linewidth}
+%% Cover page
+\def\spcup{\vspace*{1.20cm}}
+\def \hdg{Sea Ice modelling Integrated Initiative (SI$^3$)}
+\def\shdg{The NEMO sea ice engine                         }
+\def\spcdn{\vspace*{1.00cm}}
+\def\autwd{0.20\linewidth}\def\lnlg{230pt}\def\abswd{0.65\linewidth}
 
-%% Color for document (frontpage banner, links and chapter boxes)
-\def \setmanualcolor{ \definecolor{manualcolor}{cmyk}{0, 0, 0, 0.4} }
+%% Color in cmyk model for manual theme (frontpage banner, links and chapter boxes)
+\def\clr{0.0,0.0,0.0,0.4}
 
 %% IPSL publication number
-\def \ipslnum{31}
+\def\ipsl{31}
 
-%% Zenodo ID, i.e. doi:10.5281/zenodo.\([0-9]*\)
-\def \zid{1471689}
+%% Zenodo ID, i.e. doi:10.5281/zenodo.\zid
+\def\zid{1471689}
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/TOP/main/TOP_manual.ist
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/TOP/main/TOP_manual.ist	(revision 14644)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/TOP/main/TOP_manual.ist	(revision 14644)
@@ -0,0 +1,1 @@
+link ../../global/index.ist
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/TOP/main/bibliography.bib
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/TOP/main/bibliography.bib	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/TOP/main/bibliography.bib	(revision 14644)
@@ -185,4 +185,16 @@
   journal	= {Global Biogeochemical Cycles},
   publisher	= {American Geophysical Union (AGU)}
+}
+
+@techreport{      gibson_trpt86,
+  title         = "Standards for software development and maintenance",
+  pages         = "21",
+  series        = "ECMWF Technical Memoranda",
+  number        = "120",
+  author        = "J. K. Gibson",
+  institution   = "ECMWF Operations Department; Reading, United Kingdom",
+  year          = "1986",
+  month         = "aug",
+  doi           = "10.21957/gi113q4gn"
 }
 
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/TOP/main/settings.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/TOP/main/settings.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/TOP/main/settings.tex	(revision 14644)
@@ -1,20 +1,18 @@
-%% Engine (folder name)
-\def \engine{TOP}
+%% Engine
+\def\eng{TOP}
 
-%% Title and cover page settings
-\def \spacetop{  \vspace*{1.3cm} }
-\def \heading{Tracers in Ocean Paradigm (TOP)}
-\def \subheading{The NEMO passive tracers engine}
-\def \spacedown{ \vspace*{  1cm} }
-\def \authorswidth{0.15\linewidth}
-\def \rulelenght{110pt}
-\def \abstractwidth{0.7\linewidth}
+%% Cover page
+\def\spcup{\vspace*{1.30cm}}
+\def \hdg{Tracers in Ocean Paradigm (TOP)}
+\def\shdg{The NEMO passive tracers engine}
+\def\spcdn{\vspace*{1.00cm}}
+\def\autwd{0.15\linewidth}\def\lnlg{110pt}\def\abswd{0.70\linewidth}
 
-%% Color for document (frontpage banner, links and chapter boxes)
-\def \setmanualcolor{ \definecolor{manualcolor}{cmyk}{1, 0, 1, .4} }
+%% Color in cmyk model for manual theme (frontpage banner, links and chapter boxes)
+\def\clr{1.0,0.0,1.0,0.4}
 
 %% IPSL publication number
-\def \ipslnum{28}
+\def\ipsl{28}
 
-%% Zenodo ID, i.e. doi:10.5281/zenodo.\([0-9]*\)
-\def \zid{1471700}
+%% Zenodo ID, i.e. doi:10.5281/zenodo.\zid
+\def\zid{1471700}
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/TOP/subfiles/miscellaneous.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/TOP/subfiles/miscellaneous.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/TOP/subfiles/miscellaneous.tex	(revision 14644)
@@ -24,5 +24,5 @@
 %
 \begin{minted}{bash}
-    bld::tool::fppkeys   key_iomput key_mpp_mpi key_top
+    bld::tool::fppkeys   key_xios key_top
 \end{minted}
 
@@ -42,5 +42,5 @@
 %
 \begin{minted}{bash}
-   bld::tool::fppkeys   key_iomput key_mpp_mpi key_top
+   bld::tool::fppkeys   key_xios key_top
 
    src::MYBGC::initialization         <MYBGCPATH>/initialization
@@ -60,5 +60,5 @@
 %Note that, the additional lines specific for the BGC model source and build paths, can be written into a separate file, e.g. named MYBGC.fcm, and then simply included in the cpp_NEMO_MYBGC.fcm as follow
 %
-%bld::tool::fppkeys  key_zdftke key_dynspg_ts key_iomput key_mpp_mpi key_top
+%bld::tool::fppkeys  key_zdftke key_dynspg_ts key_xios key_top
 %inc <MYBGCPATH>/MYBGC.fcm
 %This will enable a more portable compilation structure for all MYBGC related configurations.
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/TOP/subfiles/model_description.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/TOP/subfiles/model_description.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/TOP/subfiles/model_description.tex	(revision 14644)
@@ -9,6 +9,4 @@
 \newcommand{\Dcq}{\Delta ^{14}\mathrm{C}}
 \newcommand{\Rq}{\mathrm{^{14}{R}}}
-\newcommand{\CODE}[1]{\textsc{#1}}
-%\newcommand{\CODE}[1]{\textcolor{black}{\textsc{#1}}\xspace}
 
 \chapter{Model Description}
@@ -28,7 +26,11 @@
 where expressions of $D^{lC}$ and $D^{vC}$ depend on the choice for the lateral and vertical subgrid scale parameterizations, see equations 5.10 and 5.11 in \citep{nemo_manual}
 
-{S(C)} , the first term on the right hand side of \ref{Eq_tracer}; is the SMS - Source Minus Sink - inherent to the tracer.  In the case of biological tracer such as phytoplankton, {S(C)} is the balance between phytoplankton growth and its decay through mortality and grazing. In the case of a tracer comprising carbon,  {S(C)} accounts for gas exchange, river discharge, flux to the sediments, gravitational sinking and other biological processes. In the case of a radioactive tracer, {S(C)} is simply loss due to radioactive decay.
-
-The second term (within brackets) represents the advection of the tracer in the three directions. It can be interpreted as the budget between the incoming and outgoing tracer fluxes in a volume $T$-cells $b_t= e_{1t}\,e_{2t}\,e_{3t}$
+{S(C)} , the first term on the right hand side of \autoref{Eq_tracer}; is the SMS - Source Minus Sink - inherent to the tracer.
+In the case of biological tracer such as phytoplankton, {S(C)} is the balance between phytoplankton growth and its decay through mortality and grazing.
+In the case of a tracer comprising carbon,  {S(C)} accounts for gas exchange, river discharge, flux to the sediments, gravitational sinking and other biological processes.
+In the case of a radioactive tracer, {S(C)} is simply loss due to radioactive decay.
+
+The second term (within brackets) represents the advection of the tracer in the three directions.
+It can be interpreted as the budget between the incoming and outgoing tracer fluxes in a volume $T$-cells $b_t= e_{1t}\,e_{2t}\,e_{3t}$
 
 The third term  represents the change due to lateral diffusion.
@@ -46,5 +48,6 @@
 \label{sec:TopInt}
 
-TOP is the NEMO hardwired interface toward biogeochemical models and provide the physical constraints/boundaries for oceanic tracers. It consists of a modular framework to handle multiple ocean tracers, including also a variety of built-in modules.
+TOP is the NEMO hardwired interface toward biogeochemical models and provide the physical constraints/boundaries for oceanic tracers.
+It consists of a modular framework to handle multiple ocean tracers, including also a variety of built-in modules.
 
 This component of the NEMO framework allows one to exploit available modules  and further develop a range of applications, spanning from the implementation of a dye passive tracer to evaluate dispersion processes (by means of MY\_TRC), track water masses age (AGE module), assess the ocean interior penetration of persistent chemical compounds (e.g., gases like CFC or even PCBs), up to the full set of equations involving marine biogeochemical cycles.
@@ -61,5 +64,6 @@
         \item \textbf{AGE}	    :    Water age tracking
         \item \textbf{MY\_TRC}  :	Template for creation of new modules and external BGC models coupling
-        \item \textbf{PISCES}    :	 Built in BGC model. See \citep{aumont_2015} for a throughout description.
+        \item \textbf{PISCES}    :	 Built in BGC model.
+See \citep{aumont_2015} for a throughout description.
 \end{itemize}
 %  ----------------------------------------------------------
@@ -69,17 +73,21 @@
 The passive tracer transport component  shares the same advection/diffusion routines with the dynamics, with specific treatment of some features like the surface boundary conditions, or the positivity of passive tracers concentrations.
 
- \subsection{ Advection}
+\subsection{Advection}
 %------------------------------------------namtrc_adv----------------------------------------------------
 \nlst{namtrc_adv}
 %-------------------------------------------------------------------------------------------------------------
-The advection schemes used for the passive tracers are the same than the ones for $T$ and $S$ and described in section 5.1 of \citep{nemo_manual}. The choice of an advection scheme  can be selected independently and  can differ from the ones used for active tracers. This choice is made in the \textit{namtrc\_adv} namelist, by  setting to \textit{true} one and only one of the logicals \textit{ln\_trcadv\_xxx}, the same way of what is done for dynamics.
-cen2, MUSCL2, and UBS are not \textit{positive} schemes meaning that negative values can appear in an initially strictly positive tracer field which is advected, implying that false extrema are permitted. Their use is not recommended on passive tracers
-
- \subsection{ Lateral diffusion}
+The advection schemes used for the passive tracers are the same than the ones for $T$ and $S$ and described in section 5.1 of \citep{nemo_manual}.
+The choice of an advection scheme  can be selected independently and  can differ from the ones used for active tracers.
+This choice is made in the \textit{namtrc\_adv} namelist, by  setting to \textit{true} one and only one of the logicals \textit{ln\_trcadv\_xxx}, the same way of what is done for dynamics.
+cen2, MUSCL2, and UBS are not \textit{positive} schemes meaning that negative values can appear in an initially strictly positive tracer field which is advected, implying that false extrema are permitted.
+Their use is not recommended on passive tracers
+
+\subsection{Lateral diffusion}
 %------------------------------------------namtrc_ldf----------------------------------------------------
 \nlst{namtrc_ldf}
 %-------------------------------------------------------------------------------------------------------------
-In NEMO v4.0, the passive tracer diffusion has necessarily the same form as the active tracer diffusion, meaning that the numerical scheme must be the same. However the passive tracer mixing coefficient can be chosen as a multiple of the active ones by changing the value of \textit{rn\_ldf\_multi} in namelist \textit{namtrc\_ldf}. The choice of numerical scheme is then set  in the \nam{namtra_ldf}{namtra\_ldf} namelist for the dynamic described in section 5.2 of \citep{nemo_manual}.
-
+In NEMO v4.0, the passive tracer diffusion has necessarily the same form as the active tracer diffusion, meaning that the numerical scheme must be the same.
+However the passive tracer mixing coefficient can be chosen as a multiple of the active ones by changing the value of \textit{rn\_ldf\_multi} in namelist \textit{namtrc\_ldf}.
+The choice of numerical scheme is then set in the \forcode{&namtra_ldf} namelist for the dynamic described in section 5.2 of \citep{nemo_manual}.
 
 %-----------------We also offers the possibility to increase zonal equatorial diffusion for passive tracers by introducing an enhanced zonal diffusivity coefficent in the equatorial domain which can be defined by the equation below :
@@ -88,5 +96,5 @@
 %-----------------\end{equation}
 
- \subsection{ Tracer damping}
+\subsection{Tracer damping}
 
 %------------------------------------------namtrc_dmp----------------------------------------------------
@@ -94,8 +102,12 @@
 %-------------------------------------------------------------------------------------------------------------
 
-The use of newtonian damping  to climatological fields or observations is also coded, sharing the same routine dans active tracers. Boolean variables are defined in the namelist\_top\_ref to select the tracers on which restoring is applied
-Options are defined through the \nam{namtrc_dmp}{namtrc\_dmp} namelist variables. The restoring term is added when the namelist parameter \np{ln\_trcdmp} is set to true. The restoring coefficient is a three-dimensional array read in a file, which name is specified by the namelist variable \np{cn\_resto\_tr}. This netcdf file can be generated using the DMP\_TOOLS tool.
-
- \subsection{ Tracer positivity}
+The use of newtonian damping  to climatological fields or observations is also coded, sharing the same routine dans active tracers.
+Boolean variables are defined in the namelist\_top\_ref to select the tracers on which restoring is applied
+Options are defined through the \nam{trc_dmp}{trc\_dmp} namelist variables.
+The restoring term is added when the namelist parameter \np{ln\_trcdmp} is set to true.
+The restoring coefficient is a three-dimensional array read in a file, which name is specified by the namelist variable \np{cn\_resto\_tr}.
+This netcdf file can be generated using the DMP\_TOOLS tool.
+
+\subsection{Tracer positivity}
 
 %------------------------------------------namtrc_rad----------------------------------------------------
@@ -103,6 +115,8 @@
 %-------------------------------------------------------------------------------------------------------------
 
-Sometimes, numerical scheme can generates negative values of passive tracers concentration that must be positive. For exemple,  isopycnal diffusion can created extrema. The trcrad routine artificially corrects negative concentrations with a very crude solution that either sets negative concentration to zero without adjusting the tracer budget, or by removing negative concentration and keeping mass conservation.
-The treatment of negative concentrations is an option and can be selected in the namelist \nam{namtrc_rad}{namtrc\_rad} by setting the parameter \np{ln\_trcrad}  to true.
+Sometimes, numerical scheme can generates negative values of passive tracers concentration that must be positive.
+For exemple,  isopycnal diffusion can created extrema.
+The trcrad routine artificially corrects negative concentrations with a very crude solution that either sets negative concentration to zero without adjusting the tracer budget, or by removing negative concentration and keeping mass conservation.
+The treatment of negative concentrations is an option and can be selected in the namelist \nam{trc_rad}{trc\_rad} by setting the parameter \np{ln\_trcrad}  to true.
 
 \section{The SMS modules}
@@ -119,31 +133,42 @@
 %----------------------------------------------------------------------------------------------------------
 
-
- An `ideal age' tracer is integrated online in TOP when \textit{ln\_age} = \texttt{.true.} in namelist \textit{namtrc}. This tracer marks the length of time in units of years that fluid has spent in the interior of the ocean, insulated from exposure to the atmosphere. Thus, away from the surface for $z<-H_{\mathrm{Age}}$ where $H_{\mathrm{Age}}$ is specified by the \textit{namage} namelist variable \textit{rn\_age\_depth}, whose default value is 10~m, there is a source $\mathrm{SMS_{\mathrm{Age}}}$ of the age tracer $A$:
+An `ideal age' tracer is integrated online in TOP when \textit{ln\_age} = \texttt{.true.} in namelist \textit{namtrc}.
+This tracer marks the length of time in units of years that fluid has spent in the interior of the ocean, insulated from exposure to the atmosphere.
+Thus, away from the surface for $z<-H_{\mathrm{Age}}$ where $H_{\mathrm{Age}}$ is specified by the \textit{namage} namelist variable \textit{rn\_age\_depth}, whose default value is 10~m, there is a source $\mathrm{SMS_{\mathrm{Age}}}$ of the age tracer $A$:
+
 \begin{equation}
   \label{eq:TOP-age-interior}
   \mathrm{SMS_{\mathrm{Age}}} = 1 \mathrm{yr}\;^{-1} = 1/T_{\mathrm{year}},
- \end{equation}
- where the length of the current year $T_{\mathrm{year}} = 86400*N_{\mathrm{days\;in\;current\; year}}\;\mathrm{s}$, where $N_{\mathrm{days\;in\;current\; year}}$ may be 366 or 365 depending on whether the current year is a leap year or not.
- Near the surface, for $z>-H_{\mathrm{Age}}$, ideal age is relaxed back to zero:
+\end{equation}
+
+where the length of the current year $T_{\mathrm{year}} = 86400*N_{\mathrm{days\;in\;current\; year}}\;\mathrm{s}$, where $N_{\mathrm{days\;in\;current\; year}}$ may be 366 or 365 depending on whether the current year is a leap year or not.
+Near the surface, for $z>-H_{\mathrm{Age}}$, ideal age is relaxed back to zero:
+
 \begin{equation}
   \label{eq:TOP-age-surface}
    \mathrm{SMS_{\mathrm{Age}}} = -\lambda_{\mathrm{Age}}A,
- \end{equation}
- where the relaxation rate $\lambda_{\mathrm{Age}}$  (units $\mathrm{s}\;^{-1}$) is specified by the \textit{namage} namelist variable \textit{rn\_age\_kill\_rate} and has a default value of 1/7200~s. Since this relaxation is applied explicitly, this relaxation rate in principle should not exceed $1/\Delta t$, where $\Delta t$ is the time step used to step forward passive tracers (2 * \textit{nn\_dttrc * rn\_rdt} when the default  leapfrog time-stepping scheme is employed).
-
- Currently the 1-dimensional reference depth of the grid boxes is used rather than the dynamically evolving depth to determine whether the age tracer is incremented or relaxed to zero. This means that the tracer only works correctly in z-coordinates. To ensure that the forcing is independent of the level thicknesses, where the tracer cell at level $k$ has its upper face $z=-depw(k)$ above the depth $-H_{\mathrm{Age}}$, but its lower face $z=-depw(k+1)$ below that depth, then the age source
- \begin{equation}
+\end{equation}
+
+where the relaxation rate $\lambda_{\mathrm{Age}}$  (units $\mathrm{s}\;^{-1}$) is specified by the \textit{namage} namelist variable \textit{rn\_age\_kill\_rate} and has a default value of 1/7200~s.
+Since this relaxation is applied explicitly, this relaxation rate in principle should not exceed $1/\Delta t$, where $\Delta t$ is the time step used to step forward passive tracers (2 * \textit{nn\_dttrc * rn\_rdt} when the default  leapfrog time-stepping scheme is employed).
+
+Currently the 1-dimensional reference depth of the grid boxes is used rather than the dynamically evolving depth to determine whether the age tracer is incremented or relaxed to zero.
+This means that the tracer only works correctly in z-coordinates.
+To ensure that the forcing is independent of the level thicknesses, where the tracer cell at level $k$ has its upper face $z=-depw(k)$ above the depth $-H_{\mathrm{Age}}$, but its lower face $z=-depw(k+1)$ below that depth, then the age source
+
+\begin{equation}
   \label{eq:TOP-age-mixed}
    \mathrm{SMS_{\mathrm{Age}}} = -f_{\mathrm{kill}}\lambda_{\mathrm{Age}}A +f_{\mathrm{add}}/T_{\mathrm{year}} ,
- \end{equation}
- where
- \begin{align}
+\end{equation}
+
+where
+
+\begin{align}
     f_{\mathrm{kill}} &= e3t_k^{-1}(H_{\mathrm{Age}} - depw(k)) , \\
     f_{\mathrm{add}} &= 1 - f_{\mathrm{kill}}.
- \end{align}
-
-
- This implementation was first used in the CORE-II intercomparison runs described e.g.\ in \citet{danabasoglu_2014}.
+\end{align}
+
+
+This implementation was first used in the CORE-II intercomparison runs described e.g.\ in \citet{danabasoglu_2014}.
 
 \subsection{Inert carbons tracer}
@@ -155,10 +180,14 @@
 
 Chlorofluorocarbons 11 and 12 (CFC-11 and CFC-12), and sulfur hexafluoride (SF6), are synthetic chemicals manufactured for industrial and domestic applications from the early 20th century onwards.
-CFC-11 (CCl$_{3}$F) is a volatile liquid at room temperature, and was widely used in refrigeration. CFC-12 (CCl$_{2}$F$_{2}$) is a gas at room temperature, and, like CFC-11, was widely used as a refrigerant,
-and additionally as an aerosol propellant. SF6 (SF$_{6}$) is also a gas at room temperature, with a range of applications based around its property as an excellent electrical insulator (often replacing more toxic alternatives).
-All three are relatively inert chemicals that are both non-toxic and non-flammable, and their wide use has led to their accumulation within the Earth's atmosphere. Large-scale production of CFC-11 and CFC-12 began in the 1930s, while production of SF6 began in the 1950s, and their atmospheric concentration time-histories are shown in Figure \ref{img_cfcatm}.
+CFC-11 (CCl$_{3}$F) is a volatile liquid at room temperature, and was widely used in refrigeration.
+CFC-12 (CCl$_{2}$F$_{2}$) is a gas at room temperature, and, like CFC-11, was widely used as a refrigerant,
+and additionally as an aerosol propellant.
+SF6 (SF$_{6}$) is also a gas at room temperature, with a range of applications based around its property as an excellent electrical insulator (often replacing more toxic alternatives).
+All three are relatively inert chemicals that are both non-toxic and non-flammable, and their wide use has led to their accumulation within the Earth's atmosphere.
+Large-scale production of CFC-11 and CFC-12 began in the 1930s, while production of SF6 began in the 1950s, and their atmospheric concentration time-histories are shown in Figure \autoref{img_cfcatm}.
 As can be seen in the figure, while the concentration of SF6 continues to rise to the present  day, the concentrations of both CFC-11 and CFC-12 have levelled off and declined since around the 1990s.
 These declines have been driven by the Montreal Protocol (effective since August 1989), which has banned the production of CFC-11 and CFC-12 (as well as other CFCs) because of their role in the depletion of
-stratospheric ozone (O$_{3}$), critical in decreasing the flux of ultraviolet radiation to the Earth's surface. Separate to this role in ozone-depletion, all three chemicals are significantly more potent greenhouse gases
+stratospheric ozone (O$_{3}$), critical in decreasing the flux of ultraviolet radiation to the Earth's surface.
+Separate to this role in ozone-depletion, all three chemicals are significantly more potent greenhouse gases
 than CO$_{2}$ (especially SF6), although their relatively low atmospheric concentrations limit their role in climate change. \\
 
@@ -171,5 +200,5 @@
 % This release began in the 1930s for CFC-11 and CFC-12, and the 1950s for SF6, and
 % regularly increasing their atmospheric concentration until the 1090s, 2000s for respectively CFC11, CFC12,
-% and is still increasing, and SF6 (see Figure \ref{img_cfcatm}).  \\
+% and is still increasing, and SF6 (see Figure \autoref{img_cfcatm}).  \\
 
 The ocean is a notable sink for all three gases, and their relatively recent occurrence in the atmosphere, coupled to the ease of making high precision measurements of their dissolved concentrations, has made them
@@ -177,8 +206,10 @@
 Because they only enter the ocean via surface air-sea exchange, and are almost completely chemically and biologically inert, their distribution within the ocean interior reveals its ventilation via transport and mixing.
 Measuring the dissolved concentrations of the gases -- as well as the mixing ratios between them -- shows circulation pathways within the ocean as well as water mass ages (i.e. the time since last contact with the
-atmosphere). This feature of the gases has made them valuable across a wide range of oceanographic problems. One use lies in ocean modelling, where they can be used to evaluate the realism of the circulation and
+atmosphere).
+This feature of the gases has made them valuable across a wide range of oceanographic problems.
+One use lies in ocean modelling, where they can be used to evaluate the realism of the circulation and
 ventilation of models, key for understanding the behaviour of wider modelled marine biogeochemistry (e.g. \citep{dutay_2002,palmieri_2015}). \\
 
-Modelling these gases (henceforth CFCs) in NEMO is done within the passive tracer transport module, TOP, using the conservation state equation \ref{Eq_tracer}
+Modelling these gases (henceforth CFCs) in NEMO is done within the passive tracer transport module, TOP, using the conservation state equation \autoref{Eq_tracer}
 
 Advection and diffusion of the CFCs in NEMO are calculated by the physical module, OPA,
@@ -198,6 +229,6 @@
 \end{eqnarray}
 
-Where $K_{w}$ is the piston velocity (in m~s$^{-1}$), as defined in Equation \ref{equ_Kw};
-$C_{sat}$ is the saturation concentration of the CFC tracer, as defined in Equation \ref{equ_C_sat};
+Where $K_{w}$ is the piston velocity (in m~s$^{-1}$), as defined in Equation \autoref{equ_Kw};
+$C_{sat}$ is the saturation concentration of the CFC tracer, as defined in Equation \autoref{equ_C_sat};
 $C_{surf}$ is the local surface concentration of the CFC tracer within the model (in mol~m$^{-3}$);
 and $f_{i}$ is the fractional sea-ice cover of the local ocean (ranging between 0.0 for ice-free ocean,
@@ -211,5 +242,5 @@
 \end{eqnarray}
 
-Where $Sol$ is the gas solubility in mol~m$^{-3}$~pptv$^{-1}$, as defined in Equation \ref{equ_Sol_CFC};
+Where $Sol$ is the gas solubility in mol~m$^{-3}$~pptv$^{-1}$, as defined in Equation \autoref{equ_Sol_CFC};
 and $P_{cfc}$ is the atmosphere concentration of the CFC (in parts per trillion by volume, pptv).
 This latter concentration is provided to the model by the historical time-series of \citet{bullister_2017}.
@@ -231,5 +262,5 @@
 $a$ is a constant re-estimated by \citet{wanninkhof_2014} to 0.251 (in $\frac{cm~h^{-1}}{(m~s^{-1})^{2}}$);
 and $u$ is the 10~m wind speed in m~s$^{-1}$ from either an atmosphere model or reanalysis atmospheric forcing.
-$Sc$ is the Schmidt number, and is calculated as follow, using coefficients from \citet{wanninkhof_2014} (see Table \ref{tab_Sc}).
+$Sc$ is the Schmidt number, and is calculated as follow, using coefficients from \citet{wanninkhof_2014} (see Table \autoref{tab_Sc}).
 
 \begin{eqnarray}
@@ -238,5 +269,5 @@
 \end{eqnarray}
 
-The solubility, $Sol$, used in Equation \ref{equ_C_sat} is calculated in mol~l$^{-1}$~atm$^{-1}$,
+The solubility, $Sol$, used in Equation \autoref{equ_C_sat} is calculated in mol~l$^{-1}$~atm$^{-1}$,
 and is specific for each gas.
 It has been experimentally estimated by \citet{warner_1985} as a function of temperature
@@ -260,13 +291,13 @@
 
 Where $T_{X}$ is $\frac{T + 273.16}{100}$, a function of temperature;
-and the $a_{x}$ and $b_{x}$ coefficients are specific for each gas (see Table \ref{tab_ref_CFC}).
+and the $a_{x}$ and $b_{x}$ coefficients are specific for each gas (see Table \autoref{tab_ref_CFC}).
 This is then converted to mol~m$^{-3}$~pptv$^{-1}$ assuming a constant atmospheric surface pressure of 1~atm.
 The solubility of CFCs thus decreases with rising $T$ while being relatively insensitive to salinity changes.
-Consequently, this translates to a pattern of solubility where it is greatest in cold, polar regions (see Figure \ref{img_cfcsol}).
+Consequently, this translates to a pattern of solubility where it is greatest in cold, polar regions (see Figure \autoref{img_cfcsol}).
 
 % AXY: not 100% sure about the units below; they might be in nanomol, or in seconds or years
 
 The standard outputs of the CFC module are seawater CFC concentrations (in mol~m$^{-3}$), the net air-sea flux (in mol~m$^{-2}$~d$^{-1}$) and the cumulative net air-sea flux (in mol~m$^{-2}$).
-Using XIOS, it is possible to obtain outputs such as the vertical integral of CFC concentrations (in mol~m$^{-2}$; see Figure \ref{img_cfcinv}).
+Using XIOS, it is possible to obtain outputs such as the vertical integral of CFC concentrations (in mol~m$^{-2}$; see Figure \autoref{img_cfcinv}).
 This property, when divided by the surface CFC concentration, estimates the local penetration depth (in m) of the CFC.
 
@@ -285,5 +316,5 @@
 
 \begin{table}[!t]
-\caption{Coefficients for fit of the CFCs solubility (Eq. \ref{equ_Sol_CFC}).}
+\caption{Coefficients for fit of the CFCs solubility (Eq. \autoref{equ_Sol_CFC}).}
 \vskip4mm
 \centering
@@ -302,5 +333,5 @@
 
 \begin{table}[!t]
-\caption{Coefficients for fit of the CFCs Schmidt number (Eq. \ref{equ_Sc}). }
+\caption{Coefficients for fit of the CFCs Schmidt number (Eq. \autoref{equ_Sc}). }
 \vskip4mm
 \centering
@@ -353,19 +384,28 @@
 %----------------------------------------------------------------------------------------------------------
 
-The C14 package implemented in NEMO by Anne Mouchet models ocean $\Dcq$. It offers several possibilities: $\Dcq$ as a physical tracer of the ocean ventilation (natural $\cq$), assessment of bomb radiocarbon uptake, as well as transient studies of paleo-historical ocean radiocarbon distributions.
+The C14 package implemented in NEMO by Anne Mouchet models ocean $\Dcq$.
+It offers several possibilities: $\Dcq$ as a physical tracer of the ocean ventilation (natural $\cq$), assessment of bomb radiocarbon uptake, as well as transient studies of paleo-historical ocean radiocarbon distributions.
 
 \subsubsection{Method}
 
- Let  $\Rq$ represent the ratio of $\cq$ atoms to the total number of carbon atoms in the sample, i.e. $\cq/\mathrm{C}$. Then, radiocarbon anomalies are reported as
+Let  $\Rq$ represent the ratio of $\cq$ atoms to the total number of carbon atoms in the sample, i.e. $\cq/\mathrm{C}$.
+Then, radiocarbon anomalies are reported as
+
 \begin{equation}
 \Dcq = \left( \frac{\Rq}{\Rq_\mathrm{ref}} - 1 \right) 10^3, \label{eq:c14dcq}
 \end{equation}
-where $\Rq_{\textrm{ref}}$ is a reference ratio. For the purpose of ocean ventilation studies $\Rq_{\textrm{ref}}$ is set to one.
+
+where $\Rq_{\textrm{ref}}$ is a reference ratio.
+For the purpose of ocean ventilation studies $\Rq_{\textrm{ref}}$ is set to one.
 
 Here we adopt the approach of \cite{fiadeiro_1982} and \cite{toggweiler_1989a,toggweiler_1989b} in which  the ratio $\Rq$ is transported rather than the individual concentrations C and $\cq$.
-This approach calls for a strong assumption, i.e., that of a homogeneous and constant dissolved inorganic carbon (DIC) field \citep{toggweiler_1989a,mouchet_2013}. While in terms of
-oceanic $\Dcq$, it yields similar results to approaches involving carbonate chemistry, it underestimates the bomb radiocarbon inventory because it assumes a constant air-sea $\cd$ disequilibrium (Mouchet, 2013). Yet, field reconstructions of the ocean bomb $\cq$ inventory are also biased low \citep{naegler_2009} since they assume that the anthropogenic perturbation did not affect ocean DIC since the pre-bomb epoch. For these reasons, bomb $\cq$ inventories obtained with the present method are directly comparable to reconstructions based on field measurements.
-
-This simplified approach also neglects the effects of fractionation (e.g.,  air-sea exchange) and of biological processes. Previous studies by \cite{bacastow_1990} and \cite{joos_1997} resulted in nearly identical $\Dcq$ distributions among experiments considering biology or not.
+This approach calls for a strong assumption, i.e., that of a homogeneous and constant dissolved inorganic carbon (DIC) field \citep{toggweiler_1989a,mouchet_2013}.
+While in terms of
+oceanic $\Dcq$, it yields similar results to approaches involving carbonate chemistry, it underestimates the bomb radiocarbon inventory because it assumes a constant air-sea $\cd$ disequilibrium (Mouchet, 2013).
+Yet, field reconstructions of the ocean bomb $\cq$ inventory are also biased low \citep{naegler_2009} since they assume that the anthropogenic perturbation did not affect ocean DIC since the pre-bomb epoch.
+For these reasons, bomb $\cq$ inventories obtained with the present method are directly comparable to reconstructions based on field measurements.
+
+This simplified approach also neglects the effects of fractionation (e.g.,  air-sea exchange) and of biological processes.
+Previous studies by \cite{bacastow_1990} and \cite{joos_1997} resulted in nearly identical $\Dcq$ distributions among experiments considering biology or not.
 Since observed $\Rq$ ratios are corrected for the isotopic fractionation when converted to the standard $\Dcq$ notation \citep{stuiver_1977} the model results are directly comparable to observations.
 
@@ -373,28 +413,37 @@
 
 The equation governing the transport of $\Rq$  in the ocean is
+
 \begin{equation}
 \frac{\partial}{\partial t} {\Rq} =  - \bigtriangledown \cdot ( \mathbf{u} \Rq - \mathbf{K} \cdot \bigtriangledown \Rq )  - \lambda \Rq, \label{eq:quick}
 \end{equation}
+
 where $\lambda$ is the radiocarbon decay rate, ${\mathbf{u}}$ the 3-D velocity field, and $\mathbf{K}$ the diffusivity tensor.
 
-At the air-sea interface a Robin boundary condition \citep{haine_2006} is applied to \eqref{eq:quick}, i.e., the flux
+At the air-sea interface a Robin boundary condition \citep{haine_2006} is applied to \autoref{eq:quick}, i.e., the flux
 through the interface is proportional to the difference in the ratios between
 the ocean and the atmosphere
+
 \begin{equation}
 \mathcal{\!F} =  \kappa_{R}  (\Rq  - \Rq_{a} ), \label{eq:BCR}
 \end{equation}
-where $\mathcal{\!F}$ is the flux out of the ocean, and $\Rq_{a}$ is the atmospheric $\cq/\mathrm{C}$ ratio. The transfer velocity $ \kappa_{R} $ for the radiocarbon ratio in \eqref{eq:BCR} is computed as
+
+where $\mathcal{\!F}$ is the flux out of the ocean, and $\Rq_{a}$ is the atmospheric $\cq/\mathrm{C}$ ratio.
+The transfer velocity $ \kappa_{R} $ for the radiocarbon ratio in \autoref{eq:BCR} is computed as
+
 \begin{equation}
  \kappa_{R} =  \frac{\kappa_{\cd} K_0}{\overline{\Ct}} \, \pacd   \label{eq:Rspeed}
 \end{equation}
+
 with $\kappa_{\cd}$ the carbon dioxide transfer or piston velocity, $K_0$ the $\cd$ solubility in seawater, $\pacd$ the atmospheric $\cd$ pressure at sea level, and $\overline{\Ct}$ the average sea-surface dissolved inorganic carbon concentration.
 
-
-The $\cd$ transfer velocity is based on the empirical formulation of \cite{wanninkhof_1992} with chemical enhancement \citep{wanninkhof_1996,wanninkhof_2014}. The original formulation is modified to account for the reduction of the  air-sea exchange rate in the presence of sea ice. Hence
+The $\cd$ transfer velocity is based on the empirical formulation of \cite{wanninkhof_1992} with chemical enhancement \citep{wanninkhof_1996,wanninkhof_2014}.
+The original formulation is modified to account for the reduction of the  air-sea exchange rate in the presence of sea ice.
+Hence
+
 \begin{equation}
 \kappa_\cd=\left( K_W\,\mathrm{w}^2 + b  \right)\, (1-f_\mathrm{ice})\,\sqrt{660/Sc}, \label{eq:wanc14}
 \end{equation}
 with $\mathrm{w}$ the wind magnitude, $f_\mathrm{ice}$ the fractional ice cover, and $Sc$ the Schmidt number.
-$K_W$ in \eqref{eq:wanc14} is an empirical coefficient with dimension of an inverse velocity.
+$K_W$ in \autoref{eq:wanc14} is an empirical coefficient with dimension of an inverse velocity.
 The chemical enhancement term $b$ is represented as a function of temperature $T$ \citep{wanninkhof_1992}
 \begin{equation}
@@ -402,5 +451,5 @@
 \end{equation}
 
-%We compare the results of equilibrium and transient experiments obtained with both methods in section \ref{sec:UNDEU}.
+%We compare the results of equilibrium and transient experiments obtained with both methods in section \autoref{sec:UNDEU}.
 
 %
@@ -413,35 +462,41 @@
 \label{sec:param}
  %
-The radiocarbon decay rate (\CODE{rlam14}; in \texttt{trcnam\_c14} module) is set to $\lambda=(1/8267)$ yr$^{-1}$ \citep{stuiver_1977}, which corresponds to a half-life of 5730 yr.\\[1pt]
-%
-The Schmidt number $Sc$, Eq. \eqref{eq:wanc14}, is calculated with the help of the formulation of \cite{wanninkhof_2014}. The $\cd$ solubility $K_0$ in \eqref{eq:Rspeed} is taken from \cite{weiss_1974}. $K_0$ and $Sc$ are computed with the OGCM temperature and salinity fields (\texttt{trcsms\_c14} module).\\[1pt]
+The radiocarbon decay rate (\forcode{rlam14}; in \texttt{trcnam\_c14} module) is set to $\lambda=(1/8267)$ yr$^{-1}$ \citep{stuiver_1977}, which corresponds to a half-life of 5730 yr.\\[1pt]
+%
+The Schmidt number $Sc$, Eq. \autoref{eq:wanc14}, is calculated with the help of the formulation of \cite{wanninkhof_2014}.
+The $\cd$ solubility $K_0$ in \autoref{eq:Rspeed} is taken from \cite{weiss_1974}. $K_0$ and $Sc$ are computed with the OGCM temperature and salinity fields (\texttt{trcsms\_c14} module).\\[1pt]
 %
 The following parameters intervening in the air-sea exchange rate are set in \texttt{namelist\_c14}:
+
 \begin{itemize}
-\item The reference DIC concentration $\overline{\Ct}$ (\CODE{xdicsur}) intervening in \eqref{eq:Rspeed} is classically set to 2 mol m$^{-3}$ \citep{toggweiler_1989a,orr_2001,butzin_2005}.
-%
-\item The value of the empirical coefficient $K_W$ (\CODE{xkwind}) in \eqref{eq:wanc14} depends on the wind field and on the model upper ocean mixing rate \citep{toggweiler_1989a,wanninkhof_1992,naegler_2009,wanninkhof_2014}.
+\item The reference DIC concentration $\overline{\Ct}$ (\forcode{xdicsur}) intervening in \autoref{eq:Rspeed} is classically set to 2 mol m$^{-3}$ \citep{toggweiler_1989a,orr_2001,butzin_2005}.
+%
+\item The value of the empirical coefficient $K_W$ (\forcode{xkwind}) in \autoref{eq:wanc14} depends on the wind field and on the model upper ocean mixing rate \citep{toggweiler_1989a,wanninkhof_1992,naegler_2009,wanninkhof_2014}.
 It should be adjusted so that the globally averaged $\cd$ piston velocity is $\kappa_\cd = 16.5\pm 3.2$ cm/h \citep{naegler_2009}.
-%The sensitivity to this parametrization is discussed in section \ref{sec:result}.
-%
-\item Chemical enhancement (term $b$  in Eq. \ref{eq:wanchem}) may be set on/off by means of the logical variable \CODE{ln\_chemh}.
+%The sensitivity to this parametrization is discussed in section \autoref{sec:result}.
+%
+\item Chemical enhancement (term $b$  in Eq. \autoref{eq:wanchem}) may be set on/off by means of the logical variable \forcode{ln\_chemh}.
 \end{itemize}
 
 %
 \paragraph{Experiment type}
-The type of experiment is determined by the value given to \CODE{kc14typ} in \texttt{namelist\_c14}. There are three possibilities:
+The type of experiment is determined by the value given to \forcode{kc14typ} in \texttt{namelist\_c14}.
+There are three possibilities:
+
 \begin{enumerate}
-\item natural $\Dcq$: \CODE{kc14typ}=0
-\item bomb $\Dcq$: \CODE{kc14typ}=1
-\item transient paleo-historical $\Dcq$: \CODE{kc14typ}=2
+\item natural                    $\Dcq$: \forcode{kc14typ}=0
+\item bomb                       $\Dcq$: \forcode{kc14typ}=1
+\item transient paleo-historical $\Dcq$: \forcode{kc14typ}=2
 \end{enumerate}
-%
+
+% 
 \textbf{Natural or Equilibrium radiocarbon}
-\CODE{kc14typ}=0
-
-Unless otherwise specified in \texttt{namelist\_c14}, the atmospheric $\Rq_a$ (\CODE{rc14at}) is set to one, the atmospheric $\cd$ (\CODE{pco2at}) to 280 ppm, and the ocean $\Rq$ is initialized with \CODE{rc14init=0.85}, i.e., $\Dcq=$-150\textperthousand  \cite[typical for deep-ocean, Fig 6 in][]{key_2004}.
-
-Equilibrium experiment should last until 98\% of the ocean volume exhibit a drift of less than 0.001\textperthousand/year \citep{orr_2000}; this is usually achieved after few kyr (Fig. \ref{fig:drift}).
-%
+\forcode{kc14typ}=0
+
+Unless otherwise specified in \texttt{namelist\_c14}, the atmospheric $\Rq_a$ (\forcode{rc14at}) is set to one, the atmospheric $\cd$ (\forcode{pco2at}) to 280 ppm, and the ocean $\Rq$ is initialized with \forcode{rc14init=0.85}, i.e., $\Dcq=$-150\textperthousand \cite[typical for deep-ocean, Fig 6 in][]{key_2004}.
+
+Equilibrium experiment should last until 98\% of the ocean volume exhibit a drift of less than 0.001\textperthousand/year \citep{orr_2000}; this is usually achieved after few kyr (Fig. \autoref{fig:drift}).
+%
+
 \begin{figure}[!h]
 \begin{center}
@@ -449,10 +504,12 @@
 \end{center}
 \vspace{-4ex}
-\caption{ Time evolution of $\Rq$ inventory anomaly for equilibrium run with homogeneous ocean initial state. The anomaly (or drift) is given in \%  change in total ocean inventory per 50 years. Time on x-axis is in simulation year.\label{fig:drift} }
+\caption{ Time evolution of $\Rq$ inventory anomaly for equilibrium run with homogeneous ocean initial state.
+The anomaly (or drift) is given in \%  change in total ocean inventory per 50 years.
+Time on x-axis is in simulation year.\label{fig:drift} }
 \end{figure}
 
 \textbf{Transient: Bomb}
 \label{sec:bomb}
-\CODE{kc14typ}=1
+\forcode{kc14typ}=1
 
 \begin{figure}[!h]
@@ -461,27 +518,35 @@
 \end{center}
 \vspace{-4ex}
-\caption{Atmospheric $\Dcq$ (solid; left axis) and $\cd$ (dashed; right axis)  forcing for the $\cq$-bomb experiments. The $\Dcq$ is illustrated for the three zonal bands (upper, middle, and lower curves correspond to latitudes $> 20$N, $\in [20\mathrm{S},20\mathrm{N}]$, and $< 20$S, respectively.} \label{fig:bomb}
+\caption{Atmospheric $\Dcq$ (solid; left axis) and $\cd$ (dashed; right axis)  forcing for the $\cq$-bomb experiments.
+The $\Dcq$ is illustrated for the three zonal bands (upper, middle, and lower curves correspond to latitudes $> 20$N, $\in [20\mathrm{S},20\mathrm{N}]$, and $< 20$S, respectively.} \label{fig:bomb}
 \end{figure}
 
-Performing this type of experiment requires that a pre-industrial equilibrium run be performed beforehand (\CODE{ln\_rsttr} should be set to \texttt{.TRUE.}).
-
-An exception to this rule is when wishing to perform a perturbation bomb experiment as was possible with the package \texttt{C14b}. It is still possible to easily set-up that type of transient experiment for which no previous run is needed.  In addition to the instructions as given in this section it is however necessary to adapt the \texttt{atmc14.dat} file so that it does no longer contain any negative $\Dcq$ values (Suess effect in the pre-bomb period).
-
-The model  is integrated from a given initial date following the observed records provided from 1765 AD on ( Fig. \ref{fig:bomb}).
-The file \texttt{atmc14.dat}  \cite[][\& I. Levin, personal comm.]{enting_1994} provides atmospheric $\Dcq$ for three latitudinal bands: 90S-20S,    20S-20N \&    20N-90N.
-Atmospheric $\cd$ in the file \texttt{splco2.dat} is obtained from a spline fit through ice core data and direct atmospheric measurements \cite[][\& J. Orr, personal comm.]{orr_2000}.
+Performing this type of experiment requires that a pre-industrial equilibrium run be performed beforehand (\forcode{ln\_rsttr} should be set to \texttt{.TRUE.}).
+
+An exception to this rule is when wishing to perform a perturbation bomb experiment as was possible with the package \texttt{C14b}.
+It is still possible to easily set-up that type of transient experiment for which no previous run is needed.
+In addition to the instructions as given in this section it is however necessary to adapt the \texttt{atmc14.dat} file so that it does no longer contain any negative $\Dcq$ values (Suess effect in the pre-bomb period).
+
+The model  is integrated from a given initial date following the observed records provided from 1765 AD on ( Fig. \autoref{fig:bomb}).
+The file \texttt{atmc14.dat}  \cite[][\& I.
+Levin, personal comm.]{enting_1994} provides atmospheric $\Dcq$ for three latitudinal bands: 90S-20S,    20S-20N \&    20N-90N.
+Atmospheric $\cd$ in the file \texttt{splco2.dat} is obtained from a spline fit through ice core data and direct atmospheric measurements \cite[][\& J.
+Orr, personal comm.]{orr_2000}.
 Dates in these forcing files are expressed as yr AD.
 
 To ensure that the atmospheric forcing is applied properly as well as that output files contain consistent dates and inventories the experiment should be set up carefully:
+
 \begin{itemize}
-\item Specify the starting date of the experiment: \CODE{nn\_date0} in \texttt{namelist}.  \CODE{nn\_date0} is written as Year0101 where Year may take any positive value (AD).
-\item Then the parameters \CODE{nn\_rstctl} in  \texttt{namelist} (on-line) and \CODE{nn\_rsttr} in \texttt{namelist\_top} (off-line)  must be \textbf{set to 0} at the start of the experiment (force the date to \CODE{nn\_date0} for the \textbf{first} experiment year).
-\item These two parameters (\CODE{nn\_rstctl} and \CODE{nn\_rsttr}) have then to be \textbf{set to 2} for the following years (the date must be read in the restart file).
+\item Specify the starting date of the experiment: \forcode{nn\_date0} in \texttt{namelist}.  \forcode{nn\_date0} is written as Year0101 where Year may take any positive value (AD).
+\item Then the parameters \forcode{nn\_rstctl} in  \texttt{namelist} (on-line) and \forcode{nn\_rsttr} in \texttt{namelist\_top} (off-line)  must be \textbf{set to 0} at the start of the experiment (force the date to \forcode{nn\_date0} for the \textbf{first} experiment year).
+\item These two parameters (\forcode{nn\_rstctl} and \forcode{nn\_rsttr}) have then to be \textbf{set to 2} for the following years (the date must be read in the restart file).
 \end{itemize}
- If the experiment date is outside the data time span then the first or last atmospheric concentrations are prescribed depending on whether the date is earlier or later. Note that \CODE{tyrc14\_beg} (\texttt{namelist\_c14}) is not used in this context.
+
+If the experiment date is outside the data time span then the first or last atmospheric concentrations are prescribed depending on whether the date is earlier or later.
+Note that \forcode{tyrc14\_beg} (\texttt{namelist\_c14}) is not used in this context.
 
 %
 \textbf{Transient: Past}
-\CODE{kc14typ}=2
+\forcode{kc14typ}=2
 %
 \begin{figure}[!h]
@@ -490,43 +555,52 @@
 \end{center}
 \vspace{-4ex}
-\caption{Atmospheric $\Dcq$ (solid) and $\cd$ (dashed)  forcing for the Paleo experiments. The $\cd$ scale is given on the right axis.} \label{fig:paleo}
+\caption{Atmospheric $\Dcq$ (solid) and $\cd$ (dashed)  forcing for the Paleo experiments.
+The $\cd$ scale is given on the right axis.} \label{fig:paleo}
 \end{figure}
 
-This experiment type does not need a previous equilibrium run. It should start 5--6 kyr earlier than the period to be analyzed.
-Atmospheric $\Rq_a$ and $\cd$ are prescribed from forcing files. The ocean $\Rq$ is initialized with the value attributed to \CODE{rc14init} in \texttt{namelist\_c14}.
+This experiment type does not need a previous equilibrium run.
+It should start 5--6 kyr earlier than the period to be analyzed.
+Atmospheric $\Rq_a$ and $\cd$ are prescribed from forcing files.
+The ocean $\Rq$ is initialized with the value attributed to \forcode{rc14init} in \texttt{namelist\_c14}.
 
 The file \texttt{intcal13.14c} \citep{reimer_2013} contains atmospheric $\Dcq$ from 0 to 50 kyr cal BP\footnote{cal BP: number of years before 1950 AD}.
-The $\cd$ forcing is provided in file \texttt{ByrdEdcCO2.txt}. The content of this file is based on  the high resolution record from EPICA Dome C \citep{monnin_2004} for the Holocene and the Transition, and on Byrd Ice Core CO2 Data for 20--90 kyr BP  \citep{ahn_2008}. These atmospheric values are reproduced in Fig. \ref{fig:paleo}. Dates in these files are expressed as yr BP.
+The $\cd$ forcing is provided in file \texttt{ByrdEdcCO2.txt}.
+The content of this file is based on  the high resolution record from EPICA Dome C \citep{monnin_2004} for the Holocene and the Transition, and on Byrd Ice Core CO2 Data for 20--90 kyr BP  \citep{ahn_2008}.
+These atmospheric values are reproduced in Fig. \autoref{fig:paleo}.
+Dates in these files are expressed as yr BP.
 
 To ensure that the atmospheric forcing is applied properly as well as that output files contain consistent dates and inventories the experiment should be set up carefully.
-The true experiment starting date is given by \CODE{tyrc14\_beg} (in yr BP) in \texttt{namelist\_c14}. In consequence, \CODE{nn\_date0} in \texttt{namelist} MUST be set to 00010101.\\
-Then the parameters \CODE{nn\_rstctl} in  \texttt{namelist} (on-line) and \CODE{nn\_rsttr} in \texttt{namelist\_top} (off-line)  must be set to 0 at the start of the experiment (force the date to \CODE{nn\_date0} for the first experiment year). These two parameters have then to be set to 2 for the following years (read the date in the restart file). \\
- If the experiment date is outside the data time span then the first or last atmospheric concentrations are prescribed depending on whether the date is earlier or later.
+The true experiment starting date is given by \forcode{tyrc14\_beg} (in yr BP) in \texttt{namelist\_c14}.
+In consequence, \forcode{nn\_date0} in \texttt{namelist} MUST be set to 00010101.\\
+Then the parameters \forcode{nn\_rstctl} in  \texttt{namelist} (on-line) and \forcode{nn\_rsttr} in \texttt{namelist\_top} (off-line)  must be set to 0 at the start of the experiment (force the date to \forcode{nn\_date0} for the first experiment year).
+These two parameters have then to be set to 2 for the following years (read the date in the restart file). \\
+If the experiment date is outside the data time span then the first or last atmospheric concentrations are prescribed depending on whether the date is earlier or later.
 
 %
 \paragraph{Model output}
 \label{sec:output}
-All output fields in Table \ref{tab:out} are routinely computed. It depends on the actual settings in \texttt{iodef.xml} whether they are stored or not.
+
+All output fields in Table \autoref{tab:out} are routinely computed.
+It depends on the actual settings in \texttt{iodef.xml} whether they are stored or not.
 %
 \begin{table}[!h]
 \begin{center}
-\caption{Standard output fields for the C14 package \label{tab:out}.
-}
+\caption{Standard output fields for the C14 package \label{tab:out}.}
 %\begin{small}
 \renewcommand{\arraystretch}{1.3}%
 \begin{tabular}[h]{|l*{3}{|c}|l|}
 \hline
-Field & Type & Dim & Units & Description \\ \hline
-RC14 & ptrc & 3-D & -        & Radiocarbon ratio \\
-DeltaC14 & diad & 3-D & \textperthousand & $\Dcq$\\
-C14Age & diad & 3-D & yr &   Radiocarbon age \\
-RAge & diad & 2-D & yr & Reservoir age\\
-qtr\_c14 &  diad & 2-D & m$^{-2}$ yr$^{-1}$ & Air-to-sea net $\Rq$ flux\\
-qint\_c14 & diad & 2-D &   m$^{-2}$ &  Cumulative air-to-sea $\Rq$ flux \\
-AtmCO2 & scalar & 0-D & ppm & Global atmospheric $\cd$ \\
-AtmC14 & scalar & 0-D & \textperthousand  & Global atmospheric $\Dcq$\\
-K\_CO2 & scalar & 0-D & cm h$^{-1}$  & Global $\cd$ piston velocity ($ \overline{\kappa_{\cd}}$) \\
-K\_C14 & scalar & 0-D &m yr$^{-1}$ & Global $\Rq$ transfer velocity  ($ \overline{\kappa_R}$)\\
-C14Inv & scalar & 0-D & $10^{26}$ atoms & Ocean radiocarbon inventory \\ \hline
+Field     & Type   & Dim & Units              & Description                                               \\ \hline
+RC14      & ptrc   & 3-D & -                  & Radiocarbon ratio                                         \\
+DeltaC14  & diad   & 3-D & \textperthousand   & $\Dcq$                                                    \\
+C14Age    & diad   & 3-D & yr                 & Radiocarbon age                                           \\
+RAge      & diad   & 2-D & yr                 & Reservoir age                                             \\
+qtr\_c14  & diad   & 2-D & m$^{-2}$ yr$^{-1}$ & Air-to-sea net $\Rq$ flux                                 \\
+qint\_c14 & diad   & 2-D & m$^{-2}$           & Cumulative air-to-sea $\Rq$ flux                          \\
+AtmCO2    & scalar & 0-D & ppm                & Global atmospheric $\cd$                                  \\
+AtmC14    & scalar & 0-D & \textperthousand   & Global atmospheric $\Dcq$                                 \\
+K\_CO2    & scalar & 0-D & cm h$^{-1}$        & Global $\cd$ piston velocity ($ \overline{\kappa_{\cd}}$) \\
+K\_C14    & scalar & 0-D & m yr$^{-1}$        & Global $\Rq$ transfer velocity  ($ \overline{\kappa_R}$)  \\
+C14Inv    & scalar & 0-D & $10^{26}$ atoms    & Ocean radiocarbon inventory                               \\ \hline
 \end{tabular}
 %\end{small}
@@ -539,20 +613,30 @@
 The radiocarbon age is computed as  $(-1/\lambda) \ln{ \left( \Rq \right)}$, with zero age corresponding to $\Rq=1$.
 
-The reservoir age is the age difference between the ocean uppermost layer and the atmosphere. It is usually reported as conventional radiocarbon age; i.e., computed by means of the Libby radiocarbon mean life \cite[8033 yr;][]{stuiver_1977}
+The reservoir age is the age difference between the ocean uppermost layer and the atmosphere.
+It is usually reported as conventional radiocarbon age; i.e., computed by means of the Libby radiocarbon mean life \cite[8033 yr;][]{stuiver_1977}
+
 \begin{align}
 {^{14}\tau_\mathrm{c}}= -8033 \; \ln \left(1 + \frac{\Dcq}{10^3}\right), \label{eq:convage}
 \end{align}
-where ${^{14}\tau_\mathrm{c}}$ is expressed in years B.P. Here we do not use that convention and compute reservoir ages with the mean lifetime $1/\lambda$. Conversion from one scale to the other is readily performed. The conventional radiocarbon age is lower than the radiocarbon age by $\simeq3\%$.
+
+where ${^{14}\tau_\mathrm{c}}$ is expressed in years B.P.
+Here we do not use that convention and compute reservoir ages with the mean lifetime $1/\lambda$.
+Conversion from one scale to the other is readily performed.
+The conventional radiocarbon age is lower than the radiocarbon age by $\simeq3\%$.
 
 The ocean radiocarbon  inventory is computed as
+
 \begin{equation}
 N_A \Rq_\mathrm{oxa} \overline{\Ct} \left( \int_\Omega \Rq d\Omega \right) /10^{26}, \label{eq:inv}
 \end{equation}
-where $N_A$ is the Avogadro's number ($N_A=6.022\times10^{23}$ at/mol), $\Rq_\mathrm{oxa}$ is the oxalic acid radiocarbon standard \cite[$\Rq_\mathrm{oxa}=1.176\times10^{-12}$;][]{stuiver_1977}, and $\Omega$ is the ocean volume.  Bomb $\cq$ inventories are traditionally reported in units of $10^{26}$ atoms, hence the denominator in \eqref{eq:inv}.
-
-All transformations from second to year, and inversely, are performed with the help of the physical constant \CODE{rsiyea} the sideral year length expressed in seconds\footnote{The variable (\CODE{nyear\_len}) which reports the length in days of the previous/current/future year (see \textrm{oce\_trc.F90}) is not a constant. }.
+
+where $N_A$ is the Avogadro's number ($N_A=6.022\times10^{23}$ at/mol), $\Rq_\mathrm{oxa}$ is the oxalic acid radiocarbon standard \cite[$\Rq_\mathrm{oxa}=1.176\times10^{-12}$;][]{stuiver_1977}, and $\Omega$ is the ocean volume.
+Bomb $\cq$ inventories are traditionally reported in units of $10^{26}$ atoms, hence the denominator in \autoref{eq:inv}.
+
+All transformations from second to year, and inversely, are performed with the help of the physical constant \forcode{rsiyea} the sideral year length expressed in seconds\footnote{The variable (\forcode{nyear\_len}) which reports the length in days of the previous/current/future year (see \textrm{oce\_trc.F90}) is not a constant. }.
 
 The global transfer velocities represent time-averaged\footnote{the actual duration is set in \texttt{iodef.xml}} global integrals of the transfer rates:
- \begin{equation}
+
+\begin{equation}
  \overline{\kappa_{\cd}}= \int_\mathcal{S} \kappa_{\cd} d\mathcal{S}  \text{ and } \overline{\kappa_R}= \int_\mathcal{S} \kappa_R d\mathcal{S}
 \end{equation}
@@ -561,19 +645,41 @@
 \subsection{PISCES biogeochemical model}
 
-PISCES is a biogeochemical model which simulates the lower trophic levels of marine ecosystem (phytoplankton, microzooplankton and mesozooplankton) and the biogeochemical cycles of carbonand of the main nutrients (P, N, Fe, and Si). The  model is intended to be used for both regional and global configurations at high or low spatial resolutions as well as for  short-term (seasonal, interannual) and long-term (climate change, paleoceanography) analyses.
+PISCES is a biogeochemical model which simulates the lower trophic levels of marine ecosystem (phytoplankton, microzooplankton and mesozooplankton) and the biogeochemical cycles of carbonand of the main nutrients (P, N, Fe, and Si).
+The  model is intended to be used for both regional and global configurations at high or low spatial resolutions as well as for  short-term (seasonal, interannual) and long-term (climate change, paleoceanography) analyses.
 Two versions of PISCES are available in NEMO v4.0 :
 
-PISCES-v2, by setting in namelist\_pisces\_ref  \np{ln\_p4z} to true,  can be seen as one of the many Monod models \citep{monod_1958}. It assumes a constant Redfield ratio and phytoplankton growth depends on the external concentration in nutrients. There are twenty-four prognostic variables (tracers) including two phytoplankton compartments  (diatoms and nanophytoplankton), two zooplankton size-classes (microzooplankton and  mesozooplankton) and a description of the carbonate chemistry. Formulations in PISCES-v2 are based on a mixed Monod/Quota formalism: On one hand, stoichiometry of C/N/P is fixed and growth rate of phytoplankton is limited by the external availability in N, P and Si. On the other hand, the iron and silicium quotas are variable and growth rate of phytoplankton is limited by the internal availability in Fe. Various parameterizations can be activated in PISCES-v2, setting for instance the complexity of iron chemistry or the description of particulate organic materials.
-
-PISCES-QUOTA has been built on the PISCES-v2 model described in \citet{aumont_2015}. PISCES-QUOTA has thirty-nine prognostic compartments. Phytoplankton growth can be controlled by five modeled limiting nutrients: Nitrate and Ammonium, Phosphate, Silicate and Iron. Five living compartments are represented: Three phytoplankton size classes/groups corresponding to picophytoplankton, nanophytoplankton and diatoms, and two zooplankton size classes which are microzooplankton and mesozooplankton. For phytoplankton, the prognostic variables are the carbon, nitrogen, phosphorus,  iron, chlorophyll and silicon biomasses (the latter only for diatoms). This means that the N/C, P/C, Fe/C and Chl/C ratios of both phytoplankton groups as well as the Si/C ratio of diatoms are prognostically predicted  by the model. Zooplankton are assumed to be strictly homeostatic \citep[e.g.,][]{sterner_2003,woods_2013,meunier_2014}. As a consequence, the C/N/P/Fe ratios of these groups are maintained constant and are not allowed to vary. In PISCES, the Redfield ratios C/N/P are set to 122/16/1 \citep{takahashi_1985} and the -O/C ratio is set to 1.34 \citep{kortzinger_2001}. No silicified zooplankton is assumed. The bacterial pool is not yet explicitly modeled.
-
-There are three non-living compartments: Semi-labile dissolved organic matter, small sinking particles, and large sinking particles. As a consequence of the variable stoichiometric ratios of phytoplankton and of the stoichiometric regulation of zooplankton, elemental ratios in organic matter cannot be supposed constant anymore as that was the case in PISCES-v2. Indeed, the nitrogen, phosphorus, iron, silicon and calcite pools of the particles are now all explicitly modeled. The sinking speed of the particles is not altered by their content in calcite and biogenic silicate (''The ballast effect'', \citep{honjo_1996,armstrong_2001}). The latter particles are assumed to sink at the same speed as the large organic matter particles. All the non-living compartments experience aggregation due to turbulence and differential settling as well as Brownian coagulation for DOM.
-
+PISCES-v2, by setting in namelist\_pisces\_ref  \np{ln\_p4z} to true,  can be seen as one of the many Monod models \citep{monod_1958}.
+It assumes a constant Redfield ratio and phytoplankton growth depends on the external concentration in nutrients.
+There are twenty-four prognostic variables (tracers) including two phytoplankton compartments  (diatoms and nanophytoplankton), two zooplankton size-classes (microzooplankton and  mesozooplankton) and a description of the carbonate chemistry.
+Formulations in PISCES-v2 are based on a mixed Monod/Quota formalism: On one hand, stoichiometry of C/N/P is fixed and growth rate of phytoplankton is limited by the external availability in N, P and Si.
+On the other hand, the iron and silicium quotas are variable and growth rate of phytoplankton is limited by the internal availability in Fe.
+Various parameterizations can be activated in PISCES-v2, setting for instance the complexity of iron chemistry or the description of particulate organic materials.
+
+PISCES-QUOTA has been built on the PISCES-v2 model described in \citet{aumont_2015}.
+PISCES-QUOTA has thirty-nine prognostic compartments.
+Phytoplankton growth can be controlled by five modeled limiting nutrients: Nitrate and Ammonium, Phosphate, Silicate and Iron.
+Five living compartments are represented: Three phytoplankton size classes/groups corresponding to picophytoplankton, nanophytoplankton and diatoms, and two zooplankton size classes which are microzooplankton and mesozooplankton.
+For phytoplankton, the prognostic variables are the carbon, nitrogen, phosphorus,  iron, chlorophyll and silicon biomasses (the latter only for diatoms).
+This means that the N/C, P/C, Fe/C and Chl/C ratios of both phytoplankton groups as well as the Si/C ratio of diatoms are prognostically predicted  by the model.
+Zooplankton are assumed to be strictly homeostatic \citep[e.g.,][]{sterner_2003,woods_2013,meunier_2014}.
+As a consequence, the C/N/P/Fe ratios of these groups are maintained constant and are not allowed to vary.
+In PISCES, the Redfield ratios C/N/P are set to 122/16/1 \citep{takahashi_1985} and the -O/C ratio is set to 1.34 \citep{kortzinger_2001}.
+No silicified zooplankton is assumed.
+The bacterial pool is not yet explicitly modeled.
+
+There are three non-living compartments: Semi-labile dissolved organic matter, small sinking particles, and large sinking particles.
+As a consequence of the variable stoichiometric ratios of phytoplankton and of the stoichiometric regulation of zooplankton, elemental ratios in organic matter cannot be supposed constant anymore as that was the case in PISCES-v2.
+Indeed, the nitrogen, phosphorus, iron, silicon and calcite pools of the particles are now all explicitly modeled.
+The sinking speed of the particles is not altered by their content in calcite and biogenic silicate (''The ballast effect'', \citep{honjo_1996,armstrong_2001}).
+The latter particles are assumed to sink at the same speed as the large organic matter particles.
+All the non-living compartments experience aggregation due to turbulence and differential settling as well as Brownian coagulation for DOM.
 
 \subsection{MY\_TRC interface for coupling external BGC models}
 \label{Mytrc}
 
-The NEMO-TOP has only one built-in biogeochemical model - PISCES - but there are several BGC models - MEDUSA, ERSEM, BFM or ECO3M - which are meant to be coupled with the NEMO dynamics. Therefore it was necessary to provide to the users a framework for easily add their own BGCM model, that can be a single passive tracer.
-The generalized interface is pivoted on MY\_TRC module that contains template files to build the coupling between NEMO and any external BGC model. The call to MY\_TRC is activated by setting  \textit{ln\_my\_trc} = \texttt{.true.} in namelist \textit{namtrc}
+The NEMO-TOP has only one built-in biogeochemical model - PISCES - but there are several BGC models - MEDUSA, ERSEM, BFM or ECO3M - which are meant to be coupled with the NEMO dynamics.
+Therefore it was necessary to provide to the users a framework for easily add their own BGCM model, that can be a single passive tracer.
+The generalized interface is pivoted on MY\_TRC module that contains template files to build the coupling between NEMO and any external BGC model.
+The call to MY\_TRC is activated by setting  \textit{ln\_my\_trc} = \texttt{.true.} in namelist \textit{namtrc}
 
 The following 6 fortran files are available in MY\_TRC with the specific purposes here described.
@@ -581,11 +687,15 @@
 \begin{itemize}
    \item \textit{par\_my\_trc.F90} :  This module allows to define additional arrays and public variables to be used within the MY\_TRC interface
-   \item \textit{trcini\_my\_trc.F90} :  Here are initialized user defined namelists and the call to the external BGC model initialization procedures to populate general tracer array (trn and trb). Here are also likely to be defined suport arrays related to system metrics that could be needed by the BGC model.
+   \item \textit{trcini\_my\_trc.F90} :  Here are initialized user defined namelists and the call to the external BGC model initialization procedures to populate general tracer array (trn and trb).
+Here are also likely to be defined suport arrays related to system metrics that could be needed by the BGC model.
   \item \textit{trcnam\_my\_trc.F90} :  This routine is called at the beginning of trcini\_my\_trc and should contain the initialization of additional namelists for the BGC model or user-defined code.
-  \item \textit{trcsms\_my\_trc.F90} :  The routine performs the call to Boundary Conditions and its main purpose is to contain the Source-Minus-Sinks terms due to the biogeochemical processes of the external model. Be aware that lateral boundary conditions are applied in trcnxt routine. IMPORTANT: the routines to compute the light penetration along the water column and the tracer vertical sinking should be defined/called in here, as generalized modules are still missing in the code.
- \item \textit{trcice\_my\_trc.F90} : Here it is possible to prescribe the tracers concentrations in the seaice that will be used as boundary conditions when ice melting occurs (nn\_ice\_tr =1 in namtrc\_ice). See e.g. the correspondent PISCES subroutine.
- \item \textit{trcwri\_my\_trc.F90} : This routine performs the output of the model tracers using IOM module (see Manual Chapter Output and Diagnostics). It is possible to place here the output of additional variables produced by the model, if not done elsewhere in the code, using the call to \textit{iom\_put}.
+  \item \textit{trcsms\_my\_trc.F90} :  The routine performs the call to Boundary Conditions and its main purpose is to contain the Source-Minus-Sinks terms due to the biogeochemical processes of the external model.
+Be aware that lateral boundary conditions are applied in trcnxt routine.
+IMPORTANT: the routines to compute the light penetration along the water column and the tracer vertical sinking should be defined/called in here, as generalized modules are still missing in the code.
+ \item \textit{trcice\_my\_trc.F90} : Here it is possible to prescribe the tracers concentrations in the seaice that will be used as boundary conditions when ice melting occurs (nn\_ice\_tr =1 in namtrc\_ice).
+See e.g. the correspondent PISCES subroutine.
+ \item \textit{trcwri\_my\_trc.F90} : This routine performs the output of the model tracers using IOM module (see Manual Chapter Output and Diagnostics).
+It is possible to place here the output of additional variables produced by the model, if not done elsewhere in the code, using the call to \textit{iom\_put}.
 \end{itemize}
-
 
 \section{The Offline Option}
@@ -596,9 +706,12 @@
 %-------------------------------------------------------------------------------------------------------------
 
-Coupling passive tracers offline with NEMO requires precomputed  physical fields from OGCM. Those fields are read from files and interpolated on-the-fly at each model time step
+Coupling passive tracers offline with NEMO requires precomputed  physical fields from OGCM.
+Those fields are read from files and interpolated on-the-fly at each model time step
 At least the following dynamical parameters should be absolutely passed to the transport : ocean velocities, temperature, salinity, mixed layer depth and for ecosystem models like PISCES, sea ice concentration, short wave radiation at the ocean surface, wind speed (or at least, wind stress).
 The so-called offline mode is useful since it has lower computational costs for example to perform very longer simulations - about 3000 years - to reach equilibrium of CO2 sinks for climate-carbon studies.
 
-The offline interface is located in the code repository : \path{<repository>/src/OFF/}. It is activated by adding the CPP key  \textit{key\_offline} to the CPP keys list. There are two specifics routines for the Offline code :
+The offline interface is located in the code repository : \path{<repository>/src/OFF/}.
+It is activated by adding the CPP key  \textit{key\_offline} to the CPP keys list.
+There are two specifics routines for the Offline code :
 
 \begin{itemize}
@@ -606,5 +719,4 @@
    \item \textit{nemogcm.F90} :  a degraded version of the main nemogcm.F90 code of NEMO to manage the time-stepping
 \end{itemize}
-
 
 %-
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/document.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/document.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/document.tex	(revision 14644)
@@ -1,88 +1,90 @@
-
 %% =================================================================================================
-%% Template structure for reference manuals
+%% Manual structure
 %% =================================================================================================
 
-%% NEMO release version
-\def \version{trunk}
-
-%% Preamble
+%% Preamble: global configuration
 %% =================================================================================================
 
-%% Document layout
-\documentclass[fontsize = 10pt, twoside, abstract]{scrreprt}
+%% Layout
+\documentclass[fontsize=10pt,twoside,abstract,draft]{scrreprt}
+%\documentclass[fontsize=10pt,twoside,abstract      ]{scrreprt}
 
-%% Load manual configuration
-\input{../../global/prologue}
+%% Overall configuration 
+\input{../../global/preamble}
 
-%% End of common preamble between main and sub-files
-%% Override custom cmds for full manual compilation
-\newcommand{\subinc}[1]{#1}
-\newcommand{\subexc}[1]{}
+%% Special cmds around to {in,ex}clude content only in subfile
+  \newcommand{\subinc}[1]{#1}
+  \newcommand{\subexc}[1]{  }
 
 \begin{document}
 
-\renewcommand{\subinc}[1]{}
+\renewcommand{\subinc}[1]{  }
 \renewcommand{\subexc}[1]{#1}
 
-
-%% Frontmatter
+%% Frontmatter: covers
+%% ({sub}title, DOI, authors, abstract and color theme are specific to each manual)
 %% =================================================================================================
 
+%\frontmatter %% Not recognized in 'scrreprt' document class
 \pagenumbering{gobble}   %% Disable page numbering temporarily
+\pagestyle{empty}
 
-%% Title page
 \input{../../global/frontpage}
-
-%% Footer for introductory parts (no header by cleaning default)
-\ofoot[]{\engine\ Reference Manual} \ifoot[]{\pagemark}
-
-%% Information page (2nd page)
 \input{../../global/info_page}
 
+\cleardoublepage
+
+\pagenumbering{Roman} %% Reactivate page numbering (uppercase roman numbers)
+\pagestyle{plain}
+%\lastpageref{pagesLTS.0}
+
+\tableofcontents
 \listoffigures
 \listoflistings
 \listoftables
+%\listoftodos
+%\lastpageref{pagesLTS.Roman}
 
-\clearpage
+\cleardoublepage
 
-\pagenumbering{roman}
-\ofoot[]{\engine\ Reference Manual} \ifoot[]{\pagemark}
+%% Mainmatter: toc, lists, introduction and primary chapters
+%% =================================================================================================
+
+%\mainmatter %% Not recognized in 'scrreprt' document class
+\pagenumbering{arabic} %% Standard page numbering
+\pagestyle{plain}
 
 \input{introduction}
 
-%% Table of Contents
-\tableofcontents
+\cleardoublepage
 
-\clearpage
+\pagestyle{scrheadings}
+\renewcommand{\chapterpagestyle}{empty}
 
+\input{chapters}
 
-%% Mainmatter
+%% Appendix: subordinate chapters
 %% =================================================================================================
 
-%% Headings for document body
-\pagenumbering{arabic}
-\lohead{Chap.\ \thechapter\ \leftmark} \rehead{Sect.\ \thesection\ \rightmark}
-\ifoot[]{Page\ \pagemark\ of \pageref*{LastPage}}
+\appendix %% Chapter numbering with letters by now
+\lohead{Apdx \thechapter\ \leftmark}
 
-\include{chapters}
+\input{appendices}
 
+\input{../../global/coding_rules} %% Add coding rules on every manual
 
-%% Appendix
+%\lastpageref{pagesLTS.arabic}
+\cleardoublepage
+
+%% Backmatter: bibliography, glossaries and indices
 %% =================================================================================================
 
-\appendix   %% Chapter numbering with letters by now
-\lohead{Apdx\ \thechapter\ \leftmark}
-\include{appendices}
+%\backmatter %% Not recognized in 'scrreprt' document class
+\pagenumbering{roman} %% Lowercase roman numbers
+\pagestyle{plain}
 
-%% Append coding rules for every manual
-\input{../../global/coding_rules}
-
-
-%% Backmatter
-%% =================================================================================================
-
-%% Bibliography and indexes
 \input{../../global/epilogue}
 
+%\lastpageref{pagesLTS.roman}
+
 \end{document}
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/epilogue.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/epilogue.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/epilogue.tex	(revision 14644)
@@ -1,17 +1,24 @@
-
-\clearpage
+%% =================================================================================================
+%% Backmatter
+%% =================================================================================================
 
 %% Bibliography
+%% =================================================================================================
+
 \phantomsection
 \addcontentsline{toc}{chapter}{Bibliography}
-\lohead{Bibliography} \rehead{Bibliography}
+\lohead{Bibliography}
+\rehead{Bibliography}
 \bibliography{../main/bibliography}
 
 \clearpage
 
-%% Indexes
+%% Indices
+%% =================================================================================================
+
 \phantomsection
-\addcontentsline{toc}{chapter}{Indexes}
-\lohead{Indexes} \rehead{Indexes}
+\addcontentsline{toc}{chapter}{Indices}
+\lohead{Indices}
+\rehead{Indices}
 \printindex[blocks]
 \printindex[keys]
@@ -19,2 +26,12 @@
 \printindex[parameters]
 \printindex[subroutines]
+
+\clearpage
+
+%% Glossary
+%% =================================================================================================
+
+%\phantomsection
+%\addcontentsline{toc}{chapter}{Glossary}
+%\lohead{Glossary}\rehead{Glossary}
+%\printglossaries
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/frontpage.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/frontpage.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/frontpage.tex	(revision 14644)
@@ -1,67 +1,71 @@
+%% =================================================================================================
+%% Front cover
+%% =================================================================================================
 
 \begin{titlepage}
-%  \newgeometry{hmargin = 1.5cm, vmargin = 3cm}
-  \setlength{\parindent}{0pt}
+%   \newgeometry{hmargin=1.5cm,vmargin=3cm}
+   \setlength{\parindent}{0pt}
 
-  \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 \\
+   \begin{center}
+
+      \begin{minipage}{0.3\textwidth}
+         \includegraphics[height=1.5cm]{NEMO_grey}
+      \end{minipage} %% Don't insert void line between `minipage` envs
+      \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]{
+               \faWordpress \hspace{1cm} \faCodeFork      \hspace{1cm}
+               \faGithub    \hspace{1cm} \faCloudDownload \hspace{1cm} \faEnvelope
+            }
+         \end{center}
+      \end{minipage}
+
+   \end{center}
+
+   \spcup
+   \textcolor{white}{\fontsize{0.8cm}{0.8cm}\selectfont\textbf{\hdg}}
+   \ifdef{\shdg}{\medskip\par\textcolor{white}{\Huge\shdg}}{}
+   \spcdn
+
+   \begin{center}
+      \LARGE Version {\ver} - {\today} \\
       \medskip
-      \hyperref[resources]{\textcolor{black}{
-          \faWordpress \hspace{0.75cm} \faCodeFork      \hspace{0.75cm}
-          \faGithub    \hspace{0.75cm} \faCloudDownload \hspace{0.75cm} \faEnvelope
-        }
-      }
-      \end{center}
-    \end{minipage}
-  \end{center}
+      \href{http://doi.org/10.5281/zenodo.\zid}{\includegraphics{zenodo.\zid}}
+   \end{center}
 
-  \spacetop
-  \textcolor{white}{\fontsize{0.8cm}{0.8cm}\selectfont\textbf{\heading}}
-  \ifdef{\subheading}{
-    \medskip
-    \par
-    \textcolor{white}{\Huge \subheading}
-  }{}
-  \spacedown
+   \vfill
 
-  \begin{center}
-    \LARGE Version \version\ -\ \today \\
-    \medskip
-    \href{http://doi.org/10.5281/zenodo.\zid}{ \includegraphics{badges/zenodo.\zid} }
-  \end{center}
+   \begin{minipage}{\autwd}
+      \raggedleft\input{authors}
+   \end{minipage}
+   \hspace{15pt} %% Don't insert void line between `minipage` envs
+   \begin{minipage}{0.02\linewidth}
+      \rule{1pt}{\lnlg}
+   \end{minipage}
+   \hspace{ 5pt} %%   "     ""    ""   ""     "        ""      ""
+   \begin{minipage}{\abswd}
+      \begin{abstract}
+         \input{abstract}
+      \end{abstract}
+   \end{minipage}
 
-  \vfill
+   \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}
+   \begin{center}
+      \Large
+      \CMCC{\includegraphics[height=1cm]{CMCC}} \hspace{0.25cm}
+      \CNRS{\includegraphics[height=1cm]{CNRS}} \hspace{0.25cm}
+       \MOI{\includegraphics[height=1cm]{MOI} } \hspace{0.25cm}
+      \UKMO{\includegraphics[height=1cm]{UKMO}} \hspace{0.25cm}
+      \NERC{\includegraphics[height=1cm]{NERC}}                 \\
+      \medskip
+      \slshape
+         {C}ommunity \hspace{1.5em} {O}cean \hspace{1.5em} {M}odel
+   \end{center}
 
 \end{titlepage}
 
-\restoregeometry
+%\restoregeometry
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/glossaries.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/glossaries.tex	(revision 14644)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/glossaries.tex	(revision 14644)
@@ -0,0 +1,11 @@
+%% =================================================================================================
+%% Glossaries
+%% =================================================================================================
+
+\usepackage[toc]{glossaries}
+
+%% \newglossaryentry{<label>}{<settings>}
+
+%% \newacronym{<label>}{<abbrv>}{<full>}
+
+\makeglossaries
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/highlighting.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/highlighting.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/highlighting.tex	(revision 14644)
@@ -1,32 +1,32 @@
+%% =================================================================================================
 %% Syntax highlighting configuration
-%% ==============================================================================
-
-\usepackage[outputdir=../build, chapter, newfloat]{minted}
+%% =================================================================================================
 
 %% Global highlighting style
-\definecolor{bg}{HTML}{f8f8f8}
+\definecolor{bg}{HTML}{f8f8f8} %% ?
 \usemintedstyle{emacs}
-\setminted{bgcolor=bg, fontsize=\scriptsize, breaklines}
-\setminted[xml]{style=borland} %% Specific per language
+\setminted{bgcolor=bg,fontsize=\scriptsize,breaklines}
+\setminted[xml]{style=borland} %% Specific style for XML
+
+%% Inline
+\newmintinline[forcode]{fortran}{bgcolor=,fontsize=auto} %% \forcode{...}
+\newmintinline[xmlcode]{xml}{    bgcolor=,fontsize=auto} %% \xmlcode{...}
+\newmintinline[snippet]{console}{bgcolor=,fontsize=auto} %% \snippet{...}
 
 %% Oneliner
-\newmint[forline]{fortran}{}   % \forline|...|
-\newmint[xmlline]{xml}{}       % \xmlline|...|
-\newmint[cmd]{console}{}       % \cmd|...|
+\newmint[forline]{fortran}{} %% \forline|...|
+\newmint[xmlline]{xml    }{} %% \xmlline|...|
+\newmint[cmd]{    console}{} %% \cmd|...|
 
 %% Multi-lines
-\newminted[forlines]{fortran}{}   % \begin{forlines}
-\newminted[xmllines]{xml}{}       % \begin{xmllines}
-\newminted[cmds]{console}{}       % \begin{cmds}
-\newminted[clines]{c}{}           % \begin{clines}
+\newminted[forlines]{fortran}{} %% \begin{forlines}
+\newminted[xmllines]{xml    }{} %% \begin{xmllines}
+\newminted[cmds]{    console}{} %% \begin{cmds}
+\newminted[clines]{  c      }{} %% \begin{clines}
 
-%% File
+%% File (namelist or module)
 \newmintedfile[forfile]{fortran}{}
-
-%% Inline
-\newmintinline[forcode]{fortran}{bgcolor=, fontsize=auto}   % \forcode{...}
-\newmintinline[xmlcode]{xml}{    bgcolor=, fontsize=auto}   % \xmlcode{...}
-\newmintinline[snippet]{console}{bgcolor=, fontsize=auto}   % \snippet{...}
 
 %% Namelists inclusion
 \newcommand{\nlst}[1]{\forfile{../../../namelists/#1}}
+
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/index.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/index.tex	(revision 14200)
+++ 	(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/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/indices.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/indices.tex	(revision 14644)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/indices.tex	(revision 14644)
@@ -0,0 +1,28 @@
+%% =================================================================================================
+%% Indices
+%% =================================================================================================
+
+%% Index entries (italic font for files, preformat for code)
+\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/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/info_page.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/info_page.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/info_page.tex	(revision 14644)
@@ -1,12 +1,13 @@
+%% =================================================================================================
+%% Back cover
+%% =================================================================================================
 
-\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},
+the \eng\ 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).
 Anyone may use it freely for research purposes, and is encouraged to
@@ -20,32 +21,32 @@
 The authors assume no responsibility for problems, errors, or incorrect usage of \NEMO.
 
-%% ================================================================
 %% 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
-  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:
-  the \href{http://listes.ipsl.fr/sympa/info/nemo-newsletter}{newsletter} for
-  top-down communications from the project
-  (announcements, calls, job opportunities, \ldots)
-  and the \href{http://listes.ipsl.fr/sympa/info/nemo-forge}{forge updates}
-  (commits, tickets and forums)
+   \item \faWordpress\ 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:
+      the \href{http://listes.ipsl.fr/sympa/info/nemo-newsletter}{newsletter} for
+      top-down communications from the project (announcements, calls, job opportunities, \ldots)
+      and the \href{http://listes.ipsl.fr/sympa/info/nemo-forge}{forge updates}
+      (commits, tickets and forums)
 \end{itemize}
 
-%% ================================================================
 %% Citation
-%% ================================================================
+%% =================================================================================================
+
 \subsubsection*{Citation}
 
@@ -55,22 +56,24 @@
 
 \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}
+   ``{\bfseries \hdg}\ifdef{\shdg}{ -- \shdg}{}'',
+   {\em Scientific Notes of Climate Modelling Center}, \textbf{\ipsl} --- ISSN 1288-1619,
+   Institut Pierre-Simon Laplace (IPSL),
+   \href{https://doi.org/10.5281/zenodo.\zid}{doi:10.5281/zenodo.\zid}
 \end{sloppypar}
 
 \begin{figure}[b]
-  \begin{minipage}[c]{0.7\textwidth}
-    \small
-    \ttfamily{
-      Scientific Notes of Climate Modelling Center \\
-      ISSN 1288-1619                               \\
-      Institut Pierre-Simon Laplace (IPSL)
-    }
-  \end{minipage}
-  \hfill
-  \begin{minipage}[c]{0.25\textwidth}
-    \href{http://www.cmc.ipsl.fr}{\includegraphics[width=\textwidth]{logos/IPSL_master}}
-  \end{minipage}
+
+   \begin{minipage}[c]{0.7\textwidth}
+      \small
+      \ttfamily{
+         Scientific Notes of Climate Modelling Center \\
+         ISSN 1288-1619                               \\
+         Institut Pierre-Simon Laplace (IPSL)
+      }
+   \end{minipage}
+   \hfill %% Don't insert void line between `minipage` envs
+   \begin{minipage}[c]{0.25\textwidth}
+      \href{http://www.cmc.ipsl.fr}{\includegraphics[width=\textwidth]{IPSL_master}}
+   \end{minipage}
+
 \end{figure}
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/latexmk.pl
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/latexmk.pl	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/latexmk.pl	(revision 14644)
@@ -1,13 +1,17 @@
+## Defaults
+#$silent   = 1;
+$pdf_mode = 5;
 
-## Defaults
-$do_cd    = 1;   ## Change to the directory of the main source file
-$silent   = 1;   ## Less verbosity
+## Using relative paths
+$ENV{'openout_any'} = 'a'       ;
+$do_cd              = 1         ;
+$out_dir            = '../build';
 
-## 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";
+## Custom cmds
+set_tex_cmds('-shell-escape -file-line-error -interaction=nonstopmode');
+#set_tex_cmds('-shell-escape -file-line-error');
+$makeindex = 'makeindex %O -s %R.ist -o %D %S';
+## %D: Destination file (.ind for index)
+## %O: Options
+## %R: Root filename (${model}_manual)
+## %S: Source file      (.idx for index)
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/nemo.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/nemo.tex	(revision 14644)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/nemo.tex	(revision 14644)
@@ -0,0 +1,23 @@
+%% =================================================================================================
+%% Common abstract
+%% =================================================================================================
+
+``Nucleus for European Modelling of the Ocean'' as \NEMO\ is a state-of-the-art modelling framework of
+ocean-related engines for research activities and forecasting services in oceanography and climatology,
+developed in a sustainable way since 2008 by a European consortium of 5 institutes
+(\CMCC{CMCC} | \CNRS{CNRS} | \MOI{Mercator Océan} | \UKMO{Met Office} | \NERC{NERC}).
+It is intended to be a flexible tool for studying the physical and biogeochemical phenomena in
+the ocean circulation, as well as its interactions with the components of the Earth climate system,
+over a wide range of space and time scales.
+
+Concerning the physics, the fundamental engine for the \textcolor{blue}{``blue ocean''} solves
+the primitive equations of the ocean \{thermo\}dynamics.
+It can be supplemented by the \textcolor{gray}{``white ocean''} for sea-ice \{thermo\}dynamics,
+brine inclusions and subgrid-scale thickness variations (\SIcube), and also by
+the \textcolor{green}{``green ocean''} for \{on,off\}line oceanic tracers transport and
+biogeochemical processes (\TOP-\PISCES).
+External alternative models can be used instead of the core engines (\eg\ \CICE\ and \BFM).
+Regarding the numerics, main features include versatile data assimilation interface,
+agile diagnostics generation thanks to \XIOS\ software,
+ocean-atmosphere coupling via the \OASIS\ library, and
+seamless embedded zooms with the \AGRIF\ 2-way nesting package.
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/new_cmds.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/new_cmds.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/new_cmds.tex	(revision 14644)
@@ -1,18 +1,27 @@
-%% Global custom commands: \newcommand{<name>}[<args>][<first argument value>]{<code>}
-%% ==============================================================================
+%% =================================================================================================
+%% Global custom commands
+%% =================================================================================================
 
-%% 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{<name>}[<args>][<first argument value>]{<code>}
+
+%% Same font for NEMO and its core engines
+\newcommand{\NEMO   }{\textsl{NEMO}}
+\newcommand{\OPA    }{\textsl{OPA}}
+\newcommand{\SIcube }{\textsl{SI$^3$}}
+\newcommand{\TOP    }{\textsl{TOP}}
+\newcommand{\PISCES }{\textsl{PISCES}}
 \newcommand{\NEMOVAR}{\textsl{NEMOVAR}}
 
-%% Links for external components
-\newcommand{\AGRIF}{\href{http://agrif.imag.fr}{AGRIF}}
+%% URL links for consortium institutes and external components
+\newcommand{\CMCC }{\href{http://www.cmcc.it}          }
+\newcommand{\CNRS }{\href{http://www.cnrs.fr}          }
+\newcommand{\MOI  }{\href{http://www.mercator-ocean.fr}}
+\newcommand{\UKMO }{\href{http://www.metoffice.gov.uk} }
+\newcommand{\NERC }{\href{http://nerc.ukri.org}        }
+\newcommand{\AGRIF}{\href{http://agrif.imag.fr                  }{AGRIF}}
+\newcommand{\BFM  }{\href{http://bfm-community.eu               }{BFM}}
 \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}}
+\newcommand{\OASIS}{\href{http://portal.enes.org/oasis          }{OASIS}}
+\newcommand{\XIOS }{\href{http://forge.ipsl.jussieu.fr/ioserver }{XIOS}}
 
 %% Fortran in small capitals
@@ -22,48 +31,47 @@
 %% Common aliases
 \renewcommand{\deg}[1][]{\ensuremath{^{\circ}#1}}
+\newcommand{\eg    }{\ensuremath{e.g.}}
+\newcommand{\ie    }{\ensuremath{i.e.}}
 \newcommand{\zstar }{\ensuremath{z^\star}}
 \newcommand{\sstar }{\ensuremath{s^\star}}
 \newcommand{\ztilde}{\ensuremath{\tilde z}}
 \newcommand{\stilde}{\ensuremath{\tilde s}}
-\newcommand{\ie}{\ensuremath{i.e.}}
-\newcommand{\eg}{\ensuremath{e.g.}}
-
-%% Inline maths
-\newcommand{\fractext}[2]{\textstyle \frac{#1}{#2}}
-\newcommand{\rdt}{\Delta t}
 
 %% Gurvan's comments
 \newcommand{\cmtgm}[1]{}
 
-%% Maths
+%% Maths: reduce equation
+\newcommand{\fractext}[2]{\textstyle\frac{#1}{#2}}
 \newcommand{\lt}{\left}
+\newcommand{\pd}[2][]{\ensuremath{\frac{\partial #1}{\partial #2}}}
+\newcommand{\rdt}{\Delta t}
 \newcommand{\rt}{\right}
-\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}{}}
+\newcommand{\vect}[1][]{\ensuremath{\mathbf{#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
+  \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}}
+%% Custom aliases
+\newcommand{\cf}{\ensuremath{C\kern-0.14em f}}
+\newcommand{\rML}[1][i]{\ensuremath{_{\mathrm{ML}\,#1}}}
+\newcommand{\rMLt}[1][i]{\tilde{r}_{\mathrm{ML}\,#1}}
+\newcommand{\triad}[6][]{\ensuremath{{}_{#2}^{#3}{\mathbb{#4}_{#1}}_{#5}^{\,#6}}}
+\newcommand{\triadd}[5]{\ensuremath{{}_{#1}^{#2}{\mathbb{#3}}_{#4}^{\,#5}}}
+\newcommand{\triadt}[5]{\ensuremath{{}_{#1}^{#2}{\tilde{\mathbb{#3}}}_{#4}^{\,#5}}}
+\newcommand{\rtriad}[2][]{\ensuremath{\triad[#1]{i}{k}{#2}{i_p}{k_p}}}
+\newcommand{\rtriadt}[1]{\ensuremath{\triadt{i}{k}{#1}{i_p}{k_p}}}
 
-%% 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%
+%% New command for ToC (?)
+\newcommand{\chaptertoc}[1][Table of contents]{
+  \etocsettocstyle{\addsec*{#1}}{}
+  \localtableofcontents
   \vfill
 }
+
+%% ORCID links
+\newcommand{\orcid}[1]{\href{http://orcid.org/#1}{\textcolor{orcidclr}\aiOrcidSquare}}
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/packages.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/packages.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/packages.tex	(revision 14644)
@@ -1,46 +1,46 @@
+%% =================================================================================================
+%% Packages
+%% =================================================================================================
 
-%% LaTeX packages in use
-%% ==============================================================================
+%% Document class
+\usepackage[footsepline=0.25pt,headsepline=0.25pt]{scrlayer-scrpage} %% KOMA-script
 
-%% 'hyperref' pkg is loaded at the end of the preamble for higher compatibility
-
-%% 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}
+%% Customisation (cover page, chapter headings and mark of draft copy)
+\usepackage[margin=2cm]{geometry} %% Why 2cm margin? Load geometry before background!
+\usepackage[pages=some]{background} %% 'some' for title page
+\usepackage[scale=15,color=pink]{draftwatermark}
+\usepackage[Bjornstrup]{fncychap} %% Chapter style
 
 %% Fonts
 \usepackage{fontspec}
-%% Issue with fontawesome pkg: path to FontAwesome.otf has to be hard-coded
-\defaultfontfeatures{
-    Path = /home/nicolas/.local/texlive/2020/texmf-dist/fonts/opentype/public/fontawesome/
-}
-\usepackage{academicons, fontawesome, newtxtext}
+%% Issue with path to 'FontAwesome.otf'
+\defaultfontfeatures{Path=/usr/local/texlive/2020/texmf-dist/fonts/opentype/public/fontawesome/}
+\usepackage{academicons,fontawesome}
 
 %% Formatting
 \usepackage[inline]{enumitem}
-\usepackage{etoc, tabularx, xcolor}
+\usepackage{etoc,tabularx,xcolor}
 
 %% Graphics
-\usepackage{caption, graphicx, grffile}
+\usepackage{caption}
+\graphicspath{{../../../badges/}{../figures/}{../../../logos/}}
 
 %% Labels
-\usepackage{lastpage, natbib}
+\usepackage{lastpage,natbib}
+%\usepackage{natbib,pageslts}
 
-%% Mathematics
-\usepackage{amsmath, amssymb, mathtools}
+%% Mathematics: 'amsmath' is loaded by 'mathtools'
+\usepackage{mathtools,amssymb}
 
 %% Versatility
 \usepackage{subfiles}
 
-%% Configuration
-\graphicspath{ {../../../} {../figures/} }
+%% Source code listings
+\usepackage[cachedir=cache,outputdir=../build,chapter,newfloat]{minted}
+%% chapter? newfloat?
+
+%% Indexing and cross-referencing, loaded at the end for higher compatibility
+\usepackage{hyperref,imakeidx}
 
 %% Missing utmr8a font
 \usepackage{times}
-
-\usepackage{hyperref}   %% links
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/preamble.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/preamble.tex	(revision 14644)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/preamble.tex	(revision 14644)
@@ -0,0 +1,17 @@
+%% =================================================================================================
+%% Preamble
+%% =================================================================================================
+
+\def\ver{trunk}
+
+%% Specific configuration
+\input{../main/settings}
+
+%% Global configuration
+\input{../../global/packages} % First obviously
+\input{../../global/styles} % Color definitions
+\input{../../global/highlighting}
+\input{../../global/indices}
+\input{../../global/new_cmds}
+%\input{../../global/todonotes}
+%\input{../../global/glossaries}
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/prologue.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/prologue.tex	(revision 14200)
+++ 	(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/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/styles.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/styles.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/styles.tex	(revision 14644)
@@ -1,23 +1,52 @@
-
+%% =================================================================================================
 %% Styles
-%% ==============================================================================
+%% =================================================================================================
 
 %% Colors
-\setmanualcolor
-\colorlet{manualcolorshaded}{manualcolor!60}
-\definecolor{orcidcolor}{HTML}{A6CE39}
+\definecolor{orcidclr}{HTML}{A6CE39}
+\definecolor{manclr}{cmyk}{\clr} %% \clr defined for each manual from local settings.tex
+\colorlet{manclrshd}{manclr!60} %% Derived color for chapter heading, see below
+
+%% Cover page
+\backgroundsetup{
+   firstpage=true,scale=1,angle=0,opacity=1,
+   contents ={
+      \begin{tikzpicture}[remember picture,overlay]
+         \path[fill=manclr] (-0.5\paperwidth,7) rectangle (0.5\paperwidth,10);
+      \end{tikzpicture}
+    }
+}
 
 %% Page layout
-\pagestyle{scrheadings}
+%\pagestyle{scrheadings}
+%\renewcommand{\chapterpagestyle}{empty}
+\renewcommand{\chaptermark}[1]{\markboth{ #1}{}} %% Convert mark to lowercase
+\renewcommand{\sectionmark}[1]{\markright{#1}{}} %%    "     ""  ""     "  
+\ohead{} %% Clear default headings
+\lohead{Chap. \thechapter\  \leftmark}
+\rehead{Sect. \thesection\ \rightmark}
+\ifoot{Page \thepage\ of \pageref*{LastPage}}
+%\ifoot[\pagemark]{Page \thepage\ of \lastpageref*{pagesLTS.arabic}}
+\ofoot{\eng\ Reference Manual}
 \addtokomafont{pagehead}{  \sffamily              }
 \addtokomafont{pagefoot}{  \sffamily \footnotesize}
 \addtokomafont{pagenumber}{\sffamily \slshape     }
-\addtokomafont{chapter}{\color{white}}
-\ohead{} \ofoot{}   %% Clear defaults
+%\addtokomafont{chapter}{\color{white}}
 
-%% Caption
-\captionsetup{font = footnotesize, justification = justified}
+%% Cross-referencing
+\hypersetup{
+   pdftitle=\hdg,pdfauthor=Gurvan Madec and NEMO System Team,
+   pdfsubject=Reference manual of NEMO modelling framework,pdfkeywords=ocean circulation modelling,
+   colorlinks,allcolors=manclr
+}
+\renewcommand{\appendixautorefname}{appendix}          %% `\autoref` uncapitalization
+\renewcommand{\equationautorefname}{equation}          %%     ""            ""
+\renewcommand{\figureautorefname  }{figure}            %%     ""            ""
+\renewcommand{\listingname        }{namelist}          %%     ""            ""
+\renewcommand{\listlistingname    }{List of Namelists} %%     ""            ""
+\renewcommand{\tableautorefname   }{table}             %%     ""            ""
 
-%% Footnote
+%% Misc. (caption and footnote)
+\captionsetup{font=footnotesize,justification=justified}
 \renewcommand{\thefootnote}{\fnsymbol{footnote}}
 
@@ -28,58 +57,33 @@
 \renewcommand{\bibpostamble}{  \end{multicols}   }
 
-%% Catcodes
+%% Catcodes (between `\makeatletter` and `\makeatother`)
 \makeatletter
 
-%% 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 manual color for chap. headings (original snippets from fncychap.sty)
+%% !!! Let trailing percent sign to avoid space insertion
+\renewcommand{\DOCH}{% %% Upper box with chapter number
+   \settowidth{\py}{\CNoV\thechapter}%
+   \addtolength{\py}{-10pt}% %% Amount of space by which the number is shifted right
+   \fboxsep=0pt%
+   \colorbox{manclr}{\rule{0pt}{40pt}\parbox[b]{\textwidth}{\hfill}}%
+   \kern-\py\raise20pt%
+   \hbox{\color{manclrshd}\CNoV\thechapter}\\
+}
+\renewcommand{\DOTI}[1]{% %% Lower box with chapter title
+   \nointerlineskip\raggedright%
+   \fboxsep=\myhi%
+   \vskip-1ex%
+   \colorbox{manclr}{\parbox[t]{\mylen}{\color{white}\CTV\FmTi{#1}}}\par\nobreak%
+   \vskip 40\p@%
+}
+\renewcommand{\DOTIS}[1]{% %% Box for unumbered chapter
+   \fboxsep=0pt%
+   \colorbox{manclr}{\rule{0pt}{40pt}\parbox[b]{\textwidth}{\hfill}}\\
+   \nointerlineskip\raggedright%
+   \fboxsep=\myhi%
+   \vskip-1ex% %% Remove white 1pt line
+   \colorbox{manclr}{\parbox[t]{\mylen}{\color{white}\CTV\FmTi{#1}}}\par\nobreak%
+   \vskip 40\p@%
 }
 
-%% Apply engine color for chapter headings: tweaking snippets from fncychap.sty
-\renewcommand{\DOCH}{%
-  \settowidth{\py}{\CNoV\thechapter}
-  \addtolength{\py}{-10pt}      % Amount of space by which the
-%                                  % number is shifted right
-  \fboxsep=0pt%
-  \colorbox{manualcolor}{\rule{0pt}{40pt}\parbox[b]{\textwidth}{\hfill}}%
-  \kern-\py\raise20pt%
-  \hbox{\color{manualcolorshaded}\CNoV\thechapter}\\%
-}
-\renewcommand{\DOTI}[1]{%
-  \nointerlineskip\raggedright%
-  \fboxsep=\myhi%
-  \vskip-1ex%
-  \colorbox{manualcolor}{\parbox[t]{\mylen}{\color{white}\CTV\FmTi{#1}}}\par\nobreak%
-  \vskip 40\p@%
-}
-\renewcommand{\DOTIS}[1]{%
-  \fboxsep=0pt
-  \colorbox{manualcolor}{\rule{0pt}{40pt}\parbox[b]{\textwidth}{\hfill}}\\%
-  \nointerlineskip\raggedright%
-  \fboxsep=\myhi%
-  \vskip-1ex% Remove white 1pt line
-  \colorbox{manualcolor}{\parbox[t]{\mylen}{\color{white}\CTV\FmTi{#1}}}\par\nobreak%
-  \vskip 40\p@%
-}
-
-%% 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
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/todonotes.tex
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/todonotes.tex	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/latex/global/todonotes.tex	(revision 14644)
@@ -1,24 +1,30 @@
-\usepackage[]{todonotes}
+%% =================================================================================================
+%% Notes
+%% =================================================================================================
+
+\usepackage{todonotes}
 
 \newcounter{ubcomment}
-\newcommand{\ubcomment}[2][]{%
-\refstepcounter{ubcomment}%
-{%
-\todo[linecolor=black,backgroundcolor={green!40!},size=\footnotesize]{%
-\textbf{Fixme: UB [\uppercase{#1}\theubcomment]:}~#2}%
-}}
-\newcommand{\ubcommentinline}[2][]{%
-\refstepcounter{ubcomment}%
-{%
-\todo[linecolor=black,inline,backgroundcolor={green!40!},size=\footnotesize]{%
-\textbf{Fixme: UB [\uppercase{#1}\theubcomment]:}~#2}%
+
+\newcommand{\ubcomment         }[2][]{
+\refstepcounter{ubcomment}
+{
+\todo[linecolor=black,       backgroundcolor={green!40!},size=\footnotesize ]{
+\textbf{Fixme: UB [\uppercase{#1}\theubcomment]:}~#2}
 }}
 
-\newcommand{\ubcommentmultiline}[2]{%
-\refstepcounter{ubcomment}%
-{%
-\todo[linecolor=black,inline,caption={\textbf{{Fixme: UB}
-    [\theubcomment] #1}} ,backgroundcolor={green!40!},size=\footnotesize]{%
-\textbf{Fixme: UB [\theubcomment]:}~#2}%
+\newcommand{\ubcommentinline   }[2][]{
+\refstepcounter{ubcomment}
+{
+\todo[linecolor=black,inline,backgroundcolor={green!40!},size=\footnotesize ]{
+\textbf{Fixme: UB [\uppercase{#1}\theubcomment]:}~#2}
+}}
+
+\newcommand{\ubcommentmultiline}[2]{
+\refstepcounter{ubcomment}
+{
+\todo[linecolor=black,inline,backgroundcolor={green!40!},size=\footnotesize,
+      caption={\textbf{{Fixme: UB} [\theubcomment] #1}}                     ]{
+\textbf{Fixme: UB [              \theubcomment]:}~#2}
 }}
 
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/manual_build.sh
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/manual_build.sh	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/manual_build.sh	(revision 14644)
@@ -21,15 +21,8 @@
 
 ## LaTeX installation, find latexmk should be enough
-[ -z $( which latexmk ) ] && { echo 'latexmk not installed => QUIT'; exit 2; }
+[ -z "$( which latexmk )" ] && { echo 'latexmk not installed => QUIT'; exit 2; }
 
 ## Pygments package for syntax highlighting of source code (namelists & snippets)
 [ -n "$( ./tools/check_pkg.py pygments )" ] && { echo 'Python pygments is missing => QUIT'; exit 2; }
-
-## Retrieve figures if not already there
-#if [ ! -d latex/figures ]; then
-#    printf "Downloading of shared figures and logos\n\n"
-#    svn co http://forge.ipsl.jussieu.fr/nemo/svn/utils/figures latex/figures > /dev/null
-#fi
-
 
 ## Loop on the models
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/namelists/namberg
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/namelists/namberg	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/namelists/namberg	(revision 14644)
@@ -33,4 +33,7 @@
    rn_speed_limit          = 0.      ! CFL speed limit for a berg
 
+   ln_M2016                = .false. ! use Merino et al. (2016) modification (use of 3d ocean data instead of only sea surface data)
+      ln_icb_grd           = .false. ! ground icb when icb bottom level hit oce bottom level (need ln_M2016 to be activated)
+
    cn_dir      = './'      !  root directory for the calving data location
    !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/namelists/nammpp
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/namelists/nammpp	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/namelists/nammpp	(revision 14644)
@@ -1,4 +1,4 @@
 !-----------------------------------------------------------------------
-&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi")
+&nammpp        !   Massively Parallel Processing
 !-----------------------------------------------------------------------
    ln_listonly =  .false.  !  do nothing else than listing the best domain decompositions (with land domains suppression)
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/namelists/namrun
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/namelists/namrun	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/namelists/namrun	(revision 14644)
@@ -26,5 +26,5 @@
       !                          !    = -1 do not do any restart
    nn_stocklist = 0,0,0,0,0,0,0,0,0,0 ! List of timesteps when a restart file is to be written
-   nn_write    =       0   !  used only if key_iomput is not defined: output frequency (modulo referenced to nn_it000)
+   nn_write    =       0   !  used only if key_xios is not defined: output frequency (modulo referenced to nn_it000)
       !                          !    =  0 force to write output files only at the end of the run
       !                          !    = -1 do not do any output file
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/rst/source/conf.py
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/rst/source/conf.py	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/rst/source/conf.py	(revision 14644)
@@ -43,5 +43,5 @@
 # General information about the project.
 project = u'NEMO'
-copyright = u'2019, NEMO Consortium'
+copyright = u'2020, NEMO Consortium'
 
 # The version info for the project you're documenting, acts as replacement for
@@ -50,5 +50,5 @@
 #
 # The short X.Y version.
-version = 'trk'
+version = 'trunk'
 # The full version, including alpha/beta/rc tags.
 release = 'trunk'
@@ -279,2 +279,5 @@
 # Default language to highlight set to fortran
 highlight_language = 'fortran'
+
+# Extra setting for sphinxcontrib.bibtex upgrade to 2.X.X branche
+bibtex_bibfiles = ['cfgs.bib', 'ref.bib', 'tests.bib', 'zooms.bib']
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/rst/source/guide.rst
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/rst/source/guide.rst	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/rst/source/guide.rst	(revision 14644)
@@ -16,5 +16,6 @@
 .. toctree::
    :hidden:
-.. todos::
+
+   todos
 
 .. Only displayed with 'make drafthtml'
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/tools/check_pkg.py
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/tools/check_pkg.py	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/tools/check_pkg.py	(revision 14644)
@@ -1,3 +1,3 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 import sys, importlib
@@ -7,4 +7,4 @@
 		importlib.import_module(argv)
 	except ImportError:
-		print("Package %s is missing in Python" % argv)
+		print("Package %s is missing in Python 3" % argv)
 
Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/tools/shr_func.sh
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/tools/shr_func.sh	(revision 14200)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/doc/tools/shr_func.sh	(revision 14644)
@@ -8,7 +8,7 @@
 
 build() {
-    printf "\t¤ Generation of the PDF format\n"
-    latexmk -r ./latex/global/latexmk.pl -pdfxe ./latex/$1/main/$1_manual \
-#	1> /dev/null
+    printf "\t¤ Generation of the PDF export of the manual\n"
+    latexmk -r ./latex/global/latexmk.pl ./latex/$1/main/$1_manual \
+	1> /dev/null
     [ -f ./latex/$1/build/$1_manual.pdf ] && mv ./latex/$1/build/$1_manual.pdf .
     echo
