Index: /NEMO/branches/2020/tickets_icb_1900/cfgs/SHARED/namelist_ref
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/cfgs/SHARED/namelist_ref	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/cfgs/SHARED/namelist_ref	(revision 14012)
@@ -94,4 +94,11 @@
    ln_use_jattr = .false.    !  use (T) the file attribute: open_ocean_jstart, if present
    !                         !  in netcdf input files, as the start j-row for reading
+/
+!-----------------------------------------------------------------------
+&namtile        !   parameters of the tiling
+!-----------------------------------------------------------------------
+   ln_tile = .false.     !  Use tiling (T) or not (F)
+   nn_ltile_i = 10       !  Length of tiles in i
+   nn_ltile_j = 10       !  Length of tiles in j
 /
 !-----------------------------------------------------------------------
Index: /NEMO/branches/2020/tickets_icb_1900/doc/latex/NEMO/main/bibliography.bib
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/doc/latex/NEMO/main/bibliography.bib	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/doc/latex/NEMO/main/bibliography.bib	(revision 14012)
@@ -1906,4 +1906,14 @@
 }
 
+@Article{        love_PRSLA1909,
+  author       = "A. E. H. Love",
+  title        = "The Yielding of the Earth to Disturbing Forces",
+  journal      = "Proc. R. Soc. Lond. A",
+  year         = "1909",
+  volume       = "82",
+  pages        = "73-88",
+  doi          = "10.1098/rspa.1909.0008"
+}
+
 @article{         losch_JGR08,
   title         = "Modeling ice shelf cavities in a z coordinate Ocean
Index: /NEMO/branches/2020/tickets_icb_1900/doc/latex/NEMO/subfiles/chap_DIA.tex
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/doc/latex/NEMO/subfiles/chap_DIA.tex	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/doc/latex/NEMO/subfiles/chap_DIA.tex	(revision 14012)
@@ -119,6 +119,7 @@
 \subsection{XIOS: Reading and writing restart file}
 
-XIOS may be used to read single file restart produced by \NEMO. Currently only the variables written to
-file \forcode{numror} can be handled by XIOS. To activate restart reading using XIOS, set \np[=.true. ]{ln_xios_read}{ln\_xios\_read}
+XIOS may be used to read single file restart produced by \NEMO. The variables written to
+file \forcode{numror} (OCE), \forcode{numrir} (SI3), \forcode{numrtr} (TOP), \forcode{numrsr} (SED) can be handled by XIOS. 
+To activate restart reading using XIOS, set \np[=.true. ]{ln_xios_read}{ln\_xios\_read}
 in \textit{namelist\_cfg}. This setting will be ignored when multiple restart files are present, and default \NEMO
 functionality will be used for reading. There is no need to change iodef.xml file to use XIOS to read
@@ -142,15 +143,4 @@
 have to be rebuild before continuing the run. This option aims to reduce number of restart files generated by \NEMO\ only,
 and may be useful when there is a need to change number of processors used to run simulation.
-
-If an additional variable must be written to a restart file, the following steps are needed:
-\begin{enumerate}
-\item Add variable name to a list of restart variables (in subroutine \rou{iom\_set\_rst\_vars,} \mdl{iom}) and
-define correct grid for the variable (\forcode{grid_N_3D} - 3D variable, \forcode{grid_N} - 2D variable, \forcode{grid_vector} -
-1D variable, \forcode{grid_scalar} - scalar),
-\item Add variable to the list of fields written by restart.  This can be done either in subroutine
-\rou{iom\_set\_rstw\_core} (\mdl{iom}) or by calling  \rou{iom\_set\_rstw\_active} (\mdl{iom}) with the name of a variable
-as an argument. This convention follows approach for writing restart using iom, where variables are
-written either by \rou{rst\_write} or by calling \rou{iom\_rstput} from individual routines.
-\end{enumerate}
 
 An older versions of XIOS do not support reading functionality. It's recommended to use at least XIOS2@1451.
Index: /NEMO/branches/2020/tickets_icb_1900/doc/latex/NEMO/subfiles/chap_DYN.tex
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/doc/latex/NEMO/subfiles/chap_DYN.tex	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/doc/latex/NEMO/subfiles/chap_DYN.tex	(revision 14012)
@@ -1245,5 +1245,5 @@
 the atmospheric pressure is taken into account when computing the surface pressure gradient.
 
-(2) When \np[=.true.]{ln_tide_pot}{ln\_tide\_pot} and \np[=.true.]{ln_tide}{ln\_tide} (see \autoref{sec:SBC_tide}),
+(2) When \np[=.true.]{ln_tide_pot}{ln\_tide\_pot} and \np[=.true.]{ln_tide}{ln\_tide} (see \autoref{sec:SBC_TDE}),
 the tidal potential is taken into account when computing the surface pressure gradient.
 
Index: /NEMO/branches/2020/tickets_icb_1900/doc/latex/NEMO/subfiles/chap_LBC.tex
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/doc/latex/NEMO/subfiles/chap_LBC.tex	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/doc/latex/NEMO/subfiles/chap_LBC.tex	(revision 14012)
@@ -16,4 +16,5 @@
     Release & Author(s) & Modifications \\
     \hline
+    {\em  next} & {\em Simon M{\" u}ller} & {\em Minor update of \autoref{subsec:LBC_bdy_tides}} \\[2mm]
     {\em   4.0} & {\em ...} & {\em ...} \\
     {\em   3.6} & {\em ...} & {\em ...} \\
@@ -665,38 +666,33 @@
 
 Tidal forcing at open boundaries requires the activation of surface
-tides (i.e., in \nam{_tide}{\_tide}, \np{ln_tide}{ln\_tide} needs to be set to
-\forcode{.true.} and the required constituents need to be activated by
-including their names in the \np{clname}{clname} array; see
-\autoref{sec:SBC_tide}). Specific options related to the reading in of
+tides (i.e., in \nam{_tide}{\_tide}, \np[=.true.]{ln_tide}{ln\_tide} with the active tidal
+constituents listed in the \np{sn_tide_cnames}{sn\_tide\_cnames} array; see
+\autoref{sec:SBC_TDE}). The specific options related to the reading in of
 the complex harmonic amplitudes of elevation (SSH) and barotropic
-velocity (u,v) at open boundaries are defined through the
-\nam{bdy_tide}{bdy\_tide} namelist parameters.\\
+velocity components (u,v) at the open boundaries are defined through the
+\nam{bdy_tide}{bdy\_tide} namelist parameters.\par
 
 The tidal harmonic data at open boundaries can be specified in two
 different ways, either on a two-dimensional grid covering the entire
 model domain or along open boundary segments; these two variants can
-be selected by setting \np{ln_bdytide_2ddta }{ln\_bdytide\_2ddta } to \forcode{.true.} or
-\forcode{.false.}, respectively. In either case, the real and
-imaginary parts of SSH and the two barotropic velocity components for
-each activated tidal constituent \textit{tcname} have to be provided
-separately: when two-dimensional data is used, variables
-\textit{tcname\_z1} and \textit{tcname\_z2} for real and imaginary SSH,
-respectively, are expected in input file \np{filtide}{filtide} with suffix
-\ifile{\_grid\_T}, variables \textit{tcname\_u1} and
-\textit{tcname\_u2} for real and imaginary u, respectively, are
-expected in input file \np{filtide}{filtide} with suffix \ifile{\_grid\_U}, and
-\textit{tcname\_v1} and \textit{tcname\_v2} for real and imaginary v,
-respectively, are expected in input file \np{filtide}{filtide} with suffix
-\ifile{\_grid\_V}; when data along open boundary segments is used,
-variables \textit{z1} and \textit{z2} (real and imaginary part of SSH)
-are expected to be available from file \np{filtide}{filtide} with suffix
-\ifile{tcname\_grid\_T}, variables \textit{u1} and \textit{u2} (real
-and imaginary part of u) are expected to be available from file
-\np{filtide}{filtide} with suffix \ifile{tcname\_grid\_U}, and variables
-\textit{v1} and \textit{v2} (real and imaginary part of v) are
-expected to be available from file \np{filtide}{filtide} with suffix
-\ifile{tcname\_grid\_V}. If \np{ln_bdytide_conj}{ln\_bdytide\_conj} is set to
-\forcode{.true.}, the data is expected to be in complex conjugate
-form.
+be selected by setting \np[=.true.]{ln_bdytide_2ddta}{ln\_bdytide\_2ddta} or
+\np[=.false.]{ln_bdytide_2ddta}{ln\_bdytide\_2ddta}, respectively. In either
+case, the real and imaginary parts of SSH, u, and v amplitudes associated with
+each activated tidal constituent \texttt{<constituent>} have to be provided
+separately as fields in input files with names based on
+\np[=<input>]{filtide}{filtide}: when two-dimensional data is used, variables
+\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
+\texttt{<constituent>\_u2} for the real and imaginary parts of u, respectively, in file
+\ifile{<input>\_grid\_U}, 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,
+variables \texttt{z1} and \texttt{z2} (real and imaginary part of SSH) are
+expected to be available in file \ifile{<input><constituent>\_grid\_T},
+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}
+(real and imaginary part of v) in file
+\ifile{<input><constituent>\_grid\_V}.\par
 
 Note that the barotropic velocity components are assumed to be defined
Index: /NEMO/branches/2020/tickets_icb_1900/doc/latex/NEMO/subfiles/chap_SBC.tex
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/doc/latex/NEMO/subfiles/chap_SBC.tex	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/doc/latex/NEMO/subfiles/chap_SBC.tex	(revision 14012)
@@ -5,5 +5,5 @@
 \begin{document}
 
-\chapter{Surface Boundary Condition (SBC, SAS, ISF, ICB)}
+\chapter{Surface Boundary Condition (SBC, SAS, ISF, ICB, TDE)}
 \label{chap:SBC}
 
@@ -18,4 +18,5 @@
     Release & Author(s) & Modifications \\
     \hline
+    {\em  next} & {\em Simon M{\" u}ller} & {\em Update of \autoref{sec:SBC_TDE}}\\[2mm]
     {\em   4.0} & {\em ...} & {\em ...} \\
     {\em   3.6} & {\em ...} & {\em ...} \\
@@ -1013,6 +1014,6 @@
 
 %% =================================================================================================
-\section[Surface tides (\textit{sbctide.F90})]{Surface tides (\protect\mdl{sbctide})}
-\label{sec:SBC_tide}
+\section{Surface tides (TDE)}
+\label{sec:SBC_TDE}
 
 \begin{listing}
@@ -1022,43 +1023,80 @@
 \end{listing}
 
-The tidal forcing, generated by the gravity forces of the Earth-Moon and Earth-Sun sytems,
-is activated if \np{ln_tide}{ln\_tide} and \np{ln_tide_pot}{ln\_tide\_pot} are both set to \forcode{.true.} in \nam{_tide}{\_tide}.
-This translates as an additional barotropic force in the momentum \autoref{eq:MB_PE_dyn} such that:
+\subsection{Tidal constituents}
+Ocean model component TDE provides the common functionality for tidal forcing
+and tidal analysis in the model framework. This includes the computation of the gravitational
+surface forcing, as well as support for lateral forcing at open boundaries (see
+\autoref{subsec:LBC_bdy_tides}) and tidal harmonic analysis (see
+\autoref{subsec:DIA_diamlr} and \autoref{subsec:DIA_diadetide}). The module is
+activated with \np[=.true.]{ln_tide}{ln\_tide} in namelist
+\nam{_tide}{\_tide}. It provides the same 34 tidal constituents that are
+included in the
+\href{https://www.aviso.altimetry.fr/en/data/products/auxiliary-products/global-tide-fes.html}{FES2014
+  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
+  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
+  4.0 and earlier are available}. Constituents to be included in the tidal forcing
+(surface and lateral boundaries) are selected by enumerating their respective
+names in namelist array \np{sn_tide_cnames}{sn\_tide\_cnames}.\par
+
+\subsection{Surface tidal forcing}
+Surface tidal forcing can be represented in the model through an additional
+barotropic force in the momentum equation (\autoref{eq:MB_PE_dyn}) such that:
 \[
-  % \label{eq:SBC_PE_dyn_tides}
-  \frac{\partial {\mathrm {\mathbf U}}_h }{\partial t}= ...
-  +g\nabla (\Pi_{eq} + \Pi_{sal})
+  \frac{\partial {\mathrm {\mathbf U}}_h }{\partial t} = \ldots +g\nabla (\gamma
+  \Pi_{eq} + \Pi_{sal})
 \]
-where $\Pi_{eq}$ stands for the equilibrium tidal forcing and
-$\Pi_{sal}$ is a self-attraction and loading term (SAL).
-
-The equilibrium tidal forcing is expressed as a sum over a subset of
-constituents chosen from the set of available tidal constituents
-defined in file \hf{SBC/tide} (this comprises the tidal
-constituents \textit{M2, N2, 2N2, S2, K2, K1, O1, Q1, P1, M4, Mf, Mm,
-  Msqm, Mtm, S1, MU2, NU2, L2}, and \textit{T2}). Individual
-constituents are selected by including their names in the array
-\np{clname}{clname} in \nam{_tide}{\_tide} (e.g., \np{clname}{clname}\forcode{(1)='M2', }
-\np{clname}{clname}\forcode{(2)='S2'} to select solely the tidal consituents \textit{M2}
-and \textit{S2}). Optionally, when \np{ln_tide_ramp}{ln\_tide\_ramp} is set to
-\forcode{.true.}, the equilibrium tidal forcing can be ramped up
-linearly from zero during the initial \np{rdttideramp}{rdttideramp} days of the
-model run.
+where $\gamma \Pi_{eq}$ stands for the equilibrium tidal forcing scaled by a spatially
+uniform tilt factor $\gamma$, and $\Pi_{sal}$ is an optional
+self-attraction and loading term (SAL). These additional terms are enabled when,
+in addition to \np[=.true.]{ln_tide}{ln\_tide}),
+\np[=.true.]{ln_tide_pot}{ln\_tide\_pot}.\par
+
+The equilibrium tidal forcing is expressed as a sum over the subset of
+constituents listed in \np{sn_tide_cnames}{sn\_tide\_cnames} of
+\nam{_tide} (e.g.,
+\begin{forlines}
+      sn_tide_cnames(1) = 'M2'
+      sn_tide_cnames(2) = 'K1'
+      sn_tide_cnames(3) = 'S2'
+      sn_tide_cnames(4) = 'O1'
+\end{forlines}
+to select the four tidal constituents of strongest equilibrium tidal
+potential). The tidal tilt factor $\gamma = 1 + k - h$ includes the
+Love numbers $k$ and $h$ \citep{love_prsla1909}; this factor is
+configurable using \np{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
+\np{rn_tide_ramp_dt}{rn\_tide\_ramp\_dt} days of the model run.\par
 
 The SAL term should in principle be computed online as it depends on
 the model tidal prediction itself (see \citet{arbic.garner.ea_DSR04} for a
-discussion about the practical implementation of this term).
-Nevertheless, the complex calculations involved would make this
-computationally too expensive. Here, two options are available:
-$\Pi_{sal}$ generated by an external model can be read in
-(\np[=.true.]{ln_read_load}{ln\_read\_load}), or a ``scalar approximation'' can be
-used (\np[=.true.]{ln_scal_load}{ln\_scal\_load}). In the latter case
+discussion about the practical implementation of this term). The complex
+calculations involved in such computations, however, are computationally very
+expensive. Here, two mutually exclusive simpler variants are available:
+amplitudes generated by an external model for oscillatory $\Pi_{sal}$
+contributions from each of the selected tidal constituents can be read in
+(\np[=.true.]{ln_read_load}{ln\_read\_load}) from the file specified in
+\np{cn_tide_load}{cn\_tide\_load} (the variable names are comprised of the
+tidal-constituent name and suffixes \forcode{_z1} and \forcode{_z2} for the two
+orthogonal components, respectively); alternatively, a ``scalar approximation''
+can be used (\np[=.true.]{ln_scal_load}{ln\_scal\_load}), where
 \[
   \Pi_{sal} = \beta \eta,
 \]
-where $\beta$ (\np{rn_scal_load}{rn\_scal\_load} with a default value of 0.094) is a
-spatially constant scalar, often chosen to minimize tidal prediction
-errors. Setting both \np{ln_read_load}{ln\_read\_load} and \np{ln_scal_load}{ln\_scal\_load} to
-\forcode{.false.} removes the SAL contribution.
+with a spatially uniform coefficient $\beta$, which can be configured
+via \np{rn_scal_load}{rn\_scal\_load} (default value 0.094) and is
+often tuned to minimize tidal prediction errors.\par
+
+For diagnostic purposes, the forcing potential of the individual tidal
+constituents (incl. load ptential, if activated) and the total forcing
+potential (incl. load potential, if activated) can be made available
+as diagnostic output by setting
+\np[=.true.]{ln_tide_dia}{ln\_tide\_dia} (fields
+\forcode{tide_pot_<constituent>} and \forcode{tide_pot}).\par
 
 %% =================================================================================================
Index: /NEMO/branches/2020/tickets_icb_1900/doc/namelists/nam_tide
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/doc/namelists/nam_tide	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/doc/namelists/nam_tide	(revision 14012)
@@ -3,12 +3,16 @@
 !-----------------------------------------------------------------------
    ln_tide     = .false.      ! Activate tides
-      ln_tide_pot   = .true.                !  use tidal potential forcing
+      nn_tide_var   = 1          !  Variant of tidal parameter set and tide-potential computation
+      !                          !     (1: default; 0: compatibility with previous versions)
+      ln_tide_dia   = .false.    !  Enable tidal diagnostic output
+      ln_tide_pot   = .false.               !  use tidal potential forcing
+         rn_tide_gamma = 0.7                   ! Tidal tilt factor
          ln_scal_load  = .false.               ! Use scalar approximation for
             rn_scal_load = 0.094               !     load potential
          ln_read_load  = .false.               ! Or read load potential from file
             cn_tide_load = 'tide_LOAD_grid_T.nc'  ! filename for load potential
-            !      
+            !
       ln_tide_ramp  = .false.               !  Use linear ramp for tides at startup
-         rdttideramp   =    0.                 !  ramp duration in days
-      clname(1)     = 'DUMMY'               !  name of constituent - all tidal components must be set in namelist_cfg
+         rn_tide_ramp_dt = 0.               !  ramp duration in days
+      sn_tide_cnames(1) = 'DUMMY'               !  name of constituent - all tidal components must be set in namelist_cfg
 /
Index: /NEMO/branches/2020/tickets_icb_1900/doc/namelists/nambdy_tide
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/doc/namelists/nambdy_tide	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/doc/namelists/nambdy_tide	(revision 14012)
@@ -4,4 +4,3 @@
    filtide          = 'bdydta/amm12_bdytide_'   !  file name root of tidal forcing files
    ln_bdytide_2ddta = .false.                   !
-   ln_bdytide_conj  = .false.                   ! 
 /
Index: /NEMO/branches/2020/tickets_icb_1900/src/ICE/icedia.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/ICE/icedia.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/ICE/icedia.F90	(revision 14012)
@@ -261,9 +261,9 @@
          ! Write in numriw (if iter == nitrst)
          ! ------------------ 
-         CALL iom_rstput( iter, nitrst, numriw, 'frc_voltop' , frc_voltop  )
-         CALL iom_rstput( iter, nitrst, numriw, 'frc_volbot' , frc_volbot  )
-         CALL iom_rstput( iter, nitrst, numriw, 'frc_temtop' , frc_temtop  )
-         CALL iom_rstput( iter, nitrst, numriw, 'frc_tembot' , frc_tembot  )
-         CALL iom_rstput( iter, nitrst, numriw, 'frc_sal'    , frc_sal     )
+         CALL iom_rstput( iter, nitrst, numriw, 'frc_voltop' , frc_voltop )
+         CALL iom_rstput( iter, nitrst, numriw, 'frc_volbot' , frc_volbot )
+         CALL iom_rstput( iter, nitrst, numriw, 'frc_temtop' , frc_temtop )
+         CALL iom_rstput( iter, nitrst, numriw, 'frc_tembot' , frc_tembot )
+         CALL iom_rstput( iter, nitrst, numriw, 'frc_sal'    , frc_sal    )
          CALL iom_rstput( iter, nitrst, numriw, 'vol_loc_ini', vol_loc_ini )
          CALL iom_rstput( iter, nitrst, numriw, 'tem_loc_ini', tem_loc_ini )
Index: /NEMO/branches/2020/tickets_icb_1900/src/ICE/icedyn_adv_pra.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/ICE/icedyn_adv_pra.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/ICE/icedyn_adv_pra.F90	(revision 14012)
@@ -989,18 +989,28 @@
             DO jk = 1, nlay_s
                WRITE(zchar1,'(I2.2)') jk
-               znam = 'sxc0'//'_l'//zchar1  ;   CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp )   ;   sxc0 (:,:,jk,:) = z3d(:,:,:)
-               znam = 'syc0'//'_l'//zchar1  ;   CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp )   ;   syc0 (:,:,jk,:) = z3d(:,:,:)
-               znam = 'sxxc0'//'_l'//zchar1 ;   CALL iom_get( numrir, jpdom_auto, znam , z3d )   ;   sxxc0(:,:,jk,:) = z3d(:,:,:)
-               znam = 'syyc0'//'_l'//zchar1 ;   CALL iom_get( numrir, jpdom_auto, znam , z3d )   ;   syyc0(:,:,jk,:) = z3d(:,:,:)
-               znam = 'sxyc0'//'_l'//zchar1 ;   CALL iom_get( numrir, jpdom_auto, znam , z3d )   ;   sxyc0(:,:,jk,:) = z3d(:,:,:)
+               znam = 'sxc0'//'_l'//zchar1  
+               CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp )   ;   sxc0 (:,:,jk,:) = z3d(:,:,:)
+               znam = 'syc0'//'_l'//zchar1  
+               CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp )   ;   syc0 (:,:,jk,:) = z3d(:,:,:)
+               znam = 'sxxc0'//'_l'//zchar1 
+               CALL iom_get( numrir, jpdom_auto, znam , z3d )   ;   sxxc0(:,:,jk,:) = z3d(:,:,:)
+               znam = 'syyc0'//'_l'//zchar1 
+               CALL iom_get( numrir, jpdom_auto, znam , z3d )   ;   syyc0(:,:,jk,:) = z3d(:,:,:)
+               znam = 'sxyc0'//'_l'//zchar1 
+               CALL iom_get( numrir, jpdom_auto, znam , z3d )   ;   sxyc0(:,:,jk,:) = z3d(:,:,:)
             END DO
             !                                                        ! ice layers heat content
             DO jk = 1, nlay_i
                WRITE(zchar1,'(I2.2)') jk
-               znam = 'sxe'//'_l'//zchar1   ;   CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp )   ;   sxe (:,:,jk,:) = z3d(:,:,:)
-               znam = 'sye'//'_l'//zchar1   ;   CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp )   ;   sye (:,:,jk,:) = z3d(:,:,:)
-               znam = 'sxxe'//'_l'//zchar1  ;   CALL iom_get( numrir, jpdom_auto, znam , z3d )   ;   sxxe(:,:,jk,:) = z3d(:,:,:)
-               znam = 'syye'//'_l'//zchar1  ;   CALL iom_get( numrir, jpdom_auto, znam , z3d )   ;   syye(:,:,jk,:) = z3d(:,:,:)
-               znam = 'sxye'//'_l'//zchar1  ;   CALL iom_get( numrir, jpdom_auto, znam , z3d )   ;   sxye(:,:,jk,:) = z3d(:,:,:)
+               znam = 'sxe'//'_l'//zchar1   
+               CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp )   ;   sxe (:,:,jk,:) = z3d(:,:,:)
+               znam = 'sye'//'_l'//zchar1   
+               CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp )   ;   sye (:,:,jk,:) = z3d(:,:,:)
+               znam = 'sxxe'//'_l'//zchar1  
+               CALL iom_get( numrir, jpdom_auto, znam , z3d )   ;   sxxe(:,:,jk,:) = z3d(:,:,:)
+               znam = 'syye'//'_l'//zchar1  
+               CALL iom_get( numrir, jpdom_auto, znam , z3d )   ;   syye(:,:,jk,:) = z3d(:,:,:)
+               znam = 'sxye'//'_l'//zchar1  
+               CALL iom_get( numrir, jpdom_auto, znam , z3d )   ;   sxye(:,:,jk,:) = z3d(:,:,:)
             END DO
             !
@@ -1067,50 +1077,60 @@
          !
          !                                                           ! ice thickness
-         CALL iom_rstput( iter, nitrst, numriw, 'sxice' , sxice  )
-         CALL iom_rstput( iter, nitrst, numriw, 'syice' , syice  )
-         CALL iom_rstput( iter, nitrst, numriw, 'sxxice', sxxice )
-         CALL iom_rstput( iter, nitrst, numriw, 'syyice', syyice )
-         CALL iom_rstput( iter, nitrst, numriw, 'sxyice', sxyice )
+         CALL iom_rstput( iter, nitrst, numriw, 'sxice' , sxice)
+         CALL iom_rstput( iter, nitrst, numriw, 'syice' , syice)
+         CALL iom_rstput( iter, nitrst, numriw, 'sxxice', sxxice)
+         CALL iom_rstput( iter, nitrst, numriw, 'syyice', syyice)
+         CALL iom_rstput( iter, nitrst, numriw, 'sxyice', sxyice)
          !                                                           ! snow thickness
-         CALL iom_rstput( iter, nitrst, numriw, 'sxsn'  , sxsn   )
-         CALL iom_rstput( iter, nitrst, numriw, 'sysn'  , sysn   )
-         CALL iom_rstput( iter, nitrst, numriw, 'sxxsn' , sxxsn  )
-         CALL iom_rstput( iter, nitrst, numriw, 'syysn' , syysn  )
-         CALL iom_rstput( iter, nitrst, numriw, 'sxysn' , sxysn  )
+         CALL iom_rstput( iter, nitrst, numriw, 'sxsn'  , sxsn )
+         CALL iom_rstput( iter, nitrst, numriw, 'sysn'  , sysn )
+         CALL iom_rstput( iter, nitrst, numriw, 'sxxsn' , sxxsn )
+         CALL iom_rstput( iter, nitrst, numriw, 'syysn' , syysn )
+         CALL iom_rstput( iter, nitrst, numriw, 'sxysn' , sxysn )
          !                                                           ! ice concentration
-         CALL iom_rstput( iter, nitrst, numriw, 'sxa'   , sxa    )
-         CALL iom_rstput( iter, nitrst, numriw, 'sya'   , sya    )
-         CALL iom_rstput( iter, nitrst, numriw, 'sxxa'  , sxxa   )
-         CALL iom_rstput( iter, nitrst, numriw, 'syya'  , syya   )
-         CALL iom_rstput( iter, nitrst, numriw, 'sxya'  , sxya   )
+         CALL iom_rstput( iter, nitrst, numriw, 'sxa'   , sxa  )
+         CALL iom_rstput( iter, nitrst, numriw, 'sya'   , sya  )
+         CALL iom_rstput( iter, nitrst, numriw, 'sxxa'  , sxxa  )
+         CALL iom_rstput( iter, nitrst, numriw, 'syya'  , syya  )
+         CALL iom_rstput( iter, nitrst, numriw, 'sxya'  , sxya  )
          !                                                           ! ice salinity
-         CALL iom_rstput( iter, nitrst, numriw, 'sxsal' , sxsal  )
-         CALL iom_rstput( iter, nitrst, numriw, 'sysal' , sysal  )
-         CALL iom_rstput( iter, nitrst, numriw, 'sxxsal', sxxsal )
-         CALL iom_rstput( iter, nitrst, numriw, 'syysal', syysal )
-         CALL iom_rstput( iter, nitrst, numriw, 'sxysal', sxysal )
+         CALL iom_rstput( iter, nitrst, numriw, 'sxsal' , sxsal)
+         CALL iom_rstput( iter, nitrst, numriw, 'sysal' , sysal)
+         CALL iom_rstput( iter, nitrst, numriw, 'sxxsal', sxxsal)
+         CALL iom_rstput( iter, nitrst, numriw, 'syysal', syysal)
+         CALL iom_rstput( iter, nitrst, numriw, 'sxysal', sxysal)
          !                                                           ! ice age
-         CALL iom_rstput( iter, nitrst, numriw, 'sxage' , sxage  )
-         CALL iom_rstput( iter, nitrst, numriw, 'syage' , syage  )
-         CALL iom_rstput( iter, nitrst, numriw, 'sxxage', sxxage )
-         CALL iom_rstput( iter, nitrst, numriw, 'syyage', syyage )
-         CALL iom_rstput( iter, nitrst, numriw, 'sxyage', sxyage )
+         CALL iom_rstput( iter, nitrst, numriw, 'sxage' , sxage)
+         CALL iom_rstput( iter, nitrst, numriw, 'syage' , syage)
+         CALL iom_rstput( iter, nitrst, numriw, 'sxxage', sxxage)
+         CALL iom_rstput( iter, nitrst, numriw, 'syyage', syyage)
+         CALL iom_rstput( iter, nitrst, numriw, 'sxyage', sxyage)
          !                                                           ! snow layers heat content
          DO jk = 1, nlay_s
             WRITE(zchar1,'(I2.2)') jk
-            znam = 'sxc0'//'_l'//zchar1  ;   z3d(:,:,:) = sxc0 (:,:,jk,:)  ;   CALL iom_rstput( iter, nitrst, numriw, znam , z3d )
-            znam = 'syc0'//'_l'//zchar1  ;   z3d(:,:,:) = syc0 (:,:,jk,:)  ;   CALL iom_rstput( iter, nitrst, numriw, znam , z3d )
-            znam = 'sxxc0'//'_l'//zchar1 ;   z3d(:,:,:) = sxxc0(:,:,jk,:)  ;   CALL iom_rstput( iter, nitrst, numriw, znam , z3d )
-            znam = 'syyc0'//'_l'//zchar1 ;   z3d(:,:,:) = syyc0(:,:,jk,:)  ;   CALL iom_rstput( iter, nitrst, numriw, znam , z3d )
-            znam = 'sxyc0'//'_l'//zchar1 ;   z3d(:,:,:) = sxyc0(:,:,jk,:)  ;   CALL iom_rstput( iter, nitrst, numriw, znam , z3d )
+            znam = 'sxc0'//'_l'//zchar1  ;   z3d(:,:,:) = sxc0 (:,:,jk,:)
+            CALL iom_rstput( iter, nitrst, numriw, znam , z3d)
+            znam = 'syc0'//'_l'//zchar1  ;   z3d(:,:,:) = syc0 (:,:,jk,:)
+            CALL iom_rstput( iter, nitrst, numriw, znam , z3d)
+            znam = 'sxxc0'//'_l'//zchar1 ;   z3d(:,:,:) = sxxc0(:,:,jk,:)
+            CALL iom_rstput( iter, nitrst, numriw, znam , z3d)
+            znam = 'syyc0'//'_l'//zchar1 ;   z3d(:,:,:) = syyc0(:,:,jk,:)
+            CALL iom_rstput( iter, nitrst, numriw, znam , z3d)
+            znam = 'sxyc0'//'_l'//zchar1 ;   z3d(:,:,:) = sxyc0(:,:,jk,:)
+            CALL iom_rstput( iter, nitrst, numriw, znam , z3d)
          END DO
          !                                                           ! ice layers heat content
          DO jk = 1, nlay_i
             WRITE(zchar1,'(I2.2)') jk
-            znam = 'sxe'//'_l'//zchar1   ;   z3d(:,:,:) = sxe (:,:,jk,:)   ;   CALL iom_rstput( iter, nitrst, numriw, znam , z3d )
-            znam = 'sye'//'_l'//zchar1   ;   z3d(:,:,:) = sye (:,:,jk,:)   ;   CALL iom_rstput( iter, nitrst, numriw, znam , z3d )
-            znam = 'sxxe'//'_l'//zchar1  ;   z3d(:,:,:) = sxxe(:,:,jk,:)   ;   CALL iom_rstput( iter, nitrst, numriw, znam , z3d )
-            znam = 'syye'//'_l'//zchar1  ;   z3d(:,:,:) = syye(:,:,jk,:)   ;   CALL iom_rstput( iter, nitrst, numriw, znam , z3d )
-            znam = 'sxye'//'_l'//zchar1  ;   z3d(:,:,:) = sxye(:,:,jk,:)   ;   CALL iom_rstput( iter, nitrst, numriw, znam , z3d )
+            znam = 'sxe'//'_l'//zchar1   ;   z3d(:,:,:) = sxe (:,:,jk,:)
+            CALL iom_rstput( iter, nitrst, numriw, znam , z3d)
+            znam = 'sye'//'_l'//zchar1   ;   z3d(:,:,:) = sye (:,:,jk,:)
+            CALL iom_rstput( iter, nitrst, numriw, znam , z3d)
+            znam = 'sxxe'//'_l'//zchar1  ;   z3d(:,:,:) = sxxe(:,:,jk,:)
+            CALL iom_rstput( iter, nitrst, numriw, znam , z3d)
+            znam = 'syye'//'_l'//zchar1  ;   z3d(:,:,:) = syye(:,:,jk,:)
+            CALL iom_rstput( iter, nitrst, numriw, znam , z3d)
+            znam = 'sxye'//'_l'//zchar1  ;   z3d(:,:,:) = sxye(:,:,jk,:)
+            CALL iom_rstput( iter, nitrst, numriw, znam , z3d)
          END DO
          !
Index: /NEMO/branches/2020/tickets_icb_1900/src/ICE/icedyn_rhg_evp.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/ICE/icedyn_rhg_evp.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/ICE/icedyn_rhg_evp.F90	(revision 14012)
@@ -199,5 +199,5 @@
          zfmask(ji,jj) = tmask(ji,jj,1) * tmask(ji+1,jj,1) * tmask(ji,jj+1,1) * tmask(ji+1,jj+1,1)
       END_2D
-      CALL lbc_lnk( 'icedyn_rhg_evp', zfmask, 'F', 1._wp )
+      CALL lbc_lnk( 'icedyn_rhg_evp', zfmask, 'F', 1._wp)
 
       ! Lateral boundary conditions on velocity (modify zfmask)
@@ -1033,6 +1033,6 @@
          iter = kt + nn_fsbc - 1             ! ice restarts are written at kt == nitrst - nn_fsbc + 1
          !
-         CALL iom_rstput( iter, nitrst, numriw, 'stress1_i' , stress1_i  )
-         CALL iom_rstput( iter, nitrst, numriw, 'stress2_i' , stress2_i  )
+         CALL iom_rstput( iter, nitrst, numriw, 'stress1_i' , stress1_i )
+         CALL iom_rstput( iter, nitrst, numriw, 'stress2_i' , stress2_i )
          CALL iom_rstput( iter, nitrst, numriw, 'stress12_i', stress12_i )
          !
Index: /NEMO/branches/2020/tickets_icb_1900/src/ICE/icerst.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/ICE/icerst.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/ICE/icerst.F90	(revision 14012)
@@ -55,4 +55,5 @@
       CHARACTER(len=50)   ::   clname   ! ice output restart file name
       CHARACTER(len=256)  ::   clpath   ! full path to ice output restart file 
+      CHARACTER(LEN=52)   ::   clpname   ! ocean output restart file name including prefix for AGRIF
       !!----------------------------------------------------------------------
       !
@@ -84,5 +85,22 @@
             ENDIF
             !
-            CALL iom_open( TRIM(clpath)//TRIM(clname), numriw, ldwrt = .TRUE., kdlev = jpl, cdcomp = 'ICE' )
+            IF(.NOT.lwxios) THEN
+               CALL iom_open( TRIM(clpath)//TRIM(clname), numriw, ldwrt = .TRUE., kdlev = jpl, cdcomp = 'ICE' )
+            ELSE
+#if defined key_iomput
+               cw_icerst_cxt = "rstwi_"//TRIM(ADJUSTL(clkt))
+               IF( TRIM(Agrif_CFixed()) == '0' ) THEN
+                  clpname = clname
+               ELSE
+                  clpname = TRIM(Agrif_CFixed())//"_"//clname
+               ENDIF
+               numriw = iom_xios_setid(TRIM(clpath)//TRIM(clpname))
+               CALL iom_init( cw_icerst_cxt, kdid = numriw, ld_closedef = .FALSE. )
+               CALL iom_swap( cxios_context )
+#else
+               clinfo = 'Can not use XIOS in rst_opn'
+               CALL ctl_stop(TRIM(clinfo))
+#endif
+            ENDIF
             lrst_ice = .TRUE.
          ENDIF
@@ -117,5 +135,5 @@
          IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~'         
       ENDIF
-
+      
       ! Write in numriw (if iter == nitrst)
       ! ------------------ 
@@ -123,5 +141,6 @@
       CALL iom_rstput( iter, nitrst, numriw, 'nn_fsbc', REAL( nn_fsbc, wp ) )      ! time-step 
       CALL iom_rstput( iter, nitrst, numriw, 'kt_ice' , REAL( iter   , wp ) )      ! date
-      CALL iom_delay_rst( 'WRITE', 'ICE', numriw )   ! save only ice delayed global communication variables
+      
+      IF(.NOT.lwxios) CALL iom_delay_rst( 'WRITE', 'ICE', numriw )   ! save only ice delayed global communication variables
 
       ! Prognostic variables
@@ -154,5 +173,5 @@
       IF( ln_cpl ) THEN
          CALL iom_rstput( iter, nitrst, numriw, 'cnd_ice', cnd_ice )
-         CALL iom_rstput( iter, nitrst, numriw, 't1_ice' , t1_ice  )
+         CALL iom_rstput( iter, nitrst, numriw, 't1_ice' , t1_ice )
       ENDIF
       !
@@ -161,5 +180,11 @@
       ! ------------------
       IF( iter == nitrst ) THEN
-         CALL iom_close( numriw )
+         IF(.NOT.lwxios) THEN
+            CALL iom_close( numriw )
+         ELSE
+            CALL iom_context_finalize(      cw_icerst_cxt          )
+            iom_file(numriw)%nfid       = 0
+            numriw = 0
+         ENDIF
          lrst_ice = .FALSE.
       ENDIF
@@ -181,4 +206,5 @@
       CHARACTER(len=2)  ::   zchar, zchar1
       REAL(wp)          ::   zfice, ziter
+      CHARACTER(lc)     ::   clpname
       REAL(wp), DIMENSION(jpi,jpj,jpl) ::   z3d   ! 3D workspace
       !!----------------------------------------------------------------------
@@ -190,5 +216,17 @@
       ENDIF
 
+      lxios_sini = .FALSE.
       CALL iom_open ( TRIM(cn_icerst_indir)//'/'//cn_icerst_in, numrir )
+
+      IF( lrxios) THEN
+          cr_icerst_cxt = 'si3_rst'
+          IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS for SI3'
+!         IF( TRIM(Agrif_CFixed()) == '0' ) THEN
+!            clpname = cn_icerst_in
+!         ELSE
+!            clpname = TRIM(Agrif_CFixed())//"_"//cn_icerst_in   
+!         ENDIF
+          CALL iom_init( cr_icerst_cxt, kdid = numrir, ld_closedef = .TRUE. )
+      ENDIF
 
       ! test if v_i exists 
@@ -198,5 +236,4 @@
       IF( id0 > 0 ) THEN   ! == case of a normal restart == !
          !                 ! ------------------------------ !
-         
          ! Time info
          CALL iom_get( numrir, 'nn_fsbc', zfice )
@@ -278,6 +315,5 @@
          ENDIF
 
-         CALL iom_delay_rst( 'READ', 'ICE', numrir )   ! read only ice delayed global communication variables
-
+         IF(.NOT.lrxios) CALL iom_delay_rst( 'READ', 'ICE', numrir )   ! read only ice delayed global communication variables
          !                 ! ---------------------------------- !
       ELSE                 ! == case of a simplified restart == !
Index: /NEMO/branches/2020/tickets_icb_1900/src/ICE/icestp.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/ICE/icestp.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/ICE/icestp.F90	(revision 14012)
@@ -291,5 +291,8 @@
       tn_ice(:,:,:) = t_su(:,:,:)      ! initialisation of surface temp for coupled simu
       !
-      IF( ln_rstart )   CALL iom_close( numrir )  ! close input ice restart file
+      IF( ln_rstart )  THEN
+         CALL iom_close( numrir )  ! close input ice restart file
+         IF(lrxios) CALL iom_context_finalize(      cr_icerst_cxt         )
+      ENDIF
       !
    END SUBROUTINE ice_init
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/ASM/asminc.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/ASM/asminc.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/ASM/asminc.F90	(revision 14012)
@@ -26,4 +26,5 @@
    USE par_oce         ! Ocean space and time domain variables
    USE dom_oce         ! Ocean space and time domain
+   USE domain, ONLY : dom_tile
    USE domvvl          ! domain: variable volume level
    USE ldfdyn          ! lateral diffusion: eddy viscosity coefficients
@@ -518,14 +519,16 @@
       !
       INTEGER  :: ji, jj, jk
-      INTEGER  :: it
+      INTEGER  :: it, itile
       REAL(wp) :: zincwgt  ! IAU weight for current time step
-      REAL (wp), DIMENSION(jpi,jpj,jpk) :: fzptnz ! 3d freezing point values
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk) :: fzptnz ! 3d freezing point values
       !!----------------------------------------------------------------------
       !
       ! freezing point calculation taken from oc_fz_pt (but calculated for all depths) 
       ! used to prevent the applied increments taking the temperature below the local freezing point 
-      DO jk = 1, jpkm1
-        CALL eos_fzp( pts(:,:,jk,jp_sal,Kmm), fzptnz(:,:,jk), gdept(:,:,jk,Kmm) )
-      END DO
+      IF( ln_temnofreeze ) THEN
+         DO jk = 1, jpkm1
+           CALL eos_fzp( pts(:,:,jk,jp_sal,Kmm), fzptnz(:,:,jk), gdept(:,:,jk,Kmm) )
+         END DO
+      ENDIF
          !
          !                             !--------------------------------------
@@ -538,8 +541,10 @@
             zincwgt = wgtiau(it) / rn_Dt   ! IAU weight for the current time step
             !
-            IF(lwp) THEN
-               WRITE(numout,*) 
-               WRITE(numout,*) 'tra_asm_inc : Tracer IAU at time step = ', kt,' with IAU weight = ', wgtiau(it)
-               WRITE(numout,*) '~~~~~~~~~~~~'
+            IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile
+               IF(lwp) THEN
+                  WRITE(numout,*)
+                  WRITE(numout,*) 'tra_asm_inc : Tracer IAU at time step = ', kt,' with IAU weight = ', wgtiau(it)
+                  WRITE(numout,*) '~~~~~~~~~~~~'
+               ENDIF
             ENDIF
             !
@@ -548,20 +553,24 @@
                IF (ln_temnofreeze) THEN
                   ! Do not apply negative increments if the temperature will fall below freezing
-                  WHERE(t_bkginc(:,:,jk) > 0.0_wp .OR. &
-                     &   pts(:,:,jk,jp_tem,Kmm) + pts(:,:,jk,jp_tem,Krhs) + t_bkginc(:,:,jk) * wgtiau(it) > fzptnz(:,:,jk) ) 
-                     pts(:,:,jk,jp_tem,Krhs) = pts(:,:,jk,jp_tem,Krhs) + t_bkginc(:,:,jk) * zincwgt  
+                  WHERE(t_bkginc(A2D(0),jk) > 0.0_wp .OR. &
+                     &   pts(A2D(0),jk,jp_tem,Kmm) + pts(A2D(0),jk,jp_tem,Krhs) + t_bkginc(A2D(0),jk) * wgtiau(it) > fzptnz(:,:,jk) )
+                     pts(A2D(0),jk,jp_tem,Krhs) = pts(A2D(0),jk,jp_tem,Krhs) + t_bkginc(A2D(0),jk) * zincwgt
                   END WHERE
                ELSE
-                  pts(:,:,jk,jp_tem,Krhs) = pts(:,:,jk,jp_tem,Krhs) + t_bkginc(:,:,jk) * zincwgt  
+                  DO_2D( 0, 0, 0, 0 )
+                     pts(ji,jj,jk,jp_tem,Krhs) = pts(ji,jj,jk,jp_tem,Krhs) + t_bkginc(ji,jj,jk) * zincwgt
+                  END_2D
                ENDIF
                IF (ln_salfix) THEN
                   ! Do not apply negative increments if the salinity will fall below a specified
                   ! minimum value salfixmin
-                  WHERE(s_bkginc(:,:,jk) > 0.0_wp .OR. &
-                     &   pts(:,:,jk,jp_sal,Kmm) + pts(:,:,jk,jp_sal,Krhs) + s_bkginc(:,:,jk) * wgtiau(it) > salfixmin ) 
-                     pts(:,:,jk,jp_sal,Krhs) = pts(:,:,jk,jp_sal,Krhs) + s_bkginc(:,:,jk) * zincwgt
+                  WHERE(s_bkginc(A2D(0),jk) > 0.0_wp .OR. &
+                     &   pts(A2D(0),jk,jp_sal,Kmm) + pts(A2D(0),jk,jp_sal,Krhs) + s_bkginc(A2D(0),jk) * wgtiau(it) > salfixmin )
+                     pts(A2D(0),jk,jp_sal,Krhs) = pts(A2D(0),jk,jp_sal,Krhs) + s_bkginc(A2D(0),jk) * zincwgt
                   END WHERE
                ELSE
-                  pts(:,:,jk,jp_sal,Krhs) = pts(:,:,jk,jp_sal,Krhs) + s_bkginc(:,:,jk) * zincwgt
+                  DO_2D( 0, 0, 0, 0 )
+                     pts(ji,jj,jk,jp_sal,Krhs) = pts(ji,jj,jk,jp_sal,Krhs) + s_bkginc(ji,jj,jk) * zincwgt
+                  END_2D
                ENDIF
             END DO
@@ -569,7 +578,9 @@
          ENDIF
          !
-         IF ( kt == nitiaufin_r + 1  ) THEN   ! For bias crcn to work
-            DEALLOCATE( t_bkginc )
-            DEALLOCATE( s_bkginc )
+         IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only on the last tile
+            IF ( kt == nitiaufin_r + 1  ) THEN   ! For bias crcn to work
+               DEALLOCATE( t_bkginc )
+               DEALLOCATE( s_bkginc )
+            ENDIF
          ENDIF
          !                             !--------------------------------------
@@ -584,21 +595,27 @@
             IF (ln_temnofreeze) THEN
                ! Do not apply negative increments if the temperature will fall below freezing
-               WHERE( t_bkginc(:,:,:) > 0.0_wp .OR. pts(:,:,:,jp_tem,Kmm) + t_bkginc(:,:,:) > fzptnz(:,:,:) ) 
-                  pts(:,:,:,jp_tem,Kmm) = t_bkg(:,:,:) + t_bkginc(:,:,:)   
+               WHERE( t_bkginc(A2D(0),:) > 0.0_wp .OR. pts(A2D(0),:,jp_tem,Kmm) + t_bkginc(A2D(0),:) > fzptnz(:,:,:) )
+                  pts(A2D(0),:,jp_tem,Kmm) = t_bkg(A2D(0),:) + t_bkginc(A2D(0),:)
                END WHERE
             ELSE
-               pts(:,:,:,jp_tem,Kmm) = t_bkg(:,:,:) + t_bkginc(:,:,:)   
+               DO_3D( 0, 0, 0, 0, 1, jpk )
+                  pts(ji,jj,jk,jp_tem,Kmm) = t_bkg(ji,jj,jk) + t_bkginc(ji,jj,jk)
+               END_3D
             ENDIF
             IF (ln_salfix) THEN
                ! Do not apply negative increments if the salinity will fall below a specified
                ! minimum value salfixmin
-               WHERE( s_bkginc(:,:,:) > 0.0_wp .OR. pts(:,:,:,jp_sal,Kmm) + s_bkginc(:,:,:) > salfixmin ) 
-                  pts(:,:,:,jp_sal,Kmm) = s_bkg(:,:,:) + s_bkginc(:,:,:)   
+               WHERE( s_bkginc(A2D(0),:) > 0.0_wp .OR. pts(A2D(0),:,jp_sal,Kmm) + s_bkginc(A2D(0),:) > salfixmin )
+                  pts(A2D(0),:,jp_sal,Kmm) = s_bkg(A2D(0),:) + s_bkginc(A2D(0),:)
                END WHERE
             ELSE
-               pts(:,:,:,jp_sal,Kmm) = s_bkg(:,:,:) + s_bkginc(:,:,:)   
-            ENDIF
-
-            pts(:,:,:,:,Kbb) = pts(:,:,:,:,Kmm)                 ! Update before fields
+               DO_3D( 0, 0, 0, 0, 1, jpk )
+                  pts(ji,jj,jk,jp_sal,Kmm) = s_bkg(ji,jj,jk) + s_bkginc(ji,jj,jk)
+               END_3D
+            ENDIF
+
+            DO_3D( 0, 0, 0, 0, 1, jpk )
+               pts(ji,jj,jk,:,Kbb) = pts(ji,jj,jk,:,Kmm)             ! Update before fields
+            END_3D
 
             CALL eos( pts(:,:,:,:,Kbb), rhd, rhop, gdept_0(:,:,:) )  ! Before potential and in situ densities
@@ -607,15 +624,26 @@
 !!gm
 
-            IF( ln_zps .AND. .NOT. lk_c1d .AND. .NOT. ln_isfcav)           &
-               &  CALL zps_hde    ( kt, Kmm, jpts, pts(:,:,:,:,Kbb), gtsu, gtsv,        &  ! Partial steps: before horizontal gradient
-               &                              rhd, gru , grv               )  ! of t, s, rd at the last ocean level
-            IF( ln_zps .AND. .NOT. lk_c1d .AND.       ln_isfcav)                       &
-               &  CALL zps_hde_isf( nit000, Kmm, jpts, pts(:,:,:,:,Kbb), gtsu, gtsv, gtui, gtvi,    &  ! Partial steps for top cell (ISF)
-               &                                  rhd, gru , grv , grui, grvi          )  ! of t, s, rd at the last ocean level
-
-            DEALLOCATE( t_bkginc )
-            DEALLOCATE( s_bkginc )
-            DEALLOCATE( t_bkg    )
-            DEALLOCATE( s_bkg    )
+            ! TEMP: [tiling] This change not necessary after extra haloes development (lbc_lnk removed from zps_hde*)
+            IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only for the full domain
+               itile = ntile
+               IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 )            ! Use full domain
+
+               IF( ln_zps .AND. .NOT. lk_c1d .AND. .NOT. ln_isfcav)           &
+                  &  CALL zps_hde    ( kt, Kmm, jpts, pts(:,:,:,:,Kbb), gtsu, gtsv,        &  ! Partial steps: before horizontal gradient
+                  &                              rhd, gru , grv               )  ! of t, s, rd at the last ocean level
+               IF( ln_zps .AND. .NOT. lk_c1d .AND.       ln_isfcav)                       &
+                  &  CALL zps_hde_isf( nit000, Kmm, jpts, pts(:,:,:,:,Kbb), gtsu, gtsv, gtui, gtvi,    &  ! Partial steps for top cell (ISF)
+                  &                                  rhd, gru , grv , grui, grvi          )  ! of t, s, rd at the last ocean level
+
+               IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = itile )            ! Revert to tile domain
+            ENDIF
+
+            IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only on the last tile
+               DEALLOCATE( t_bkginc )
+               DEALLOCATE( s_bkginc )
+               DEALLOCATE( t_bkg    )
+               DEALLOCATE( s_bkg    )
+            ENDIF
+         !
          ENDIF
          !  
@@ -829,8 +857,9 @@
       INTEGER, INTENT(in), OPTIONAL ::   kindic   ! flag for disabling the deallocation
       !
+      INTEGER  ::   ji, jj
       INTEGER  ::   it
       REAL(wp) ::   zincwgt   ! IAU weight for current time step
 #if defined key_si3
-      REAL(wp), DIMENSION(jpi,jpj) ::   zofrld, zohicif, zseaicendg, zhicifinc
+      REAL(wp), DIMENSION(A2D(nn_hls)) ::   zofrld, zohicif, zseaicendg, zhicifinc
       REAL(wp) ::   zhicifmin = 0.5_wp      ! ice minimum depth in metres
 #endif
@@ -847,8 +876,10 @@
             ! note this is not a tendency so should not be divided by rn_Dt (as with the tracer and other increments)
             !
-            IF(lwp) THEN
-               WRITE(numout,*) 
-               WRITE(numout,*) 'seaice_asm_inc : sea ice conc IAU at time step = ', kt,' with IAU weight = ', wgtiau(it)
-               WRITE(numout,*) '~~~~~~~~~~~~'
+            IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile
+               IF(lwp) THEN
+                  WRITE(numout,*)
+                  WRITE(numout,*) 'seaice_asm_inc : sea ice conc IAU at time step = ', kt,' with IAU weight = ', wgtiau(it)
+                  WRITE(numout,*) '~~~~~~~~~~~~'
+               ENDIF
             ENDIF
             !
@@ -856,16 +887,18 @@
             !
 #if defined key_si3
-            zofrld (:,:) = 1._wp - at_i(:,:)
-            zohicif(:,:) = hm_i(:,:)
-            !
-            at_i  (:,:) = 1. - MIN( MAX( 1.-at_i  (:,:) - seaice_bkginc(:,:) * zincwgt, 0.0_wp), 1.0_wp)
-            at_i_b(:,:) = 1. - MIN( MAX( 1.-at_i_b(:,:) - seaice_bkginc(:,:) * zincwgt, 0.0_wp), 1.0_wp)
-            fr_i(:,:) = at_i(:,:)        ! adjust ice fraction
-            !
-            zseaicendg(:,:) = zofrld(:,:) - (1. - at_i(:,:))   ! find out actual sea ice nudge applied
+            DO_2D( 0, 0, 0, 0 )
+               zofrld (ji,jj) = 1._wp - at_i(ji,jj)
+               zohicif(ji,jj) = hm_i(ji,jj)
+               !
+               at_i  (ji,jj) = 1. - MIN( MAX( 1.-at_i  (ji,jj) - seaice_bkginc(ji,jj) * zincwgt, 0.0_wp), 1.0_wp)
+               at_i_b(ji,jj) = 1. - MIN( MAX( 1.-at_i_b(ji,jj) - seaice_bkginc(ji,jj) * zincwgt, 0.0_wp), 1.0_wp)
+               fr_i(ji,jj) = at_i(ji,jj)        ! adjust ice fraction
+               !
+               zseaicendg(ji,jj) = zofrld(ji,jj) - (1. - at_i(ji,jj))   ! find out actual sea ice nudge applied
+            END_2D
             !
             ! Nudge sea ice depth to bring it up to a required minimum depth
-            WHERE( zseaicendg(:,:) > 0.0_wp .AND. hm_i(:,:) < zhicifmin ) 
-               zhicifinc(:,:) = (zhicifmin - hm_i(:,:)) * zincwgt    
+            WHERE( zseaicendg(:,:) > 0.0_wp .AND. hm_i(A2D(0)) < zhicifmin )
+               zhicifinc(:,:) = (zhicifmin - hm_i(A2D(0))) * zincwgt
             ELSEWHERE
                zhicifinc(:,:) = 0.0_wp
@@ -873,5 +906,7 @@
             !
             ! nudge ice depth
-            hm_i (:,:) = hm_i (:,:) + zhicifinc(:,:)
+            DO_2D( 0, 0, 0, 0 )
+               hm_i (ji,jj) = hm_i (ji,jj) + zhicifinc(ji,jj)
+            END_2D
             !
             ! seaice salinity balancing (to add)
@@ -880,9 +915,13 @@
 #if defined key_cice && defined key_asminc
             ! Sea-ice : CICE case. Pass ice increment tendency into CICE
-            ndaice_da(:,:) = seaice_bkginc(:,:) * zincwgt / rn_Dt
-#endif
-            !
-            IF ( kt == nitiaufin_r ) THEN
-               DEALLOCATE( seaice_bkginc )
+            DO_2D( 0, 0, 0, 0 )
+               ndaice_da(ji,jj) = seaice_bkginc(ji,jj) * zincwgt / rn_Dt
+            END_2D
+#endif
+            !
+            IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only on the last tile
+               IF ( kt == nitiaufin_r ) THEN
+                  DEALLOCATE( seaice_bkginc )
+               ENDIF
             ENDIF
             !
@@ -890,5 +929,7 @@
             !
 #if defined key_cice && defined key_asminc
-            ndaice_da(:,:) = 0._wp        ! Sea-ice : CICE case. Zero ice increment tendency into CICE
+            DO_2D( 0, 0, 0, 0 )
+               ndaice_da(ji,jj) = 0._wp        ! Sea-ice : CICE case. Zero ice increment tendency into CICE
+            END_2D
 #endif
             !
@@ -905,17 +946,19 @@
             !
 #if defined key_si3
-            zofrld (:,:) = 1._wp - at_i(:,:)
-            zohicif(:,:) = hm_i(:,:)
-            ! 
-            ! Initialize the now fields the background + increment
-            at_i(:,:) = 1. - MIN( MAX( 1.-at_i(:,:) - seaice_bkginc(:,:), 0.0_wp), 1.0_wp)
-            at_i_b(:,:) = at_i(:,:) 
-            fr_i(:,:) = at_i(:,:)        ! adjust ice fraction
-            !
-            zseaicendg(:,:) = zofrld(:,:) - (1. - at_i(:,:))   ! find out actual sea ice nudge applied
+            DO_2D( 0, 0, 0, 0 )
+               zofrld (ji,jj) = 1._wp - at_i(ji,jj)
+               zohicif(ji,jj) = hm_i(ji,jj)
+               !
+               ! Initialize the now fields the background + increment
+               at_i(ji,jj) = 1. - MIN( MAX( 1.-at_i(ji,jj) - seaice_bkginc(ji,jj), 0.0_wp), 1.0_wp)
+               at_i_b(ji,jj) = at_i(ji,jj)
+               fr_i(ji,jj) = at_i(ji,jj)        ! adjust ice fraction
+               !
+               zseaicendg(ji,jj) = zofrld(ji,jj) - (1. - at_i(ji,jj))   ! find out actual sea ice nudge applied
+            END_2D
             !
             ! Nudge sea ice depth to bring it up to a required minimum depth
-            WHERE( zseaicendg(:,:) > 0.0_wp .AND. hm_i(:,:) < zhicifmin ) 
-               zhicifinc(:,:) = zhicifmin - hm_i(:,:)
+            WHERE( zseaicendg(:,:) > 0.0_wp .AND. hm_i(A2D(0)) < zhicifmin )
+               zhicifinc(:,:) = zhicifmin - hm_i(A2D(0))
             ELSEWHERE
                zhicifinc(:,:) = 0.0_wp
@@ -923,5 +966,7 @@
             !
             ! nudge ice depth
-            hm_i (:,:) = hm_i (:,:) + zhicifinc(:,:)
+            DO_2D( 0, 0, 0, 0 )
+               hm_i(ji,jj) = hm_i (ji,jj) + zhicifinc(ji,jj)
+            END_2D
             !
             ! seaice salinity balancing (to add)
@@ -930,14 +975,20 @@
 #if defined key_cice && defined key_asminc
             ! Sea-ice : CICE case. Pass ice increment tendency into CICE
-           ndaice_da(:,:) = seaice_bkginc(:,:) / rn_Dt
-#endif
-            IF ( .NOT. PRESENT(kindic) ) THEN
-               DEALLOCATE( seaice_bkginc )
-            END IF
+            DO_2D( 0, 0, 0, 0 )
+               ndaice_da(ji,jj) = seaice_bkginc(ji,jj) / rn_Dt
+            END_2D
+#endif
+            IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only on the last tile
+               IF ( .NOT. PRESENT(kindic) ) THEN
+                  DEALLOCATE( seaice_bkginc )
+               END IF
+            ENDIF
             !
          ELSE
             !
 #if defined key_cice && defined key_asminc
-            ndaice_da(:,:) = 0._wp     ! Sea-ice : CICE case. Zero ice increment tendency into CICE
+            DO_2D( 0, 0, 0, 0 )
+               ndaice_da(ji,jj) = 0._wp     ! Sea-ice : CICE case. Zero ice increment tendency into CICE
+            END_2D
 #endif
             !
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/BDY/bdytra.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/BDY/bdytra.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/BDY/bdytra.F90	(revision 14012)
@@ -13,5 +13,5 @@
    !!----------------------------------------------------------------------
    USE oce            ! ocean dynamics and tracers variables
-   USE dom_oce        ! ocean space and time domain variables 
+   USE dom_oce        ! ocean space and time domain variables
    USE bdy_oce        ! ocean open boundary conditions
    USE bdylib         ! for orlanski library routines
@@ -157,4 +157,5 @@
       INTEGER  ::   ib_bdy         ! Loop index
       !!----------------------------------------------------------------------
+      IF( ntile /= 0 .AND. ntile /= 1 ) RETURN                        ! Do only for the full domain
       !
       IF( ln_timing )   CALL timing_start('bdy_tra_dmp')
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/C1D/step_c1d.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/C1D/step_c1d.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/C1D/step_c1d.F90	(revision 14012)
@@ -122,4 +122,7 @@
                         CALL dyn_atf    ( kstp, Nbb, Nnn, Naa , uu, vv, e3t, e3u, e3v )  ! time filtering of "now" fields
       IF(.NOT.ln_linssh)CALL ssh_atf    ( kstp, Nbb, Nnn, Naa , ssh )                    ! time filtering of "now" sea surface height
+      IF( kstp == nit000 .AND. ln_linssh) THEN
+         ssh(:,:,Naa) = ssh(:,:,Nnn)  ! init ssh after in ln_linssh case
+      ENDIF
       !
       ! Swap time levels
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/DIA/diaar5.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/DIA/diaar5.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/DIA/diaar5.F90	(revision 14012)
@@ -34,4 +34,5 @@
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:  ) ::   thick0       ! ocean thickness (interior domain)
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   sn0          ! initial salinity
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   hstr_adv, hstr_ldf
 
    LOGICAL  :: l_ar5
@@ -54,5 +55,6 @@
       !!----------------------------------------------------------------------
       !
-      ALLOCATE( thick0(jpi,jpj) , sn0(jpi,jpj,jpk) , STAT=dia_ar5_alloc )
+      ALLOCATE( thick0(jpi,jpj) , sn0(jpi,jpj,jpk) , &
+         &      hstr_adv(jpi,jpj,jpts,2), hstr_ldf(jpi,jpj,jpts,2), STAT=dia_ar5_alloc )
       !
       CALL mpp_sum ( 'diaar5', dia_ar5_alloc )
@@ -304,6 +306,6 @@
    END SUBROUTINE dia_ar5
 
-
-   SUBROUTINE dia_ar5_hst( ktra, cptr, puflx, pvflx ) 
+   ! TEMP: [tiling] These changes not necessary if using XIOS (subdomain support, will not output haloes)
+   SUBROUTINE dia_ar5_hst( ktra, cptr, puflx, pvflx )
       !!----------------------------------------------------------------------
       !!                    ***  ROUTINE dia_ar5_htr ***
@@ -314,39 +316,47 @@
       INTEGER                         , INTENT(in )  :: ktra  ! tracer index
       CHARACTER(len=3)                , INTENT(in)   :: cptr  ! transport type  'adv'/'ldf'
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in)   :: puflx  ! u-flux of advection/diffusion
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in)   :: pvflx  ! v-flux of advection/diffusion
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk)    , INTENT(in)   :: puflx  ! u-flux of advection/diffusion
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk)    , INTENT(in)   :: pvflx  ! v-flux of advection/diffusion
       !
       INTEGER    ::  ji, jj, jk
-      REAL(wp), DIMENSION(jpi,jpj)  :: z2d
-
+
+      IF( cptr /= 'adv' .AND. cptr /= 'ldf' ) RETURN
+      IF( ktra /= jp_tem .AND. ktra /= jp_sal ) RETURN
+
+      IF( cptr == 'adv' ) THEN
+         DO_2D( 0, 0, 0, 0 )
+            hstr_adv(ji,jj,ktra,1) = puflx(ji,jj,1)
+            hstr_adv(ji,jj,ktra,2) = pvflx(ji,jj,1)
+         END_2D
+         DO_3D( 0, 0, 0, 0, 1, jpkm1 )
+            hstr_adv(ji,jj,ktra,1) = hstr_adv(ji,jj,ktra,1) + puflx(ji,jj,jk)
+            hstr_adv(ji,jj,ktra,2) = hstr_adv(ji,jj,ktra,2) + pvflx(ji,jj,jk)
+         END_3D
+      ELSE IF( cptr == 'ldf' ) THEN
+         DO_2D( 0, 0, 0, 0 )
+            hstr_ldf(ji,jj,ktra,1) = puflx(ji,jj,1)
+            hstr_ldf(ji,jj,ktra,2) = pvflx(ji,jj,1)
+         END_2D
+         DO_3D( 0, 0, 0, 0, 1, jpkm1 )
+            hstr_ldf(ji,jj,ktra,1) = hstr_ldf(ji,jj,ktra,1) + puflx(ji,jj,jk)
+            hstr_ldf(ji,jj,ktra,2) = hstr_ldf(ji,jj,ktra,2) + pvflx(ji,jj,jk)
+         END_3D
+      ENDIF
+
+      IF( ntile == 0 .OR. ntile == nijtile ) THEN
+         IF( cptr == 'adv' ) THEN
+            IF( ktra == jp_tem ) CALL iom_put( 'uadv_heattr' , rho0_rcp * hstr_adv(:,:,ktra,1) )  ! advective heat transport in i-direction
+            IF( ktra == jp_sal ) CALL iom_put( 'uadv_salttr' , rho0     * hstr_adv(:,:,ktra,1) )  ! advective salt transport in i-direction
+            IF( ktra == jp_tem ) CALL iom_put( 'vadv_heattr' , rho0_rcp * hstr_adv(:,:,ktra,2) )  ! advective heat transport in j-direction
+            IF( ktra == jp_sal ) CALL iom_put( 'vadv_salttr' , rho0     * hstr_adv(:,:,ktra,2) )  ! advective salt transport in j-direction
+         ENDIF
+         IF( cptr == 'ldf' ) THEN
+            IF( ktra == jp_tem ) CALL iom_put( 'udiff_heattr' , rho0_rcp * hstr_ldf(:,:,ktra,1) ) ! diffusive heat transport in i-direction
+            IF( ktra == jp_sal ) CALL iom_put( 'udiff_salttr' , rho0     * hstr_ldf(:,:,ktra,1) ) ! diffusive salt transport in i-direction
+            IF( ktra == jp_tem ) CALL iom_put( 'vdiff_heattr' , rho0_rcp * hstr_ldf(:,:,ktra,2) ) ! diffusive heat transport in j-direction
+            IF( ktra == jp_sal ) CALL iom_put( 'vdiff_salttr' , rho0     * hstr_ldf(:,:,ktra,2) ) ! diffusive salt transport in j-direction
+         ENDIF
+      ENDIF
     
-      z2d(:,:) = puflx(:,:,1) 
-      DO_3D( 0, 0, 0, 0, 1, jpkm1 )
-         z2d(ji,jj) = z2d(ji,jj) + puflx(ji,jj,jk) 
-      END_3D
-       CALL lbc_lnk( 'diaar5', z2d, 'U', -1.0_wp )
-       IF( cptr == 'adv' ) THEN
-          IF( ktra == jp_tem ) CALL iom_put( 'uadv_heattr' , rho0_rcp * z2d )  ! advective heat transport in i-direction
-          IF( ktra == jp_sal ) CALL iom_put( 'uadv_salttr' , rho0     * z2d )  ! advective salt transport in i-direction
-       ENDIF
-       IF( cptr == 'ldf' ) THEN
-          IF( ktra == jp_tem ) CALL iom_put( 'udiff_heattr' , rho0_rcp * z2d ) ! diffusive heat transport in i-direction
-          IF( ktra == jp_sal ) CALL iom_put( 'udiff_salttr' , rho0     * z2d ) ! diffusive salt transport in i-direction
-       ENDIF
-       !
-       z2d(:,:) = pvflx(:,:,1) 
-       DO_3D( 0, 0, 0, 0, 1, jpkm1 )
-          z2d(ji,jj) = z2d(ji,jj) + pvflx(ji,jj,jk) 
-       END_3D
-       CALL lbc_lnk( 'diaar5', z2d, 'V', -1.0_wp )
-       IF( cptr == 'adv' ) THEN
-          IF( ktra == jp_tem ) CALL iom_put( 'vadv_heattr' , rho0_rcp * z2d )  ! advective heat transport in j-direction
-          IF( ktra == jp_sal ) CALL iom_put( 'vadv_salttr' , rho0     * z2d )  ! advective salt transport in j-direction
-       ENDIF
-       IF( cptr == 'ldf' ) THEN
-          IF( ktra == jp_tem ) CALL iom_put( 'vdiff_heattr' , rho0_rcp * z2d ) ! diffusive heat transport in j-direction
-          IF( ktra == jp_sal ) CALL iom_put( 'vdiff_salttr' , rho0     * z2d ) ! diffusive salt transport in j-direction
-       ENDIF
-          
    END SUBROUTINE dia_ar5_hst
 
@@ -371,4 +381,8 @@
          &  iom_use( 'masstot' ) .OR. iom_use( 'temptot'   )  .OR. iom_use( 'saltot' ) .OR.  &    
          &  iom_use( 'botpres' ) .OR. iom_use( 'sshthster' )  .OR. iom_use( 'sshsteric' ) .OR. &
+         &  iom_use( 'uadv_heattr' ) .OR. iom_use( 'udiff_heattr' ) .OR. &
+         &  iom_use( 'uadv_salttr' ) .OR. iom_use( 'udiff_salttr' ) .OR. &
+         &  iom_use( 'vadv_heattr' ) .OR. iom_use( 'vdiff_heattr' ) .OR. &
+         &  iom_use( 'vadv_salttr' ) .OR. iom_use( 'vdiff_salttr' ) .OR. &
          &  iom_use( 'rhop' )  ) L_ar5 = .TRUE.
   
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/DIA/diahsb.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/DIA/diahsb.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/DIA/diahsb.F90	(revision 14012)
@@ -267,20 +267,20 @@
             IF(lwp) WRITE(numout,*) '   dia_hsb_rst : read hsb restart at it= ', kt,' date= ', ndastp
             IF(lwp) WRITE(numout,*)
-            CALL iom_get( numror, 'frc_v', frc_v, ldxios = lrxios )
-            CALL iom_get( numror, 'frc_t', frc_t, ldxios = lrxios )
-            CALL iom_get( numror, 'frc_s', frc_s, ldxios = lrxios )
+            CALL iom_get( numror, 'frc_v', frc_v )
+            CALL iom_get( numror, 'frc_t', frc_t )
+            CALL iom_get( numror, 'frc_s', frc_s )
             IF( ln_linssh ) THEN
-               CALL iom_get( numror, 'frc_wn_t', frc_wn_t, ldxios = lrxios )
-               CALL iom_get( numror, 'frc_wn_s', frc_wn_s, ldxios = lrxios )
+               CALL iom_get( numror, 'frc_wn_t', frc_wn_t )
+               CALL iom_get( numror, 'frc_wn_s', frc_wn_s )
             ENDIF
-            CALL iom_get( numror, jpdom_auto, 'surf_ini'  , surf_ini  , ldxios = lrxios ) ! ice sheet coupling
-            CALL iom_get( numror, jpdom_auto, 'ssh_ini'   , ssh_ini   , ldxios = lrxios )
-            CALL iom_get( numror, jpdom_auto, 'e3t_ini'   , e3t_ini   , ldxios = lrxios )
-            CALL iom_get( numror, jpdom_auto, 'tmask_ini' , tmask_ini , ldxios = lrxios )
-            CALL iom_get( numror, jpdom_auto, 'hc_loc_ini', hc_loc_ini, ldxios = lrxios )
-            CALL iom_get( numror, jpdom_auto, 'sc_loc_ini', sc_loc_ini, ldxios = lrxios )
+            CALL iom_get( numror, jpdom_auto, 'surf_ini'  , surf_ini   ) ! ice sheet coupling
+            CALL iom_get( numror, jpdom_auto, 'ssh_ini'   , ssh_ini    )
+            CALL iom_get( numror, jpdom_auto, 'e3t_ini'   , e3t_ini    )
+            CALL iom_get( numror, jpdom_auto, 'tmask_ini' , tmask_ini  )
+            CALL iom_get( numror, jpdom_auto, 'hc_loc_ini', hc_loc_ini )
+            CALL iom_get( numror, jpdom_auto, 'sc_loc_ini', sc_loc_ini )
             IF( ln_linssh ) THEN
-               CALL iom_get( numror, jpdom_auto, 'ssh_hc_loc_ini', ssh_hc_loc_ini, ldxios = lrxios )
-               CALL iom_get( numror, jpdom_auto, 'ssh_sc_loc_ini', ssh_sc_loc_ini, ldxios = lrxios )
+               CALL iom_get( numror, jpdom_auto, 'ssh_hc_loc_ini', ssh_hc_loc_ini )
+               CALL iom_get( numror, jpdom_auto, 'ssh_sc_loc_ini', ssh_sc_loc_ini )
             ENDIF
          ELSE
@@ -323,23 +323,21 @@
          IF(lwp) WRITE(numout,*)
          !
-         IF( lwxios ) CALL iom_swap(      cwxios_context          )
-         CALL iom_rstput( kt, nitrst, numrow, 'frc_v', frc_v, ldxios = lwxios )
-         CALL iom_rstput( kt, nitrst, numrow, 'frc_t', frc_t, ldxios = lwxios )
-         CALL iom_rstput( kt, nitrst, numrow, 'frc_s', frc_s, ldxios = lwxios )
+         CALL iom_rstput( kt, nitrst, numrow, 'frc_v', frc_v )
+         CALL iom_rstput( kt, nitrst, numrow, 'frc_t', frc_t )
+         CALL iom_rstput( kt, nitrst, numrow, 'frc_s', frc_s )
          IF( ln_linssh ) THEN
-            CALL iom_rstput( kt, nitrst, numrow, 'frc_wn_t', frc_wn_t, ldxios = lwxios )
-            CALL iom_rstput( kt, nitrst, numrow, 'frc_wn_s', frc_wn_s, ldxios = lwxios )
+            CALL iom_rstput( kt, nitrst, numrow, 'frc_wn_t', frc_wn_t )
+            CALL iom_rstput( kt, nitrst, numrow, 'frc_wn_s', frc_wn_s )
          ENDIF
-         CALL iom_rstput( kt, nitrst, numrow, 'surf_ini'  , surf_ini  , ldxios = lwxios )      ! ice sheet coupling
-         CALL iom_rstput( kt, nitrst, numrow, 'ssh_ini'   , ssh_ini   , ldxios = lwxios )
-         CALL iom_rstput( kt, nitrst, numrow, 'e3t_ini'   , e3t_ini   , ldxios = lwxios )
-         CALL iom_rstput( kt, nitrst, numrow, 'tmask_ini' , tmask_ini , ldxios = lwxios )
-         CALL iom_rstput( kt, nitrst, numrow, 'hc_loc_ini', hc_loc_ini, ldxios = lwxios )
-         CALL iom_rstput( kt, nitrst, numrow, 'sc_loc_ini', sc_loc_ini, ldxios = lwxios )
+         CALL iom_rstput( kt, nitrst, numrow, 'surf_ini'  , surf_ini   )      ! ice sheet coupling
+         CALL iom_rstput( kt, nitrst, numrow, 'ssh_ini'   , ssh_ini    )
+         CALL iom_rstput( kt, nitrst, numrow, 'e3t_ini'   , e3t_ini    )
+         CALL iom_rstput( kt, nitrst, numrow, 'tmask_ini' , tmask_ini  )
+         CALL iom_rstput( kt, nitrst, numrow, 'hc_loc_ini', hc_loc_ini )
+         CALL iom_rstput( kt, nitrst, numrow, 'sc_loc_ini', sc_loc_ini )
          IF( ln_linssh ) THEN
-            CALL iom_rstput( kt, nitrst, numrow, 'ssh_hc_loc_ini', ssh_hc_loc_ini, ldxios = lwxios )
-            CALL iom_rstput( kt, nitrst, numrow, 'ssh_sc_loc_ini', ssh_sc_loc_ini, ldxios = lwxios )
+            CALL iom_rstput( kt, nitrst, numrow, 'ssh_hc_loc_ini', ssh_hc_loc_ini )
+            CALL iom_rstput( kt, nitrst, numrow, 'ssh_sc_loc_ini', ssh_sc_loc_ini )
          ENDIF
-         IF( lwxios ) CALL iom_swap(      cxios_context          )
          !
       ENDIF
@@ -385,21 +383,4 @@
       IF( .NOT. ln_diahsb )   RETURN
 
-      IF(lwxios) THEN
-! define variables in restart file when writing with XIOS
-        CALL iom_set_rstw_var_active('frc_v')
-        CALL iom_set_rstw_var_active('frc_t')
-        CALL iom_set_rstw_var_active('frc_s')
-        CALL iom_set_rstw_var_active('surf_ini')
-        CALL iom_set_rstw_var_active('ssh_ini')
-        CALL iom_set_rstw_var_active('e3t_ini')
-        CALL iom_set_rstw_var_active('hc_loc_ini')
-        CALL iom_set_rstw_var_active('sc_loc_ini')
-        IF( ln_linssh ) THEN
-           CALL iom_set_rstw_var_active('ssh_hc_loc_ini')
-           CALL iom_set_rstw_var_active('ssh_sc_loc_ini')
-           CALL iom_set_rstw_var_active('frc_wn_t')
-           CALL iom_set_rstw_var_active('frc_wn_s')
-        ENDIF
-      ENDIF
       ! ------------------- !
       ! 1 - Allocate memory !
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/DIA/diaptr.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/DIA/diaptr.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/DIA/diaptr.F90	(revision 14012)
@@ -22,4 +22,5 @@
    USE oce              ! ocean dynamics and active tracers
    USE dom_oce          ! ocean space and time domain
+   USE domain, ONLY : dom_tile
    USE phycst           ! physical constants
    !
@@ -32,4 +33,8 @@
    PRIVATE
 
+   INTERFACE ptr_sum
+      MODULE PROCEDURE ptr_sum_3d, ptr_sum_2d
+   END INTERFACE
+
    INTERFACE ptr_sj
       MODULE PROCEDURE ptr_sj_3d, ptr_sj_2d
@@ -39,8 +44,11 @@
    PUBLIC   dia_ptr_hst    ! called from tra_ldf/tra_adv routines
 
-   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   hstr_adv, hstr_ldf, hstr_eiv   !: Heat/Salt TRansports(adv, diff, Bolus.)
-   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   hstr_ove, hstr_btr, hstr_vtr   !: heat Salt TRansports(overturn, baro, merional)
-
-   LOGICAL, PUBLIC ::   l_diaptr       !: tracers  trend flag
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   hstr_adv, hstr_ldf, hstr_eiv   !: Heat/Salt TRansports(adv, diff, Bolus.)
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   hstr_ove, hstr_btr, hstr_vtr   !: heat Salt TRansports(overturn, baro, merional)
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   pvtr_int, pzon_int             !: Other zonal integrals
+
+   LOGICAL, PUBLIC    ::   l_diaptr       !: tracers  trend flag
+   INTEGER, PARAMETER ::   jp_msk = 3
+   INTEGER, PARAMETER ::   jp_vtr = 4
 
    REAL(wp) ::   rc_sv    = 1.e-6_wp   ! conversion from m3/s to Sverdrup
@@ -51,9 +59,6 @@
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: btmsk34 ! mask out Southern Ocean (=0 south of 34°S)
 
-   REAL(wp), TARGET, ALLOCATABLE, SAVE, DIMENSION(:)   :: p_fval1d
-   REAL(wp), TARGET, ALLOCATABLE, SAVE, DIMENSION(:,:) :: p_fval2d
-
    LOGICAL ::   ll_init = .TRUE.        !: tracers  trend flag
-   
+
    !! * Substitutions
 #  include "do_loop_substitute.h90"
@@ -72,12 +77,40 @@
       INTEGER                         , INTENT(in)           ::   kt     ! ocean time-step index     
       INTEGER                         , INTENT(in)           ::   Kmm    ! time level index
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in), OPTIONAL ::   pvtr   ! j-effective transport
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk)    , INTENT(in), OPTIONAL ::   pvtr   ! j-effective transport
+      !!----------------------------------------------------------------------
+      !
+      IF( ln_timing )   CALL timing_start('dia_ptr')
+
+      IF( kt == nit000 .AND. ll_init )   CALL dia_ptr_init    ! -> will define l_diaptr and nbasin
+      !
+      IF( l_diaptr ) THEN
+         ! Calculate zonal integrals
+         IF( PRESENT( pvtr ) ) THEN
+            CALL dia_ptr_zint( Kmm, pvtr )
+         ELSE
+            CALL dia_ptr_zint( Kmm )
+         ENDIF
+
+         ! Calculate diagnostics only when zonal integrals have finished
+         IF( ntile == 0 .OR. ntile == nijtile ) CALL dia_ptr_iom(kt, Kmm, pvtr)
+      ENDIF
+
+      IF( ln_timing )   CALL timing_stop('dia_ptr')
+      !
+   END SUBROUTINE dia_ptr
+
+
+   SUBROUTINE dia_ptr_iom( kt, Kmm, pvtr )
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE dia_ptr_iom  ***
+      !!----------------------------------------------------------------------
+      !! ** Purpose : Calculate diagnostics and send to XIOS
+      !!----------------------------------------------------------------------
+      INTEGER                         , INTENT(in)           ::   kt     ! ocean time-step index
+      INTEGER                         , INTENT(in)           ::   Kmm    ! time level index
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk)    , INTENT(in), OPTIONAL ::   pvtr   ! j-effective transport
       !
       INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices
-      REAL(wp) ::   zsfc,zvfc               ! local scalar
       REAL(wp), DIMENSION(jpi,jpj)     ::  z2d   ! 2D workspace
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zmask   ! 3D workspace
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::  z3d    ! 3D workspace
-      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts) ::  zts   ! 3D workspace
       REAL(wp), DIMENSION(jpj)      ::  zvsum, ztsum, zssum   ! 1D workspace
       !
@@ -90,112 +123,292 @@
       !!----------------------------------------------------------------------
       !
-      IF( ln_timing )   CALL timing_start('dia_ptr')
-
-      IF( kt == nit000 .AND. ll_init )   CALL dia_ptr_init   ! -> will define l_diaptr and nbasin
-      !
-      IF( .NOT. l_diaptr ) THEN
-         IF( ln_timing ) CALL timing_stop('dia_ptr')
-         RETURN
-      ENDIF
-      !
       ALLOCATE( z3dtr(jpi,jpj,nbasin) )
-      !
+
       IF( PRESENT( pvtr ) ) THEN
          IF( iom_use( 'zomsf' ) ) THEN    ! effective MSF
             ALLOCATE( z4d1(jpi,jpj,jpk,nbasin) )
+            !
             DO jn = 1, nbasin                                    ! by sub-basins
-               z4d1(1,:,:,jn) =  ptr_sjk( pvtr(:,:,:), btmsk34(:,:,jn) )  ! zonal cumulative effective transport excluding closed seas
-               DO jk = jpkm1, 1, -1 
+               z4d1(1,:,:,jn) =  pvtr_int(:,:,jp_vtr,jn)                  ! zonal cumulative effective transport excluding closed seas
+               DO jk = jpkm1, 1, -1
                   z4d1(1,:,jk,jn) = z4d1(1,:,jk+1,jn) - z4d1(1,:,jk,jn)    ! effective j-Stream-Function (MSF)
                END DO
-               DO ji = 1, jpi
+               DO ji = 2, jpi
                   z4d1(ji,:,:,jn) = z4d1(1,:,:,jn)
                ENDDO
             END DO
             CALL iom_put( 'zomsf', z4d1 * rc_sv )
+            !
             DEALLOCATE( z4d1 )
          ENDIF
+         IF( iom_use( 'sopstove' ) .OR. iom_use( 'sophtove' ) ) THEN
+            ALLOCATE( sjk(jpj,jpk,nbasin), r1_sjk(jpj,jpk,nbasin), v_msf(jpj,jpk,nbasin),   &
+               &      zt_jk(jpj,jpk,nbasin), zs_jk(jpj,jpk,nbasin) )
+            !
+            DO jn = 1, nbasin
+               sjk(:,:,jn) = pvtr_int(:,:,jp_msk,jn)
+               r1_sjk(:,:,jn) = 0._wp
+               WHERE( sjk(:,:,jn) /= 0._wp )   r1_sjk(:,:,jn) = 1._wp / sjk(:,:,jn)
+               ! i-mean T and S, j-Stream-Function, basin
+               zt_jk(:,:,jn) = pvtr_int(:,:,jp_tem,jn) * r1_sjk(:,:,jn)
+               zs_jk(:,:,jn) = pvtr_int(:,:,jp_sal,jn) * r1_sjk(:,:,jn)
+               v_msf(:,:,jn) = pvtr_int(:,:,jp_vtr,jn)
+               hstr_ove(:,jp_tem,jn) = SUM( v_msf(:,:,jn)*zt_jk(:,:,jn), 2 )
+               hstr_ove(:,jp_sal,jn) = SUM( v_msf(:,:,jn)*zs_jk(:,:,jn), 2 )
+               !
+            ENDDO
+            DO jn = 1, nbasin
+               z3dtr(1,:,jn) = hstr_ove(:,jp_tem,jn) * rc_pwatt  !  (conversion in PW)
+               DO ji = 2, jpi
+                  z3dtr(ji,:,jn) = z3dtr(1,:,jn)
+               ENDDO
+            ENDDO
+            CALL iom_put( 'sophtove', z3dtr )
+            DO jn = 1, nbasin
+               z3dtr(1,:,jn) = hstr_ove(:,jp_sal,jn) * rc_ggram !  (conversion in Gg)
+               DO ji = 2, jpi
+                  z3dtr(ji,:,jn) = z3dtr(1,:,jn)
+               ENDDO
+            ENDDO
+            CALL iom_put( 'sopstove', z3dtr )
+            !
+            DEALLOCATE( sjk, r1_sjk, v_msf, zt_jk, zs_jk )
+         ENDIF
+
+         IF( iom_use( 'sopstbtr' ) .OR. iom_use( 'sophtbtr' ) ) THEN
+            ! Calculate barotropic heat and salt transport here 
+            ALLOCATE( sjk(jpj,1,nbasin), r1_sjk(jpj,1,nbasin) )
+            !
+            DO jn = 1, nbasin
+               sjk(:,1,jn) = SUM( pvtr_int(:,:,jp_msk,jn), 2 )
+               r1_sjk(:,1,jn) = 0._wp
+               WHERE( sjk(:,1,jn) /= 0._wp )   r1_sjk(:,1,jn) = 1._wp / sjk(:,1,jn)
+               !
+               zvsum(:) =    SUM( pvtr_int(:,:,jp_vtr,jn), 2 )
+               ztsum(:) =    SUM( pvtr_int(:,:,jp_tem,jn), 2 )
+               zssum(:) =    SUM( pvtr_int(:,:,jp_sal,jn), 2 )
+               hstr_btr(:,jp_tem,jn) = zvsum(:) * ztsum(:) * r1_sjk(:,1,jn)
+               hstr_btr(:,jp_sal,jn) = zvsum(:) * zssum(:) * r1_sjk(:,1,jn)
+               !
+            ENDDO
+            DO jn = 1, nbasin
+               z3dtr(1,:,jn) = hstr_btr(:,jp_tem,jn) * rc_pwatt  !  (conversion in PW)
+               DO ji = 2, jpi
+                  z3dtr(ji,:,jn) = z3dtr(1,:,jn)
+               ENDDO
+            ENDDO
+            CALL iom_put( 'sophtbtr', z3dtr )
+            DO jn = 1, nbasin
+               z3dtr(1,:,jn) = hstr_btr(:,jp_sal,jn) * rc_ggram !  (conversion in Gg)
+               DO ji = 2, jpi
+                  z3dtr(ji,:,jn) = z3dtr(1,:,jn)
+               ENDDO
+            ENDDO
+            CALL iom_put( 'sopstbtr', z3dtr )
+            !
+            DEALLOCATE( sjk, r1_sjk )
+         ENDIF
+         !
+         hstr_ove(:,:,:) = 0._wp       ! Zero before next timestep
+         hstr_btr(:,:,:) = 0._wp
+         pvtr_int(:,:,:,:) = 0._wp
+      ELSE
+         IF( iom_use( 'zotem' ) .OR. iom_use( 'zosal' ) .OR. iom_use( 'zosrf' )  ) THEN    ! i-mean i-k-surface
+            ALLOCATE( z4d1(jpi,jpj,jpk,nbasin), z4d2(jpi,jpj,jpk,nbasin) )
+            !
+            DO jn = 1, nbasin
+               z4d1(1,:,:,jn) = pzon_int(:,:,jp_msk,jn)
+               DO ji = 2, jpi
+                  z4d1(ji,:,:,jn) = z4d1(1,:,:,jn)
+               ENDDO
+            ENDDO
+            CALL iom_put( 'zosrf', z4d1 )
+            !
+            DO jn = 1, nbasin
+               z4d2(1,:,:,jn) = pzon_int(:,:,jp_tem,jn) / MAX( z4d1(1,:,:,jn), 10.e-15 )
+               DO ji = 2, jpi
+                  z4d2(ji,:,:,jn) = z4d2(1,:,:,jn)
+               ENDDO
+            ENDDO
+            CALL iom_put( 'zotem', z4d2 )
+            !
+            DO jn = 1, nbasin
+               z4d2(1,:,:,jn) = pzon_int(:,:,jp_sal,jn) / MAX( z4d1(1,:,:,jn), 10.e-15 )
+               DO ji = 2, jpi
+                  z4d2(ji,:,:,jn) = z4d2(1,:,:,jn)
+               ENDDO
+            ENDDO
+            CALL iom_put( 'zosal', z4d2 )
+            !
+            DEALLOCATE( z4d1, z4d2 )
+         ENDIF
+         !
+         !                                ! Advective and diffusive heat and salt transport
+         IF( iom_use( 'sophtadv' ) .OR. iom_use( 'sopstadv' ) ) THEN  
+            ! 
+            DO jn = 1, nbasin
+               z3dtr(1,:,jn) = hstr_adv(:,jp_tem,jn) * rc_pwatt  !  (conversion in PW)
+               DO ji = 2, jpi
+                  z3dtr(ji,:,jn) = z3dtr(1,:,jn)
+               ENDDO
+            ENDDO
+            CALL iom_put( 'sophtadv', z3dtr )
+            DO jn = 1, nbasin
+               z3dtr(1,:,jn) = hstr_adv(:,jp_sal,jn) * rc_ggram !  (conversion in Gg)
+               DO ji = 2, jpi
+                  z3dtr(ji,:,jn) = z3dtr(1,:,jn)
+               ENDDO
+            ENDDO
+            CALL iom_put( 'sopstadv', z3dtr )
+         ENDIF
+         !
+         IF( iom_use( 'sophtldf' ) .OR. iom_use( 'sopstldf' ) ) THEN  
+            ! 
+            DO jn = 1, nbasin
+               z3dtr(1,:,jn) = hstr_ldf(:,jp_tem,jn) * rc_pwatt  !  (conversion in PW)
+               DO ji = 2, jpi
+                  z3dtr(ji,:,jn) = z3dtr(1,:,jn)
+               ENDDO
+            ENDDO
+            CALL iom_put( 'sophtldf', z3dtr )
+            DO jn = 1, nbasin
+               z3dtr(1,:,jn) = hstr_ldf(:,jp_sal,jn) * rc_ggram !  (conversion in Gg)
+               DO ji = 2, jpi
+                  z3dtr(ji,:,jn) = z3dtr(1,:,jn)
+               ENDDO
+            ENDDO
+            CALL iom_put( 'sopstldf', z3dtr )
+         ENDIF
+         !
+         IF( iom_use( 'sophteiv' ) .OR. iom_use( 'sopsteiv' ) ) THEN  
+            ! 
+            DO jn = 1, nbasin
+               z3dtr(1,:,jn) = hstr_eiv(:,jp_tem,jn) * rc_pwatt  !  (conversion in PW)
+               DO ji = 2, jpi
+                  z3dtr(ji,:,jn) = z3dtr(1,:,jn)
+               ENDDO
+            ENDDO
+            CALL iom_put( 'sophteiv', z3dtr )
+            DO jn = 1, nbasin
+               z3dtr(1,:,jn) = hstr_eiv(:,jp_sal,jn) * rc_ggram !  (conversion in Gg)
+               DO ji = 2, jpi
+                  z3dtr(ji,:,jn) = z3dtr(1,:,jn)
+               ENDDO
+            ENDDO
+            CALL iom_put( 'sopsteiv', z3dtr )
+         ENDIF
+         !
+         IF( iom_use( 'sopstvtr' ) .OR. iom_use( 'sophtvtr' ) ) THEN
+             DO jn = 1, nbasin
+                z3dtr(1,:,jn) = hstr_vtr(:,jp_tem,jn) * rc_pwatt  !  (conversion in PW)
+                DO ji = 2, jpi
+                   z3dtr(ji,:,jn) = z3dtr(1,:,jn)
+                ENDDO
+             ENDDO
+             CALL iom_put( 'sophtvtr', z3dtr )
+             DO jn = 1, nbasin
+               z3dtr(1,:,jn) = hstr_vtr(:,jp_sal,jn) * rc_ggram !  (conversion in Gg)
+               DO ji = 2, jpi
+                  z3dtr(ji,:,jn) = z3dtr(1,:,jn)
+               ENDDO
+            ENDDO
+            CALL iom_put( 'sopstvtr', z3dtr )
+         ENDIF
+         !
+         IF( iom_use( 'uocetr_vsum_cumul' ) ) THEN
+            IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 )         ! Use full domain
+            CALL iom_get_var(  'uocetr_vsum_op', z2d ) ! get uocetr_vsum_op from xml
+            z2d(:,:) = ptr_ci_2d( z2d(:,:) )  
+            CALL iom_put( 'uocetr_vsum_cumul', z2d )
+            IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = nijtile )   ! Revert to tile domain
+         ENDIF
+         !
+         hstr_adv(:,:,:) = 0._wp       ! Zero before next timestep
+         hstr_ldf(:,:,:) = 0._wp
+         hstr_eiv(:,:,:) = 0._wp
+         hstr_vtr(:,:,:) = 0._wp
+         pzon_int(:,:,:,:) = 0._wp
+      ENDIF
+      !
+      DEALLOCATE( z3dtr )
+      !
+   END SUBROUTINE dia_ptr_iom
+
+
+   SUBROUTINE dia_ptr_zint( Kmm, pvtr )
+      !!----------------------------------------------------------------------
+      !!                    ***  ROUTINE dia_ptr_zint ***
+      !!----------------------------------------------------------------------
+      !! ** Purpose : i and i-k sum operations on arrays
+      !!
+      !! ** Method  : - Call ptr_sjk (i sum) or ptr_sj (i-k sum) to perform the sum operation
+      !!              - Call ptr_sum to add this result to the sum over tiles
+      !!
+      !! ** Action  : pvtr_int - terms for volume streamfunction, heat/salt transport barotropic/overturning terms
+      !!              pzon_int - terms for i mean temperature/salinity
+      !!----------------------------------------------------------------------
+      INTEGER                     , INTENT(in)           :: Kmm          ! time level index
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk), INTENT(in), OPTIONAL :: pvtr         ! j-effective transport
+      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE            :: zmask        ! 3D workspace
+      REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE          :: zts          ! 4D workspace
+      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE            :: sjk, v_msf   ! Zonal sum: i-k surface area, j-effective transport
+      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE            :: zt_jk, zs_jk ! Zonal sum: i-k surface area * (T, S)
+      REAL(wp)                                           :: zsfc, zvfc   ! i-k surface area
+      INTEGER  ::   ji, jj, jk, jn                                       ! dummy loop indices
+      !!----------------------------------------------------------------------
+
+      IF( PRESENT( pvtr ) ) THEN
+         ! i sum of effective j transport excluding closed seas
+         IF( iom_use( 'zomsf' ) .OR. iom_use( 'sopstove' ) .OR. iom_use( 'sophtove' ) ) THEN
+            ALLOCATE( v_msf(A1Dj(nn_hls),jpk,nbasin) )
+
+            DO jn = 1, nbasin
+               v_msf(:,:,jn) = ptr_sjk( pvtr(:,:,:), btmsk34(:,:,jn) )
+            ENDDO
+
+            CALL ptr_sum( pvtr_int(:,:,jp_vtr,:), v_msf(:,:,:) )
+
+            DEALLOCATE( v_msf )
+         ENDIF
+
+         ! i sum of j surface area, j surface area - temperature/salinity product on V grid
          IF(  iom_use( 'sopstove' ) .OR. iom_use( 'sophtove' ) .OR.   &
             & iom_use( 'sopstbtr' ) .OR. iom_use( 'sophtbtr' ) ) THEN
-            ! define fields multiplied by scalar
+            ALLOCATE( zmask(A2D(nn_hls),jpk), zts(A2D(nn_hls),jpk,jpts), &
+               &      sjk(A1Dj(nn_hls),jpk,nbasin), &
+               &      zt_jk(A1Dj(nn_hls),jpk,nbasin), zs_jk(A1Dj(nn_hls),jpk,nbasin) )
+
             zmask(:,:,:) = 0._wp
             zts(:,:,:,:) = 0._wp
+
             DO_3D( 1, 0, 1, 1, 1, jpkm1 )
                zvfc = e1v(ji,jj) * e3v(ji,jj,jk,Kmm)
                zmask(ji,jj,jk)      = vmask(ji,jj,jk)      * zvfc
-               zts(ji,jj,jk,jp_tem) = (ts(ji,jj,jk,jp_tem,Kmm)+ts(ji,jj+1,jk,jp_tem,Kmm)) * 0.5 * zvfc  !Tracers averaged onto V grid
+               zts(ji,jj,jk,jp_tem) = (ts(ji,jj,jk,jp_tem,Kmm)+ts(ji,jj+1,jk,jp_tem,Kmm)) * 0.5 * zvfc !Tracers averaged onto V grid
                zts(ji,jj,jk,jp_sal) = (ts(ji,jj,jk,jp_sal,Kmm)+ts(ji,jj+1,jk,jp_sal,Kmm)) * 0.5 * zvfc
             END_3D
-         ENDIF
-         IF( iom_use( 'sopstove' ) .OR. iom_use( 'sophtove' ) ) THEN
-            DO jn = 1, nbasin
-               ALLOCATE( sjk(jpj,jpk,nbasin), r1_sjk(jpj,jpk,nbasin), v_msf(jpj,jpk,nbasin),   &
-                  &                          zt_jk(jpj,jpk,nbasin), zs_jk(jpj,jpk,nbasin) )
-               sjk(:,:,jn) = ptr_sjk( zmask(:,:,:), btmsk(:,:,jn) )
-               r1_sjk(:,:,jn) = 0._wp
-               WHERE( sjk(:,:,jn) /= 0._wp )   r1_sjk(:,:,jn) = 1._wp / sjk(:,:,jn)
-               ! i-mean T and S, j-Stream-Function, basin
-               zt_jk(:,:,jn) = ptr_sjk( zts(:,:,:,jp_tem), btmsk(:,:,jn) ) * r1_sjk(:,:,jn)
-               zs_jk(:,:,jn) = ptr_sjk( zts(:,:,:,jp_sal), btmsk(:,:,jn) ) * r1_sjk(:,:,jn)
-               v_msf(:,:,jn) = ptr_sjk( pvtr(:,:,:), btmsk34(:,:,jn) ) 
-               hstr_ove(:,jp_tem,jn) = SUM( v_msf(:,:,jn)*zt_jk(:,:,jn), 2 )
-               hstr_ove(:,jp_sal,jn) = SUM( v_msf(:,:,jn)*zs_jk(:,:,jn), 2 )
-               DEALLOCATE( sjk, r1_sjk, v_msf, zt_jk, zs_jk )
-               !
-            ENDDO
-            DO jn = 1, nbasin
-               z3dtr(1,:,jn) = hstr_ove(:,jp_tem,jn) * rc_pwatt  !  (conversion in PW)
-               DO ji = 1, jpi
-                  z3dtr(ji,:,jn) = z3dtr(1,:,jn)
-               ENDDO
-            ENDDO
-            CALL iom_put( 'sophtove', z3dtr )
-            DO jn = 1, nbasin
-               z3dtr(1,:,jn) = hstr_ove(:,jp_sal,jn) * rc_ggram !  (conversion in Gg)
-               DO ji = 1, jpi
-                  z3dtr(ji,:,jn) = z3dtr(1,:,jn)
-               ENDDO
-            ENDDO
-            CALL iom_put( 'sopstove', z3dtr )
-         ENDIF
-
-         IF( iom_use( 'sopstbtr' ) .OR. iom_use( 'sophtbtr' ) ) THEN
-            ! Calculate barotropic heat and salt transport here 
-            DO jn = 1, nbasin
-               ALLOCATE( sjk(jpj,1,nbasin), r1_sjk(jpj,1,nbasin) )
-               sjk(:,1,jn) = ptr_sj( zmask(:,:,:), btmsk(:,:,jn) )
-               r1_sjk(:,1,jn) = 0._wp
-               WHERE( sjk(:,1,jn) /= 0._wp )   r1_sjk(:,1,jn) = 1._wp / sjk(:,1,jn)
-               !
-               zvsum(:) = ptr_sj( pvtr(:,:,:), btmsk34(:,:,jn) )
-               ztsum(:) = ptr_sj( zts(:,:,:,jp_tem), btmsk(:,:,jn) )
-               zssum(:) = ptr_sj( zts(:,:,:,jp_sal), btmsk(:,:,jn) )
-               hstr_btr(:,jp_tem,jn) = zvsum(:) * ztsum(:) * r1_sjk(:,1,jn)
-               hstr_btr(:,jp_sal,jn) = zvsum(:) * zssum(:) * r1_sjk(:,1,jn)
-               DEALLOCATE( sjk, r1_sjk )
-               !
-            ENDDO
-            DO jn = 1, nbasin
-               z3dtr(1,:,jn) = hstr_btr(:,jp_tem,jn) * rc_pwatt  !  (conversion in PW)
-               DO ji = 1, jpi
-                  z3dtr(ji,:,jn) = z3dtr(1,:,jn)
-               ENDDO
-            ENDDO
-            CALL iom_put( 'sophtbtr', z3dtr )
-            DO jn = 1, nbasin
-               z3dtr(1,:,jn) = hstr_btr(:,jp_sal,jn) * rc_ggram !  (conversion in Gg)
-               DO ji = 1, jpi
-                  z3dtr(ji,:,jn) = z3dtr(1,:,jn)
-               ENDDO
-            ENDDO
-            CALL iom_put( 'sopstbtr', z3dtr )
-         ENDIF 
-         !
+
+            DO jn = 1, nbasin
+               sjk(:,:,jn)   = ptr_sjk( zmask(:,:,:)     , btmsk(:,:,jn) )
+               zt_jk(:,:,jn) = ptr_sjk( zts(:,:,:,jp_tem), btmsk(:,:,jn) )
+               zs_jk(:,:,jn) = ptr_sjk( zts(:,:,:,jp_sal), btmsk(:,:,jn) )
+            ENDDO
+
+            CALL ptr_sum( pvtr_int(:,:,jp_msk,:), sjk(:,:,:)   )
+            CALL ptr_sum( pvtr_int(:,:,jp_tem,:), zt_jk(:,:,:) )
+            CALL ptr_sum( pvtr_int(:,:,jp_sal,:), zs_jk(:,:,:) )
+
+            DEALLOCATE( zmask, zts, sjk, zt_jk, zs_jk )
+         ENDIF
       ELSE
-         !
-         zmask(:,:,:) = 0._wp
-         zts(:,:,:,:) = 0._wp
-         IF( iom_use( 'zotem' ) .OR. iom_use( 'zosal' ) .OR. iom_use( 'zosrf' )  ) THEN    ! i-mean i-k-surface 
-            ALLOCATE( z4d1(jpi,jpj,jpk,nbasin), z4d2(jpi,jpj,jpk,nbasin) )
+         ! i sum of j surface area - temperature/salinity product on T grid
+         IF( iom_use( 'zotem' ) .OR. iom_use( 'zosal' ) .OR. iom_use( 'zosrf' )  ) THEN
+            ALLOCATE( zmask(A2D(nn_hls),jpk), zts(A2D(nn_hls),jpk,jpts), &
+               &      sjk(A1Dj(nn_hls),jpk,nbasin), &
+               &      zt_jk(A1Dj(nn_hls),jpk,nbasin), zs_jk(A1Dj(nn_hls),jpk,nbasin) )
+
+            zmask(:,:,:) = 0._wp
+            zts(:,:,:,:) = 0._wp
+
             DO_3D( 1, 1, 1, 1, 1, jpkm1 )
                zsfc = e1t(ji,jj) * e3t(ji,jj,jk,Kmm)
@@ -204,92 +417,24 @@
                zts(ji,jj,jk,jp_sal) = ts(ji,jj,jk,jp_sal,Kmm) * zsfc
             END_3D
-            !
-            DO jn = 1, nbasin
-               zmask(1,:,:) = ptr_sjk( zmask(:,:,:), btmsk(:,:,jn) )
-               DO ji = 1, jpi
-                  zmask(ji,:,:) = zmask(1,:,:)
-               ENDDO
-               z4d1(:,:,:,jn) = zmask(:,:,:)
-            ENDDO
-            CALL iom_put( 'zosrf', z4d1 )
-            !
-            DO jn = 1, nbasin
-               z4d2(1,:,:,jn) = ptr_sjk( zts(:,:,:,jp_tem), btmsk(:,:,jn) ) &
-                  &            / MAX( z4d1(1,:,:,jn), 10.e-15 )
-               DO ji = 1, jpi
-                  z4d2(ji,:,:,jn) = z4d2(1,:,:,jn)
-               ENDDO
-            ENDDO
-            CALL iom_put( 'zotem', z4d2 )
-            !
-            DO jn = 1, nbasin
-               z4d2(1,:,:,jn) = ptr_sjk( zts(:,:,:,jp_sal), btmsk(:,:,jn) ) &
-                  &            / MAX( z4d1(1,:,:,jn), 10.e-15 )
-               DO ji = 1, jpi
-                  z4d2(ji,:,:,jn) = z4d2(1,:,:,jn)
-               ENDDO
-            ENDDO
-            CALL iom_put( 'zosal', z4d2 )
-            DEALLOCATE( z4d1, z4d2 )
-            !
-         ENDIF
-         !
-         !                                ! Advective and diffusive heat and salt transport
-         IF( iom_use( 'sophtadv' ) .OR. iom_use( 'sopstadv' ) ) THEN  
-            ! 
-            DO jn = 1, nbasin
-               z3dtr(1,:,jn) = hstr_adv(:,jp_tem,jn) * rc_pwatt  !  (conversion in PW)
-               DO ji = 1, jpi
-                  z3dtr(ji,:,jn) = z3dtr(1,:,jn)
-               ENDDO
-            ENDDO
-            CALL iom_put( 'sophtadv', z3dtr )
-            DO jn = 1, nbasin
-               z3dtr(1,:,jn) = hstr_adv(:,jp_sal,jn) * rc_ggram !  (conversion in Gg)
-               DO ji = 1, jpi
-                  z3dtr(ji,:,jn) = z3dtr(1,:,jn)
-               ENDDO
-            ENDDO
-            CALL iom_put( 'sopstadv', z3dtr )
-         ENDIF
-         !
-         IF( iom_use( 'sophtldf' ) .OR. iom_use( 'sopstldf' ) ) THEN  
-            ! 
-            DO jn = 1, nbasin
-               z3dtr(1,:,jn) = hstr_ldf(:,jp_tem,jn) * rc_pwatt  !  (conversion in PW)
-               DO ji = 1, jpi
-                  z3dtr(ji,:,jn) = z3dtr(1,:,jn)
-               ENDDO
-            ENDDO
-            CALL iom_put( 'sophtldf', z3dtr )
-            DO jn = 1, nbasin
-               z3dtr(1,:,jn) = hstr_ldf(:,jp_sal,jn) * rc_ggram !  (conversion in Gg)
-               DO ji = 1, jpi
-                  z3dtr(ji,:,jn) = z3dtr(1,:,jn)
-               ENDDO
-            ENDDO
-            CALL iom_put( 'sopstldf', z3dtr )
-         ENDIF
-         !
-         IF( iom_use( 'sophteiv' ) .OR. iom_use( 'sopsteiv' ) ) THEN  
-            ! 
-            DO jn = 1, nbasin
-               z3dtr(1,:,jn) = hstr_eiv(:,jp_tem,jn) * rc_pwatt  !  (conversion in PW)
-               DO ji = 1, jpi
-                  z3dtr(ji,:,jn) = z3dtr(1,:,jn)
-               ENDDO
-            ENDDO
-            CALL iom_put( 'sophteiv', z3dtr )
-            DO jn = 1, nbasin
-               z3dtr(1,:,jn) = hstr_eiv(:,jp_sal,jn) * rc_ggram !  (conversion in Gg)
-               DO ji = 1, jpi
-                  z3dtr(ji,:,jn) = z3dtr(1,:,jn)
-               ENDDO
-            ENDDO
-            CALL iom_put( 'sopsteiv', z3dtr )
-         ENDIF
-         !
+
+            DO jn = 1, nbasin
+               sjk(:,:,jn)   = ptr_sjk( zmask(:,:,:)     , btmsk(:,:,jn) )
+               zt_jk(:,:,jn) = ptr_sjk( zts(:,:,:,jp_tem), btmsk(:,:,jn) )
+               zs_jk(:,:,jn) = ptr_sjk( zts(:,:,:,jp_sal), btmsk(:,:,jn) )
+            ENDDO
+
+            CALL ptr_sum( pzon_int(:,:,jp_msk,:), sjk(:,:,:)   )
+            CALL ptr_sum( pzon_int(:,:,jp_tem,:), zt_jk(:,:,:) )
+            CALL ptr_sum( pzon_int(:,:,jp_sal,:), zs_jk(:,:,:) )
+
+            DEALLOCATE( zmask, zts, sjk, zt_jk, zs_jk )
+         ENDIF
+
+         ! i-k sum of j surface area - temperature/salinity product on V grid
          IF( iom_use( 'sopstvtr' ) .OR. iom_use( 'sophtvtr' ) ) THEN
+            ALLOCATE( zts(A2D(nn_hls),jpk,jpts) )
+
             zts(:,:,:,:) = 0._wp
+
             DO_3D( 1, 0, 1, 1, 1, jpkm1 )
                zvfc = e1v(ji,jj) * e3v(ji,jj,jk,Kmm)
@@ -297,35 +442,12 @@
                zts(ji,jj,jk,jp_sal) = (ts(ji,jj,jk,jp_sal,Kmm)+ts(ji,jj+1,jk,jp_sal,Kmm)) * 0.5 * zvfc
             END_3D
-             CALL dia_ptr_hst( jp_tem, 'vtr', zts(:,:,:,jp_tem) )
-             CALL dia_ptr_hst( jp_sal, 'vtr', zts(:,:,:,jp_sal) )
-             DO jn = 1, nbasin
-                z3dtr(1,:,jn) = hstr_vtr(:,jp_tem,jn) * rc_pwatt  !  (conversion in PW)
-                DO ji = 1, jpi
-                   z3dtr(ji,:,jn) = z3dtr(1,:,jn)
-                ENDDO
-             ENDDO
-             CALL iom_put( 'sophtvtr', z3dtr )
-             DO jn = 1, nbasin
-               z3dtr(1,:,jn) = hstr_vtr(:,jp_sal,jn) * rc_ggram !  (conversion in Gg)
-               DO ji = 1, jpi
-                  z3dtr(ji,:,jn) = z3dtr(1,:,jn)
-               ENDDO
-            ENDDO
-            CALL iom_put( 'sopstvtr', z3dtr )
-         ENDIF
-         !
-         IF( iom_use( 'uocetr_vsum_cumul' ) ) THEN
-            CALL iom_get_var(  'uocetr_vsum_op', z2d ) ! get uocetr_vsum_op from xml
-            z2d(:,:) = ptr_ci_2d( z2d(:,:) )  
-            CALL iom_put( 'uocetr_vsum_cumul', z2d )
-         ENDIF
-         !
+
+            CALL dia_ptr_hst( jp_tem, 'vtr', zts(:,:,:,jp_tem) )
+            CALL dia_ptr_hst( jp_sal, 'vtr', zts(:,:,:,jp_sal) )
+
+            DEALLOCATE( zts )
+         ENDIF
       ENDIF
-      !
-      DEALLOCATE( z3dtr )
-      !
-      IF( ln_timing )   CALL timing_stop('dia_ptr')
-      !
-   END SUBROUTINE dia_ptr
+   END SUBROUTINE dia_ptr_zint
 
 
@@ -340,5 +462,5 @@
       REAL(wp), DIMENSION(jpi,jpj) :: zmsk
       !!----------------------------------------------------------------------
-      
+
       ! l_diaptr is defined with iom_use
       !   --> dia_ptr_init must be done after the call to iom_init
@@ -347,8 +469,8 @@
          &       iom_use( 'zosrf'    ) .OR. iom_use( 'sopstove' ) .OR. iom_use( 'sophtove' ) .OR.  &
          &       iom_use( 'sopstbtr' ) .OR. iom_use( 'sophtbtr' ) .OR. iom_use( 'sophtadv' ) .OR.  &
-         &       iom_use( 'sopstadv' ) .OR. iom_use( 'sophtldf' ) .OR. iom_use( 'sopstldf' ) .OR.  & 
+         &       iom_use( 'sopstadv' ) .OR. iom_use( 'sophtldf' ) .OR. iom_use( 'sopstldf' ) .OR.  &
          &       iom_use( 'sophteiv' ) .OR. iom_use( 'sopsteiv' ) .OR. iom_use( 'sopstvtr' ) .OR.  &
-         &       iom_use( 'sophtvtr' ) .OR. iom_use( 'uocetr_vsum_cumul' ) 
- 
+         &       iom_use( 'sophtvtr' ) .OR. iom_use( 'uocetr_vsum_cumul' )
+      
       IF(lwp) THEN                     ! Control print
          WRITE(numout,*)
@@ -398,4 +520,6 @@
          hstr_btr(:,:,:) = 0._wp           !
          hstr_vtr(:,:,:) = 0._wp           !
+         pvtr_int(:,:,:,:) = 0._wp
+         pzon_int(:,:,:,:) = 0._wp
          !
          ll_init = .FALSE.
@@ -415,61 +539,101 @@
       INTEGER                         , INTENT(in )  :: ktra  ! tracer index
       CHARACTER(len=3)                , INTENT(in)   :: cptr  ! transport type  'adv'/'ldf'/'eiv'
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in)   :: pvflx   ! 3D input array of advection/diffusion
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk)    , INTENT(in)   :: pvflx ! 3D input array of advection/diffusion
+      REAL(wp), DIMENSION(A1Dj(nn_hls),nbasin)                 :: zsj   !
       INTEGER                                        :: jn    !
 
+      DO jn = 1, nbasin
+         zsj(:,jn) = ptr_sj( pvflx(:,:,:), btmsk(:,:,jn) )
+      ENDDO
       !
       IF( cptr == 'adv' ) THEN
-         IF( ktra == jp_tem )  THEN
-             DO jn = 1, nbasin
-                hstr_adv(:,jp_tem,jn) = ptr_sj( pvflx(:,:,:), btmsk(:,:,jn) )
-             ENDDO
-         ENDIF
-         IF( ktra == jp_sal )  THEN
-             DO jn = 1, nbasin
-                hstr_adv(:,jp_sal,jn) = ptr_sj( pvflx(:,:,:), btmsk(:,:,jn) )
-             ENDDO
-         ENDIF
+         IF( ktra == jp_tem )  CALL ptr_sum( hstr_adv(:,jp_tem,:), zsj(:,:) )
+         IF( ktra == jp_sal )  CALL ptr_sum( hstr_adv(:,jp_sal,:), zsj(:,:) )
+      ELSE IF( cptr == 'ldf' ) THEN
+         IF( ktra == jp_tem )  CALL ptr_sum( hstr_ldf(:,jp_tem,:), zsj(:,:) )
+         IF( ktra == jp_sal )  CALL ptr_sum( hstr_ldf(:,jp_sal,:), zsj(:,:) )
+      ELSE IF( cptr == 'eiv' ) THEN
+         IF( ktra == jp_tem )  CALL ptr_sum( hstr_eiv(:,jp_tem,:), zsj(:,:) )
+         IF( ktra == jp_sal )  CALL ptr_sum( hstr_eiv(:,jp_sal,:), zsj(:,:) )
+      ELSE IF( cptr == 'vtr' ) THEN
+         IF( ktra == jp_tem )  CALL ptr_sum( hstr_vtr(:,jp_tem,:), zsj(:,:) )
+         IF( ktra == jp_sal )  CALL ptr_sum( hstr_vtr(:,jp_sal,:), zsj(:,:) )
       ENDIF
       !
-      IF( cptr == 'ldf' ) THEN
-         IF( ktra == jp_tem )  THEN
-             DO jn = 1, nbasin
-                hstr_ldf(:,jp_tem,jn) = ptr_sj( pvflx(:,:,:), btmsk(:,:,jn) )
-             ENDDO
-         ENDIF
-         IF( ktra == jp_sal )  THEN
-             DO jn = 1, nbasin
-                hstr_ldf(:,jp_sal,jn) = ptr_sj( pvflx(:,:,:), btmsk(:,:,jn) )
-             ENDDO
-         ENDIF
+   END SUBROUTINE dia_ptr_hst
+
+
+   SUBROUTINE ptr_sum_2d( phstr, pva )
+      !!----------------------------------------------------------------------
+      !!                    ***  ROUTINE ptr_sum_2d ***
+      !!----------------------------------------------------------------------
+      !! ** Purpose : Add two 2D arrays with (j,nbasin) dimensions
+      !!
+      !! ** Method  : - phstr = phstr + pva
+      !!              - Call mpp_sum if the final tile
+      !!
+      !! ** Action  : phstr
+      !!----------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpj,nbasin) , INTENT(inout)         ::  phstr  !
+      REAL(wp), DIMENSION(A1Dj(nn_hls),nbasin), INTENT(in)            ::  pva    !
+      INTEGER                                               ::  jj
+#if defined key_mpp_mpi
+      INTEGER, DIMENSION(1)           ::  ish1d
+      INTEGER, DIMENSION(2)           ::  ish2d
+      REAL(wp), DIMENSION(jpj*nbasin) ::  zwork
+#endif
+
+      DO jj = ntsj, ntej
+         phstr(jj,:) = phstr(jj,:)  + pva(jj,:)
+      END DO
+
+#if defined key_mpp_mpi
+      IF( ntile == 0 .OR. ntile == nijtile ) THEN
+         ish1d(1) = jpj*nbasin
+         ish2d(1) = jpj ; ish2d(2) = nbasin
+         zwork(:) = RESHAPE( phstr(:,:), ish1d )
+         CALL mpp_sum( 'diaptr', zwork, ish1d(1), ncomm_znl )
+         phstr(:,:) = RESHAPE( zwork, ish2d )
       ENDIF
-      !
-      IF( cptr == 'eiv' ) THEN
-         IF( ktra == jp_tem )  THEN
-             DO jn = 1, nbasin
-                hstr_eiv(:,jp_tem,jn) = ptr_sj( pvflx(:,:,:), btmsk(:,:,jn) )
-             ENDDO
-         ENDIF
-         IF( ktra == jp_sal )  THEN
-             DO jn = 1, nbasin
-                hstr_eiv(:,jp_sal,jn) = ptr_sj( pvflx(:,:,:), btmsk(:,:,jn) )
-             ENDDO
-         ENDIF
+#endif
+   END SUBROUTINE ptr_sum_2d
+
+
+   SUBROUTINE ptr_sum_3d( phstr, pva )
+      !!----------------------------------------------------------------------
+      !!                    ***  ROUTINE ptr_sum_3d ***
+      !!----------------------------------------------------------------------
+      !! ** Purpose : Add two 3D arrays with (j,k,nbasin) dimensions
+      !!
+      !! ** Method  : - phstr = phstr + pva
+      !!              - Call mpp_sum if the final tile
+      !!
+      !! ** Action  : phstr
+      !!----------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpj,jpk,nbasin) , INTENT(inout)     ::  phstr  !
+      REAL(wp), DIMENSION(A1Dj(nn_hls),jpk,nbasin), INTENT(in)        ::  pva    !
+      INTEGER                                               ::  jj, jk
+#if defined key_mpp_mpi
+      INTEGER, DIMENSION(1)              ::  ish1d
+      INTEGER, DIMENSION(3)              ::  ish3d
+      REAL(wp), DIMENSION(jpj*jpk*nbasin)  ::  zwork
+#endif
+
+      DO jk = 1, jpk
+         DO jj = ntsj, ntej
+            phstr(jj,jk,:) = phstr(jj,jk,:)  + pva(jj,jk,:)
+         END DO
+      END DO
+
+#if defined key_mpp_mpi
+      IF( ntile == 0 .OR. ntile == nijtile ) THEN
+         ish1d(1) = jpj*jpk*nbasin
+         ish3d(1) = jpj ; ish3d(2) = jpk ; ish3d(3) = nbasin
+         zwork(:) = RESHAPE( phstr(:,:,:), ish1d )
+         CALL mpp_sum( 'diaptr', zwork, ish1d(1), ncomm_znl )
+         phstr(:,:,:) = RESHAPE( zwork, ish3d )
       ENDIF
-      !
-      IF( cptr == 'vtr' ) THEN
-         IF( ktra == jp_tem )  THEN
-             DO jn = 1, nbasin
-                hstr_vtr(:,jp_tem,jn) = ptr_sj( pvflx(:,:,:), btmsk(:,:,jn) )
-             ENDDO
-         ENDIF
-         IF( ktra == jp_sal )  THEN
-             DO jn = 1, nbasin
-                hstr_vtr(:,jp_sal,jn) = ptr_sj( pvflx(:,:,:), btmsk(:,:,jn) )
-             ENDDO
-         ENDIF
-      ENDIF
-      !
-   END SUBROUTINE dia_ptr_hst
+#endif
+   END SUBROUTINE ptr_sum_3d
 
 
@@ -479,5 +643,5 @@
       !!----------------------------------------------------------------------
       INTEGER               ::   dia_ptr_alloc   ! return value
-      INTEGER, DIMENSION(3) ::   ierr
+      INTEGER, DIMENSION(2) ::   ierr
       !!----------------------------------------------------------------------
       ierr(:) = 0
@@ -491,5 +655,6 @@
             &      hstr_ldf(jpj,jpts,nbasin), hstr_vtr(jpj,jpts,nbasin), STAT=ierr(1)  )
             !
-         ALLOCATE( p_fval1d(jpj), p_fval2d(jpj,jpk), Stat=ierr(2))
+         ALLOCATE( pvtr_int(jpj,jpk,jpts+2,nbasin), &
+            &      pzon_int(jpj,jpk,jpts+1,nbasin), STAT=ierr(2) )
          !
          dia_ptr_alloc = MAXVAL( ierr )
@@ -511,23 +676,15 @@
       !! ** Action  : - p_fval: i-k-mean poleward flux of pvflx
       !!----------------------------------------------------------------------
-      REAL(wp), INTENT(in), DIMENSION(jpi,jpj,jpk)  ::   pvflx  ! mask flux array at V-point
-      REAL(wp), INTENT(in), DIMENSION(jpi,jpj)      ::   pmsk   ! Optional 2D basin mask
+      REAL(wp), INTENT(in), DIMENSION(A2D(nn_hls),jpk)  ::   pvflx  ! mask flux array at V-point
+      REAL(wp), INTENT(in), DIMENSION(jpi,jpj)  ::   pmsk   ! Optional 2D basin mask
       !
       INTEGER                  ::   ji, jj, jk   ! dummy loop arguments
-      INTEGER                  ::   ijpj         ! ???
-      REAL(wp), POINTER, DIMENSION(:) :: p_fval  ! function value
+      REAL(wp), DIMENSION(A1Dj(nn_hls)) :: p_fval  ! function value
       !!--------------------------------------------------------------------
       !
-      p_fval => p_fval1d
-
-      ijpj = jpj
       p_fval(:) = 0._wp
       DO_3D( 0, 0, 0, 0, 1, jpkm1 )
          p_fval(jj) = p_fval(jj) + pvflx(ji,jj,jk) * pmsk(ji,jj) * tmask_i(ji,jj)
       END_3D
-#if defined key_mpp_mpi
-      CALL mpp_sum( 'diaptr', p_fval, ijpj, ncomm_znl)
-#endif
-      !
    END FUNCTION ptr_sj_3d
 
@@ -544,23 +701,15 @@
       !! ** Action  : - p_fval: i-k-mean poleward flux of pvflx
       !!----------------------------------------------------------------------
-      REAL(wp) , INTENT(in), DIMENSION(jpi,jpj) ::   pvflx  ! mask flux array at V-point
+      REAL(wp) , INTENT(in), DIMENSION(A2D(nn_hls))     ::   pvflx  ! mask flux array at V-point
       REAL(wp) , INTENT(in), DIMENSION(jpi,jpj) ::   pmsk   ! Optional 2D basin mask
       !
       INTEGER                  ::   ji,jj       ! dummy loop arguments
-      INTEGER                  ::   ijpj        ! ???
-      REAL(wp), POINTER, DIMENSION(:) :: p_fval ! function value
+      REAL(wp), DIMENSION(A1Dj(nn_hls)) :: p_fval ! function value
       !!--------------------------------------------------------------------
-      ! 
-      p_fval => p_fval1d
-
-      ijpj = jpj
+      !
       p_fval(:) = 0._wp
       DO_2D( 0, 0, 0, 0 )
          p_fval(jj) = p_fval(jj) + pvflx(ji,jj) * pmsk(ji,jj) * tmask_i(ji,jj)
       END_2D
-#if defined key_mpp_mpi
-      CALL mpp_sum( 'diaptr', p_fval, ijpj, ncomm_znl )
-#endif
-      ! 
    END FUNCTION ptr_sj_2d
 
@@ -588,5 +737,4 @@
             p_fval(ji,jj) = p_fval(ji,jj-1) + pva(ji,jj) * tmask_i(ji,jj)
          END_2D
-         CALL lbc_lnk( 'diaptr', p_fval, 'U', -1.0_wp )
       END DO
       ! 
@@ -607,19 +755,11 @@
       !!
       IMPLICIT none
-      REAL(wp) , INTENT(in), DIMENSION(jpi,jpj,jpk) ::   pta    ! mask flux array at V-point
-      REAL(wp) , INTENT(in), DIMENSION(jpi,jpj)     ::   pmsk   ! Optional 2D basin mask
+      REAL(wp) , INTENT(in), DIMENSION(A2D(nn_hls),jpk) ::   pta    ! mask flux array at V-point
+      REAL(wp) , INTENT(in), DIMENSION(jpi,jpj) ::   pmsk   ! Optional 2D basin mask
       !!
       INTEGER                           :: ji, jj, jk ! dummy loop arguments
-      REAL(wp), POINTER, DIMENSION(:,:) :: p_fval     ! return function value
-#if defined key_mpp_mpi
-      INTEGER, DIMENSION(1) ::   ish
-      INTEGER, DIMENSION(2) ::   ish2
-      INTEGER               ::   ijpjjpk
-      REAL(wp), DIMENSION(jpj*jpk) ::   zwork    ! mask flux array at V-point
-#endif
+      REAL(wp), DIMENSION(A1Dj(nn_hls),jpk) :: p_fval     ! return function value
       !!--------------------------------------------------------------------
       !
-      p_fval => p_fval2d
-
       p_fval(:,:) = 0._wp
       !
@@ -627,13 +767,4 @@
          p_fval(jj,jk) = p_fval(jj,jk) + pta(ji,jj,jk) * pmsk(ji,jj) * tmask_i(ji,jj)
       END_3D
-      !
-#if defined key_mpp_mpi
-      ijpjjpk = jpj*jpk
-      ish(1) = ijpjjpk  ;   ish2(1) = jpj   ;   ish2(2) = jpk
-      zwork(1:ijpjjpk) = RESHAPE( p_fval, ish )
-      CALL mpp_sum( 'diaptr', zwork, ijpjjpk, ncomm_znl )
-      p_fval(:,:) = RESHAPE( zwork, ish2 )
-#endif
-      !
    END FUNCTION ptr_sjk
 
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/DOM/daymod.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/DOM/daymod.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/DOM/daymod.F90	(revision 14012)
@@ -149,12 +149,4 @@
       CALL day( nit000 )
       !
-      IF( lwxios ) THEN
-! define variables in restart file when writing with XIOS
-          CALL iom_set_rstw_var_active('kt')
-          CALL iom_set_rstw_var_active('ndastp')
-          CALL iom_set_rstw_var_active('adatrj')
-          CALL iom_set_rstw_var_active('ntime')
-      ENDIF
-
    END SUBROUTINE day_init
 
@@ -324,8 +316,7 @@
 
       IF( TRIM(cdrw) == 'READ' ) THEN
-
          IF( iom_varid( numror, 'kt', ldstop = .FALSE. ) > 0 ) THEN
             ! Get Calendar informations
-            CALL iom_get( numror, 'kt', zkt, ldxios = lrxios )   ! last time-step of previous run
+            CALL iom_get( numror, 'kt', zkt )   ! last time-step of previous run
             IF(lwp) THEN
                WRITE(numout,*) ' *** Info read in restart : '
@@ -346,8 +337,8 @@
             IF ( nrstdt == 2 ) THEN
                ! read the parameters corresponding to nit000 - 1 (last time step of previous run)
-               CALL iom_get( numror, 'ndastp', zndastp, ldxios = lrxios )
+               CALL iom_get( numror, 'ndastp', zndastp )
                ndastp = NINT( zndastp )
-               CALL iom_get( numror, 'adatrj', adatrj , ldxios = lrxios )
-	       CALL iom_get( numror, 'ntime' , ktime  , ldxios = lrxios )
+               CALL iom_get( numror, 'adatrj', adatrj  )
+	       CALL iom_get( numror, 'ntime' , ktime   )
                nn_time0 = NINT(ktime)
                ! calculate start time in hours and minutes
@@ -410,11 +401,9 @@
          ENDIF
          ! calendar control
-         IF( lwxios ) CALL iom_swap(      cwxios_context          )
-         CALL iom_rstput( kt, nitrst, numrow, 'kt'     , REAL( kt    , wp)  , ldxios = lwxios )   ! time-step
-         CALL iom_rstput( kt, nitrst, numrow, 'ndastp' , REAL( ndastp, wp)  , ldxios = lwxios )   ! date
-         CALL iom_rstput( kt, nitrst, numrow, 'adatrj' , adatrj             , ldxios = lwxios            )   ! number of elapsed days since
+         CALL iom_rstput( kt, nitrst, numrow, 'kt'     , REAL( kt    , wp)   )   ! time-step
+         CALL iom_rstput( kt, nitrst, numrow, 'ndastp' , REAL( ndastp, wp)   )   ! date
+         CALL iom_rstput( kt, nitrst, numrow, 'adatrj' , adatrj              )   ! number of elapsed days since
          !                                                                                                   ! the begining of the run [s]
-         CALL iom_rstput( kt, nitrst, numrow, 'ntime'  , REAL( nn_time0, wp), ldxios = lwxios ) ! time
-         IF( lwxios ) CALL iom_swap(      cxios_context          )
+         CALL iom_rstput( kt, nitrst, numrow, 'ntime'  , REAL( nn_time0, wp) ) ! time
       ENDIF
       !
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/DOM/dom_oce.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/DOM/dom_oce.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/DOM/dom_oce.F90	(revision 14012)
@@ -74,4 +74,14 @@
    LOGICAL, PUBLIC ::   l_Iperio, l_Jperio   !   should we explicitely take care I/J periodicity 
 
+   ! Tiling namelist
+   LOGICAL, PUBLIC ::   ln_tile
+   INTEGER         ::   nn_ltile_i, nn_ltile_j
+
+   ! Domain tiling (all tiles)
+   INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   ntsi_a       !: start of internal part of tile domain
+   INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   ntsj_a       !
+   INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   ntei_a       !: end of internal part of tile domain
+   INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   ntej_a       !
+
    !                             !: domain MPP decomposition parameters
    INTEGER             , PUBLIC ::   nimpp, njmpp     !: i- & j-indexes for mpp-subdomain left bottom
@@ -87,4 +97,8 @@
    INTEGER, PUBLIC ::   noea, nowe        !: index of the local neighboring processors in
    INTEGER, PUBLIC ::   noso, nono        !: east, west, south and north directions
+   INTEGER, PUBLIC ::   nones, nonws        !: north-east, north-west directions for sending 
+   INTEGER, PUBLIC ::   noses, nosws        !: south-east, south-west directions for sending
+   INTEGER, PUBLIC ::   noner, nonwr        !: north-east, north-west directions for receiving
+   INTEGER, PUBLIC ::   noser, noswr        !: south-east, south-west directions for receiving
    INTEGER, PUBLIC ::   nidom             !: ???
 
@@ -296,9 +310,9 @@
       ALLOCATE( e3t(jpi,jpj,jpk,jpt) , e3u (jpi,jpj,jpk,jpt) , e3v (jpi,jpj,jpk,jpt) , e3f(jpi,jpj,jpk) ,      &
          &      e3w(jpi,jpj,jpk,jpt) , e3uw(jpi,jpj,jpk,jpt) , e3vw(jpi,jpj,jpk,jpt)                    ,  STAT=ierr(ii) )
-#endif  
+#endif
          !
       ii = ii+1
       ALLOCATE( r3t  (jpi,jpj,jpt)   , r3u  (jpi,jpj,jpt)    , r3v  (jpi,jpj,jpt)    , r3f  (jpi,jpj) ,  &
-         &      r3t_f(jpi,jpj)       , r3u_f(jpi,jpj)        , r3v_f(jpi,jpj)                         ,  STAT=ierr(ii) )       
+         &      r3t_f(jpi,jpj)       , r3u_f(jpi,jpj)        , r3v_f(jpi,jpj)                         ,  STAT=ierr(ii) )
          !
       ii = ii+1
@@ -317,5 +331,5 @@
          !
       ii = ii+1
-      ALLOCATE( risfdep(jpi,jpj) , bathy(jpi,jpj) , STAT=ierr(ii)  ) 
+      ALLOCATE( risfdep(jpi,jpj) , bathy(jpi,jpj) , STAT=ierr(ii)  )
          !
       ii = ii+1
@@ -323,5 +337,5 @@
          !
       ii = ii+1
-      ALLOCATE( tmask_i(jpi,jpj) , tmask_h(jpi,jpj) ,                        & 
+      ALLOCATE( tmask_i(jpi,jpj) , tmask_h(jpi,jpj) ,                        &
          &      ssmask (jpi,jpj) , ssumask(jpi,jpj) , ssvmask(jpi,jpj) , ssfmask(jpi,jpj) ,     &
          &      mbkt   (jpi,jpj) , mbku   (jpi,jpj) , mbkv   (jpi,jpj) ,                    STAT=ierr(ii) )
@@ -331,5 +345,5 @@
          !
       ii = ii+1
-      ALLOCATE( tmask(jpi,jpj,jpk) , umask(jpi,jpj,jpk) ,     & 
+      ALLOCATE( tmask(jpi,jpj,jpk) , umask(jpi,jpj,jpk) ,     &
          &      vmask(jpi,jpj,jpk) , fmask(jpi,jpj,jpk) , STAT=ierr(ii) )
          !
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/DOM/domain.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/DOM/domain.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/DOM/domain.F90	(revision 14012)
@@ -45,4 +45,5 @@
    USE closea , ONLY : dom_clo ! closed seas
    !
+   USE prtctl         ! Print control (prt_ctl_info routine)
    USE in_out_manager ! I/O manager
    USE iom            ! I/O library
@@ -55,4 +56,5 @@
    PUBLIC   dom_init     ! called by nemogcm.F90
    PUBLIC   domain_cfg   ! called by nemogcm.F90
+   PUBLIC   dom_tile     ! called by step.F90
 
    !!-------------------------------------------------------------------------
@@ -63,5 +65,5 @@
 CONTAINS
 
-   SUBROUTINE dom_init( Kbb, Kmm, Kaa, cdstr )
+   SUBROUTINE dom_init( Kbb, Kmm, Kaa )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE dom_init  ***
@@ -79,5 +81,4 @@
       !!----------------------------------------------------------------------
       INTEGER          , INTENT(in) :: Kbb, Kmm, Kaa          ! ocean time level indices
-      CHARACTER (len=*), INTENT(in) :: cdstr                  ! model: NEMO or SAS. Determines core restart variables
       !
       INTEGER ::   ji, jj, jk, jt   ! dummy loop indices
@@ -120,22 +121,13 @@
          WRITE(numout,*)     '         cn_cfg = ', TRIM( cn_cfg ), '   nn_cfg = ', nn_cfg
       ENDIF
+      nn_wxios = 0
+      ln_xios_read = .FALSE.
       !
       !           !==  Reference coordinate system  ==!
       !
-      CALL dom_glo                     ! global domain versus local domain
-      CALL dom_nam                     ! read namelist ( namrun, namdom )
-      !
-      IF( lwxios ) THEN
-!define names for restart write and set core output (restart.F90)
-         CALL iom_set_rst_vars(rst_wfields)
-         CALL iom_set_rstw_core(cdstr)
-      ENDIF
-!reset namelist for SAS
-      IF(cdstr == 'SAS') THEN
-         IF(lrxios) THEN
-               IF(lwp) write(numout,*) 'Disable reading restart file using XIOS for SAS'
-               lrxios = .FALSE.
-         ENDIF
-      ENDIF
+      CALL dom_glo                            ! global domain versus local domain
+      CALL dom_nam                            ! read namelist ( namrun, namdom )
+      CALL dom_tile( ntsi, ntsj, ntei, ntej ) ! Tile domain
+
       !
       CALL dom_hgr                      ! Horizontal mesh
@@ -285,4 +277,87 @@
 
 
+   SUBROUTINE dom_tile( ktsi, ktsj, ktei, ktej, ktile )
+      !!----------------------------------------------------------------------
+      !!                     ***  ROUTINE dom_tile  ***
+      !!
+      !! ** Purpose :   Set tile domain variables
+      !!
+      !! ** Action  : - ktsi, ktsj     : start of internal part of domain
+      !!              - ktei, ktej     : end of internal part of domain
+      !!              - ntile          : current tile number
+      !!              - nijtile        : total number of tiles
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT(out) :: ktsi, ktsj, ktei, ktej      ! Tile domain indices
+      INTEGER, INTENT(in), OPTIONAL :: ktile              ! Tile number
+      INTEGER ::   jt                                     ! dummy loop argument
+      INTEGER ::   iitile, ijtile                         ! Local integers
+      CHARACTER (len=11) ::   charout
+      !!----------------------------------------------------------------------
+      IF( PRESENT(ktile) .AND. ln_tile ) THEN
+         ntile = ktile                 ! Set domain indices for tile
+         ktsi = ntsi_a(ktile)
+         ktsj = ntsj_a(ktile)
+         ktei = ntei_a(ktile)
+         ktej = ntej_a(ktile)
+
+         IF(sn_cfctl%l_prtctl) THEN
+            WRITE(charout, FMT="('ntile =', I4)") ktile
+            CALL prt_ctl_info( charout )
+         ENDIF
+      ELSE
+         ntile = 0                     ! Initialise to full domain
+         nijtile = 1
+         ktsi = Nis0
+         ktsj = Njs0
+         ktei = Nie0
+         ktej = Nje0
+
+         IF( ln_tile ) THEN            ! Calculate tile domain indices
+            iitile = Ni_0 / nn_ltile_i       ! Number of tiles
+            ijtile = Nj_0 / nn_ltile_j
+            IF( MOD( Ni_0, nn_ltile_i ) /= 0 ) iitile = iitile + 1
+            IF( MOD( Nj_0, nn_ltile_j ) /= 0 ) ijtile = ijtile + 1
+
+            nijtile = iitile * ijtile
+            ALLOCATE( ntsi_a(0:nijtile), ntsj_a(0:nijtile), ntei_a(0:nijtile), ntej_a(0:nijtile) )
+
+            ntsi_a(0) = ktsi                 ! Full domain
+            ntsj_a(0) = ktsj
+            ntei_a(0) = ktei
+            ntej_a(0) = ktej
+
+            DO jt = 1, nijtile               ! Tile domains
+               ntsi_a(jt) = Nis0 + nn_ltile_i * MOD(jt - 1, iitile)
+               ntsj_a(jt) = Njs0 + nn_ltile_j * ((jt - 1) / iitile)
+               ntei_a(jt) = MIN(ntsi_a(jt) + nn_ltile_i - 1, Nie0)
+               ntej_a(jt) = MIN(ntsj_a(jt) + nn_ltile_j - 1, Nje0)
+            ENDDO
+         ENDIF
+
+         IF(lwp) THEN                  ! control print
+            WRITE(numout,*)
+            WRITE(numout,*) 'dom_tile : Domain tiling decomposition'
+            WRITE(numout,*) '~~~~~~~~'
+            IF( ln_tile ) THEN
+               WRITE(numout,*) iitile, 'tiles in i'
+               WRITE(numout,*) '    Starting indices'
+               WRITE(numout,*) '        ', (ntsi_a(jt), jt=1, iitile)
+               WRITE(numout,*) '    Ending indices'
+               WRITE(numout,*) '        ', (ntei_a(jt), jt=1, iitile)
+               WRITE(numout,*) ijtile, 'tiles in j'
+               WRITE(numout,*) '    Starting indices'
+               WRITE(numout,*) '        ', (ntsj_a(jt), jt=1, nijtile, iitile)
+               WRITE(numout,*) '    Ending indices'
+               WRITE(numout,*) '        ', (ntej_a(jt), jt=1, nijtile, iitile)
+            ELSE
+               WRITE(numout,*) 'No domain tiling'
+               WRITE(numout,*) '    i indices =', ktsi, ':', ktei
+               WRITE(numout,*) '    j indices =', ktsj, ':', ktej
+            ENDIF
+         ENDIF
+      ENDIF
+   END SUBROUTINE dom_tile
+
+
    SUBROUTINE dom_nam
       !!----------------------------------------------------------------------
@@ -293,4 +368,5 @@
       !! ** input   : - namrun namelist
       !!              - namdom namelist
+      !!              - namtile namelist
       !!              - namnc4 namelist   ! "key_netcdf4" only
       !!----------------------------------------------------------------------
@@ -305,4 +381,5 @@
          &             ln_cfmeta, ln_xios_read, nn_wxios
       NAMELIST/namdom/ ln_linssh, rn_Dt, rn_atfp, ln_crs, ln_meshmask
+      NAMELIST/namtile/ ln_tile, nn_ltile_i, nn_ltile_j
 #if defined key_netcdf4
       NAMELIST/namnc4/ nn_nchunks_i, nn_nchunks_j, nn_nchunks_k, ln_nc4zip
@@ -441,4 +518,24 @@
       r1_Dt = 1._wp / rDt
 
+      READ  ( numnam_ref, namtile, IOSTAT = ios, ERR = 905 )
+905   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namtile in reference namelist' )
+      READ  ( numnam_cfg, namtile, IOSTAT = ios, ERR = 906 )
+906   IF( ios >  0 )   CALL ctl_nam ( ios , 'namtile in configuration namelist' )
+      IF(lwm) WRITE( numond, namtile )
+
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*)    '   Namelist : namtile   ---   Domain tiling decomposition'
+         WRITE(numout,*)    '      Tiling (T) or not (F)                ln_tile    = ', ln_tile
+         WRITE(numout,*)    '      Length of tile in i                  nn_ltile_i = ', nn_ltile_i
+         WRITE(numout,*)    '      Length of tile in j                  nn_ltile_j = ', nn_ltile_j
+         WRITE(numout,*)
+         IF( ln_tile ) THEN
+            WRITE(numout,*) '      The domain will be decomposed into tiles of size', nn_ltile_i, 'x', nn_ltile_j
+         ELSE
+            WRITE(numout,*) '      Domain tiling will NOT be used'
+         ENDIF
+      ENDIF
+
       IF( TRIM(Agrif_CFixed()) == '0' ) THEN
          lrxios = ln_xios_read.AND.ln_rstart
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/DOM/domqco.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/DOM/domqco.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/DOM/domqco.F90	(revision 14012)
@@ -91,9 +91,4 @@
       !
       CALL dom_qco_zgr(Kbb, Kmm, Kaa) ! interpolation scale factor, depth and water column
-      !
-      ! IF(lwxios) THEN   ! define variables in restart file when writing with XIOS
-      !    CALL iom_set_rstw_var_active('e3t_b')
-      !    CALL iom_set_rstw_var_active('e3t_n')
-      ! ENDIF
       !
    END SUBROUTINE dom_qco_init
@@ -217,6 +212,6 @@
             !
             IF( MIN( id1, id2 ) > 0 ) THEN       ! all required arrays exist
-               CALL iom_get( numror, jpdom_auto, 'sshb'   , ssh(:,:,Kbb), ldxios = lrxios    )
-               CALL iom_get( numror, jpdom_auto, 'sshn'   , ssh(:,:,Kmm), ldxios = lrxios    )
+               CALL iom_get( numror, jpdom_auto, 'sshb'   , ssh(:,:,Kbb)    )
+               CALL iom_get( numror, jpdom_auto, 'sshn'   , ssh(:,:,Kmm)    )
                ! needed to restart if land processor not computed
                IF(lwp) write(numout,*) 'qe_rst_read : ssh(:,:,Kbb) and ssh(:,:,Kmm) found in restart files'
@@ -232,5 +227,5 @@
                IF(lwp) write(numout,*) 'sshn set equal to sshb.'
                IF(lwp) write(numout,*) 'neuler is forced to 0'
-               CALL iom_get( numror, jpdom_auto, 'sshb', ssh(:,:,Kbb), ldxios = lrxios )
+               CALL iom_get( numror, jpdom_auto, 'sshb', ssh(:,:,Kbb) )
                ssh(:,:,Kmm) = ssh(:,:,Kbb)
                l_1st_euler = .TRUE.
@@ -239,5 +234,5 @@
                IF(lwp) write(numout,*) 'sshb set equal to sshn.'
                IF(lwp) write(numout,*) 'neuler is forced to 0'
-               CALL iom_get( numror, jpdom_auto, 'sshn', ssh(:,:,Kmm), ldxios = lrxios )
+               CALL iom_get( numror, jpdom_auto, 'sshn', ssh(:,:,Kmm) )
                ssh(:,:,Kbb) = ssh(:,:,Kmm)
                l_1st_euler = .TRUE.
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/DOM/domutl.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/DOM/domutl.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/DOM/domutl.F90	(revision 14012)
@@ -21,6 +21,11 @@
    PRIVATE
 
+   INTERFACE is_tile
+      MODULE PROCEDURE is_tile_2d, is_tile_3d, is_tile_4d
+   END INTERFACE is_tile
+
    PUBLIC dom_ngb    ! routine called in iom.F90 module
    PUBLIC dom_uniq   ! Called by dommsk and domwri
+   PUBLIC is_tile
 
    !!----------------------------------------------------------------------
@@ -109,5 +114,44 @@
       !
    END SUBROUTINE dom_uniq
-   
+
+
+   FUNCTION is_tile_2d( pt )
+      !!
+      REAL(wp), DIMENSION(:,:), INTENT(in) ::   pt
+      INTEGER :: is_tile_2d
+      !!
+      IF( ln_tile .AND. (SIZE(pt, 1) < jpi .OR. SIZE(pt, 2) < jpj) ) THEN
+         is_tile_2d = 1
+      ELSE
+         is_tile_2d = 0
+      ENDIF
+   END FUNCTION is_tile_2d
+
+
+   FUNCTION is_tile_3d( pt )
+      !!
+      REAL(wp), DIMENSION(:,:,:), INTENT(in) ::   pt
+      INTEGER :: is_tile_3d
+      !!
+      IF( ln_tile .AND. (SIZE(pt, 1) < jpi .OR. SIZE(pt, 2) < jpj) ) THEN
+         is_tile_3d = 1
+      ELSE
+         is_tile_3d = 0
+      ENDIF
+   END FUNCTION is_tile_3d
+
+
+   FUNCTION is_tile_4d( pt )
+      !!
+      REAL(wp), DIMENSION(:,:,:,:), INTENT(in) ::   pt
+      INTEGER :: is_tile_4d
+      !!
+      IF( ln_tile .AND. (SIZE(pt, 1) < jpi .OR. SIZE(pt, 2) < jpj) ) THEN
+         is_tile_4d = 1
+      ELSE
+         is_tile_4d = 0
+      ENDIF
+   END FUNCTION is_tile_4d
+
    !!======================================================================
 END MODULE domutl
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/DOM/domvvl.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/DOM/domvvl.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/DOM/domvvl.F90	(revision 14012)
@@ -282,22 +282,4 @@
       ENDIF
       !
-      IF(lwxios) THEN
-! define variables in restart file when writing with XIOS
-         CALL iom_set_rstw_var_active('e3t_b')
-         CALL iom_set_rstw_var_active('e3t_n')
-         !                                           ! ----------------------- !
-         IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN  ! z_tilde and layer cases !
-            !                                        ! ----------------------- !
-            CALL iom_set_rstw_var_active('tilde_e3t_b')
-            CALL iom_set_rstw_var_active('tilde_e3t_n')
-         END IF
-         !                                           ! -------------!    
-         IF( ln_vvl_ztilde ) THEN                    ! z_tilde case !
-            !                                        ! ------------ !
-            CALL iom_set_rstw_var_active('hdiv_lf')
-         ENDIF
-         !
-      ENDIF
-      !
    END SUBROUTINE dom_vvl_zgr
 
@@ -440,5 +422,4 @@
          !                             (stored for tracer advction and continuity equation)
          CALL lbc_lnk_multi( 'domvvl', un_td , 'U' , -1._wp, vn_td , 'V' , -1._wp)
-
          ! 4 - Time stepping of baroclinic scale factors
          ! ---------------------------------------------
@@ -803,5 +784,5 @@
          IF( ln_rstart ) THEN                   !* Read the restart file
             CALL rst_read_open                  !  open the restart file if necessary
-            CALL iom_get( numror, jpdom_auto, 'sshn'   , ssh(:,:,Kmm), ldxios = lrxios    )
+            CALL iom_get( numror, jpdom_auto, 'sshn'   , ssh(:,:,Kmm)    )
             !
             id1 = iom_varid( numror, 'e3t_b', ldstop = .FALSE. )
@@ -816,6 +797,6 @@
             !
             IF( MIN( id1, id2 ) > 0 ) THEN       ! all required arrays exist
-               CALL iom_get( numror, jpdom_auto, 'e3t_b', e3t(:,:,:,Kbb), ldxios = lrxios )
-               CALL iom_get( numror, jpdom_auto, 'e3t_n', e3t(:,:,:,Kmm), ldxios = lrxios )
+               CALL iom_get( numror, jpdom_auto, 'e3t_b', e3t(:,:,:,Kbb) )
+               CALL iom_get( numror, jpdom_auto, 'e3t_n', e3t(:,:,:,Kmm) )
                ! needed to restart if land processor not computed 
                IF(lwp) write(numout,*) 'dom_vvl_rst : e3t(:,:,:,Kbb) and e3t(:,:,:,Kmm) found in restart files'
@@ -831,5 +812,5 @@
                IF(lwp) write(numout,*) 'e3t_n set equal to e3t_b.'
                IF(lwp) write(numout,*) 'l_1st_euler is forced to true'
-               CALL iom_get( numror, jpdom_auto, 'e3t_b', e3t(:,:,:,Kbb), ldxios = lrxios )
+               CALL iom_get( numror, jpdom_auto, 'e3t_b', e3t(:,:,:,Kbb) )
                e3t(:,:,:,Kmm) = e3t(:,:,:,Kbb)
                l_1st_euler = .true.
@@ -838,5 +819,5 @@
                IF(lwp) write(numout,*) 'e3t_b set equal to e3t_n.'
                IF(lwp) write(numout,*) 'l_1st_euler is forced to true'
-               CALL iom_get( numror, jpdom_auto, 'e3t_n', e3t(:,:,:,Kmm), ldxios = lrxios )
+               CALL iom_get( numror, jpdom_auto, 'e3t_n', e3t(:,:,:,Kmm) )
                e3t(:,:,:,Kbb) = e3t(:,:,:,Kmm)
                l_1st_euler = .true.
@@ -863,6 +844,6 @@
                !                          ! ----------------------- !
                IF( MIN( id3, id4 ) > 0 ) THEN  ! all required arrays exist
-                  CALL iom_get( numror, jpdom_auto, 'tilde_e3t_b', tilde_e3t_b(:,:,:), ldxios = lrxios )
-                  CALL iom_get( numror, jpdom_auto, 'tilde_e3t_n', tilde_e3t_n(:,:,:), ldxios = lrxios )
+                  CALL iom_get( numror, jpdom_auto, 'tilde_e3t_b', tilde_e3t_b(:,:,:) )
+                  CALL iom_get( numror, jpdom_auto, 'tilde_e3t_n', tilde_e3t_n(:,:,:) )
                ELSE                            ! one at least array is missing
                   tilde_e3t_b(:,:,:) = 0.0_wp
@@ -873,5 +854,5 @@
                   !                       ! ------------ !
                   IF( id5 > 0 ) THEN  ! required array exists
-                     CALL iom_get( numror, jpdom_auto, 'hdiv_lf', hdiv_lf(:,:,:), ldxios = lrxios )
+                     CALL iom_get( numror, jpdom_auto, 'hdiv_lf', hdiv_lf(:,:,:) )
                   ELSE                ! array is missing
                      hdiv_lf(:,:,:) = 0.0_wp
@@ -946,23 +927,21 @@
          !                                   ! ===================
          IF(lwp) WRITE(numout,*) '---- dom_vvl_rst ----'
-         IF( lwxios ) CALL iom_swap(      cwxios_context          )
          !                                           ! --------- !
          !                                           ! all cases !
          !                                           ! --------- !
-         CALL iom_rstput( kt, nitrst, numrow, 'e3t_b', e3t(:,:,:,Kbb), ldxios = lwxios )
-         CALL iom_rstput( kt, nitrst, numrow, 'e3t_n', e3t(:,:,:,Kmm), ldxios = lwxios )
+         CALL iom_rstput( kt, nitrst, numrow, 'e3t_b', e3t(:,:,:,Kbb) )
+         CALL iom_rstput( kt, nitrst, numrow, 'e3t_n', e3t(:,:,:,Kmm) )
          !                                           ! ----------------------- !
          IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN  ! z_tilde and layer cases !
             !                                        ! ----------------------- !
-            CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_b', tilde_e3t_b(:,:,:), ldxios = lwxios)
-            CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_n', tilde_e3t_n(:,:,:), ldxios = lwxios)
+            CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_b', tilde_e3t_b(:,:,:))
+            CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_n', tilde_e3t_n(:,:,:))
          END IF
          !                                           ! -------------!    
          IF( ln_vvl_ztilde ) THEN                    ! z_tilde case !
             !                                        ! ------------ !
-            CALL iom_rstput( kt, nitrst, numrow, 'hdiv_lf', hdiv_lf(:,:,:), ldxios = lwxios)
+            CALL iom_rstput( kt, nitrst, numrow, 'hdiv_lf', hdiv_lf(:,:,:))
          ENDIF
          !
-         IF( lwxios ) CALL iom_swap(      cxios_context          )
       ENDIF
       !
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/DOM/dtatsd.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/DOM/dtatsd.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/DOM/dtatsd.F90	(revision 14012)
@@ -18,4 +18,5 @@
    USE phycst          ! physical constants
    USE dom_oce         ! ocean space and time domain
+   USE domain, ONLY : dom_tile
    USE fldread         ! read input fields
    !
@@ -135,56 +136,67 @@
       !! ** Action  :   ptsd   T-S data on medl mesh and interpolated at time-step kt
       !!----------------------------------------------------------------------
-      INTEGER                              , INTENT(in   ) ::   kt     ! ocean time-step
-      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(  out) ::   ptsd   ! T & S data
+      INTEGER                          , INTENT(in   ) ::   kt     ! ocean time-step
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk,jpts), INTENT(  out) ::   ptsd   ! T & S data
       !
       INTEGER ::   ji, jj, jk, jl, jkk   ! dummy loop indicies
       INTEGER ::   ik, il0, il1, ii0, ii1, ij0, ij1   ! local integers
+      INTEGER ::   itile
       REAL(wp)::   zl, zi                             ! local scalars
       REAL(wp), DIMENSION(jpk) ::  ztp, zsp   ! 1D workspace
       !!----------------------------------------------------------------------
       !
-      CALL fld_read( kt, 1, sf_tsd )      !==   read T & S data at kt time step   ==!
+      IF( ntile == 0 .OR. ntile == 1 )  THEN                                         ! Do only for the full domain
+         itile = ntile
+         IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 )            ! Use full domain
+            CALL fld_read( kt, 1, sf_tsd )   !==   read T & S data at kt time step   ==!
       !
       !
 !!gm  This should be removed from the code   ===>>>>  T & S files has to be changed
-      !
-      !                                   !==   ORCA_R2 configuration and T & S damping   ==! 
-      IF( cn_cfg == "orca" .OR. cn_cfg == "ORCA" ) THEN
-         IF( nn_cfg == 2 .AND. ln_tsd_dmp ) THEN    ! some hand made alterations
-            !
-            ij0 = 101 + nn_hls       ;   ij1 = 109 + nn_hls                       ! Reduced T & S in the Alboran Sea
-            ii0 = 141 + nn_hls - 1   ;   ii1 = 155 + nn_hls - 1
-            DO jj = mj0(ij0), mj1(ij1)
-               DO ji = mi0(ii0), mi1(ii1)
-                  sf_tsd(jp_tem)%fnow(ji,jj,13:13) = sf_tsd(jp_tem)%fnow(ji,jj,13:13) - 0.20_wp
-                  sf_tsd(jp_tem)%fnow(ji,jj,14:15) = sf_tsd(jp_tem)%fnow(ji,jj,14:15) - 0.35_wp
-                  sf_tsd(jp_tem)%fnow(ji,jj,16:25) = sf_tsd(jp_tem)%fnow(ji,jj,16:25) - 0.40_wp
-                  !
-                  sf_tsd(jp_sal)%fnow(ji,jj,13:13) = sf_tsd(jp_sal)%fnow(ji,jj,13:13) - 0.15_wp
-                  sf_tsd(jp_sal)%fnow(ji,jj,14:15) = sf_tsd(jp_sal)%fnow(ji,jj,14:15) - 0.25_wp
-                  sf_tsd(jp_sal)%fnow(ji,jj,16:17) = sf_tsd(jp_sal)%fnow(ji,jj,16:17) - 0.30_wp
-                  sf_tsd(jp_sal)%fnow(ji,jj,18:25) = sf_tsd(jp_sal)%fnow(ji,jj,18:25) - 0.35_wp
+         !
+         !                                   !==   ORCA_R2 configuration and T & S damping   ==!
+         IF( cn_cfg == "orca" .OR. cn_cfg == "ORCA" ) THEN
+            IF( nn_cfg == 2 .AND. ln_tsd_dmp ) THEN    ! some hand made alterations
+               !
+               ij0 = 101 + nn_hls       ;   ij1 = 109 + nn_hls                       ! Reduced T & S in the Alboran Sea
+               ii0 = 141 + nn_hls - 1   ;   ii1 = 155 + nn_hls - 1
+               DO jj = mj0(ij0), mj1(ij1)
+                  DO ji = mi0(ii0), mi1(ii1)
+                     sf_tsd(jp_tem)%fnow(ji,jj,13:13) = sf_tsd(jp_tem)%fnow(ji,jj,13:13) - 0.20_wp
+                     sf_tsd(jp_tem)%fnow(ji,jj,14:15) = sf_tsd(jp_tem)%fnow(ji,jj,14:15) - 0.35_wp
+                     sf_tsd(jp_tem)%fnow(ji,jj,16:25) = sf_tsd(jp_tem)%fnow(ji,jj,16:25) - 0.40_wp
+                     !
+                     sf_tsd(jp_sal)%fnow(ji,jj,13:13) = sf_tsd(jp_sal)%fnow(ji,jj,13:13) - 0.15_wp
+                     sf_tsd(jp_sal)%fnow(ji,jj,14:15) = sf_tsd(jp_sal)%fnow(ji,jj,14:15) - 0.25_wp
+                     sf_tsd(jp_sal)%fnow(ji,jj,16:17) = sf_tsd(jp_sal)%fnow(ji,jj,16:17) - 0.30_wp
+                     sf_tsd(jp_sal)%fnow(ji,jj,18:25) = sf_tsd(jp_sal)%fnow(ji,jj,18:25) - 0.35_wp
+                  END DO
                END DO
-            END DO
-            ij0 =  87 + nn_hls       ;   ij1 =  96 + nn_hls                       ! Reduced temperature in Red Sea
-            ii0 = 148 + nn_hls - 1   ;   ii1 = 160 + nn_hls - 1
-            sf_tsd(jp_tem)%fnow( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ,  4:10 ) = 7.0_wp
-            sf_tsd(jp_tem)%fnow( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 11:13 ) = 6.5_wp
-            sf_tsd(jp_tem)%fnow( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 14:20 ) = 6.0_wp
-         ENDIF
-      ENDIF
+               ij0 =  87 + nn_hls       ;   ij1 =  96 + nn_hls                       ! Reduced temperature in Red Sea
+               ii0 = 148 + nn_hls - 1   ;   ii1 = 160 + nn_hls - 1
+               sf_tsd(jp_tem)%fnow( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ,  4:10 ) = 7.0_wp
+               sf_tsd(jp_tem)%fnow( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 11:13 ) = 6.5_wp
+               sf_tsd(jp_tem)%fnow( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 14:20 ) = 6.0_wp
+            ENDIF
+         ENDIF
 !!gm end
-      !
-      ptsd(:,:,:,jp_tem) = sf_tsd(jp_tem)%fnow(:,:,:)    ! NO mask
-      ptsd(:,:,:,jp_sal) = sf_tsd(jp_sal)%fnow(:,:,:) 
+         IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = itile )            ! Revert to tile domain
+      ENDIF
+      !
+      DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpk )
+         ptsd(ji,jj,jk,jp_tem) = sf_tsd(jp_tem)%fnow(ji,jj,jk)    ! NO mask
+         ptsd(ji,jj,jk,jp_sal) = sf_tsd(jp_sal)%fnow(ji,jj,jk)
+      END_3D
       !
       IF( ln_sco ) THEN                   !==   s- or mixed s-zps-coordinate   ==!
          !
-         IF( kt == nit000 .AND. lwp )THEN
-            WRITE(numout,*)
-            WRITE(numout,*) 'dta_tsd: interpolates T & S data onto the s- or mixed s-z-coordinate mesh'
-         ENDIF
-         !
-         DO_2D( 1, 1, 1, 1 )                  ! vertical interpolation of T & S
+         IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile
+            IF( kt == nit000 .AND. lwp )THEN
+               WRITE(numout,*)
+               WRITE(numout,*) 'dta_tsd: interpolates T & S data onto the s- or mixed s-z-coordinate mesh'
+            ENDIF
+         ENDIF
+         !
+         ! NOTE: [tiling-comms-merge] This fix was necessary to take out tra_adv lbc_lnk statements in the zps case, but did not work in the zco case
+         DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )                  ! vertical interpolation of T & S
             DO jk = 1, jpk                        ! determines the intepolated T-S profiles at each (i,j) points
                zl = gdept_0(ji,jj,jk)
@@ -215,9 +227,12 @@
       ELSE                                !==   z- or zps- coordinate   ==!
          !                             
-         ptsd(:,:,:,jp_tem) = ptsd(:,:,:,jp_tem) * tmask(:,:,:)    ! Mask
-         ptsd(:,:,:,jp_sal) = ptsd(:,:,:,jp_sal) * tmask(:,:,:)
+         DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpk )
+            ptsd(ji,jj,jk,jp_tem) = ptsd(ji,jj,jk,jp_tem) * tmask(ji,jj,jk)    ! Mask
+            ptsd(ji,jj,jk,jp_sal) = ptsd(ji,jj,jk,jp_sal) * tmask(ji,jj,jk)
+         END_3D
          !
          IF( ln_zps ) THEN                      ! zps-coordinate (partial steps) interpolation at the last ocean level
-            DO_2D( 1, 1, 1, 1 )
+            ! NOTE: [tiling-comms-merge] This fix was necessary to take out tra_adv lbc_lnk statements in the zps case
+            DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
                ik = mbkt(ji,jj) 
                IF( ik > 1 ) THEN
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/DYN/dynhpg.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/DYN/dynhpg.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/DYN/dynhpg.F90	(revision 14012)
@@ -302,6 +302,7 @@
       INTEGER  ::   iku, ikv                         ! temporary integers
       REAL(wp) ::   zcoef0, zcoef1, zcoef2, zcoef3   ! temporary scalars
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zhpi, zhpj
-      REAL(wp), DIMENSION(jpi,jpj) :: zgtsu, zgtsv, zgru, zgrv
+      REAL(wp), DIMENSION(jpi,jpj,jpk) :: zhpi, zhpj
+      REAL(wp), DIMENSION(jpi,jpj,jpts)   :: zgtsu, zgtsv
+      REAL(wp), DIMENSION(jpi,jpj)     :: zgru, zgrv
       !!----------------------------------------------------------------------
       !
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/DYN/dynspg_ts.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/DYN/dynspg_ts.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/DYN/dynspg_ts.F90	(revision 14012)
@@ -900,21 +900,21 @@
          !                                   ! ---------------
          IF( ln_rstart .AND. ln_bt_fw .AND. (.NOT.l_1st_euler) ) THEN    !* Read the restart file
-            CALL iom_get( numror, jpdom_auto, 'ub2_b'  , ub2_b  (:,:), cd_type = 'U', psgn = -1._wp, ldxios = lrxios )   
-            CALL iom_get( numror, jpdom_auto, 'vb2_b'  , vb2_b  (:,:), cd_type = 'V', psgn = -1._wp, ldxios = lrxios ) 
-            CALL iom_get( numror, jpdom_auto, 'un_bf'  , un_bf  (:,:), cd_type = 'U', psgn = -1._wp, ldxios = lrxios )   
-            CALL iom_get( numror, jpdom_auto, 'vn_bf'  , vn_bf  (:,:), cd_type = 'V', psgn = -1._wp, ldxios = lrxios ) 
+            CALL iom_get( numror, jpdom_auto, 'ub2_b'  , ub2_b  (:,:), cd_type = 'U', psgn = -1._wp )   
+            CALL iom_get( numror, jpdom_auto, 'vb2_b'  , vb2_b  (:,:), cd_type = 'V', psgn = -1._wp ) 
+            CALL iom_get( numror, jpdom_auto, 'un_bf'  , un_bf  (:,:), cd_type = 'U', psgn = -1._wp )   
+            CALL iom_get( numror, jpdom_auto, 'vn_bf'  , vn_bf  (:,:), cd_type = 'V', psgn = -1._wp ) 
             IF( .NOT.ln_bt_av ) THEN
-               CALL iom_get( numror, jpdom_auto, 'sshbb_e'  , sshbb_e(:,:), cd_type = 'T', psgn =  1._wp, ldxios = lrxios )   
-               CALL iom_get( numror, jpdom_auto, 'ubb_e'    ,   ubb_e(:,:), cd_type = 'U', psgn = -1._wp, ldxios = lrxios )   
-               CALL iom_get( numror, jpdom_auto, 'vbb_e'    ,   vbb_e(:,:), cd_type = 'V', psgn = -1._wp, ldxios = lrxios )
-               CALL iom_get( numror, jpdom_auto, 'sshb_e'   ,  sshb_e(:,:), cd_type = 'T', psgn =  1._wp, ldxios = lrxios ) 
-               CALL iom_get( numror, jpdom_auto, 'ub_e'     ,    ub_e(:,:), cd_type = 'U', psgn = -1._wp, ldxios = lrxios )   
-               CALL iom_get( numror, jpdom_auto, 'vb_e'     ,    vb_e(:,:), cd_type = 'V', psgn = -1._wp, ldxios = lrxios )
+               CALL iom_get( numror, jpdom_auto, 'sshbb_e'  , sshbb_e(:,:), cd_type = 'T', psgn =  1._wp )   
+               CALL iom_get( numror, jpdom_auto, 'ubb_e'    ,   ubb_e(:,:), cd_type = 'U', psgn = -1._wp )   
+               CALL iom_get( numror, jpdom_auto, 'vbb_e'    ,   vbb_e(:,:), cd_type = 'V', psgn = -1._wp )
+               CALL iom_get( numror, jpdom_auto, 'sshb_e'   ,  sshb_e(:,:), cd_type = 'T', psgn =  1._wp ) 
+               CALL iom_get( numror, jpdom_auto, 'ub_e'     ,    ub_e(:,:), cd_type = 'U', psgn = -1._wp )   
+               CALL iom_get( numror, jpdom_auto, 'vb_e'     ,    vb_e(:,:), cd_type = 'V', psgn = -1._wp )
             ENDIF
 #if defined key_agrif
             ! Read time integrated fluxes
             IF ( .NOT.Agrif_Root() ) THEN
-               CALL iom_get( numror, jpdom_auto, 'ub2_i_b'  , ub2_i_b(:,:), cd_type = 'U', psgn = -1._wp, ldxios = lrxios )   
-               CALL iom_get( numror, jpdom_auto, 'vb2_i_b'  , vb2_i_b(:,:), cd_type = 'V', psgn = -1._wp, ldxios = lrxios )
+               CALL iom_get( numror, jpdom_auto, 'ub2_i_b'  , ub2_i_b(:,:), cd_type = 'U', psgn = -1._wp )   
+               CALL iom_get( numror, jpdom_auto, 'vb2_i_b'  , vb2_i_b(:,:), cd_type = 'V', psgn = -1._wp )
             ELSE
                ub2_i_b(:,:) = 0._wp   ;   vb2_i_b(:,:) = 0._wp   ! used in the 1st update of agrif
@@ -935,26 +935,24 @@
          !                                   ! -------------------
          IF(lwp) WRITE(numout,*) '---- ts_rst ----'
-         IF( lwxios ) CALL iom_swap(      cwxios_context          )
-         CALL iom_rstput( kt, nitrst, numrow, 'ub2_b'   , ub2_b  (:,:), ldxios = lwxios )
-         CALL iom_rstput( kt, nitrst, numrow, 'vb2_b'   , vb2_b  (:,:), ldxios = lwxios )
-         CALL iom_rstput( kt, nitrst, numrow, 'un_bf'   , un_bf  (:,:), ldxios = lwxios )
-         CALL iom_rstput( kt, nitrst, numrow, 'vn_bf'   , vn_bf  (:,:), ldxios = lwxios )
+         CALL iom_rstput( kt, nitrst, numrow, 'ub2_b'   , ub2_b  (:,:) )
+         CALL iom_rstput( kt, nitrst, numrow, 'vb2_b'   , vb2_b  (:,:) )
+         CALL iom_rstput( kt, nitrst, numrow, 'un_bf'   , un_bf  (:,:) )
+         CALL iom_rstput( kt, nitrst, numrow, 'vn_bf'   , vn_bf  (:,:) )
          !
          IF (.NOT.ln_bt_av) THEN
-            CALL iom_rstput( kt, nitrst, numrow, 'sshbb_e'  , sshbb_e(:,:), ldxios = lwxios ) 
-            CALL iom_rstput( kt, nitrst, numrow, 'ubb_e'    ,   ubb_e(:,:), ldxios = lwxios )
-            CALL iom_rstput( kt, nitrst, numrow, 'vbb_e'    ,   vbb_e(:,:), ldxios = lwxios )
-            CALL iom_rstput( kt, nitrst, numrow, 'sshb_e'   ,  sshb_e(:,:), ldxios = lwxios )
-            CALL iom_rstput( kt, nitrst, numrow, 'ub_e'     ,    ub_e(:,:), ldxios = lwxios )
-            CALL iom_rstput( kt, nitrst, numrow, 'vb_e'     ,    vb_e(:,:), ldxios = lwxios )
+            CALL iom_rstput( kt, nitrst, numrow, 'sshbb_e'  , sshbb_e(:,:) ) 
+            CALL iom_rstput( kt, nitrst, numrow, 'ubb_e'    ,   ubb_e(:,:) )
+            CALL iom_rstput( kt, nitrst, numrow, 'vbb_e'    ,   vbb_e(:,:) )
+            CALL iom_rstput( kt, nitrst, numrow, 'sshb_e'   ,  sshb_e(:,:) )
+            CALL iom_rstput( kt, nitrst, numrow, 'ub_e'     ,    ub_e(:,:) )
+            CALL iom_rstput( kt, nitrst, numrow, 'vb_e'     ,    vb_e(:,:) )
          ENDIF
 #if defined key_agrif
          ! Save time integrated fluxes
          IF ( .NOT.Agrif_Root() ) THEN
-            CALL iom_rstput( kt, nitrst, numrow, 'ub2_i_b'  , ub2_i_b(:,:), ldxios = lwxios )
-            CALL iom_rstput( kt, nitrst, numrow, 'vb2_i_b'  , vb2_i_b(:,:), ldxios = lwxios )
+            CALL iom_rstput( kt, nitrst, numrow, 'ub2_i_b'  , ub2_i_b(:,:) )
+            CALL iom_rstput( kt, nitrst, numrow, 'vb2_i_b'  , vb2_i_b(:,:) )
          ENDIF
 #endif
-         IF( lwxios ) CALL iom_swap(      cxios_context          )
       ENDIF
       !
@@ -1048,28 +1046,4 @@
       !                             ! read restart when needed
       CALL ts_rst( nit000, 'READ' )
-      !
-      IF( lwxios ) THEN
-! define variables in restart file when writing with XIOS
-         CALL iom_set_rstw_var_active('ub2_b')
-         CALL iom_set_rstw_var_active('vb2_b')
-         CALL iom_set_rstw_var_active('un_bf')
-         CALL iom_set_rstw_var_active('vn_bf')
-         !
-         IF (.NOT.ln_bt_av) THEN
-            CALL iom_set_rstw_var_active('sshbb_e')
-            CALL iom_set_rstw_var_active('ubb_e')
-            CALL iom_set_rstw_var_active('vbb_e')
-            CALL iom_set_rstw_var_active('sshb_e')
-            CALL iom_set_rstw_var_active('ub_e')
-            CALL iom_set_rstw_var_active('vb_e')
-         ENDIF
-#if defined key_agrif
-         ! Save time integrated fluxes
-         IF ( .NOT.Agrif_Root() ) THEN
-            CALL iom_set_rstw_var_active('ub2_i_b')
-            CALL iom_set_rstw_var_active('vb2_i_b')
-         ENDIF
-#endif
-      ENDIF
       !
    END SUBROUTINE dyn_spg_ts_init
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/IOM/in_out_manager.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/IOM/in_out_manager.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/IOM/in_out_manager.F90	(revision 14012)
@@ -89,9 +89,14 @@
    LOGICAL ::   lrst_abl              !: logical to control the abl restart write 
    INTEGER ::   numror = 0            !: logical unit for ocean restart (read). Init to 0 is needed for SAS (in daymod.F90)
-   INTEGER ::   numrir                !: logical unit for ice   restart (read)
-   INTEGER ::   numrar                !: logical unit for abl   restart (read)
-   INTEGER ::   numrow                !: logical unit for ocean restart (write)
-   INTEGER ::   numriw                !: logical unit for ice   restart (write)
-   INTEGER ::   numraw                !: logical unit for abl   restart (write)
+   INTEGER ::   numrir = 0            !: logical unit for ice   restart (read)
+   INTEGER ::   numrar = 0            !: logical unit for abl   restart (read)
+   INTEGER ::   numrow = 0            !: logical unit for ocean restart (write)
+   INTEGER ::   numriw = 0            !: logical unit for ice   restart (write)
+   INTEGER ::   numraw = 0            !: logical unit for abl   restart (write)
+   INTEGER ::   numrtr = 0            !: trc restart (read )
+   INTEGER ::   numrtw = 0            !: trc restart (write )
+   INTEGER ::   numrsr = 0            !: logical unit for sed restart (read)
+   INTEGER ::   numrsw = 0            !: logical unit for sed restart (write)
+
    INTEGER ::   nrst_lst              !: number of restart to output next
 
@@ -165,7 +170,16 @@
    LOGICAL       ::   lwp      = .FALSE.    !: boolean : true on the 1st processor only .OR. sn_cfctl%l_oceout=T
    LOGICAL       ::   lsp_area = .TRUE.     !: to make a control print over a specific area
-   CHARACTER(lc) ::   cxios_context         !: context name used in xios
-   CHARACTER(lc) ::   crxios_context         !: context name used in xios to read restart
-   CHARACTER(lc) ::   cwxios_context        !: context name used in xios to write restart file
+   CHARACTER(LEN=lc) ::   cxios_context     !: context name used in xios
+   CHARACTER(LEN=lc) ::   cr_ocerst_cxt     !: context name used in xios to read OCE restart
+   CHARACTER(LEN=lc) ::   cw_ocerst_cxt     !: context name used in xios to write OCE restart file
+   CHARACTER(LEN=lc) ::   cr_icerst_cxt     !: context name used in xios to read SI3 restart
+   CHARACTER(LEN=lc) ::   cw_icerst_cxt     !: context name used in xios to write SI3 restart file
+   CHARACTER(LEN=lc) ::   cr_toprst_cxt     !: context name used in xios to read TOP restart
+   CHARACTER(LEN=lc) ::   cw_toprst_cxt     !: context name used in xios to write TOP restart file
+   CHARACTER(LEN=lc) ::   cr_sedrst_cxt     !: context name used in xios to read SEDIMENT restart
+   CHARACTER(LEN=lc) ::   cw_sedrst_cxt     !: context name used in xios to write SEDIMENT restart file
+
+
+
 
    !! * Substitutions
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/IOM/iom.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/IOM/iom.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/IOM/iom.F90	(revision 14012)
@@ -46,4 +46,6 @@
    USE lib_fortran 
    USE diu_bulk, ONLY : ln_diurnal_only, ln_diurnal
+   USE iom_nf90
+   USE netcdf
 
    IMPLICIT NONE
@@ -58,4 +60,5 @@
    PUBLIC iom_chkatt, iom_getatt, iom_putatt, iom_getszuld, iom_rstput, iom_delay_rst, iom_put
    PUBLIC iom_use, iom_context_finalize, iom_update_file_name, iom_miss_val
+   PUBLIC iom_xios_setid
 
    PRIVATE iom_rp0d_sp, iom_rp1d_sp, iom_rp2d_sp, iom_rp3d_sp
@@ -69,7 +72,8 @@
    PRIVATE iom_set_domain_attr, iom_set_axis_attr, iom_set_field_attr, iom_set_file_attr, iom_get_file_attr, iom_set_grid_attr
    PRIVATE set_grid, set_grid_bounds, set_scalar, set_xmlatt, set_mooring, iom_sdate
-   PRIVATE iom_set_rst_context, iom_set_rstw_active, iom_set_rstr_active
+   PRIVATE iom_set_rst_context, iom_set_vars_active
 # endif
-   PUBLIC iom_set_rstw_var_active, iom_set_rstw_core, iom_set_rst_vars
+   PRIVATE set_xios_context
+   PRIVATE iom_set_rstw_active
 
    INTERFACE iom_get
@@ -101,5 +105,5 @@
 CONTAINS
 
-   SUBROUTINE iom_init( cdname, fname, ld_closedef ) 
+   SUBROUTINE iom_init( cdname, kdid, ld_closedef ) 
       !!----------------------------------------------------------------------
       !!                     ***  ROUTINE   ***
@@ -109,5 +113,5 @@
       !!----------------------------------------------------------------------
       CHARACTER(len=*),           INTENT(in)  :: cdname
-      CHARACTER(len=*), OPTIONAL, INTENT(in)  :: fname
+      INTEGER         , OPTIONAL, INTENT(in)  :: kdid          
       LOGICAL         , OPTIONAL, INTENT(in)  :: ld_closedef
 #if defined key_iomput
@@ -118,12 +122,15 @@
       INTEGER             :: irefyear, irefmonth, irefday
       INTEGER           :: ji
-      LOGICAL :: llrst_context              ! is context related to restart
+      LOGICAL           :: llrst_context              ! is context related to restart
+      LOGICAL           :: llrstr, llrstw 
+      INTEGER           :: inum
       !
       REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zt_bnds, zw_bnds
       REAL(wp), DIMENSION(2,jpkam1)         :: za_bnds   ! ABL vertical boundaries
-      LOGICAL ::   ll_closedef = .TRUE.
+      LOGICAL ::   ll_closedef
       LOGICAL ::   ll_exist
       !!----------------------------------------------------------------------
       !
+      ll_closedef = .TRUE.
       IF ( PRESENT(ld_closedef) ) ll_closedef = ld_closedef
       !
@@ -134,5 +141,14 @@
       CALL xios_context_initialize(TRIM(clname), mpi_comm_oce)
       CALL iom_swap( cdname )
-      llrst_context =  (TRIM(cdname) == TRIM(crxios_context) .OR. TRIM(cdname) == TRIM(cwxios_context))
+
+      llrstr = (cdname == cr_ocerst_cxt) .OR. (cdname == cr_icerst_cxt)
+      llrstr = llrstr .OR. (cdname == cr_toprst_cxt)
+      llrstr = llrstr .OR. (cdname == cr_sedrst_cxt)
+
+      llrstw = (cdname == cw_ocerst_cxt) .OR. (cdname == cw_icerst_cxt)
+      llrstw = llrstw .OR. (cdname == cw_toprst_cxt)
+      llrstw = llrstw .OR. (cdname == cw_sedrst_cxt)
+
+      llrst_context = llrstr .OR. llrstw
 
       ! Calendar type is now defined in xml file 
@@ -153,5 +169,5 @@
       IF(.NOT.llrst_context) CALL set_scalar
       !
-      IF( TRIM(cdname) == TRIM(cxios_context) ) THEN  
+      IF( cdname == cxios_context ) THEN  
          CALL set_grid( "T", glamt, gphit, .FALSE., .FALSE. ) 
          CALL set_grid( "U", glamu, gphiu, .FALSE., .FALSE. )
@@ -197,72 +213,70 @@
       ! vertical grid definition
       IF(.NOT.llrst_context) THEN
-          CALL iom_set_axis_attr(  "deptht", paxis = gdept_1d )
-          CALL iom_set_axis_attr(  "depthu", paxis = gdept_1d )
-          CALL iom_set_axis_attr(  "depthv", paxis = gdept_1d )
-          CALL iom_set_axis_attr(  "depthw", paxis = gdepw_1d )
+         CALL iom_set_axis_attr(  "deptht", paxis = gdept_1d )
+         CALL iom_set_axis_attr(  "depthu", paxis = gdept_1d )
+         CALL iom_set_axis_attr(  "depthv", paxis = gdept_1d )
+         CALL iom_set_axis_attr(  "depthw", paxis = gdepw_1d )
 
           ! ABL
-          IF( .NOT. ALLOCATED(ght_abl) ) THEN   ! force definition for xml files (xios) 
-             ALLOCATE( ght_abl(jpka), ghw_abl(jpka), e3t_abl(jpka), e3w_abl(jpka) )   ! default allocation needed by iom
-             ght_abl(:) = -1._wp   ;   ghw_abl(:) = -1._wp
-             e3t_abl(:) = -1._wp   ;   e3w_abl(:) = -1._wp
-          ENDIF
-          CALL iom_set_axis_attr( "ght_abl", ght_abl(2:jpka) )
-          CALL iom_set_axis_attr( "ghw_abl", ghw_abl(2:jpka) )
+         IF( .NOT. ALLOCATED(ght_abl) ) THEN   ! force definition for xml files (xios) 
+            ALLOCATE( ght_abl(jpka), ghw_abl(jpka), e3t_abl(jpka), e3w_abl(jpka) )   ! default allocation needed by iom
+            ght_abl(:) = -1._wp   ;   ghw_abl(:) = -1._wp
+            e3t_abl(:) = -1._wp   ;   e3w_abl(:) = -1._wp
+         ENDIF
+         CALL iom_set_axis_attr( "ght_abl", ght_abl(2:jpka) )
+         CALL iom_set_axis_attr( "ghw_abl", ghw_abl(2:jpka) )
           
-          ! Add vertical grid bounds
-          zt_bnds(2,:      ) = gdept_1d(:)
-          zt_bnds(1,2:jpk  ) = gdept_1d(1:jpkm1)
-          zt_bnds(1,1      ) = gdept_1d(1) - e3w_1d(1)
-          zw_bnds(1,:      ) = gdepw_1d(:)
-          zw_bnds(2,1:jpkm1) = gdepw_1d(2:jpk)
-          zw_bnds(2,jpk:   ) = gdepw_1d(jpk) + e3t_1d(jpk)
-          CALL iom_set_axis_attr(  "deptht", bounds=zw_bnds )
-          CALL iom_set_axis_attr(  "depthu", bounds=zw_bnds )
-          CALL iom_set_axis_attr(  "depthv", bounds=zw_bnds )
-          CALL iom_set_axis_attr(  "depthw", bounds=zt_bnds )
-
-          ! ABL
-          za_bnds(1,:) = ghw_abl(1:jpkam1)
-          za_bnds(2,:) = ghw_abl(2:jpka  )
-          CALL iom_set_axis_attr( "ght_abl", bounds=za_bnds )
-          za_bnds(1,:) = ght_abl(2:jpka  )
-          za_bnds(2,:) = ght_abl(2:jpka  ) + e3w_abl(2:jpka)
-          CALL iom_set_axis_attr( "ghw_abl", bounds=za_bnds )
-
-          CALL iom_set_axis_attr(  "nfloat", (/ (REAL(ji,wp), ji=1,jpnfl) /) )
+         ! Add vertical grid bounds
+         zt_bnds(2,:      ) = gdept_1d(:)
+         zt_bnds(1,2:jpk  ) = gdept_1d(1:jpkm1)
+         zt_bnds(1,1      ) = gdept_1d(1) - e3w_1d(1)
+         zw_bnds(1,:      ) = gdepw_1d(:)
+         zw_bnds(2,1:jpkm1) = gdepw_1d(2:jpk)
+         zw_bnds(2,jpk:   ) = gdepw_1d(jpk) + e3t_1d(jpk)
+         CALL iom_set_axis_attr(  "deptht", bounds=zw_bnds )
+         CALL iom_set_axis_attr(  "depthu", bounds=zw_bnds )
+         CALL iom_set_axis_attr(  "depthv", bounds=zw_bnds )
+         CALL iom_set_axis_attr(  "depthw", bounds=zt_bnds )
+
+         ! ABL
+         za_bnds(1,:) = ghw_abl(1:jpkam1)
+         za_bnds(2,:) = ghw_abl(2:jpka  )
+         CALL iom_set_axis_attr( "ght_abl", bounds=za_bnds )
+         za_bnds(1,:) = ght_abl(2:jpka  )
+         za_bnds(2,:) = ght_abl(2:jpka  ) + e3w_abl(2:jpka)
+         CALL iom_set_axis_attr( "ghw_abl", bounds=za_bnds )
+
+         CALL iom_set_axis_attr(  "nfloat", (/ (REAL(ji,wp), ji=1,jpnfl) /) )
 # if defined key_si3
-          CALL iom_set_axis_attr( "ncatice", (/ (REAL(ji,wp), ji=1,jpl) /) )
-          ! SIMIP diagnostics (4 main arctic straits)
-          CALL iom_set_axis_attr( "nstrait", (/ (REAL(ji,wp), ji=1,4) /) )
+         CALL iom_set_axis_attr( "ncatice", (/ (REAL(ji,wp), ji=1,jpl) /) )
+         ! SIMIP diagnostics (4 main arctic straits)
+         CALL iom_set_axis_attr( "nstrait", (/ (REAL(ji,wp), ji=1,4) /) )
 # endif
 #if defined key_top
-          IF( ALLOCATED(profsed) ) CALL iom_set_axis_attr( "profsed", paxis = profsed )
-#endif
-          CALL iom_set_axis_attr( "icbcla", class_num )
-          CALL iom_set_axis_attr( "iax_20C", (/ REAL(20,wp) /) )   ! strange syntaxe and idea...
-          CALL iom_set_axis_attr( "iax_26C", (/ REAL(26,wp) /) )   ! strange syntaxe and idea...
-          CALL iom_set_axis_attr( "iax_28C", (/ REAL(28,wp) /) )   ! strange syntaxe and idea...
-          ! for diaprt, we need to define an axis which size can be 1 (default) or 5 (if the file subbasins.nc exists)
-          INQUIRE( FILE = 'subbasins.nc', EXIST = ll_exist )
-          nbasin = 1 + 4 * COUNT( (/ll_exist/) )
-          CALL iom_set_axis_attr( "basin"  , (/ (REAL(ji,wp), ji=1,nbasin) /) )
+         IF( ALLOCATED(profsed) ) CALL iom_set_axis_attr( "profsed", paxis = profsed )
+#endif
+         CALL iom_set_axis_attr( "icbcla", class_num )
+         CALL iom_set_axis_attr( "iax_20C", (/ REAL(20,wp) /) )   ! strange syntaxe and idea...
+         CALL iom_set_axis_attr( "iax_26C", (/ REAL(26,wp) /) )   ! strange syntaxe and idea...
+         CALL iom_set_axis_attr( "iax_28C", (/ REAL(28,wp) /) )   ! strange syntaxe and idea...
+         ! for diaprt, we need to define an axis which size can be 1 (default) or 5 (if the file subbasins.nc exists)
+         INQUIRE( FILE = 'subbasins.nc', EXIST = ll_exist )
+         nbasin = 1 + 4 * COUNT( (/ll_exist/) )
+         CALL iom_set_axis_attr( "basin"  , (/ (REAL(ji,wp), ji=1,nbasin) /) )
       ENDIF
       !
       ! automatic definitions of some of the xml attributs
-      IF( TRIM(cdname) == TRIM(crxios_context) ) THEN
-!set names of the fields in restart file IF using XIOS to read data
-          CALL iom_set_rst_context(.TRUE.)
-          CALL iom_set_rst_vars(rst_rfields)
-!set which fields are to be read from restart file
-          CALL iom_set_rstr_active()
-      ELSE IF( TRIM(cdname) == TRIM(cwxios_context) ) THEN
-!set names of the fields in restart file IF using XIOS to write data
-          CALL iom_set_rst_context(.FALSE.)
-          CALL iom_set_rst_vars(rst_wfields)
-!set which fields are to be written to a restart file
-          CALL iom_set_rstw_active(fname)
+      IF(llrstr) THEN
+         IF(PRESENT(kdid)) THEN
+            CALL iom_set_rst_context(.TRUE.)
+!set which fields will be read from restart file
+            CALL iom_set_vars_active(kdid)
+         ELSE
+            CALL ctl_stop( 'iom_init:', 'restart read with XIOS: missing pointer to NETCDF file' )
+         ENDIF
+      ELSE IF(llrstw) THEN
+         CALL iom_set_rstw_file(iom_file(kdid)%name)
       ELSE
-          CALL set_xmlatt
+         CALL set_xmlatt
       ENDIF
       !
@@ -280,5 +294,5 @@
    END SUBROUTINE iom_init
 
-   SUBROUTINE iom_init_closedef
+   SUBROUTINE iom_init_closedef(cdname)
       !!----------------------------------------------------------------------
       !!            ***  SUBROUTINE iom_init_closedef  ***
@@ -288,8 +302,24 @@
       !!
       !!----------------------------------------------------------------------
-
+      CHARACTER(len=*), OPTIONAL, INTENT(IN) :: cdname
 #if defined key_iomput
-      CALL xios_close_context_definition()
-      CALL xios_update_calendar( 0 )
+      LOGICAL :: llrstw
+
+      llrstw = .FALSE.
+      IF(PRESENT(cdname)) THEN
+         llrstw = (cdname == cw_ocerst_cxt)
+         llrstw = llrstw .OR. (cdname == cw_icerst_cxt)
+         llrstw = llrstw .OR. (cdname == cw_toprst_cxt)
+         llrstw = llrstw .OR. (cdname == cw_sedrst_cxt)
+      ENDIF
+
+      IF( llrstw ) THEN
+!set names of the fields in restart file IF using XIOS to write data
+         CALL iom_set_rst_context(.FALSE.)
+         CALL xios_close_context_definition()
+      ELSE
+         CALL xios_close_context_definition()
+         CALL xios_update_calendar( 0 )
+      ENDIF
 #else
       IF( .FALSE. )   WRITE(numout,*) 'iom_init_closedef: should not see this'   ! useless statement to avoid compilation warnings
@@ -298,252 +328,143 @@
    END SUBROUTINE iom_init_closedef
 
-   SUBROUTINE iom_set_rstw_var_active(field)
+   SUBROUTINE iom_set_vars_active(idnum)
       !!---------------------------------------------------------------------
-      !!                   ***  SUBROUTINE  iom_set_rstw_var_active  ***
-      !!
-      !! ** Purpose :  enable variable in restart file when writing with XIOS 
+      !!                   ***  SUBROUTINE  iom_set_vars_active  ***
+      !!
+      !! ** Purpose :  define filename in XIOS context for reading file,
+      !!               enable variables present in a file for reading with XIOS 
+      !!               id of the file is assumed to be rrestart.
       !!---------------------------------------------------------------------
-   CHARACTER(len = *), INTENT(IN) :: field
-   INTEGER :: i
-   LOGICAL :: llis_set
-   CHARACTER(LEN=256) :: clinfo    ! info character
-
+      INTEGER, INTENT(IN) :: idnum 
+      
 #if defined key_iomput
-   llis_set = .FALSE.
-
-   DO i = 1, max_rst_fields
-       IF(TRIM(rst_wfields(i)%vname) == field) THEN 
-          rst_wfields(i)%active = .TRUE.
-          llis_set = .TRUE.
-          EXIT
-       ENDIF
-   ENDDO
-!Warn if variable is not in defined in rst_wfields
-   IF(.NOT.llis_set) THEN
-      WRITE(ctmp1,*) 'iom_set_rstw_var_active: variable ', field ,' is available for writing but not defined' 
-      CALL ctl_stop( 'iom_set_rstw_var_active:', ctmp1 )
-   ENDIF
-#else
-        clinfo = 'iom_set_rstw_var_active: key_iomput is needed to use XIOS restart read/write functionality'
-        CALL ctl_stop('STOP', TRIM(clinfo))
-#endif
-
-   END SUBROUTINE iom_set_rstw_var_active
-
-   SUBROUTINE iom_set_rstr_active()
+      INTEGER                                    :: ndims, nvars, natts, unlimitedDimId, dimlen, xtype,mdims
+      TYPE(xios_field)                           :: field_hdl
+      TYPE(xios_file)                            :: file_hdl
+      TYPE(xios_filegroup)                       :: filegroup_hdl
+      INTEGER                                    :: dimids(4), jv,i, idim
+      CHARACTER(LEN=256)                         :: clinfo               ! info character
+      INTEGER, ALLOCATABLE                       :: indimlens(:)
+      CHARACTER(LEN=nf90_max_name), ALLOCATABLE  :: indimnames(:)
+      CHARACTER(LEN=nf90_max_name)               :: dimname, varname
+      INTEGER                                    :: iln
+      CHARACTER(LEN=lc)                          :: fname
+      LOGICAL                                    :: lmeta
+!metadata in restart file for restart read with XIOS
+      INTEGER, PARAMETER                         :: NMETA = 10
+      CHARACTER(LEN=lc)                          :: meta(NMETA)
+
+
+      meta(1) = "nav_lat"
+      meta(2) = "nav_lon"
+      meta(3) = "nav_lev"
+      meta(4) = "time_instant"
+      meta(5) = "time_instant_bounds"
+      meta(6) = "time_counter"
+      meta(7) = "time_counter_bounds"
+      meta(8) = "x"
+      meta(9) = "y"
+      meta(10) = "numcat"
+
+      clinfo = '          iom_set_vars_active, file: '//TRIM(iom_file(idnum)%name)
+
+      iln = INDEX( iom_file(idnum)%name, '.nc' )
+!XIOS doee not need .nc
+      IF(iln > 0) THEN
+        fname =  iom_file(idnum)%name(1:iln-1)
+      ELSE
+        fname =  iom_file(idnum)%name
+      ENDIF
+
+!set name of the restart file and enable available fields
+      CALL xios_get_handle("file_definition", filegroup_hdl )
+      CALL xios_add_child(filegroup_hdl, file_hdl, 'rrestart')
+      CALL xios_set_file_attr( "rrestart", name=fname, type="one_file",      &
+           par_access="collective", enabled=.TRUE., mode="read",              &
+                                                    output_freq=xios_timestep )
+
+      CALL iom_nf90_check( nf90_inquire(iom_file(idnum)%nfid, ndims, nvars, natts ), clinfo )
+      ALLOCATE(indimlens(ndims), indimnames(ndims))
+      CALL iom_nf90_check( nf90_inquire(iom_file(idnum)%nfid, unlimitedDimId = unlimitedDimId ), clinfo )
+
+      DO idim = 1, ndims
+         CALL iom_nf90_check( nf90_inquire_dimension(iom_file(idnum)%nfid, idim, dimname, dimlen ), clinfo )
+         indimlens(idim) = dimlen
+         indimnames(idim) = dimname
+      ENDDO
+
+      DO jv =1, nvars
+         lmeta = .FALSE.
+         CALL iom_nf90_check( nf90_inquire_variable(iom_file(idnum)%nfid, jv, varname, xtype, ndims, dimids, natts ), clinfo )
+         DO i = 1, NMETA
+           IF(varname == meta(i)) THEN
+             lmeta = .TRUE.
+           ENDIF
+         ENDDO
+         IF(.NOT.lmeta) THEN
+            CALL xios_add_child(file_hdl, field_hdl, varname)
+            mdims = ndims
+
+            IF(ANY(dimids(1:ndims) == unlimitedDimId)) THEN
+               mdims = mdims - 1
+            ENDIF
+
+            IF(mdims == 3) THEN
+               CALL xios_set_attr (field_hdl, enabled = .TRUE., name = varname,   &
+                                   domain_ref="grid_N",                           &
+                                   axis_ref=iom_axis(indimlens(dimids(mdims))),   &
+                                   prec = 8, operation = "instant"                )
+            ELSEIF(mdims == 2) THEN
+               CALL xios_set_attr (field_hdl, enabled = .TRUE., name = varname,  &
+                                   domain_ref="grid_N", prec = 8,                &
+                                   operation = "instant"                         ) 
+            ELSEIF(mdims == 1) THEN
+               CALL xios_set_attr (field_hdl, enabled = .TRUE., name = varname, &
+                                   axis_ref=iom_axis(indimlens(dimids(mdims))), &
+                                   prec = 8, operation = "instant"              )
+            ELSEIF(mdims == 0) THEN
+               CALL xios_set_attr (field_hdl, enabled = .TRUE., name = varname, &
+                                   scalar_ref = "grid_scalar", prec = 8,        &
+                                   operation = "instant"                        )
+            ELSE
+               WRITE(ctmp1,*) 'iom_set_vars_active: variable ', TRIM(varname) ,' incorrect number of dimensions' 
+               CALL ctl_stop( 'iom_set_vars_active:', ctmp1 )
+            ENDIF
+         ENDIF
+      ENDDO
+      DEALLOCATE(indimlens, indimnames)
+#endif
+   END SUBROUTINE iom_set_vars_active
+
+   SUBROUTINE iom_set_rstw_file(cdrst_file)
       !!---------------------------------------------------------------------
-      !!                   ***  SUBROUTINE  iom_set_rstr_active  ***
-      !!
-      !! ** Purpose :  define file name in XIOS context for reading restart file,
-      !!               enable variables present in restart file for reading with XIOS 
+      !!                   ***  SUBROUTINE iom_set_rstw_file   ***
+      !!
+      !! ** Purpose :  define file name in XIOS context for writing restart
       !!---------------------------------------------------------------------
-
-!sets enabled = .TRUE. for each field in restart file
-   CHARACTER(len=256) :: rst_file
-
+      CHARACTER(len=*) :: cdrst_file
 #if defined key_iomput
-   TYPE(xios_field) :: field_hdl
-   TYPE(xios_file) :: file_hdl
-   TYPE(xios_filegroup) :: filegroup_hdl
-   INTEGER :: i
-   CHARACTER(lc)  ::   clpath
-
-        clpath = TRIM(cn_ocerst_indir)
-        IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath) // '/'
-        IF( TRIM(Agrif_CFixed()) == '0' ) THEN
-           rst_file = TRIM(clpath)//TRIM(cn_ocerst_in)
-        ELSE
-           rst_file = TRIM(clpath)//TRIM(Agrif_CFixed())//'_'//TRIM(cn_ocerst_in)
-        ENDIF
+      TYPE(xios_file) :: file_hdl
+      TYPE(xios_filegroup) :: filegroup_hdl
+
 !set name of the restart file and enable available fields
-        if(lwp) WRITE(numout,*) 'Setting restart filename (for XIOS) to: ',rst_file
-        CALL xios_get_handle("file_definition", filegroup_hdl )
-        CALL xios_add_child(filegroup_hdl, file_hdl, 'rrestart')
-        CALL xios_set_file_attr( "rrestart", name=trim(rst_file), type="one_file", &
-             par_access="collective", enabled=.TRUE., mode="read",                 &
-             output_freq=xios_timestep)
-!define variables for restart context
-        DO i = 1, max_rst_fields
-         IF( TRIM(rst_rfields(i)%vname) /= "NO_NAME") THEN
-           IF( iom_varid( numror, TRIM(rst_rfields(i)%vname), ldstop = .FALSE. ) > 0 ) THEN
-                CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_rfields(i)%vname))
-                SELECT CASE (TRIM(rst_rfields(i)%grid))
-                 CASE ("grid_N_3D")
-                    CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_rfields(i)%vname), &
-                        domain_ref="grid_N", axis_ref="nav_lev", operation = "instant")
-                 CASE ("grid_N")
-                    CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_rfields(i)%vname), &
-                        domain_ref="grid_N", operation = "instant") 
-                CASE ("grid_vector")
-                    CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_rfields(i)%vname), &
-                         axis_ref="nav_lev", operation = "instant")
-                 CASE ("grid_scalar")
-                    CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_rfields(i)%vname), &
-                        scalar_ref = "grid_scalar", operation = "instant")
-                END SELECT
-                IF(lwp) WRITE(numout,*) 'XIOS read: ', TRIM(rst_rfields(i)%vname), ' enabled in ', TRIM(rst_file)
-           ENDIF
-         ENDIF
-        END DO
-#endif
-   END SUBROUTINE iom_set_rstr_active
-
-   SUBROUTINE iom_set_rstw_core(cdmdl)
-      !!---------------------------------------------------------------------
-      !!                   ***  SUBROUTINE  iom_set_rstw_core  ***
-      !!
-      !! ** Purpose :  set variables which are always in restart file 
-      !!---------------------------------------------------------------------
-   CHARACTER (len=*), INTENT (IN) :: cdmdl ! model OPA or SAS
-   CHARACTER(LEN=256)             :: clinfo    ! info character
-#if defined key_iomput
-   IF(cdmdl == "OPA") THEN
-!from restart.F90
-   CALL iom_set_rstw_var_active("rn_Dt")
-   IF ( .NOT. ln_diurnal_only ) THEN
-        CALL iom_set_rstw_var_active('ub'  )
-        CALL iom_set_rstw_var_active('vb'  )
-        CALL iom_set_rstw_var_active('tb'  )
-        CALL iom_set_rstw_var_active('sb'  )
-        CALL iom_set_rstw_var_active('sshb')
-        !
-        CALL iom_set_rstw_var_active('un'  )
-        CALL iom_set_rstw_var_active('vn'  )
-        CALL iom_set_rstw_var_active('tn'  )
-        CALL iom_set_rstw_var_active('sn'  )
-        CALL iom_set_rstw_var_active('sshn')
-        CALL iom_set_rstw_var_active('rhop')
-      ENDIF
-      IF(ln_diurnal) CALL iom_set_rstw_var_active('Dsst')
-!from trasbc.F90
-         CALL iom_set_rstw_var_active('sbc_hc_b')
-         CALL iom_set_rstw_var_active('sbc_sc_b')
-   ENDIF
-#else
-        clinfo = 'iom_set_rstw_core: key_iomput is needed to use XIOS restart read/write functionality'
-        CALL ctl_stop('STOP', TRIM(clinfo))
-#endif
-   END SUBROUTINE iom_set_rstw_core
-
-   SUBROUTINE iom_set_rst_vars(fields)
-      !!---------------------------------------------------------------------
-      !!                   ***  SUBROUTINE iom_set_rst_vars   ***
-      !!
-      !! ** Purpose :  Fill array fields with the information about all 
-      !!               possible variables and corresponding grids definition 
-      !!               for reading/writing restart with XIOS
-      !!---------------------------------------------------------------------
-   TYPE(RST_FIELD), INTENT(INOUT) :: fields(max_rst_fields)
-   INTEGER :: i
-
-        i = 0
-        i = i + 1; fields(i)%vname="rn_Dt";            fields(i)%grid="grid_scalar"
-        i = i + 1; fields(i)%vname="un";             fields(i)%grid="grid_N_3D"
-        i = i + 1; fields(i)%vname="ub";             fields(i)%grid="grid_N_3D"
-        i = i + 1; fields(i)%vname="vn";             fields(i)%grid="grid_N_3D"
-        i = i + 1; fields(i)%vname="vb";             fields(i)%grid="grid_N_3D"  
-        i = i + 1; fields(i)%vname="tn";             fields(i)%grid="grid_N_3D"
-        i = i + 1; fields(i)%vname="tb";             fields(i)%grid="grid_N_3D"
-        i = i + 1; fields(i)%vname="sn";             fields(i)%grid="grid_N_3D"
-        i = i + 1; fields(i)%vname="sb";             fields(i)%grid="grid_N_3D"
-        i = i + 1; fields(i)%vname="sshn";           fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="sshb";           fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="rhop";           fields(i)%grid="grid_N_3D"
-        i = i + 1; fields(i)%vname="kt";             fields(i)%grid="grid_scalar"
-        i = i + 1; fields(i)%vname="ndastp";         fields(i)%grid="grid_scalar"
-        i = i + 1; fields(i)%vname="adatrj";         fields(i)%grid="grid_scalar"
-        i = i + 1; fields(i)%vname="utau_b";         fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="vtau_b";         fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="qns_b";          fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="emp_b";          fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="sfx_b";          fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="en" ;            fields(i)%grid="grid_N_3D" 
-        i = i + 1; fields(i)%vname="avt_k";            fields(i)%grid="grid_N_3D"
-        i = i + 1; fields(i)%vname="avm_k";            fields(i)%grid="grid_N_3D"
-        i = i + 1; fields(i)%vname="dissl";          fields(i)%grid="grid_N_3D"
-        i = i + 1; fields(i)%vname="sbc_hc_b";       fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="sbc_sc_b";       fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="qsr_hc_b";       fields(i)%grid="grid_N_3D"
-        i = i + 1; fields(i)%vname="fraqsr_1lev";    fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="greenland_icesheet_mass"
-                                               fields(i)%grid="grid_scalar"
-        i = i + 1; fields(i)%vname="greenland_icesheet_timelapsed"
-                                               fields(i)%grid="grid_scalar"
-        i = i + 1; fields(i)%vname="greenland_icesheet_mass_roc"
-                                               fields(i)%grid="grid_scalar"
-        i = i + 1; fields(i)%vname="antarctica_icesheet_mass"
-                                               fields(i)%grid="grid_scalar"
-        i = i + 1; fields(i)%vname="antarctica_icesheet_timelapsed"
-                                               fields(i)%grid="grid_scalar"
-        i = i + 1; fields(i)%vname="antarctica_icesheet_mass_roc"
-                                               fields(i)%grid="grid_scalar"
-        i = i + 1; fields(i)%vname="frc_v";          fields(i)%grid="grid_scalar"
-        i = i + 1; fields(i)%vname="frc_t";          fields(i)%grid="grid_scalar"
-        i = i + 1; fields(i)%vname="frc_s";          fields(i)%grid="grid_scalar"
-        i = i + 1; fields(i)%vname="frc_wn_t";       fields(i)%grid="grid_scalar"
-        i = i + 1; fields(i)%vname="frc_wn_s";       fields(i)%grid="grid_scalar"
-        i = i + 1; fields(i)%vname="ssh_ini";        fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="e3t_ini";        fields(i)%grid="grid_N_3D"
-        i = i + 1; fields(i)%vname="hc_loc_ini";     fields(i)%grid="grid_N_3D"
-        i = i + 1; fields(i)%vname="sc_loc_ini";     fields(i)%grid="grid_N_3D"
-        i = i + 1; fields(i)%vname="ssh_hc_loc_ini"; fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="ssh_sc_loc_ini"; fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="tilde_e3t_b";    fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="tilde_e3t_n";    fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="hdiv_lf";        fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="ub2_b";          fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="vb2_b";          fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="sshbb_e";        fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="ubb_e";          fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="vbb_e";          fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="sshb_e";         fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="ub_e";           fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="vb_e";           fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="fwf_isf_b";      fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="isf_sc_b";       fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="isf_hc_b";       fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="ssh_ibb";        fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="rnf_b";          fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="rnf_hc_b";       fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="rnf_sc_b";       fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="nn_fsbc";        fields(i)%grid="grid_scalar"
-        i = i + 1; fields(i)%vname="ssu_m";          fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="ssv_m";          fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="sst_m";          fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="sss_m";          fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="ssh_m";          fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="e3t_m";          fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="frq_m";          fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="avmb";           fields(i)%grid="grid_vector"
-        i = i + 1; fields(i)%vname="avtb";           fields(i)%grid="grid_vector"
-        i = i + 1; fields(i)%vname="ub2_i_b";        fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="vb2_i_b";        fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="ntime";          fields(i)%grid="grid_scalar"
-        i = i + 1; fields(i)%vname="Dsst";           fields(i)%grid="grid_scalar"
-        i = i + 1; fields(i)%vname="tmask";          fields(i)%grid="grid_N_3D"
-        i = i + 1; fields(i)%vname="umask";          fields(i)%grid="grid_N_3D"
-        i = i + 1; fields(i)%vname="vmask";          fields(i)%grid="grid_N_3D"
-        i = i + 1; fields(i)%vname="smask";          fields(i)%grid="grid_N_3D"
-        i = i + 1; fields(i)%vname="gdepw_n";        fields(i)%grid="grid_N_3D"
-        i = i + 1; fields(i)%vname="e3t_n";          fields(i)%grid="grid_N_3D"
-        i = i + 1; fields(i)%vname="e3u_n";          fields(i)%grid="grid_N_3D"
-        i = i + 1; fields(i)%vname="e3v_n";          fields(i)%grid="grid_N_3D"
-        i = i + 1; fields(i)%vname="surf_ini";       fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="e3t_b";          fields(i)%grid="grid_N_3D"
-        i = i + 1; fields(i)%vname="hmxl_n";         fields(i)%grid="grid_N_3D"
-        i = i + 1; fields(i)%vname="un_bf";          fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="vn_bf";          fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="hbl";            fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="hbli";           fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="wn";             fields(i)%grid="grid_N_3D"
-
-        IF( i-1 > max_rst_fields) THEN
-           WRITE(ctmp1,*) 'E R R O R : iom_set_rst_vars SIZE of RST_FIELD array is too small'
-           CALL ctl_stop( 'iom_set_rst_vars:', ctmp1 )
-        ENDIF
-   END SUBROUTINE iom_set_rst_vars
-
-
-   SUBROUTINE iom_set_rstw_active(cdrst_file)
+      IF(lwp) WRITE(numout,*) 'Setting restart filename (for XIOS write) to: ', TRIM(cdrst_file)
+      CALL xios_get_handle("file_definition", filegroup_hdl )
+      CALL xios_add_child(filegroup_hdl, file_hdl, 'wrestart')
+      IF(nxioso.eq.1) THEN 
+         CALL xios_set_file_attr( "wrestart", type="one_file", enabled=.TRUE.,& 
+                                       mode="write", output_freq=xios_timestep) 
+         IF(lwp) write(numout,*) 'OPEN ', trim(cdrst_file), ' in one_file mode' 
+      ELSE  
+         CALL xios_set_file_attr( "wrestart", type="multiple_file", enabled=.TRUE.,& 
+                                            mode="write", output_freq=xios_timestep) 
+         IF(lwp) write(numout,*) 'OPEN ', trim(cdrst_file), ' in multiple_file mode' 
+      ENDIF 
+      CALL xios_set_file_attr( "wrestart", name=trim(cdrst_file))
+#endif
+   END SUBROUTINE iom_set_rstw_file
+
+
+   SUBROUTINE iom_set_rstw_active(sdfield, rd0, rs0, rd1, rs1, rd2, rs2, rd3, rs3)
       !!---------------------------------------------------------------------
       !!                   ***  SUBROUTINE iom_set_rstw_active   ***
@@ -553,51 +474,110 @@
       !!---------------------------------------------------------------------
 !sets enabled = .TRUE. for each field in restart file
-   CHARACTER(len=*) :: cdrst_file
+      CHARACTER(len = *), INTENT(IN)                     :: sdfield
+      REAL(dp), OPTIONAL, INTENT(IN)                     :: rd0
+      REAL(sp), OPTIONAL, INTENT(IN)                     :: rs0
+      REAL(dp), OPTIONAL, INTENT(IN), DIMENSION(:)       :: rd1
+      REAL(sp), OPTIONAL, INTENT(IN), DIMENSION(:)       :: rs1
+      REAL(dp), OPTIONAL, INTENT(IN), DIMENSION(:, :)    :: rd2
+      REAL(sp), OPTIONAL, INTENT(IN), DIMENSION(:, :)    :: rs2
+      REAL(dp), OPTIONAL, INTENT(IN), DIMENSION(:, :, :) :: rd3  
+      REAL(sp), OPTIONAL, INTENT(IN), DIMENSION(:, :, :) :: rs3
 #if defined key_iomput
-   TYPE(xios_field) :: field_hdl
-   TYPE(xios_file) :: file_hdl
-   TYPE(xios_filegroup) :: filegroup_hdl
-   INTEGER :: i
-   CHARACTER(lc)  ::   clpath
-
-!set name of the restart file and enable available fields
-        IF(lwp) WRITE(numout,*) 'Setting restart filename (for XIOS write) to: ',cdrst_file
-        CALL xios_get_handle("file_definition", filegroup_hdl )
-        CALL xios_add_child(filegroup_hdl, file_hdl, 'wrestart')
-        IF(nxioso.eq.1) THEN 
-           CALL xios_set_file_attr( "wrestart", type="one_file", enabled=.TRUE.,& 
-                                    mode="write", output_freq=xios_timestep) 
-           if(lwp) write(numout,*) 'OPEN ', trim(cdrst_file), ' in one_file mode' 
-        ELSE  
-           CALL xios_set_file_attr( "wrestart", type="multiple_file", enabled=.TRUE.,& 
-                                    mode="write", output_freq=xios_timestep) 
-           if(lwp) write(numout,*) 'OPEN ', trim(cdrst_file), ' in multiple_file mode' 
-        ENDIF 
-        CALL xios_set_file_attr( "wrestart", name=trim(cdrst_file))
+      TYPE(xios_field) :: field_hdl
+      TYPE(xios_file) :: file_hdl
+
+      CALL xios_get_handle("wrestart", file_hdl)
 !define fields for restart context
-        DO i = 1, max_rst_fields
-         IF( rst_wfields(i)%active ) THEN
-                CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_wfields(i)%vname))
-                SELECT CASE (TRIM(rst_wfields(i)%grid))
-                 CASE ("grid_N_3D")
-                    CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_wfields(i)%vname), &
-                        domain_ref="grid_N", axis_ref="nav_lev", prec = 8, operation = "instant")
-                 CASE ("grid_N")
-                    CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_wfields(i)%vname), &
-                        domain_ref="grid_N", prec = 8, operation = "instant") 
-                 CASE ("grid_vector")
-                    CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_wfields(i)%vname), &
-                         axis_ref="nav_lev", prec = 8, operation = "instant")
-                 CASE ("grid_scalar")
-                    CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_wfields(i)%vname), &
-                        scalar_ref = "grid_scalar", prec = 8, operation = "instant")
-                END SELECT
-         ENDIF
-        END DO
+      CALL xios_add_child(file_hdl, field_hdl, sdfield)
+
+      IF(PRESENT(rd3)) THEN
+         CALL xios_set_attr (field_hdl, enabled = .TRUE., name = sdfield, &
+                             domain_ref = "grid_N",                       &
+                             axis_ref = iom_axis(size(rd3, 3)),           &
+                             prec = 8, operation = "instant"              )
+      ELSEIF(PRESENT(rs3)) THEN
+         CALL xios_set_attr (field_hdl, enabled = .TRUE., name = sdfield, &
+                             domain_ref = "grid_N",                       &
+                             axis_ref = iom_axis(size(rd3, 3)),           &
+                             prec = 4, operation = "instant"              )
+      ELSEIF(PRESENT(rd2)) THEN
+         CALL xios_set_attr (field_hdl, enabled = .TRUE., name = sdfield, &
+                             domain_ref = "grid_N", prec = 8,             &
+                             operation = "instant"                        ) 
+      ELSEIF(PRESENT(rs2)) THEN
+         CALL xios_set_attr (field_hdl, enabled = .TRUE., name = sdfield, &
+                             domain_ref = "grid_N", prec = 4,             &
+                             operation = "instant"                        )
+      ELSEIF(PRESENT(rd1)) THEN
+         CALL xios_set_attr (field_hdl, enabled = .TRUE., name = sdfield, &
+                             axis_ref = iom_axis(size(rd1, 1)),           &
+                             prec = 8, operation = "instant"              )
+      ELSEIF(PRESENT(rs1)) THEN
+         CALL xios_set_attr (field_hdl, enabled = .TRUE., name = sdfield, &
+                             axis_ref = iom_axis(size(rd1, 1)),           &
+                             prec = 4, operation = "instant"              )
+      ELSEIF(PRESENT(rd0)) THEN
+         CALL xios_set_attr (field_hdl, enabled = .TRUE., name = sdfield, &
+                             scalar_ref = "grid_scalar", prec = 8,        &
+                             operation = "instant"                        )
+      ELSEIF(PRESENT(rs0)) THEN
+         CALL xios_set_attr (field_hdl, enabled = .TRUE., name = sdfield, &
+                             scalar_ref = "grid_scalar", prec = 4,        &
+                             operation = "instant"                        )
+      ENDIF
 #endif
    END SUBROUTINE iom_set_rstw_active
 
+   FUNCTION iom_axis(idlev) result(axis_ref)
+      !!---------------------------------------------------------------------
+      !!                   ***  FUNCTION  iom_axis  ***
+      !!
+      !! ** Purpose : Used for grid definition when XIOS is used to read/write
+      !!              restart. Returns axis corresponding to the number of levels
+      !!              given as an input variable. Axes are defined in routine 
+      !!              iom_set_rst_context
+      !!---------------------------------------------------------------------
+      INTEGER, INTENT(IN) :: idlev
+      CHARACTER(len=lc)   :: axis_ref
+      CHARACTER(len=12)   :: str
+      IF(idlev == jpk) THEN
+         axis_ref="nav_lev"
+#if defined key_si3
+      ELSEIF(idlev == jpl) THEN
+         axis_ref="numcat"
+#endif         
+      ELSE
+         write(str, *) idlev
+         CALL ctl_stop( 'iom_axis', 'Definition for axis with '//TRIM(ADJUSTL(str))//' levels missing')
+      ENDIF
+   END FUNCTION iom_axis
+
+   FUNCTION iom_xios_setid(cdname) result(kid)
+     !!---------------------------------------------------------------------
+      !!                   ***  FUNCTION    ***
+      !!
+      !! ** Purpose : this function returns first available id to keep information about file 
+      !!              sets filename in iom_file structure and sets name
+      !!              of XIOS context depending on cdcomp
+      !!              corresponds to iom_nf90_open
+      !!---------------------------------------------------------------------
+      CHARACTER(len=*), INTENT(in   ) :: cdname      ! File name
+      INTEGER                         :: kid      ! identifier of the opened file
+      INTEGER                         :: jl
+
+      kid = 0
+      DO jl = jpmax_files, 1, -1
+         IF( iom_file(jl)%nfid == 0 )   kid = jl
+      ENDDO
+
+      iom_file(kid)%name   = TRIM(cdname)
+      iom_file(kid)%nfid   = 1
+      iom_file(kid)%nvars  = 0
+      iom_file(kid)%irec   = -1
+
+   END FUNCTION iom_xios_setid
+
    SUBROUTINE iom_set_rst_context(ld_rstr) 
-     !!---------------------------------------------------------------------
+      !!---------------------------------------------------------------------
       !!                   ***  SUBROUTINE  iom_set_rst_context  ***
       !!
@@ -606,30 +586,71 @@
       !!               
       !!---------------------------------------------------------------------
-   LOGICAL, INTENT(IN)               :: ld_rstr
-!ld_rstr is true for restart context. There is no need to define grid for 
-!restart read, because it's read from file
+      LOGICAL, INTENT(IN)               :: ld_rstr
+      INTEGER :: ji
 #if defined key_iomput
-   TYPE(xios_domaingroup)            :: domaingroup_hdl 
-   TYPE(xios_domain)                 :: domain_hdl 
-   TYPE(xios_axisgroup)              :: axisgroup_hdl 
-   TYPE(xios_axis)                   :: axis_hdl 
-   TYPE(xios_scalar)                 :: scalar_hdl 
-   TYPE(xios_scalargroup)            :: scalargroup_hdl 
-
-     CALL xios_get_handle("domain_definition",domaingroup_hdl) 
-     CALL xios_add_child(domaingroup_hdl, domain_hdl, "grid_N") 
-     CALL set_grid("N", glamt, gphit, .TRUE., ld_rstr) 
+      TYPE(xios_domaingroup)            :: domaingroup_hdl 
+      TYPE(xios_domain)                 :: domain_hdl 
+      TYPE(xios_axisgroup)              :: axisgroup_hdl 
+      TYPE(xios_axis)                   :: axis_hdl 
+      TYPE(xios_scalar)                 :: scalar_hdl 
+      TYPE(xios_scalargroup)            :: scalargroup_hdl 
+
+      CALL xios_get_handle("domain_definition",domaingroup_hdl) 
+      CALL xios_add_child(domaingroup_hdl, domain_hdl, "grid_N") 
+      CALL set_grid("N", glamt, gphit, .TRUE., ld_rstr) 
  
-     CALL xios_get_handle("axis_definition",axisgroup_hdl) 
-     CALL xios_add_child(axisgroup_hdl, axis_hdl, "nav_lev") 
+      CALL xios_get_handle("axis_definition",axisgroup_hdl) 
+      CALL xios_add_child(axisgroup_hdl, axis_hdl, "nav_lev") 
 !AGRIF fails to compile when unit= is in call to xios_set_axis_attr
-!    CALL xios_set_axis_attr( "nav_lev", long_name="Vertical levels",  unit="m", positive="down") 
-     CALL xios_set_axis_attr( "nav_lev", long_name="Vertical levels in meters", positive="down")
-     CALL iom_set_axis_attr( "nav_lev", paxis = gdept_1d ) 
-
-     CALL xios_get_handle("scalar_definition", scalargroup_hdl) 
-     CALL xios_add_child(scalargroup_hdl, scalar_hdl, "grid_scalar") 
+!     CALL xios_set_axis_attr( "nav_lev", long_name="Vertical levels",  unit="m", positive="down") 
+      CALL xios_set_axis_attr( "nav_lev", long_name = "Vertical levels in meters", positive = "down")
+      CALL iom_set_axis_attr( "nav_lev", paxis = gdept_1d ) 
+#if defined key_si3
+      CALL xios_add_child(axisgroup_hdl, axis_hdl, "numcat")
+      CALL iom_set_axis_attr( "numcat", (/ (REAL(ji,wp), ji=1,jpl) /) )
+#endif
+      CALL xios_get_handle("scalar_definition", scalargroup_hdl) 
+      CALL xios_add_child(scalargroup_hdl, scalar_hdl, "grid_scalar") 
 #endif
    END SUBROUTINE iom_set_rst_context
+
+
+   SUBROUTINE set_xios_context(kdid, cdcont) 
+      !!---------------------------------------------------------------------
+      !!                   ***  SUBROUTINE  iom_set_rst_context  ***
+      !!
+      !! ** Purpose : set correct XIOS context based on kdid
+      !!               
+      !!---------------------------------------------------------------------
+      INTEGER,           INTENT(IN)     :: kdid           ! Identifier of the file
+      CHARACTER(LEN=lc), INTENT(OUT)    :: cdcont         ! name of the context for XIOS read/write
+      
+      cdcont = "NONE"
+
+      IF(lrxios) THEN
+         IF(kdid == numror) THEN
+            cdcont = cr_ocerst_cxt
+         ELSEIF(kdid == numrir) THEN
+            cdcont = cr_icerst_cxt 
+         ELSEIF(kdid == numrtr) THEN
+            cdcont = cr_toprst_cxt
+         ELSEIF(kdid == numrsr) THEN
+            cdcont = cr_sedrst_cxt
+         ENDIF
+      ENDIF
+
+      IF(lwxios) THEN
+         IF(kdid == numrow) THEN
+            cdcont = cw_ocerst_cxt
+         ELSEIF(kdid == numriw) THEN
+            cdcont = cw_icerst_cxt
+         ELSEIF(kdid == numrtw) THEN
+            cdcont = cw_toprst_cxt
+         ELSEIF(kdid == numrsw) THEN
+            cdcont = cw_sedrst_cxt
+         ENDIF
+      ENDIF
+   END SUBROUTINE set_xios_context
+
 
    SUBROUTINE iom_swap( cdname )
@@ -642,5 +663,4 @@
 #if defined key_iomput
       TYPE(xios_context) :: nemo_hdl
-
       IF( TRIM(Agrif_CFixed()) == '0' ) THEN
         CALL xios_get_handle(TRIM(cdname),nemo_hdl)
@@ -892,5 +912,5 @@
    !!                   INTERFACE iom_get
    !!----------------------------------------------------------------------
-   SUBROUTINE iom_g0d_sp( kiomid, cdvar, pvar, ktime, ldxios )
+   SUBROUTINE iom_g0d_sp( kiomid, cdvar, pvar, ktime )
       INTEGER         , INTENT(in   )                 ::   kiomid    ! Identifier of the file
       CHARACTER(len=*), INTENT(in   )                 ::   cdvar     ! Name of the variable
@@ -898,5 +918,4 @@
       REAL(dp)                                        ::   ztmp_pvar ! tmp var to read field
       INTEGER         , INTENT(in   ),     OPTIONAL   ::   ktime     ! record number
-      LOGICAL         , INTENT(in   ),     OPTIONAL   ::   ldxios    ! use xios to read restart
       !
       INTEGER                                         ::   idvar     ! variable id
@@ -906,10 +925,9 @@
       CHARACTER(LEN=100)                              ::   clname    ! file name
       CHARACTER(LEN=1)                                ::   cldmspc   !
-      LOGICAL                                         ::   llxios
-      !
-      llxios = .FALSE.
-      IF( PRESENT(ldxios) ) llxios = ldxios
-
-      IF(.NOT.llxios) THEN  ! read data using default library
+      CHARACTER(LEN=lc)                               ::   context
+      !
+      CALL set_xios_context(kiomid, context)
+
+      IF(context == "NONE") THEN  ! read data using default library
          itime = 1
          IF( PRESENT(ktime) ) itime = ktime
@@ -934,7 +952,7 @@
 #if defined key_iomput
          IF(lwp) WRITE(numout,*) 'XIOS RST READ (0D): ', trim(cdvar)
-         CALL iom_swap( TRIM(crxios_context) )
+         CALL iom_swap(context)
          CALL xios_recv_field( trim(cdvar), pvar)
-         CALL iom_swap( TRIM(cxios_context) )
+         CALL iom_swap(cxios_context)
 #else
          WRITE(ctmp1,*) 'Can not use XIOS in iom_g0d, file: '//trim(clname)//', var:'//trim(cdvar)
@@ -944,10 +962,9 @@
    END SUBROUTINE iom_g0d_sp
 
-   SUBROUTINE iom_g0d_dp( kiomid, cdvar, pvar, ktime, ldxios )
+   SUBROUTINE iom_g0d_dp( kiomid, cdvar, pvar, ktime )
       INTEGER         , INTENT(in   )                 ::   kiomid    ! Identifier of the file
       CHARACTER(len=*), INTENT(in   )                 ::   cdvar     ! Name of the variable
       REAL(dp)        , INTENT(  out)                 ::   pvar      ! read field
       INTEGER         , INTENT(in   ),     OPTIONAL   ::   ktime     ! record number
-      LOGICAL         , INTENT(in   ),     OPTIONAL   ::   ldxios    ! use xios to read restart
       !
       INTEGER                                         ::   idvar     ! variable id
@@ -957,10 +974,9 @@
       CHARACTER(LEN=100)                              ::   clname    ! file name
       CHARACTER(LEN=1)                                ::   cldmspc   !
-      LOGICAL                                         ::   llxios
-      !
-      llxios = .FALSE.
-      IF( PRESENT(ldxios) ) llxios = ldxios
-
-      IF(.NOT.llxios) THEN  ! read data using default library
+      CHARACTER(LEN=lc)                               ::   context
+      !
+      CALL set_xios_context(kiomid, context)
+
+      IF(context == "NONE") THEN  ! read data using default library
          itime = 1
          IF( PRESENT(ktime) ) itime = ktime
@@ -984,7 +1000,7 @@
 #if defined key_iomput
          IF(lwp) WRITE(numout,*) 'XIOS RST READ (0D): ', trim(cdvar)
-         CALL iom_swap( TRIM(crxios_context) )
+         CALL iom_swap(context)
          CALL xios_recv_field( trim(cdvar), pvar)
-         CALL iom_swap( TRIM(cxios_context) )
+         CALL iom_swap(cxios_context)
 #else
          WRITE(ctmp1,*) 'Can not use XIOS in iom_g0d, file: '//trim(clname)//', var:'//trim(cdvar)
@@ -994,5 +1010,5 @@
    END SUBROUTINE iom_g0d_dp
 
-   SUBROUTINE iom_g1d_sp( kiomid, kdom, cdvar, pvar, ktime, kstart, kcount, ldxios )
+   SUBROUTINE iom_g1d_sp( kiomid, kdom, cdvar, pvar, ktime, kstart, kcount )
       INTEGER         , INTENT(in   )                         ::   kiomid    ! Identifier of the file
       INTEGER         , INTENT(in   )                         ::   kdom      ! Type of domain to be read
@@ -1003,5 +1019,4 @@
       INTEGER         , INTENT(in   ), DIMENSION(1), OPTIONAL ::   kstart    ! start axis position of the reading 
       INTEGER         , INTENT(in   ), DIMENSION(1), OPTIONAL ::   kcount    ! number of points in each axis
-      LOGICAL         , INTENT(in   ),               OPTIONAL ::   ldxios    ! read data using XIOS
       !
       IF( kiomid > 0 ) THEN
@@ -1009,6 +1024,5 @@
             ALLOCATE(ztmp_pvar(size(pvar,1)))
             CALL iom_get_123d( kiomid, kdom       , cdvar        , pv_r1d=ztmp_pvar,   &
-              &                                                     ktime=ktime, kstart=kstart, kcount=kcount, &
-              &                                                     ldxios=ldxios )
+              &                                                     ktime=ktime, kstart=kstart, kcount=kcount )
             pvar = ztmp_pvar
             DEALLOCATE(ztmp_pvar)
@@ -1018,5 +1032,5 @@
 
 
-   SUBROUTINE iom_g1d_dp( kiomid, kdom, cdvar, pvar, ktime, kstart, kcount, ldxios )
+   SUBROUTINE iom_g1d_dp( kiomid, kdom, cdvar, pvar, ktime, kstart, kcount )
       INTEGER         , INTENT(in   )                         ::   kiomid    ! Identifier of the file
       INTEGER         , INTENT(in   )                         ::   kdom      ! Type of domain to be read
@@ -1026,14 +1040,12 @@
       INTEGER         , INTENT(in   ), DIMENSION(1), OPTIONAL ::   kstart    ! start axis position of the reading 
       INTEGER         , INTENT(in   ), DIMENSION(1), OPTIONAL ::   kcount    ! number of points in each axis
-      LOGICAL         , INTENT(in   ),               OPTIONAL ::   ldxios    ! read data using XIOS
       !
       IF( kiomid > 0 ) THEN
          IF( iom_file(kiomid)%nfid > 0 ) CALL iom_get_123d( kiomid, kdom       , cdvar        , pv_r1d=pvar,   &
-              &                                                     ktime=ktime, kstart=kstart, kcount=kcount, &
-              &                                                     ldxios=ldxios )
+              &                                                     ktime=ktime, kstart=kstart, kcount=kcount)
       ENDIF
    END SUBROUTINE iom_g1d_dp
 
-   SUBROUTINE iom_g2d_sp( kiomid, kdom, cdvar, pvar, ktime, cd_type, psgn, kfill, kstart, kcount, ldxios)
+   SUBROUTINE iom_g2d_sp( kiomid, kdom, cdvar, pvar, ktime, cd_type, psgn, kfill, kstart, kcount)
       INTEGER         , INTENT(in   )                         ::   kiomid    ! Identifier of the file
       INTEGER         , INTENT(in   )                         ::   kdom      ! Type of domain to be read
@@ -1047,5 +1059,4 @@
       INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kstart    ! start axis position of the reading 
       INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kcount    ! number of points in each axis
-      LOGICAL         , INTENT(in   ),               OPTIONAL ::   ldxios    ! read data using XIOS
       !
       IF( kiomid > 0 ) THEN
@@ -1054,5 +1065,5 @@
             CALL iom_get_123d( kiomid, kdom, cdvar      , pv_r2d = ztmp_pvar  , ktime = ktime,   &
              &                                                      cd_type = cd_type, psgn   = psgn  , kfill = kfill,   &
-             &                                                      kstart  = kstart , kcount = kcount, ldxios=ldxios  )
+             &                                                      kstart  = kstart , kcount = kcount  )
             pvar = ztmp_pvar
             DEALLOCATE(ztmp_pvar)
@@ -1061,5 +1072,5 @@
    END SUBROUTINE iom_g2d_sp
 
-   SUBROUTINE iom_g2d_dp( kiomid, kdom, cdvar, pvar, ktime, cd_type, psgn, kfill, kstart, kcount, ldxios)
+   SUBROUTINE iom_g2d_dp( kiomid, kdom, cdvar, pvar, ktime, cd_type, psgn, kfill, kstart, kcount)
       INTEGER         , INTENT(in   )                         ::   kiomid    ! Identifier of the file
       INTEGER         , INTENT(in   )                         ::   kdom      ! Type of domain to be read
@@ -1072,14 +1083,13 @@
       INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kstart    ! start axis position of the reading 
       INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kcount    ! number of points in each axis
-      LOGICAL         , INTENT(in   ),               OPTIONAL ::   ldxios    ! read data using XIOS
       !
       IF( kiomid > 0 ) THEN
          IF( iom_file(kiomid)%nfid > 0 ) CALL iom_get_123d( kiomid, kdom, cdvar      , pv_r2d = pvar  , ktime = ktime,   &
             &                                                       cd_type = cd_type, psgn   = psgn  , kfill = kfill,   &
-            &                                                       kstart  = kstart , kcount = kcount, ldxios=ldxios  )
+            &                                                       kstart  = kstart , kcount = kcount                )
       ENDIF
    END SUBROUTINE iom_g2d_dp
 
-   SUBROUTINE iom_g3d_sp( kiomid, kdom, cdvar, pvar, ktime, cd_type, psgn, kfill, kstart, kcount, ldxios )
+   SUBROUTINE iom_g3d_sp( kiomid, kdom, cdvar, pvar, ktime, cd_type, psgn, kfill, kstart, kcount )
       INTEGER         , INTENT(in   )                         ::   kiomid    ! Identifier of the file
       INTEGER         , INTENT(in   )                         ::   kdom      ! Type of domain to be read
@@ -1093,5 +1103,4 @@
       INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kstart    ! start axis position of the reading 
       INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kcount    ! number of points in each axis
-      LOGICAL         , INTENT(in   ),               OPTIONAL ::   ldxios    ! read data using XIOS
       !
       IF( kiomid > 0 ) THEN
@@ -1100,5 +1109,5 @@
             CALL iom_get_123d( kiomid, kdom, cdvar      , pv_r3d = ztmp_pvar  , ktime = ktime,   &
             &                                                       cd_type = cd_type, psgn   = psgn  , kfill = kfill,   &
-            &                                                       kstart  = kstart , kcount = kcount, ldxios=ldxios  )
+            &                                                       kstart  = kstart , kcount = kcount                )
             pvar = ztmp_pvar
             DEALLOCATE(ztmp_pvar)
@@ -1107,5 +1116,5 @@
    END SUBROUTINE iom_g3d_sp
 
-   SUBROUTINE iom_g3d_dp( kiomid, kdom, cdvar, pvar, ktime, cd_type, psgn, kfill, kstart, kcount, ldxios )
+   SUBROUTINE iom_g3d_dp( kiomid, kdom, cdvar, pvar, ktime, cd_type, psgn, kfill, kstart, kcount )
       INTEGER         , INTENT(in   )                         ::   kiomid    ! Identifier of the file
       INTEGER         , INTENT(in   )                         ::   kdom      ! Type of domain to be read
@@ -1118,5 +1127,4 @@
       INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kstart    ! start axis position of the reading 
       INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kcount    ! number of points in each axis
-      LOGICAL         , INTENT(in   ),               OPTIONAL ::   ldxios    ! read data using XIOS
       !
       IF( kiomid > 0 ) THEN
@@ -1124,5 +1132,5 @@
             CALL iom_get_123d( kiomid, kdom, cdvar      , pv_r3d = pvar  , ktime = ktime,   &
             &                                                       cd_type = cd_type, psgn   = psgn  , kfill = kfill,   &
-            &                                                       kstart  = kstart , kcount = kcount, ldxios=ldxios  )
+            &                                                       kstart  = kstart , kcount = kcount                )
          END IF
       ENDIF
@@ -1132,5 +1140,5 @@
 
    SUBROUTINE iom_get_123d( kiomid , kdom, cdvar, pv_r1d, pv_r2d, pv_r3d, ktime ,   &
-         &                  cd_type, psgn, kfill, kstart, kcount, ldxios )
+         &                  cd_type, psgn, kfill, kstart, kcount )
       !!-----------------------------------------------------------------------
       !!                  ***  ROUTINE  iom_get_123d  ***
@@ -1152,8 +1160,6 @@
       INTEGER , DIMENSION(:)     , INTENT(in   ), OPTIONAL ::   kstart    ! start position of the reading in each axis 
       INTEGER , DIMENSION(:)     , INTENT(in   ), OPTIONAL ::   kcount    ! number of points to be read in each axis
-      LOGICAL                    , INTENT(in   ), OPTIONAL ::   ldxios    ! use XIOS to read restart
       !
       LOGICAL                        ::   llok        ! true if ok!
-      LOGICAL                        ::   llxios      ! local definition for XIOS read
       INTEGER                        ::   jl          ! loop on number of dimension 
       INTEGER                        ::   idom        ! type of domain
@@ -1182,15 +1188,14 @@
       REAL(dp)                       ::   gma, gmi
       !---------------------------------------------------------------------
-      !
+      CHARACTER(LEN=lc)                               ::   context
+      !
+      CALL set_xios_context(kiomid, context)
       inlev = -1
       IF( PRESENT(pv_r3d) )   inlev = SIZE(pv_r3d, 3)
       !
-      llxios = .FALSE.
-      IF( PRESENT(ldxios) )   llxios = ldxios
-      !
       idom = kdom
       istop = nstop
       !
-      IF(.NOT.llxios) THEN
+      IF(context == "NONE") THEN
          clname = iom_file(kiomid)%name   !   esier to read
          clinfo = '          iom_get_123d, file: '//trim(clname)//', var: '//trim(cdvar)
@@ -1359,18 +1364,28 @@
 #if defined key_iomput
 !would be good to be able to check which context is active and swap only if current is not restart
-         CALL iom_swap( TRIM(crxios_context) ) 
+         idvar = iom_varid( kiomid, cdvar )
+         CALL iom_swap(context)
+         zsgn = 1._wp
+         IF( PRESENT(psgn   ) )   zsgn    = psgn
+         cl_type = 'T'
+         IF( PRESENT(cd_type) )   cl_type = cd_type
+
          IF( PRESENT(pv_r3d) ) THEN
             IF(lwp) WRITE(numout,*) 'XIOS RST READ (3D): ',TRIM(cdvar)
-            CALL xios_recv_field( trim(cdvar), pv_r3d)
-            IF(idom /= jpdom_unknown )   CALL lbc_lnk( 'iom', pv_r3d,'Z', -999., kfillmode = jpfillnothing)
+            CALL xios_recv_field( trim(cdvar), pv_r3d(:, :, :))
+            IF(idom /= jpdom_unknown .AND. cl_type /= 'Z' ) THEN
+               CALL lbc_lnk( 'iom', pv_r3d, cl_type, zsgn, kfillmode = kfill)
+            ENDIF
          ELSEIF( PRESENT(pv_r2d) ) THEN
             IF(lwp) WRITE(numout,*) 'XIOS RST READ (2D): ', TRIM(cdvar)
-            CALL xios_recv_field( trim(cdvar), pv_r2d)
-            IF(idom /= jpdom_unknown )   CALL lbc_lnk('iom', pv_r2d,'Z',-999., kfillmode = jpfillnothing)
+            CALL xios_recv_field( trim(cdvar), pv_r2d(:, :))
+            IF(idom /= jpdom_unknown .AND. cl_type /= 'Z' ) THEN
+               CALL lbc_lnk('iom', pv_r2d, cl_type, zsgn, kfillmode = kfill)
+            ENDIF
          ELSEIF( PRESENT(pv_r1d) ) THEN
             IF(lwp) WRITE(numout,*) 'XIOS RST READ (1D): ', TRIM(cdvar)
             CALL xios_recv_field( trim(cdvar), pv_r1d)
          ENDIF
-         CALL iom_swap( TRIM(cxios_context) )
+         CALL iom_swap(cxios_context)
 #else
          istop = istop + 1 
@@ -1387,12 +1402,12 @@
       zofs = iom_file(kiomid)%ofs(idvar)      ! offset
       IF(     PRESENT(pv_r1d) ) THEN
-         IF( zscf /= 1. )   pv_r1d(:) = pv_r1d(:) * zscf 
-         IF( zofs /= 0. )   pv_r1d(:) = pv_r1d(:) + zofs
+         IF( zscf /= 1._wp )   pv_r1d(:) = pv_r1d(:) * zscf 
+         IF( zofs /= 0._wp )   pv_r1d(:) = pv_r1d(:) + zofs
       ELSEIF( PRESENT(pv_r2d) ) THEN
-         IF( zscf /= 1.)   pv_r2d(:,:) = pv_r2d(:,:) * zscf
-         IF( zofs /= 0.)   pv_r2d(:,:) = pv_r2d(:,:) + zofs
+         IF( zscf /= 1._wp)   pv_r2d(:,:) = pv_r2d(:,:) * zscf
+         IF( zofs /= 0._wp)   pv_r2d(:,:) = pv_r2d(:,:) + zofs
       ELSEIF( PRESENT(pv_r3d) ) THEN
-         IF( zscf /= 1.)   pv_r3d(:,:,:) = pv_r3d(:,:,:) * zscf
-         IF( zofs /= 0.)   pv_r3d(:,:,:) = pv_r3d(:,:,:) + zofs
+         IF( zscf /= 1._wp)   pv_r3d(:,:,:) = pv_r3d(:,:,:) * zscf
+         IF( zofs /= 0._wp)   pv_r3d(:,:,:) = pv_r3d(:,:,:) + zofs
       ENDIF
       !
@@ -1568,5 +1583,5 @@
    !!                   INTERFACE iom_rstput
    !!----------------------------------------------------------------------
-   SUBROUTINE iom_rp0d_sp( kt, kwrite, kiomid, cdvar, pvar, ktype, ldxios )
+   SUBROUTINE iom_rp0d_sp( kt, kwrite, kiomid, cdvar, pvar, ktype )
       INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step
       INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step
@@ -1575,16 +1590,26 @@
       REAL(sp)        , INTENT(in)                         ::   pvar     ! written field
       INTEGER         , INTENT(in), OPTIONAL               ::   ktype    ! variable external type
-      LOGICAL, OPTIONAL :: ldxios   ! xios write flag
-      LOGICAL :: llx                ! local xios write flag
-      INTEGER :: ivid   ! variable id
-
-      llx = .FALSE.
-      IF(PRESENT(ldxios)) llx = ldxios
+      !
+      LOGICAL           :: llx                ! local xios write flag
+      INTEGER           :: ivid   ! variable id
+      CHARACTER(LEN=lc) :: context
+      !
+      CALL set_xios_context(kiomid, context)
+
+      llx = .NOT. (context == "NONE")
+
       IF( llx ) THEN
 #ifdef key_iomput
-      IF( kt == kwrite ) THEN
-          IF(lwp) write(numout,*) 'RESTART: write (XIOS 0D) ',trim(cdvar)
-          CALL xios_send_field(trim(cdvar), pvar)
-      ENDIF
+         IF( kt == kwrite ) THEN
+            IF(lwp) write(numout,*) 'RESTART: write (XIOS 0D) ',trim(cdvar)
+            CALL iom_swap(context)
+            CALL iom_put(trim(cdvar), pvar)
+            CALL iom_swap(cxios_context)
+         ELSE
+            IF(lwp) write(numout,*) 'RESTART: define (XIOS 0D) ',trim(cdvar)
+            CALL iom_swap(context)
+            CALL iom_set_rstw_active( trim(cdvar), rs0 = pvar ) 
+            CALL iom_swap(cxios_context)
+         ENDIF
 #endif
       ELSE
@@ -1598,5 +1623,5 @@
    END SUBROUTINE iom_rp0d_sp
 
-   SUBROUTINE iom_rp0d_dp( kt, kwrite, kiomid, cdvar, pvar, ktype, ldxios )
+   SUBROUTINE iom_rp0d_dp( kt, kwrite, kiomid, cdvar, pvar, ktype )
       INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step
       INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step
@@ -1605,16 +1630,26 @@
       REAL(dp)        , INTENT(in)                         ::   pvar     ! written field
       INTEGER         , INTENT(in), OPTIONAL               ::   ktype    ! variable external type
-      LOGICAL, OPTIONAL :: ldxios   ! xios write flag
-      LOGICAL :: llx                ! local xios write flag
-      INTEGER :: ivid   ! variable id
-
-      llx = .FALSE.
-      IF(PRESENT(ldxios)) llx = ldxios
+      !
+      LOGICAL           :: llx                ! local xios write flag
+      INTEGER           :: ivid   ! variable id
+      CHARACTER(LEN=lc) :: context
+      !
+      CALL set_xios_context(kiomid, context)
+
+      llx = .NOT. (context == "NONE")
+
       IF( llx ) THEN
 #ifdef key_iomput
-      IF( kt == kwrite ) THEN
-          IF(lwp) write(numout,*) 'RESTART: write (XIOS 0D) ',trim(cdvar)
-          CALL xios_send_field(trim(cdvar), pvar)
-      ENDIF
+         IF( kt == kwrite ) THEN
+            IF(lwp) write(numout,*) 'RESTART: write (XIOS 0D) ',trim(cdvar)
+            CALL iom_swap(context)
+            CALL iom_put(trim(cdvar), pvar)
+            CALL iom_swap(cxios_context)
+         ELSE
+            IF(lwp) write(numout,*) 'RESTART: define (XIOS 0D) ',trim(cdvar)
+            CALL iom_swap(context)
+            CALL iom_set_rstw_active( trim(cdvar), rd0 = pvar ) 
+            CALL iom_swap(cxios_context)
+         ENDIF
 #endif
       ELSE
@@ -1629,5 +1664,5 @@
 
 
-   SUBROUTINE iom_rp1d_sp( kt, kwrite, kiomid, cdvar, pvar, ktype, ldxios )
+   SUBROUTINE iom_rp1d_sp( kt, kwrite, kiomid, cdvar, pvar, ktype )
       INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step
       INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step
@@ -1636,16 +1671,26 @@
       REAL(sp)        , INTENT(in), DIMENSION(          :) ::   pvar     ! written field
       INTEGER         , INTENT(in), OPTIONAL               ::   ktype    ! variable external type
-      LOGICAL, OPTIONAL                                    ::   ldxios   ! xios write flag
-      LOGICAL :: llx                ! local xios write flag
-      INTEGER :: ivid   ! variable id
-
-      llx = .FALSE.
-      IF(PRESENT(ldxios)) llx = ldxios
+      !
+      LOGICAL           :: llx                ! local xios write flag
+      INTEGER           :: ivid   ! variable id
+      CHARACTER(LEN=lc) :: context
+      !
+      CALL set_xios_context(kiomid, context)
+
+      llx = .NOT. (context == "NONE")
+
       IF( llx ) THEN
 #ifdef key_iomput
-      IF( kt == kwrite ) THEN
-         IF(lwp) write(numout,*) 'RESTART: write (XIOS 1D) ',trim(cdvar)
-         CALL xios_send_field(trim(cdvar), pvar)
-      ENDIF
+         IF( kt == kwrite ) THEN
+            IF(lwp) write(numout,*) 'RESTART: write (XIOS 1D) ',trim(cdvar)
+            CALL iom_swap(context)
+            CALL iom_put(trim(cdvar), pvar)
+            CALL iom_swap(cxios_context)
+         ELSE
+            IF(lwp) write(numout,*) 'RESTART: define (XIOS 1D)',trim(cdvar)
+            CALL iom_swap(context)
+            CALL iom_set_rstw_active( trim(cdvar), rs1 = pvar )
+            CALL iom_swap(cxios_context)
+         ENDIF
 #endif
       ELSE
@@ -1659,5 +1704,5 @@
    END SUBROUTINE iom_rp1d_sp
 
-   SUBROUTINE iom_rp1d_dp( kt, kwrite, kiomid, cdvar, pvar, ktype, ldxios )
+   SUBROUTINE iom_rp1d_dp( kt, kwrite, kiomid, cdvar, pvar, ktype )
       INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step
       INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step
@@ -1666,16 +1711,26 @@
       REAL(dp)        , INTENT(in), DIMENSION(          :) ::   pvar     ! written field
       INTEGER         , INTENT(in), OPTIONAL               ::   ktype    ! variable external type
-      LOGICAL, OPTIONAL                                    ::   ldxios   ! xios write flag
-      LOGICAL :: llx                ! local xios write flag
-      INTEGER :: ivid   ! variable id
-
-      llx = .FALSE.
-      IF(PRESENT(ldxios)) llx = ldxios
+      !
+      LOGICAL           :: llx                ! local xios write flag
+      INTEGER           :: ivid   ! variable id
+      CHARACTER(LEN=lc) :: context
+      !
+      CALL set_xios_context(kiomid, context)
+
+      llx = .NOT. (context == "NONE")
+
       IF( llx ) THEN
 #ifdef key_iomput
-      IF( kt == kwrite ) THEN
-         IF(lwp) write(numout,*) 'RESTART: write (XIOS 1D) ',trim(cdvar)
-         CALL xios_send_field(trim(cdvar), pvar)
-      ENDIF
+         IF( kt == kwrite ) THEN
+            IF(lwp) write(numout,*) 'RESTART: write (XIOS 1D) ',trim(cdvar)
+            CALL iom_swap(context)
+            CALL iom_put(trim(cdvar), pvar)
+            CALL iom_swap(cxios_context)
+         ELSE
+            IF(lwp) write(numout,*) 'RESTART: define (XIOS 1D)',trim(cdvar)
+            CALL iom_swap(context)
+            CALL iom_set_rstw_active( trim(cdvar), rd1 = pvar )
+            CALL iom_swap(cxios_context)
+         ENDIF
 #endif
       ELSE
@@ -1690,5 +1745,5 @@
 
 
-   SUBROUTINE iom_rp2d_sp( kt, kwrite, kiomid, cdvar, pvar, ktype, ldxios )
+   SUBROUTINE iom_rp2d_sp( kt, kwrite, kiomid, cdvar, pvar, ktype )
       INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step
       INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step
@@ -1697,16 +1752,26 @@
       REAL(sp)        , INTENT(in), DIMENSION(:,    :    ) ::   pvar     ! written field
       INTEGER         , INTENT(in), OPTIONAL               ::   ktype    ! variable external type
-      LOGICAL, OPTIONAL :: ldxios   ! xios write flag
-      LOGICAL :: llx
-      INTEGER :: ivid   ! variable id
-
-      llx = .FALSE.
-      IF(PRESENT(ldxios)) llx = ldxios
+      !
+      LOGICAL            :: llx
+      INTEGER            :: ivid   ! variable id
+      CHARACTER(LEN=lc)  :: context
+      !
+      CALL set_xios_context(kiomid, context)
+
+      llx = .NOT. (context == "NONE")
+
       IF( llx ) THEN
 #ifdef key_iomput
-      IF( kt == kwrite ) THEN
-         IF(lwp) write(numout,*) 'RESTART: write (XIOS 2D) ',trim(cdvar)
-         CALL xios_send_field(trim(cdvar), pvar)
-      ENDIF
+         IF( kt == kwrite ) THEN
+            IF(lwp) write(numout,*) 'RESTART: write (XIOS 2D) ',trim(cdvar)
+            CALL iom_swap(context)
+            CALL iom_put(trim(cdvar), pvar)
+            CALL iom_swap(cxios_context)
+         ELSE
+            IF(lwp) write(numout,*) 'RESTART: define (XIOS 2D)',trim(cdvar)
+            CALL iom_swap(context)
+            CALL iom_set_rstw_active( trim(cdvar), rs2 = pvar )
+            CALL iom_swap(cxios_context)
+         ENDIF
 #endif
       ELSE
@@ -1720,5 +1785,5 @@
    END SUBROUTINE iom_rp2d_sp
 
-   SUBROUTINE iom_rp2d_dp( kt, kwrite, kiomid, cdvar, pvar, ktype, ldxios )
+   SUBROUTINE iom_rp2d_dp( kt, kwrite, kiomid, cdvar, pvar, ktype )
       INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step
       INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step
@@ -1727,16 +1792,26 @@
       REAL(dp)        , INTENT(in), DIMENSION(:,    :    ) ::   pvar     ! written field
       INTEGER         , INTENT(in), OPTIONAL               ::   ktype    ! variable external type
-      LOGICAL, OPTIONAL :: ldxios   ! xios write flag
-      LOGICAL :: llx
-      INTEGER :: ivid   ! variable id
-
-      llx = .FALSE.
-      IF(PRESENT(ldxios)) llx = ldxios
+      !
+      LOGICAL           :: llx
+      INTEGER           :: ivid   ! variable id
+      CHARACTER(LEN=lc) :: context
+      !
+      CALL set_xios_context(kiomid, context)
+
+      llx = .NOT. (context == "NONE")
+
       IF( llx ) THEN
 #ifdef key_iomput
-      IF( kt == kwrite ) THEN
-         IF(lwp) write(numout,*) 'RESTART: write (XIOS 2D) ',trim(cdvar)
-         CALL xios_send_field(trim(cdvar), pvar)
-      ENDIF
+         IF( kt == kwrite ) THEN
+            IF(lwp) write(numout,*) 'RESTART: write (XIOS 2D) ',trim(cdvar)
+            CALL iom_swap(context)
+            CALL iom_put(trim(cdvar), pvar)
+            CALL iom_swap(cxios_context)
+         ELSE
+            IF(lwp) write(numout,*) 'RESTART: define (XIOS 2D)',trim(cdvar)
+            CALL iom_swap(context)
+            CALL iom_set_rstw_active( trim(cdvar), rd2 = pvar )
+            CALL iom_swap(cxios_context)
+         ENDIF
 #endif
       ELSE
@@ -1751,5 +1826,5 @@
 
 
-   SUBROUTINE iom_rp3d_sp( kt, kwrite, kiomid, cdvar, pvar, ktype, ldxios )
+   SUBROUTINE iom_rp3d_sp( kt, kwrite, kiomid, cdvar, pvar, ktype )
       INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step
       INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step
@@ -1758,16 +1833,26 @@
       REAL(sp)        , INTENT(in),       DIMENSION(:,:,:) ::   pvar     ! written field
       INTEGER         , INTENT(in), OPTIONAL               ::   ktype    ! variable external type
-      LOGICAL, OPTIONAL :: ldxios   ! xios write flag
-      LOGICAL :: llx                 ! local xios write flag
-      INTEGER :: ivid   ! variable id
-
-      llx = .FALSE.
-      IF(PRESENT(ldxios)) llx = ldxios
+      !
+      LOGICAL           :: llx                 ! local xios write flag
+      INTEGER           :: ivid   ! variable id
+      CHARACTER(LEN=lc) :: context
+      !
+      CALL set_xios_context(kiomid, context)
+
+      llx = .NOT. (context == "NONE")
+
       IF( llx ) THEN
 #ifdef key_iomput
-      IF( kt == kwrite ) THEN
-         IF(lwp) write(numout,*) 'RESTART: write (XIOS 3D) ',trim(cdvar)
-         CALL xios_send_field(trim(cdvar), pvar)
-      ENDIF
+         IF( kt == kwrite ) THEN
+            IF(lwp) write(numout,*) 'RESTART: write (XIOS 3D) ',trim(cdvar)
+            CALL iom_swap(context)
+            CALL iom_put(trim(cdvar), pvar)
+            CALL iom_swap(cxios_context)
+         ELSE
+            IF(lwp) write(numout,*) 'RESTART: define (XIOS 3D)',trim(cdvar)
+            CALL iom_swap(context)
+            CALL iom_set_rstw_active( trim(cdvar), rs3 = pvar )
+            CALL iom_swap(cxios_context)
+         ENDIF
 #endif
       ELSE
@@ -1781,5 +1866,5 @@
    END SUBROUTINE iom_rp3d_sp
 
-   SUBROUTINE iom_rp3d_dp( kt, kwrite, kiomid, cdvar, pvar, ktype, ldxios )
+   SUBROUTINE iom_rp3d_dp( kt, kwrite, kiomid, cdvar, pvar, ktype )
       INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step
       INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step
@@ -1788,16 +1873,26 @@
       REAL(dp)        , INTENT(in),       DIMENSION(:,:,:) ::   pvar     ! written field
       INTEGER         , INTENT(in), OPTIONAL               ::   ktype    ! variable external type
-      LOGICAL, OPTIONAL :: ldxios   ! xios write flag
-      LOGICAL :: llx                 ! local xios write flag
-      INTEGER :: ivid   ! variable id
-
-      llx = .FALSE.
-      IF(PRESENT(ldxios)) llx = ldxios
+      !
+      LOGICAL           :: llx                 ! local xios write flag
+      INTEGER           :: ivid   ! variable id
+      CHARACTER(LEN=lc) :: context
+      !
+      CALL set_xios_context(kiomid, context)
+
+      llx = .NOT. (context == "NONE")
+
       IF( llx ) THEN
 #ifdef key_iomput
-      IF( kt == kwrite ) THEN
-         IF(lwp) write(numout,*) 'RESTART: write (XIOS 3D) ',trim(cdvar)
-         CALL xios_send_field(trim(cdvar), pvar)
-      ENDIF
+         IF( kt == kwrite ) THEN
+            IF(lwp) write(numout,*) 'RESTART: write (XIOS 3D) ',trim(cdvar)
+            CALL iom_swap(context)
+            CALL iom_put(trim(cdvar), pvar)
+            CALL iom_swap(cxios_context)
+         ELSE
+            IF(lwp) write(numout,*) 'RESTART: define (XIOS 3D)',trim(cdvar)
+            CALL iom_swap(context)
+            CALL iom_set_rstw_active( trim(cdvar), rd3 = pvar )
+            CALL iom_swap(cxios_context)
+         ENDIF
 #endif
       ELSE
@@ -1865,5 +1960,5 @@
       CHARACTER(LEN=*), INTENT(in) ::   cdname
       REAL(sp)        , INTENT(in) ::   pfield0d
-!!      REAL(wp)        , DIMENSION(jpi,jpj) ::   zz     ! masson
+      !!      REAL(wp)        , DIMENSION(jpi,jpj) ::   zz     ! masson
 #if defined key_iomput
 !!clem      zz(:,:)=pfield0d
@@ -2145,5 +2240,5 @@
       CALL iom_swap( cdname )   ! swap to cdname context
       CALL xios_update_calendar(kt)
-      IF( cdname /= TRIM(cxios_context) )   CALL iom_swap( TRIM(cxios_context) )   ! return back to nemo context
+      IF( cdname /= TRIM(cxios_context) )   CALL iom_swap( cxios_context )   ! return back to nemo context
    END SUBROUTINE iom_setkt
 
@@ -2159,5 +2254,5 @@
          CALL iom_swap( cdname )   ! swap to cdname context
          CALL xios_context_finalize() ! finalize the context
-         IF( cdname /= TRIM(cxios_context) ) CALL iom_swap( TRIM(cxios_context) )   ! return back to nemo context
+         IF( cdname /= cxios_context ) CALL iom_swap( cxios_context )   ! return back to nemo context
       ENDIF
       !
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/IOM/iom_def.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/IOM/iom_def.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/IOM/iom_def.F90	(revision 14012)
@@ -9,4 +9,5 @@
    !!----------------------------------------------------------------------
    USE par_kind
+   USE netcdf
 
    IMPLICIT NONE
@@ -36,7 +37,8 @@
    INTEGER, PUBLIC            ::   nxioso = 0          !: type of restart file when writing using XIOS 1 - single, 2 - multiple
 !XIOS read restart   
-   LOGICAL, PUBLIC            ::   lrxios = .FALSE.     !: read single file restart using XIOS
+   LOGICAL, PUBLIC            ::   lrxios = .FALSE.     !: read single file restart using XIOS main switch
    LOGICAL, PUBLIC            ::   lxios_sini = .FALSE. ! is restart in a single file
-   LOGICAL, PUBLIC            ::   lxios_set  = .FALSE. 
+
+
 
    TYPE, PUBLIC ::   file_descriptor
@@ -59,13 +61,5 @@
    END TYPE file_descriptor
    TYPE(file_descriptor), DIMENSION(jpmax_files), PUBLIC ::   iom_file !: array containing the info for all opened files
-   INTEGER, PARAMETER, PUBLIC                   :: max_rst_fields = 95 !: maximum number of restart variables defined in iom_set_rst_vars
-   TYPE, PUBLIC :: RST_FIELD  
-    CHARACTER(len=30) :: vname = "NO_NAME" ! names of variables in restart file
-    CHARACTER(len=30) :: grid = "NO_GRID"
-    LOGICAL           :: active =.FALSE. ! for restart write only: true - write field, false do not write field
-   END TYPE RST_FIELD
 !$AGRIF_END_DO_NOT_TREAT
-   !
-   TYPE(RST_FIELD), PUBLIC, SAVE :: rst_wfields(max_rst_fields), rst_rfields(max_rst_fields)
    !
    !! * Substitutions
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/IOM/iom_nf90.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/IOM/iom_nf90.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/IOM/iom_nf90.F90	(revision 14012)
@@ -31,4 +31,5 @@
    PUBLIC iom_nf90_open  , iom_nf90_close, iom_nf90_varid, iom_nf90_get, iom_nf90_rstput
    PUBLIC iom_nf90_chkatt, iom_nf90_getatt, iom_nf90_putatt
+   PUBLIC iom_nf90_check
 
    INTERFACE iom_nf90_get
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/IOM/prtctl.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/IOM/prtctl.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/IOM/prtctl.F90	(revision 14012)
@@ -8,4 +8,5 @@
    !!----------------------------------------------------------------------
    USE dom_oce          ! ocean space and time domain variables
+   USE domutl, ONLY : is_tile
    USE in_out_manager   ! I/O manager
    USE mppini           ! distributed memory computing
@@ -26,4 +27,6 @@
    PUBLIC prt_ctl_init    ! called by nemogcm.F90 and prt_ctl_trc_init
 
+   !! * Substitutions
+#  include "do_loop_substitute.h90"
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
@@ -35,4 +38,33 @@
    SUBROUTINE prt_ctl (tab2d_1, tab3d_1, tab4d_1, tab2d_2, tab3d_2, mask1, mask2,   &
       &                 clinfo, clinfo1, clinfo2, clinfo3, kdim )
+      !!
+      REAL(wp),         DIMENSION(:,:)    , INTENT(in), OPTIONAL ::   tab2d_1
+      REAL(wp),         DIMENSION(:,:,:)  , INTENT(in), OPTIONAL ::   tab3d_1
+      REAL(wp),         DIMENSION(:,:,:,:), INTENT(in), OPTIONAL ::   tab4d_1
+      REAL(wp),         DIMENSION(:,:)    , INTENT(in), OPTIONAL ::   tab2d_2
+      REAL(wp),         DIMENSION(:,:,:)  , INTENT(in), OPTIONAL ::   tab3d_2
+      REAL(wp),         DIMENSION(:,:,:)  , INTENT(in), OPTIONAL ::   mask1
+      REAL(wp),         DIMENSION(:,:,:)  , INTENT(in), OPTIONAL ::   mask2
+      CHARACTER(len=*), DIMENSION(:)      , INTENT(in), OPTIONAL ::   clinfo    ! information about the tab3d array
+      CHARACTER(len=*)                    , INTENT(in), OPTIONAL ::   clinfo1
+      CHARACTER(len=*)                    , INTENT(in), OPTIONAL ::   clinfo2
+      CHARACTER(len=*)                    , INTENT(in), OPTIONAL ::   clinfo3
+      INTEGER                             , INTENT(in), OPTIONAL ::   kdim
+      !
+      INTEGER :: itab2d_1, itab3d_1, itab4d_1, itab2d_2, itab3d_2
+      !!
+      IF( PRESENT(tab2d_1)  ) THEN ; itab2d_1 = is_tile(tab2d_1)  ; ELSE ; itab2d_1 = 0 ; ENDIF
+      IF( PRESENT(tab3d_1)  ) THEN ; itab3d_1 = is_tile(tab3d_1)  ; ELSE ; itab3d_1 = 0 ; ENDIF
+      IF( PRESENT(tab4d_1)  ) THEN ; itab4d_1 = is_tile(tab4d_1)  ; ELSE ; itab4d_1 = 0 ; ENDIF
+      IF( PRESENT(tab2d_2)  ) THEN ; itab2d_2 = is_tile(tab2d_2)  ; ELSE ; itab2d_2 = 0 ; ENDIF
+      IF( PRESENT(tab3d_2)  ) THEN ; itab3d_2 = is_tile(tab3d_2)  ; ELSE ; itab3d_2 = 0 ; ENDIF
+
+      CALL prt_ctl_t (tab2d_1, itab2d_1, tab3d_1, itab3d_1, tab4d_1, itab4d_1, tab2d_2, itab2d_2, tab3d_2, itab3d_2,  &
+      &               mask1, mask2, clinfo, clinfo1, clinfo2, clinfo3, kdim )
+   END SUBROUTINE prt_ctl
+
+
+   SUBROUTINE prt_ctl_t (tab2d_1, ktab2d_1, tab3d_1, ktab3d_1, tab4d_1, ktab4d_1, tab2d_2, ktab2d_2, tab3d_2, ktab3d_2,  &
+      &                  mask1, mask2, clinfo, clinfo1, clinfo2, clinfo3, kdim )
       !!----------------------------------------------------------------------
       !!                     ***  ROUTINE prt_ctl  ***
@@ -70,9 +102,10 @@
       !!                    clinfo3 : additional information 
       !!----------------------------------------------------------------------
-      REAL(wp),         DIMENSION(:,:)    , INTENT(in), OPTIONAL ::   tab2d_1
-      REAL(wp),         DIMENSION(:,:,:)  , INTENT(in), OPTIONAL ::   tab3d_1
-      REAL(wp),         DIMENSION(:,:,:,:), INTENT(in), OPTIONAL ::   tab4d_1
-      REAL(wp),         DIMENSION(:,:)    , INTENT(in), OPTIONAL ::   tab2d_2
-      REAL(wp),         DIMENSION(:,:,:)  , INTENT(in), OPTIONAL ::   tab3d_2
+      INTEGER                             , INTENT(in)           ::   ktab2d_1, ktab3d_1, ktab4d_1, ktab2d_2, ktab3d_2
+      REAL(wp),         DIMENSION(A2D_T(ktab2d_1))    , INTENT(in), OPTIONAL ::   tab2d_1
+      REAL(wp),         DIMENSION(A2D_T(ktab3d_1),:)  , INTENT(in), OPTIONAL ::   tab3d_1
+      REAL(wp),         DIMENSION(A2D_T(ktab4d_1),:,:), INTENT(in), OPTIONAL ::   tab4d_1
+      REAL(wp),         DIMENSION(A2D_T(ktab2d_2))    , INTENT(in), OPTIONAL ::   tab2d_2
+      REAL(wp),         DIMENSION(A2D_T(ktab3d_2),:)  , INTENT(in), OPTIONAL ::   tab3d_2
       REAL(wp),         DIMENSION(:,:,:)  , INTENT(in), OPTIONAL ::   mask1
       REAL(wp),         DIMENSION(:,:,:)  , INTENT(in), OPTIONAL ::   mask2
@@ -106,8 +139,8 @@
 
          ! define shoter names...
-         iis = nall_ictls(jl)
-         iie = nall_ictle(jl)
-         jjs = nall_jctls(jl)
-         jje = nall_jctle(jl)
+         iis = MAX( nall_ictls(jl), ntsi )
+         iie = MIN( nall_ictle(jl), ntei )
+         jjs = MAX( nall_jctls(jl), ntsj )
+         jje = MIN( nall_jctle(jl), ntej )
 
          IF( PRESENT(clinfo) ) THEN   ;   inum = numprt_top(jl)
@@ -115,83 +148,86 @@
          ENDIF
 
-         DO jn = 1, itra
-
-            IF( PRESENT(clinfo3) ) THEN
-               IF    ( clinfo3 == 'tra-ta' )   THEN
-                  zvctl1 = t_ctl(jl)
-               ELSEIF( clinfo3 == 'tra'    )   THEN
-                  zvctl1 = t_ctl(jl)
-                  zvctl2 = s_ctl(jl)
-               ELSEIF( clinfo3 == 'dyn'    )   THEN
-                  zvctl1 = u_ctl(jl)
-                  zvctl2 = v_ctl(jl)
+         ! Compute the sum control only where the tile domain and control print area overlap
+         IF( iie >= iis .AND. jje >= jjs ) THEN
+            DO jn = 1, itra
+
+               IF( PRESENT(clinfo3) ) THEN
+                  IF    ( clinfo3 == 'tra-ta' )   THEN
+                     zvctl1 = t_ctl(jl)
+                  ELSEIF( clinfo3 == 'tra'    )   THEN
+                     zvctl1 = t_ctl(jl)
+                     zvctl2 = s_ctl(jl)
+                  ELSEIF( clinfo3 == 'dyn'    )   THEN
+                     zvctl1 = u_ctl(jl)
+                     zvctl2 = v_ctl(jl)
+                  ELSE
+                     zvctl1 = tra_ctl(jn,jl)
+                  ENDIF
+               ENDIF
+
+               ! 2D arrays
+               IF( PRESENT(tab2d_1) ) THEN
+                  IF( PRESENT(mask1) ) THEN   ;   zsum1 = SUM( tab2d_1(iis:iie,jjs:jje) * mask1(iis:iie,jjs:jje,1) )
+                  ELSE                        ;   zsum1 = SUM( tab2d_1(iis:iie,jjs:jje)                            )
+                  ENDIF
+               ENDIF
+               IF( PRESENT(tab2d_2) ) THEN
+                  IF( PRESENT(mask2) ) THEN   ;   zsum2 = SUM( tab2d_2(iis:iie,jjs:jje) * mask2(iis:iie,jjs:jje,1) )
+                  ELSE                        ;   zsum2 = SUM( tab2d_2(iis:iie,jjs:jje)                            )
+                  ENDIF
+               ENDIF
+
+               ! 3D arrays
+               IF( PRESENT(tab3d_1) ) THEN
+                  IF( PRESENT(mask1) ) THEN   ;   zsum1 = SUM( tab3d_1(iis:iie,jjs:jje,1:kdir) * mask1(iis:iie,jjs:jje,1:kdir) )
+                  ELSE                        ;   zsum1 = SUM( tab3d_1(iis:iie,jjs:jje,1:kdir)                                 )
+                  ENDIF
+               ENDIF
+               IF( PRESENT(tab3d_2) ) THEN
+                  IF( PRESENT(mask2) ) THEN   ;   zsum2 = SUM( tab3d_2(iis:iie,jjs:jje,1:kdir) * mask2(iis:iie,jjs:jje,1:kdir) )
+                  ELSE                        ;   zsum2 = SUM( tab3d_2(iis:iie,jjs:jje,1:kdir)                                 )
+                  ENDIF
+               ENDIF
+
+               ! 4D arrays
+               IF( PRESENT(tab4d_1) ) THEN
+                  IF( PRESENT(mask1) ) THEN   ;   zsum1 = SUM( tab4d_1(iis:iie,jjs:jje,1:kdir,jn) * mask1(iis:iie,jjs:jje,1:kdir) )
+                  ELSE                        ;   zsum1 = SUM( tab4d_1(iis:iie,jjs:jje,1:kdir,jn)                                 )
+                  ENDIF
+               ENDIF
+
+               ! Print the result
+               IF( PRESENT(clinfo ) )   cl1  = clinfo(jn)
+               IF( PRESENT(clinfo3) )   THEN
+                  !
+                  IF( PRESENT(tab2d_2) .OR. PRESENT(tab3d_2) ) THEN
+                     WRITE(inum, "(3x,a,' : ',D23.16,3x,a,' : ',D23.16)") cl1, zsum1 - zvctl1, cl2, zsum2 - zvctl2
+                  ELSE
+                     WRITE(inum, "(3x,a,' : ',D23.16                  )") cl1, zsum1 - zvctl1
+                  ENDIF
+                  !
+                  SELECT CASE( clinfo3 )
+                  CASE ( 'tra-ta' )
+                     t_ctl(jl) = zsum1
+                  CASE ( 'tra' )
+                     t_ctl(jl) = zsum1
+                     s_ctl(jl) = zsum2
+                  CASE ( 'dyn' )
+                     u_ctl(jl) = zsum1
+                     v_ctl(jl) = zsum2
+                  CASE default
+                     tra_ctl(jn,jl) = zsum1
+                  END SELECT
+               ELSEIF ( PRESENT(tab2d_2) .OR. PRESENT(tab3d_2) )   THEN
+                  WRITE(inum, "(3x,a,' : ',D23.16,3x,a,' : ',D23.16)") cl1, zsum1, cl2, zsum2
                ELSE
-                  zvctl1 = tra_ctl(jn,jl)
-               ENDIF
-            ENDIF
-
-            ! 2D arrays
-            IF( PRESENT(tab2d_1) ) THEN
-               IF( PRESENT(mask1) ) THEN   ;   zsum1 = SUM( tab2d_1(iis:iie,jjs:jje) * mask1(iis:iie,jjs:jje,1) )
-               ELSE                        ;   zsum1 = SUM( tab2d_1(iis:iie,jjs:jje)                            )
-               ENDIF
-            ENDIF
-            IF( PRESENT(tab2d_2) ) THEN
-               IF( PRESENT(mask2) ) THEN   ;   zsum2 = SUM( tab2d_2(iis:iie,jjs:jje) * mask2(iis:iie,jjs:jje,1) )
-               ELSE                        ;   zsum2 = SUM( tab2d_2(iis:iie,jjs:jje)                            )
-               ENDIF
-            ENDIF
-
-            ! 3D arrays
-            IF( PRESENT(tab3d_1) ) THEN
-               IF( PRESENT(mask1) ) THEN   ;   zsum1 = SUM( tab3d_1(iis:iie,jjs:jje,1:kdir) * mask1(iis:iie,jjs:jje,1:kdir) )
-               ELSE                        ;   zsum1 = SUM( tab3d_1(iis:iie,jjs:jje,1:kdir)                                 )
-               ENDIF
-            ENDIF
-            IF( PRESENT(tab3d_2) ) THEN
-               IF( PRESENT(mask2) ) THEN   ;   zsum2 = SUM( tab3d_2(iis:iie,jjs:jje,1:kdir) * mask2(iis:iie,jjs:jje,1:kdir) )
-               ELSE                        ;   zsum2 = SUM( tab3d_2(iis:iie,jjs:jje,1:kdir)                                 )
-               ENDIF
-            ENDIF
-
-            ! 4D arrays
-            IF( PRESENT(tab4d_1) ) THEN
-               IF( PRESENT(mask1) ) THEN   ;   zsum1 = SUM( tab4d_1(iis:iie,jjs:jje,1:kdir,jn) * mask1(iis:iie,jjs:jje,1:kdir) )
-               ELSE                        ;   zsum1 = SUM( tab4d_1(iis:iie,jjs:jje,1:kdir,jn)                                 )
-               ENDIF
-            ENDIF
-
-            ! Print the result
-            IF( PRESENT(clinfo ) )   cl1  = clinfo(jn)
-            IF( PRESENT(clinfo3) )   THEN
-               !
-               IF( PRESENT(tab2d_2) .OR. PRESENT(tab3d_2) ) THEN
-                  WRITE(inum, "(3x,a,' : ',D23.16,3x,a,' : ',D23.16)") cl1, zsum1 - zvctl1, cl2, zsum2 - zvctl2
-               ELSE
-                  WRITE(inum, "(3x,a,' : ',D23.16                  )") cl1, zsum1 - zvctl1
-               ENDIF
-               !
-               SELECT CASE( clinfo3 )
-               CASE ( 'tra-ta' ) 
-                  t_ctl(jl) = zsum1
-               CASE ( 'tra' ) 
-                  t_ctl(jl) = zsum1
-                  s_ctl(jl) = zsum2
-               CASE ( 'dyn' ) 
-                  u_ctl(jl) = zsum1
-                  v_ctl(jl) = zsum2
-               CASE default
-                  tra_ctl(jn,jl) = zsum1
-               END SELECT
-            ELSEIF ( PRESENT(tab2d_2) .OR. PRESENT(tab3d_2) )   THEN
-               WRITE(inum, "(3x,a,' : ',D23.16,3x,a,' : ',D23.16)") cl1, zsum1, cl2, zsum2
-            ELSE
-               WRITE(inum, "(3x,a,' : ',D23.16                  )") cl1, zsum1
-            ENDIF
-
-         END DO
+                  WRITE(inum, "(3x,a,' : ',D23.16                  )") cl1, zsum1
+               ENDIF
+
+            END DO
+         ENDIF
       END DO
       !
-   END SUBROUTINE prt_ctl
+   END SUBROUTINE prt_ctl_t
 
 
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/IOM/restart.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/IOM/restart.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/IOM/restart.F90	(revision 14012)
@@ -110,5 +110,5 @@
             ELSE
 #if defined key_iomput
-               cwxios_context = "rstw_"//TRIM(ADJUSTL(clkt))
+               cw_ocerst_cxt = "rstw_"//TRIM(ADJUSTL(clkt))
                IF( TRIM(Agrif_CFixed()) == '0' ) THEN
                   clpname = clname
@@ -116,6 +116,6 @@
                   clpname = TRIM(Agrif_CFixed())//"_"//clname   
                ENDIF
-               CALL iom_init( cwxios_context, TRIM(clpath)//TRIM(clpname), .false. )
-               CALL xios_update_calendar(nitrst)
+               numrow = iom_xios_setid(TRIM(clpath)//TRIM(clpname))
+               CALL iom_init( cw_ocerst_cxt, kdid = numrow, ld_closedef = .false. )
                CALL iom_swap(      cxios_context          )
 #else
@@ -143,30 +143,30 @@
       INTEGER, INTENT(in) ::   Kbb, Kmm   ! ocean time level indices
       !!----------------------------------------------------------------------
-                     IF(lwxios) CALL iom_swap(      cwxios_context          )
-                     CALL iom_rstput( kt, nitrst, numrow, 'rdt'    , rn_Dt       , ldxios = lwxios)   ! dynamics time step
-                     CALL iom_delay_rst( 'WRITE', 'OCE', numrow )   ! save only ocean delayed global communication variables
+                     CALL iom_rstput( kt, nitrst, numrow, 'rdt'    , rn_Dt       )   ! dynamics time step
+                     IF(.NOT.lwxios) CALL iom_delay_rst( 'WRITE', 'OCE', numrow )   ! save only ocean delayed global communication variables
 
       IF ( .NOT. ln_diurnal_only ) THEN
-                     CALL iom_rstput( kt, nitrst, numrow, 'ub'     , uu(:,:,:       ,Kbb), ldxios = lwxios        )     ! before fields
-                     CALL iom_rstput( kt, nitrst, numrow, 'vb'     , vv(:,:,:       ,Kbb), ldxios = lwxios        )
-                     CALL iom_rstput( kt, nitrst, numrow, 'tb'     , ts(:,:,:,jp_tem,Kbb), ldxios = lwxios )
-                     CALL iom_rstput( kt, nitrst, numrow, 'sb'     , ts(:,:,:,jp_sal,Kbb), ldxios = lwxios )
-                     CALL iom_rstput( kt, nitrst, numrow, 'sshb'   ,ssh(:,:         ,Kbb), ldxios = lwxios      )
+                     CALL iom_rstput( kt, nitrst, numrow, 'ub'     , uu(:,:,:       ,Kbb) )     ! before fields
+                     CALL iom_rstput( kt, nitrst, numrow, 'vb'     , vv(:,:,:       ,Kbb) )
+                     CALL iom_rstput( kt, nitrst, numrow, 'tb'     , ts(:,:,:,jp_tem,Kbb) )
+                     CALL iom_rstput( kt, nitrst, numrow, 'sb'     , ts(:,:,:,jp_sal,Kbb) )
+                     CALL iom_rstput( kt, nitrst, numrow, 'sshb'   , ssh(:,:         ,Kbb))
                      !
-                     CALL iom_rstput( kt, nitrst, numrow, 'un'     , uu(:,:,:       ,Kmm), ldxios = lwxios        )     ! now fields
-                     CALL iom_rstput( kt, nitrst, numrow, 'vn'     , vv(:,:,:       ,Kmm), ldxios = lwxios        )
-                     CALL iom_rstput( kt, nitrst, numrow, 'tn'     , ts(:,:,:,jp_tem,Kmm), ldxios = lwxios )
-                     CALL iom_rstput( kt, nitrst, numrow, 'sn'     , ts(:,:,:,jp_sal,Kmm), ldxios = lwxios )
-                     CALL iom_rstput( kt, nitrst, numrow, 'sshn'   ,ssh(:,:         ,Kmm), ldxios = lwxios      )
-                     CALL iom_rstput( kt, nitrst, numrow, 'rhop'   , rhop, ldxios = lwxios      )
+                     CALL iom_rstput( kt, nitrst, numrow, 'un'     , uu(:,:,:       ,Kmm) )     ! now fields
+                     CALL iom_rstput( kt, nitrst, numrow, 'vn'     , vv(:,:,:       ,Kmm) )
+                     CALL iom_rstput( kt, nitrst, numrow, 'tn'     , ts(:,:,:,jp_tem,Kmm) )
+                     CALL iom_rstput( kt, nitrst, numrow, 'sn'     , ts(:,:,:,jp_sal,Kmm) )
+                     CALL iom_rstput( kt, nitrst, numrow, 'sshn'   , ssh(:,:         ,Kmm))
+                     CALL iom_rstput( kt, nitrst, numrow, 'rhop'   , rhop      )
       ENDIF
       
-      IF (ln_diurnal) CALL iom_rstput( kt, nitrst, numrow, 'Dsst', x_dsst, ldxios = lwxios )  
-      IF(lwxios) CALL iom_swap(      cxios_context          )
+      IF (ln_diurnal) CALL iom_rstput( kt, nitrst, numrow, 'Dsst', x_dsst )  
       IF( kt == nitrst ) THEN
          IF(.NOT.lwxios) THEN
             CALL iom_close( numrow )     ! close the restart file (only at last time step)
          ELSE
-            CALL iom_context_finalize(      cwxios_context          )
+            CALL iom_context_finalize(      cw_ocerst_cxt          )
+            iom_file(numrow)%nfid       = 0
+            numrow = 0
          ENDIF
 !!gm         IF( .NOT. lk_trdmld )   lrst_oce = .FALSE.
@@ -191,6 +191,7 @@
       !!                the file has already been opened
       !!----------------------------------------------------------------------
-      LOGICAL        ::   llok
-      CHARACTER(lc)  ::   clpath   ! full path to ocean output restart file
+      LOGICAL             ::   llok
+      CHARACTER(len=lc)   ::   clpath   ! full path to ocean output restart file
+      CHARACTER(len=lc+2) ::   clpname  ! file name including agrif prefix
       !!----------------------------------------------------------------------
       !
@@ -209,18 +210,18 @@
 ! can handle checking if variable is in the restart file (there will be no need to open
 ! restart)
-         IF(.NOT.lxios_set) lrxios = lrxios.AND.lxios_sini
+         lrxios = lrxios.AND.lxios_sini
+
          IF( lrxios) THEN
-             crxios_context = 'nemo_rst'
-             IF( .NOT.lxios_set ) THEN
-                 IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS'
-                 CALL iom_init( crxios_context )
-                 lxios_set = .TRUE.
-             ENDIF
-         ENDIF
-         IF( TRIM(Agrif_CFixed()) /= '0' .AND. lrxios) THEN
-             CALL iom_init( crxios_context )
-             IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS for AGRIF'
-             lxios_set = .TRUE.
-         ENDIF 
+             cr_ocerst_cxt = 'oce_rst'
+             IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS'
+!            IF( TRIM(Agrif_CFixed()) == '0' ) THEN
+!               clpname = cn_ocerst_in
+!            ELSE
+!               clpname = TRIM(Agrif_CFixed())//"_"//cn_ocerst_in   
+!            ENDIF
+             CALL iom_init( cr_ocerst_cxt, kdid = numror, ld_closedef = .TRUE. )
+             CALL iom_swap(      cxios_context          )
+         ENDIF
+
       ENDIF
 
@@ -246,5 +247,5 @@
       ! Check dynamics and tracer time-step consistency and force Euler restart if changed
       IF( iom_varid( numror, 'rdt', ldstop = .FALSE. ) > 0 )   THEN
-         CALL iom_get( numror, 'rdt', zrdt, ldxios = lrxios )
+         CALL iom_get( numror, 'rdt', zrdt )
          IF( zrdt /= rn_Dt ) THEN
             IF(lwp) WRITE( numout,*)
@@ -256,24 +257,24 @@
       ENDIF
 
-      CALL iom_delay_rst( 'READ', 'OCE', numror )   ! read only ocean delayed global communication variables
+      IF(.NOT.lrxios ) CALL iom_delay_rst( 'READ', 'OCE', numror )   ! read only ocean delayed global communication variables
       
       ! Diurnal DSST 
-      IF( ln_diurnal ) CALL iom_get( numror, jpdom_auto, 'Dsst' , x_dsst, ldxios = lrxios ) 
+      IF( ln_diurnal ) CALL iom_get( numror, jpdom_auto, 'Dsst' , x_dsst ) 
       IF ( ln_diurnal_only ) THEN 
          IF(lwp) WRITE( numout, * ) &
          &   "rst_read:- ln_diurnal_only set, setting rhop=rho0" 
          rhop = rho0
-         CALL iom_get( numror, jpdom_auto, 'tn'     , w3d, ldxios = lrxios ) 
+         CALL iom_get( numror, jpdom_auto, 'tn'     , w3d ) 
          ts(:,:,1,jp_tem,Kmm) = w3d(:,:,1)
          RETURN 
       ENDIF  
-      
+
       IF( iom_varid( numror, 'ub', ldstop = .FALSE. ) > 0 ) THEN
          ! before fields
-         CALL iom_get( numror, jpdom_auto, 'ub'     , uu(:,:,:       ,Kbb), ldxios = lrxios, cd_type = 'U', psgn = -1._wp )
-         CALL iom_get( numror, jpdom_auto, 'vb'     , vv(:,:,:       ,Kbb), ldxios = lrxios, cd_type = 'V', psgn = -1._wp )
-         CALL iom_get( numror, jpdom_auto, 'tb'     , ts(:,:,:,jp_tem,Kbb), ldxios = lrxios )
-         CALL iom_get( numror, jpdom_auto, 'sb'     , ts(:,:,:,jp_sal,Kbb), ldxios = lrxios )
-         CALL iom_get( numror, jpdom_auto, 'sshb'   ,ssh(:,:         ,Kbb), ldxios = lrxios )
+         CALL iom_get( numror, jpdom_auto, 'ub'     , uu(:,:,:       ,Kbb), cd_type = 'U', psgn = -1._wp )
+         CALL iom_get( numror, jpdom_auto, 'vb'     , vv(:,:,:       ,Kbb), cd_type = 'V', psgn = -1._wp )
+         CALL iom_get( numror, jpdom_auto, 'tb'     , ts(:,:,:,jp_tem,Kbb) )
+         CALL iom_get( numror, jpdom_auto, 'sb'     , ts(:,:,:,jp_sal,Kbb) )
+         CALL iom_get( numror, jpdom_auto, 'sshb'   ,ssh(:,:         ,Kbb) )
       ELSE
          l_1st_euler =  .TRUE.      ! before field not found, forced euler 1st time-step
@@ -281,11 +282,11 @@
       !
       ! now fields
-      CALL iom_get( numror, jpdom_auto, 'un'     , uu(:,:,:       ,Kmm), ldxios = lrxios, cd_type = 'U', psgn = -1._wp )
-      CALL iom_get( numror, jpdom_auto, 'vn'     , vv(:,:,:       ,Kmm), ldxios = lrxios, cd_type = 'V', psgn = -1._wp )
-      CALL iom_get( numror, jpdom_auto, 'tn'     , ts(:,:,:,jp_tem,Kmm), ldxios = lrxios )
-      CALL iom_get( numror, jpdom_auto, 'sn'     , ts(:,:,:,jp_sal,Kmm), ldxios = lrxios )
-      CALL iom_get( numror, jpdom_auto, 'sshn'   ,ssh(:,:         ,Kmm), ldxios = lrxios )
+      CALL iom_get( numror, jpdom_auto, 'un'     , uu(:,:,:       ,Kmm), cd_type = 'U', psgn = -1._wp )
+      CALL iom_get( numror, jpdom_auto, 'vn'     , vv(:,:,:       ,Kmm), cd_type = 'V', psgn = -1._wp )
+      CALL iom_get( numror, jpdom_auto, 'tn'     , ts(:,:,:,jp_tem,Kmm) )
+      CALL iom_get( numror, jpdom_auto, 'sn'     , ts(:,:,:,jp_sal,Kmm) )
+      CALL iom_get( numror, jpdom_auto, 'sshn'   ,ssh(:,:         ,Kmm) )
       IF( iom_varid( numror, 'rhop', ldstop = .FALSE. ) > 0 ) THEN
-         CALL iom_get( numror, jpdom_auto, 'rhop'   , rhop, ldxios = lrxios )   ! now    potential density
+         CALL iom_get( numror, jpdom_auto, 'rhop'   , rhop )   ! now    potential density
       ELSE
          CALL eos( ts(:,:,:,:,Kmm), rhd, rhop, gdept(:,:,:,Kmm) )   
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/ISF/isfcav.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/ISF/isfcav.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/ISF/isfcav.F90	(revision 14012)
@@ -183,7 +183,10 @@
       ! cavity mask
       mskisf_cav(:,:)    = (1._wp - tmask(:,:,1)) * ssmask(:,:)
-      !
-      !================
-      ! 2: read restart
+      !================
+      ! 2: activate restart
+      !================
+      !
+      !================
+      ! 3: read restart
       !================
       !
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/ISF/isfcpl.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/ISF/isfcpl.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/ISF/isfcpl.F90	(revision 14012)
@@ -120,13 +120,4 @@
       e3t(:,:,:,Kbb)   = e3t(:,:,:,Kmm)
 #endif 
-      ! prepare writing restart
-      IF( lwxios ) THEN
-         CALL iom_set_rstw_var_active('ssmask')
-         CALL iom_set_rstw_var_active('tmask')
-         CALL iom_set_rstw_var_active('e3t_n')
-         CALL iom_set_rstw_var_active('e3u_n')
-         CALL iom_set_rstw_var_active('e3v_n')
-      END IF
-      !
    END SUBROUTINE isfcpl_init
    ! 
@@ -153,12 +144,10 @@
       END DO 
       !
-      IF( lwxios ) CALL iom_swap( cwxios_context )
-      CALL iom_rstput( kt, nitrst, numrow, 'tmask'  , tmask , ldxios = lwxios )
-      CALL iom_rstput( kt, nitrst, numrow, 'ssmask' , ssmask, ldxios = lwxios )
-      CALL iom_rstput( kt, nitrst, numrow, 'e3t_n'  , ze3t , ldxios = lwxios )
-      CALL iom_rstput( kt, nitrst, numrow, 'e3u_n'  , ze3u , ldxios = lwxios )
-      CALL iom_rstput( kt, nitrst, numrow, 'e3v_n'  , ze3v , ldxios = lwxios )
-      CALL iom_rstput( kt, nitrst, numrow, 'gdepw_n', zgdepw , ldxios = lwxios )
-      IF( lwxios ) CALL iom_swap( cxios_context )
+      CALL iom_rstput( kt, nitrst, numrow, 'tmask'  , tmask  )
+      CALL iom_rstput( kt, nitrst, numrow, 'ssmask' , ssmask )
+      CALL iom_rstput( kt, nitrst, numrow, 'e3t_n'  , ze3t   )
+      CALL iom_rstput( kt, nitrst, numrow, 'e3u_n'  , ze3u   )
+      CALL iom_rstput( kt, nitrst, numrow, 'e3v_n'  , ze3v   )
+      CALL iom_rstput( kt, nitrst, numrow, 'gdepw_n', zgdepw )
       !
    END SUBROUTINE isfcpl_rst_write
@@ -183,5 +172,5 @@
       !!----------------------------------------------------------------------
       !
-      CALL iom_get( numror, jpdom_auto, 'ssmask'  , zssmask_b, ldxios = lrxios   ) ! need to extrapolate T/S
+      CALL iom_get( numror, jpdom_auto, 'ssmask'  , zssmask_b   ) ! need to extrapolate T/S
 
       ! compute new ssh if we open a full water column 
@@ -264,7 +253,7 @@
       !!----------------------------------------------------------------------
       ! 
-      CALL iom_get( numror, jpdom_auto, 'tmask'  , ztmask_b, ldxios = lrxios   ) ! need to extrapolate T/S
-      !CALL iom_get( numror, jpdom_auto, 'wmask'  , zwmask_b, ldxios = lrxios   ) ! need to extrapolate T/S
-      !CALL iom_get( numror, jpdom_auto, 'gdepw_n', zdepw_b(:,:,:), ldxios = lrxios ) ! need to interpol vertical profile (vvl)
+      CALL iom_get( numror, jpdom_auto, 'tmask'  , ztmask_b   ) ! need to extrapolate T/S
+      !CALL iom_get( numror, jpdom_auto, 'wmask'  , zwmask_b  ) ! need to extrapolate T/S
+      !CALL iom_get( numror, jpdom_auto, 'gdepw_n', zdepw_b(:,:,:) ) ! need to interpol vertical profile (vvl)
       !
       ! 
@@ -410,7 +399,7 @@
       !!----------------------------------------------------------------------
       !
-      CALL iom_get( numror, jpdom_auto, 'tmask'  , ztmask_b, ldxios = lrxios )
-      CALL iom_get( numror, jpdom_auto, 'e3u_n'  , ze3u_b  , ldxios = lrxios )
-      CALL iom_get( numror, jpdom_auto, 'e3v_n'  , ze3v_b  , ldxios = lrxios )
+      CALL iom_get( numror, jpdom_auto, 'tmask'  , ztmask_b )
+      CALL iom_get( numror, jpdom_auto, 'e3u_n'  , ze3u_b   )
+      CALL iom_get( numror, jpdom_auto, 'e3v_n'  , ze3v_b   )
       !
       ! 1.0: compute horizontal volume flux divergence difference before-after coupling
@@ -520,8 +509,8 @@
 
       ! get restart variable
-      CALL iom_get( numror, jpdom_auto, 'tmask'  , ztmask_b(:,:,:), ldxios = lrxios   ) ! need to extrapolate T/S
-      CALL iom_get( numror, jpdom_auto, 'e3t_n'  , ze3t_b(:,:,:)  , ldxios = lrxios )
-      CALL iom_get( numror, jpdom_auto, 'tn'     , zt_b(:,:,:)    , ldxios = lrxios )
-      CALL iom_get( numror, jpdom_auto, 'sn'     , zs_b(:,:,:)    , ldxios = lrxios )
+      CALL iom_get( numror, jpdom_auto, 'tmask'  , ztmask_b(:,:,:) ) ! need to extrapolate T/S
+      CALL iom_get( numror, jpdom_auto, 'e3t_n'  , ze3t_b(:,:,:)   )
+      CALL iom_get( numror, jpdom_auto, 'tn'     , zt_b(:,:,:)     )
+      CALL iom_get( numror, jpdom_auto, 'sn'     , zs_b(:,:,:)     )
 
       ! compute run length
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/ISF/isfrst.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/ISF/isfrst.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/ISF/isfrst.F90	(revision 14012)
@@ -53,7 +53,7 @@
       IF( iom_varid( numror, cfwf_b, ldstop = .FALSE. ) > 0 ) THEN
          IF(lwp) WRITE(numout,*) '          nit000-1 isf tracer content forcing fields read in the restart file'
-         CALL iom_get( numror, jpdom_auto, cfwf_b, pfwf_b(:,:)        , ldxios = lrxios )   ! before ice shelf melt
-         CALL iom_get( numror, jpdom_auto, chc_b , ptsc_b (:,:,jp_tem), ldxios = lrxios )   ! before ice shelf heat flux
-         CALL iom_get( numror, jpdom_auto, csc_b , ptsc_b (:,:,jp_sal), ldxios = lrxios )   ! before ice shelf heat flux
+         CALL iom_get( numror, jpdom_auto, cfwf_b, pfwf_b(:,:)         )   ! before ice shelf melt
+         CALL iom_get( numror, jpdom_auto, chc_b , ptsc_b (:,:,jp_tem) )   ! before ice shelf heat flux
+         CALL iom_get( numror, jpdom_auto, csc_b , ptsc_b (:,:,jp_sal) )   ! before ice shelf heat flux
       ELSE
          pfwf_b(:,:)   = pfwf(:,:)
@@ -61,10 +61,4 @@
       ENDIF
       !
-      IF( lwxios ) THEN
-         CALL iom_set_rstw_var_active(TRIM(chc_b ))
-         CALL iom_set_rstw_var_active(TRIM(csc_b ))
-         CALL iom_set_rstw_var_active(TRIM(cfwf_b))
-      ENDIF
-
    END SUBROUTINE isfrst_read
    ! 
@@ -95,9 +89,7 @@
       !
       ! write restart variable
-      IF( lwxios ) CALL iom_swap( cwxios_context )
-      CALL iom_rstput( kt, nitrst, numrow, cfwf_b, pfwf(:,:)       , ldxios = lwxios )
-      CALL iom_rstput( kt, nitrst, numrow, chc_b , ptsc(:,:,jp_tem), ldxios = lwxios )
-      CALL iom_rstput( kt, nitrst, numrow, csc_b , ptsc(:,:,jp_sal), ldxios = lwxios )
-      IF( lwxios ) CALL iom_swap( cxios_context )
+      CALL iom_rstput( kt, nitrst, numrow, cfwf_b, pfwf(:,:)        )
+      CALL iom_rstput( kt, nitrst, numrow, chc_b , ptsc(:,:,jp_tem) )
+      CALL iom_rstput( kt, nitrst, numrow, csc_b , ptsc(:,:,jp_sal) )
       !
    END SUBROUTINE isfrst_write
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/LBC/lbc_lnk_multi_generic.h90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/LBC/lbc_lnk_multi_generic.h90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/LBC/lbc_lnk_multi_generic.h90	(revision 14012)
@@ -40,5 +40,5 @@
       &                    , pt9 , cdna9 , psgn9 , pt10, cdna10, psgn10, pt11, cdna11, psgn11, pt12, cdna12, psgn12  &
       &                    , pt13, cdna13, psgn13, pt14, cdna14, psgn14, pt15, cdna15, psgn15, pt16, cdna16, psgn16  &
-      &                    , kfillmode, pfillval, lsend, lrecv )
+      &                    , kfillmode, pfillval, lsend, lrecv, ncsten )
       !!---------------------------------------------------------------------
       CHARACTER(len=*)     ,                   INTENT(in   ) ::   cdname  ! name of the calling subroutine
@@ -55,4 +55,5 @@
       REAL(wp)             , OPTIONAL        , INTENT(in   ) ::   pfillval    ! background value (used at closed boundaries)
       LOGICAL, DIMENSION(4), OPTIONAL        , INTENT(in   ) ::   lsend, lrecv   ! indicate how communications are to be carried out
+      LOGICAL              , OPTIONAL        , INTENT(in   ) ::   ncsten
       !!
       INTEGER                          ::   kfld        ! number of elements that will be attributed
@@ -84,5 +85,5 @@
       IF( PRESENT(psgn16) )   CALL ROUTINE_LOAD( pt16, cdna16, psgn16, ptab_ptr, cdna_ptr, psgn_ptr, kfld )
       !
-      CALL lbc_lnk_ptr( cdname, ptab_ptr, cdna_ptr, psgn_ptr, kfld, kfillmode, pfillval, lsend, lrecv )
+      CALL lbc_lnk_ptr( cdname, ptab_ptr, cdna_ptr, psgn_ptr, kfld, kfillmode, pfillval, lsend, lrecv, ncsten )
       !
    END SUBROUTINE ROUTINE_MULTI
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/LBC/lbc_lnk_nc_generic.h90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/LBC/lbc_lnk_nc_generic.h90	(revision 14012)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/LBC/lbc_lnk_nc_generic.h90	(revision 14012)
@@ -0,0 +1,113 @@
+#if defined SINGLE_PRECISION
+#   if defined DIM_2d
+#      define ARRAY_TYPE(i,j,k,l)   REAL(sp), DIMENSION(i,j)
+#      define PTR_TYPE              TYPE(PTR_2D_sp)
+#      define PTR_ptab              pt2d
+#   endif
+#   if defined DIM_3d
+#      define ARRAY_TYPE(i,j,k,l)   REAL(sp), DIMENSION(i,j,k)
+#      define PTR_TYPE              TYPE(PTR_3D_sp)
+#      define PTR_ptab              pt3d
+#   endif
+#   if defined DIM_4d
+#      define ARRAY_TYPE(i,j,k,l)   REAL(sp), DIMENSION(i,j,k,l)
+#      define PTR_TYPE              TYPE(PTR_4D_sp)
+#      define PTR_ptab              pt4d
+#   endif
+#   define PRECISION sp
+#else
+#   if defined DIM_2d
+#      define ARRAY_TYPE(i,j,k,l)   REAL(dp), DIMENSION(i,j)
+#      define PTR_TYPE              TYPE(PTR_2D_dp)
+#      define PTR_ptab              pt2d
+#   endif
+#   if defined DIM_3d
+#      define ARRAY_TYPE(i,j,k,l)   REAL(dp), DIMENSION(i,j,k)
+#      define PTR_TYPE              TYPE(PTR_3D_dp)
+#      define PTR_ptab              pt3d
+#   endif
+#   if defined DIM_4d
+#      define ARRAY_TYPE(i,j,k,l)   REAL(dp), DIMENSION(i,j,k,l)
+#      define PTR_TYPE              TYPE(PTR_4D_dp)
+#      define PTR_ptab              pt4d
+#   endif
+#   define PRECISION dp
+#endif
+
+   SUBROUTINE ROUTINE_MULTI_NC( cdname                                                                             &
+      &                    , pt1 , cdna1 , psgn1 , pt2 , cdna2 , psgn2 , pt3 , cdna3 , psgn3 , pt4 , cdna4 , psgn4   &
+      &                    , pt5 , cdna5 , psgn5 , pt6 , cdna6 , psgn6 , pt7 , cdna7 , psgn7 , pt8 , cdna8 , psgn8   &
+      &                    , pt9 , cdna9 , psgn9 , pt10, cdna10, psgn10, pt11, cdna11, psgn11, pt12, cdna12, psgn12  &
+      &                    , pt13, cdna13, psgn13, pt14, cdna14, psgn14, pt15, cdna15, psgn15, pt16, cdna16, psgn16  &
+      &                    , kfillmode, pfillval, lsend, lrecv, ncsten )
+      !!---------------------------------------------------------------------
+      CHARACTER(len=*)   ,                   INTENT(in   ) :: cdname  ! name of the calling subroutine
+      ARRAY_TYPE(:,:,:,:)          , TARGET, INTENT(inout) :: pt1     ! arrays on which the lbc is applied
+      ARRAY_TYPE(:,:,:,:), OPTIONAL, TARGET, INTENT(inout) :: pt2  , pt3  , pt4  , pt5  , pt6  , pt7  , pt8  , pt9  , &
+         &                                                    pt10  , pt11  , pt12  , pt13  , pt14  , pt15  , pt16
+      CHARACTER(len=1)                     , INTENT(in   ) :: cdna1   ! nature of pt2D. array grid-points
+      CHARACTER(len=1)   , OPTIONAL        , INTENT(in   ) :: cdna2, cdna3, cdna4, cdna5, cdna6, cdna7, cdna8, cdna9, &
+         &                                                    cdna10, cdna11, cdna12, cdna13, cdna14, cdna15, cdna16
+      REAL(wp)                             , INTENT(in   ) :: psgn1   ! sign used across the north fold
+      REAL(wp)           , OPTIONAL        , INTENT(in   ) :: psgn2, psgn3, psgn4, psgn5, psgn6, psgn7, psgn8, psgn9, &
+         &                                                    psgn10, psgn11, psgn12, psgn13, psgn14, psgn15, psgn16
+      INTEGER            , OPTIONAL        , INTENT(in   ) :: kfillmode   ! filling method for halo over land (default = constant)
+      REAL(wp)           , OPTIONAL        , INTENT(in   ) :: pfillval    ! background value (used at closed boundaries)
+      LOGICAL, DIMENSION(4), OPTIONAL      , INTENT(in   ) :: lsend, lrecv   ! indicate how communications are to be carried out
+      LOGICAL            , OPTIONAL      , INTENT(in   ) :: ncsten
+      !!
+      INTEGER                          ::   kfld        ! number of elements that will be attributed
+      PTR_TYPE         , DIMENSION(16) ::   ptab_ptr    ! pointer array
+      CHARACTER(len=1) , DIMENSION(16) ::   cdna_ptr    ! nature of ptab_ptr grid-points
+      REAL(wp)         , DIMENSION(16) ::   psgn_ptr    ! sign used across the north fold boundary
+      !!---------------------------------------------------------------------
+      !
+      kfld = 0          ! initial array of pointer size
+      !
+      !                 ! Load the first array
+      CALL ROUTINE_NC_LOAD( pt1, cdna1, psgn1, ptab_ptr, cdna_ptr, psgn_ptr, kfld )
+      !
+      !                 ! Look if more arrays are added
+      IF( PRESENT(psgn2 ) )   CALL ROUTINE_NC_LOAD( pt2 , cdna2 , psgn2 , ptab_ptr, cdna_ptr, psgn_ptr, kfld )
+      IF( PRESENT(psgn3 ) )   CALL ROUTINE_NC_LOAD( pt3 , cdna3 , psgn3 , ptab_ptr, cdna_ptr, psgn_ptr, kfld )
+      IF( PRESENT(psgn4 ) )   CALL ROUTINE_NC_LOAD( pt4 , cdna4 , psgn4 , ptab_ptr, cdna_ptr, psgn_ptr, kfld )
+      IF( PRESENT(psgn5 ) )   CALL ROUTINE_NC_LOAD( pt5 , cdna5 , psgn5 , ptab_ptr, cdna_ptr, psgn_ptr, kfld )
+      IF( PRESENT(psgn6 ) )   CALL ROUTINE_NC_LOAD( pt6 , cdna6 , psgn6 , ptab_ptr, cdna_ptr, psgn_ptr, kfld )
+      IF( PRESENT(psgn7 ) )   CALL ROUTINE_NC_LOAD( pt7 , cdna7 , psgn7 , ptab_ptr, cdna_ptr, psgn_ptr, kfld )
+      IF( PRESENT(psgn8 ) )   CALL ROUTINE_NC_LOAD( pt8 , cdna8 , psgn8 , ptab_ptr, cdna_ptr, psgn_ptr, kfld )
+      IF( PRESENT(psgn9 ) )   CALL ROUTINE_NC_LOAD( pt9 , cdna9 , psgn9 , ptab_ptr, cdna_ptr, psgn_ptr, kfld )
+      IF( PRESENT(psgn10) )   CALL ROUTINE_NC_LOAD( pt10, cdna10, psgn10, ptab_ptr, cdna_ptr, psgn_ptr, kfld )
+      IF( PRESENT(psgn11) )   CALL ROUTINE_NC_LOAD( pt11, cdna11, psgn11, ptab_ptr, cdna_ptr, psgn_ptr, kfld )
+      IF( PRESENT(psgn12) )   CALL ROUTINE_NC_LOAD( pt12, cdna12, psgn12, ptab_ptr, cdna_ptr, psgn_ptr, kfld )
+      IF( PRESENT(psgn13) )   CALL ROUTINE_NC_LOAD( pt13, cdna13, psgn13, ptab_ptr, cdna_ptr, psgn_ptr, kfld )
+      IF( PRESENT(psgn14) )   CALL ROUTINE_NC_LOAD( pt14, cdna14, psgn14, ptab_ptr, cdna_ptr, psgn_ptr, kfld )
+      IF( PRESENT(psgn15) )   CALL ROUTINE_NC_LOAD( pt15, cdna15, psgn15, ptab_ptr, cdna_ptr, psgn_ptr, kfld )
+      IF( PRESENT(psgn16) )   CALL ROUTINE_NC_LOAD( pt16, cdna16, psgn16, ptab_ptr, cdna_ptr, psgn_ptr, kfld )
+      !
+      CALL lbc_lnk_nc    ( cdname,               ptab_ptr, cdna_ptr, psgn_ptr, kfld, kfillmode, pfillval, lsend, lrecv, ncsten )
+      !
+   END SUBROUTINE ROUTINE_MULTI_NC
+
+
+   SUBROUTINE ROUTINE_NC_LOAD( ptab, cdna, psgn, ptab_ptr, cdna_ptr, psgn_ptr, kfld )
+      !!---------------------------------------------------------------------
+      ARRAY_TYPE(:,:,:,:)   , TARGET, INTENT(inout) ::   ptab       ! arrays on which the lbc is applied
+      CHARACTER(len=1)              , INTENT(in   ) ::   cdna       ! nature of pt2d array grid-points
+      REAL(wp)                      , INTENT(in   ) ::   psgn       ! sign used across the north fold boundary
+      PTR_TYPE        , DIMENSION(:), INTENT(inout) ::   ptab_ptr   ! array of pointers
+      CHARACTER(len=1), DIMENSION(:), INTENT(inout) ::   cdna_ptr   ! nature of pt2d_array array grid-points
+      REAL(wp)        , DIMENSION(:), INTENT(inout) ::   psgn_ptr   ! sign used across the north fold boundary
+      INTEGER                       , INTENT(inout) ::   kfld       ! number of elements that has been attributed
+      !!---------------------------------------------------------------------
+      !
+      kfld                    =  kfld + 1
+      ptab_ptr(kfld)%PTR_ptab => ptab
+      cdna_ptr(kfld)          =  cdna
+      psgn_ptr(kfld)          =  psgn
+      !
+   END SUBROUTINE ROUTINE_NC_LOAD
+
+#undef PRECISION
+#undef ARRAY_TYPE
+#undef PTR_TYPE
+#undef PTR_ptab
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/LBC/lbclnk.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/LBC/lbclnk.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/LBC/lbclnk.F90	(revision 14012)
@@ -39,4 +39,12 @@
       MODULE PROCEDURE   lbc_lnk_2d_multi_dp , lbc_lnk_3d_multi_dp, lbc_lnk_4d_multi_dp
    END INTERFACE
+   INTERFACE lbc_lnk_nc_multi
+      MODULE PROCEDURE   lbc_lnk_nc_2d_sp, lbc_lnk_nc_3d_sp, lbc_lnk_nc_4d_sp
+      MODULE PROCEDURE   lbc_lnk_nc_2d_dp, lbc_lnk_nc_3d_dp, lbc_lnk_nc_4d_dp
+   END INTERFACE
+   INTERFACE lbc_lnk_nc
+      MODULE PROCEDURE   mpp_lnk_nc_2d_sp, mpp_lnk_nc_3d_sp, mpp_lnk_nc_4d_sp
+      MODULE PROCEDURE   mpp_lnk_nc_2d_dp, mpp_lnk_nc_3d_dp, mpp_lnk_nc_4d_dp
+   END INTERFACE
    !
    INTERFACE lbc_lnk_icb
@@ -52,7 +60,9 @@
    END INTERFACE
 
-   PUBLIC   lbc_lnk       ! ocean/ice lateral boundary conditions
-   PUBLIC   lbc_lnk_multi ! modified ocean/ice lateral boundary conditions
-   PUBLIC   lbc_lnk_icb   ! iceberg lateral boundary conditions
+   PUBLIC   lbc_lnk            ! ocean/ice lateral boundary conditions
+   PUBLIC   lbc_lnk_multi      ! modified ocean/ice lateral boundary conditions
+   PUBLIC   lbc_lnk_icb        ! iceberg lateral boundary conditions
+   PUBLIC   lbc_lnk_nc         ! ocean/ice lateral boundary conditions (MPI3 version)
+   PUBLIC   lbc_lnk_nc_multi   ! modified ocean/ice lateral boundary conditions (MPI3 version)
 
 #if   defined key_mpp_mpi
@@ -250,4 +260,146 @@
 #  undef DIM_4d
 
+   !!----------------------------------------------------------------------
+   !!                   ***   load_ptr_(2,3,4)d   ***
+   !!
+   !!   * Dummy Argument :
+   !!       in    ==>   ptab       ! array to be loaded (2D, 3D or 4D)
+   !!                   cd_nat     ! nature of pt2d array grid-points
+   !!                   psgn       ! sign used across the north fold boundary
+   !!       inout <=>   ptab_ptr   ! array of 2D, 3D or 4D pointers
+   !!                   cdna_ptr   ! nature of ptab array grid-points
+   !!                   psgn_ptr   ! sign used across the north fold boundary
+   !!                   kfld       ! number of elements that has been attributed
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!                  ***   lbc_lnk_nc(2,3,4)d_multi   ***
+   !!                     ***   load_ptr_(2,3,4)d   ***
+   !!
+   !!   * Argument : dummy argument use in lbc_lnk_nc_multi_... routines
+   !!
+   !!----------------------------------------------------------------------
+
+   !!
+   !!   ----   SINGLE PRECISION VERSIONS
+   !!
+#  define SINGLE_PRECISION
+#  define DIM_2d
+#     define ROUTINE_NC_LOAD           load_ptr_nc_2d_sp
+#     define ROUTINE_MULTI_NC          lbc_lnk_nc_2d_sp
+#     include "lbc_lnk_nc_generic.h90"
+#     undef ROUTINE_MULTI_NC
+#     undef ROUTINE_NC_LOAD
+#  undef DIM_2d
+
+#  define DIM_3d
+#     define ROUTINE_NC_LOAD           load_ptr_nc_3d_sp
+#     define ROUTINE_MULTI_NC          lbc_lnk_nc_3d_sp
+#     include "lbc_lnk_nc_generic.h90"
+#     undef ROUTINE_MULTI_NC
+#     undef ROUTINE_NC_LOAD
+#  undef DIM_3d
+
+#  define DIM_4d
+#     define ROUTINE_NC_LOAD           load_ptr_nc_4d_sp
+#     define ROUTINE_MULTI_NC          lbc_lnk_nc_4d_sp
+#     include "lbc_lnk_nc_generic.h90"
+#     undef ROUTINE_MULTI_NC
+#     undef ROUTINE_NC_LOAD
+#  undef DIM_4d
+#  undef SINGLE_PRECISION
+   !!
+   !!   ----   DOUBLE PRECISION VERSIONS
+   !!
+
+#  define DIM_2d
+#     define ROUTINE_NC_LOAD           load_ptr_nc_2d_dp
+#     define ROUTINE_MULTI_NC          lbc_lnk_nc_2d_dp
+#     include "lbc_lnk_nc_generic.h90"
+#     undef ROUTINE_MULTI_NC
+#     undef ROUTINE_NC_LOAD
+#  undef DIM_2d
+
+#  define DIM_3d
+#     define ROUTINE_NC_LOAD           load_ptr_nc_3d_dp
+#     define ROUTINE_MULTI_NC          lbc_lnk_nc_3d_dp
+#     include "lbc_lnk_nc_generic.h90"
+#     undef ROUTINE_MULTI_NC
+#     undef ROUTINE_NC_LOAD
+#  undef DIM_3d
+
+#  define DIM_4d
+#     define ROUTINE_NC_LOAD           load_ptr_nc_4d_dp
+#     define ROUTINE_MULTI_NC          lbc_lnk_nc_4d_dp
+#     include "lbc_lnk_nc_generic.h90"
+#     undef ROUTINE_MULTI_NC
+#     undef ROUTINE_NC_LOAD
+#  undef DIM_4d
+
+   !!----------------------------------------------------------------------
+   !!                   ***  routine mpp_lnk_nc_(2,3,4)d  ***
+   !!
+   !!   * Argument : dummy argument use in mpp_lnk_... routines
+   !!                ptab      :   array or pointer of arrays on which the boundary condition is applied
+   !!                cd_nat    :   nature of array grid-points
+   !!                psgn      :   sign used across the north fold boundary
+   !!                kfld      :   optional, number of pt3d arrays
+   !!                kfillmode :   optional, method to be use to fill the halos (see jpfill* variables)
+   !!                pfillval  :   optional, background value (used with jpfillcopy)
+   !!----------------------------------------------------------------------
+   !
+   !                       !==  2D array and array of 2D pointer  ==!
+   !
+   !!
+   !!   ----   SINGLE PRECISION VERSIONS
+   !!
+# define SINGLE_PRECISION
+#  define DIM_2d
+#     define ROUTINE_NC           mpp_lnk_nc_2d_sp
+#     include "mpp_nc_generic.h90"
+#     undef ROUTINE_NC
+#  undef DIM_2d
+   !
+   !                       !==  3D array and array of 3D pointer  ==!
+   !
+#  define DIM_3d
+#     define ROUTINE_NC           mpp_lnk_nc_3d_sp
+#     include "mpp_nc_generic.h90"
+#     undef ROUTINE_NC
+#  undef DIM_3d
+   !
+   !                       !==  4D array and array of 4D pointer  ==!
+   !
+#  define DIM_4d
+#     define ROUTINE_NC           mpp_lnk_nc_4d_sp
+#     include "mpp_nc_generic.h90"
+#     undef ROUTINE_NC
+#  undef DIM_4d
+# undef SINGLE_PRECISION
+
+   !!
+   !!   ----   DOUBLE PRECISION VERSIONS
+   !!
+#  define DIM_2d
+#     define ROUTINE_NC           mpp_lnk_nc_2d_dp
+#     include "mpp_nc_generic.h90"
+#     undef ROUTINE_NC
+#  undef DIM_2d
+   !
+   !                       !==  3D array and array of 3D pointer  ==!
+   !
+#  define DIM_3d
+#     define ROUTINE_NC           mpp_lnk_nc_3d_dp
+#     include "mpp_nc_generic.h90"
+#     undef ROUTINE_NC
+#  undef DIM_3d
+   !
+   !                       !==  4D array and array of 4D pointer  ==!
+   !
+#  define DIM_4d
+#     define ROUTINE_NC           mpp_lnk_nc_4d_dp
+#     include "mpp_nc_generic.h90"
+#     undef ROUTINE_NC
+#  undef DIM_4d
 
    !!----------------------------------------------------------------------
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/LBC/lib_mpp.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/LBC/lib_mpp.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/LBC/lib_mpp.F90	(revision 14012)
@@ -66,4 +66,5 @@
    PUBLIC   mppscatter, mppgather
    PUBLIC   mpp_ini_znl
+   PUBLIC   mpp_ini_nc
    PUBLIC   mppsend, mpprecv                          ! needed by TAM and ICB routines
    PUBLIC   mppsend_sp, mpprecv_sp                          ! needed by TAM and ICB routines
@@ -137,4 +138,8 @@
    INTEGER         ::   ndim_rank_znl   !  number of processors on the same zonal average
    INTEGER, DIMENSION(:), ALLOCATABLE, SAVE ::   nrank_znl  ! dimension ndim_rank_znl, number of the procs into the same znl domain
+
+   ! variables used for MPI3 neighbourhood collectives
+   INTEGER, PUBLIC :: mpi_nc_com                   ! MPI3 neighbourhood collectives communicator
+   INTEGER, PUBLIC :: mpi_nc_all_com               ! MPI3 neighbourhood collectives communicator (with diagionals)
 
    ! North fold condition in mpp_mpi with jpni > 1 (PUBLIC for TAM)
@@ -1067,4 +1072,151 @@
 
    END SUBROUTINE mpp_ini_znl
+
+   SUBROUTINE mpp_ini_nc
+      !!----------------------------------------------------------------------
+      !!               ***  routine mpp_ini_nc  ***
+      !!
+      !! ** Purpose :   Initialize special communicators for MPI3 neighbourhood
+      !!                collectives
+      !!
+      !! ** Method  : - Create graph communicators starting from the processes   
+      !!                distribution along i and j directions
+      !
+      !! ** output
+      !!         mpi_nc_com = MPI3 neighbourhood collectives communicator
+      !!         mpi_nc_all_com = MPI3 neighbourhood collectives communicator
+      !!                          (with diagonals)
+      !!
+      !!----------------------------------------------------------------------
+      INTEGER, DIMENSION(:), ALLOCATABLE :: ineigh, ineighalls, ineighallr
+      INTEGER :: ideg, idegalls, idegallr, icont, icont1
+      INTEGER :: ierr
+      LOGICAL, PARAMETER :: ireord = .FALSE.
+
+#if defined key_mpp_mpi
+
+      ideg = 0
+      idegalls = 0
+      idegallr = 0
+      icont = 0
+      icont1 = 0
+
+      IF (nbondi .eq. 1) THEN
+         ideg = ideg + 1
+      ELSEIF (nbondi .eq. -1) THEN
+         ideg = ideg + 1
+      ELSEIF (nbondi .eq. 0) THEN
+         ideg = ideg + 2
+      ENDIF
+
+      IF (nbondj .eq. 1) THEN
+         ideg = ideg + 1
+      ELSEIF (nbondj .eq. -1) THEN
+         ideg = ideg + 1
+      ELSEIF (nbondj .eq. 0) THEN
+         ideg = ideg + 2
+      ENDIF
+
+      idegalls = ideg
+      idegallr = ideg
+
+      IF (nones .ne. -1) idegalls = idegalls + 1
+      IF (nonws .ne. -1) idegalls = idegalls + 1
+      IF (noses .ne. -1) idegalls = idegalls + 1
+      IF (nosws .ne. -1) idegalls = idegalls + 1
+      IF (noner .ne. -1) idegallr = idegallr + 1
+      IF (nonwr .ne. -1) idegallr = idegallr + 1
+      IF (noser .ne. -1) idegallr = idegallr + 1
+      IF (noswr .ne. -1) idegallr = idegallr + 1
+
+      ALLOCATE(ineigh(ideg))
+      ALLOCATE(ineighalls(idegalls))
+      ALLOCATE(ineighallr(idegallr))
+
+      IF (nbondi .eq. 1) THEN
+         icont = icont + 1
+         ineigh(icont) = nowe
+         ineighalls(icont) = nowe
+         ineighallr(icont) = nowe
+      ELSEIF (nbondi .eq. -1) THEN
+         icont = icont + 1
+         ineigh(icont) = noea
+         ineighalls(icont) = noea
+         ineighallr(icont) = noea
+      ELSEIF (nbondi .eq. 0) THEN
+         icont = icont + 1
+         ineigh(icont) = nowe
+         ineighalls(icont) = nowe
+         ineighallr(icont) = nowe
+         icont = icont + 1
+         ineigh(icont) = noea
+         ineighalls(icont) = noea
+         ineighallr(icont) = noea
+      ENDIF
+
+      IF (nbondj .eq. 1) THEN
+         icont = icont + 1
+         ineigh(icont) = noso
+         ineighalls(icont) = noso
+         ineighallr(icont) = noso
+      ELSEIF (nbondj .eq. -1) THEN
+         icont = icont + 1
+         ineigh(icont) = nono
+         ineighalls(icont) = nono
+         ineighallr(icont) = nono
+      ELSEIF (nbondj .eq. 0) THEN
+         icont = icont + 1
+         ineigh(icont) = noso
+         ineighalls(icont) = noso
+         ineighallr(icont) = noso
+         icont = icont + 1
+         ineigh(icont) = nono
+         ineighalls(icont) = nono
+         ineighallr(icont) = nono
+      ENDIF
+
+      icont1 = icont
+      IF (nosws .ne. -1) THEN
+         icont = icont + 1
+         ineighalls(icont) = nosws
+      ENDIF
+      IF (noses .ne. -1) THEN
+         icont = icont + 1
+         ineighalls(icont) = noses
+      ENDIF
+      IF (nonws .ne. -1) THEN
+         icont = icont + 1
+         ineighalls(icont) = nonws
+      ENDIF
+      IF (nones .ne. -1) THEN
+         icont = icont + 1
+         ineighalls(icont) = nones
+      ENDIF
+      IF (noswr .ne. -1) THEN
+         icont1 = icont1 + 1
+         ineighallr(icont1) = noswr
+      ENDIF
+      IF (noser .ne. -1) THEN
+         icont1 = icont1 + 1
+         ineighallr(icont1) = noser
+      ENDIF
+      IF (nonwr .ne. -1) THEN
+         icont1 = icont1 + 1
+         ineighallr(icont1) = nonwr
+      ENDIF
+      IF (noner .ne. -1) THEN
+         icont1 = icont1 + 1
+         ineighallr(icont1) = noner
+      ENDIF
+
+      CALL MPI_Dist_graph_create_adjacent(mpi_comm_oce, ideg, ineigh, MPI_UNWEIGHTED, ideg, ineigh, MPI_UNWEIGHTED, MPI_INFO_NULL, ireord, mpi_nc_com, ierr)
+      CALL MPI_Dist_graph_create_adjacent(mpi_comm_oce, idegallr, ineighallr, MPI_UNWEIGHTED, idegalls, ineighalls, MPI_UNWEIGHTED, MPI_INFO_NULL, ireord, mpi_nc_all_com, ierr)
+
+      DEALLOCATE (ineigh)
+      DEALLOCATE (ineighalls)
+      DEALLOCATE (ineighallr)
+#endif
+   END SUBROUTINE mpp_ini_nc
+
 
 
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/LBC/mpp_lnk_generic.h90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/LBC/mpp_lnk_generic.h90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/LBC/mpp_lnk_generic.h90	(revision 14012)
@@ -72,8 +72,8 @@
 
 #if defined MULTI
-   SUBROUTINE ROUTINE_LNK( cdname, ptab, cd_nat, psgn, kfld, kfillmode, pfillval, lsend, lrecv )
+   SUBROUTINE ROUTINE_LNK( cdname, ptab, cd_nat, psgn, kfld, kfillmode, pfillval, lsend, lrecv, ncsten )
       INTEGER             , INTENT(in   ) ::   kfld        ! number of pt3d arrays
 #else
-   SUBROUTINE ROUTINE_LNK( cdname, ptab, cd_nat, psgn      , kfillmode, pfillval, lsend, lrecv )
+   SUBROUTINE ROUTINE_LNK( cdname, ptab, cd_nat, psgn      , kfillmode, pfillval, lsend, lrecv, ncsten )
 #endif
       ARRAY_TYPE(:,:,:,:,:)                                        ! array or pointer of arrays on which the boundary condition is applied
@@ -84,4 +84,5 @@
       REAL(wp),             OPTIONAL, INTENT(in   ) ::   pfillval    ! background value (used at closed boundaries)
       LOGICAL, DIMENSION(4),OPTIONAL, INTENT(in   ) ::   lsend, lrecv  ! communication with other 4 proc
+      LOGICAL,              OPTIONAL, INTENT(in   ) ::   ncsten      ! 5-point or 9-point stencil
       !
       INTEGER  ::    ji,  jj,  jk,  jl,  jf      ! dummy loop indices
@@ -100,4 +101,12 @@
       !!----------------------------------------------------------------------
       !
+#if defined key_mpi3
+#   if defined MULTI
+      CALL lbc_lnk_nc    ( cdname,  ptab, cd_nat, psgn, kfld, kfillmode, pfillval, lsend, lrecv, ncsten )
+#   else
+      CALL lbc_lnk_nc_multi(cdname, ptab, cd_nat, psgn, kfillmode=kfillmode, pfillval=pfillval, lsend=lsend, lrecv=lrecv, ncsten=ncsten)
+#   endif
+#else
+
       ! ----------------------------------------- !
       !     0. local variables initialization     !
@@ -387,4 +396,5 @@
       IF( llrecv_no )   DEALLOCATE( zrcv_no )
       !
+#endif
    END SUBROUTINE ROUTINE_LNK
 #undef PRECISION
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/LBC/mpp_nc_generic.h90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/LBC/mpp_nc_generic.h90	(revision 14012)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/LBC/mpp_nc_generic.h90	(revision 14012)
@@ -0,0 +1,950 @@
+#   define NAT_IN(k)                cd_nat(k)   
+#   define SGN_IN(k)                psgn(k)
+#   define F_SIZE(ptab)             kfld
+#   define OPT_K(k)                 ,ipf
+#   if defined DIM_2d
+#      if defined SINGLE_PRECISION
+#         define ARRAY_TYPE(i,j,k,l,f)    TYPE(PTR_2D_sp)                , INTENT(inout) ::   ptab(f)
+#      else
+#         define ARRAY_TYPE(i,j,k,l,f)    TYPE(PTR_2D_dp)                , INTENT(inout) ::   ptab(f)
+#      endif
+#      define ARRAY_IN(i,j,k,l,f)      ptab(f)%pt2d(i,j)
+#      define K_SIZE(ptab)             1
+#      define L_SIZE(ptab)             1
+#   endif
+#   if defined DIM_3d
+#      if defined SINGLE_PRECISION
+#         define ARRAY_TYPE(i,j,k,l,f)    TYPE(PTR_3D_sp)                , INTENT(inout) ::   ptab(f)
+#      else
+#         define ARRAY_TYPE(i,j,k,l,f)    TYPE(PTR_3D_dp)                , INTENT(inout) ::   ptab(f)
+#      endif
+#      define ARRAY_IN(i,j,k,l,f)      ptab(f)%pt3d(i,j,k)
+#      define K_SIZE(ptab)             SIZE(ptab(1)%pt3d,3)
+#      define L_SIZE(ptab)             1
+#   endif
+#   if defined DIM_4d
+#      if defined SINGLE_PRECISION
+#         define ARRAY_TYPE(i,j,k,l,f)    TYPE(PTR_4D_sp)                , INTENT(inout) ::   ptab(f)
+#      else
+#         define ARRAY_TYPE(i,j,k,l,f)    TYPE(PTR_4D_dp)                , INTENT(inout) ::   ptab(f)
+#      endif
+#      define ARRAY_IN(i,j,k,l,f)      ptab(f)%pt4d(i,j,k,l)
+#      define K_SIZE(ptab)             SIZE(ptab(1)%pt4d,3)
+#      define L_SIZE(ptab)             SIZE(ptab(1)%pt4d,4)
+#   endif
+#   if defined SINGLE_PRECISION
+#      define PRECISION sp
+#      define MPI_TYPE MPI_REAL
+#   else
+#      define PRECISION dp
+#      define MPI_TYPE MPI_DOUBLE_PRECISION
+#   endif
+
+   SUBROUTINE ROUTINE_NC( cdname, ptab, cd_nat, psgn, kfld, kfillmode, pfillval, lsend, lrecv, ncsten )
+      INTEGER             , INTENT(in   ) ::   kfld        ! number of pt3d arrays
+      ARRAY_TYPE(:,:,:,:,:)                                        ! array or pointer of arrays on which the boundary condition is applied
+      CHARACTER(len=*)              , INTENT(in   ) ::   cdname      ! name of the calling subroutine
+      CHARACTER(len=1)              , INTENT(in   ) ::   NAT_IN(:)   ! nature of array grid-points
+      REAL(wp)                      , INTENT(in   ) ::   SGN_IN(:)   ! sign used across the north fold boundary
+      INTEGER ,             OPTIONAL, INTENT(in   ) ::   kfillmode   ! filling method for halo over land (default = constant)
+      REAL(wp),             OPTIONAL, INTENT(in   ) ::   pfillval    ! background value (used at closed boundaries)
+      LOGICAL, DIMENSION(4),OPTIONAL, INTENT(in   ) ::   lsend, lrecv  ! communication with other 4 proc
+      LOGICAL,              OPTIONAL, INTENT(in   ) ::   ncsten      ! 5-point or 9-point stencil
+      !
+      INTEGER  ::   ji,  jj,  jk,  jl,  jf                                      ! dummy loop indices
+      INTEGER  ::   ipi, ipj, ipk, ipl, ipf                                     ! dimension of the input array
+      INTEGER  ::   ishift, ishift2, idx, icount, icount1                       ! local integers
+      INTEGER  ::   idims, idimr, isizet, isizets, isizetr, izsnd, izrcv        ! local integers
+      INTEGER  ::   ierr
+      INTEGER  ::   ifill_we, ifill_ea, ifill_so, ifill_no
+      INTEGER  ::   ifill_web, ifill_eab
+      REAL(wp) ::   zland
+      INTEGER , DIMENSION(MPI_STATUS_SIZE)                        ::   istate              ! for mpi_isend
+      REAL(PRECISION), DIMENSION(:), ALLOCATABLE                  ::   zsnd, zrcv          ! halos arrays
+      INTEGER , DIMENSION(:), ALLOCATABLE                         ::   isizes              ! number of elements to be sent
+      INTEGER , DIMENSION(:), ALLOCATABLE                         ::   isizer              ! number of elements to be received
+      INTEGER , DIMENSION(:), ALLOCATABLE                         ::   idatatys, idatatyr  ! datatype of halos arrays
+      INTEGER (KIND=MPI_ADDRESS_KIND), DIMENSION (:), ALLOCATABLE ::   idispls, idisplr    ! displacement in halos arrays
+      LOGICAL  ::   llsend_we, llsend_ea, llsend_no, llsend_so       ! communication send
+      LOGICAL  ::   llrecv_we, llrecv_ea, llrecv_no, llrecv_so       ! communication receive 
+      LOGICAL  ::   lldo_nfd                                         ! do north pole folding
+      LOGICAL  ::   llncall                                          ! default: 9-point stencil
+
+      !!----------------------------------------------------------------------
+      !
+      ! ----------------------------------------- !
+      !     0. local variables initialization     !
+      ! ----------------------------------------- !
+      !
+      llncall = .TRUE. 
+      ipk = K_SIZE(ptab)   ! 3rd dimension
+      ipl = L_SIZE(ptab)   ! 4th    -
+      ipf = F_SIZE(ptab)   ! 5th    -      use in "multi" case (array of pointers)
+      !
+      IF( narea == 1 .AND. numcom == -1 ) CALL mpp_report( cdname, ipk, ipl, ipf, ld_lbc = .TRUE. )
+      !
+      IF     ( PRESENT(lsend) .AND. PRESENT(lrecv) ) THEN
+         llsend_we = lsend(1)   ;   llsend_ea = lsend(2)   ;   llsend_so = lsend(3)   ;   llsend_no = lsend(4)
+         llrecv_we = lrecv(1)   ;   llrecv_ea = lrecv(2)   ;   llrecv_so = lrecv(3)   ;   llrecv_no = lrecv(4)
+      ELSE IF( PRESENT(lsend) .OR.  PRESENT(lrecv) ) THEN
+         WRITE(ctmp1,*) ' E R R O R : Routine ', cdname, '  is calling lbc_lnk with only one of the two arguments lsend or lrecv'
+         WRITE(ctmp2,*) ' ========== '
+         CALL ctl_stop( ' ', ctmp1, ctmp2, ' ' )
+      ELSE   ! send and receive with every neighbour
+         llsend_we = nbondi ==  1 .OR. nbondi == 0   ! keep for compatibility, should be defined in mppini
+         llsend_ea = nbondi == -1 .OR. nbondi == 0   ! keep for compatibility, should be defined in mppini
+         llsend_so = nbondj ==  1 .OR. nbondj == 0   ! keep for compatibility, should be defined in mppini
+         llsend_no = nbondj == -1 .OR. nbondj == 0   ! keep for compatibility, should be defined in mppini
+         llrecv_we = llsend_we   ;   llrecv_ea = llsend_ea   ;   llrecv_so = llsend_so   ;   llrecv_no = llsend_no
+      END IF
+         
+      lldo_nfd = npolj /= 0                      ! keep for compatibility, should be defined in mppini
+
+      zland = 0._wp                                     ! land filling value: zero by default
+      IF( PRESENT( pfillval ) )   zland = pfillval      ! set land value
+
+
+      ! define the method we will use to fill the halos in each direction
+      IF(              llrecv_we ) THEN   ;   ifill_we = jpfillmpi
+      ELSEIF(           l_Iperio ) THEN   ;   ifill_we = jpfillperio
+      ELSEIF( PRESENT(kfillmode) ) THEN   ;   ifill_we = kfillmode
+      ELSE                                ;   ifill_we = jpfillcst
+      END IF
+      IF(               l_Iperio ) THEN   ;   ifill_web = jpfillperio
+      ELSEIF( PRESENT(kfillmode) ) THEN   ;   ifill_web = kfillmode
+      ELSE                                ;   ifill_web = jpfillcst
+      END IF
+      !
+      IF(              llrecv_ea ) THEN   ;   ifill_ea = jpfillmpi
+      ELSEIF(           l_Iperio ) THEN   ;   ifill_ea = jpfillperio
+      ELSEIF( PRESENT(kfillmode) ) THEN   ;   ifill_ea = kfillmode
+      ELSE                                ;   ifill_ea = jpfillcst
+      END IF
+      IF(               l_Iperio ) THEN   ;   ifill_eab = jpfillperio
+      ELSEIF( PRESENT(kfillmode) ) THEN   ;   ifill_eab = kfillmode
+      ELSE                                ;   ifill_eab = jpfillcst
+      END IF
+      !
+      IF(              llrecv_so ) THEN   ;   ifill_so = jpfillmpi
+      ELSEIF(           l_Jperio ) THEN   ;   ifill_so = jpfillperio
+      ELSEIF( PRESENT(kfillmode) ) THEN   ;   ifill_so = kfillmode
+      ELSE                                ;   ifill_so = jpfillcst
+      END IF
+      !
+      IF(              llrecv_no ) THEN   ;   ifill_no = jpfillmpi
+      ELSEIF(           l_Jperio ) THEN   ;   ifill_no = jpfillperio
+      ELSEIF( PRESENT(kfillmode) ) THEN   ;   ifill_no = kfillmode
+      ELSE                                ;   ifill_no = jpfillcst
+      END IF
+      !
+      IF(PRESENT(ncsten)) llncall = ncsten 
+#if defined PRINT_CAUTION
+      !
+      ! ================================================================================== !
+      ! CAUTION: semi-column notation is often impossible because of the cpp preprocessing !
+      ! ================================================================================== !
+      !
+#endif
+      !
+      ! -------------------------------------------------- !
+      !     1. Do west, east, south and north MPI exchange !
+      ! -------------------------------------------------- !
+      !
+      ! Allocate local temporary arrays to be sent/received. Fill arrays to be sent
+
+      idims = 0
+      idimr = 0
+      izsnd = 0
+      izrcv = 0
+
+      IF(llsend_we) idims = idims + 1
+      IF(llsend_ea) idims = idims + 1
+      IF(llsend_so) idims = idims + 1
+      IF(llsend_no) idims = idims + 1
+
+      idimr = idims
+
+      IF(llncall) THEN
+         IF(noswr .ne. -1) idimr = idimr + 1
+         IF(noser .ne. -1) idimr = idimr + 1
+         IF(nonwr .ne. -1) idimr = idimr + 1
+         IF(noner .ne. -1) idimr = idimr + 1
+      
+         IF(nosws .ne. -1) idims = idims + 1
+         IF(noses .ne. -1) idims = idims + 1
+         IF(nonws .ne. -1) idims = idims + 1
+         IF(nones .ne. -1) idims = idims + 1
+      END IF
+
+      IF(llsend_we) izsnd = izsnd + nn_hls * (jpj - 2*nn_hls) * ipk * ipl * ipf
+      IF(llsend_ea) izsnd = izsnd + nn_hls * (jpj - 2*nn_hls) * ipk * ipl * ipf
+      IF(llsend_so) izsnd = izsnd + (jpi - 2*nn_hls) * nn_hls * ipk * ipl * ipf
+      IF(llsend_no) izsnd = izsnd + (jpi - 2*nn_hls) * nn_hls * ipk * ipl * ipf
+
+      izrcv = izsnd
+      
+      IF(llncall) THEN
+         IF(noswr .ne. -1) izrcv = izrcv + nn_hls * nn_hls * ipk * ipl * ipf
+         IF(noser .ne. -1) izrcv = izrcv + nn_hls * nn_hls * ipk * ipl * ipf
+         IF(nonwr .ne. -1) izrcv = izrcv + nn_hls * nn_hls * ipk * ipl * ipf
+         IF(noner .ne. -1) izrcv = izrcv + nn_hls * nn_hls * ipk * ipl * ipf
+
+         IF(nosws .ne. -1) izsnd = izsnd + nn_hls * nn_hls * ipk * ipl * ipf
+         IF(noses .ne. -1) izsnd = izsnd + nn_hls * nn_hls * ipk * ipl * ipf
+         IF(nonws .ne. -1) izsnd = izsnd + nn_hls * nn_hls * ipk * ipl * ipf
+         IF(nones .ne. -1) izsnd = izsnd + nn_hls * nn_hls * ipk * ipl * ipf
+      END IF
+
+      ALLOCATE(zsnd(izsnd))
+      ALLOCATE(zrcv(izrcv))
+      ALLOCATE(isizes(idims))
+      ALLOCATE(isizer(idimr))
+      ALLOCATE(idatatys(idims))
+      ALLOCATE(idatatyr(idimr))
+      ALLOCATE(idispls(idims))
+      ALLOCATE(idisplr(idimr))
+
+      zrcv(:)=-1
+      zsnd(:)=-1
+      isizes(:) = 0
+      isizer(:) = 0
+      idispls(:) = 0
+      idisplr(:) = 0
+      isizet = 0 
+     
+      idx = 1
+      icount = 1
+
+      IF(llsend_we) THEN
+         DO jf = 1, ipf  ;  DO jl = 1, ipl  ;  DO jk = 1, ipk  ;  DO jj = nn_hls + 1, jpj - nn_hls  ;  DO ji = 1, nn_hls
+            zsnd(idx) = ARRAY_IN(nn_hls+ji,jj,jk,jl,jf)
+            idx = idx + 1
+         END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+
+         isizes(icount) = nn_hls * (jpj - 2*nn_hls) * ipk * ipl * ipf
+         IF(icount .gt. 1) isizet = isizet + isizes(icount - 1)
+         idispls(icount) = jpbyt*isizet
+         icount = icount + 1
+      END IF
+
+      IF(llsend_ea) THEN
+         ishift = jpi-2*nn_hls
+
+         DO jf = 1, ipf  ;  DO jl = 1, ipl  ;  DO jk = 1, ipk  ;  DO jj = nn_hls + 1, jpj - nn_hls  ;  DO ji = 1, nn_hls
+            zsnd(idx) = ARRAY_IN(ishift+ji,jj,jk,jl,jf)
+            idx = idx + 1
+         END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+
+         isizes(icount) = nn_hls * (jpj - 2*nn_hls) * ipk * ipl * ipf
+         IF(icount .gt. 1) isizet = isizet + isizes(icount - 1)
+         idispls(icount) = jpbyt*isizet
+         icount = icount + 1
+      END IF
+
+      IF(llsend_so) THEN
+         DO jf = 1, ipf  ;  DO jl = 1, ipl  ;  DO jk = 1, ipk  ;  DO jj = 1, nn_hls  ;  DO ji = nn_hls + 1, jpi - nn_hls
+            zsnd(idx) = ARRAY_IN(ji,nn_hls+jj,jk,jl,jf)
+            idx = idx + 1
+         END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+
+         isizes(icount) = (jpi - 2*nn_hls) * nn_hls * ipk * ipl * ipf
+         IF(icount .gt. 1) isizet = isizet + isizes(icount - 1)
+         idispls(icount) = jpbyt*isizet
+         icount = icount + 1
+      END IF
+
+      IF(llsend_no) THEN
+         ishift = jpj-2*nn_hls
+
+         DO jf = 1, ipf  ;  DO jl = 1, ipl  ;  DO jk = 1, ipk  ;  DO jj = 1, nn_hls  ;  DO ji = nn_hls + 1, jpi - nn_hls
+            zsnd(idx) = ARRAY_IN(ji,ishift+jj,jk,jl,jf)
+            idx = idx + 1
+         END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+
+         isizes(icount) = (jpi - 2*nn_hls) * nn_hls * ipk * ipl * ipf
+         IF(icount .gt. 1) isizet = isizet + isizes(icount - 1)
+         idispls(icount) = jpbyt*isizet
+         icount = icount + 1
+      END IF
+
+      isizer(:) = isizes(:)
+      idisplr(:) = idispls(:)
+      
+      icount1 = icount
+      isizets = isizet 
+      isizetr = isizet 
+
+      IF(llncall) THEN
+         IF(noswr .ne. -1) THEN
+            isizer(icount1) = nn_hls * nn_hls * ipk * ipl * ipf
+            IF(icount1 .gt. 1) isizetr = isizetr + isizer(icount1 - 1)
+            idisplr(icount1) = jpbyt*isizetr
+            icount1 = icount1 + 1
+         END IF
+         IF(noser .ne. -1) THEN
+            isizer(icount1) = nn_hls * nn_hls * ipk * ipl * ipf
+            IF(icount1 .gt. 1) isizetr = isizetr + isizer(icount1 - 1)
+            idisplr(icount1) = jpbyt*isizetr
+            icount1 = icount1 + 1
+         END IF
+         IF(nonwr .ne. -1) THEN
+            isizer(icount1) = nn_hls * nn_hls * ipk * ipl * ipf
+            IF(icount1 .gt. 1) isizetr = isizetr + isizer(icount1 - 1)
+            idisplr(icount1) = jpbyt*isizetr
+            icount1 = icount1 + 1
+         END IF
+         IF(noner .ne. -1) THEN
+            isizer(icount1) = nn_hls * nn_hls * ipk * ipl * ipf
+            IF(icount1 .gt. 1) isizetr = isizetr + isizer(icount1 - 1)
+            idisplr(icount1) = jpbyt*isizetr
+            icount1 = icount1 + 1
+         END IF
+
+         IF(nosws .ne. -1) THEN
+            DO jf = 1, ipf  ;  DO jl = 1, ipl  ;  DO jk = 1, ipk  ;  DO jj = 1, nn_hls  ;  DO ji = 1, nn_hls
+               zsnd(idx) = ARRAY_IN(nn_hls+ji,nn_hls+jj,jk,jl,jf)
+               idx = idx + 1
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+
+            isizes(icount) = nn_hls * nn_hls * ipk * ipl * ipf
+            IF(icount .gt. 1) isizets = isizets + isizes(icount - 1)
+            idispls(icount) = jpbyt*isizets
+            icount = icount + 1
+         END IF
+         IF(noses .ne. -1) THEN
+            ishift = jpi-2*nn_hls
+            DO jf = 1, ipf  ;  DO jl = 1, ipl  ;  DO jk = 1, ipk  ;  DO jj = 1, nn_hls  ;  DO ji = 1, nn_hls
+               zsnd(idx) = ARRAY_IN(ji+ishift,nn_hls+jj,jk,jl,jf)
+               idx = idx + 1
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+
+            isizes(icount) = nn_hls * nn_hls * ipk * ipl * ipf
+            IF(icount .gt. 1) isizets = isizets + isizes(icount - 1)
+            idispls(icount) = jpbyt*isizets
+            icount = icount + 1
+         END IF
+         IF(nonws .ne. -1) THEN
+            ishift = jpj-2*nn_hls
+            DO jf = 1, ipf  ;  DO jl = 1, ipl  ;  DO jk = 1, ipk  ;  DO jj = 1, nn_hls  ;  DO ji = 1, nn_hls
+               zsnd(idx) = ARRAY_IN(nn_hls+ji,jj+ishift,jk,jl,jf)
+               idx = idx + 1
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+
+            isizes(icount) = nn_hls * nn_hls * ipk * ipl * ipf
+            IF(icount .gt. 1) isizets = isizets + isizes(icount - 1)
+            idispls(icount) = jpbyt*isizets
+            icount = icount + 1
+         END IF
+         IF(nones .ne. -1) THEN
+            ishift = jpi-2*nn_hls
+            ishift2 = jpj-2*nn_hls
+            DO jf = 1, ipf  ;  DO jl = 1, ipl  ;  DO jk = 1, ipk  ;  DO jj = 1, nn_hls  ;  DO ji = 1, nn_hls
+               zsnd(idx) = ARRAY_IN(ji+ishift,jj+ishift2,jk,jl,jf)
+               idx = idx + 1
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+
+            isizes(icount) = nn_hls * nn_hls * ipk * ipl * ipf
+            IF(icount .gt. 1) isizets = isizets + isizes(icount - 1)
+            idispls(icount) = jpbyt*isizets
+            icount = icount + 1
+         END IF
+      END IF
+
+      idatatys(:) = MPI_TYPE
+      idatatyr(:) = MPI_TYPE
+
+      IF(llncall) THEN
+         IF( ln_timing ) CALL tic_tac(.TRUE.)
+         CALL mpi_neighbor_alltoallw (zsnd, isizes, idispls, idatatys, zrcv, isizer, idisplr, idatatyr, mpi_nc_all_com, ierr)
+         IF( ln_timing ) CALL tic_tac(.FALSE.)
+      ELSE
+         IF( ln_timing ) CALL tic_tac(.TRUE.)
+         CALL mpi_neighbor_alltoallw (zsnd, isizes, idispls, idatatys, zrcv, isizer, idisplr, idatatyr, mpi_nc_com, ierr)
+         IF( ln_timing ) CALL tic_tac(.FALSE.)
+      END IF
+
+      ! --------------------------------------------------- !
+      !     2. Fill east and west north and south halos     !
+      ! --------------------------------------------------- !
+      !
+      !!! Patch to solve MPI3 bug when we have only two processes columns
+      IF(jpni .eq. 2) THEN
+         ! ---------------------
+         ! 2.2 fill eastern halo
+         ! ---------------------
+         idx = 1
+         ishift = jpi - nn_hls                ! fill halo from ji = jpi-nn_hls+1 to jpi
+         SELECT CASE ( ifill_ea )
+         CASE ( jpfillnothing )               ! no filling
+         CASE ( jpfillmpi   )                 ! use data received by MPI
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = nn_hls + 1, jpj - nn_hls   ;   DO ji = 1, nn_hls
+               ARRAY_IN(ishift+ji,jj,jk,jl,jf) = zrcv(idx)   ! jpi - nn_hls + 1 -> jpi
+               idx = idx + 1
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+         CASE ( jpfillperio )                 ! use east-weast periodicity
+            ishift2 = nn_hls
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls
+               ARRAY_IN(ishift+ji,jj,jk,jl,jf) = ARRAY_IN(ishift2+ji,jj,jk,jl,jf)
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+         CASE ( jpfillcopy  )                 ! filling with inner domain values
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls
+               ARRAY_IN(ishift+ji,jj,jk,jl,jf) = ARRAY_IN(ishift,jj,jk,jl,jf)
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+         CASE ( jpfillcst   )                 ! filling with constant value
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls
+               ARRAY_IN(ishift+ji,jj,jk,jl,jf) = zland
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+         END SELECT
+         ! ----------------------
+         ! 2.1 fill weastern halo
+         ! ----------------------
+         SELECT CASE ( ifill_we )
+         CASE ( jpfillnothing )               ! no filling
+         CASE ( jpfillmpi   )                 ! use data received by MPI
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = nn_hls + 1, jpj - nn_hls   ;   DO ji = 1, nn_hls
+               ARRAY_IN(ji,jj,jk,jl,jf) = zrcv(idx)   ! 1 -> nn_hls
+               idx = idx + 1
+            END DO;   END DO   ;   END DO   ;   END DO   ;   END DO
+         CASE ( jpfillperio )                 ! use east-weast periodicity
+            ishift2 = jpi - 2 * nn_hls
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls
+               ARRAY_IN(ji,jj,jk,jl,jf) = ARRAY_IN(ishift2+ji,jj,jk,jl,jf)
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+         CASE ( jpfillcopy  )                 ! filling with inner domain values
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls
+               ARRAY_IN(ji,jj,jk,jl,jf) = ARRAY_IN(nn_hls+1,jj,jk,jl,jf)
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+         CASE ( jpfillcst   )                 ! filling with constant value
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls
+               ARRAY_IN(ji,jj,jk,jl,jf) = zland
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+         END SELECT
+
+      ELSE
+
+         ! ----------------------
+         ! 2.1 fill weastern halo
+         ! ----------------------
+         idx = 1
+         SELECT CASE ( ifill_we )
+         CASE ( jpfillnothing )               ! no filling 
+         CASE ( jpfillmpi   )                 ! use data received by MPI 
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = nn_hls + 1, jpj - nn_hls   ;   DO ji = 1, nn_hls
+               ARRAY_IN(ji,jj,jk,jl,jf) = zrcv(idx)   ! 1 -> nn_hls
+               idx = idx + 1
+            END DO;   END DO   ;   END DO   ;   END DO   ;   END DO
+         CASE ( jpfillperio )                 ! use east-weast periodicity
+            ishift2 = jpi - 2 * nn_hls
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls
+               ARRAY_IN(ji,jj,jk,jl,jf) = ARRAY_IN(ishift2+ji,jj,jk,jl,jf)
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+         CASE ( jpfillcopy  )                 ! filling with inner domain values
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls
+               ARRAY_IN(ji,jj,jk,jl,jf) = ARRAY_IN(nn_hls+1,jj,jk,jl,jf)
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+         CASE ( jpfillcst   )                 ! filling with constant value
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls
+               ARRAY_IN(ji,jj,jk,jl,jf) = zland
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+         END SELECT
+         ! ---------------------
+         ! 2.2 fill eastern halo
+         ! ---------------------
+         ishift = jpi - nn_hls                ! fill halo from ji = jpi-nn_hls+1 to jpi 
+         SELECT CASE ( ifill_ea )
+         CASE ( jpfillnothing )               ! no filling 
+         CASE ( jpfillmpi   )                 ! use data received by MPI 
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = nn_hls + 1, jpj - nn_hls   ;   DO ji = 1, nn_hls
+               ARRAY_IN(ishift+ji,jj,jk,jl,jf) = zrcv(idx)   ! jpi - nn_hls + 1 -> jpi
+               idx = idx + 1
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+         CASE ( jpfillperio )                 ! use east-weast periodicity
+            ishift2 = nn_hls
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls
+               ARRAY_IN(ishift+ji,jj,jk,jl,jf) = ARRAY_IN(ishift2+ji,jj,jk,jl,jf)
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+         CASE ( jpfillcopy  )                 ! filling with inner domain values
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls
+               ARRAY_IN(ishift+ji,jj,jk,jl,jf) = ARRAY_IN(ishift,jj,jk,jl,jf)
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+         CASE ( jpfillcst   )                 ! filling with constant value
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls
+               ARRAY_IN(ishift+ji,jj,jk,jl,jf) = zland
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+         END SELECT
+
+      ENDIF
+
+      !!! Patch to solve MPI3 bug when we have only two processes rows
+      IF(jpnj .eq. 2) THEN
+         ! ----------------------
+         ! 2.3 fill northern halo
+         ! ----------------------
+         ishift = jpj - nn_hls                ! fill halo from jj = jpj-nn_hls+1 to jpj 
+         SELECT CASE ( ifill_no )
+         CASE ( jpfillnothing )               ! no filling 
+         CASE ( jpfillmpi   )                 ! use data received by MPI 
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = nn_hls + 1, jpi - nn_hls
+               ARRAY_IN(ji,ishift+jj,jk,jl,jf) = zrcv(idx)   ! jpj-nn_hls+1 -> jpj
+               idx = idx + 1
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+            IF(nonwr .eq. -1) THEN
+               ishift = jpj - nn_hls
+               SELECT CASE ( ifill_web )
+                  CASE ( jpfillperio )
+                     ishift2 = jpi - 2 * nn_hls
+                     DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1 + ishift, jpj   ;  DO ji = 1, nn_hls
+                        ARRAY_IN(ji,jj,jk,jl,jf) = ARRAY_IN(ishift2+ji,jj,jk,jl,jf)
+                     END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+                  CASE ( jpfillcopy  )
+                     DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1 + ishift, jpj   ;  DO ji = 1, nn_hls
+                        ARRAY_IN(ji,jj,jk,jl,jf) = ARRAY_IN(nn_hls+1,jj,jk,jl,jf)
+                     END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+
+                  CASE ( jpfillcst   )
+                     DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1 + ishift, jpj   ;  DO ji = 1, nn_hls
+                        ARRAY_IN(ji,jj,jk,jl,jf) = zland
+                     END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+               END SELECT
+            END IF
+            IF(noner .eq. -1) THEN
+               ishift = jpi - nn_hls
+               ishift2 = jpj - nn_hls
+               SELECT CASE ( ifill_eab )
+                  CASE ( jpfillperio )
+                     DO jf = 1, ipf  ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1 + ishift2, jpj   ;  DO ji = 1, nn_hls
+                        ARRAY_IN(ishift+ji,jj,jk,jl,jf) = ARRAY_IN(ji,jj,jk,jl,jf)
+                     END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+
+                  CASE ( jpfillcopy  )
+                     DO jf = 1, ipf  ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1 + ishift2, jpj   ;  DO ji = 1, nn_hls
+                        ARRAY_IN(ishift+ji,jj,jk,jl,jf) = ARRAY_IN(ishift,jj,jk,jl,jf)
+                     END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+                  CASE ( jpfillcst   )
+                     DO jf = 1, ipf  ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1 + ishift2, jpj   ;  DO ji = 1, nn_hls
+                        ARRAY_IN(ishift+ji,jj,jk,jl,jf) = zland
+                     END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+               END SELECT
+            END IF
+         CASE ( jpfillperio )                 ! use north-south periodicity
+            ishift2 = nn_hls
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi
+               ARRAY_IN(ji,ishift+jj,jk,jl,jf) = ARRAY_IN(ji,ishift2+jj,jk,jl,jf)
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+         CASE ( jpfillcopy  )                 ! filling with inner domain values
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi
+               ARRAY_IN(ji,ishift+jj,jk,jl,jf) = ARRAY_IN(ji,ishift,jk,jl,jf)
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+         CASE ( jpfillcst   )                 ! filling with constant value
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi
+               ARRAY_IN(ji,ishift+jj,jk,jl,jf) = zland
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+         END SELECT
+
+         ! ----------------------
+         ! 2.4 fill southern halo
+         ! ----------------------
+         SELECT CASE ( ifill_so )
+         CASE ( jpfillnothing )               ! no filling 
+         CASE ( jpfillmpi   )                 ! use data received by MPI 
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = nn_hls + 1, jpi - nn_hls
+               ARRAY_IN(ji,jj,jk,jl,jf) = zrcv(idx)   ! 1 -> nn_hls
+               idx = idx + 1
+            END DO;   END DO   ;   END DO   ;   END DO   ;   END DO
+            IF(noswr .eq. -1) THEN
+               SELECT CASE ( ifill_web )
+                  CASE ( jpfillperio )
+                     ishift2 = jpi - 2 * nn_hls
+                     DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = 1, nn_hls
+                        ARRAY_IN(ji,jj,jk,jl,jf) = ARRAY_IN(ishift2+ji,jj,jk,jl,jf)
+                     END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+                  CASE ( jpfillcopy  )
+                     DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = 1, nn_hls
+                        ARRAY_IN(ji,jj,jk,jl,jf) = ARRAY_IN(nn_hls+1,jj,jk,jl,jf)
+                     END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+
+                  CASE ( jpfillcst   )
+                     DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = 1, nn_hls
+                        ARRAY_IN(ji,jj,jk,jl,jf) = zland
+                     END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+               END SELECT
+            END IF
+            IF(noser .eq. -1) THEN
+               ishift = jpi - nn_hls
+               SELECT CASE ( ifill_eab )
+                  CASE ( jpfillperio )
+                     DO jf = 1, ipf  ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = 1, nn_hls
+                        ARRAY_IN(ishift+ji,jj,jk,jl,jf) = ARRAY_IN(ji+nn_hls,jj,jk,jl,jf)
+                     END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+
+                  CASE ( jpfillcopy  )
+                     DO jf = 1, ipf  ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = 1, nn_hls
+                        ARRAY_IN(ishift+ji,jj,jk,jl,jf) = ARRAY_IN(ishift,jj,jk,jl,jf)
+                     END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+                  CASE ( jpfillcst   )
+                     DO jf = 1, ipf  ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = 1, nn_hls
+                        ARRAY_IN(ishift+ji,jj,jk,jl,jf) = zland
+                     END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+               END SELECT
+            END IF
+         CASE ( jpfillperio )                 ! use north-south periodicity
+            ishift2 = jpj - 2 * nn_hls
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi
+               ARRAY_IN(ji,jj,jk,jl,jf) = ARRAY_IN(ji,ishift2+jj,jk,jl,jf)
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+         CASE ( jpfillcopy  )                 ! filling with inner domain values
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi
+               ARRAY_IN(ji,jj,jk,jl,jf) = ARRAY_IN(ji,nn_hls+1,jk,jl,jf)
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+         CASE ( jpfillcst   )                 ! filling with constant value
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi
+               ARRAY_IN(ji,jj,jk,jl,jf) = zland
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+         END SELECT
+      ELSE
+         ! ----------------------
+         ! 2.3 fill southern halo
+         ! ----------------------
+         SELECT CASE ( ifill_so )
+         CASE ( jpfillnothing )               ! no filling 
+         CASE ( jpfillmpi   )                 ! use data received by MPI 
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = nn_hls + 1, jpi - nn_hls
+               ARRAY_IN(ji,jj,jk,jl,jf) = zrcv(idx)   ! 1 -> nn_hls
+               idx = idx + 1
+            END DO;   END DO   ;   END DO   ;   END DO   ;   END DO
+            IF(noswr .eq. -1) THEN
+               SELECT CASE ( ifill_web )
+                  CASE ( jpfillperio )
+                     ishift2 = jpi - 2 * nn_hls
+                     DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = 1, nn_hls
+                        ARRAY_IN(ji,jj,jk,jl,jf) = ARRAY_IN(ishift2+ji,jj,jk,jl,jf)
+                     END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+                  CASE ( jpfillcopy  )
+                     DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = 1, nn_hls
+                        ARRAY_IN(ji,jj,jk,jl,jf) = ARRAY_IN(nn_hls+1,jj,jk,jl,jf)
+                     END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+
+                  CASE ( jpfillcst   )
+                     DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = 1, nn_hls
+                        ARRAY_IN(ji,jj,jk,jl,jf) = zland
+                     END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+               END SELECT
+            END IF
+            IF(noser .eq. -1) THEN
+               ishift = jpi - nn_hls
+               SELECT CASE ( ifill_eab )
+                  CASE ( jpfillperio )
+                     DO jf = 1, ipf  ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = 1, nn_hls
+                        ARRAY_IN(ishift+ji,jj,jk,jl,jf) = ARRAY_IN(ji+nn_hls,jj,jk,jl,jf)
+                     END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+
+                  CASE ( jpfillcopy  )
+                     DO jf = 1, ipf  ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = 1, nn_hls
+                        ARRAY_IN(ishift+ji,jj,jk,jl,jf) = ARRAY_IN(ishift,jj,jk,jl,jf)
+                     END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+                  CASE ( jpfillcst   )
+                     DO jf = 1, ipf  ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = 1, nn_hls
+                        ARRAY_IN(ishift+ji,jj,jk,jl,jf) = zland
+                     END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+               END SELECT
+            END IF
+         CASE ( jpfillperio )                 ! use north-south periodicity
+            ishift2 = jpj - 2 * nn_hls
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi
+               ARRAY_IN(ji,jj,jk,jl,jf) = ARRAY_IN(ji,ishift2+jj,jk,jl,jf)
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+         CASE ( jpfillcopy  )                 ! filling with inner domain values
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi
+               ARRAY_IN(ji,jj,jk,jl,jf) = ARRAY_IN(ji,nn_hls+1,jk,jl,jf)
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+         CASE ( jpfillcst   )                 ! filling with constant value
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi
+               ARRAY_IN(ji,jj,jk,jl,jf) = zland
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+         END SELECT
+
+         ! ----------------------
+         ! 2.4 fill northern halo
+         ! ----------------------
+         ishift = jpj - nn_hls                ! fill halo from jj = jpj-nn_hls+1 to jpj 
+         SELECT CASE ( ifill_no )
+         CASE ( jpfillnothing )               ! no filling 
+         CASE ( jpfillmpi   )                 ! use data received by MPI 
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = nn_hls + 1, jpi - nn_hls
+               ARRAY_IN(ji,ishift+jj,jk,jl,jf) = zrcv(idx)   ! jpj-nn_hls+1 -> jpj
+               idx = idx + 1
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+            IF(nonwr .eq. -1) THEN
+               ishift = jpj - nn_hls
+               SELECT CASE ( ifill_web )
+                  CASE ( jpfillperio )
+                     ishift2 = jpi - 2 * nn_hls
+                     DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1 + ishift, jpj   ;  DO ji = 1, nn_hls
+                        ARRAY_IN(ji,jj,jk,jl,jf) = ARRAY_IN(ishift2+ji,jj,jk,jl,jf)
+                     END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+                  CASE ( jpfillcopy  )
+                     DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1 + ishift, jpj   ;  DO ji = 1, nn_hls
+                        ARRAY_IN(ji,jj,jk,jl,jf) = ARRAY_IN(nn_hls+1,jj,jk,jl,jf)
+                     END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+
+                  CASE ( jpfillcst   )
+                     DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1 + ishift, jpj   ;  DO ji = 1, nn_hls
+                        ARRAY_IN(ji,jj,jk,jl,jf) = zland
+                     END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+               END SELECT
+            END IF
+            IF(noner .eq. -1) THEN
+               ishift = jpi - nn_hls
+               ishift2 = jpj - nn_hls
+               SELECT CASE ( ifill_eab )
+                  CASE ( jpfillperio )
+                     DO jf = 1, ipf  ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1 + ishift2, jpj   ;  DO ji = 1, nn_hls
+                        ARRAY_IN(ishift+ji,jj,jk,jl,jf) = ARRAY_IN(ji,jj,jk,jl,jf)
+                     END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+
+                  CASE ( jpfillcopy  )
+                     DO jf = 1, ipf  ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1 + ishift2, jpj   ;  DO ji = 1, nn_hls
+                        ARRAY_IN(ishift+ji,jj,jk,jl,jf) = ARRAY_IN(ishift,jj,jk,jl,jf)
+                     END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+                  CASE ( jpfillcst   )
+                     DO jf = 1, ipf  ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1 + ishift2, jpj   ;  DO ji = 1, nn_hls
+                        ARRAY_IN(ishift+ji,jj,jk,jl,jf) = zland
+                     END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+               END SELECT
+            END IF
+         CASE ( jpfillperio )                 ! use north-south periodicity
+            ishift2 = nn_hls
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi
+               ARRAY_IN(ji,ishift+jj,jk,jl,jf) = ARRAY_IN(ji,ishift2+jj,jk,jl,jf)
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+         CASE ( jpfillcopy  )                 ! filling with inner domain values
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi
+               ARRAY_IN(ji,ishift+jj,jk,jl,jf) = ARRAY_IN(ji,ishift,jk,jl,jf)
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+         CASE ( jpfillcst   )                 ! filling with constant value
+            DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi
+               ARRAY_IN(ji,ishift+jj,jk,jl,jf) = zland
+            END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+         END SELECT
+      ENDIF
+
+      IF(llncall) THEN
+
+         !!! Patch to solve MPI3 bug when we have only two processes columns
+         IF(jpni .eq. 2) THEN
+            !!! Patch to solve MPI3 bug when we have only two processes rows
+            IF(jpnj .eq. 2) THEN
+               ! ---------------------------
+               ! 2.5 fill east-nouthern halo
+               ! ---------------------------
+                 IF(noner .ne. -1) THEN
+                    ishift = jpi - nn_hls
+                    ishift2 = jpj - nn_hls
+                    DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = 1, nn_hls
+                       ARRAY_IN(ji+ishift,jj+ishift2,jk,jl,jf) = zrcv(idx)
+                       idx = idx + 1
+                    END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+                 END IF
+               ! ---------------------------
+               ! 2.6 fill west-nouthern halo
+               ! ---------------------------
+                 IF(nonwr .ne. -1) THEN
+                    ishift = jpj - nn_hls
+                    DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = 1, nn_hls
+                       ARRAY_IN(ji,jj+ishift,jk,jl,jf) = zrcv(idx)
+                       idx = idx + 1
+                    END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+                 END IF
+               ! ---------------------------
+               ! 2.7 fill east-southern halo
+               ! ---------------------------
+                 IF(noser .ne. -1) THEN
+                    ishift = jpi - nn_hls
+                    DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = 1, nn_hls
+                       ARRAY_IN(ji+ishift,jj,jk,jl,jf) = zrcv(idx)
+                       idx = idx + 1
+                    END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+                 END IF
+               ! ---------------------------
+               ! 2.8 fill west-southern halo
+               ! ---------------------------
+                 IF(noswr .ne. -1) THEN
+                    DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = 1, nn_hls
+                       ARRAY_IN(ji,jj,jk,jl,jf) = zrcv(idx)
+                       idx = idx + 1
+                    END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+                 END IF
+
+            ELSE
+               ! ---------------------------
+               ! 2.5 fill east-southern halo
+               ! ---------------------------
+                 IF(noser .ne. -1) THEN
+                    ishift = jpi - nn_hls
+                    DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = 1, nn_hls
+                       ARRAY_IN(ji+ishift,jj,jk,jl,jf) = zrcv(idx)
+                       idx = idx + 1
+                    END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+                 END IF
+               ! ---------------------------
+               ! 2.6 fill west-southern halo
+               ! ---------------------------
+                 IF(noswr .ne. -1) THEN
+                    DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = 1, nn_hls
+                       ARRAY_IN(ji,jj,jk,jl,jf) = zrcv(idx)
+                       idx = idx + 1
+                    END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+                 END IF
+               ! ---------------------------
+               ! 2.7 fill east-nouthern halo
+               ! ---------------------------
+                 IF(noner .ne. -1) THEN
+                    ishift = jpi - nn_hls
+                    ishift2 = jpj - nn_hls
+                    DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = 1, nn_hls
+                       ARRAY_IN(ji+ishift,jj+ishift2,jk,jl,jf) = zrcv(idx)
+                       idx = idx + 1
+                    END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+                 END IF
+               ! ---------------------------
+               ! 2.8 fill west-nouthern halo
+               ! ---------------------------
+                 IF(nonwr .ne. -1) THEN
+                    ishift = jpj - nn_hls
+                    DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = 1, nn_hls
+                       ARRAY_IN(ji,jj+ishift,jk,jl,jf) = zrcv(idx)
+                       idx = idx + 1
+                    END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+                 END IF
+            ENDIF
+         ELSE
+            !!! Patch to solve MPI3 bug when we have only two processes rows
+            IF(jpnj .eq. 2) THEN
+               ! ---------------------------
+               ! 2.5 fill west-nouthern halo
+               ! ---------------------------
+                 IF(nonwr .ne. -1) THEN
+                    ishift = jpj - nn_hls
+                    DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = 1, nn_hls
+                       ARRAY_IN(ji,jj+ishift,jk,jl,jf) = zrcv(idx)
+                       idx = idx + 1
+                    END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+                 END IF
+               ! ---------------------------
+               ! 2.6 fill east-nouthern halo
+               ! ---------------------------
+                 IF(noner .ne. -1) THEN
+                    ishift = jpi - nn_hls
+                    ishift2 = jpj - nn_hls
+                    DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = 1, nn_hls
+                       ARRAY_IN(ji+ishift,jj+ishift2,jk,jl,jf) = zrcv(idx)
+                       idx = idx + 1
+                    END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+                 END IF
+               ! ---------------------------
+               ! 2.7 fill west-southern halo
+               ! ---------------------------
+                 IF(noswr .ne. -1) THEN
+                    DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = 1, nn_hls
+                       ARRAY_IN(ji,jj,jk,jl,jf) = zrcv(idx)
+                       idx = idx + 1
+                    END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+                 END IF
+               ! ---------------------------
+               ! 2.8 fill east-southern halo
+               ! ---------------------------
+                 IF(noser .ne. -1) THEN
+                    ishift = jpi - nn_hls
+                    DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = 1, nn_hls
+                       ARRAY_IN(ji+ishift,jj,jk,jl,jf) = zrcv(idx)
+                       idx = idx + 1
+                    END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+                 END IF
+
+            ELSE
+               ! ---------------------------
+               ! 2.5 fill west-southern halo
+               ! ---------------------------
+                 IF(noswr .ne. -1) THEN
+                    DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = 1, nn_hls
+                       ARRAY_IN(ji,jj,jk,jl,jf) = zrcv(idx)
+                       idx = idx + 1
+                    END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+                 END IF
+               ! ---------------------------
+               ! 2.6 fill east-southern halo
+               ! ---------------------------
+                 IF(noser .ne. -1) THEN
+                    ishift = jpi - nn_hls
+                    DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = 1, nn_hls
+                       ARRAY_IN(ji+ishift,jj,jk,jl,jf) = zrcv(idx)
+                       idx = idx + 1
+                    END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+                 END IF
+               ! ---------------------------
+               ! 2.7 fill west-nouthern halo
+               ! ---------------------------
+                 IF(nonwr .ne. -1) THEN
+                    ishift = jpj - nn_hls
+                    DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = 1, nn_hls
+                       ARRAY_IN(ji,jj+ishift,jk,jl,jf) = zrcv(idx)
+                       idx = idx + 1
+                    END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+                 END IF
+               ! ---------------------------
+               ! 2.8 fill east-nouthern halo
+               ! ---------------------------
+                 IF(noner .ne. -1) THEN
+                    ishift = jpi - nn_hls
+                    ishift2 = jpj - nn_hls
+                    DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;  DO ji = 1, nn_hls
+                       ARRAY_IN(ji+ishift,jj+ishift2,jk,jl,jf) = zrcv(idx)
+                       idx = idx + 1
+                    END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
+                 END IF
+            ENDIF
+         END IF
+      END IF
+
+
+      !
+      ! -------------------------------------------- !
+      !     3. deallocate local temporary arrays     !
+      ! -------------------------------------------- !
+      !
+      DEALLOCATE( zsnd )
+      DEALLOCATE( zrcv )
+      DEALLOCATE(isizes)
+      DEALLOCATE(isizer)
+      DEALLOCATE(idatatys)
+      DEALLOCATE(idatatyr)
+      DEALLOCATE(idispls)
+      DEALLOCATE(idisplr)
+      !
+      ! ------------------------------- !
+      !     4. north fold treatment     !
+      ! ------------------------------- !
+      !
+      IF( lldo_nfd .AND. ifill_no /= jpfillnothing ) THEN
+         !
+         SELECT CASE ( jpni )
+         CASE ( 1 )     ;   CALL lbc_nfd( ptab, NAT_IN(:), SGN_IN(:)                  OPT_K(:) )   ! only 1 northern proc, no mpp
+         CASE DEFAULT   ;   CALL mpp_nfd( ptab, NAT_IN(:), SGN_IN(:), ifill_no, zland OPT_K(:) )   ! for all northern procs.
+         END SELECT
+         !
+         ifill_no = jpfillnothing  ! force to do nothing for the northern halo as we just done the north pole folding
+         !
+      ENDIF
+
+   END SUBROUTINE ROUTINE_NC
+
+#undef PRECISION
+#undef ARRAY_TYPE
+#undef NAT_IN
+#undef SGN_IN
+#undef ARRAY_IN
+#undef K_SIZE
+#undef L_SIZE
+#undef F_SIZE
+#undef OPT_K
+#undef MPI_TYPE
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/LBC/mppini.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/LBC/mppini.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/LBC/mppini.F90	(revision 14012)
@@ -542,9 +542,4 @@
       ij = ijn(narea)
       !
-      ! set default neighbours
-      noso = ii_noso(narea)
-      nowe = ii_nowe(narea)
-      noea = ii_noea(narea)
-      nono = ii_nono(narea)
       jpi    = ijpi(ii,ij)  
 !!$      Nis0  = iis0(ii,ij)
@@ -558,4 +553,63 @@
       njmpp = ijmppt(ii,ij)
       jpk = jpkglo                              ! third dim
+
+      ! set default neighbours
+      noso = ii_noso(narea)
+      nowe = ii_nowe(narea)
+      noea = ii_noea(narea)
+      nono = ii_nono(narea)
+
+      nones = -1
+      nonws = -1
+      noses = -1
+      nosws = -1
+      
+      noner = -1
+      nonwr = -1
+      noser = -1
+      noswr = -1
+
+      IF((nbondi .eq. -1) .or. (nbondi .eq. 0)) THEN ! east neighbour exists
+         IF(ibondj(iin(noea+1),ijn(noea+1)) .eq. 0) THEN
+            nones = ii_nono(noea+1)                  ! east neighbour has north and south neighbours
+            noses = ii_noso(noea+1)
+         ELSEIF(ibondj(iin(noea+1),ijn(noea+1)) .eq. -1) THEN
+            nones = ii_nono(noea+1)                  ! east neighbour has north neighbour
+         ELSEIF(ibondj(iin(noea+1),ijn(noea+1)) .eq. 1) THEN
+            noses = ii_noso(noea+1)                  ! east neighbour has south neighbour
+         END IF
+      END IF
+      IF((nbondi .eq. 1) .or. (nbondi .eq. 0)) THEN  ! west neighbour exists
+         IF(ibondj(iin(nowe+1),ijn(nowe+1)) .eq. 0) THEN
+            nonws = ii_nono(nowe+1)                  ! west neighbour has north and south neighbours
+            nosws = ii_noso(nowe+1)
+         ELSEIF(ibondj(iin(nowe+1),ijn(nowe+1)) .eq. -1) THEN
+            nonws = ii_nono(nowe+1)                  ! west neighbour has north neighbour
+         ELSEIF(ibondj(iin(nowe+1),ijn(nowe+1)) .eq. 1)  THEN
+            nosws = ii_noso(nowe+1)                  ! west neighbour has north neighbour
+         END IF
+      END IF
+
+      IF((nbondj .eq. -1) .or. (nbondj .eq. 0)) THEN ! north neighbour exists
+         IF(ibondi(iin(nono+1),ijn(nono+1)) .eq. 0) THEN
+            noner = ii_noea(nono+1)                  ! north neighbour has east and west neighbours
+            nonwr = ii_nowe(nono+1)
+         ELSEIF(ibondi(iin(nono+1),ijn(nono+1)) .eq. -1) THEN
+            noner = ii_noea(nono+1)                  ! north neighbour has east neighbour
+         ELSEIF(ibondi(iin(nono+1),ijn(nono+1)) .eq. 1) THEN
+            nonwr = ii_nowe(nono+1)                  ! north neighbour has west neighbour
+         END IF
+      END IF
+      IF((nbondj .eq. 1) .or. (nbondj .eq. 0)) THEN  ! south neighbour exists
+         IF(ibondi(iin(noso+1),ijn(noso+1)) .eq. 0) THEN
+            noser = ii_noea(noso+1)                  ! south neighbour has east and west neighbours
+            noswr = ii_nowe(noso+1)
+         ELSEIF(ibondi(iin(noso+1),ijn(noso+1)) .eq. -1) THEN
+            noser = ii_noea(noso+1)                  ! south neighbour has east neighbour
+         ELSEIF(ibondi(iin(noso+1),ijn(noso+1)) .eq. 1) THEN
+            noswr = ii_nowe(noso+1)                  ! south neighbour has west neighbour
+         END IF
+      END IF
+
       !
       CALL init_doloop                          ! set start/end indices of do-loop, depending on the halo width value (nn_hls) 
@@ -648,4 +702,7 @@
          ENDIF
       ENDIF
+
+      !
+      CALL mpp_ini_nc        ! Initialize communicator for neighbourhood collective communications
       !
       CALL init_ioipsl       ! Prepare NetCDF output file (if necessary)
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/LDF/ldfc1d_c2d.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/LDF/ldfc1d_c2d.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/LDF/ldfc1d_c2d.F90	(revision 14012)
@@ -140,5 +140,6 @@
          END_2D
       CASE( 'TRA' )                       ! U- and V-points
-         DO_2D( 1, 1, 1, 1 )
+         ! NOTE: [tiling-comms-merge] Change needed to preserve results with respect to the trunk
+         DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
             pah1(ji,jj,1) = pUfac * MAX( e1u(ji,jj), e2u(ji,jj) )**knn
             pah2(ji,jj,1) = pUfac * MAX( e1v(ji,jj), e2v(ji,jj) )**knn
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/LDF/ldftra.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/LDF/ldftra.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/LDF/ldftra.F90	(revision 14012)
@@ -427,5 +427,6 @@
          zaht_min = 0.2_wp * aht0                                       ! minimum value for aht
          zDaht    = aht0 - zaht_min                                      
-         DO_2D( 1, 1, 1, 1 )
+         ! NOTE: [tiling-comms-merge] Change needed to preserve results with respect to the trunk
+         DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
             !!gm CAUTION : here we assume lat/lon grid in 20deg N/S band (like all ORCA cfg)
             !!     ==>>>   The Coriolis value is identical for t- & u_points, and for v- and f-points
@@ -725,22 +726,24 @@
       !! ** Action  : pu, pv increased by the eiv transport
       !!----------------------------------------------------------------------
-      INTEGER                         , INTENT(in   ) ::   kt        ! ocean time-step index
-      INTEGER                         , INTENT(in   ) ::   kit000    ! first time step index
-      INTEGER                         , INTENT(in   ) ::   Kmm, Krhs ! ocean time level indices
-      CHARACTER(len=3)                , INTENT(in   ) ::   cdtype    ! =TRA or TRC (tracer indicator)
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   pu      ! in : 3 ocean transport components   [m3/s]
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   pv      ! out: 3 ocean transport components   [m3/s]
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   pw      ! increased by the eiv                [m3/s]
+      INTEGER                     , INTENT(in   ) ::   kt        ! ocean time-step index
+      INTEGER                     , INTENT(in   ) ::   kit000    ! first time step index
+      INTEGER                     , INTENT(in   ) ::   Kmm, Krhs ! ocean time level indices
+      CHARACTER(len=3)            , INTENT(in   ) ::   cdtype    ! =TRA or TRC (tracer indicator)
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk), INTENT(inout) ::   pu        ! in : 3 ocean transport components   [m3/s]
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk), INTENT(inout) ::   pv        ! out: 3 ocean transport components   [m3/s]
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk), INTENT(inout) ::   pw        ! increased by the eiv                [m3/s]
       !!
       INTEGER  ::   ji, jj, jk                 ! dummy loop indices
       REAL(wp) ::   zuwk, zuwk1, zuwi, zuwi1   ! local scalars
       REAL(wp) ::   zvwk, zvwk1, zvwj, zvwj1   !   -      -
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zpsi_uw, zpsi_vw
-      !!----------------------------------------------------------------------
-      !
-      IF( kt == kit000 )  THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'ldf_eiv_trp : eddy induced advection on ', cdtype,' :'
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~   add to velocity fields the eiv component'
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk) ::   zpsi_uw, zpsi_vw
+      !!----------------------------------------------------------------------
+      !
+      IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile
+         IF( kt == kit000 )  THEN
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) 'ldf_eiv_trp : eddy induced advection on ', cdtype,' :'
+            IF(lwp) WRITE(numout,*) '~~~~~~~~~~~   add to velocity fields the eiv component'
+         ENDIF
       ENDIF
 
@@ -781,11 +784,11 @@
       !!
       !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   psi_uw, psi_vw   ! streamfunction   [m3/s]
-      INTEGER                         , INTENT(in   ) ::   Kmm   ! ocean time level indices
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk), INTENT(inout) ::   psi_uw, psi_vw   ! streamfunction   [m3/s]
+      INTEGER                     , INTENT(in   ) ::   Kmm   ! ocean time level indices
       !
       INTEGER  ::   ji, jj, jk    ! dummy loop indices
       REAL(wp) ::   zztmp   ! local scalar
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zw2d   ! 2D workspace
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zw3d   ! 3D workspace
+      REAL(wp), DIMENSION(A2D(nn_hls))     ::   zw2d   ! 2D workspace
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk) ::   zw3d   ! 3D workspace
       !!----------------------------------------------------------------------
       !
@@ -793,6 +796,4 @@
 !!gm     to be redesigned....   
       !                                                  !==  eiv stream function: output  ==!
-      CALL lbc_lnk_multi( 'ldftra', psi_uw, 'U', -1.0_wp , psi_vw, 'V', -1.0_wp )
-      !
 !!gm      CALL iom_put( "psi_eiv_uw", psi_uw )                 ! output
 !!gm      CALL iom_put( "psi_eiv_vw", psi_vw )
@@ -802,12 +803,12 @@
       zw3d(:,:,jpk) = 0._wp                                    ! bottom value always 0
       !
-      DO jk = 1, jpkm1                                         ! e2u e3u u_eiv = -dk[psi_uw]
-         zw3d(:,:,jk) = ( psi_uw(:,:,jk+1) - psi_uw(:,:,jk) ) / ( e2u(:,:) * e3u(:,:,jk,Kmm) )
-      END DO
+      DO_3D( 0, 0, 0, 0, 1, jpkm1 )                                  ! e2u e3u u_eiv = -dk[psi_uw]
+         zw3d(ji,jj,jk) = ( psi_uw(ji,jj,jk+1) - psi_uw(ji,jj,jk) ) / ( e2u(ji,jj) * e3u(ji,jj,jk,Kmm) )
+      END_3D
       CALL iom_put( "uoce_eiv", zw3d )
       !
-      DO jk = 1, jpkm1                                         ! e1v e3v v_eiv = -dk[psi_vw]
-         zw3d(:,:,jk) = ( psi_vw(:,:,jk+1) - psi_vw(:,:,jk) ) / ( e1v(:,:) * e3v(:,:,jk,Kmm) )
-      END DO
+      DO_3D( 0, 0, 0, 0, 1, jpkm1 )                                  ! e1v e3v v_eiv = -dk[psi_vw]
+         zw3d(ji,jj,jk) = ( psi_vw(ji,jj,jk+1) - psi_vw(ji,jj,jk) ) / ( e1v(ji,jj) * e3v(ji,jj,jk,Kmm) )
+      END_3D
       CALL iom_put( "voce_eiv", zw3d )
       !
@@ -816,9 +817,10 @@
             &              + psi_uw(ji,jj,jk) - psi_uw(ji-1,jj  ,jk)  ) / e1e2t(ji,jj)
       END_3D
-      CALL lbc_lnk( 'ldftra', zw3d, 'T', 1.0_wp )      ! lateral boundary condition
       CALL iom_put( "woce_eiv", zw3d )
       !
       IF( iom_use('weiv_masstr') ) THEN   ! vertical mass transport & its square value
-         zw2d(:,:) = rho0 * e1e2t(:,:)
+         DO_2D( 0, 0, 0, 0 )
+            zw2d(ji,jj) = rho0 * e1e2t(ji,jj)
+         END_2D
          DO jk = 1, jpk
             zw3d(:,:,jk) = zw3d(:,:,jk) * zw2d(:,:)
@@ -844,6 +846,4 @@
            zw2d(ji,jj) = zw2d(ji,jj) + zw3d(ji,jj,jk)
         END_3D
-        CALL lbc_lnk( 'ldftra', zw2d, 'U', -1.0_wp )
-        CALL lbc_lnk( 'ldftra', zw3d, 'U', -1.0_wp )
         CALL iom_put( "ueiv_heattr"  , zztmp * zw2d )                  ! heat transport in i-direction
         CALL iom_put( "ueiv_heattr3d", zztmp * zw3d )                  ! heat transport in i-direction
@@ -865,7 +865,6 @@
          zw2d(ji,jj) = zw2d(ji,jj) + zw3d(ji,jj,jk)
       END_3D
-      CALL lbc_lnk( 'ldftra', zw2d, 'V', -1.0_wp )
-      CALL iom_put( "veiv_heattr", zztmp * zw2d )                  !  heat transport in j-direction
-      CALL iom_put( "veiv_heattr", zztmp * zw3d )                  !  heat transport in j-direction
+      CALL iom_put( "veiv_heattr"  , zztmp * zw2d )                  !  heat transport in j-direction
+      CALL iom_put( "veiv_heattr3d", zztmp * zw3d )                  !  heat transport in j-direction
       !
       IF( iom_use( 'sophteiv' ) )   CALL dia_ptr_hst( jp_tem, 'eiv', 0.5 * zw3d )
@@ -880,6 +879,4 @@
            zw2d(ji,jj) = zw2d(ji,jj) + zw3d(ji,jj,jk)
         END_3D
-        CALL lbc_lnk( 'ldftra', zw2d, 'U', -1.0_wp )
-        CALL lbc_lnk( 'ldftra', zw3d, 'U', -1.0_wp )
         CALL iom_put( "ueiv_salttr", zztmp * zw2d )                  ! salt transport in i-direction
         CALL iom_put( "ueiv_salttr3d", zztmp * zw3d )                ! salt transport in i-direction
@@ -892,7 +889,6 @@
          zw2d(ji,jj) = zw2d(ji,jj) + zw3d(ji,jj,jk)
       END_3D
-      CALL lbc_lnk( 'ldftra', zw2d, 'V', -1.0_wp )
-      CALL iom_put( "veiv_salttr", zztmp * zw2d )                  !  salt transport in j-direction
-      CALL iom_put( "veiv_salttr", zztmp * zw3d )                  !  salt transport in j-direction
+      CALL iom_put( "veiv_salttr"  , zztmp * zw2d )                  !  salt transport in j-direction
+      CALL iom_put( "veiv_salttr3d", zztmp * zw3d )                  !  salt transport in j-direction
       !
       IF( iom_use( 'sopsteiv' ) ) CALL dia_ptr_hst( jp_sal, 'eiv', 0.5 * zw3d )
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/SBC/sbcapr.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/SBC/sbcapr.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/SBC/sbcapr.F90	(revision 14012)
@@ -65,5 +65,4 @@
       CHARACTER(len=100) ::  cn_dir   ! Root directory for location of ssr files
       TYPE(FLD_N)        ::  sn_apr   ! informations about the fields to be read
-      LOGICAL            ::  lrxios   ! read restart using XIOS?
       !!
       NAMELIST/namsbc_apr/ cn_dir, sn_apr, ln_ref_apr, rn_pref, ln_apr_obc
@@ -108,7 +107,4 @@
             CALL ctl_warn( 'sbc_apr: use inverse barometer ssh at open boundary ONLY requires ln_apr_dyn=T' )
       !
-      IF( lwxios ) THEN
-         CALL iom_set_rstw_var_active('ssh_ibb')
-      ENDIF
    END SUBROUTINE sbc_apr_init
 
@@ -154,5 +150,5 @@
          IF( ln_rstart .AND. iom_varid( numror, 'ssh_ibb', ldstop = .FALSE. ) > 0 ) THEN 
             IF(lwp) WRITE(numout,*) 'sbc_apr:   ssh_ibb read in the restart file'
-            CALL iom_get( numror, jpdom_auto, 'ssh_ibb', ssh_ibb, ldxios = lrxios )   ! before inv. barometer ssh
+            CALL iom_get( numror, jpdom_auto, 'ssh_ibb', ssh_ibb )   ! before inv. barometer ssh
             !
          ELSE                                         !* no restart: set from nit000 values
@@ -167,7 +163,5 @@
          IF(lwp) WRITE(numout,*) 'sbc_apr : ssh_ib written in ocean restart file at it= ', kt,' date= ', ndastp
          IF(lwp) WRITE(numout,*) '~~~~'
-         IF( lwxios ) CALL iom_swap(      cwxios_context          )
-         CALL iom_rstput( kt, nitrst, numrow, 'ssh_ibb' , ssh_ib, ldxios = lwxios )
-         IF( lwxios ) CALL iom_swap(      cxios_context          )
+         CALL iom_rstput( kt, nitrst, numrow, 'ssh_ibb' , ssh_ib )
       ENDIF
       !
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/SBC/sbcflx.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/SBC/sbcflx.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/SBC/sbcflx.F90	(revision 14012)
@@ -127,5 +127,5 @@
 
          IF( ln_dm2dc ) THEN   ! modify now Qsr to include the diurnal cycle
-            qsr(:,:) = sbc_dcy( sf(jp_qsr)%fnow(:,:,1) ) * tmask(ji,jj,1)
+            qsr(:,:) = sbc_dcy( sf(jp_qsr)%fnow(:,:,1) ) * tmask(:,:,1)
          ELSE
             DO_2D( 0, 0, 0, 0 )
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/SBC/sbcmod.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/SBC/sbcmod.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/SBC/sbcmod.F90	(revision 14012)
@@ -359,14 +359,4 @@
       IF( ln_wave     )   CALL sbc_wave_init                     ! surface wave initialisation
       !
-      IF( lwxios ) THEN
-         CALL iom_set_rstw_var_active('utau_b')
-         CALL iom_set_rstw_var_active('vtau_b')
-         CALL iom_set_rstw_var_active('qns_b')
-         ! The 3D heat content due to qsr forcing is treated in traqsr
-         ! CALL iom_set_rstw_var_active('qsr_b')
-         CALL iom_set_rstw_var_active('emp_b')
-         CALL iom_set_rstw_var_active('sfx_b')
-      ENDIF
-
    END SUBROUTINE sbc_init
 
@@ -510,13 +500,13 @@
             & iom_varid( numror, 'utau_b', ldstop = .FALSE. ) > 0 ) THEN
             IF(lwp) WRITE(numout,*) '          nit000-1 surface forcing fields red in the restart file'
-            CALL iom_get( numror, jpdom_auto, 'utau_b', utau_b, ldxios = lrxios, cd_type = 'U', psgn = -1._wp )   ! before i-stress  (U-point)
-            CALL iom_get( numror, jpdom_auto, 'vtau_b', vtau_b, ldxios = lrxios, cd_type = 'V', psgn = -1._wp )   ! before j-stress  (V-point)
-            CALL iom_get( numror, jpdom_auto,  'qns_b',  qns_b, ldxios = lrxios )   ! before non solar heat flux (T-point)
+            CALL iom_get( numror, jpdom_auto, 'utau_b', utau_b )   ! before i-stress  (U-point)
+            CALL iom_get( numror, jpdom_auto, 'vtau_b', vtau_b )   ! before j-stress  (V-point)
+            CALL iom_get( numror, jpdom_auto,  'qns_b',  qns_b )   ! before non solar heat flux (T-point)
             ! The 3D heat content due to qsr forcing is treated in traqsr
-            ! CALL iom_get( numror, jpdom_auto, 'qsr_b' , qsr_b, ldxios = lrxios  ) ! before     solar heat flux (T-point)
-            CALL iom_get( numror, jpdom_auto, 'emp_b', emp_b, ldxios = lrxios  )    ! before     freshwater flux (T-point)
+            ! CALL iom_get( numror, jpdom_auto, 'qsr_b' , qsr_b  ) ! before     solar heat flux (T-point)
+            CALL iom_get( numror, jpdom_auto, 'emp_b', emp_b  )    ! before     freshwater flux (T-point)
             ! To ensure restart capability with 3.3x/3.4 restart files    !! to be removed in v3.6
             IF( iom_varid( numror, 'sfx_b', ldstop = .FALSE. ) > 0 ) THEN
-               CALL iom_get( numror, jpdom_auto, 'sfx_b', sfx_b, ldxios = lrxios )  ! before salt flux (T-point)
+               CALL iom_get( numror, jpdom_auto, 'sfx_b', sfx_b )  ! before salt flux (T-point)
             ELSE
                sfx_b (:,:) = sfx(:,:)
@@ -538,13 +528,11 @@
             &                    'at it= ', kt,' date= ', ndastp
          IF(lwp) WRITE(numout,*) '~~~~'
-         IF( lwxios ) CALL iom_swap(      cwxios_context          )
-         CALL iom_rstput( kt, nitrst, numrow, 'utau_b' , utau, ldxios = lwxios )
-         CALL iom_rstput( kt, nitrst, numrow, 'vtau_b' , vtau, ldxios = lwxios )
-         CALL iom_rstput( kt, nitrst, numrow, 'qns_b'  , qns, ldxios = lwxios  )
+         CALL iom_rstput( kt, nitrst, numrow, 'utau_b' , utau )
+         CALL iom_rstput( kt, nitrst, numrow, 'vtau_b' , vtau )
+         CALL iom_rstput( kt, nitrst, numrow, 'qns_b'  , qns  )
          ! The 3D heat content due to qsr forcing is treated in traqsr
          ! CALL iom_rstput( kt, nitrst, numrow, 'qsr_b'  , qsr  )
-         CALL iom_rstput( kt, nitrst, numrow, 'emp_b'  , emp, ldxios = lwxios  )
-         CALL iom_rstput( kt, nitrst, numrow, 'sfx_b'  , sfx, ldxios = lwxios  )
-         IF( lwxios ) CALL iom_swap(      cxios_context          )
+         CALL iom_rstput( kt, nitrst, numrow, 'emp_b'  , emp  )
+         CALL iom_rstput( kt, nitrst, numrow, 'sfx_b'  , sfx  )
       ENDIF
       !                                                ! ---------------------------------------- !
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/SBC/sbcrnf.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/SBC/sbcrnf.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/SBC/sbcrnf.F90	(revision 14012)
@@ -160,7 +160,7 @@
             & iom_varid( numror, 'rnf_b', ldstop = .FALSE. ) > 0 ) THEN
             IF(lwp) WRITE(numout,*) '          nit000-1 runoff forcing fields red in the restart file', lrxios
-            CALL iom_get( numror, jpdom_auto, 'rnf_b', rnf_b, ldxios = lrxios )     ! before runoff
-            CALL iom_get( numror, jpdom_auto, 'rnf_hc_b', rnf_tsc_b(:,:,jp_tem), ldxios = lrxios )   ! before heat content of runoff
-            CALL iom_get( numror, jpdom_auto, 'rnf_sc_b', rnf_tsc_b(:,:,jp_sal), ldxios = lrxios )   ! before salinity content of runoff
+            CALL iom_get( numror, jpdom_auto, 'rnf_b', rnf_b )     ! before runoff
+            CALL iom_get( numror, jpdom_auto, 'rnf_hc_b', rnf_tsc_b(:,:,jp_tem) )   ! before heat content of runoff
+            CALL iom_get( numror, jpdom_auto, 'rnf_sc_b', rnf_tsc_b(:,:,jp_sal) )   ! before salinity content of runoff
          ELSE                                                   !* no restart: set from nit000 values
             IF(lwp) WRITE(numout,*) '          nit000-1 runoff forcing fields set to nit000'
@@ -176,9 +176,7 @@
             &                    'at it= ', kt,' date= ', ndastp
          IF(lwp) WRITE(numout,*) '~~~~'
-         IF( lwxios ) CALL iom_swap(      cwxios_context          )
-         CALL iom_rstput( kt, nitrst, numrow, 'rnf_b' , rnf, ldxios = lwxios )
-         CALL iom_rstput( kt, nitrst, numrow, 'rnf_hc_b', rnf_tsc(:,:,jp_tem), ldxios = lwxios )
-         CALL iom_rstput( kt, nitrst, numrow, 'rnf_sc_b', rnf_tsc(:,:,jp_sal), ldxios = lwxios )
-         IF( lwxios ) CALL iom_swap(      cxios_context          )
+         CALL iom_rstput( kt, nitrst, numrow, 'rnf_b' , rnf )
+         CALL iom_rstput( kt, nitrst, numrow, 'rnf_hc_b', rnf_tsc(:,:,jp_tem) )
+         CALL iom_rstput( kt, nitrst, numrow, 'rnf_sc_b', rnf_tsc(:,:,jp_sal) )
       ENDIF
       !
@@ -480,10 +478,4 @@
       ENDIF
       !
-      IF( lwxios ) THEN
-         CALL iom_set_rstw_var_active('rnf_b')
-         CALL iom_set_rstw_var_active('rnf_hc_b')
-         CALL iom_set_rstw_var_active('rnf_sc_b')
-      ENDIF
-
    END SUBROUTINE sbc_rnf_init
 
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/SBC/sbcssm.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/SBC/sbcssm.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/SBC/sbcssm.F90	(revision 14012)
@@ -154,15 +154,13 @@
             IF(lwp) WRITE(numout,*) '~~~~~~~'
             zf_sbc = REAL( nn_fsbc, wp )
-            IF( lwxios ) CALL iom_swap(      cwxios_context          )
-            CALL iom_rstput( kt, nitrst, numrow, 'nn_fsbc', zf_sbc, ldxios = lwxios )    ! sbc frequency
-            CALL iom_rstput( kt, nitrst, numrow, 'ssu_m'  , ssu_m, ldxios = lwxios  )    ! sea surface mean fields
-            CALL iom_rstput( kt, nitrst, numrow, 'ssv_m'  , ssv_m, ldxios = lwxios  )
-            CALL iom_rstput( kt, nitrst, numrow, 'sst_m'  , sst_m, ldxios = lwxios  )
-            CALL iom_rstput( kt, nitrst, numrow, 'sss_m'  , sss_m, ldxios = lwxios  )
-            CALL iom_rstput( kt, nitrst, numrow, 'ssh_m'  , ssh_m, ldxios = lwxios  )
-            CALL iom_rstput( kt, nitrst, numrow, 'e3t_m'  , e3t_m, ldxios = lwxios  )
-            CALL iom_rstput( kt, nitrst, numrow, 'frq_m'  , frq_m, ldxios = lwxios  )
-            !
-            IF( lwxios ) CALL iom_swap(      cxios_context          )
+            CALL iom_rstput( kt, nitrst, numrow, 'nn_fsbc', zf_sbc )    ! sbc frequency
+            CALL iom_rstput( kt, nitrst, numrow, 'ssu_m'  , ssu_m  )    ! sea surface mean fields
+            CALL iom_rstput( kt, nitrst, numrow, 'ssv_m'  , ssv_m  )
+            CALL iom_rstput( kt, nitrst, numrow, 'sst_m'  , sst_m  )
+            CALL iom_rstput( kt, nitrst, numrow, 'sss_m'  , sss_m  )
+            CALL iom_rstput( kt, nitrst, numrow, 'ssh_m'  , ssh_m  )
+            CALL iom_rstput( kt, nitrst, numrow, 'e3t_m'  , e3t_m  )
+            CALL iom_rstput( kt, nitrst, numrow, 'frq_m'  , frq_m  )
+            !
          ENDIF
          !
@@ -208,14 +206,14 @@
          IF( ln_rstart .AND. iom_varid( numror, 'nn_fsbc', ldstop = .FALSE. ) > 0 ) THEN
             l_ssm_mean = .TRUE.
-            CALL iom_get( numror            , 'nn_fsbc', zf_sbc,ldxios = lrxios )     ! sbc frequency of previous run
-            CALL iom_get( numror, jpdom_auto, 'ssu_m'  , ssu_m, ldxios = lrxios, cd_type = 'U', psgn = -1._wp )    ! sea surface mean velocity    (U-point)
-            CALL iom_get( numror, jpdom_auto, 'ssv_m'  , ssv_m, ldxios = lrxios, cd_type = 'V', psgn = -1._wp )    !   "         "    velocity    (V-point)
-            CALL iom_get( numror, jpdom_auto, 'sst_m'  , sst_m, ldxios = lrxios )    !   "         "    temperature (T-point)
-            CALL iom_get( numror, jpdom_auto, 'sss_m'  , sss_m, ldxios = lrxios )    !   "         "    salinity    (T-point)
-            CALL iom_get( numror, jpdom_auto, 'ssh_m'  , ssh_m, ldxios = lrxios )    !   "         "    height      (T-point)
-            CALL iom_get( numror, jpdom_auto, 'e3t_m'  , e3t_m, ldxios = lrxios )    ! 1st level thickness          (T-point)
+            CALL iom_get( numror            , 'nn_fsbc', zf_sbc )     ! sbc frequency of previous run
+            CALL iom_get( numror, jpdom_auto, 'ssu_m'  , ssu_m, cd_type = 'U', psgn = -1._wp )    ! sea surface mean velocity    (U-point)
+            CALL iom_get( numror, jpdom_auto, 'ssv_m'  , ssv_m, cd_type = 'V', psgn = -1._wp )    !   "         "    velocity    (V-point)
+            CALL iom_get( numror, jpdom_auto, 'sst_m'  , sst_m )    !   "         "    temperature (T-point)
+            CALL iom_get( numror, jpdom_auto, 'sss_m'  , sss_m )    !   "         "    salinity    (T-point)
+            CALL iom_get( numror, jpdom_auto, 'ssh_m'  , ssh_m )    !   "         "    height      (T-point)
+            CALL iom_get( numror, jpdom_auto, 'e3t_m'  , e3t_m )    ! 1st level thickness          (T-point)
             ! fraction of solar net radiation absorbed in 1st T level
             IF( iom_varid( numror, 'frq_m', ldstop = .FALSE. ) > 0 ) THEN
-               CALL iom_get( numror, jpdom_auto, 'frq_m'  , frq_m, ldxios = lrxios  )
+               CALL iom_get( numror, jpdom_auto, 'frq_m'  , frq_m  )
             ELSE
                frq_m(:,:) = 1._wp   ! default definition
@@ -255,15 +253,4 @@
       IF( .NOT. ln_traqsr )   fraqsr_1lev(:,:) = 1._wp   ! default definition: qsr 100% in the fisrt level 
       !
-      IF( lwxios.AND.nn_fsbc > 1 ) THEN
-         CALL iom_set_rstw_var_active('nn_fsbc')
-         CALL iom_set_rstw_var_active('ssu_m')
-         CALL iom_set_rstw_var_active('ssv_m')
-         CALL iom_set_rstw_var_active('sst_m')
-         CALL iom_set_rstw_var_active('sss_m')
-         CALL iom_set_rstw_var_active('ssh_m')
-         CALL iom_set_rstw_var_active('e3t_m')
-         CALL iom_set_rstw_var_active('frq_m')
-      ENDIF
-
    END SUBROUTINE sbc_ssm_init
 
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/eosbn2.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/eosbn2.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/eosbn2.F90	(revision 14012)
@@ -39,4 +39,5 @@
    !!----------------------------------------------------------------------
    USE dom_oce        ! ocean space and time domain
+   USE domutl, ONLY : is_tile
    USE phycst         ! physical constants
    USE stopar         ! Stochastic T/S fluctuations
@@ -189,4 +190,14 @@
 
    SUBROUTINE eos_insitu( pts, prd, pdep )
+      !!
+      REAL(wp), DIMENSION(:,:,:,:), INTENT(in   ) ::   pts   ! 1 : potential temperature  [Celsius]
+      !                                                      ! 2 : salinity               [psu]
+      REAL(wp), DIMENSION(:,:,:)  , INTENT(  out) ::   prd   ! in situ density            [-]
+      REAL(wp), DIMENSION(:,:,:)  , INTENT(in   ) ::   pdep  ! depth                      [m]
+      !!
+      CALL eos_insitu_t( pts, is_tile(pts), prd, is_tile(prd), pdep, is_tile(pdep) )
+   END SUBROUTINE eos_insitu
+
+   SUBROUTINE eos_insitu_t( pts, ktts, prd, ktrd, pdep, ktdep )
       !!----------------------------------------------------------------------
       !!                   ***  ROUTINE eos_insitu  ***
@@ -222,8 +233,9 @@
       !!                TEOS-10 Manual, 2010
       !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in   ) ::   pts   ! 1 : potential temperature  [Celsius]
-      !                                                               ! 2 : salinity               [psu]
-      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(  out) ::   prd   ! in situ density            [-]
-      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(in   ) ::   pdep  ! depth                      [m]
+      INTEGER                                 , INTENT(in   ) ::   ktts, ktrd, ktdep
+      REAL(wp), DIMENSION(A2D_T(ktts) ,JPK,JPTS), INTENT(in   ) ::   pts   ! 1 : potential temperature  [Celsius]
+      !                                                                  ! 2 : salinity               [psu]
+      REAL(wp), DIMENSION(A2D_T(ktrd) ,JPK     ), INTENT(  out) ::   prd   ! in situ density            [-]
+      REAL(wp), DIMENSION(A2D_T(ktdep),JPK     ), INTENT(in   ) ::   pdep  ! depth                      [m]
       !
       INTEGER  ::   ji, jj, jk                ! dummy loop indices
@@ -238,5 +250,5 @@
       CASE( np_teos10, np_eos80 )                !==  polynomial TEOS-10 / EOS-80 ==!
          !
-         DO_3D( 1, 1, 1, 1, 1, jpkm1 )
+         DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpkm1 )
             !
             zh  = pdep(ji,jj,jk) * r1_Z0                                  ! depth
@@ -274,5 +286,5 @@
       CASE( np_seos )                !==  simplified EOS  ==!
          !
-         DO_3D( 1, 1, 1, 1, 1, jpkm1 )
+         DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpkm1 )
             zt  = pts  (ji,jj,jk,jp_tem) - 10._wp
             zs  = pts  (ji,jj,jk,jp_sal) - 35._wp
@@ -293,8 +305,20 @@
       IF( ln_timing )   CALL timing_stop('eos-insitu')
       !
-   END SUBROUTINE eos_insitu
+   END SUBROUTINE eos_insitu_t
 
 
    SUBROUTINE eos_insitu_pot( pts, prd, prhop, pdep )
+      !!
+      REAL(wp), DIMENSION(:,:,:,:), INTENT(in   ) ::   pts    ! 1 : potential temperature  [Celsius]
+      !                                                       ! 2 : salinity               [psu]
+      REAL(wp), DIMENSION(:,:,:)  , INTENT(  out) ::   prd    ! in situ density            [-]
+      REAL(wp), DIMENSION(:,:,:)  , INTENT(  out) ::   prhop  ! potential density (surface referenced)
+      REAL(wp), DIMENSION(:,:,:)  , INTENT(in   ) ::   pdep   ! depth                      [m]
+      !!
+      CALL eos_insitu_pot_t( pts, is_tile(pts), prd, is_tile(prd), prhop, is_tile(prhop), pdep, is_tile(pdep) )
+   END SUBROUTINE eos_insitu_pot
+
+
+   SUBROUTINE eos_insitu_pot_t( pts, ktts, prd, ktrd, prhop, ktrhop, pdep, ktdep )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE eos_insitu_pot  ***
@@ -309,9 +333,10 @@
       !!
       !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in   ) ::   pts    ! 1 : potential temperature  [Celsius]
-      !                                                                ! 2 : salinity               [psu]
-      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(  out) ::   prd    ! in situ density            [-]
-      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(  out) ::   prhop  ! potential density (surface referenced)
-      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(in   ) ::   pdep   ! depth                      [m]
+      INTEGER                                  , INTENT(in   ) ::   ktts, ktrd, ktrhop, ktdep
+      REAL(wp), DIMENSION(A2D_T(ktts)  ,JPK,JPTS), INTENT(in   ) ::   pts    ! 1 : potential temperature  [Celsius]
+      !                                                                    ! 2 : salinity               [psu]
+      REAL(wp), DIMENSION(A2D_T(ktrd)  ,JPK     ), INTENT(  out) ::   prd    ! in situ density            [-]
+      REAL(wp), DIMENSION(A2D_T(ktrhop),JPK     ), INTENT(  out) ::   prhop  ! potential density (surface referenced)
+      REAL(wp), DIMENSION(A2D_T(ktdep) ,JPK     ), INTENT(in   ) ::   pdep   ! depth                      [m]
       !
       INTEGER  ::   ji, jj, jk, jsmp             ! dummy loop indices
@@ -338,5 +363,5 @@
             END DO
             !
-            DO_3D( 1, 1, 1, 1, 1, jpkm1 )
+            DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpkm1 )
                !
                ! compute density (2*nn_sto_eos) times:
@@ -388,5 +413,5 @@
          ! Non-stochastic equation of state
          ELSE
-            DO_3D( 1, 1, 1, 1, 1, jpkm1 )
+            DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpkm1 )
                !
                zh  = pdep(ji,jj,jk) * r1_Z0                                  ! depth
@@ -426,5 +451,5 @@
       CASE( np_seos )                !==  simplified EOS  ==!
          !
-         DO_3D( 1, 1, 1, 1, 1, jpkm1 )
+         DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpkm1 )
             zt  = pts  (ji,jj,jk,jp_tem) - 10._wp
             zs  = pts  (ji,jj,jk,jp_sal) - 35._wp
@@ -444,12 +469,24 @@
       END SELECT
       !
-      IF(sn_cfctl%l_prtctl)   CALL prt_ctl( tab3d_1=prd, clinfo1=' eos-pot: ', tab3d_2=prhop, clinfo2=' pot : ', kdim=jpk )
+      IF(sn_cfctl%l_prtctl)   CALL prt_ctl( tab3d_1=prd, clinfo1=' eos-pot: ', &
+         &                                  tab3d_2=prhop, clinfo2=' pot : ', kdim=jpk )
       !
       IF( ln_timing )   CALL timing_stop('eos-pot')
       !
-   END SUBROUTINE eos_insitu_pot
+   END SUBROUTINE eos_insitu_pot_t
 
 
    SUBROUTINE eos_insitu_2d( pts, pdep, prd )
+      !!
+      REAL(wp), DIMENSION(:,:,:), INTENT(in   ) ::   pts   ! 1 : potential temperature  [Celsius]
+      !                                                    ! 2 : salinity               [psu]
+      REAL(wp), DIMENSION(:,:)  , INTENT(in   ) ::   pdep  ! depth                      [m]
+      REAL(wp), DIMENSION(:,:)  , INTENT(  out) ::   prd   ! in situ density
+      !!
+      CALL eos_insitu_2d_t( pts, is_tile(pts), pdep, is_tile(pdep), prd, is_tile(prd) )
+   END SUBROUTINE eos_insitu_2d
+
+
+   SUBROUTINE eos_insitu_2d_t( pts, ktts, pdep, ktdep, prd, ktrd )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE eos_insitu_2d  ***
@@ -462,8 +499,9 @@
       !!
       !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj,jpts), INTENT(in   ) ::   pts   ! 1 : potential temperature  [Celsius]
-      !                                                           ! 2 : salinity               [psu]
-      REAL(wp), DIMENSION(jpi,jpj)     , INTENT(in   ) ::   pdep  ! depth                      [m]
-      REAL(wp), DIMENSION(jpi,jpj)     , INTENT(  out) ::   prd   ! in situ density
+      INTEGER                            , INTENT(in   ) ::   ktts, ktdep, ktrd
+      REAL(wp), DIMENSION(A2D_T(ktts),JPTS), INTENT(in   ) ::   pts   ! 1 : potential temperature  [Celsius]
+      !                                                             ! 2 : salinity               [psu]
+      REAL(wp), DIMENSION(A2D_T(ktdep)    ), INTENT(in   ) ::   pdep  ! depth                      [m]
+      REAL(wp), DIMENSION(A2D_T(ktrd)     ), INTENT(  out) ::   prd   ! in situ density
       !
       INTEGER  ::   ji, jj, jk                ! dummy loop indices
@@ -480,5 +518,5 @@
       CASE( np_teos10, np_eos80 )                !==  polynomial TEOS-10 / EOS-80 ==!
          !
-         DO_2D( 1, 1, 1, 1 )
+         DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
             !
             zh  = pdep(ji,jj) * r1_Z0                                  ! depth
@@ -515,5 +553,5 @@
       CASE( np_seos )                !==  simplified EOS  ==!
          !
-         DO_2D( 1, 1, 1, 1 )
+         DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
             !
             zt    = pts  (ji,jj,jp_tem)  - 10._wp
@@ -535,8 +573,18 @@
       IF( ln_timing )   CALL timing_stop('eos2d')
       !
-   END SUBROUTINE eos_insitu_2d
+   END SUBROUTINE eos_insitu_2d_t
 
 
    SUBROUTINE rab_3d( pts, pab, Kmm )
+      !!
+      INTEGER                     , INTENT(in   ) ::   Kmm   ! time level index
+      REAL(wp), DIMENSION(:,:,:,:), INTENT(in   ) ::   pts   ! pot. temperature & salinity
+      REAL(wp), DIMENSION(:,:,:,:), INTENT(  out) ::   pab   ! thermal/haline expansion ratio
+      !!
+      CALL rab_3d_t( pts, is_tile(pts), pab, is_tile(pab), Kmm )
+   END SUBROUTINE rab_3d
+
+
+   SUBROUTINE rab_3d_t( pts, ktts, pab, ktab, Kmm )
       !!----------------------------------------------------------------------
       !!                 ***  ROUTINE rab_3d  ***
@@ -548,7 +596,8 @@
       !! ** Action  : - pab     : thermal/haline expansion ratio at T-points
       !!----------------------------------------------------------------------
-      INTEGER                              , INTENT(in   ) ::   Kmm   ! time level index
-      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in   ) ::   pts   ! pot. temperature & salinity
-      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(  out) ::   pab   ! thermal/haline expansion ratio
+      INTEGER                                , INTENT(in   ) ::   Kmm   ! time level index
+      INTEGER                                , INTENT(in   ) ::   ktts, ktab
+      REAL(wp), DIMENSION(A2D_T(ktts),JPK,JPTS), INTENT(in   ) ::   pts   ! pot. temperature & salinity
+      REAL(wp), DIMENSION(A2D_T(ktab),JPK,JPTS), INTENT(  out) ::   pab   ! thermal/haline expansion ratio
       !
       INTEGER  ::   ji, jj, jk                ! dummy loop indices
@@ -563,5 +612,5 @@
       CASE( np_teos10, np_eos80 )                !==  polynomial TEOS-10 / EOS-80 ==!
          !
-         DO_3D( 1, 1, 1, 1, 1, jpkm1 )
+         DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpkm1 )
             !
             zh  = gdept(ji,jj,jk,Kmm) * r1_Z0                                ! depth
@@ -616,5 +665,5 @@
       CASE( np_seos )                  !==  simplified EOS  ==!
          !
-         DO_3D( 1, 1, 1, 1, 1, jpkm1 )
+         DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpkm1 )
             zt  = pts (ji,jj,jk,jp_tem) - 10._wp   ! pot. temperature anomaly (t-T0)
             zs  = pts (ji,jj,jk,jp_sal) - 35._wp   ! abs. salinity anomaly (s-S0)
@@ -641,8 +690,19 @@
       IF( ln_timing )   CALL timing_stop('rab_3d')
       !
-   END SUBROUTINE rab_3d
+   END SUBROUTINE rab_3d_t
 
 
    SUBROUTINE rab_2d( pts, pdep, pab, Kmm )
+      !!
+      INTEGER                   , INTENT(in   ) ::   Kmm   ! time level index
+      REAL(wp), DIMENSION(:,:,:), INTENT(in   ) ::   pts    ! pot. temperature & salinity
+      REAL(wp), DIMENSION(:,:)  , INTENT(in   ) ::   pdep   ! depth                  [m]
+      REAL(wp), DIMENSION(:,:,:), INTENT(  out) ::   pab    ! thermal/haline expansion ratio
+      !!
+      CALL rab_2d_t(pts, is_tile(pts), pdep, is_tile(pdep), pab, is_tile(pab), Kmm)
+   END SUBROUTINE rab_2d
+
+
+   SUBROUTINE rab_2d_t( pts, ktts, pdep, ktdep, pab, ktab, Kmm )
       !!----------------------------------------------------------------------
       !!                 ***  ROUTINE rab_2d  ***
@@ -652,8 +712,9 @@
       !! ** Action  : - pab     : thermal/haline expansion ratio at T-points
       !!----------------------------------------------------------------------
-      INTEGER                              , INTENT(in   ) ::   Kmm   ! time level index
-      REAL(wp), DIMENSION(jpi,jpj,jpts)    , INTENT(in   ) ::   pts    ! pot. temperature & salinity
-      REAL(wp), DIMENSION(jpi,jpj)         , INTENT(in   ) ::   pdep   ! depth                  [m]
-      REAL(wp), DIMENSION(jpi,jpj,jpts)    , INTENT(  out) ::   pab    ! thermal/haline expansion ratio
+      INTEGER                            , INTENT(in   ) ::   Kmm   ! time level index
+      INTEGER                            , INTENT(in   ) ::   ktts, ktdep, ktab
+      REAL(wp), DIMENSION(A2D_T(ktts),JPTS), INTENT(in   ) ::   pts    ! pot. temperature & salinity
+      REAL(wp), DIMENSION(A2D_T(ktdep)    ), INTENT(in   ) ::   pdep   ! depth                  [m]
+      REAL(wp), DIMENSION(A2D_T(ktab),JPTS), INTENT(  out) ::   pab    ! thermal/haline expansion ratio
       !
       INTEGER  ::   ji, jj, jk                ! dummy loop indices
@@ -670,5 +731,5 @@
       CASE( np_teos10, np_eos80 )                !==  polynomial TEOS-10 / EOS-80 ==!
          !
-         DO_2D( 1, 1, 1, 1 )
+         DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
             !
             zh  = pdep(ji,jj) * r1_Z0                                  ! depth
@@ -723,5 +784,5 @@
       CASE( np_seos )                  !==  simplified EOS  ==!
          !
-         DO_2D( 1, 1, 1, 1 )
+         DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
             !
             zt    = pts  (ji,jj,jp_tem) - 10._wp   ! pot. temperature anomaly (t-T0)
@@ -748,5 +809,5 @@
       IF( ln_timing )   CALL timing_stop('rab_2d')
       !
-   END SUBROUTINE rab_2d
+   END SUBROUTINE rab_2d_t
 
 
@@ -849,4 +910,15 @@
 
    SUBROUTINE bn2( pts, pab, pn2, Kmm )
+      !!
+      INTEGER                              , INTENT(in   ) ::  Kmm   ! time level index
+      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in   ) ::  pts   ! pot. temperature and salinity   [Celsius,psu]
+      REAL(wp), DIMENSION(:,:,:,:)         , INTENT(in   ) ::  pab   ! thermal/haline expansion coef.  [Celsius-1,psu-1]
+      REAL(wp), DIMENSION(:,:,:)           , INTENT(  out) ::  pn2   ! Brunt-Vaisala frequency squared [1/s^2]
+      !!
+      CALL bn2_t( pts, pab, is_tile(pab), pn2, is_tile(pn2), Kmm )
+   END SUBROUTINE bn2
+
+
+   SUBROUTINE bn2_t( pts, pab, ktab, pn2, ktn2, Kmm )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE bn2  ***
@@ -862,8 +934,9 @@
       !!
       !!----------------------------------------------------------------------
-      INTEGER                              , INTENT(in   ) ::   Kmm   ! time level index
-      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in   ) ::  pts   ! pot. temperature and salinity   [Celsius,psu]
-      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in   ) ::  pab   ! thermal/haline expansion coef.  [Celsius-1,psu-1]
-      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(  out) ::  pn2   ! Brunt-Vaisala frequency squared [1/s^2]
+      INTEGER                                , INTENT(in   ) ::  Kmm   ! time level index
+      INTEGER                                , INTENT(in   ) ::  ktab, ktn2
+      REAL(wp), DIMENSION(jpi,jpj,  jpk,jpts), INTENT(in   ) ::  pts   ! pot. temperature and salinity   [Celsius,psu]
+      REAL(wp), DIMENSION(A2D_T(ktab),JPK,JPTS), INTENT(in   ) ::  pab   ! thermal/haline expansion coef.  [Celsius-1,psu-1]
+      REAL(wp), DIMENSION(A2D_T(ktn2),JPK     ), INTENT(  out) ::  pn2   ! Brunt-Vaisala frequency squared [1/s^2]
       !
       INTEGER  ::   ji, jj, jk      ! dummy loop indices
@@ -873,5 +946,5 @@
       IF( ln_timing )   CALL timing_start('bn2')
       !
-      DO_3D( 1, 1, 1, 1, 2, jpkm1 )      ! interior points only (2=< jk =< jpkm1 ); surface and bottom value set to zero one for all in istate.F90
+      DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 2, jpkm1 )      ! interior points only (2=< jk =< jpkm1 ); surface and bottom value set to zero one for all in istate.F90
          zrw =   ( gdepw(ji,jj,jk  ,Kmm) - gdept(ji,jj,jk,Kmm) )   &
             &  / ( gdept(ji,jj,jk-1,Kmm) - gdept(ji,jj,jk,Kmm) ) 
@@ -889,5 +962,5 @@
       IF( ln_timing )   CALL timing_stop('bn2')
       !
-   END SUBROUTINE bn2
+   END SUBROUTINE bn2_t
 
 
@@ -949,5 +1022,15 @@
 
 
-   SUBROUTINE  eos_fzp_2d( psal, ptf, pdep )
+   SUBROUTINE eos_fzp_2d( psal, ptf, pdep )
+      !!
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   )           ::   psal   ! salinity   [psu]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ), OPTIONAL ::   pdep   ! depth      [m]
+      REAL(wp), DIMENSION(:,:)    , INTENT(out  )           ::   ptf    ! freezing temperature [Celsius]
+      !!
+      CALL eos_fzp_2d_t( psal, ptf, is_tile(ptf), pdep )
+   END SUBROUTINE eos_fzp_2d
+
+
+   SUBROUTINE  eos_fzp_2d_t( psal, ptf, kttf, pdep )
       !!----------------------------------------------------------------------
       !!                 ***  ROUTINE eos_fzp  ***
@@ -961,7 +1044,8 @@
       !! Reference  :   UNESCO tech. papers in the marine science no. 28. 1978
       !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   )           ::   psal   ! salinity   [psu]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ), OPTIONAL ::   pdep   ! depth      [m]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(out  )           ::   ptf    ! freezing temperature [Celsius]
+      INTEGER                       , INTENT(in   )           ::   kttf
+      REAL(wp), DIMENSION(jpi,jpj)  , INTENT(in   )           ::   psal   ! salinity   [psu]
+      REAL(wp), DIMENSION(jpi,jpj)  , INTENT(in   ), OPTIONAL ::   pdep   ! depth      [m]
+      REAL(wp), DIMENSION(A2D_T(kttf)), INTENT(out  )           ::   ptf    ! freezing temperature [Celsius]
       !
       INTEGER  ::   ji, jj          ! dummy loop indices
@@ -996,5 +1080,5 @@
       END SELECT      
       !
-  END SUBROUTINE eos_fzp_2d
+  END SUBROUTINE eos_fzp_2d_t
 
 
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traadv.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traadv.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traadv.F90	(revision 14012)
@@ -18,4 +18,6 @@
    USE oce            ! ocean dynamics and active tracers
    USE dom_oce        ! ocean space and time domain
+   ! TEMP: [tiling] This change not necessary after extended haloes development
+   USE domain, ONLY : dom_tile
    USE domvvl         ! variable vertical scale factors
    USE sbcwave        ! wave module
@@ -23,5 +25,7 @@
    USE traadv_cen     ! centered scheme            (tra_adv_cen  routine)
    USE traadv_fct     ! FCT      scheme            (tra_adv_fct  routine)
+   USE traadv_fct_lf  ! FCT      scheme            (tra_adv_fct  routine - loop fusion version)
    USE traadv_mus     ! MUSCL    scheme            (tra_adv_mus  routine)
+   USE traadv_mus_lf  ! MUSCL    scheme            (tra_adv_mus  routine - loop fusion version)
    USE traadv_ubs     ! UBS      scheme            (tra_adv_ubs  routine)
    USE traadv_qck     ! QUICKEST scheme            (tra_adv_qck  routine)
@@ -65,5 +69,7 @@
    INTEGER, PARAMETER ::   np_UBS     = 4   ! 3rd order Upstream Biased Scheme
    INTEGER, PARAMETER ::   np_QCK     = 5   ! QUICK scheme
-   
+
+   !! * Substitutions
+#  include "do_loop_substitute.h90"
 #  include "domzgr_substitute.h90"
    !!----------------------------------------------------------------------
@@ -86,88 +92,151 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts            ! active tracers and RHS of tracer equation
       !
-      INTEGER ::   jk   ! dummy loop index
-      REAL(wp), DIMENSION(jpi,jpj,jpk)        :: zuu, zvv, zww   ! 3D workspace
-      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   ztrdt, ztrds
+      INTEGER ::   ji, jj, jk   ! dummy loop index
+      ! TEMP: [tiling] This change not necessary and can be A2D(nn_hls) if using XIOS (subdomain support)
+      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, SAVE :: zuu, zvv, zww   ! 3D workspace
+      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: ztrdt, ztrds
+      ! TEMP: [tiling] This change not necessary after extra haloes development
+      LOGICAL :: lskip
       !!----------------------------------------------------------------------
       !
       IF( ln_timing )   CALL timing_start('tra_adv')
       !
-      !                                         !==  effective transport  ==!
-      zuu(:,:,jpk) = 0._wp
-      zvv(:,:,jpk) = 0._wp
-      zww(:,:,jpk) = 0._wp
-      IF( ln_wave .AND. ln_sdw )  THEN
-         DO jk = 1, jpkm1                                                       ! eulerian transport + Stokes Drift
-            zuu(:,:,jk) =   &
-               &  e2u  (:,:) * e3u(:,:,jk,Kmm) * ( uu(:,:,jk,Kmm) + usd(:,:,jk) )
-            zvv(:,:,jk) =   & 
-               &  e1v  (:,:) * e3v(:,:,jk,Kmm) * ( vv(:,:,jk,Kmm) + vsd(:,:,jk) )
-            zww(:,:,jk) =   & 
-               &  e1e2t(:,:)                 * ( ww(:,:,jk) + wsd(:,:,jk) )
-         END DO
-      ELSE
-         DO jk = 1, jpkm1
-            zuu(:,:,jk) = e2u  (:,:) * e3u(:,:,jk,Kmm) * uu(:,:,jk,Kmm)               ! eulerian transport only
-            zvv(:,:,jk) = e1v  (:,:) * e3v(:,:,jk,Kmm) * vv(:,:,jk,Kmm)
-            zww(:,:,jk) = e1e2t(:,:)                 * ww(:,:,jk)
-         END DO
-      ENDIF
-      !
-      IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN                                ! add z-tilde and/or vvl corrections
-         zuu(:,:,:) = zuu(:,:,:) + un_td(:,:,:)
-         zvv(:,:,:) = zvv(:,:,:) + vn_td(:,:,:)
-      ENDIF
-      !
-      zuu(:,:,jpk) = 0._wp                                                      ! no transport trough the bottom
-      zvv(:,:,jpk) = 0._wp
-      zww(:,:,jpk) = 0._wp
-      !
-      IF( ln_ldfeiv .AND. .NOT. ln_traldf_triad )   &
-         &              CALL ldf_eiv_trp( kt, nit000, zuu, zvv, zww, 'TRA', Kmm, Krhs )   ! add the eiv transport (if necessary)
-      !
-      IF( ln_mle    )   CALL tra_mle_trp( kt, nit000, zuu, zvv, zww, 'TRA', Kmm       )   ! add the mle transport (if necessary)
-      !
-      CALL iom_put( "uocetr_eff", zuu )                                        ! output effective transport      
-      CALL iom_put( "vocetr_eff", zvv )
-      CALL iom_put( "wocetr_eff", zww )
-      !
-!!gm ???
-      CALL dia_ptr( kt, Kmm, zvv )                                    ! diagnose the effective MSF 
-!!gm ???
-      !
-
-      IF( l_trdtra )   THEN                    !* Save ta and sa trends
-         ALLOCATE( ztrdt(jpi,jpj,jpk), ztrds(jpi,jpj,jpk) )
-         ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs)
-         ztrds(:,:,:) = pts(:,:,:,jp_sal,Krhs)
-      ENDIF
-      !
-      SELECT CASE ( nadv )                      !==  compute advection trend and add it to general trend  ==!
-      !
-      CASE ( np_CEN )                                 ! Centered scheme : 2nd / 4th order
-         CALL tra_adv_cen    ( kt, nit000, 'TRA',         zuu, zvv, zww, Kmm, pts, jpts, Krhs, nn_cen_h, nn_cen_v )
-      CASE ( np_FCT )                                 ! FCT scheme      : 2nd / 4th order
-         CALL tra_adv_fct    ( kt, nit000, 'TRA', rDt, zuu, zvv, zww, Kbb, Kmm, pts, jpts, Krhs, nn_fct_h, nn_fct_v )
-      CASE ( np_MUS )                                 ! MUSCL
-         CALL tra_adv_mus    ( kt, nit000, 'TRA', rDt, zuu, zvv, zww, Kbb, Kmm, pts, jpts, Krhs, ln_mus_ups ) 
-      CASE ( np_UBS )                                 ! UBS
-         CALL tra_adv_ubs    ( kt, nit000, 'TRA', rDt, zuu, zvv, zww, Kbb, Kmm, pts, jpts, Krhs, nn_ubs_v   )
-      CASE ( np_QCK )                                 ! QUICKEST
-         CALL tra_adv_qck    ( kt, nit000, 'TRA', rDt, zuu, zvv, zww, Kbb, Kmm, pts, jpts, Krhs )
-      !
-      END SELECT
-      !
-      IF( l_trdtra )   THEN                      ! save the advective trends for further diagnostics
-         DO jk = 1, jpkm1
-            ztrdt(:,:,jk) = pts(:,:,jk,jp_tem,Krhs) - ztrdt(:,:,jk)
-            ztrds(:,:,jk) = pts(:,:,jk,jp_sal,Krhs) - ztrds(:,:,jk)
-         END DO
-         CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_totad, ztrdt )
-         CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_sal, jptra_totad, ztrds )
-         DEALLOCATE( ztrdt, ztrds )
+      lskip = .FALSE.
+
+      ! TEMP: [tiling] These changes not necessary if using XIOS (subdomain support)
+      IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile
+         ALLOCATE( zuu(jpi,jpj,jpk), zvv(jpi,jpj,jpk), zww(jpi,jpj,jpk) )
+      ENDIF
+
+      ! TEMP: [tiling] These changes not necessary after extra haloes development (lbc_lnk removed from tra_adv_*) and if XIOS has subdomain support (ldf_eiv_dia)
+      IF( nadv /= np_CEN .OR. (nadv == np_CEN .AND. nn_cen_h == 4) .OR. ln_ldfeiv_dia )  THEN
+         IF( ln_tile ) THEN
+            IF( ntile == 1 ) THEN
+               CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 )
+            ELSE
+               lskip = .TRUE.
+            ENDIF
+         ENDIF
+      ENDIF
+      IF( .NOT. lskip ) THEN
+         !                                         !==  effective transport  ==!
+         IF( ln_wave .AND. ln_sdw )  THEN
+            DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpkm1 )
+               zuu(ji,jj,jk) = e2u  (ji,jj) * e3u(ji,jj,jk,Kmm) * ( uu(ji,jj,jk,Kmm) + usd(ji,jj,jk) )
+               zvv(ji,jj,jk) = e1v  (ji,jj) * e3v(ji,jj,jk,Kmm) * ( vv(ji,jj,jk,Kmm) + vsd(ji,jj,jk) )
+               zww(ji,jj,jk) = e1e2t(ji,jj)                     * ( ww(ji,jj,jk)     + wsd(ji,jj,jk) )
+            END_3D
+         ELSE
+            DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpkm1 )
+               zuu(ji,jj,jk) = e2u  (ji,jj) * e3u(ji,jj,jk,Kmm) * uu(ji,jj,jk,Kmm)               ! eulerian transport only
+               zvv(ji,jj,jk) = e1v  (ji,jj) * e3v(ji,jj,jk,Kmm) * vv(ji,jj,jk,Kmm)
+               zww(ji,jj,jk) = e1e2t(ji,jj)                     * ww(ji,jj,jk)
+            END_3D
+         ENDIF
+         !
+         IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN                                ! add z-tilde and/or vvl corrections
+            DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpkm1 )
+               zuu(ji,jj,jk) = zuu(ji,jj,jk) + un_td(ji,jj,jk)
+               zvv(ji,jj,jk) = zvv(ji,jj,jk) + vn_td(ji,jj,jk)
+            END_3D
+         ENDIF
+         !
+         DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+            zuu(ji,jj,jpk) = 0._wp                                                      ! no transport trough the bottom
+            zvv(ji,jj,jpk) = 0._wp
+            zww(ji,jj,jpk) = 0._wp
+         END_2D
+         !
+         ! TEMP: [tiling] These changes not necessary if using XIOS (subdomain support)
+         IF( ln_ldfeiv .AND. .NOT. ln_traldf_triad )   &
+            &              CALL ldf_eiv_trp( kt, nit000, zuu(A2D(nn_hls),:), zvv(A2D(nn_hls),:), zww(A2D(nn_hls),:), &
+            &                                'TRA', Kmm, Krhs )   ! add the eiv transport (if necessary)
+         !
+         IF( ln_mle    )   CALL tra_mle_trp( kt, nit000, zuu(A2D(nn_hls),:), zvv(A2D(nn_hls),:), zww(A2D(nn_hls),:), &
+            &                                'TRA', Kmm       )   ! add the mle transport (if necessary)
+         !
+         ! TEMP: [tiling] This change not necessary if using XIOS (subdomain support)
+         IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only on the last tile
+            CALL iom_put( "uocetr_eff", zuu )                                        ! output effective transport
+            CALL iom_put( "vocetr_eff", zvv )
+            CALL iom_put( "wocetr_eff", zww )
+         ENDIF
+         !
+   !!gm ???
+         ! TEMP: [tiling] This change not necessary if using XIOS (subdomain support)
+         CALL dia_ptr( kt, Kmm, zvv(A2D(nn_hls),:) )                                    ! diagnose the effective MSF
+   !!gm ???
+         !
+
+         IF( l_trdtra )   THEN                    !* Save ta and sa trends
+            ALLOCATE( ztrdt(jpi,jpj,jpk), ztrds(jpi,jpj,jpk) )
+            ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs)
+            ztrds(:,:,:) = pts(:,:,:,jp_sal,Krhs)
+         ENDIF
+         !
+         ! NOTE: [tiling-comms-merge] These lbc_lnk calls are still needed (pts in the zco case because zps_hde is not called in step, zuu/zvv/zww in all cases, I think because DO loop bounds need to be updated in DYN as done in TRA)
+         SELECT CASE ( nadv )                      !==  compute advection trend and add it to general trend  ==!
+         !
+         CASE ( np_CEN )                                 ! Centered scheme : 2nd / 4th order
+            IF (nn_hls.EQ.2) CALL lbc_lnk( 'traadv', pts(:,:,:,:,Kmm), 'T', 1. )
+            CALL tra_adv_cen    ( kt, nit000, 'TRA',         zuu, zvv, zww, Kmm, pts, jpts, Krhs, nn_cen_h, nn_cen_v )
+         CASE ( np_FCT )                                 ! FCT scheme      : 2nd / 4th order
+            IF (nn_hls.EQ.2) THEN
+               CALL lbc_lnk_multi( 'traadv', pts(:,:,:,:,Kbb), 'T', 1., pts(:,:,:,:,Kmm), 'T', 1.)
+               CALL lbc_lnk_multi( 'traadv', zuu(:,:,:), 'U', -1., zvv(:,:,:), 'V', -1., zww(:,:,:), 'W', 1.)
+#if defined key_loop_fusion
+               CALL tra_adv_fct_lf ( kt, nit000, 'TRA', rDt, zuu, zvv, zww, Kbb, Kmm, pts, jpts, Krhs, nn_fct_h, nn_fct_v )
+#else
+               CALL tra_adv_fct    ( kt, nit000, 'TRA', rDt, zuu, zvv, zww, Kbb, Kmm, pts, jpts, Krhs, nn_fct_h, nn_fct_v )
+#endif
+            ELSE
+               CALL tra_adv_fct    ( kt, nit000, 'TRA', rDt, zuu, zvv, zww, Kbb, Kmm, pts, jpts, Krhs, nn_fct_h, nn_fct_v )
+            END IF
+         CASE ( np_MUS )                                 ! MUSCL
+            ! NOTE: [tiling-comms-merge] I added this lbc_lnk as it did not validate against the trunk when using ln_zco
+            IF (nn_hls.EQ.2) THEN 
+                CALL lbc_lnk( 'traadv', pts(:,:,:,:,Kbb), 'T', 1.)
+#if defined key_loop_fusion
+                CALL tra_adv_mus_lf ( kt, nit000, 'TRA', rDt, zuu, zvv, zww, Kbb, Kmm, pts, jpts, Krhs, ln_mus_ups ) 
+#else
+                CALL tra_adv_mus    ( kt, nit000, 'TRA', rDt, zuu, zvv, zww, Kbb, Kmm, pts, jpts, Krhs, ln_mus_ups ) 
+#endif
+            ELSE
+                CALL tra_adv_mus    ( kt, nit000, 'TRA', rDt, zuu, zvv, zww, Kbb, Kmm, pts, jpts, Krhs, ln_mus_ups ) 
+            END IF
+         CASE ( np_UBS )                                 ! UBS
+            IF (nn_hls.EQ.2) CALL lbc_lnk( 'traadv', pts(:,:,:,:,Kbb), 'T', 1.)
+            CALL tra_adv_ubs    ( kt, nit000, 'TRA', rDt, zuu, zvv, zww, Kbb, Kmm, pts, jpts, Krhs, nn_ubs_v   )
+         CASE ( np_QCK )                                 ! QUICKEST
+            IF (nn_hls.EQ.2) THEN
+               CALL lbc_lnk_multi( 'traadv', zuu(:,:,:), 'U', -1., zvv(:,:,:), 'V', -1.)
+               CALL lbc_lnk( 'traadv', pts(:,:,:,:,Kbb), 'T', 1.)
+            END IF
+            CALL tra_adv_qck    ( kt, nit000, 'TRA', rDt, zuu, zvv, zww, Kbb, Kmm, pts, jpts, Krhs )
+         !
+         END SELECT
+         !
+         IF( l_trdtra )   THEN                      ! save the advective trends for further diagnostics
+            DO jk = 1, jpkm1
+               ztrdt(:,:,jk) = pts(:,:,jk,jp_tem,Krhs) - ztrdt(:,:,jk)
+               ztrds(:,:,jk) = pts(:,:,jk,jp_sal,Krhs) - ztrds(:,:,jk)
+            END DO
+            CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_totad, ztrdt )
+            CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_sal, jptra_totad, ztrds )
+            DEALLOCATE( ztrdt, ztrds )
+         ENDIF
+
+         ! TEMP: [tiling] This change not necessary after extra haloes development (lbc_lnk removed from tra_adv_*) and if XIOS has subdomain support (ldf_eiv_dia)
+         IF( ln_tile .AND. ntile == 0 ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 1 )
+
       ENDIF
       !                                              ! print mean trends (used for debugging)
-      IF(sn_cfctl%l_prtctl)   CALL prt_ctl( tab3d_1=pts(:,:,:,jp_tem,Krhs), clinfo1=' adv  - Ta: ', mask1=tmask,               &
+      IF(sn_cfctl%l_prtctl)   CALL prt_ctl( tab3d_1=pts(:,:,:,jp_tem,Krhs), clinfo1=' adv  - Ta: ', mask1=tmask, &
          &                                  tab3d_2=pts(:,:,:,jp_sal,Krhs), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' )
+
+      ! TEMP: [tiling] This change not necessary if using XIOS (subdomain support)
+      IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only for the full domain
+         DEALLOCATE( zuu, zvv, zww )
+      ENDIF
       !
       IF( ln_timing )   CALL timing_stop( 'tra_adv' )
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traadv_cen.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traadv_cen.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traadv_cen.F90	(revision 14012)
@@ -71,4 +71,5 @@
       INTEGER                                  , INTENT(in   ) ::   kn_cen_h        ! =2/4 (2nd or 4th order scheme)
       INTEGER                                  , INTENT(in   ) ::   kn_cen_v        ! =2/4 (2nd or 4th order scheme)
+      ! TEMP: [tiling] This can be A2D(nn_hls) if using XIOS (subdomain support)
       REAL(wp), DIMENSION(jpi,jpj,jpk         ), INTENT(in   ) ::   pU, pV, pW      ! 3 ocean volume flux components
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt,jpt), INTENT(inout) ::   pt              ! tracers and RHS of tracer equation
@@ -78,20 +79,22 @@
       REAL(wp) ::   zC2t_u, zC4t_u   ! local scalars
       REAL(wp) ::   zC2t_v, zC4t_v   !   -      -
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zwx, zwy, zwz, ztu, ztv, ztw
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk) ::   zwx, zwy, zwz, ztu, ztv, ztw
       !!----------------------------------------------------------------------
       !
-      IF( kt == kit000 )  THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'tra_adv_cen : centered advection scheme on ', cdtype, ' order h/v =', kn_cen_h,'/', kn_cen_v
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~ '
+      IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile
+         IF( kt == kit000 )  THEN
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) 'tra_adv_cen : centered advection scheme on ', cdtype, ' order h/v =', kn_cen_h,'/', kn_cen_v
+            IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~ '
+         ENDIF
+         !                          ! set local switches
+         l_trd = .FALSE.
+         l_hst = .FALSE.
+         l_ptr = .FALSE.
+         IF( ( cdtype == 'TRA' .AND. l_trdtra ) .OR. ( cdtype == 'TRC' .AND. l_trdtrc ) )       l_trd = .TRUE.
+         IF(   cdtype == 'TRA' .AND. ( iom_use( 'sophtadv' ) .OR. iom_use( 'sophtadv' ) )  )    l_ptr = .TRUE.
+         IF(   cdtype == 'TRA' .AND. ( iom_use("uadv_heattr") .OR. iom_use("vadv_heattr") .OR. &
+            &                          iom_use("uadv_salttr") .OR. iom_use("vadv_salttr")  ) )  l_hst = .TRUE.
       ENDIF
-      !                          ! set local switches
-      l_trd = .FALSE.
-      l_hst = .FALSE.
-      l_ptr = .FALSE.
-      IF( ( cdtype == 'TRA' .AND. l_trdtra ) .OR. ( cdtype == 'TRC' .AND. l_trdtrc ) )       l_trd = .TRUE.
-      IF(   cdtype == 'TRA' .AND. ( iom_use( 'sophtadv' ) .OR. iom_use( 'sophtadv' ) )  )    l_ptr = .TRUE. 
-      IF(   cdtype == 'TRA' .AND. ( iom_use("uadv_heattr") .OR. iom_use("vadv_heattr") .OR. &
-         &                          iom_use("uadv_salttr") .OR. iom_use("vadv_salttr")  ) )  l_hst = .TRUE.
       !
       !                    
@@ -112,11 +115,11 @@
             ztu(:,:,jpk) = 0._wp                   ! Bottom value : flux set to zero
             ztv(:,:,jpk) = 0._wp
-            DO_3D( 0, 0, 0, 0, 1, jpkm1 )          ! masked gradient
+            DO_3D( nn_hls, nn_hls-1, nn_hls, nn_hls-1, 1, jpkm1 )          ! masked gradient
                ztu(ji,jj,jk) = ( pt(ji+1,jj  ,jk,jn,Kmm) - pt(ji,jj,jk,jn,Kmm) ) * umask(ji,jj,jk)
                ztv(ji,jj,jk) = ( pt(ji  ,jj+1,jk,jn,Kmm) - pt(ji,jj,jk,jn,Kmm) ) * vmask(ji,jj,jk)
             END_3D
-            CALL lbc_lnk_multi( 'traadv_cen', ztu, 'U', -1.0_wp , ztv, 'V', -1.0_wp )   ! Lateral boundary cond.
+            IF (nn_hls.EQ.1) CALL lbc_lnk_multi( 'traadv_cen', ztu, 'U', -1.0_wp , ztv, 'V', -1.0_wp )   ! Lateral boundary cond.
             !
-            DO_3D( 0, 0, 0, 0, 1, jpkm1 )           ! Horizontal advective fluxes
+            DO_3D( nn_hls-1, 0, nn_hls-1, 0, 1, jpkm1 )           ! Horizontal advective fluxes
                zC2t_u = pt(ji,jj,jk,jn,Kmm) + pt(ji+1,jj  ,jk,jn,Kmm)   ! C2 interpolation of T at u- & v-points (x2)
                zC2t_v = pt(ji,jj,jk,jn,Kmm) + pt(ji  ,jj+1,jk,jn,Kmm)
@@ -128,5 +131,5 @@
                zwy(ji,jj,jk) =  0.5_wp * pV(ji,jj,jk) * zC4t_v
             END_3D
-            CALL lbc_lnk_multi( 'traadv_cen', zwx, 'U', -1. , zwy, 'V', -1. )
+            IF (nn_hls.EQ.1) CALL lbc_lnk_multi( 'traadv_cen', zwx, 'U', -1. , zwy, 'V', -1. )
             !
          CASE DEFAULT
@@ -155,5 +158,7 @@
                END_2D
             ELSE                                   ! no ice-shelf cavities (only ocean surface)
-               zwz(:,:,1) = pW(:,:,1) * pt(:,:,1,jn,Kmm)
+               DO_2D( 1, 1, 1, 1 )
+                  zwz(ji,jj,1) = pW(ji,jj,1) * pt(ji,jj,1,jn,Kmm)
+               END_2D
             ENDIF
          ENDIF
@@ -171,6 +176,6 @@
             CALL trd_tra( kt, Kmm, Krhs, cdtype, jn, jptra_yad, zwy, pV, pt(:,:,:,jn,Kmm) )
             CALL trd_tra( kt, Kmm, Krhs, cdtype, jn, jptra_zad, zwz, pW, pt(:,:,:,jn,Kmm) )
-         END IF
-         !                                 ! "Poleward" heat and salt transports 
+         ENDIF
+         !                                 ! "Poleward" heat and salt transports
          IF( l_ptr )   CALL dia_ptr_hst( jn, 'adv', zwy(:,:,:) )
          !                                 !  heat and salt transport
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traadv_fct.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traadv_fct.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traadv_fct.F90	(revision 14012)
@@ -34,4 +34,6 @@
    PUBLIC   tra_adv_fct        ! called by traadv.F90
    PUBLIC   interp_4th_cpt     ! called by traadv_cen.F90
+   PUBLIC   tridia_solver      ! called by traadv_fct_lf.F90
+   PUBLIC   nonosc             ! called by traadv_fct_lf.F90 - key_agrif
 
    LOGICAL  ::   l_trd   ! flag to compute trends
@@ -79,12 +81,14 @@
       INTEGER                                  , INTENT(in   ) ::   kn_fct_v        ! order of the FCT scheme (=2 or 4)
       REAL(wp)                                 , INTENT(in   ) ::   p2dt            ! tracer time-step
+      ! TEMP: [tiling] This can be A2D(nn_hls) if using XIOS (subdomain support)
+      ! NOTE: [tiling-comms-merge] These were changed to INTENT(inout) but they are not modified, so it is reverted
       REAL(wp), DIMENSION(jpi,jpj,jpk         ), INTENT(in   ) ::   pU, pV, pW      ! 3 ocean volume flux components
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt,jpt), INTENT(inout) ::   pt              ! tracers and RHS of tracer equation
       !
-      INTEGER  ::   ji, jj, jk, jn                           ! dummy loop indices  
+      INTEGER  ::   ji, jj, jk, jn                           ! dummy loop indices
       REAL(wp) ::   ztra                                     ! local scalar
       REAL(wp) ::   zfp_ui, zfp_vj, zfp_wk, zC2t_u, zC4t_u   !   -      -
       REAL(wp) ::   zfm_ui, zfm_vj, zfm_wk, zC2t_v, zC4t_v   !   -      -
-      REAL(wp), DIMENSION(jpi,jpj,jpk)        ::   zwi, zwx, zwy, zwz, ztu, ztv, zltu, zltv, ztw
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk)        ::   zwi, zwx, zwy, zwz, ztu, ztv, zltu, zltv, ztw
       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   ztrdx, ztrdy, ztrdz, zptry
       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   zwinf, zwdia, zwsup
@@ -92,9 +96,23 @@
       !!----------------------------------------------------------------------
       !
-      IF( kt == kit000 )  THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'tra_adv_fct : FCT advection scheme on ', cdtype
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
+      IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile
+         IF( kt == kit000 )  THEN
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) 'tra_adv_fct : FCT advection scheme on ', cdtype
+            IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
+         ENDIF
+         ! NOTE: [tiling-comms-merge] Bug fix- move array zeroing out of this IF block
+         !
+         l_trd = .FALSE.            ! set local switches
+         l_hst = .FALSE.
+         l_ptr = .FALSE.
+         ll_zAimp = .FALSE.
+         IF( ( cdtype == 'TRA' .AND. l_trdtra  ) .OR. ( cdtype =='TRC' .AND. l_trdtrc ) )      l_trd = .TRUE.
+         IF(   cdtype == 'TRA' .AND. ( iom_use( 'sophtadv' ) .OR. iom_use( 'sophtadv' ) ) )    l_ptr = .TRUE.
+         IF(   cdtype == 'TRA' .AND. ( iom_use("uadv_heattr") .OR. iom_use("vadv_heattr") .OR.  &
+            &                         iom_use("uadv_salttr") .OR. iom_use("vadv_salttr")  ) )  l_hst = .TRUE.
+         !
       ENDIF
+
       !! -- init to 0
       zwi(:,:,:) = 0._wp
@@ -108,36 +126,22 @@
       ztw(:,:,:) = 0._wp
       !
-      l_trd = .FALSE.            ! set local switches
-      l_hst = .FALSE.
-      l_ptr = .FALSE.
-      ll_zAimp = .FALSE.
-      IF( ( cdtype == 'TRA' .AND. l_trdtra  ) .OR. ( cdtype =='TRC' .AND. l_trdtrc ) )      l_trd = .TRUE.
-      IF(   cdtype == 'TRA' .AND. ( iom_use( 'sophtadv' ) .OR. iom_use( 'sophtadv' ) ) )    l_ptr = .TRUE. 
-      IF(   cdtype == 'TRA' .AND. ( iom_use("uadv_heattr") .OR. iom_use("vadv_heattr") .OR.  &
-         &                         iom_use("uadv_salttr") .OR. iom_use("vadv_salttr")  ) )  l_hst = .TRUE.
-      !
       IF( l_trd .OR. l_hst )  THEN
-         ALLOCATE( ztrdx(jpi,jpj,jpk), ztrdy(jpi,jpj,jpk), ztrdz(jpi,jpj,jpk) )
+         ALLOCATE( ztrdx(A2D(nn_hls),jpk), ztrdy(A2D(nn_hls),jpk), ztrdz(A2D(nn_hls),jpk) )
          ztrdx(:,:,:) = 0._wp   ;    ztrdy(:,:,:) = 0._wp   ;   ztrdz(:,:,:) = 0._wp
       ENDIF
       !
-      IF( l_ptr ) THEN  
-         ALLOCATE( zptry(jpi,jpj,jpk) )
+      IF( l_ptr ) THEN
+         ALLOCATE( zptry(A2D(nn_hls),jpk) )
          zptry(:,:,:) = 0._wp
       ENDIF
-      !                          ! surface & bottom value : flux set to zero one for all
-      zwz(:,:, 1 ) = 0._wp            
-      zwx(:,:,jpk) = 0._wp   ;   zwy(:,:,jpk) = 0._wp    ;    zwz(:,:,jpk) = 0._wp
-      !
-      zwi(:,:,:) = 0._wp        
       !
       ! If adaptive vertical advection, check if it is needed on this PE at this time
       IF( ln_zad_Aimp ) THEN
-         IF( MAXVAL( ABS( wi(:,:,:) ) ) > 0._wp ) ll_zAimp = .TRUE.
+         IF( MAXVAL( ABS( wi(A2D(nn_hls),:) ) ) > 0._wp ) ll_zAimp = .TRUE.
       END IF
       ! If active adaptive vertical advection, build tridiagonal matrix
       IF( ll_zAimp ) THEN
-         ALLOCATE(zwdia(jpi,jpj,jpk), zwinf(jpi,jpj,jpk),zwsup(jpi,jpj,jpk))
-         DO_3D( 0, 0, 0, 0, 1, jpkm1 )
+         ALLOCATE(zwdia(A2D(nn_hls),jpk), zwinf(A2D(nn_hls),jpk), zwsup(A2D(nn_hls),jpk))
+         DO_3D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, 1, jpkm1 )
             zwdia(ji,jj,jk) =  1._wp + p2dt * ( MAX( wi(ji,jj,jk) , 0._wp ) - MIN( wi(ji,jj,jk+1) , 0._wp ) )   &
             &                               / e3t(ji,jj,jk,Krhs)
@@ -151,5 +155,5 @@
          !        !==  upstream advection with initial mass fluxes & intermediate update  ==!
          !                    !* upstream tracer flux in the i and j direction 
-         DO_3D( 1, 0, 1, 0, 1, jpkm1 )
+         DO_3D( nn_hls, nn_hls-1, nn_hls, nn_hls-1, 1, jpkm1 )
             ! upstream scheme
             zfp_ui = pU(ji,jj,jk) + ABS( pU(ji,jj,jk) )
@@ -178,5 +182,5 @@
          ENDIF
          !               
-         DO_3D( 0, 0, 0, 0, 1, jpkm1 )   !* trend and after field with monotonic scheme
+         DO_3D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, 1, jpkm1 )   !* trend and after field with monotonic scheme
             !                               ! total intermediate advective trends
             ztra = - (  zwx(ji,jj,jk) - zwx(ji-1,jj  ,jk  )   &
@@ -194,5 +198,5 @@
             !
             ztw(:,:,1) = 0._wp ; ztw(:,:,jpk) = 0._wp ;
-            DO_3D( 0, 0, 0, 0, 2, jpkm1 )       ! Interior value ( multiplied by wmask)
+            DO_3D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, 2, jpkm1 )       ! Interior value ( multiplied by wmask)
                zfp_wk = wi(ji,jj,jk) + ABS( wi(ji,jj,jk) )
                zfm_wk = wi(ji,jj,jk) - ABS( wi(ji,jj,jk) )
@@ -206,5 +210,5 @@
             !
          END IF
-         !                
+         !
          IF( l_trd .OR. l_hst )  THEN             ! trend diagnostics (contribution of upstream fluxes)
             ztrdx(:,:,:) = zwx(:,:,:)   ;   ztrdy(:,:,:) = zwy(:,:,:)   ;   ztrdz(:,:,:) = zwz(:,:,:)
@@ -218,5 +222,5 @@
          !
          CASE(  2  )                   !- 2nd order centered
-            DO_3D( 1, 0, 1, 0, 1, jpkm1 )
+            DO_3D( nn_hls, nn_hls-1, nn_hls, nn_hls-1, 1, jpkm1 )
                zwx(ji,jj,jk) = 0.5_wp * pU(ji,jj,jk) * ( pt(ji,jj,jk,jn,Kmm) + pt(ji+1,jj,jk,jn,Kmm) ) - zwx(ji,jj,jk)
                zwy(ji,jj,jk) = 0.5_wp * pV(ji,jj,jk) * ( pt(ji,jj,jk,jn,Kmm) + pt(ji,jj+1,jk,jn,Kmm) ) - zwy(ji,jj,jk)
@@ -238,20 +242,23 @@
             CALL lbc_lnk_multi( 'traadv_fct', zltu, 'T', 1.0_wp , zltv, 'T', 1.0_wp )   ! Lateral boundary cond. (unchanged sgn)
             !
-            DO_3D( 1, 0, 1, 0, 1, jpkm1 )    ! Horizontal advective fluxes
+            DO_3D( 1, 0, 1, 0, 1, jpkm1 )
                zC2t_u = pt(ji,jj,jk,jn,Kmm) + pt(ji+1,jj  ,jk,jn,Kmm)   ! 2 x C2 interpolation of T at u- & v-points
                zC2t_v = pt(ji,jj,jk,jn,Kmm) + pt(ji  ,jj+1,jk,jn,Kmm)
-               !                                                        ! C4 minus upstream advective fluxes 
+               !                                                        ! C4 minus upstream advective fluxes
                zwx(ji,jj,jk) =  0.5_wp * pU(ji,jj,jk) * ( zC2t_u + zltu(ji,jj,jk) - zltu(ji+1,jj,jk) ) - zwx(ji,jj,jk)
                zwy(ji,jj,jk) =  0.5_wp * pV(ji,jj,jk) * ( zC2t_v + zltv(ji,jj,jk) - zltv(ji,jj+1,jk) ) - zwy(ji,jj,jk)
             END_3D
+            IF (nn_hls.EQ.2) CALL lbc_lnk_multi( 'traadv_fct', zwx, 'U', -1.0_wp, zwy, 'V', -1.0_wp )   ! Lateral boundary cond. (unchanged sgn)
             !
          CASE(  41 )                   !- 4th order centered       ==>>   !!gm coding attempt   need to be tested
             ztu(:,:,jpk) = 0._wp             ! Bottom value : flux set to zero
             ztv(:,:,jpk) = 0._wp
-            DO_3D( 1, 0, 1, 0, 1, jpkm1 )    ! 1st derivative (gradient)
+            DO_3D( nn_hls, nn_hls-1, nn_hls, nn_hls-1, 1, jpkm1 )    ! 1st derivative (gradient)
                ztu(ji,jj,jk) = ( pt(ji+1,jj  ,jk,jn,Kmm) - pt(ji,jj,jk,jn,Kmm) ) * umask(ji,jj,jk)
                ztv(ji,jj,jk) = ( pt(ji  ,jj+1,jk,jn,Kmm) - pt(ji,jj,jk,jn,Kmm) ) * vmask(ji,jj,jk)
             END_3D
-            CALL lbc_lnk_multi( 'traadv_fct', ztu, 'U', -1.0_wp , ztv, 'V', -1.0_wp )   ! Lateral boundary cond. (unchanged sgn)
+            IF (nn_hls.EQ.1) CALL lbc_lnk_multi( 'traadv_fct', ztu, 'U', -1.0_wp , ztv, 'V', -1.0_wp )   ! Lateral boundary cond. (unchanged sgn)
+            !
+            IF (nn_hls.EQ.1) CALL lbc_lnk_multi( 'traadv_fct', ztu, 'U', -1.0_wp , ztv, 'V', -1.0_wp )   ! Lateral boundary cond. (unchanged sgn)
             !
             DO_3D( 0, 0, 0, 0, 1, jpkm1 )    ! Horizontal advective fluxes
@@ -265,4 +272,5 @@
                zwy(ji,jj,jk) =  0.5_wp * pV(ji,jj,jk) * zC4t_v - zwy(ji,jj,jk)
             END_3D
+            IF (nn_hls.EQ.2) CALL lbc_lnk_multi( 'traadv_fct', zwx, 'U', -1.0_wp , zwy, 'V', -1.0_wp )   ! Lateral boundary cond. (unchanged sgn)
             !
          END SELECT
@@ -271,5 +279,5 @@
          !
          CASE(  2  )                   !- 2nd order centered
-            DO_3D( 0, 0, 0, 0, 2, jpkm1 )
+            DO_3D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, 2, jpkm1 )
                zwz(ji,jj,jk) =  (  pW(ji,jj,jk) * 0.5_wp * ( pt(ji,jj,jk,jn,Kmm) + pt(ji,jj,jk-1,jn,Kmm) )   &
                   &              - zwz(ji,jj,jk)  ) * wmask(ji,jj,jk)
@@ -278,5 +286,5 @@
          CASE(  4  )                   !- 4th order COMPACT
             CALL interp_4th_cpt( pt(:,:,:,jn,Kmm) , ztw )   ! zwt = COMPACT interpolation of T at w-point
-            DO_3D( 0, 0, 0, 0, 2, jpkm1 )
+            DO_3D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, 2, jpkm1 )
                zwz(ji,jj,jk) = ( pW(ji,jj,jk) * ztw(ji,jj,jk) - zwz(ji,jj,jk) ) * wmask(ji,jj,jk)
             END_3D
@@ -286,24 +294,34 @@
             zwz(:,:,1) = 0._wp   ! only ocean surface as interior zwz values have been w-masked
          ENDIF
-         !         
+         !
+         IF (nn_hls.EQ.1) THEN
+            CALL lbc_lnk_multi( 'traadv_fct', zwi, 'T', 1.0_wp, zwx, 'U', -1.0_wp , zwy, 'V', -1.0_wp, zwz, 'T', 1.0_wp )
+         ELSE
+            CALL lbc_lnk( 'traadv_fct', zwi, 'T', 1.0_wp)
+         END IF
+         !
+         IF (nn_hls.EQ.1) THEN
+            CALL lbc_lnk_multi( 'traadv_fct', zwi, 'T', 1.0_wp, zwx, 'U', -1.0_wp , zwy, 'V', -1.0_wp, zwz, 'T', 1.0_wp )
+         ELSE
+            CALL lbc_lnk( 'traadv_fct', zwi, 'T', 1.0_wp)
+         END IF
+         !
          IF ( ll_zAimp ) THEN
-            DO_3D( 0, 0, 0, 0, 1, jpkm1 )    !* trend and after field with monotonic scheme
+            DO_3D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, 1, jpkm1 )    !* trend and after field with monotonic scheme
                !                                                ! total intermediate advective trends
                ztra = - (  zwx(ji,jj,jk) - zwx(ji-1,jj  ,jk  )   &
                   &      + zwy(ji,jj,jk) - zwy(ji  ,jj-1,jk  )   &
                   &      + zwz(ji,jj,jk) - zwz(ji  ,jj  ,jk+1) ) * r1_e1e2t(ji,jj)
-               ztw(ji,jj,jk)  = zwi(ji,jj,jk) + p2dt * ztra / e3t(ji,jj,jk,Krhs) * tmask(ji,jj,jk)
+               ztw(ji,jj,jk) = zwi(ji,jj,jk) + p2dt * ztra / e3t(ji,jj,jk,Krhs) * tmask(ji,jj,jk)
             END_3D
             !
             CALL tridia_solver( zwdia, zwsup, zwinf, ztw, ztw , 0 )
             !
-            DO_3D( 0, 0, 0, 0, 2, jpkm1 )       ! Interior value ( multiplied by wmask)
+            DO_3D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, 2, jpkm1 )       ! Interior value ( multiplied by wmask)
                zfp_wk = wi(ji,jj,jk) + ABS( wi(ji,jj,jk) )
                zfm_wk = wi(ji,jj,jk) - ABS( wi(ji,jj,jk) )
-               zwz(ji,jj,jk) =  zwz(ji,jj,jk) + 0.5 * e1e2t(ji,jj) * ( zfp_wk * ztw(ji,jj,jk) + zfm_wk * ztw(ji,jj,jk-1) ) * wmask(ji,jj,jk)
+               zwz(ji,jj,jk) = zwz(ji,jj,jk) + 0.5 * e1e2t(ji,jj) * ( zfp_wk * ztw(ji,jj,jk) + zfm_wk * ztw(ji,jj,jk-1) ) * wmask(ji,jj,jk)
             END_3D
          END IF
-         !
-         CALL lbc_lnk_multi( 'traadv_fct', zwi, 'T', 1.0_wp, zwx, 'U', -1.0_wp , zwy, 'V', -1.0_wp,  zwz, 'W',  1.0_wp )
          !
          !        !==  monotonicity algorithm  ==!
@@ -334,8 +352,9 @@
                   &                                        * r1_e1e2t(ji,jj) / e3t(ji,jj,jk,Kmm)
             END_3D
-         END IF         
-         !
+         END IF
+         ! NOTE: [tiling-comms-merge] I tested this
+         ! NOT TESTED - NEED l_trd OR l_hst TRUE
          IF( l_trd .OR. l_hst ) THEN   ! trend diagnostics // heat/salt transport
-            ztrdx(:,:,:) = ztrdx(:,:,:) + zwx(:,:,:)  ! <<< add anti-diffusive fluxes 
+            ztrdx(:,:,:) = ztrdx(:,:,:) + zwx(:,:,:)  ! <<< add anti-diffusive fluxes
             ztrdy(:,:,:) = ztrdy(:,:,:) + zwy(:,:,:)  !     to upstream fluxes
             ztrdz(:,:,:) = ztrdz(:,:,:) + zwz(:,:,:)  !
@@ -350,4 +369,6 @@
             !
          ENDIF
+         ! NOTE: [tiling-comms-merge] I tested this
+         ! NOT TESTED - NEED l_ptr TRUE
          IF( l_ptr ) THEN              ! "Poleward" transports
             zptry(:,:,:) = zptry(:,:,:) + zwy(:,:,:)  ! <<< add anti-diffusive fluxes
@@ -360,5 +381,5 @@
          DEALLOCATE( zwdia, zwinf, zwsup )
       ENDIF
-      IF( l_trd .OR. l_hst ) THEN 
+      IF( l_trd .OR. l_hst ) THEN
          DEALLOCATE( ztrdx, ztrdy, ztrdz )
       ENDIF
@@ -383,8 +404,9 @@
       !!       in-space based differencing for fluid
       !!----------------------------------------------------------------------
-      INTEGER                          , INTENT(in   ) ::   Kmm             ! time level index 
-      REAL(wp)                         , INTENT(in   ) ::   p2dt            ! tracer time-step
-      REAL(wp), DIMENSION (jpi,jpj,jpk), INTENT(in   ) ::   pbef, paft      ! before & after field
-      REAL(wp), DIMENSION (jpi,jpj,jpk), INTENT(inout) ::   paa, pbb, pcc   ! monotonic fluxes in the 3 directions
+      INTEGER                         , INTENT(in   ) ::   Kmm             ! time level index
+      REAL(wp)                        , INTENT(in   ) ::   p2dt            ! tracer time-step
+      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in   ) ::   pbef            ! before field
+      REAL(wp), DIMENSION(A2D(nn_hls)    ,jpk), INTENT(in   ) ::   paft            ! after field
+      REAL(wp), DIMENSION(A2D(nn_hls)    ,jpk), INTENT(inout) ::   paa, pbb, pcc   ! monotonic fluxes in the 3 directions
       !
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
@@ -392,5 +414,5 @@
       REAL(dp) ::   zpos, zneg, zbt, za, zb, zc, zbig, zrtrn    ! local scalars
       REAL(dp) ::   zau, zbu, zcu, zav, zbv, zcv, zup, zdo            !   -      -
-      REAL(dp), DIMENSION(jpi,jpj,jpk) :: zbetup, zbetdo, zbup, zbdo
+      REAL(dp), DIMENSION(A2D(nn_hls),jpk) :: zbetup, zbetdo, zbup, zbdo
       !!----------------------------------------------------------------------
       !
@@ -402,12 +424,14 @@
       ! --------------------
       ! max/min of pbef & paft with large negative/positive value (-/+zbig) inside land
-      zbup = MAX( pbef * tmask - zbig * ( 1._wp - tmask ),   &
-         &        paft * tmask - zbig * ( 1._wp - tmask )  )
-      zbdo = MIN( pbef * tmask + zbig * ( 1._wp - tmask ),   &
-         &        paft * tmask + zbig * ( 1._wp - tmask )  )
+      DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpk )
+         zbup(ji,jj,jk) = MAX( pbef(ji,jj,jk) * tmask(ji,jj,jk) - zbig * ( 1._wp - tmask(ji,jj,jk) ),   &
+            &                  paft(ji,jj,jk) * tmask(ji,jj,jk) - zbig * ( 1._wp - tmask(ji,jj,jk) )  )
+         zbdo(ji,jj,jk) = MIN( pbef(ji,jj,jk) * tmask(ji,jj,jk) + zbig * ( 1._wp - tmask(ji,jj,jk) ),   &
+            &                  paft(ji,jj,jk) * tmask(ji,jj,jk) + zbig * ( 1._wp - tmask(ji,jj,jk) )  )
+      END_3D
 
       DO jk = 1, jpkm1
          ikm1 = MAX(jk-1,1)
-         DO_2D( 0, 0, 0, 0 )
+         DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )
 
             ! search maximum in neighbourhood
@@ -439,9 +463,9 @@
          END_2D
       END DO
-      CALL lbc_lnk_multi( 'traadv_fct', zbetup, 'T', 1.0_wp , zbetdo, 'T', 1.0_wp )   ! lateral boundary cond. (unchanged sign)
+      IF (nn_hls.EQ.1) CALL lbc_lnk_multi( 'traadv_fct', zbetup, 'T', 1.0_wp , zbetdo, 'T', 1.0_wp )   ! lateral boundary cond. (unchanged sign)
 
       ! 3. monotonic flux in the i & j direction (paa & pbb)
       ! ----------------------------------------
-      DO_3D( 0, 0, 0, 0, 1, jpkm1 )
+      DO_3D( 1, 0, 1, 0, 1, jpkm1 )
          zau = MIN( 1._wp, zbetdo(ji,jj,jk), zbetup(ji+1,jj,jk) )
          zbu = MIN( 1._wp, zbetup(ji,jj,jk), zbetdo(ji+1,jj,jk) )
@@ -461,5 +485,4 @@
          pcc(ji,jj,jk+1) = pcc(ji,jj,jk+1) * ( zc * za + ( 1._wp - zc) * zb )
       END_3D
-      CALL lbc_lnk_multi( 'traadv_fct', paa, 'U', -1.0_wp , pbb, 'V', -1.0_wp )   ! lateral boundary condition (changed sign)
       !
    END SUBROUTINE nonosc
@@ -537,14 +560,14 @@
       !!----------------------------------------------------------------------
       REAL(wp),DIMENSION(jpi,jpj,jpk), INTENT(in   ) ::   pt_in    ! field at t-point
-      REAL(wp),DIMENSION(jpi,jpj,jpk), INTENT(  out) ::   pt_out   ! field interpolated at w-point
+      REAL(wp),DIMENSION(A2D(nn_hls)    ,jpk), INTENT(  out) ::   pt_out   ! field interpolated at w-point
       !
       INTEGER ::   ji, jj, jk   ! dummy loop integers
       INTEGER ::   ikt, ikb     ! local integers
-      REAL(wp),DIMENSION(jpi,jpj,jpk) :: zwd, zwi, zws, zwrm, zwt
+      REAL(wp),DIMENSION(A2D(nn_hls),jpk) :: zwd, zwi, zws, zwrm, zwt
       !!----------------------------------------------------------------------
       !
       !                      !==  build the three diagonal matrix & the RHS  ==!
       !
-      DO_3D( 0, 0, 0, 0, 3, jpkm1 )    ! interior (from jk=3 to jpk-1)
+      DO_3D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, 3, jpkm1 )    ! interior (from jk=3 to jpk-1)
          zwd (ji,jj,jk) = 3._wp * wmask(ji,jj,jk) + 1._wp                 !       diagonal
          zwi (ji,jj,jk) =         wmask(ji,jj,jk)                         ! lower diagonal
@@ -565,5 +588,5 @@
       END IF
       !
-      DO_2D( 0, 0, 0, 0 )              ! 2nd order centered at top & bottom
+      DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )              ! 2nd order centered at top & bottom
          ikt = mikt(ji,jj) + 1            ! w-point below the 1st  wet point
          ikb = MAX(mbkt(ji,jj), 2)        !     -   above the last wet point
@@ -582,22 +605,22 @@
       !                       !==  tridiagonal solver  ==!
       !
-      DO_2D( 0, 0, 0, 0 )           !* 1st recurrence:   Tk = Dk - Ik Sk-1 / Tk-1
+      DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )           !* 1st recurrence:   Tk = Dk - Ik Sk-1 / Tk-1
          zwt(ji,jj,2) = zwd(ji,jj,2)
       END_2D
-      DO_3D( 0, 0, 0, 0, 3, jpkm1 )
+      DO_3D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, 3, jpkm1 )
          zwt(ji,jj,jk) = zwd(ji,jj,jk) - zwi(ji,jj,jk) * zws(ji,jj,jk-1) /zwt(ji,jj,jk-1)
       END_3D
       !
-      DO_2D( 0, 0, 0, 0 )           !* 2nd recurrence:    Zk = Yk - Ik / Tk-1  Zk-1
+      DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )           !* 2nd recurrence:    Zk = Yk - Ik / Tk-1  Zk-1
          pt_out(ji,jj,2) = zwrm(ji,jj,2)
       END_2D
-      DO_3D( 0, 0, 0, 0, 3, jpkm1 )
+      DO_3D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, 3, jpkm1 )
          pt_out(ji,jj,jk) = zwrm(ji,jj,jk) - zwi(ji,jj,jk) / zwt(ji,jj,jk-1) *pt_out(ji,jj,jk-1)             
       END_3D
 
-      DO_2D( 0, 0, 0, 0 )           !* 3d recurrence:    Xk = (Zk - Sk Xk+1 ) / Tk
+      DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )           !* 3d recurrence:    Xk = (Zk - Sk Xk+1 ) / Tk
          pt_out(ji,jj,jpkm1) = pt_out(ji,jj,jpkm1) / zwt(ji,jj,jpkm1)
       END_2D
-      DO_3DS( 0, 0, 0, 0, jpk-2, 2, -1 )
+      DO_3DS( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, jpk-2, 2, -1 )
          pt_out(ji,jj,jk) = ( pt_out(ji,jj,jk) - zws(ji,jj,jk) * pt_out(ji,jj,jk+1) ) / zwt(ji,jj,jk)
       END_3D
@@ -626,34 +649,34 @@
       !!        The 3d array zwt is used as a work space array.
       !!----------------------------------------------------------------------
-      REAL(wp),DIMENSION(:,:,:), INTENT(in   ) ::   pD, pU, PL    ! 3-diagonal matrix
-      REAL(wp),DIMENSION(:,:,:), INTENT(in   ) ::   pRHS          ! Right-Hand-Side
-      REAL(wp),DIMENSION(:,:,:), INTENT(  out) ::   pt_out        !!gm field at level=F(klev)
-      INTEGER                  , INTENT(in   ) ::   klev          ! =1 pt_out at w-level 
-      !                                                           ! =0 pt at t-level
+      REAL(wp),DIMENSION(A2D(nn_hls),jpk), INTENT(in   ) ::   pD, pU, PL    ! 3-diagonal matrix
+      REAL(wp),DIMENSION(A2D(nn_hls),jpk), INTENT(in   ) ::   pRHS          ! Right-Hand-Side
+      REAL(wp),DIMENSION(A2D(nn_hls),jpk), INTENT(  out) ::   pt_out        !!gm field at level=F(klev)
+      INTEGER                    , INTENT(in   ) ::   klev          ! =1 pt_out at w-level
+      !                                                             ! =0 pt at t-level
       INTEGER ::   ji, jj, jk   ! dummy loop integers
       INTEGER ::   kstart       ! local indices
-      REAL(wp),DIMENSION(jpi,jpj,jpk) ::   zwt   ! 3D work array
+      REAL(wp),DIMENSION(A2D(nn_hls),jpk) ::   zwt   ! 3D work array
       !!----------------------------------------------------------------------
       !
       kstart =  1  + klev
       !
-      DO_2D( 0, 0, 0, 0 )                         !* 1st recurrence:   Tk = Dk - Ik Sk-1 / Tk-1
+      DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )                         !* 1st recurrence:   Tk = Dk - Ik Sk-1 / Tk-1
          zwt(ji,jj,kstart) = pD(ji,jj,kstart)
       END_2D
-      DO_3D( 0, 0, 0, 0, kstart+1, jpkm1 )
+      DO_3D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, kstart+1, jpkm1 )
          zwt(ji,jj,jk) = pD(ji,jj,jk) - pL(ji,jj,jk) * pU(ji,jj,jk-1) /zwt(ji,jj,jk-1)
       END_3D
       !
-      DO_2D( 0, 0, 0, 0 )                        !* 2nd recurrence:    Zk = Yk - Ik / Tk-1  Zk-1
+      DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )                        !* 2nd recurrence:    Zk = Yk - Ik / Tk-1  Zk-1
          pt_out(ji,jj,kstart) = pRHS(ji,jj,kstart)
       END_2D
-      DO_3D( 0, 0, 0, 0, kstart+1, jpkm1 )
+      DO_3D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, kstart+1, jpkm1 )
          pt_out(ji,jj,jk) = pRHS(ji,jj,jk) - pL(ji,jj,jk) / zwt(ji,jj,jk-1) *pt_out(ji,jj,jk-1)             
       END_3D
 
-      DO_2D( 0, 0, 0, 0 )                       !* 3d recurrence:    Xk = (Zk - Sk Xk+1 ) / Tk
+      DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )                       !* 3d recurrence:    Xk = (Zk - Sk Xk+1 ) / Tk
          pt_out(ji,jj,jpkm1) = pt_out(ji,jj,jpkm1) / zwt(ji,jj,jpkm1)
       END_2D
-      DO_3DS( 0, 0, 0, 0, jpk-2, kstart, -1 )
+      DO_3DS( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, jpk-2, kstart, -1 )
          pt_out(ji,jj,jk) = ( pt_out(ji,jj,jk) - pU(ji,jj,jk) * pt_out(ji,jj,jk+1) ) / zwt(ji,jj,jk)
       END_3D
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traadv_fct_lf.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traadv_fct_lf.F90	(revision 14012)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traadv_fct_lf.F90	(revision 14012)
@@ -0,0 +1,553 @@
+MODULE traadv_fct_lf
+   !!==============================================================================
+   !!                       ***  MODULE  traadv_fct  ***
+   !! Ocean  tracers:  horizontal & vertical advective trend (2nd/4th order Flux Corrected Transport method)
+   !!==============================================================================
+   !! History :  3.7  !  2015-09  (L. Debreu, G. Madec)  original code (inspired from traadv_tvd.F90)
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!  tra_adv_fct-lf : update the tracer trend with a 3D advective trends using a 2nd or 4th order FCT scheme
+   !!                   with sub-time-stepping in the vertical direction - loop fusion version
+   !!  nonosc_lf      : compute monotonic tracer fluxes by a non-oscillatory algorithm - loop fusion version 
+   !!----------------------------------------------------------------------
+   USE oce            ! ocean dynamics and active tracers
+   USE dom_oce        ! ocean space and time domain
+   USE trc_oce        ! share passive tracers/Ocean variables
+   USE trd_oce        ! trends: ocean variables
+   USE trdtra         ! tracers trends
+   USE diaptr         ! poleward transport diagnostics
+   USE diaar5         ! AR5 diagnostics
+   USE phycst  , ONLY : rho0_rcp
+   USE zdf_oce , ONLY : ln_zad_Aimp
+   !
+   USE in_out_manager ! I/O manager
+   USE iom            ! 
+   USE lib_mpp        ! MPP library
+   USE lbclnk         ! ocean lateral boundary condition (or mpp link) 
+   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)  
+   USE traadv_fct
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   tra_adv_fct_lf     ! called by traadv.F90
+
+   LOGICAL  ::   l_trd   ! flag to compute trends
+   LOGICAL  ::   l_ptr   ! flag to compute poleward transport
+   LOGICAL  ::   l_hst   ! flag to compute heat/salt transport
+   REAL(wp) ::   r1_6 = 1._wp / 6._wp   ! =1/6
+
+   !                                        ! tridiag solver associated indices:
+   INTEGER, PARAMETER ::   np_NH   = 0   ! Neumann homogeneous boundary condition
+   INTEGER, PARAMETER ::   np_CEN2 = 1   ! 2nd order centered  boundary condition
+
+   !! * Substitutions
+#  include "do_loop_substitute.h90"
+#  include "domzgr_substitute.h90"
+
+#define tracer_flux_i(out,zfp,zfm,ji,jj,jk) \
+        zfp = pU(ji,jj,jk) + ABS( pU(ji,jj,jk) ) ; \
+        zfm = pU(ji,jj,jk) - ABS( pU(ji,jj,jk) ) ; \
+        out = 0.5 * ( zfp * pt(ji,jj,jk,jn,Kbb) + zfm * pt(ji+1,jj,jk,jn,Kbb) )
+
+#define tracer_flux_j(out,zfp,zfm,ji,jj,jk) \
+        zfp = pV(ji,jj,jk) + ABS( pV(ji,jj,jk) ) ; \
+        zfm = pV(ji,jj,jk) - ABS( pV(ji,jj,jk) ) ; \
+        out = 0.5 * ( zfp * pt(ji,jj,jk,jn,Kbb) + zfm * pt(ji,jj+1,jk,jn,Kbb) )
+
+#define search_in_neighbour(out,OP,vec,ji,jj,jk) \
+        out = OP(vec(ji,jj,jk),vec(ji-1,jj,jk),vec(ji+1,jj,jk), \
+        vec(ji,jj-1,jk),vec(ji,jj+1,jk),vec(ji,jj,MAX(jk-1,1)),vec(ji,jj,jk+1))
+
+#define pos_part_of_flux(ji,jj,jk,out) \
+        out = MAX(0.,paa_in(ji-1,jj,jk)) - MIN(0.,paa_in(ji,jj,jk)) \
+        + MAX(0.,pbb_in(ji,jj-1,jk)) - MIN(0.,pbb_in(ji,jj,jk)) \
+        + MAX(0.,pcc_in(ji,jj,jk+1)) - MIN(0.,pcc_in(ji,jj,jk)) 
+
+#define neg_part_of_flux(ji,jj,jk,out) \
+        out = MAX( 0.,paa_in(ji,jj,jk) ) - MIN( 0., paa_in(ji-1,jj,jk)) \
+        + MAX( 0.,pbb_in(ji,jj,jk) ) - MIN( 0., pbb_in(ji,jj-1,jk)) \
+        + MAX( 0.,pcc_in(ji,jj,jk) ) - MIN( 0., pcc_in(ji,jj,jk+1))
+
+#define beta_terms(bt,betup,betdo,up,pos,do,neg,ji,jj,jk) \
+        bt = e1e2t(ji,jj) * e3t(ji,jj,jk,Kmm) / p2dt ; \
+        betup = ( up            - paft(ji,jj,jk) ) / ( pos + zrtrn ) * bt ; \
+        betdo = ( paft(ji,jj,jk) - do            ) / ( neg + zrtrn ) * bt
+
+#define monotonic_flux(a,b,c,betup_p1,betdo_p1,vec,vec_in,jk) \
+        a = MIN( 1._wp, zbetdo(ji,jj), betup_p1 ) ; \
+        b = MIN( 1._wp, zbetup(ji,jj), betdo_p1 ) ; \
+        c = ( 0.5_wp  + SIGN( 0.5_wp , vec_in(ji,jj,jk) ) ) ; \
+        vec(ji,jj,jk) = vec_in(ji,jj,jk) * ( c * a + ( 1._wp - c) * b )
+
+#define monotonic_flux_k(a,b,c,betup,betdo,vec,vec_in,jk) \
+        a = MIN( 1._wp, betdo, zbetup_ptr(ji,jj) ) ; \
+        b = MIN( 1._wp, betup, zbetdo_ptr(ji,jj) ) ; \
+        c = ( 0.5 + SIGN( 0.5_wp , vec_in(ji,jj,jk) ) ) ; \
+        vec(ji,jj,jk) = vec_in(ji,jj,jk) * ( c * a + ( 1._wp - c) * b )
+
+   !!----------------------------------------------------------------------
+   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
+   !! $Id: traadv_fct.F90 13660 2020-10-22 10:47:32Z francesca $
+   !! Software governed by the CeCILL license (see ./LICENSE)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   SUBROUTINE tra_adv_fct_lf( kt, kit000, cdtype, p2dt, pU, pV, pW,       &
+      &                    Kbb, Kmm, pt, kjpt, Krhs, kn_fct_h, kn_fct_v )
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE tra_adv_fct  ***
+      !! 
+      !! **  Purpose :   Compute the now trend due to total advection of tracers
+      !!               and add it to the general trend of tracer equations
+      !!
+      !! **  Method  : - 2nd or 4th FCT scheme on the horizontal direction
+      !!               (choice through the value of kn_fct)
+      !!               - on the vertical the 4th order is a compact scheme 
+      !!               - corrected flux (monotonic correction) 
+      !!
+      !! ** Action : - update pt(:,:,:,:,Krhs)  with the now advective tracer trends
+      !!             - send trends to trdtra module for further diagnostics (l_trdtra=T)
+      !!             - poleward advective heat and salt transport (ln_diaptr=T)
+      !!----------------------------------------------------------------------
+      INTEGER                                  , INTENT(in   ) ::   kt              ! ocean time-step index
+      INTEGER                                  , INTENT(in   ) ::   Kbb, Kmm, Krhs  ! ocean time level indices
+      INTEGER                                  , INTENT(in   ) ::   kit000          ! first time step index
+      CHARACTER(len=3)                         , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator)
+      INTEGER                                  , INTENT(in   ) ::   kjpt            ! number of tracers
+      INTEGER                                  , INTENT(in   ) ::   kn_fct_h        ! order of the FCT scheme (=2 or 4)
+      INTEGER                                  , INTENT(in   ) ::   kn_fct_v        ! order of the FCT scheme (=2 or 4)
+      REAL(wp)                                 , INTENT(in   ) ::   p2dt            ! tracer time-step
+      REAL(wp), DIMENSION(jpi,jpj,jpk         ), INTENT(inout) ::   pU, pV, pW      ! 3 ocean volume flux components
+      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt,jpt), INTENT(inout) ::   pt              ! tracers and RHS of tracer equation
+      !
+      INTEGER  ::   ji, jj, jk, jn                           ! dummy loop indices  
+      REAL(wp) ::   ztra                                     ! local scalar
+      REAL(wp) ::   zwx_im1, zfp_ui, zfp_ui_m1, zfp_vj, zfp_vj_m1, zfp_wk, zC2t_u, zC4t_u   !   -      -
+      REAL(wp) ::   zwy_jm1, zfm_ui, zfm_ui_m1, zfm_vj, zfm_vj_m1, zfm_wk, zC2t_v, zC4t_v   !   -      -
+      REAL(wp) ::   ztu_im1, ztu_ip1, ztv_jm1, ztv_jp1  
+      REAL(wp), DIMENSION(jpi,jpj,jpk)        ::   zwi, zwx_3d, zwy_3d, zwz, ztw, zltu_3d, zltv_3d, ztu, ztv
+      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   ztrdx, ztrdy, ztrdz, zptry
+      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   zwinf, zwdia, zwsup
+      LOGICAL  ::   ll_zAimp                                 ! flag to apply adaptive implicit vertical advection
+      !!----------------------------------------------------------------------
+      !
+      IF( kt == kit000 )  THEN
+         IF(lwp) WRITE(numout,*)
+         IF(lwp) WRITE(numout,*) 'tra_adv_fct_lf : FCT advection scheme on ', cdtype
+         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
+      ENDIF
+      !! -- init to 0
+      zwx_3d(:,:,:) = 0._wp
+      zwy_3d(:,:,:) = 0._wp
+      zwz(:,:,:) = 0._wp
+      zwi(:,:,:) = 0._wp
+      !
+      l_trd = .FALSE.            ! set local switches
+      l_hst = .FALSE.
+      l_ptr = .FALSE.
+      ll_zAimp = .FALSE.
+      IF( ( cdtype == 'TRA' .AND. l_trdtra  ) .OR. ( cdtype =='TRC' .AND. l_trdtrc ) )      l_trd = .TRUE.
+      IF(   cdtype == 'TRA' .AND. ( iom_use( 'sophtadv' ) .OR. iom_use( 'sophtadv' ) ) )    l_ptr = .TRUE. 
+      IF(   cdtype == 'TRA' .AND. ( iom_use("uadv_heattr") .OR. iom_use("vadv_heattr") .OR.  &
+         &                         iom_use("uadv_salttr") .OR. iom_use("vadv_salttr")  ) )  l_hst = .TRUE.
+      !
+      IF( l_trd .OR. l_hst )  THEN
+         ALLOCATE( ztrdx(jpi,jpj,jpk), ztrdy(jpi,jpj,jpk), ztrdz(jpi,jpj,jpk) )
+         ztrdx(:,:,:) = 0._wp   ;    ztrdy(:,:,:) = 0._wp   ;   ztrdz(:,:,:) = 0._wp
+      ENDIF
+      !
+      IF( l_ptr ) THEN  
+         ALLOCATE( zptry(jpi,jpj,jpk) )
+         zptry(:,:,:) = 0._wp
+      ENDIF
+      !
+      ! If adaptive vertical advection, check if it is needed on this PE at this time
+      IF( ln_zad_Aimp ) THEN
+         IF( MAXVAL( ABS( wi(:,:,:) ) ) > 0._wp ) ll_zAimp = .TRUE.
+      END IF
+      ! If active adaptive vertical advection, build tridiagonal matrix
+      IF( ll_zAimp ) THEN
+         ALLOCATE(zwdia(jpi,jpj,jpk), zwinf(jpi,jpj,jpk),zwsup(jpi,jpj,jpk))
+         DO_3D( 1, 1, 1, 1, 1, jpkm1 )
+            zwdia(ji,jj,jk) =  1._wp + p2dt * ( MAX( wi(ji,jj,jk) , 0._wp ) - MIN( wi(ji,jj,jk+1) , 0._wp ) )   &
+            &                               / e3t(ji,jj,jk,Krhs)
+            zwinf(ji,jj,jk) =  p2dt * MIN( wi(ji,jj,jk  ) , 0._wp ) / e3t(ji,jj,jk,Krhs)
+            zwsup(ji,jj,jk) = -p2dt * MAX( wi(ji,jj,jk+1) , 0._wp ) / e3t(ji,jj,jk,Krhs)
+         END_3D
+      END IF
+      !
+      DO jn = 1, kjpt            !==  loop over the tracers  ==!
+         !
+         !        !==  upstream advection with initial mass fluxes & intermediate update  ==!
+         !                               !* upstream tracer flux in the k direction *!
+         DO_3D( 1, 1, 1, 1, 2, jpkm1 )      ! Interior value ( multiplied by wmask)
+            zfp_wk = pW(ji,jj,jk) + ABS( pW(ji,jj,jk) )
+            zfm_wk = pW(ji,jj,jk) - ABS( pW(ji,jj,jk) )
+            zwz(ji,jj,jk) = 0.5 * ( zfp_wk * pt(ji,jj,jk,jn,Kbb) + zfm_wk * pt(ji,jj,jk-1,jn,Kbb) ) * wmask(ji,jj,jk)
+         END_3D
+         IF( ln_linssh ) THEN               ! top ocean value (only in linear free surface as zwz has been w-masked)
+            IF( ln_isfcav ) THEN                        ! top of the ice-shelf cavities and at the ocean surface
+               DO_2D( 1, 1, 1, 1 )
+                  zwz(ji,jj, mikt(ji,jj) ) = pW(ji,jj,mikt(ji,jj)) * pt(ji,jj,mikt(ji,jj),jn,Kbb)   ! linear free surface 
+               END_2D
+            ELSE                                        ! no cavities: only at the ocean surface
+               DO_2D( 1, 1, 1, 1 )
+                  zwz(ji,jj,1) = pW(ji,jj,1) * pt(ji,jj,1,jn,Kbb)
+               END_2D
+            ENDIF
+         ENDIF
+         !               
+         !                    !* upstream tracer flux in the i and j direction 
+         DO jk = 1, jpkm1
+            DO jj = 1, jpj-1
+               tracer_flux_i(zwx_3d(1,jj,jk),zfp_ui,zfm_ui,1,jj,jk)
+               tracer_flux_j(zwy_3d(1,jj,jk),zfp_vj,zfm_vj,1,jj,jk)
+            END DO
+            DO ji = 1, jpi-1
+               tracer_flux_i(zwx_3d(ji,1,jk),zfp_ui,zfm_ui,ji,1,jk)
+               tracer_flux_j(zwy_3d(ji,1,jk),zfp_vj,zfm_vj,ji,1,jk)
+            END DO
+            DO_2D( 1, 1, 1, 1 )
+               tracer_flux_i(zwx_3d(ji,jj,jk),zfp_ui,zfm_ui,ji,jj,jk)
+               tracer_flux_i(zwx_im1,zfp_ui_m1,zfm_ui_m1,ji-1,jj,jk)
+               tracer_flux_j(zwy_3d(ji,jj,jk),zfp_vj,zfm_vj,ji,jj,jk)
+               tracer_flux_j(zwy_jm1,zfp_vj_m1,zfm_vj_m1,ji,jj-1,jk)
+               ztra = - ( zwx_3d(ji,jj,jk) - zwx_im1 + zwy_3d(ji,jj,jk) - zwy_jm1 + zwz(ji,jj,jk) - zwz(ji,jj,jk+1) ) * r1_e1e2t(ji,jj)
+               !                               ! update and guess with monotonic sheme
+               pt(ji,jj,jk,jn,Krhs) =                   pt(ji,jj,jk,jn,Krhs) +       ztra   &
+                  &                                  / e3t(ji,jj,jk,Kmm ) * tmask(ji,jj,jk)
+               zwi(ji,jj,jk)    = ( e3t(ji,jj,jk,Kbb) * pt(ji,jj,jk,jn,Kbb) + p2dt * ztra ) &
+                  &                                  / e3t(ji,jj,jk,Krhs) * tmask(ji,jj,jk)
+            END_2D
+         END DO
+         
+         IF ( ll_zAimp ) THEN
+            CALL tridia_solver( zwdia, zwsup, zwinf, zwi, zwi , 0 )
+            !
+            ztw(:,:,1) = 0._wp ; ztw(:,:,jpk) = 0._wp ;
+            DO_3D( 1, 1, 1, 1, 2, jpkm1 )       ! Interior value ( multiplied by wmask)
+               zfp_wk = wi(ji,jj,jk) + ABS( wi(ji,jj,jk) )
+               zfm_wk = wi(ji,jj,jk) - ABS( wi(ji,jj,jk) )
+               ztw(ji,jj,jk) =  0.5 * e1e2t(ji,jj) * ( zfp_wk * zwi(ji,jj,jk) + zfm_wk * zwi(ji,jj,jk-1) ) * wmask(ji,jj,jk)
+               zwz(ji,jj,jk) = zwz(ji,jj,jk) + ztw(ji,jj,jk) ! update vertical fluxes
+            END_3D
+            DO_3D( 0, 0, 0, 0, 1, jpkm1 )
+               pt(ji,jj,jk,jn,Krhs) = pt(ji,jj,jk,jn,Krhs) - ( ztw(ji,jj,jk) - ztw(ji  ,jj  ,jk+1) ) &
+                  &                                        * r1_e1e2t(ji,jj) / e3t(ji,jj,jk,Kmm)
+            END_3D
+            !
+         END IF
+         !                
+         IF( l_trd .OR. l_hst )  THEN             ! trend diagnostics (contribution of upstream fluxes)
+            ztrdx(:,:,:) = zwx_3d(:,:,:)   ;   ztrdy(:,:,:) = zwy_3d(:,:,:)   ;   ztrdz(:,:,:) = zwz(:,:,:)
+         END IF
+         !                             ! "Poleward" heat and salt transports (contribution of upstream fluxes)
+         IF( l_ptr )   zptry(:,:,:) = zwy_3d(:,:,:) 
+         !
+         !        !==  anti-diffusive flux : high order minus low order  ==!
+         !
+         SELECT CASE( kn_fct_h )    !* horizontal anti-diffusive fluxes
+         !
+         CASE(  2  )                   !- 2nd order centered
+            DO_3D( 2, 1, 2, 1, 1, jpkm1 )
+               zwx_3d(ji,jj,jk) = 0.5_wp * pU(ji,jj,jk) * ( pt(ji,jj,jk,jn,Kmm) + pt(ji+1,jj,jk,jn,Kmm) ) - zwx_3d(ji,jj,jk)
+               zwy_3d(ji,jj,jk) = 0.5_wp * pV(ji,jj,jk) * ( pt(ji,jj,jk,jn,Kmm) + pt(ji,jj+1,jk,jn,Kmm) ) - zwy_3d(ji,jj,jk)
+            END_3D
+            !
+         CASE(  4  )                   !- 4th order centered
+            zltu_3d(:,:,jpk) = 0._wp            ! Bottom value : flux set to zero
+            zltv_3d(:,:,jpk) = 0._wp
+            DO jk = 1, jpkm1                 ! Laplacian
+               DO_2D( 1, 0, 1, 0 )                 ! 1st derivative (gradient)
+                  ztu(ji,jj,jk) = ( pt(ji+1,jj  ,jk,jn,Kmm) - pt(ji,jj,jk,jn,Kmm) ) * umask(ji,jj,jk)
+                  ztv(ji,jj,jk) = ( pt(ji  ,jj+1,jk,jn,Kmm) - pt(ji,jj,jk,jn,Kmm) ) * vmask(ji,jj,jk)
+               END_2D
+               DO_2D( 0, 0, 0, 0 )                 ! 2nd derivative * 1/ 6
+                  zltu_3d(ji,jj,jk) = (  ztu(ji,jj,jk) + ztu(ji-1,jj,jk)  ) * r1_6
+                  zltv_3d(ji,jj,jk) = (  ztv(ji,jj,jk) + ztv(ji,jj-1,jk)  ) * r1_6
+               END_2D
+            END DO
+            CALL lbc_lnk_multi( 'traadv_fct', zltu_3d, 'T', 1.0_wp , zltv_3d, 'T', 1.0_wp )   ! Lateral boundary cond. (unchanged sgn)
+!            !
+            DO_3D( nn_hls, nn_hls-1, nn_hls, nn_hls-1, 1, jpkm1 )
+               zC2t_u = pt(ji,jj,jk,jn,Kmm) + pt(ji+1,jj  ,jk,jn,Kmm)   ! 2 x C2 interpolation of T at u- & v-points
+               zC2t_v = pt(ji,jj,jk,jn,Kmm) + pt(ji  ,jj+1,jk,jn,Kmm)
+               !                                                        ! C4 minus upstream advective fluxes 
+               zwx_3d(ji,jj,jk) =  0.5_wp * pU(ji,jj,jk) * ( zC2t_u + zltu_3d(ji,jj,jk) - zltu_3d(ji+1,jj,jk) ) - zwx_3d(ji,jj,jk)
+               zwy_3d(ji,jj,jk) =  0.5_wp * pV(ji,jj,jk) * ( zC2t_v + zltv_3d(ji,jj,jk) - zltv_3d(ji,jj+1,jk) ) - zwy_3d(ji,jj,jk)
+            END_3D
+            !
+            CALL lbc_lnk_multi( 'traadv_fct', zwx_3d, 'U', -1.0_wp , zwy_3d, 'V', -1.0_wp )   ! Lateral boundary cond. (unchanged sgn)
+         CASE(  41 )                   !- 4th order centered       ==>>   !!gm coding attempt   need to be tested
+            DO_3D( 0, 0, 0, 0, 1, jpkm1 )    ! Horizontal advective fluxes
+               ztu_im1 = ( pt(ji  ,jj  ,jk,jn,Kmm) - pt(ji-1,jj,jk,jn,Kmm) ) * umask(ji-1,jj,jk)
+               ztu_ip1 = ( pt(ji+2,jj  ,jk,jn,Kmm) - pt(ji+1,jj,jk,jn,Kmm) ) * umask(ji+1,jj,jk)
+
+               ztv_jm1 = ( pt(ji,jj  ,jk,jn,Kmm) - pt(ji,jj-1,jk,jn,Kmm) ) * vmask(ji,jj-1,jk)
+               ztv_jp1 = ( pt(ji,jj+2,jk,jn,Kmm) - pt(ji,jj+1,jk,jn,Kmm) ) * vmask(ji,jj+1,jk)
+
+               zC2t_u = pt(ji,jj,jk,jn,Kmm) + pt(ji+1,jj  ,jk,jn,Kmm)   ! 2 x C2 interpolation of T at u- & v-points (x2)
+               zC2t_v = pt(ji,jj,jk,jn,Kmm) + pt(ji  ,jj+1,jk,jn,Kmm)
+               !                                                  ! C4 interpolation of T at u- & v-points (x2)
+               zC4t_u =  zC2t_u + r1_6 * ( ztu_im1 - ztu_ip1 )
+               zC4t_v =  zC2t_v + r1_6 * ( ztv_jm1 - ztv_jp1 )
+               !                                                  ! C4 minus upstream advective fluxes 
+               zwx_3d(ji,jj,jk) =  0.5_wp * pU(ji,jj,jk) * zC4t_u - zwx_3d(ji,jj,jk)
+               zwy_3d(ji,jj,jk) =  0.5_wp * pV(ji,jj,jk) * zC4t_v - zwy_3d(ji,jj,jk)
+            END_3D
+            CALL lbc_lnk_multi( 'traadv_fct', zwx_3d, 'U', -1.0_wp , zwy_3d, 'V', -1.0_wp )   ! Lateral boundary cond. (unchanged sgn)
+            !
+         END SELECT
+         !                      
+         SELECT CASE( kn_fct_v )    !* vertical anti-diffusive fluxes (w-masked interior values)
+         !
+         CASE(  2  )                   !- 2nd order centered
+            DO_3D( 1, 1, 1, 1, 2, jpkm1 )
+               zwz(ji,jj,jk) =  (  pW(ji,jj,jk) * 0.5_wp * ( pt(ji,jj,jk,jn,Kmm) + pt(ji,jj,jk-1,jn,Kmm) )   &
+                  &              - zwz(ji,jj,jk)  ) * wmask(ji,jj,jk)
+            END_3D
+            !
+         CASE(  4  )                   !- 4th order COMPACT
+            CALL interp_4th_cpt( pt(:,:,:,jn,Kmm) , ztw )   ! zwt = COMPACT interpolation of T at w-point
+            DO_3D( 1, 1, 1, 1, 2, jpkm1 )
+               zwz(ji,jj,jk) = ( pW(ji,jj,jk) * ztw(ji,jj,jk) - zwz(ji,jj,jk) ) * wmask(ji,jj,jk)
+            END_3D
+            !
+         END SELECT
+         IF( ln_linssh ) THEN    ! top ocean value: high order = upstream  ==>>  zwz=0
+            zwz(:,:,1) = 0._wp   ! only ocean surface as interior zwz values have been w-masked
+         ENDIF
+         !         
+         CALL lbc_lnk( 'traadv_fct', zwi, 'T', 1.0_wp)
+         !
+         IF ( ll_zAimp ) THEN
+            DO_3D( 1, 1, 1, 1, 1, jpkm1 )    !* trend and after field with monotonic scheme
+               !                                                ! total intermediate advective trends
+               ztra = - (  zwx_3d(ji,jj,jk) - zwx_3d(ji-1,jj  ,jk  )   &
+                  &      + zwy_3d(ji,jj,jk) - zwy_3d(ji  ,jj-1,jk  )   &
+                  &      + zwz(ji,jj,jk) - zwz(ji  ,jj  ,jk+1) ) * r1_e1e2t(ji,jj)
+               ztw(ji,jj,jk) = zwi(ji,jj,jk) + p2dt * ztra / e3t(ji,jj,jk,Krhs) * tmask(ji,jj,jk)
+            END_3D
+            !
+            CALL tridia_solver( zwdia, zwsup, zwinf, ztw, ztw , 0 )
+            !
+            DO_3D( 1, 1, 1, 1, 2, jpkm1 )       ! Interior value ( multiplied by wmask)
+               zfp_wk = wi(ji,jj,jk) + ABS( wi(ji,jj,jk) )
+               zfm_wk = wi(ji,jj,jk) - ABS( wi(ji,jj,jk) )
+               zwz(ji,jj,jk) = zwz(ji,jj,jk) + 0.5 * e1e2t(ji,jj) * ( zfp_wk * ztw(ji,jj,jk) + zfm_wk * ztw(ji,jj,jk-1) ) * wmask(ji,jj,jk)
+            END_3D
+         END IF
+         !
+         !        !==  monotonicity algorithm  ==!
+         !
+#if defined key_agrif
+         CALL nonosc( Kmm, pt(:,:,:,jn,Kbb), zwx_3d, zwy_3d, zwz, zwi, p2dt )
+#else
+         CALL nonosc_lf( Kmm, pt(:,:,:,jn,Kbb), zwx_3d, zwy_3d, zwz, zwi, p2dt )
+#endif
+         !
+         !        !==  final trend with corrected fluxes  ==!
+         !
+         DO_3D( 0, 0, 0, 0, 1, jpkm1 )
+            ztra = - (  zwx_3d(ji,jj,jk) - zwx_3d(ji-1,jj  ,jk  )   &
+               &      + zwy_3d(ji,jj,jk) - zwy_3d(ji  ,jj-1,jk  )   &
+               &      + zwz(ji,jj,jk) - zwz(ji  ,jj  ,jk+1) ) * r1_e1e2t(ji,jj)
+            pt(ji,jj,jk,jn,Krhs) = pt(ji,jj,jk,jn,Krhs) + ztra / e3t(ji,jj,jk,Kmm)
+            zwi(ji,jj,jk) = zwi(ji,jj,jk) + p2dt * ztra / e3t(ji,jj,jk,Krhs) * tmask(ji,jj,jk)
+         END_3D
+         !
+         IF ( ll_zAimp ) THEN
+            !
+            ztw(:,:,1) = 0._wp ; ztw(:,:,jpk) = 0._wp
+            DO_3D( 0, 0, 0, 0, 2, jpkm1 )      ! Interior value ( multiplied by wmask)
+               zfp_wk = wi(ji,jj,jk) + ABS( wi(ji,jj,jk) )
+               zfm_wk = wi(ji,jj,jk) - ABS( wi(ji,jj,jk) )
+               ztw(ji,jj,jk) = - 0.5 * e1e2t(ji,jj) * ( zfp_wk * zwi(ji,jj,jk) + zfm_wk * zwi(ji,jj,jk-1) ) * wmask(ji,jj,jk)
+               zwz(ji,jj,jk) = zwz(ji,jj,jk) + ztw(ji,jj,jk) ! Update vertical fluxes for trend diagnostic
+            END_3D
+            DO_3D( 0, 0, 0, 0, 1, jpkm1 )
+               pt(ji,jj,jk,jn,Krhs) = pt(ji,jj,jk,jn,Krhs) - ( ztw(ji,jj,jk) - ztw(ji  ,jj  ,jk+1) ) &
+                  &                                        * r1_e1e2t(ji,jj) / e3t(ji,jj,jk,Kmm)
+            END_3D
+         END IF         
+         ! NOT TESTED - NEED l_trd OR l_hst TRUE 
+         IF( l_trd .OR. l_hst ) THEN   ! trend diagnostics // heat/salt transport
+            ztrdx(:,:,:) = ztrdx(:,:,:) + zwx_3d(:,:,:)  ! <<< add anti-diffusive fluxes 
+            ztrdy(:,:,:) = ztrdy(:,:,:) + zwy_3d(:,:,:)  !     to upstream fluxes
+            ztrdz(:,:,:) = ztrdz(:,:,:) + zwz(:,:,:)  !
+            !
+            IF( l_trd ) THEN              ! trend diagnostics
+               CALL trd_tra( kt, Kmm, Krhs, cdtype, jn, jptra_xad, ztrdx, pU, pt(:,:,:,jn,Kmm) )
+               CALL trd_tra( kt, Kmm, Krhs, cdtype, jn, jptra_yad, ztrdy, pV, pt(:,:,:,jn,Kmm) )
+               CALL trd_tra( kt, Kmm, Krhs, cdtype, jn, jptra_zad, ztrdz, pW, pt(:,:,:,jn,Kmm) )
+            ENDIF
+            !                             ! heat/salt transport
+            IF( l_hst )   CALL dia_ar5_hst( jn, 'adv', ztrdx(:,:,:), ztrdy(:,:,:) )
+            !
+         ENDIF
+         ! NOT TESTED - NEED l_ptr TRUE 
+         IF( l_ptr ) THEN              ! "Poleward" transports
+            zptry(:,:,:) = zptry(:,:,:) + zwy_3d(:,:,:)  ! <<< add anti-diffusive fluxes
+            CALL dia_ptr_hst( jn, 'adv', zptry(:,:,:) )
+         ENDIF
+         !
+      END DO                     ! end of tracer loop
+      !
+      IF ( ll_zAimp ) THEN
+         DEALLOCATE( zwdia, zwinf, zwsup )
+      ENDIF
+      IF( l_trd .OR. l_hst ) THEN 
+         DEALLOCATE( ztrdx, ztrdy, ztrdz )
+      ENDIF
+      IF( l_ptr ) THEN 
+         DEALLOCATE( zptry )
+      ENDIF
+      !
+   END SUBROUTINE tra_adv_fct_lf
+
+   SUBROUTINE nonosc_lf( Kmm, pbef, paa, pbb, pcc, paft, p2dt )
+      !!---------------------------------------------------------------------
+      !!                    ***  ROUTINE nonosc  ***
+      !!     
+      !! **  Purpose :   compute monotonic tracer fluxes from the upstream 
+      !!       scheme and the before field by a nonoscillatory algorithm 
+      !!
+      !! **  Method  :   ... ???
+      !!       warning : pbef and paft must be masked, but the boundaries
+      !!       conditions on the fluxes are not necessary zalezak (1979)
+      !!       drange (1995) multi-dimensional forward-in-time and upstream-
+      !!       in-space based differencing for fluid
+      !!----------------------------------------------------------------------
+      INTEGER                          , INTENT(in   ) ::   Kmm             ! time level index 
+      REAL(wp)                         , INTENT(in   ) ::   p2dt            ! tracer time-step
+      REAL(wp), DIMENSION (jpi,jpj,jpk), INTENT(in   ) ::   pbef, paft      ! before & after field
+      REAL(wp), DIMENSION (jpi,jpj,jpk), INTENT(inout) ::   paa, pbb, pcc   ! monotonic fluxes in the 3 directions
+      REAL(wp), DIMENSION (jpi,jpj,jpk) ::   paa_in, pbb_in, pcc_in   ! monotonic fluxes in the 3 directions
+      !
+      REAL(dp), DIMENSION (jpi,jpj,jpk) :: zbup, zbdo
+      !
+      INTEGER  ::   ji, jj, jk   ! dummy loop indices
+      REAL(dp) ::   zpos, zneg, zbt, za, zb, zc, zbig, zrtrn    ! local scalars
+      REAL(dp) ::   zau, zbu, zcu, zav, zbv, zcv, zup, zdo            !   -      -
+      REAL(dp) ::   zbt_ip1, zpos_ip1, zneg_ip1, zup_ip1, zdo_ip1, zbetup_ip1, zbetdo_ip1 
+      REAL(dp) ::   zbt_jp1, zpos_jp1, zneg_jp1, zup_jp1, zdo_jp1, zbetup_jp1, zbetdo_jp1
+      REAL(dp), TARGET, DIMENSION(jpi,jpj) :: zbetup_buf, zbetdo_buf, zbetup_ptr_buf, zbetdo_ptr_buf
+      REAL(dp), POINTER, DIMENSION(:,:) :: tmp, zbetup, zbetdo, zbetup_ptr, zbetdo_ptr
+      !!----------------------------------------------------------------------
+      !
+      zbig  = 1.e+40_dp
+      zrtrn = 1.e-15_dp
+
+      paa_in(:,:,:) = paa(:,:,:)
+      pbb_in(:,:,:) = pbb(:,:,:)
+      pcc_in(:,:,:) = pcc(:,:,:)
+      ! Search local extrema
+      ! --------------------
+      ! max/min of pbef & paft with large negative/positive value (-/+zbig) inside land
+      zbup = MAX( pbef * tmask - zbig * ( 1._wp - tmask ),   &
+         &        paft * tmask - zbig * ( 1._wp - tmask )  )
+      zbdo = MIN( pbef * tmask + zbig * ( 1._wp - tmask ),   &
+         &        paft * tmask + zbig * ( 1._wp - tmask )  )
+
+      zbetup => zbetup_buf
+      zbetdo => zbetdo_buf
+      zbetup_ptr => zbetup_ptr_buf
+      zbetdo_ptr => zbetdo_ptr_buf
+
+      DO_2D( 1, 0, 1, 0 )
+
+        ! search maximum in neighbourhood
+        search_in_neighbour(zup,MAX,zbup,ji,jj,1)
+        search_in_neighbour(zup_ip1,MAX,zbup,ji+1,jj,1)
+        search_in_neighbour(zup_jp1,MAX,zbup,ji,jj+1,1)
+
+        ! search minimum in neighbourhood
+        search_in_neighbour(zdo,MIN,zbdo,ji,jj,1)
+        search_in_neighbour(zdo_ip1,MIN,zbdo,ji+1,jj,1)
+        search_in_neighbour(zdo_jp1,MIN,zbdo,ji,jj+1,1)
+
+        ! positive part of the flux
+        pos_part_of_flux(ji,jj,1,zpos)
+        pos_part_of_flux(ji+1,jj,1,zpos_ip1)
+        pos_part_of_flux(ji,jj+1,1,zpos_jp1)
+
+        ! negative part of the flux
+        neg_part_of_flux(ji,jj,1,zneg)
+        neg_part_of_flux(ji+1,jj,1,zneg_ip1)
+        neg_part_of_flux(ji,jj+1,1,zneg_jp1)
+
+        ! up & down beta terms
+        beta_terms(zbt,zbetup(ji,jj),zbetdo(ji,jj),zup,zpos,zdo,zneg,ji,jj,1)
+        beta_terms(zbt_ip1,zbetup_ip1,zbetdo_ip1,zup_ip1,zpos_ip1,zdo_ip1,zneg_ip1,ji+1,jj,1)
+        beta_terms(zbt_jp1,zbetup_jp1,zbetdo_jp1,zup_jp1,zpos_jp1,zdo_jp1,zneg_jp1,ji,jj+1,1)
+
+        ! 3. monotonic flux in the i & j (paa & pbb)
+        ! ----------------------------------------
+        monotonic_flux(zau,zbu,zcu,zbetup_ip1,zbetdo_ip1,paa,paa_in,1)
+        monotonic_flux(zav,zbv,zcv,zbetup_jp1,zbetdo_jp1,pbb,pbb_in,1)
+
+      END_2D
+      tmp => zbetup_ptr
+      zbetup_ptr => zbetup
+      zbetup => tmp
+
+      tmp => zbetdo_ptr
+      zbetdo_ptr => zbetdo
+      zbetdo => tmp
+
+      DO jk = 2, jpk-1
+         DO_2D( 1, 0, 1, 0 )
+
+            ! search maximum in neighbourhood
+            search_in_neighbour(zup,MAX,zbup,ji,jj,jk)
+            search_in_neighbour(zup_ip1,MAX,zbup,ji+1,jj,jk)
+            search_in_neighbour(zup_jp1,MAX,zbup,ji,jj+1,jk)
+
+            ! search minimum in neighbourhood
+            search_in_neighbour(zdo,MIN,zbdo,ji,jj,jk)
+            search_in_neighbour(zdo_ip1,MIN,zbdo,ji+1,jj,jk)
+            search_in_neighbour(zdo_jp1,MIN,zbdo,ji,jj+1,jk)
+
+            ! positive part of the flux
+            pos_part_of_flux(ji,jj,jk,zpos)
+            pos_part_of_flux(ji+1,jj,jk,zpos_ip1)
+            pos_part_of_flux(ji,jj+1,jk,zpos_jp1)
+
+            ! negative part of the flux
+            neg_part_of_flux(ji,jj,jk,zneg)
+            neg_part_of_flux(ji+1,jj,jk,zneg_ip1)
+            neg_part_of_flux(ji,jj+1,jk,zneg_jp1)
+
+            ! up & down beta terms
+            beta_terms(zbt,zbetup(ji,jj),zbetdo(ji,jj),zup,zpos,zdo,zneg,ji,jj,jk)
+            beta_terms(zbt_ip1,zbetup_ip1,zbetdo_ip1,zup_ip1,zpos_ip1,zdo_ip1,zneg_ip1,ji+1,jj,jk)
+            beta_terms(zbt_jp1,zbetup_jp1,zbetdo_jp1,zup_jp1,zpos_jp1,zdo_jp1,zneg_jp1,ji,jj+1,jk)
+
+            ! 3. monotonic flux in the i & j (paa & pbb)
+            ! ----------------------------------------
+            monotonic_flux(zau,zbu,zcu,zbetup_ip1,zbetdo_ip1,paa,paa_in,jk)
+            monotonic_flux(zav,zbv,zcv,zbetup_jp1,zbetdo_jp1,pbb,pbb_in,jk)
+
+            ! monotonic flux in the k direction, i.e. pcc
+            ! -------------------------------------------
+            monotonic_flux_k(za,zb,zc,zbetup(ji,jj),zbetdo(ji,jj),pcc,pcc_in,jk)
+         END_2D
+         tmp => zbetup_ptr
+         zbetup_ptr => zbetup
+         zbetup => tmp
+
+         tmp => zbetdo_ptr
+         zbetdo_ptr => zbetdo
+         zbetdo => tmp
+      END DO
+      !
+      DO_2D( 1, 0, 1, 0 )
+        ! monotonic flux in the k direction, i.e. pcc
+        ! -------------------------------------------
+        monotonic_flux_k(za,zb,zc,0._dp,0._dp,pcc,pcc_in,jpk)
+      END_2D
+   END SUBROUTINE nonosc_lf
+
+END MODULE traadv_fct_lf
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traadv_mus.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traadv_mus.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traadv_mus.F90	(revision 14012)
@@ -81,4 +81,5 @@
       LOGICAL                                  , INTENT(in   ) ::   ld_msc_ups      ! use upstream scheme within muscl
       REAL(wp)                                 , INTENT(in   ) ::   p2dt            ! tracer time-step
+      ! TEMP: [tiling] This can be A2D(nn_hls) if using XIOS (subdomain support)
       REAL(wp), DIMENSION(jpi,jpj,jpk         ), INTENT(in   ) ::   pU, pV, pW      ! 3 ocean volume flux components
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt,jpt), INTENT(inout) ::   pt              ! tracers and RHS of tracer equation
@@ -88,40 +89,42 @@
       REAL(wp) ::   zu, z0u, zzwx, zw , zalpha   ! local scalars
       REAL(wp) ::   zv, z0v, zzwy, z0w           !   -      -
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zwx, zslpx   ! 3D workspace
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zwy, zslpy   ! -      - 
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk) ::   zwx, zslpx   ! 3D workspace
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk) ::   zwy, zslpy   ! -      -
       !!----------------------------------------------------------------------
       !
-      IF( kt == kit000 )  THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'tra_adv : MUSCL advection scheme on ', cdtype
-         IF(lwp) WRITE(numout,*) '        : mixed up-stream           ', ld_msc_ups
-         IF(lwp) WRITE(numout,*) '~~~~~~~'
-         IF(lwp) WRITE(numout,*)
-         !
-         ! Upstream / MUSCL scheme indicator
-         !
-         ALLOCATE( xind(jpi,jpj,jpk), STAT=ierr )
-         xind(:,:,:) = 1._wp              ! set equal to 1 where up-stream is not needed
-         !
-         IF( ld_msc_ups ) THEN            ! define the upstream indicator (if asked)
-            ALLOCATE( upsmsk(jpi,jpj), STAT=ierr )
-            upsmsk(:,:) = 0._wp                             ! not upstream by default
-            !
-            DO jk = 1, jpkm1
-               xind(:,:,jk) = 1._wp                              &                 ! =>1 where up-stream is not needed
-                  &         - MAX ( rnfmsk(:,:) * rnfmsk_z(jk),  &                 ! =>0 near runoff mouths (& closed sea outflows)
-                  &                 upsmsk(:,:)                ) * tmask(:,:,jk)   ! =>0 in some user defined area
-            END DO
-         ENDIF 
-         !
-      ENDIF 
-      !      
-      l_trd = .FALSE.
-      l_hst = .FALSE.
-      l_ptr = .FALSE.
-      IF( ( cdtype == 'TRA' .AND. l_trdtra ) .OR. ( cdtype == 'TRC' .AND. l_trdtrc ) )      l_trd = .TRUE.
-      IF(   cdtype == 'TRA' .AND. ( iom_use( 'sophtadv' ) .OR. iom_use( 'sophtadv' ) )  )   l_ptr = .TRUE. 
-      IF(   cdtype == 'TRA' .AND. ( iom_use("uadv_heattr") .OR. iom_use("vadv_heattr") .OR. &
-         &                          iom_use("uadv_salttr") .OR. iom_use("vadv_salttr")  ) ) l_hst = .TRUE.
+      IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile
+         IF( kt == kit000 )  THEN
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) 'tra_adv : MUSCL advection scheme on ', cdtype
+            IF(lwp) WRITE(numout,*) '        : mixed up-stream           ', ld_msc_ups
+            IF(lwp) WRITE(numout,*) '~~~~~~~'
+            IF(lwp) WRITE(numout,*)
+            !
+            ! Upstream / MUSCL scheme indicator
+            !
+            ALLOCATE( xind(jpi,jpj,jpk), STAT=ierr )
+            xind(:,:,:) = 1._wp              ! set equal to 1 where up-stream is not needed
+            !
+            IF( ld_msc_ups ) THEN            ! define the upstream indicator (if asked)
+               ALLOCATE( upsmsk(jpi,jpj), STAT=ierr )
+               upsmsk(:,:) = 0._wp                             ! not upstream by default
+               !
+               DO jk = 1, jpkm1
+                  xind(:,:,jk) = 1._wp                              &                 ! =>1 where up-stream is not needed
+                     &         - MAX ( rnfmsk(:,:) * rnfmsk_z(jk),  &                 ! =>0 near runoff mouths (& closed sea outflows)
+                     &                 upsmsk(:,:)                ) * tmask(:,:,jk)   ! =>0 in some user defined area
+               END DO
+            ENDIF
+            !
+         ENDIF
+         !
+         l_trd = .FALSE.
+         l_hst = .FALSE.
+         l_ptr = .FALSE.
+         IF( ( cdtype == 'TRA' .AND. l_trdtra ) .OR. ( cdtype == 'TRC' .AND. l_trdtrc ) )      l_trd = .TRUE.
+         IF(   cdtype == 'TRA' .AND. ( iom_use( 'sophtadv' ) .OR. iom_use( 'sophtadv' ) )  )   l_ptr = .TRUE.
+         IF(   cdtype == 'TRA' .AND. ( iom_use("uadv_heattr") .OR. iom_use("vadv_heattr") .OR. &
+            &                          iom_use("uadv_salttr") .OR. iom_use("vadv_salttr")  ) ) l_hst = .TRUE.
+      ENDIF
       !
       DO jn = 1, kjpt            !==  loop over the tracers  ==!
@@ -132,14 +135,14 @@
          zwx(:,:,jpk) = 0._wp                   ! bottom values
          zwy(:,:,jpk) = 0._wp  
-         DO_3D( 1, 0, 1, 0, 1, jpkm1 )
+         DO_3D( nn_hls, nn_hls-1, nn_hls, nn_hls-1, 1, jpkm1 )
             zwx(ji,jj,jk) = umask(ji,jj,jk) * ( pt(ji+1,jj,jk,jn,Kbb) - pt(ji,jj,jk,jn,Kbb) )
             zwy(ji,jj,jk) = vmask(ji,jj,jk) * ( pt(ji,jj+1,jk,jn,Kbb) - pt(ji,jj,jk,jn,Kbb) )
          END_3D
          ! lateral boundary conditions   (changed sign)
-         CALL lbc_lnk_multi( 'traadv_mus', zwx, 'U', -1.0_wp , zwy, 'V', -1.0_wp )
+         IF ( nn_hls.EQ.1 ) CALL lbc_lnk_multi( 'traadv_mus', zwx, 'U', -1.0_wp , zwy, 'V', -1.0_wp )
          !                                !-- Slopes of tracer
          zslpx(:,:,jpk) = 0._wp                 ! bottom values
          zslpy(:,:,jpk) = 0._wp
-         DO_3D( 0, 1, 0, 1, 1, jpkm1 )
+         DO_3D( nn_hls-1, 1, nn_hls-1, 1, 1, jpkm1 )
             zslpx(ji,jj,jk) =                       ( zwx(ji,jj,jk) + zwx(ji-1,jj  ,jk) )   &
                &            * ( 0.25 + SIGN( 0.25_wp, zwx(ji,jj,jk) * zwx(ji-1,jj  ,jk) ) )
@@ -148,5 +151,5 @@
          END_3D
          !
-         DO_3D( 0, 1, 0, 1, 1, jpkm1 )    !-- Slopes limitation
+         DO_3D( nn_hls-1, 1, nn_hls-1, 1, 1, jpkm1 )    !-- Slopes limitation
             zslpx(ji,jj,jk) = SIGN( 1.0_wp, zslpx(ji,jj,jk) ) * MIN(    ABS( zslpx(ji  ,jj,jk) ),   &
                &                                                     2.*ABS( zwx  (ji-1,jj,jk) ),   &
@@ -157,5 +160,5 @@
          END_3D
          !
-         DO_3D( 0, 0, 0, 0, 1, jpkm1 )    !-- MUSCL horizontal advective fluxes
+         DO_3D( nn_hls-1, 0, nn_hls-1, 0, 1, jpkm1 )    !-- MUSCL horizontal advective fluxes
             ! MUSCL fluxes
             z0u = SIGN( 0.5_wp, pU(ji,jj,jk) )
@@ -173,5 +176,5 @@
             zwy(ji,jj,jk) = pV(ji,jj,jk) * ( zalpha * zzwx + (1.-zalpha) * zzwy )
          END_3D
-         CALL lbc_lnk_multi( 'traadv_mus', zwx, 'U', -1.0_wp , zwy, 'V', -1.0_wp )   ! lateral boundary conditions   (changed sign)
+         IF ( nn_hls.EQ.1 ) CALL lbc_lnk_multi( 'traadv_mus', zwx, 'U', -1.0_wp , zwy, 'V', -1.0_wp )   ! lateral boundary conditions   (changed sign)
          !
          DO_3D( 0, 0, 0, 0, 1, jpkm1 )    !-- Tracer advective trend
@@ -195,7 +198,7 @@
          zwx(:,:, 1 ) = 0._wp                   ! surface & bottom boundary conditions
          zwx(:,:,jpk) = 0._wp
-         DO jk = 2, jpkm1                       ! interior values
-            zwx(:,:,jk) = tmask(:,:,jk) * ( pt(:,:,jk-1,jn,Kbb) - pt(:,:,jk,jn,Kbb) )
-         END DO
+         DO_3D( 1, 1, 1, 1, 2, jpkm1 )                ! interior values
+            zwx(ji,jj,jk) = tmask(ji,jj,jk) * ( pt(ji,jj,jk-1,jn,Kbb) - pt(ji,jj,jk,jn,Kbb) )
+         END_3D
          !                                !-- Slopes of tracer
          zslpx(:,:,1) = 0._wp                   ! surface values
@@ -223,5 +226,7 @@
                END_2D
             ELSE                                      ! no cavities: only at the ocean surface
-               zwx(:,:,1) = pW(:,:,1) * pt(:,:,1,jn,Kbb)
+               DO_2D( 1, 1, 1, 1 )
+                  zwx(ji,jj,1) = pW(ji,jj,1) * pt(ji,jj,1,jn,Kbb)
+               END_2D
             ENDIF
          ENDIF
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traadv_mus_lf.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traadv_mus_lf.F90	(revision 14012)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traadv_mus_lf.F90	(revision 14012)
@@ -0,0 +1,289 @@
+MODULE traadv_mus_lf
+   !!======================================================================
+   !!                       ***  MODULE  traadv_mus  ***
+   !! Ocean  tracers:  horizontal & vertical advective trend
+   !!======================================================================
+   !! History :       !  2000-06  (A.Estublier)  for passive tracers
+   !!                 !  2001-08  (E.Durand, G.Madec)  adapted for T & S
+   !!   NEMO     1.0  !  2002-06  (G. Madec)  F90: Free form and module
+   !!            3.2  !  2010-05  (C. Ethe, G. Madec)  merge TRC-TRA + switch from velocity to transport
+   !!            3.4  !  2012-06  (P. Oddo, M. Vichi) include the upstream where needed
+   !!            3.7  !  2015-09  (G. Madec) add the ice-shelf cavities boundary condition
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   tra_adv_mus   : update the tracer trend with the horizontal
+   !!                   and vertical advection trends using MUSCL scheme
+   !!----------------------------------------------------------------------
+   USE oce            ! ocean dynamics and active tracers
+   USE trc_oce        ! share passive tracers/Ocean variables
+   USE dom_oce        ! ocean space and time domain
+   USE trd_oce        ! trends: ocean variables
+   USE trdtra         ! tracers trends manager
+   USE sbcrnf         ! river runoffs
+   USE diaptr         ! poleward transport diagnostics
+   USE diaar5         ! AR5 diagnostics
+
+   !
+   USE iom            ! XIOS library
+   USE in_out_manager ! I/O manager
+   USE lib_mpp        ! distribued memory computing
+   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)  
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   tra_adv_mus_lf   ! routine called by traadv.F90
+   
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   upsmsk   !: mixed upstream/centered scheme near some straits
+   !                                                           !  and in closed seas (orca 2 and 1 configurations)
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   xind     !: mixed upstream/centered index
+   
+   LOGICAL  ::   l_trd   ! flag to compute trends
+   LOGICAL  ::   l_ptr   ! flag to compute poleward transport
+   LOGICAL  ::   l_hst   ! flag to compute heat/salt transport
+
+   !! * Substitutions
+#  include "do_loop_substitute.h90"
+#  include "domzgr_substitute.h90"
+
+#define initial_slop_i(out, ji) \
+        out = umask(ji,jj,jk) * ( pt(ji+1,jj,jk,jn,Kbb) - pt(ji,jj,jk,jn,Kbb) )
+
+#define initial_slop_j(out, jj) \
+        out = vmask(ji,jj,jk) * ( pt(ji,jj+1,jk,jn,Kbb) - pt(ji,jj,jk,jn,Kbb) )
+
+#define initial_slop_k(out, jk) \
+        out = tmask(ji,jj,jk) * ( pt(ji,jj,jk-1,jn,Kbb) - pt(ji,jj,jk,jn,Kbb) )
+
+#define tracer_slop(out, zzw, zzwm1) \
+        out = ( zzw + zzwm1 ) * ( 0.25 + SIGN( 0.25_wp, zzw * zzwm1 ) )
+
+#define limitation_slop(out, zzslp, zzwm1, zzw) \
+        out = SIGN( 1.0_wp, zzslp ) * MIN( ABS( zzslp ), 2.*ABS( zzwm1 ), 2.*ABS( zzw ) )
+
+#define vertical_adv_flux_i(out, jk, slp, slp1) \
+        z0u = SIGN( 0.5_wp, pU(ji,jj,jk) ) ; \
+        zalpha = 0.5 - z0u ; \
+        zu  = z0u - 0.5 * pU(ji,jj,jk) * p2dt * r1_e1e2u(ji,jj) / e3u(ji,jj,jk,Kmm) ; \
+        zzwx = pt(ji+1,jj,jk,jn,Kbb) + xind(ji,jj,jk) * zu * slp1 ; \
+        zzwy = pt(ji  ,jj,jk,jn,Kbb) + xind(ji,jj,jk) * zu * slp ; \
+        out = pU(ji,jj,jk) * ( zalpha * zzwx + (1.-zalpha) * zzwy )
+
+#define vertical_adv_flux_j(out, jk, slp, slp1) \
+        z0v = SIGN( 0.5_wp, pV(ji,jj,jk) ) ; \
+        zalpha = 0.5 - z0v ; \
+        zv  = z0v - 0.5 * pV(ji,jj,jk) * p2dt * r1_e1e2v(ji,jj) / e3v(ji,jj,jk,Kmm) ; \
+        zzwx = pt(ji,jj+1,jk,jn,Kbb) + xind(ji,jj,jk) * zv * slp1 ; \
+        zzwy = pt(ji,jj  ,jk,jn,Kbb) + xind(ji,jj,jk) * zv * slp ; \
+        out = pV(ji,jj,jk) * ( zalpha * zzwx + (1.-zalpha) * zzwy )
+
+#define vertical_adv_flux(out, jk, slp, slp1) \
+        z0w = SIGN( 0.5_wp, pW(ji,jj,jk+1) ) ; \
+        zalpha = 0.5 + z0w ; \
+        zw  = z0w - 0.5 * pW(ji,jj,jk+1) * p2dt * r1_e1e2t(ji,jj) / e3w(ji,jj,jk+1,Kmm) ; \
+        zzwx = pt(ji,jj,jk+1,jn,Kbb) + xind(ji,jj,jk) * zw * slp1 ; \
+        zzwy = pt(ji,jj,jk  ,jn,Kbb) + xind(ji,jj,jk) * zw * slp ; \
+        out = pW(ji,jj,jk+1) * ( zalpha * zzwx + (1.-zalpha) * zzwy ) * wmask(ji,jj,jk) 
+
+   !!----------------------------------------------------------------------
+   !!----------------------------------------------------------------------
+   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
+   !! $Id: traadv_mus.F90 13619 2020-10-16 08:41:21Z francesca $ 
+   !! Software governed by the CeCILL license (see ./LICENSE)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   SUBROUTINE tra_adv_mus_lf( kt, kit000, cdtype, p2dt, pU, pV, pW,             &
+      &                    Kbb, Kmm, pt, kjpt, Krhs, ld_msc_ups )
+      !!----------------------------------------------------------------------
+      !!                    ***  ROUTINE tra_adv_mus  ***
+      !!
+      !! ** Purpose :   Compute the now trend due to total advection of tracers
+      !!              using a MUSCL scheme (Monotone Upstream-centered Scheme for
+      !!              Conservation Laws) and add it to the general tracer trend.
+      !!
+      !! ** Method  : MUSCL scheme plus centered scheme at ocean boundaries
+      !!              ld_msc_ups=T : 
+      !!
+      !! ** Action : - update pt(:,:,:,:,Krhs)  with the now advective tracer trends
+      !!             - send trends to trdtra module for further diagnostcs (l_trdtra=T)
+      !!             - poleward advective heat and salt transport (ln_diaptr=T)
+      !!
+      !! References : Estubier, A., and M. Levy, Notes Techn. Pole de Modelisation
+      !!              IPSL, Sept. 2000 (http://www.lodyc.jussieu.fr/opa)
+      !!----------------------------------------------------------------------
+      INTEGER                                  , INTENT(in   ) ::   kt              ! ocean time-step index
+      INTEGER                                  , INTENT(in   ) ::   Kbb, Kmm, Krhs  ! ocean time level indices
+      INTEGER                                  , INTENT(in   ) ::   kit000          ! first time step index
+      CHARACTER(len=3)                         , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator)
+      INTEGER                                  , INTENT(in   ) ::   kjpt            ! number of tracers
+      LOGICAL                                  , INTENT(in   ) ::   ld_msc_ups      ! use upstream scheme within muscl
+      REAL(wp)                                 , INTENT(in   ) ::   p2dt            ! tracer time-step
+      REAL(wp), DIMENSION(jpi,jpj,jpk         ), INTENT(in   ) ::   pU, pV, pW      ! 3 ocean volume flux components
+      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt,jpt), INTENT(inout) ::   pt              ! tracers and RHS of tracer equation
+      !
+      INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices
+      INTEGER  ::   ierr             ! local integer
+      REAL(wp) ::   zu, z0u, zw , zalpha   ! local scalars
+      REAL(wp) ::   zv, z0v, z0w           !   -      -
+      REAL(wp) ::   zzwx, zzwxm1, zzwxp1, zzwy, zzwym1, zzwyp1
+      REAL(wp) ::   zzslpx, zzslpxp1, zzslpy, zzslpyp1
+      REAL(wp), TARGET, DIMENSION(jpi,jpj) :: zzwz_buf, zzwzp1_buf, zzwzp2_buf
+      REAL(wp), TARGET, DIMENSION(jpi,jpj) :: zzslpz_buf, zzslpzp1_buf
+      REAL(wp), POINTER, DIMENSION(:,:)    :: tmp, zzwz_ptr, zzwzp1_ptr, zzwzp2_ptr
+      REAL(wp), POINTER, DIMENSION(:,:)    :: zzslpz_ptr, zzslpzp1_ptr 
+      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zwz, zwx, zwy   ! 3D workspace
+      !!----------------------------------------------------------------------
+      !
+      IF( kt == kit000 )  THEN
+         IF(lwp) WRITE(numout,*)
+         IF(lwp) WRITE(numout,*) 'tra_adv : MUSCL advection scheme on ', cdtype
+         IF(lwp) WRITE(numout,*) '        : mixed up-stream           ', ld_msc_ups
+         IF(lwp) WRITE(numout,*) '~~~~~~~'
+         IF(lwp) WRITE(numout,*)
+         !
+         ! Upstream / MUSCL scheme indicator
+         !
+         ALLOCATE( xind(jpi,jpj,jpk), STAT=ierr )
+         xind(:,:,:) = 1._wp              ! set equal to 1 where up-stream is not needed
+         !
+         IF( ld_msc_ups ) THEN            ! define the upstream indicator (if asked)
+            ALLOCATE( upsmsk(jpi,jpj), STAT=ierr )
+            upsmsk(:,:) = 0._wp                             ! not upstream by default
+            !
+            DO jk = 1, jpkm1
+               xind(:,:,jk) = 1._wp                              &                 ! =>1 where up-stream is not needed
+                  &         - MAX ( rnfmsk(:,:) * rnfmsk_z(jk),  &                 ! =>0 near runoff mouths (& closed sea outflows)
+                  &                 upsmsk(:,:)                ) * tmask(:,:,jk)   ! =>0 in some user defined area
+            END DO
+         ENDIF 
+         !
+      ENDIF 
+      !      
+      l_trd = .FALSE.
+      l_hst = .FALSE.
+      l_ptr = .FALSE.
+      IF( ( cdtype == 'TRA' .AND. l_trdtra ) .OR. ( cdtype == 'TRC' .AND. l_trdtrc ) )      l_trd = .TRUE.
+      IF(   cdtype == 'TRA' .AND. ( iom_use( 'sophtadv' ) .OR. iom_use( 'sophtadv' ) )  )   l_ptr = .TRUE. 
+      IF(   cdtype == 'TRA' .AND. ( iom_use("uadv_heattr") .OR. iom_use("vadv_heattr") .OR. &
+         &                          iom_use("uadv_salttr") .OR. iom_use("vadv_salttr")  ) ) l_hst = .TRUE.
+      !
+         zzwz_ptr => zzwz_buf
+         zzwzp1_ptr => zzwzp1_buf
+         zzwzp2_ptr => zzwzp2_buf
+         zzslpz_ptr => zzslpz_buf
+         zzslpzp1_ptr => zzslpzp1_buf
+         !
+      DO jn = 1, kjpt            !==  loop over the tracers  ==!
+         !
+         zwx(:,:,jpk) = 0._wp                   ! bottom values
+         zwy(:,:,jpk) = 0._wp
+         zwz(:,:, 1 ) = 0._wp                   ! surface & bottom boundary conditions
+         zwz(:,:,jpk) = 0._wp
+         !                          !* Horizontal advective fluxes
+         !
+         !!----------------------------------------------------------------------
+         DO_3D( 1, 0, 1, 0, 1, jpkm1 )
+            !-- first guess of the slopes
+            initial_slop_i(zzwxm1, ji-1)
+            initial_slop_i(zzwx, ji)
+            initial_slop_i(zzwxp1, ji+1)
+
+            initial_slop_j(zzwym1, jj-1)
+            initial_slop_j(zzwy, jj)
+            initial_slop_j(zzwyp1, jj+1)
+            !-- Slopes of tracer
+            tracer_slop(zzslpx, zzwx, zzwxm1) 
+            tracer_slop(zzslpxp1, zzwxp1, zzwx) 
+            tracer_slop(zzslpy, zzwy, zzwym1) 
+            tracer_slop(zzslpyp1, zzwyp1, zzwy) 
+            !-- Slopes limitation
+            limitation_slop(zzslpx, zzslpx, zzwxm1, zzwx)
+            limitation_slop(zzslpxp1, zzslpxp1, zzwx, zzwxp1)
+            limitation_slop(zzslpy, zzslpy, zzwym1, zzwy)
+            limitation_slop(zzslpyp1, zzslpyp1, zzwy, zzwyp1)
+            !-- MUSCL horizontal advective fluxes
+            vertical_adv_flux_i(zwx(ji,jj,jk), jk, zzslpx, zzslpxp1) 
+            vertical_adv_flux_j(zwy(ji,jj,jk), jk, zzslpy, zzslpyp1) 
+         END_3D
+         !
+         DO_3D( 0, 0, 0, 0, 1, jpkm1 )    !-- Tracer advective trend
+            pt(ji,jj,jk,jn,Krhs) = pt(ji,jj,jk,jn,Krhs) - ( zwx(ji,jj,jk) - zwx(ji-1,jj,jk)       &
+            &                                     + zwy(ji,jj,jk) - zwy(ji  ,jj-1,jk  ) )     &
+            &                                     * r1_e1e2t(ji,jj) / e3t(ji,jj,jk,Kmm)
+         END_3D
+         !                          !* Vertical advective fluxes
+         DO_2D( 0, 0, 0, 0 ) 
+            !-- first guess of the slopes
+            initial_slop_k(zzwz_ptr(ji,jj), 2)
+            initial_slop_k(zzwzp1_ptr(ji,jj), 3)
+            !-- Slopes of tracer
+            tracer_slop(zzslpz_ptr(ji,jj), zzwz_ptr(ji,jj), zzwzp1_ptr(ji,jj))
+            !-- Slopes limitation
+            limitation_slop(zzslpz_ptr(ji,jj), zzslpz_ptr(ji,jj), zzwzp1_ptr(ji,jj), zzwz_ptr(ji,jj))
+            !-- vertical advective flux
+            vertical_adv_flux(zwz(ji,jj,2), 1, 0, zzslpz_ptr(ji,jj))
+         END_2D
+         
+         DO jk = 2, jpk-3    
+            DO_2D( 0, 0, 0, 0 )
+               !-- first guess of the slopes
+               initial_slop_k(zzwzp2_ptr(ji,jj), jk+2)
+               !-- Slopes of tracer
+               tracer_slop(zzslpzp1_ptr(ji,jj), zzwzp1_ptr(ji,jj), zzwzp2_ptr(ji,jj))
+               !-- Slopes limitation
+               limitation_slop(zzslpzp1_ptr(ji,jj), zzslpzp1_ptr(ji,jj), zzwzp2_ptr(ji,jj), zzwzp1_ptr(ji,jj))
+               !-- vertical advective flux
+               vertical_adv_flux(zwz(ji,jj,jk+1), jk, zzslpz_ptr(ji,jj), zzslpzp1_ptr(ji,jj))
+            END_2D
+            tmp => zzwzp1_ptr
+            zzwzp1_ptr => zzwzp2_ptr
+            zzwzp2_ptr => tmp
+
+            tmp => zzslpz_ptr
+            zzslpz_ptr => zzslpzp1_ptr
+            zzslpzp1_ptr => tmp 
+         END DO
+         DO_2D( 0, 0, 0, 0 ) 
+            !-- Slopes of tracer
+            tracer_slop(zzslpzp1_ptr(ji,jj), zzwzp1_ptr(ji,jj), 0)
+            !-- Slopes limitation
+            limitation_slop(zzslpzp1_ptr(ji,jj), zzslpzp1_ptr(ji,jj), 0, zzwzp1_ptr(ji,jj))
+            !-- vertical advective flux
+            vertical_adv_flux(zwz(ji,jj,jpk-1), jpk-2, zzslpz_ptr(ji,jj), zzslpzp1_ptr(ji,jj))
+         END_2D
+
+         IF( ln_linssh ) THEN                   ! top values, linear free surface only
+            IF( ln_isfcav ) THEN                      ! ice-shelf cavities (top of the ocean)
+               DO_2D( 1, 1, 1, 1 )
+                  zwz(ji,jj, mikt(ji,jj) ) = pW(ji,jj,mikt(ji,jj)) * pt(ji,jj,mikt(ji,jj),jn,Kbb)
+               END_2D
+            ELSE                                      ! no cavities: only at the ocean surface
+               zwz(:,:,1) = pW(:,:,1) * pt(:,:,1,jn,Kbb)
+            ENDIF
+         ENDIF
+         !
+         DO_3D( 0, 0, 0, 0, 1, jpkm1 )     !-- vertical advective trend
+            pt(ji,jj,jk,jn,Krhs) =  pt(ji,jj,jk,jn,Krhs) - ( zwz(ji,jj,jk) - zwz(ji,jj,jk+1) )   &
+               &                                      * r1_e1e2t(ji,jj) / e3t(ji,jj,jk,Kmm)
+         END_3D
+         !                                ! trend horizontal diagnostics
+         IF( l_trd )  THEN
+            CALL trd_tra( kt, Kmm, Krhs, cdtype, jn, jptra_xad, zwx, pU, pt(:,:,:,jn,Kbb) )
+            CALL trd_tra( kt, Kmm, Krhs, cdtype, jn, jptra_yad, zwy, pV, pt(:,:,:,jn,Kbb) )
+         END IF
+         !                                 ! "Poleward" heat and salt transports 
+         IF( l_ptr )  CALL dia_ptr_hst( jn, 'adv', zwy(:,:,:) )
+         !                                 !  heat transport
+         IF( l_hst )  CALL dia_ar5_hst( jn, 'adv', zwx(:,:,:), zwy(:,:,:) )
+         !
+         !                                ! send vertical trends for diagnostic
+         IF( l_trd )  CALL trd_tra( kt, Kmm, Krhs, cdtype, jn, jptra_zad, zwz, pW, pt(:,:,:,jn,Kbb) )
+         !
+      END DO                     ! end of tracer loop
+      !
+   END SUBROUTINE tra_adv_mus_lf
+
+   !!======================================================================
+END MODULE traadv_mus_lf
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traadv_qck.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traadv_qck.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traadv_qck.F90	(revision 14012)
@@ -91,20 +91,23 @@
       INTEGER                                  , INTENT(in   ) ::   kjpt            ! number of tracers
       REAL(wp)                                 , INTENT(in   ) ::   p2dt            ! tracer time-step
+      ! TEMP: [tiling] This can be A2D(nn_hls) if using XIOS (subdomain support)
+      ! NOTE: [tiling-comms-merge] These were changed to INTENT(inout) but they are not modified, so it is reverted
       REAL(wp), DIMENSION(jpi,jpj,jpk         ), INTENT(in   ) ::   pU, pV, pW      ! 3 ocean volume transport components
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt,jpt), INTENT(inout) ::   pt              ! tracers and RHS of tracer equation
       !!----------------------------------------------------------------------
       !
-      IF( kt == kit000 )  THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'tra_adv_qck : 3rd order quickest advection scheme on ', cdtype
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~'
-         IF(lwp) WRITE(numout,*)
+      IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile
+         IF( kt == kit000 )  THEN
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) 'tra_adv_qck : 3rd order quickest advection scheme on ', cdtype
+            IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~'
+            IF(lwp) WRITE(numout,*)
+         ENDIF
+         !
+         l_trd = .FALSE.
+         l_ptr = .FALSE.
+         IF( ( cdtype == 'TRA' .AND. l_trdtra ) .OR. ( cdtype == 'TRC' .AND. l_trdtrc ) )   l_trd = .TRUE.
+         IF(   cdtype == 'TRA' .AND. ( iom_use( 'sophtadv' ) .OR. iom_use( 'sophtadv' ) ) ) l_ptr = .TRUE.
       ENDIF
-      !
-      l_trd = .FALSE.
-      l_ptr = .FALSE.
-      IF( ( cdtype == 'TRA' .AND. l_trdtra ) .OR. ( cdtype == 'TRC' .AND. l_trdtrc ) )   l_trd = .TRUE.
-      IF(   cdtype == 'TRA' .AND. ( iom_use( 'sophtadv' ) .OR. iom_use( 'sophtadv' ) ) ) l_ptr = .TRUE. 
-      !
       !
       !        ! horizontal fluxes are computed with the QUICKEST + ULTIMATE scheme
@@ -127,4 +130,5 @@
       INTEGER                                  , INTENT(in   ) ::   kjpt       ! number of tracers
       REAL(wp)                                 , INTENT(in   ) ::   p2dt       ! tracer time-step
+      ! TEMP: [tiling] This can be A2D(nn_hls) if using XIOS (subdomain support)
       REAL(wp), DIMENSION(jpi,jpj,jpk         ), INTENT(in   ) ::   pU        ! i-velocity components
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt,jpt), INTENT(inout) ::   pt              ! active tracers and RHS of tracer equation
@@ -132,5 +136,5 @@
       INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices
       REAL(wp) ::   ztra, zbtr, zdir, zdx, zmsk   ! local scalars
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zwx, zfu, zfc, zfd
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk) ::   zwx, zfu, zfc, zfd
       !----------------------------------------------------------------------
       !
@@ -142,19 +146,19 @@
          !
 !!gm why not using a SHIFT instruction...
-         DO_3D( 0, 0, 0, 0, 1, jpkm1 )     !--- Computation of the ustream and downstream value of the tracer and the mask
+         DO_3D( 0, 0, nn_hls-1, nn_hls-1, 1, jpkm1 )     !--- Computation of the ustream and downstream value of the tracer and the mask
             zfc(ji,jj,jk) = pt(ji-1,jj,jk,jn,Kbb)        ! Upstream   in the x-direction for the tracer
             zfd(ji,jj,jk) = pt(ji+1,jj,jk,jn,Kbb)        ! Downstream in the x-direction for the tracer
          END_3D
-         CALL lbc_lnk_multi( 'traadv_qck', zfc(:,:,:), 'T', 1.0_wp , zfd(:,:,:), 'T', 1.0_wp )   ! Lateral boundary conditions 
+         IF (nn_hls.EQ.1) CALL lbc_lnk_multi( 'traadv_qck', zfc(:,:,:), 'T', 1.0_wp , zfd(:,:,:), 'T', 1.0_wp )   ! Lateral boundary conditions
          
          !
          ! Horizontal advective fluxes
          ! ---------------------------
-         DO_3D( 0, 0, 0, 0, 1, jpkm1 )
+         DO_3D( 0, 0, nn_hls-1, 0, 1, jpkm1 )
             zdir = 0.5 + SIGN( 0.5_wp, pU(ji,jj,jk) )   ! if pU > 0 : zdir = 1 otherwise zdir = 0 
             zfu(ji,jj,jk) = zdir * zfc(ji,jj,jk ) + ( 1. - zdir ) * zfd(ji+1,jj,jk)  ! FU in the x-direction for T 
          END_3D
          !
-         DO_3D( 0, 0, 0, 0, 1, jpkm1 )
+         DO_3D( 0, 0, nn_hls-1, 0, 1, jpkm1 )
             zdir = 0.5 + SIGN( 0.5_wp, pU(ji,jj,jk) )   ! if pU > 0 : zdir = 1 otherwise zdir = 0 
             zdx = ( zdir * e1t(ji,jj) + ( 1. - zdir ) * e1t(ji+1,jj) ) * e2u(ji,jj) * e3u(ji,jj,jk,Kmm)
@@ -164,5 +168,5 @@
          END_3D
          !--- Lateral boundary conditions 
-         CALL lbc_lnk_multi( 'traadv_qck', zfu(:,:,:), 'T', 1.0_wp , zfd(:,:,:), 'T', 1.0_wp, zfc(:,:,:), 'T', 1.0_wp,  zwx(:,:,:), 'T', 1.0_wp )
+         IF (nn_hls.EQ.1) CALL lbc_lnk_multi( 'traadv_qck', zfu(:,:,:), 'T', 1.0_wp , zfd(:,:,:), 'T', 1.0_wp, zfc(:,:,:), 'T', 1.0_wp,  zwx(:,:,:), 'T', 1.0_wp )
 
          !--- QUICKEST scheme
@@ -170,24 +174,19 @@
          !
          ! Mask at the T-points in the x-direction (mask=0 or mask=1)
-         DO_3D( 0, 0, 0, 0, 1, jpkm1 )
+         DO_3D( 0, 0, nn_hls-1, nn_hls-1, 1, jpkm1 )
             zfu(ji,jj,jk) = tmask(ji-1,jj,jk) + tmask(ji,jj,jk) + tmask(ji+1,jj,jk) - 2.
          END_3D
-         CALL lbc_lnk( 'traadv_qck', zfu(:,:,:), 'T', 1.0_wp )      ! Lateral boundary conditions 
+         IF (nn_hls.EQ.1) CALL lbc_lnk( 'traadv_qck', zfu(:,:,:), 'T', 1.0_wp )      ! Lateral boundary conditions
 
          !
          ! Tracer flux on the x-direction
-         DO jk = 1, jpkm1  
-            !
-            DO_2D( 0, 0, 0, 0 )
-               zdir = 0.5 + SIGN( 0.5_wp, pU(ji,jj,jk) )   ! if pU > 0 : zdir = 1 otherwise zdir = 0 
-               !--- If the second ustream point is a land point
-               !--- the flux is computed by the 1st order UPWIND scheme
-               zmsk = zdir * zfu(ji,jj,jk) + ( 1. - zdir ) * zfu(ji+1,jj,jk)
-               zwx(ji,jj,jk) = zmsk * zwx(ji,jj,jk) + ( 1. - zmsk ) * zfc(ji,jj,jk)
-               zwx(ji,jj,jk) = zwx(ji,jj,jk) * pU(ji,jj,jk)
-            END_2D
-         END DO
-         !
-         CALL lbc_lnk( 'traadv_qck', zwx(:,:,:), 'T', 1.0_wp ) ! Lateral boundary conditions
+         DO_3D( 0, 0, 1, 0, 1, jpkm1 )
+            zdir = 0.5 + SIGN( 0.5_wp, pU(ji,jj,jk) )   ! if pU > 0 : zdir = 1 otherwise zdir = 0
+            !--- If the second ustream point is a land point
+            !--- the flux is computed by the 1st order UPWIND scheme
+            zmsk = zdir * zfu(ji,jj,jk) + ( 1. - zdir ) * zfu(ji+1,jj,jk)
+            zwx(ji,jj,jk) = zmsk * zwx(ji,jj,jk) + ( 1. - zmsk ) * zfc(ji,jj,jk)
+            zwx(ji,jj,jk) = zwx(ji,jj,jk) * pU(ji,jj,jk)
+         END_3D
          !
          ! Computation of the trend
@@ -216,4 +215,5 @@
       INTEGER                                  , INTENT(in   ) ::   kjpt       ! number of tracers
       REAL(wp)                                 , INTENT(in   ) ::   p2dt       ! tracer time-step
+      ! TEMP: [tiling] This can be A2D(nn_hls) if using XIOS (subdomain support)
       REAL(wp), DIMENSION(jpi,jpj,jpk         ), INTENT(in   ) ::   pV        ! j-velocity components
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt,jpt), INTENT(inout) ::   pt              ! active tracers and RHS of tracer equation
@@ -221,5 +221,5 @@
       INTEGER  :: ji, jj, jk, jn                ! dummy loop indices
       REAL(wp) :: ztra, zbtr, zdir, zdx, zmsk   ! local scalars
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zwy, zfu, zfc, zfd   ! 3D workspace
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk) ::   zwy, zfu, zfc, zfd   ! 3D workspace
       !----------------------------------------------------------------------
       !
@@ -233,5 +233,5 @@
             !                                             
             !--- Computation of the ustream and downstream value of the tracer and the mask
-            DO_2D( 0, 0, 0, 0 )
+            DO_2D( nn_hls-1, nn_hls-1, 0, 0 )
                ! Upstream in the x-direction for the tracer
                zfc(ji,jj,jk) = pt(ji,jj-1,jk,jn,Kbb)
@@ -240,6 +240,5 @@
             END_2D
          END DO
-         CALL lbc_lnk_multi( 'traadv_qck', zfc(:,:,:), 'T', 1.0_wp , zfd(:,:,:), 'T', 1.0_wp )   ! Lateral boundary conditions 
-
+         IF (nn_hls.EQ.1) CALL lbc_lnk_multi( 'traadv_qck', zfc(:,:,:), 'T', 1.0_wp , zfd(:,:,:), 'T', 1.0_wp )   ! Lateral boundary conditions
          
          !
@@ -247,10 +246,10 @@
          ! ---------------------------
          !
-         DO_3D( 0, 0, 0, 0, 1, jpkm1 )
+         DO_3D( nn_hls-1, 0, 0, 0, 1, jpkm1 )
             zdir = 0.5 + SIGN( 0.5_wp, pV(ji,jj,jk) )   ! if pU > 0 : zdir = 1 otherwise zdir = 0 
             zfu(ji,jj,jk) = zdir * zfc(ji,jj,jk ) + ( 1. - zdir ) * zfd(ji,jj+1,jk)  ! FU in the x-direction for T 
          END_3D
          !
-         DO_3D( 0, 0, 0, 0, 1, jpkm1 )
+         DO_3D( nn_hls-1, 0, 0, 0, 1, jpkm1 )
             zdir = 0.5 + SIGN( 0.5_wp, pV(ji,jj,jk) )   ! if pU > 0 : zdir = 1 otherwise zdir = 0 
             zdx = ( zdir * e2t(ji,jj) + ( 1. - zdir ) * e2t(ji,jj+1) ) * e1v(ji,jj) * e3v(ji,jj,jk,Kmm)
@@ -261,5 +260,5 @@
 
          !--- Lateral boundary conditions 
-         CALL lbc_lnk_multi( 'traadv_qck', zfu(:,:,:), 'T', 1.0_wp , zfd(:,:,:), 'T', 1.0_wp, zfc(:,:,:), 'T', 1.0_wp, zwy(:,:,:), 'T', 1.0_wp )
+         IF (nn_hls.EQ.1) CALL lbc_lnk_multi( 'traadv_qck', zfu(:,:,:), 'T', 1.0_wp , zfd(:,:,:), 'T', 1.0_wp, zfc(:,:,:), 'T', 1.0_wp, zwy(:,:,:), 'T', 1.0_wp )
 
          !--- QUICKEST scheme
@@ -267,23 +266,18 @@
          !
          ! Mask at the T-points in the x-direction (mask=0 or mask=1)
-         DO_3D( 0, 0, 0, 0, 1, jpkm1 )
+         DO_3D( nn_hls-1, nn_hls-1, 0, 0, 1, jpkm1 )
             zfu(ji,jj,jk) = tmask(ji,jj-1,jk) + tmask(ji,jj,jk) + tmask(ji,jj+1,jk) - 2.
          END_3D
-         CALL lbc_lnk( 'traadv_qck', zfu(:,:,:), 'T', 1.0_wp )    !--- Lateral boundary conditions 
+         IF (nn_hls.EQ.1) CALL lbc_lnk( 'traadv_qck', zfu(:,:,:), 'T', 1.0_wp )    !--- Lateral boundary conditions
          !
          ! Tracer flux on the x-direction
-         DO jk = 1, jpkm1  
-            !
-            DO_2D( 0, 0, 0, 0 )
-               zdir = 0.5 + SIGN( 0.5_wp, pV(ji,jj,jk) )   ! if pU > 0 : zdir = 1 otherwise zdir = 0 
-               !--- If the second ustream point is a land point
-               !--- the flux is computed by the 1st order UPWIND scheme
-               zmsk = zdir * zfu(ji,jj,jk) + ( 1. - zdir ) * zfu(ji,jj+1,jk)
-               zwy(ji,jj,jk) = zmsk * zwy(ji,jj,jk) + ( 1. - zmsk ) * zfc(ji,jj,jk)
-               zwy(ji,jj,jk) = zwy(ji,jj,jk) * pV(ji,jj,jk)
-            END_2D
-         END DO
-         !
-         CALL lbc_lnk( 'traadv_qck', zwy(:,:,:), 'T', 1.0_wp ) ! Lateral boundary conditions
+         DO_3D( 1, 0, 0, 0, 1, jpkm1 )
+            zdir = 0.5 + SIGN( 0.5_wp, pV(ji,jj,jk) )   ! if pU > 0 : zdir = 1 otherwise zdir = 0
+            !--- If the second ustream point is a land point
+            !--- the flux is computed by the 1st order UPWIND scheme
+            zmsk = zdir * zfu(ji,jj,jk) + ( 1. - zdir ) * zfu(ji,jj+1,jk)
+            zwy(ji,jj,jk) = zmsk * zwy(ji,jj,jk) + ( 1. - zmsk ) * zfc(ji,jj,jk)
+            zwy(ji,jj,jk) = zwy(ji,jj,jk) * pV(ji,jj,jk)
+         END_3D
          !
          ! Computation of the trend
@@ -313,9 +307,10 @@
       CHARACTER(len=3)                         , INTENT(in   ) ::   cdtype   ! =TRA or TRC (tracer indicator)
       INTEGER                                  , INTENT(in   ) ::   kjpt     ! number of tracers
-      REAL(wp), DIMENSION(jpi,jpj,jpk         ), INTENT(in   ) ::   pW      ! vertical velocity 
+      ! TEMP: [tiling] This can be A2D(nn_hls) if using XIOS (subdomain support)
+      REAL(wp), DIMENSION(jpi,jpj,jpk         ), INTENT(in   ) ::   pW      ! vertical velocity
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt,jpt), INTENT(inout) ::   pt              ! active tracers and RHS of tracer equation
       !
       INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zwz   ! 3D workspace
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk) ::   zwz   ! 3D workspace
       !!----------------------------------------------------------------------
       !
@@ -332,9 +327,11 @@
          IF( ln_linssh ) THEN                !* top value   (only in linear free surf. as zwz is multiplied by wmask)
             IF( ln_isfcav ) THEN                  ! ice-shelf cavities (top of the ocean)
-               DO_2D( 1, 1, 1, 1 )
+               DO_2D( 0, 0, 0, 0 )
                   zwz(ji,jj, mikt(ji,jj) ) = pW(ji,jj,mikt(ji,jj)) * pt(ji,jj,mikt(ji,jj),jn,Kmm)   ! linear free surface 
                END_2D
             ELSE                                   ! no ocean cavities (only ocean surface)
-               zwz(:,:,1) = pW(:,:,1) * pt(:,:,1,jn,Kmm)
+               DO_2D( 0, 0, 0, 0 )
+                  zwz(ji,jj,1) = pW(ji,jj,1) * pt(ji,jj,1,jn,Kmm)
+               END_2D
             ENDIF
          ENDIF
@@ -359,8 +356,8 @@
       !! ** Method :   
       !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in   ) ::   pfu   ! second upwind point
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in   ) ::   pfd   ! first douwning point
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in   ) ::   pfc   ! the central point (or the first upwind point)
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   puc   ! input as Courant number ; output as flux
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk), INTENT(in   ) ::   pfu   ! second upwind point
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk), INTENT(in   ) ::   pfd   ! first douwning point
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk), INTENT(in   ) ::   pfc   ! the central point (or the first upwind point)
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk), INTENT(inout) ::   puc   ! input as Courant number ; output as flux
       !!
       INTEGER  ::  ji, jj, jk               ! dummy loop indices 
@@ -369,5 +366,5 @@
       !----------------------------------------------------------------------
       !
-      DO_3D( 1, 1, 1, 1, 1, jpkm1 )
+      DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpkm1 )
          zc     = puc(ji,jj,jk)                         ! Courant number
          zcurv  = pfd(ji,jj,jk) + pfu(ji,jj,jk) - 2. * pfc(ji,jj,jk)
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traadv_ubs.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traadv_ubs.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traadv_ubs.F90	(revision 14012)
@@ -92,4 +92,5 @@
       INTEGER                                  , INTENT(in   ) ::   kn_ubs_v        ! number of tracers
       REAL(wp)                                 , INTENT(in   ) ::   p2dt            ! tracer time-step
+      ! TEMP: [tiling] This can be A2D(nn_hls) if using XIOS (subdomain support)
       REAL(wp), DIMENSION(jpi,jpj,jpk         ), INTENT(in   ) ::   pU, pV, pW      ! 3 ocean volume transport components
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt,jpt), INTENT(inout) ::   pt              ! tracers and RHS of tracer equation
@@ -99,25 +100,26 @@
       REAL(wp) ::   zfp_ui, zfm_ui, zcenut, ztak, zfp_wk, zfm_wk   !   -      -
       REAL(wp) ::   zfp_vj, zfm_vj, zcenvt, zeeu, zeev, z_hdivn    !   -      -
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   ztu, ztv, zltu, zltv, zti, ztw   ! 3D workspace
-      !!----------------------------------------------------------------------
-      !
-      IF( kt == kit000 )  THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'tra_adv_ubs :  horizontal UBS advection scheme on ', cdtype
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~'
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk) ::   ztu, ztv, zltu, zltv, zti, ztw     ! 3D workspace
+      !!----------------------------------------------------------------------
+      !
+      IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile
+         IF( kt == kit000 )  THEN
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) 'tra_adv_ubs :  horizontal UBS advection scheme on ', cdtype
+            IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~'
+         ENDIF
+         !
+         l_trd = .FALSE.
+         l_hst = .FALSE.
+         l_ptr = .FALSE.
+         IF( ( cdtype == 'TRA' .AND. l_trdtra ) .OR. ( cdtype == 'TRC' .AND. l_trdtrc ) )      l_trd = .TRUE.
+         IF(   cdtype == 'TRA' .AND. ( iom_use( 'sophtadv' ) .OR. iom_use( 'sophtadv' ) )  )   l_ptr = .TRUE.
+         IF(   cdtype == 'TRA' .AND. ( iom_use("uadv_heattr") .OR. iom_use("vadv_heattr") .OR. &
+            &                          iom_use("uadv_salttr") .OR. iom_use("vadv_salttr")  ) ) l_hst = .TRUE.
       ENDIF
-      !
-      l_trd = .FALSE.
-      l_hst = .FALSE.
-      l_ptr = .FALSE.
-      IF( ( cdtype == 'TRA' .AND. l_trdtra ) .OR. ( cdtype == 'TRC' .AND. l_trdtrc ) )      l_trd = .TRUE.
-      IF(   cdtype == 'TRA' .AND. ( iom_use( 'sophtadv' ) .OR. iom_use( 'sophtadv' ) )  )   l_ptr = .TRUE. 
-      IF(   cdtype == 'TRA' .AND. ( iom_use("uadv_heattr") .OR. iom_use("vadv_heattr") .OR. &
-         &                          iom_use("uadv_salttr") .OR. iom_use("vadv_salttr")  ) ) l_hst = .TRUE.
       !
       ztw (:,:, 1 ) = 0._wp      ! surface & bottom value : set to zero for all tracers
       zltu(:,:,jpk) = 0._wp   ;   zltv(:,:,jpk) = 0._wp
       ztw (:,:,jpk) = 0._wp   ;   zti (:,:,jpk) = 0._wp
-      !
       !                                                          ! ===========
       DO jn = 1, kjpt                                            ! tracer loop
@@ -125,5 +127,5 @@
          !                                              
          DO jk = 1, jpkm1                !==  horizontal laplacian of before tracer ==!
-            DO_2D( 1, 0, 1, 0 )                   ! First derivative (masked gradient)
+            DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 )                   ! First derivative (masked gradient)
                zeeu = e2_e1u(ji,jj) * e3u(ji,jj,jk,Kmm) * umask(ji,jj,jk)
                zeev = e1_e2v(ji,jj) * e3v(ji,jj,jk,Kmm) * vmask(ji,jj,jk)
@@ -131,5 +133,5 @@
                ztv(ji,jj,jk) = zeev * ( pt(ji  ,jj+1,jk,jn,Kbb) - pt(ji,jj,jk,jn,Kbb) )
             END_2D
-            DO_2D( 0, 0, 0, 0 )                   ! Second derivative (divergence)
+            DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )                   ! Second derivative (divergence)
                zcoef = 1._wp / ( 6._wp * e3t(ji,jj,jk,Kmm) )
                zltu(ji,jj,jk) = (  ztu(ji,jj,jk) - ztu(ji-1,jj,jk)  ) * zcoef
@@ -138,5 +140,5 @@
             !                                    
          END DO         
-         CALL lbc_lnk( 'traadv_ubs', zltu, 'T', 1.0_wp )   ;    CALL lbc_lnk( 'traadv_ubs', zltv, 'T', 1.0_wp )   ! Lateral boundary cond. (unchanged sgn)
+         IF (nn_hls.EQ.1) CALL lbc_lnk_multi( 'traadv_ubs', zltu, 'T', 1.0_wp, zltv, 'T', 1.0_wp )   ! Lateral boundary cond. (unchanged sgn)
          !    
          DO_3D( 1, 0, 1, 0, 1, jpkm1 )   !==  Horizontal advective fluxes  ==!     (UBS)
@@ -153,5 +155,7 @@
          END_3D
          !
-         zltu(:,:,:) = pt(:,:,:,jn,Krhs)      ! store the initial trends before its update
+         DO_3D( 1, 1, 1, 1, 1, jpk )
+            zltu(ji,jj,jk) = pt(ji,jj,jk,jn,Krhs)      ! store the initial trends before its update
+         END_3D
          !
          DO jk = 1, jpkm1        !==  add the horizontal advective trend  ==!
@@ -165,7 +169,8 @@
          END DO
          !
-         zltu(:,:,:) = pt(:,:,:,jn,Krhs) - zltu(:,:,:)    ! Horizontal advective trend used in vertical 2nd order FCT case
-         !                                                ! and/or in trend diagnostic (l_trd=T) 
-         !                
+         DO_3D( 1, 1, 1, 1, 1, jpk )
+            zltu(ji,jj,jk) = pt(ji,jj,jk,jn,Krhs) - zltu(ji,jj,jk)  ! Horizontal advective trend used in vertical 2nd order FCT case
+         END_3D                                                     ! and/or in trend diagnostic (l_trd=T)
+         !
          IF( l_trd ) THEN                  ! trend diagnostics
              CALL trd_tra( kt, Kmm, Krhs, cdtype, jn, jptra_xad, ztu, pU, pt(:,:,:,jn,Kmm) )
@@ -185,5 +190,9 @@
          CASE(  2  )                   ! 2nd order FCT 
             !         
-            IF( l_trd )   zltv(:,:,:) = pt(:,:,:,jn,Krhs)          ! store pt(:,:,:,:,Krhs) if trend diag.
+            IF( l_trd ) THEN
+               DO_3D( 0, 0, 0, 0, 1, jpkm1 )
+                  zltv(ji,jj,jk) = pt(ji,jj,jk,jn,Krhs)          ! store pt(:,:,:,:,Krhs) if trend diag.
+               END_3D
+            ENDIF
             !
             !                               !*  upstream advection with initial mass fluxes & intermediate update  ==!
@@ -199,5 +208,7 @@
                   END_2D
                ELSE                                   ! no cavities: only at the ocean surface
-                  ztw(:,:,1) = pW(:,:,1) * pt(:,:,1,jn,Kbb)
+                  DO_2D( 1, 1, 1, 1 )
+                     ztw(ji,jj,1) = pW(ji,jj,1) * pt(ji,jj,1,jn,Kbb)
+                  END_2D
                ENDIF
             ENDIF
@@ -209,5 +220,4 @@
                zti(ji,jj,jk)    = ( pt(ji,jj,jk,jn,Kbb) + p2dt * ( ztak + zltu(ji,jj,jk) ) ) * tmask(ji,jj,jk)
             END_3D
-            CALL lbc_lnk( 'traadv_ubs', zti, 'T', 1.0_wp )      ! Lateral boundary conditions on zti, zsi   (unchanged sign)
             !
             !                          !*  anti-diffusive flux : high order minus low order
@@ -226,5 +236,9 @@
                ztw(ji,jj,jk) = pW(ji,jj,jk) * ztw(ji,jj,jk) * wmask(ji,jj,jk)
             END_3D
-            IF( ln_linssh )   ztw(:,:, 1 ) = pW(:,:,1) * pt(:,:,1,jn,Kmm)     !!gm ISF & 4th COMPACT doesn't work
+            IF( ln_linssh ) THEN
+               DO_2D( 1, 1, 1, 1 )
+                  ztw(ji,jj,1) = pW(ji,jj,1) * pt(ji,jj,1,jn,Kmm)     !!gm ISF & 4th COMPACT doesn't work
+               END_2D
+            ENDIF
             !
          END SELECT
@@ -262,14 +276,14 @@
       !!       in-space based differencing for fluid
       !!----------------------------------------------------------------------
-      INTEGER , INTENT(in   )                          ::   Kmm    ! time level index
-      REAL(wp), INTENT(in   )                          ::   p2dt   ! tracer time-step
-      REAL(wp),                DIMENSION (jpi,jpj,jpk) ::   pbef   ! before field
-      REAL(wp), INTENT(inout), DIMENSION (jpi,jpj,jpk) ::   paft   ! after field
-      REAL(wp), INTENT(inout), DIMENSION (jpi,jpj,jpk) ::   pcc    ! monotonic flux in the k direction
+      INTEGER , INTENT(in   )                         ::   Kmm    ! time level index
+      REAL(wp), INTENT(in   )                         ::   p2dt   ! tracer time-step
+      REAL(wp),                DIMENSION(jpi,jpj,jpk) ::   pbef   ! before field
+      REAL(wp), INTENT(inout), DIMENSION(A2D(nn_hls)    ,jpk) ::   paft   ! after field
+      REAL(wp), INTENT(inout), DIMENSION(A2D(nn_hls)    ,jpk) ::   pcc    ! monotonic flux in the k direction
       !
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
       INTEGER  ::   ikm1         ! local integer
       REAL(wp) ::   zpos, zneg, zbt, za, zb, zc, zbig, zrtrn   ! local scalars
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zbetup, zbetdo     ! 3D workspace
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk) ::   zbetup, zbetdo         ! 3D workspace
       !!----------------------------------------------------------------------
       !
@@ -281,6 +295,8 @@
       ! --------------------
       !                    ! large negative value (-zbig) inside land
-      pbef(:,:,:) = pbef(:,:,:) * tmask(:,:,:) - zbig * ( 1.e0 - tmask(:,:,:) )
-      paft(:,:,:) = paft(:,:,:) * tmask(:,:,:) - zbig * ( 1.e0 - tmask(:,:,:) )
+      DO_3D( 0, 0, 0, 0, 1, jpk )
+         pbef(ji,jj,jk) = pbef(ji,jj,jk) * tmask(ji,jj,jk) - zbig * ( 1.e0 - tmask(ji,jj,jk) )
+         paft(ji,jj,jk) = paft(ji,jj,jk) * tmask(ji,jj,jk) - zbig * ( 1.e0 - tmask(ji,jj,jk) )
+      END_3D
       !
       DO jk = 1, jpkm1     ! search maximum in neighbourhood
@@ -293,6 +309,8 @@
       END DO
       !                    ! large positive value (+zbig) inside land
-      pbef(:,:,:) = pbef(:,:,:) * tmask(:,:,:) + zbig * ( 1.e0 - tmask(:,:,:) )
-      paft(:,:,:) = paft(:,:,:) * tmask(:,:,:) + zbig * ( 1.e0 - tmask(:,:,:) )
+      DO_3D( 0, 0, 0, 0, 1, jpk )
+         pbef(ji,jj,jk) = pbef(ji,jj,jk) * tmask(ji,jj,jk) + zbig * ( 1.e0 - tmask(ji,jj,jk) )
+         paft(ji,jj,jk) = paft(ji,jj,jk) * tmask(ji,jj,jk) + zbig * ( 1.e0 - tmask(ji,jj,jk) )
+      END_3D
       !
       DO jk = 1, jpkm1     ! search minimum in neighbourhood
@@ -305,6 +323,8 @@
       END DO
       !                    ! restore masked values to zero
-      pbef(:,:,:) = pbef(:,:,:) * tmask(:,:,:)
-      paft(:,:,:) = paft(:,:,:) * tmask(:,:,:)
+      DO_3D( 0, 0, 0, 0, 1, jpk )
+         pbef(ji,jj,jk) = pbef(ji,jj,jk) * tmask(ji,jj,jk)
+         paft(ji,jj,jk) = paft(ji,jj,jk) * tmask(ji,jj,jk)
+      END_3D
       !
       ! Positive and negative part of fluxes and beta terms
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traatf.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traatf.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traatf.F90	(revision 14012)
@@ -156,8 +156,6 @@
          ENDIF
          !
-         CALL lbc_lnk_multi( 'traatf', pts(:,:,:,jp_tem,Kbb) , 'T', 1.0_wp, pts(:,:,:,jp_sal,Kbb) , 'T', 1.0_wp, &
-                  &                    pts(:,:,:,jp_tem,Kmm) , 'T', 1.0_wp, pts(:,:,:,jp_sal,Kmm) , 'T', 1.0_wp, &
-                  &                    pts(:,:,:,jp_tem,Kaa), 'T', 1.0_wp, pts(:,:,:,jp_sal,Kaa), 'T', 1.0_wp  )
-         !
+         CALL lbc_lnk_multi( 'traatf',  pts(:,:,:,jp_tem,Kmm) , 'T', 1.0_wp, pts(:,:,:,jp_sal,Kmm) , 'T', 1.0_wp ) 
+
       ENDIF     
       !
@@ -210,5 +208,5 @@
       DO jn = 1, kjpt
          !
-         DO_3D( 0, 0, 0, 0, 1, jpkm1 )
+         DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpkm1 )
             ztn = pt(ji,jj,jk,jn,Kmm)                                    
             ztd = pt(ji,jj,jk,jn,Kaa) - 2._wp * ztn + pt(ji,jj,jk,jn,Kbb)  ! time laplacian on tracers
@@ -275,5 +273,5 @@
       zfact2 = zfact1 * r1_rho0
       DO jn = 1, kjpt      
-         DO_3D( 0, 0, 0, 0, 1, jpkm1 )
+         DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpkm1 )
             ze3t_b = e3t(ji,jj,jk,Kbb)
             ze3t_n = e3t(ji,jj,jk,Kmm)
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traatf_qco.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traatf_qco.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traatf_qco.F90	(revision 14012)
@@ -149,8 +149,6 @@
          ENDIF
          !
-         CALL lbc_lnk_multi( 'traatfqco', pts(:,:,:,jp_tem,Kbb) , 'T', 1., pts(:,:,:,jp_sal,Kbb) , 'T', 1., &
-                  &                    pts(:,:,:,jp_tem,Kmm) , 'T', 1., pts(:,:,:,jp_sal,Kmm) , 'T', 1., &
-                  &                    pts(:,:,:,jp_tem,Kaa), 'T', 1., pts(:,:,:,jp_sal,Kaa), 'T', 1.  )
-         !
+         CALL lbc_lnk_multi( 'traatfqco', pts(:,:,:,jp_tem,Kmm) , 'T', 1., pts(:,:,:,jp_sal,Kmm) , 'T', 1. )
+
       ENDIF
       !
@@ -203,5 +201,5 @@
       DO jn = 1, kjpt
          !
-         DO_3D( 0, 0, 0, 0, 1, jpkm1 )
+         DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpkm1 )
             ztn = pt(ji,jj,jk,jn,Kmm)
             ztd = pt(ji,jj,jk,jn,Kaa) - 2._wp * ztn + pt(ji,jj,jk,jn,Kbb)  ! time laplacian on tracers
@@ -268,5 +266,5 @@
       zfact2 = zfact1 * r1_rho0
       DO jn = 1, kjpt
-         DO_3D( 0, 0, 0, 0, 1, jpkm1 )
+         DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpkm1 )
             ze3t_b = e3t(ji,jj,jk,Kbb)
             ze3t_n = e3t(ji,jj,jk,Kmm)
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/trabbc.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/trabbc.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/trabbc.F90	(revision 14012)
@@ -80,5 +80,5 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts        ! active tracers and RHS of tracer equation
       !
-      INTEGER  ::   ji, jj    ! dummy loop indices
+      INTEGER  ::   ji, jj, jk    ! dummy loop indices
       REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   ztrdt   ! 3D workspace
       !!----------------------------------------------------------------------
@@ -86,5 +86,5 @@
       IF( ln_timing )   CALL timing_start('tra_bbc')
       !
-      IF( l_trdtra )   THEN         ! Save the input temperature trend
+      IF( l_trdtra ) THEN           ! Save the input temperature trend
          ALLOCATE( ztrdt(jpi,jpj,jpk) )
          ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs)
@@ -96,6 +96,4 @@
       END_2D
       !
-      CALL lbc_lnk( 'trabbc', pts(:,:,:,jp_tem,Krhs) , 'T', 1.0_wp )
-      !
       IF( l_trdtra ) THEN        ! Send the trend for diagnostics
          ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs) - ztrdt(:,:,:)
@@ -104,5 +102,7 @@
       ENDIF
       !
-      CALL iom_put ( "hfgeou" , rho0_rcp * qgh_trd0(:,:) )
+      IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only for the full domain
+         CALL iom_put ( "hfgeou" , rho0_rcp * qgh_trd0(:,:) )
+      ENDIF
       IF(sn_cfctl%l_prtctl)   CALL prt_ctl( tab3d_1=pts(:,:,:,jp_tem,Krhs), clinfo1=' bbc  - Ta: ', mask1=tmask, clinfo3='tra-ta' )
       !
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/trabbl.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/trabbl.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/trabbl.F90	(revision 14012)
@@ -106,4 +106,5 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts             ! active tracers and RHS of tracer equation
       !
+      INTEGER  ::   ji, jj, jk   ! Dummy loop indices
       REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   ztrdt, ztrds
       !!----------------------------------------------------------------------
@@ -112,5 +113,5 @@
       !
       IF( l_trdtra )   THEN                         !* Save the T-S input trends
-         ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) )
+         ALLOCATE( ztrdt(jpi,jpj,jpk), ztrds(jpi,jpj,jpk) )
          ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs)
          ztrds(:,:,:) = pts(:,:,:,jp_sal,Krhs)
@@ -125,8 +126,8 @@
          CALL prt_ctl( tab3d_1=pts(:,:,:,jp_tem,Krhs), clinfo1=' bbl_ldf  - Ta: ', mask1=tmask, &
             &          tab3d_2=pts(:,:,:,jp_sal,Krhs), clinfo2=           ' Sa: ', mask2=tmask, clinfo3='tra' )
-         ! lateral boundary conditions ; just need for outputs
-         CALL lbc_lnk_multi( 'trabbl', ahu_bbl, 'U', 1.0_wp , ahv_bbl, 'V', 1.0_wp )
-         CALL iom_put( "ahu_bbl", ahu_bbl )   ! bbl diffusive flux i-coef
-         CALL iom_put( "ahv_bbl", ahv_bbl )   ! bbl diffusive flux j-coef
+         IF( ntile == 0 .OR. ntile == nijtile ) THEN                       ! Do only on the last tile
+            CALL iom_put( "ahu_bbl", ahu_bbl )   ! bbl diffusive flux i-coef
+            CALL iom_put( "ahv_bbl", ahv_bbl )   ! bbl diffusive flux j-coef
+         ENDIF
          !
       ENDIF
@@ -136,10 +137,13 @@
          CALL tra_bbl_adv( pts(:,:,:,:,Kbb), pts(:,:,:,:,Krhs), jpts, Kmm )
          IF(sn_cfctl%l_prtctl)   &
-         CALL prt_ctl( tab3d_1=pts(:,:,:,jp_tem,Krhs), clinfo1=' bbl_adv  - Ta: ', mask1=tmask,   &
+         CALL prt_ctl( tab3d_1=pts(:,:,:,jp_tem,Krhs), clinfo1=' bbl_adv  - Ta: ', mask1=tmask, &
             &          tab3d_2=pts(:,:,:,jp_sal,Krhs), clinfo2=           ' Sa: ', mask2=tmask, clinfo3='tra' )
-         ! lateral boundary conditions ; just need for outputs
-         CALL lbc_lnk_multi( 'trabbl', utr_bbl, 'U', 1.0_wp , vtr_bbl, 'V', 1.0_wp )
-         CALL iom_put( "uoce_bbl", utr_bbl )  ! bbl i-transport
-         CALL iom_put( "voce_bbl", vtr_bbl )  ! bbl j-transport
+         IF( ntile == 0 .OR. ntile == nijtile ) THEN                       ! Do only on the last tile
+            ! lateral boundary conditions ; just need for outputs
+            ! NOTE: [tiling-comms-merge] The diagnostic results change along the north fold if this is removed
+            CALL lbc_lnk_multi( 'trabbl', utr_bbl, 'U', 1.0_wp , vtr_bbl, 'V', 1.0_wp )
+            CALL iom_put( "uoce_bbl", utr_bbl )  ! bbl i-transport
+            CALL iom_put( "voce_bbl", vtr_bbl )  ! bbl j-transport
+         ENDIF
          !
       ENDIF
@@ -187,5 +191,5 @@
       INTEGER  ::   ik           ! local integers
       REAL(wp) ::   zbtr         ! local scalars
-      REAL(wp), DIMENSION(jpi,jpj) ::   zptb   ! workspace
+      REAL(wp), DIMENSION(A2D(nn_hls)) ::   zptb   ! workspace
       !!----------------------------------------------------------------------
       !
@@ -235,62 +239,63 @@
       INTEGER  ::   iis , iid , ijs , ijd    ! local integers
       INTEGER  ::   ikus, ikud, ikvs, ikvd   !   -       -
+      INTEGER  ::   isi, isj                 !   -       -
       REAL(wp) ::   zbtr, ztra               ! local scalars
       REAL(wp) ::   zu_bbl, zv_bbl           !   -      -
       !!----------------------------------------------------------------------
       !
+      IF( ntsi == Nis0 ) THEN ; isi = 1 ; ELSE ; isi = 0 ; ENDIF    ! Avoid double-counting when using tiling
+      IF( ntsj == Njs0 ) THEN ; isj = 1 ; ELSE ; isj = 0 ; ENDIF
       !                                                          ! ===========
       DO jn = 1, kjpt                                            ! tracer loop
          !                                                       ! ===========
-         DO jj = 1, jpjm1
-            DO ji = 1, jpim1            ! CAUTION start from i=1 to update i=2 when cyclic east-west
-               IF( utr_bbl(ji,jj) /= 0.e0 ) THEN            ! non-zero i-direction bbl advection
-                  ! down-slope i/k-indices (deep)      &   up-slope i/k indices (shelf)
-                  iid  = ji + MAX( 0, mgrhu(ji,jj) )   ;   iis  = ji + 1 - MAX( 0, mgrhu(ji,jj) )
-                  ikud = mbku_d(ji,jj)                 ;   ikus = mbku(ji,jj)
-                  zu_bbl = ABS( utr_bbl(ji,jj) )
-                  !
-                  !                                               ! up  -slope T-point (shelf bottom point)
-                  zbtr = r1_e1e2t(iis,jj) / e3t(iis,jj,ikus,Kmm)
-                  ztra = zu_bbl * ( pt(iid,jj,ikus,jn) - pt(iis,jj,ikus,jn) ) * zbtr
-                  pt_rhs(iis,jj,ikus,jn) = pt_rhs(iis,jj,ikus,jn) + ztra
-                  !
-                  DO jk = ikus, ikud-1                            ! down-slope upper to down T-point (deep column)
-                     zbtr = r1_e1e2t(iid,jj) / e3t(iid,jj,jk,Kmm)
-                     ztra = zu_bbl * ( pt(iid,jj,jk+1,jn) - pt(iid,jj,jk,jn) ) * zbtr
-                     pt_rhs(iid,jj,jk,jn) = pt_rhs(iid,jj,jk,jn) + ztra
-                  END DO
-                  !
-                  zbtr = r1_e1e2t(iid,jj) / e3t(iid,jj,ikud,Kmm)
-                  ztra = zu_bbl * ( pt(iis,jj,ikus,jn) - pt(iid,jj,ikud,jn) ) * zbtr
-                  pt_rhs(iid,jj,ikud,jn) = pt_rhs(iid,jj,ikud,jn) + ztra
-               ENDIF
-               !
-               IF( vtr_bbl(ji,jj) /= 0.e0 ) THEN            ! non-zero j-direction bbl advection
-                  ! down-slope j/k-indices (deep)        &   up-slope j/k indices (shelf)
-                  ijd  = jj + MAX( 0, mgrhv(ji,jj) )     ;   ijs  = jj + 1 - MAX( 0, mgrhv(ji,jj) )
-                  ikvd = mbkv_d(ji,jj)                   ;   ikvs = mbkv(ji,jj)
-                  zv_bbl = ABS( vtr_bbl(ji,jj) )
-                  !
-                  ! up  -slope T-point (shelf bottom point)
-                  zbtr = r1_e1e2t(ji,ijs) / e3t(ji,ijs,ikvs,Kmm)
-                  ztra = zv_bbl * ( pt(ji,ijd,ikvs,jn) - pt(ji,ijs,ikvs,jn) ) * zbtr
-                  pt_rhs(ji,ijs,ikvs,jn) = pt_rhs(ji,ijs,ikvs,jn) + ztra
-                  !
-                  DO jk = ikvs, ikvd-1                            ! down-slope upper to down T-point (deep column)
-                     zbtr = r1_e1e2t(ji,ijd) / e3t(ji,ijd,jk,Kmm)
-                     ztra = zv_bbl * ( pt(ji,ijd,jk+1,jn) - pt(ji,ijd,jk,jn) ) * zbtr
-                     pt_rhs(ji,ijd,jk,jn) = pt_rhs(ji,ijd,jk,jn)  + ztra
-                  END DO
-                  !                                               ! down-slope T-point (deep bottom point)
-                  zbtr = r1_e1e2t(ji,ijd) / e3t(ji,ijd,ikvd,Kmm)
-                  ztra = zv_bbl * ( pt(ji,ijs,ikvs,jn) - pt(ji,ijd,ikvd,jn) ) * zbtr
-                  pt_rhs(ji,ijd,ikvd,jn) = pt_rhs(ji,ijd,ikvd,jn) + ztra
-               ENDIF
-            END DO
+         ! NOTE: [tiling-comms-merge] Bug fix- correct order of indices
+         DO_2D( isj, 0, isi, 0 )            ! CAUTION start from i=1 to update i=2 when cyclic east-west
+            IF( utr_bbl(ji,jj) /= 0.e0 ) THEN            ! non-zero i-direction bbl advection
+               ! down-slope i/k-indices (deep)      &   up-slope i/k indices (shelf)
+               iid  = ji + MAX( 0, mgrhu(ji,jj) )   ;   iis  = ji + 1 - MAX( 0, mgrhu(ji,jj) )
+               ikud = mbku_d(ji,jj)                 ;   ikus = mbku(ji,jj)
+               zu_bbl = ABS( utr_bbl(ji,jj) )
+               !
+               !                                               ! up  -slope T-point (shelf bottom point)
+               zbtr = r1_e1e2t(iis,jj) / e3t(iis,jj,ikus,Kmm)
+               ztra = zu_bbl * ( pt(iid,jj,ikus,jn) - pt(iis,jj,ikus,jn) ) * zbtr
+               pt_rhs(iis,jj,ikus,jn) = pt_rhs(iis,jj,ikus,jn) + ztra
+               !
+               DO jk = ikus, ikud-1                            ! down-slope upper to down T-point (deep column)
+                  zbtr = r1_e1e2t(iid,jj) / e3t(iid,jj,jk,Kmm)
+                  ztra = zu_bbl * ( pt(iid,jj,jk+1,jn) - pt(iid,jj,jk,jn) ) * zbtr
+                  pt_rhs(iid,jj,jk,jn) = pt_rhs(iid,jj,jk,jn) + ztra
+               END DO
+               !
+               zbtr = r1_e1e2t(iid,jj) / e3t(iid,jj,ikud,Kmm)
+               ztra = zu_bbl * ( pt(iis,jj,ikus,jn) - pt(iid,jj,ikud,jn) ) * zbtr
+               pt_rhs(iid,jj,ikud,jn) = pt_rhs(iid,jj,ikud,jn) + ztra
+            ENDIF
             !
-         END DO
-         !                                                  ! ===========
-      END DO                                                ! end tracer
-      !                                                     ! ===========
+            IF( vtr_bbl(ji,jj) /= 0.e0 ) THEN            ! non-zero j-direction bbl advection
+               ! down-slope j/k-indices (deep)        &   up-slope j/k indices (shelf)
+               ijd  = jj + MAX( 0, mgrhv(ji,jj) )     ;   ijs  = jj + 1 - MAX( 0, mgrhv(ji,jj) )
+               ikvd = mbkv_d(ji,jj)                   ;   ikvs = mbkv(ji,jj)
+               zv_bbl = ABS( vtr_bbl(ji,jj) )
+               !
+               ! up  -slope T-point (shelf bottom point)
+               zbtr = r1_e1e2t(ji,ijs) / e3t(ji,ijs,ikvs,Kmm)
+               ztra = zv_bbl * ( pt(ji,ijd,ikvs,jn) - pt(ji,ijs,ikvs,jn) ) * zbtr
+               pt_rhs(ji,ijs,ikvs,jn) = pt_rhs(ji,ijs,ikvs,jn) + ztra
+               !
+               DO jk = ikvs, ikvd-1                            ! down-slope upper to down T-point (deep column)
+                  zbtr = r1_e1e2t(ji,ijd) / e3t(ji,ijd,jk,Kmm)
+                  ztra = zv_bbl * ( pt(ji,ijd,jk+1,jn) - pt(ji,ijd,jk,jn) ) * zbtr
+                  pt_rhs(ji,ijd,jk,jn) = pt_rhs(ji,ijd,jk,jn)  + ztra
+               END DO
+               !                                               ! down-slope T-point (deep bottom point)
+               zbtr = r1_e1e2t(ji,ijd) / e3t(ji,ijd,ikvd,Kmm)
+               ztra = zv_bbl * ( pt(ji,ijs,ikvs,jn) - pt(ji,ijd,ikvd,jn) ) * zbtr
+               pt_rhs(ji,ijd,ikvd,jn) = pt_rhs(ji,ijd,ikvd,jn) + ztra
+            ENDIF
+         END_2D
+         !                                                       ! ===========
+      END DO                                                     ! end tracer
+      !                                                          ! ===========
    END SUBROUTINE tra_bbl_adv
 
@@ -333,12 +338,14 @@
       REAL(wp) ::   za, zb, zgdrho            ! local scalars
       REAL(wp) ::   zsign, zsigna, zgbbl      !   -      -
-      REAL(wp), DIMENSION(jpi,jpj,jpts)   :: zts, zab         ! 3D workspace
-      REAL(wp), DIMENSION(jpi,jpj)        :: zub, zvb, zdep   ! 2D workspace
-      !!----------------------------------------------------------------------
-      !
-      IF( kt == kit000 )  THEN
-         IF(lwp)  WRITE(numout,*)
-         IF(lwp)  WRITE(numout,*) 'trabbl:bbl : Compute bbl velocities and diffusive coefficients in ', cdtype
-         IF(lwp)  WRITE(numout,*) '~~~~~~~~~~'
+      REAL(wp), DIMENSION(A2D(nn_hls),jpts)   :: zts, zab         ! 3D workspace
+      REAL(wp), DIMENSION(A2D(nn_hls))        :: zub, zvb, zdep   ! 2D workspace
+      !!----------------------------------------------------------------------
+      !
+      IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile
+         IF( kt == kit000 )  THEN
+            IF(lwp)  WRITE(numout,*)
+            IF(lwp)  WRITE(numout,*) 'trabbl:bbl : Compute bbl velocities and diffusive coefficients in ', cdtype
+            IF(lwp)  WRITE(numout,*) '~~~~~~~~~~'
+         ENDIF
       ENDIF
       !                                        !* bottom variables (T, S, alpha, beta, depth, velocity)
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/tradmp.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/tradmp.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/tradmp.F90	(revision 14012)
@@ -95,5 +95,5 @@
       !
       INTEGER ::   ji, jj, jk, jn   ! dummy loop indices
-      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts)     ::  zts_dta
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk,jpts)     ::  zts_dta
       REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::  ztrdts
       !!----------------------------------------------------------------------
@@ -102,6 +102,6 @@
       !
       IF( l_trdtra )   THEN                    !* Save ta and sa trends
-         ALLOCATE( ztrdts(jpi,jpj,jpk,jpts) ) 
-         ztrdts(:,:,:,:) = pts(:,:,:,:,Krhs) 
+         ALLOCATE( ztrdts(jpi,jpj,jpk,jpts) )
+         ztrdts(:,:,:,:) = pts(:,:,:,:,Krhs)
       ENDIF
       !                           !==  input T-S data at kt  ==!
@@ -144,5 +144,5 @@
          CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_dmp, ztrdts(:,:,:,jp_tem) )
          CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_sal, jptra_dmp, ztrdts(:,:,:,jp_sal) )
-         DEALLOCATE( ztrdts ) 
+         DEALLOCATE( ztrdts )
       ENDIF
       !                           ! Control print
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traisf.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traisf.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traisf.F90	(revision 14012)
@@ -11,4 +11,5 @@
    !!----------------------------------------------------------------------
    USE isf_oce                                     ! Ice shelf variables
+   USE par_oce , ONLY : nijtile, ntile, ntsi, ntei, ntsj, ntej
    USE dom_oce                                     ! ocean space domain variables
    USE isfutils, ONLY : debug                      ! debug option
@@ -46,8 +47,10 @@
       IF( ln_timing )   CALL timing_start('tra_isf')
       !
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'tra_isf : Ice shelf heat fluxes'
-         IF(lwp) WRITE(numout,*) '~~~~~~~ '
+      IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile
+         IF( kt == nit000 ) THEN
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) 'tra_isf : Ice shelf heat fluxes'
+            IF(lwp) WRITE(numout,*) '~~~~~~~ '
+         ENDIF
       ENDIF
       !
@@ -76,6 +79,8 @@
       !
       IF ( ln_isfdebug ) THEN
-         CALL debug('tra_isf: pts(:,:,:,:,Krhs) T', pts(:,:,:,1,Krhs))
-         CALL debug('tra_isf: pts(:,:,:,:,Krhs) S', pts(:,:,:,2,Krhs))
+         IF( ntile == 0 .OR. ntile == nijtile ) THEN                       ! Do only for the full domain
+            CALL debug('tra_isf: pts(:,:,:,:,Krhs) T', pts(:,:,:,1,Krhs))
+            CALL debug('tra_isf: pts(:,:,:,:,Krhs) S', pts(:,:,:,2,Krhs))
+         ENDIF
       END IF
       !
@@ -101,12 +106,14 @@
       INTEGER                      :: ji,jj,jk  ! loop index   
       INTEGER                      :: ikt, ikb  ! top and bottom level of the tbl
-      REAL(wp), DIMENSION(jpi,jpj) :: ztc       ! total ice shelf tracer trend
+      REAL(wp), DIMENSION(A2D(nn_hls))     :: ztc       ! total ice shelf tracer trend
       !!----------------------------------------------------------------------
       !
       ! compute 2d total trend due to isf
-      ztc(:,:) = 0.5_wp * ( ptsc(:,:,jp_tem) + ptsc_b(:,:,jp_tem) ) / phtbl(:,:)
+      DO_2D( 0, 0, 0, 0 )
+         ztc(ji,jj) = 0.5_wp * ( ptsc(ji,jj,jp_tem) + ptsc_b(ji,jj,jp_tem) ) / phtbl(ji,jj)
+      END_2D
       !
       ! update pts(:,:,:,:,Krhs)
-      DO_2D( 1, 1, 1, 1 )
+      DO_2D( 0, 0, 0, 0 )
          !
          ikt = ktop(ji,jj)
@@ -137,13 +144,11 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in   ) :: ptsc
       !!----------------------------------------------------------------------
-      INTEGER :: jk
+      INTEGER :: ji, jj, jk
       !!----------------------------------------------------------------------
       !
-      DO jk = 1,jpk
-         ptsa(:,:,jk,jp_tem) =   &
-            &  ptsa(:,:,jk,jp_tem) + ptsc(:,:,jk,jp_tem) * r1_e1e2t(:,:) / e3t(:,:,jk,Kmm)
-         ptsa(:,:,jk,jp_sal) =   &
-            &  ptsa(:,:,jk,jp_sal) + ptsc(:,:,jk,jp_sal) * r1_e1e2t(:,:) / e3t(:,:,jk,Kmm)
-      END DO
+      DO_3D( 0, 0, 0, 0, 1, jpk )
+         ptsa(ji,jj,jk,jp_tem) = ptsa(ji,jj,jk,jp_tem) + ptsc(ji,jj,jk,jp_tem) * r1_e1e2t(ji,jj) / e3t(ji,jj,jk,Kmm)
+         ptsa(ji,jj,jk,jp_sal) = ptsa(ji,jj,jk,jp_sal) + ptsc(ji,jj,jk,jp_sal) * r1_e1e2t(ji,jj) / e3t(ji,jj,jk,Kmm)
+      END_3D
       !
    END SUBROUTINE tra_isf_cpl
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traldf.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traldf.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traldf.F90	(revision 14012)
@@ -17,4 +17,6 @@
    USE oce            ! ocean dynamics and tracers
    USE dom_oce        ! ocean space and time domain
+   ! TEMP: [tiling] This change not necessary after extra haloes development (lbc_lnk removed from tra_ldf_blp, zps_hde*)
+   USE domain, ONLY : dom_tile
    USE phycst         ! physical constants
    USE ldftra         ! lateral diffusion: eddy diffusivity & EIV coeff.
@@ -37,5 +39,5 @@
    PUBLIC   tra_ldf        ! called by step.F90 
    PUBLIC   tra_ldf_init   ! called by nemogcm.F90 
-   
+
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
@@ -56,34 +58,56 @@
       !!
       REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   ztrdt, ztrds
+      ! TEMP: [tiling] This change not necessary after extra haloes development (lbc_lnk removed from tra_ldf_blp, zps_hde*)
+      LOGICAL :: lskip
       !!----------------------------------------------------------------------
       !
       IF( ln_timing )   CALL timing_start('tra_ldf')
       !
+      lskip = .FALSE.
+
       IF( l_trdtra )   THEN                    !* Save ta and sa trends
-         ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) ) 
-         ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs) 
+         ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) )
+         ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs)
          ztrds(:,:,:) = pts(:,:,:,jp_sal,Krhs)
       ENDIF
-      !
-      SELECT CASE ( nldf_tra )                 !* compute lateral mixing trend and add it to the general trend
-      CASE ( np_lap   )                                  ! laplacian: iso-level operator
-         CALL tra_ldf_lap  ( kt, Kmm, nit000,'TRA', ahtu, ahtv, gtsu, gtsv, gtui, gtvi, pts(:,:,:,:,Kbb), pts(:,:,:,:,Krhs),                   jpts,  1 )
-      CASE ( np_lap_i )                                  ! laplacian: standard iso-neutral operator (Madec)
-         CALL tra_ldf_iso  ( kt, Kmm, nit000,'TRA', ahtu, ahtv, gtsu, gtsv, gtui, gtvi, pts(:,:,:,:,Kbb), pts(:,:,:,:,Kbb), pts(:,:,:,:,Krhs), jpts,  1 )
-      CASE ( np_lap_it )                                 ! laplacian: triad iso-neutral operator (griffies)
-         CALL tra_ldf_triad( kt, Kmm, nit000,'TRA', ahtu, ahtv, gtsu, gtsv, gtui, gtvi, pts(:,:,:,:,Kbb), pts(:,:,:,:,Kbb), pts(:,:,:,:,Krhs), jpts,  1 )
-      CASE ( np_blp , np_blp_i , np_blp_it )             ! bilaplacian: iso-level & iso-neutral operators
-         CALL tra_ldf_blp  ( kt, Kmm, nit000,'TRA', ahtu, ahtv, gtsu, gtsv, gtui, gtvi, pts(:,:,:,:,Kbb), pts(:,:,:,:,Krhs),             jpts, nldf_tra )
-      END SELECT
-      !
-      IF( l_trdtra )   THEN                    !* save the horizontal diffusive trends for further diagnostics
-         ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs) - ztrdt(:,:,:)
-         ztrds(:,:,:) = pts(:,:,:,jp_sal,Krhs) - ztrds(:,:,:)
-         CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_ldf, ztrdt )
-         CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_sal, jptra_ldf, ztrds )
-         DEALLOCATE( ztrdt, ztrds ) 
+
+      ! TEMP: [tiling] These changes not necessary after extra haloes development (lbc_lnk removed from tra_ldf_blp, zps_hde*)
+      IF( nldf_tra == np_blp .OR. nldf_tra == np_blp_i .OR. nldf_tra == np_blp_it )  THEN
+         IF( ln_tile ) THEN
+            IF( ntile == 1 ) THEN
+               CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 )
+            ELSE
+               lskip = .TRUE.
+            ENDIF
+         ENDIF
+      ENDIF
+      IF( .NOT. lskip ) THEN
+         !
+         SELECT CASE ( nldf_tra )                 !* compute lateral mixing trend and add it to the general trend
+         CASE ( np_lap   )                                  ! laplacian: iso-level operator
+            CALL tra_ldf_lap  ( kt, Kmm, nit000,'TRA', ahtu, ahtv, gtsu, gtsv, gtui, gtvi, pts(:,:,:,:,Kbb), pts(:,:,:,:,Krhs),                   jpts,  1 )
+         CASE ( np_lap_i )                                  ! laplacian: standard iso-neutral operator (Madec)
+            CALL tra_ldf_iso  ( kt, Kmm, nit000,'TRA', ahtu, ahtv, gtsu, gtsv, gtui, gtvi, pts(:,:,:,:,Kbb), pts(:,:,:,:,Kbb), pts(:,:,:,:,Krhs), jpts,  1 )
+         CASE ( np_lap_it )                                 ! laplacian: triad iso-neutral operator (griffies)
+            CALL tra_ldf_triad( kt, Kmm, nit000,'TRA', ahtu, ahtv, gtsu, gtsv, gtui, gtvi, pts(:,:,:,:,Kbb), pts(:,:,:,:,Kbb), pts(:,:,:,:,Krhs), jpts,  1 )
+         CASE ( np_blp , np_blp_i , np_blp_it )             ! bilaplacian: iso-level & iso-neutral operators
+            ! NOTE: [tiling-comms-merge] This lbc_lnk is still needed in the zco case, because zps_hde is not called in step
+            IF(nn_hls.EQ.2) CALL lbc_lnk( 'tra_ldf', pts(:,:,:,:,Kbb), 'T',1.)
+            CALL tra_ldf_blp  ( kt, Kmm, nit000,'TRA', ahtu, ahtv, gtsu, gtsv, gtui, gtvi, pts(:,:,:,:,Kbb), pts(:,:,:,:,Krhs),             jpts, nldf_tra )
+         END SELECT
+         !
+         IF( l_trdtra )   THEN                    !* save the horizontal diffusive trends for further diagnostics
+            ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs) - ztrdt(:,:,:)
+            ztrds(:,:,:) = pts(:,:,:,jp_sal,Krhs) - ztrds(:,:,:)
+            CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_ldf, ztrdt )
+            CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_sal, jptra_ldf, ztrds )
+            DEALLOCATE( ztrdt, ztrds )
+         ENDIF
+
+         ! TEMP: [tiling] This change not necessary after extra haloes development (lbc_lnk removed from tra_ldf_blp, zps_hde*)
+         IF( ln_tile .AND. ntile == 0 ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 1 )
       ENDIF
       !                                        !* print mean trends (used for debugging)
-      IF(sn_cfctl%l_prtctl)   CALL prt_ctl( tab3d_1=pts(:,:,:,jp_tem,Krhs), clinfo1=' ldf  - Ta: ', mask1=tmask,               &
+      IF(sn_cfctl%l_prtctl)   CALL prt_ctl( tab3d_1=pts(:,:,:,jp_tem,Krhs), clinfo1=' ldf  - Ta: ', mask1=tmask, &
          &                                  tab3d_2=pts(:,:,:,jp_sal,Krhs), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' )
       !
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traldf_iso.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traldf_iso.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traldf_iso.F90	(revision 14012)
@@ -19,4 +19,5 @@
    USE oce            ! ocean dynamics and active tracers
    USE dom_oce        ! ocean space and time domain
+   USE domutl, ONLY : is_tile
    USE trc_oce        ! share passive tracers/Ocean variables
    USE zdf_oce        ! ocean vertical physics
@@ -49,7 +50,30 @@
 CONTAINS
 
-  SUBROUTINE tra_ldf_iso( kt, Kmm, kit000, cdtype, pahu, pahv,                    &
-      &                                            pgu , pgv    ,   pgui, pgvi,   &
-      &                                       pt , pt2 , pt_rhs , kjpt  , kpass )
+   SUBROUTINE tra_ldf_iso( kt, Kmm, kit000, cdtype, pahu, pahv,             &
+      &                                             pgu , pgv , pgui, pgvi, &
+      &                                             pt, pt2, pt_rhs, kjpt, kpass )
+      !!
+      INTEGER                     , INTENT(in   ) ::   kt         ! ocean time-step index
+      INTEGER                     , INTENT(in   ) ::   kit000     ! first time step index
+      CHARACTER(len=3)            , INTENT(in   ) ::   cdtype     ! =TRA or TRC (tracer indicator)
+      INTEGER                     , INTENT(in   ) ::   kjpt       ! number of tracers
+      INTEGER                     , INTENT(in   ) ::   kpass      ! =1/2 first or second passage
+      INTEGER                     , INTENT(in   ) ::   Kmm        ! ocean time level index
+      REAL(wp), DIMENSION(:,:,:)  , INTENT(in   ) ::   pahu, pahv ! eddy diffusivity at u- and v-points  [m2/s]
+      REAL(wp), DIMENSION(:,:,:)  , INTENT(in   ) ::   pgu, pgv   ! tracer gradient at pstep levels
+      REAL(wp), DIMENSION(:,:,:)  , INTENT(in   ) ::   pgui, pgvi ! tracer gradient at top   levels
+      REAL(wp), DIMENSION(:,:,:,:), INTENT(in   ) ::   pt         ! tracer (kpass=1) or laplacian of tracer (kpass=2)
+      REAL(wp), DIMENSION(:,:,:,:), INTENT(in   ) ::   pt2        ! tracer (only used in kpass=2)
+      REAL(wp), DIMENSION(:,:,:,:), INTENT(inout) ::   pt_rhs     ! tracer trend
+      !!
+      CALL tra_ldf_iso_t( kt, Kmm, kit000, cdtype, pahu, pahv, is_tile(pahu),                             &
+         &                                         pgu , pgv , is_tile(pgu) , pgui, pgvi, is_tile(pgui),  &
+         &                                         pt, is_tile(pt), pt2, is_tile(pt2), pt_rhs, is_tile(pt_rhs), kjpt, kpass )
+   END SUBROUTINE tra_ldf_iso
+
+
+  SUBROUTINE tra_ldf_iso_t( kt, Kmm, kit000, cdtype, pahu, pahv, ktah,                    &
+      &                                              pgu , pgv , ktg , pgui, pgvi, ktgi,  &
+      &                                              pt, ktt, pt2, ktt2, pt_rhs, ktt_rhs, kjpt, kpass )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE tra_ldf_iso  ***
@@ -92,16 +116,17 @@
       !! ** Action :   Update pt_rhs arrays with the before rotated diffusion
       !!----------------------------------------------------------------------
-      INTEGER                              , INTENT(in   ) ::   kt         ! ocean time-step index
-      INTEGER                              , INTENT(in   ) ::   kit000     ! first time step index
-      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype     ! =TRA or TRC (tracer indicator)
-      INTEGER                              , INTENT(in   ) ::   kjpt       ! number of tracers
-      INTEGER                              , INTENT(in   ) ::   kpass      ! =1/2 first or second passage
-      INTEGER                              , INTENT(in   ) ::   Kmm        ! ocean time level index
-      REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(in   ) ::   pahu, pahv ! eddy diffusivity at u- and v-points  [m2/s]
-      REAL(wp), DIMENSION(jpi,jpj    ,kjpt), INTENT(in   ) ::   pgu, pgv   ! tracer gradient at pstep levels
-      REAL(wp), DIMENSION(jpi,jpj,    kjpt), INTENT(in   ) ::   pgui, pgvi ! tracer gradient at top   levels
-      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   pt         ! tracer (kpass=1) or laplacian of tracer (kpass=2)
-      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   pt2        ! tracer (only used in kpass=2)
-      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pt_rhs     ! tracer trend
+      INTEGER                                   , INTENT(in   ) ::   kt         ! ocean time-step index
+      INTEGER                                   , INTENT(in   ) ::   kit000     ! first time step index
+      CHARACTER(len=3)                          , INTENT(in   ) ::   cdtype     ! =TRA or TRC (tracer indicator)
+      INTEGER                                   , INTENT(in   ) ::   kjpt       ! number of tracers
+      INTEGER                                   , INTENT(in   ) ::   kpass      ! =1/2 first or second passage
+      INTEGER                                   , INTENT(in   ) ::   Kmm        ! ocean time level index
+      INTEGER                                   , INTENT(in   ) ::   ktah, ktg, ktgi, ktt, ktt2, ktt_rhs
+      REAL(wp), DIMENSION(A2D_T(ktah)   ,JPK)     , INTENT(in   ) ::   pahu, pahv ! eddy diffusivity at u- and v-points  [m2/s]
+      REAL(wp), DIMENSION(A2D_T(ktg)        ,KJPT), INTENT(in   ) ::   pgu, pgv   ! tracer gradient at pstep levels
+      REAL(wp), DIMENSION(A2D_T(ktgi)       ,KJPT), INTENT(in   ) ::   pgui, pgvi ! tracer gradient at top   levels
+      REAL(wp), DIMENSION(A2D_T(ktt)    ,JPK,KJPT), INTENT(in   ) ::   pt         ! tracer (kpass=1) or laplacian of tracer (kpass=2)
+      REAL(wp), DIMENSION(A2D_T(ktt2)   ,JPK,KJPT), INTENT(in   ) ::   pt2        ! tracer (only used in kpass=2)
+      REAL(wp), DIMENSION(A2D_T(ktt_rhs),JPK,KJPT), INTENT(inout) ::   pt_rhs     ! tracer trend
       !
       INTEGER  ::  ji, jj, jk, jn   ! dummy loop indices
@@ -111,22 +136,28 @@
       REAL(wp) ::  zmskv, zahv_w, zabe2, zcof2, zcoef4   !   -      -
       REAL(wp) ::  zcoef0, ze3w_2, zsign                 !   -      -
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zdkt, zdk1t, z2d
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zdit, zdjt, zftu, zftv, ztfw 
+      REAL(wp), DIMENSION(A2D(nn_hls))     ::   zdkt, zdk1t, z2d
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk) ::   zdit, zdjt, zftu, zftv, ztfw
       !!----------------------------------------------------------------------
       !
       IF( kpass == 1 .AND. kt == kit000 )  THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'tra_ldf_iso : rotated laplacian diffusion operator on ', cdtype
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
-         !
-         akz     (:,:,:) = 0._wp      
-         ah_wslp2(:,:,:) = 0._wp
+         IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) 'tra_ldf_iso : rotated laplacian diffusion operator on ', cdtype
+            IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
+         ENDIF
+         !
+         DO_3D( 0, 0, 0, 0, 1, jpk )
+            akz     (ji,jj,jk) = 0._wp
+            ah_wslp2(ji,jj,jk) = 0._wp
+         END_3D
       ENDIF
-      !   
-      l_hst = .FALSE.
-      l_ptr = .FALSE.
-      IF( cdtype == 'TRA' .AND. ( iom_use( 'sophtldf' ) .OR. iom_use( 'sopstldf' ) ) )     l_ptr = .TRUE. 
-      IF( cdtype == 'TRA' .AND. ( iom_use("uadv_heattr") .OR. iom_use("vadv_heattr") .OR. &
-         &                        iom_use("uadv_salttr") .OR. iom_use("vadv_salttr")  ) )   l_hst = .TRUE.
+      !
+      IF( ntile == 0 .OR. ntile == 1 )  THEN                           ! Do only on the first tile
+         l_hst = .FALSE.
+         l_ptr = .FALSE.
+         IF( cdtype == 'TRA' .AND. ( iom_use( 'sophtldf' ) .OR. iom_use( 'sopstldf' ) ) )     l_ptr = .TRUE.
+         IF( cdtype == 'TRA' .AND. ( iom_use("uadv_heattr") .OR. iom_use("vadv_heattr") .OR. &
+            &                        iom_use("uadv_salttr") .OR. iom_use("vadv_salttr")  ) )   l_hst = .TRUE.
+      ENDIF
       !
       !
@@ -167,5 +198,5 @@
             !
             IF( ln_traldf_blp ) THEN                ! bilaplacian operator
-               DO_3D( 1, 0, 1, 0, 2, jpkm1 )
+               DO_3D( 0, 0, 0, 0, 2, jpkm1 )
                   akz(ji,jj,jk) = 16._wp   &
                      &   * ah_wslp2   (ji,jj,jk)   &
@@ -175,5 +206,5 @@
                END_3D
             ELSEIF( ln_traldf_lap ) THEN              ! laplacian operator
-               DO_3D( 1, 0, 1, 0, 2, jpkm1 )
+               DO_3D( 0, 0, 0, 0, 2, jpkm1 )
                   ze3w_2 = e3w(ji,jj,jk,Kmm) * e3w(ji,jj,jk,Kmm)
                   zcoef0 = rDt * (  akz(ji,jj,jk) + ah_wslp2(ji,jj,jk) / ze3w_2  )
@@ -183,5 +214,7 @@
            !
          ELSE                                    ! 33 flux set to zero with akz=ah_wslp2 ==>> computed in full implicit
-            akz(:,:,:) = ah_wslp2(:,:,:)      
+            DO_3D( 0, 0, 0, 0, 1, jpk )
+               akz(ji,jj,jk) = ah_wslp2(ji,jj,jk)
+            END_3D
          ENDIF
       ENDIF
@@ -195,6 +228,6 @@
          !!----------------------------------------------------------------------
 !!gm : bug.... why (x,:,:)?   (1,jpj,:) and (jpi,1,:) should be sufficient....
-         zdit (1,:,:) = 0._wp     ;     zdit (jpi,:,:) = 0._wp
-         zdjt (1,:,:) = 0._wp     ;     zdjt (jpi,:,:) = 0._wp
+         zdit (ntsi-nn_hls,:,:) = 0._wp     ;     zdit (ntei+nn_hls,:,:) = 0._wp
+         zdjt (ntsi-nn_hls,:,:) = 0._wp     ;     zdjt (ntei+nn_hls,:,:) = 0._wp
          !!end
 
@@ -223,10 +256,13 @@
          DO jk = 1, jpkm1                                 ! Horizontal slab
             !
-            !                             !== Vertical tracer gradient
-            zdk1t(:,:) = ( pt(:,:,jk,jn) - pt(:,:,jk+1,jn) ) * wmask(:,:,jk+1)     ! level jk+1
-            !
-            IF( jk == 1 ) THEN   ;   zdkt(:,:) = zdk1t(:,:)                          ! surface: zdkt(jk=1)=zdkt(jk=2)
-            ELSE                 ;   zdkt(:,:) = ( pt(:,:,jk-1,jn) - pt(:,:,jk,jn) ) * wmask(:,:,jk)
-            ENDIF
+            DO_2D( 1, 1, 1, 1 )
+               !                             !== Vertical tracer gradient
+               zdk1t(ji,jj) = ( pt(ji,jj,jk,jn) - pt(ji,jj,jk+1,jn) ) * wmask(ji,jj,jk+1)     ! level jk+1
+               !
+               IF( jk == 1 ) THEN   ;   zdkt(ji,jj) = zdk1t(ji,jj)                            ! surface: zdkt(jk=1)=zdkt(jk=2)
+               ELSE                 ;   zdkt(ji,jj) = ( pt(ji,jj,jk-1,jn) - pt(ji,jj,jk,jn) ) * wmask(ji,jj,jk)
+               ENDIF
+            END_2D
+            !
             DO_2D( 1, 0, 1, 0 )           !==  Horizontal fluxes
                zabe1 = pahu(ji,jj,jk) * e2_e1u(ji,jj) * e3u(ji,jj,jk,Kmm)
@@ -330,5 +366,5 @@
       END DO                                                      ! end tracer loop
       !
-   END SUBROUTINE tra_ldf_iso
+   END SUBROUTINE tra_ldf_iso_t
 
    !!==============================================================================
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traldf_lap_blp.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traldf_lap_blp.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traldf_lap_blp.F90	(revision 14012)
@@ -13,4 +13,5 @@
    USE oce            ! ocean dynamics and active tracers
    USE dom_oce        ! ocean space and time domain
+   USE domutl, ONLY : is_tile
    USE ldftra         ! lateral physics: eddy diffusivity
    USE traldf_iso     ! iso-neutral lateral diffusion (standard operator)     (tra_ldf_iso   routine)
@@ -46,7 +47,29 @@
 CONTAINS
 
-   SUBROUTINE tra_ldf_lap( kt, Kmm, kit000, cdtype, pahu, pahv  ,               &
-      &                                             pgu , pgv   , pgui, pgvi,   &
-      &                                             pt  , pt_rhs, kjpt, kpass ) 
+   SUBROUTINE tra_ldf_lap( kt, Kmm, kit000, cdtype, pahu, pahv,             &
+      &                                             pgu , pgv , pgui, pgvi, &
+      &                                             pt, pt_rhs, kjpt, kpass )
+      !!
+      INTEGER                     , INTENT(in   ) ::   kt         ! ocean time-step index
+      INTEGER                     , INTENT(in   ) ::   kit000     ! first time step index
+      CHARACTER(len=3)            , INTENT(in   ) ::   cdtype     ! =TRA or TRC (tracer indicator)
+      INTEGER                     , INTENT(in   ) ::   kjpt       ! number of tracers
+      INTEGER                     , INTENT(in   ) ::   kpass      ! =1/2 first or second passage
+      INTEGER                     , INTENT(in   ) ::   Kmm        ! ocean time level index
+      REAL(wp), DIMENSION(:,:,:)  , INTENT(in   ) ::   pahu, pahv ! eddy diffusivity at u- and v-points  [m2/s]
+      REAL(wp), DIMENSION(:,:,:)  , INTENT(in   ) ::   pgu, pgv   ! tracer gradient at pstep levels
+      REAL(wp), DIMENSION(:,:,:)  , INTENT(in   ) ::   pgui, pgvi ! tracer gradient at top   levels
+      REAL(wp), DIMENSION(:,:,:,:), INTENT(in   ) ::   pt         ! before tracer fields
+      REAL(wp), DIMENSION(:,:,:,:), INTENT(inout) ::   pt_rhs     ! tracer trend
+      !!
+      CALL tra_ldf_lap_t( kt, Kmm, kit000, cdtype, pahu, pahv, is_tile(pahu),                            &
+      &                                            pgu , pgv , is_tile(pgu) , pgui, pgvi, is_tile(pgui), &
+      &                                            pt, is_tile(pt), pt_rhs, is_tile(pt_rhs), kjpt, kpass )
+   END SUBROUTINE tra_ldf_lap
+
+
+   SUBROUTINE tra_ldf_lap_t( kt, Kmm, kit000, cdtype, pahu, pahv, ktah,                   &
+      &                                               pgu , pgv , ktg , pgui, pgvi, ktgi, &
+      &                                               pt, ktt, pt_rhs, ktt_rhs, kjpt, kpass )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE tra_ldf_lap  ***
@@ -72,26 +95,30 @@
       INTEGER                              , INTENT(in   ) ::   kpass      ! =1/2 first or second passage
       INTEGER                              , INTENT(in   ) ::   Kmm        ! ocean time level index
-      REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(in   ) ::   pahu, pahv ! eddy diffusivity at u- and v-points  [m2/s]
-      REAL(wp), DIMENSION(jpi,jpj    ,kjpt), INTENT(in   ) ::   pgu, pgv   ! tracer gradient at pstep levels
-      REAL(wp), DIMENSION(jpi,jpj,    kjpt), INTENT(in   ) ::   pgui, pgvi ! tracer gradient at top   levels
-      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   pt         ! before tracer fields
-      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pt_rhs     ! tracer trend 
-      !
-      INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices
-      REAL(wp) ::   zsign            ! local scalars
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   ztu, ztv, zaheeu, zaheev
-      !!----------------------------------------------------------------------
-      !
-      IF( kt == nit000 .AND. lwp )  THEN
-         WRITE(numout,*)
-         WRITE(numout,*) 'tra_ldf_lap : iso-level laplacian diffusion on ', cdtype, ', pass=', kpass
-         WRITE(numout,*) '~~~~~~~~~~~ '
-      ENDIF
-      !
-      l_hst = .FALSE.
-      l_ptr = .FALSE.
-      IF( cdtype == 'TRA' .AND. ( iom_use( 'sophtldf' ) .OR. iom_use( 'sopstldf' ) ) )     l_ptr = .TRUE.
-      IF( cdtype == 'TRA' .AND. ( iom_use("uadv_heattr") .OR. iom_use("vadv_heattr") .OR. &
-         &                        iom_use("uadv_salttr") .OR. iom_use("vadv_salttr")  ) )  l_hst = .TRUE.
+      INTEGER                              , INTENT(in   ) ::   ktah, ktg, ktgi, ktt, ktt_rhs
+      REAL(wp), DIMENSION(A2D_T(ktah),   JPK)     , INTENT(in   ) ::   pahu, pahv ! eddy diffusivity at u- and v-points  [m2/s]
+      REAL(wp), DIMENSION(A2D_T(ktg),        KJPT), INTENT(in   ) ::   pgu, pgv   ! tracer gradient at pstep levels
+      REAL(wp), DIMENSION(A2D_T(ktgi),       KJPT), INTENT(in   ) ::   pgui, pgvi ! tracer gradient at top   levels
+      REAL(wp), DIMENSION(A2D_T(ktt),    JPK,KJPT), INTENT(in   ) ::   pt         ! before tracer fields
+      REAL(wp), DIMENSION(A2D_T(ktt_rhs),JPK,KJPT), INTENT(inout) ::   pt_rhs     ! tracer trend
+      !
+      INTEGER  ::   ji, jj, jk, jn      ! dummy loop indices
+      INTEGER  ::   isi, iei, isj, iej  ! local integers
+      REAL(wp) ::   zsign               ! local scalars
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk) ::   ztu, ztv, zaheeu, zaheev
+      !!----------------------------------------------------------------------
+      !
+      IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile
+         IF( kt == nit000 .AND. lwp )  THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'tra_ldf_lap : iso-level laplacian diffusion on ', cdtype, ', pass=', kpass
+            WRITE(numout,*) '~~~~~~~~~~~ '
+         ENDIF
+         !
+         l_hst = .FALSE.
+         l_ptr = .FALSE.
+         IF( cdtype == 'TRA' .AND. ( iom_use( 'sophtldf' ) .OR. iom_use( 'sopstldf' ) ) )     l_ptr = .TRUE.
+         IF( cdtype == 'TRA' .AND. ( iom_use("uadv_heattr") .OR. iom_use("vadv_heattr") .OR. &
+            &                        iom_use("uadv_salttr") .OR. iom_use("vadv_salttr")  ) )  l_hst = .TRUE.
+      ENDIF
       !
       !                                !==  Initialization of metric arrays used for all tracers  ==!
@@ -99,5 +126,11 @@
       ELSE                    ;   zsign = -1._wp
       ENDIF
-      DO_3D( 1, 0, 1, 0, 1, jpkm1 )
+
+      IF( ntsi == Nis0 ) THEN ; isi = nn_hls - 1 ; ELSE ; isi = 0 ; ENDIF    ! Avoid double-counting when using tiling
+      IF( ntsj == Njs0 ) THEN ; isj = nn_hls - 1 ; ELSE ; isj = 0 ; ENDIF
+      IF( ntei == Nie0 ) THEN ; iei = nn_hls - 1 ; ELSE ; iei = 0 ; ENDIF
+      IF( ntej == Nje0 ) THEN ; iej = nn_hls - 1 ; ELSE ; iej = 0 ; ENDIF
+
+      DO_3D( nn_hls, nn_hls-1, nn_hls, nn_hls-1, 1, jpkm1 )            !== First derivative (gradient)  ==!
          zaheeu(ji,jj,jk) = zsign * pahu(ji,jj,jk) * e2_e1u(ji,jj) * e3u(ji,jj,jk,Kmm)   !!gm   * umask(ji,jj,jk) pah masked!
          zaheev(ji,jj,jk) = zsign * pahv(ji,jj,jk) * e1_e2v(ji,jj) * e3v(ji,jj,jk,Kmm)   !!gm   * vmask(ji,jj,jk)
@@ -108,15 +141,15 @@
          !                          ! =========== !    
          !                               
-         DO_3D( 1, 0, 1, 0, 1, jpkm1 )            !== First derivative (gradient)  ==!
+         DO_3D( nn_hls, nn_hls-1, nn_hls, nn_hls-1, 1, jpkm1 )            !== First derivative (gradient)  ==!
             ztu(ji,jj,jk) = zaheeu(ji,jj,jk) * ( pt(ji+1,jj  ,jk,jn) - pt(ji,jj,jk,jn) )
             ztv(ji,jj,jk) = zaheev(ji,jj,jk) * ( pt(ji  ,jj+1,jk,jn) - pt(ji,jj,jk,jn) )
          END_3D
          IF( ln_zps ) THEN                             ! set gradient at bottom/top ocean level
-            DO_2D( 1, 0, 1, 0 )                              ! bottom
+            DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 )                              ! bottom
                ztu(ji,jj,mbku(ji,jj)) = zaheeu(ji,jj,mbku(ji,jj)) * pgu(ji,jj,jn)
                ztv(ji,jj,mbkv(ji,jj)) = zaheev(ji,jj,mbkv(ji,jj)) * pgv(ji,jj,jn)
             END_2D
             IF( ln_isfcav ) THEN                             ! top in ocean cavities only
-               DO_2D( 1, 0, 1, 0 )
+               DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 )
                   IF( miku(ji,jj) > 1 )   ztu(ji,jj,miku(ji,jj)) = zaheeu(ji,jj,miku(ji,jj)) * pgui(ji,jj,jn) 
                   IF( mikv(ji,jj) > 1 )   ztv(ji,jj,mikv(ji,jj)) = zaheev(ji,jj,mikv(ji,jj)) * pgvi(ji,jj,jn) 
@@ -125,5 +158,6 @@
          ENDIF
          !
-         DO_3D( 0, 0, 0, 0, 1, jpkm1 )            !== Second derivative (divergence) added to the general tracer trends  ==!
+         ! NOTE: [tiling-comms-merge] Bounds changed to avoid repeating this calculation for overlapping rows when using tiling
+         DO_3D( isj, iej, isi, iei, 1, jpkm1 )            !== Second derivative (divergence) added to the general tracer trends  ==!
             pt_rhs(ji,jj,jk,jn) = pt_rhs(ji,jj,jk,jn) + (  ztu(ji,jj,jk) - ztu(ji-1,jj,jk)     &
                &                                      +    ztv(ji,jj,jk) - ztv(ji,jj-1,jk) )   &
@@ -142,5 +176,5 @@
       !                             ! ==================
       !
-   END SUBROUTINE tra_ldf_lap
+   END SUBROUTINE tra_ldf_lap_t
    
 
@@ -173,17 +207,19 @@
       !
       INTEGER ::   ji, jj, jk, jn   ! dummy loop indices
-      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt) :: zlap         ! laplacian at t-point
-      REAL(wp), DIMENSION(jpi,jpj,    kjpt) :: zglu, zglv   ! bottom GRADh of the laplacian (u- and v-points)
-      REAL(wp), DIMENSION(jpi,jpj,    kjpt) :: zgui, zgvi   ! top    GRADh of the laplacian (u- and v-points)
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk,kjpt) :: zlap         ! laplacian at t-point
+      REAL(wp), DIMENSION(A2D(nn_hls),    kjpt) :: zglu, zglv   ! bottom GRADh of the laplacian (u- and v-points)
+      REAL(wp), DIMENSION(A2D(nn_hls),    kjpt) :: zgui, zgvi   ! top    GRADh of the laplacian (u- and v-points)
       !!---------------------------------------------------------------------
       !
-      IF( kt == kit000 .AND. lwp )  THEN
-         WRITE(numout,*)
-         SELECT CASE ( kldf )
-         CASE ( np_blp    )   ;   WRITE(numout,*) 'tra_ldf_blp : iso-level   bilaplacian operator on ', cdtype
-         CASE ( np_blp_i  )   ;   WRITE(numout,*) 'tra_ldf_blp : iso-neutral bilaplacian operator on ', cdtype, ' (Standard)'
-         CASE ( np_blp_it )   ;   WRITE(numout,*) 'tra_ldf_blp : iso-neutral bilaplacian operator on ', cdtype, ' (triad)'
-         END SELECT
-         WRITE(numout,*) '~~~~~~~~~~~'
+      IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile
+         IF( kt == kit000 .AND. lwp )  THEN
+            WRITE(numout,*)
+            SELECT CASE ( kldf )
+            CASE ( np_blp    )   ;   WRITE(numout,*) 'tra_ldf_blp : iso-level   bilaplacian operator on ', cdtype
+            CASE ( np_blp_i  )   ;   WRITE(numout,*) 'tra_ldf_blp : iso-neutral bilaplacian operator on ', cdtype, ' (Standard)'
+            CASE ( np_blp_it )   ;   WRITE(numout,*) 'tra_ldf_blp : iso-neutral bilaplacian operator on ', cdtype, ' (triad)'
+            END SELECT
+            WRITE(numout,*) '~~~~~~~~~~~'
+         ENDIF
       ENDIF
 
@@ -200,4 +236,5 @@
       END SELECT
       !
+      ! NOTE: [tiling-comms-merge] Needed for both nn_hls as tra_ldf_iso and tra_ldf_triad have not yet been adjusted to work with nn_hls = 2. In the zps case the lbc_lnk in zps_hde handles this, but in the zco case zlap always needs this lbc_lnk. I did try adjusting the bounds in tra_ldf_iso and tra_ldf_triad so this lbc_lnk was only needed for nn_hls = 1, but this was not correct and I did not have time to figure out why
       CALL lbc_lnk( 'traldf_lap_blp', zlap(:,:,:,:) , 'T', 1.0_wp )     ! Lateral boundary conditions (unchanged sign)
       !                                               ! Partial top/bottom cell: GRADh( zlap )  
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traldf_triad.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traldf_triad.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traldf_triad.F90	(revision 14012)
@@ -13,4 +13,7 @@
    USE oce            ! ocean dynamics and active tracers
    USE dom_oce        ! ocean space and time domain
+   ! TEMP: [tiling] This change not necessary if XIOS has subdomain support
+   USE domain, ONLY : dom_tile
+   USE domutl, ONLY : is_tile
    USE phycst         ! physical constants
    USE trc_oce        ! share passive tracers/Ocean variables
@@ -33,6 +36,4 @@
    PUBLIC   tra_ldf_triad   ! routine called by traldf.F90
 
-   REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, SAVE ::   zdkt3d   !: vertical tracer gradient at 2 levels
-
    LOGICAL  ::   l_ptr   ! flag to compute poleward transport
    LOGICAL  ::   l_hst   ! flag to compute heat transport
@@ -49,7 +50,30 @@
 CONTAINS
 
-  SUBROUTINE tra_ldf_triad( kt, Kmm, kit000, cdtype, pahu, pahv,               &
-      &                                              pgu , pgv  , pgui, pgvi , &
-      &                                         pt , pt2, pt_rhs, kjpt, kpass )
+   SUBROUTINE tra_ldf_triad( kt, Kmm, kit000, cdtype, pahu, pahv,             &
+      &                                               pgu , pgv , pgui, pgvi, &
+      &                                               pt, pt2, pt_rhs, kjpt, kpass )
+      !!
+      INTEGER                     , INTENT(in   ) ::   kt         ! ocean time-step index
+      INTEGER                     , INTENT(in   ) ::   kit000     ! first time step index
+      CHARACTER(len=3)            , INTENT(in   ) ::   cdtype     ! =TRA or TRC (tracer indicator)
+      INTEGER                     , INTENT(in   ) ::   kjpt       ! number of tracers
+      INTEGER                     , INTENT(in   ) ::   kpass      ! =1/2 first or second passage
+      INTEGER                     , INTENT(in   ) ::   Kmm        ! ocean time level indices
+      REAL(wp), DIMENSION(:,:,:)  , INTENT(in   ) ::   pahu, pahv ! eddy diffusivity at u- and v-points  [m2/s]
+      REAL(wp), DIMENSION(:,:,:)  , INTENT(in   ) ::   pgu , pgv  ! tracer gradient at pstep levels
+      REAL(wp), DIMENSION(:,:,:)  , INTENT(in   ) ::   pgui, pgvi ! tracer gradient at top   levels
+      REAL(wp), DIMENSION(:,:,:,:), INTENT(in   ) ::   pt         ! tracer (kpass=1) or laplacian of tracer (kpass=2)
+      REAL(wp), DIMENSION(:,:,:,:), INTENT(in   ) ::   pt2        ! tracer (only used in kpass=2)
+      REAL(wp), DIMENSION(:,:,:,:), INTENT(inout) ::   pt_rhs     ! tracer trend
+      !!
+      CALL tra_ldf_triad_t( kt, Kmm, kit000, cdtype, pahu, pahv, is_tile(pahu),                            &
+      &                                              pgu , pgv , is_tile(pgu) , pgui, pgvi, is_tile(pgui), &
+      &                                              pt, is_tile(pt), pt2, is_tile(pt2), pt_rhs, is_tile(pt_rhs), kjpt, kpass )
+   END SUBROUTINE tra_ldf_triad
+
+
+  SUBROUTINE tra_ldf_triad_t( kt, Kmm, kit000, cdtype, pahu, pahv, ktah,                   &
+      &                                                pgu , pgv , ktg , pgui, pgvi, ktgi, &
+      &                                                pt, ktt, pt2, ktt2, pt_rhs, ktt_rhs, kjpt, kpass )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE tra_ldf_triad  ***
@@ -77,10 +101,11 @@
       INTEGER                              , INTENT(in   ) ::   kpass      ! =1/2 first or second passage
       INTEGER                              , INTENT(in)    ::   Kmm        ! ocean time level indices
-      REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(in   ) ::   pahu, pahv ! eddy diffusivity at u- and v-points  [m2/s]
-      REAL(wp), DIMENSION(jpi,jpj    ,kjpt), INTENT(in   ) ::   pgu , pgv  ! tracer gradient at pstep levels
-      REAL(wp), DIMENSION(jpi,jpj,    kjpt), INTENT(in   ) ::   pgui, pgvi ! tracer gradient at top   levels
-      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   pt         ! tracer (kpass=1) or laplacian of tracer (kpass=2)
-      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   pt2        ! tracer (only used in kpass=2)
-      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pt_rhs     ! tracer trend
+      INTEGER                              , INTENT(in   ) ::   ktah, ktg, ktgi, ktt, ktt2, ktt_rhs
+      REAL(wp), DIMENSION(A2D_T(ktah),   JPK)     , INTENT(in   ) ::   pahu, pahv ! eddy diffusivity at u- and v-points  [m2/s]
+      REAL(wp), DIMENSION(A2D_T(ktg),        KJPT), INTENT(in   ) ::   pgu , pgv  ! tracer gradient at pstep levels
+      REAL(wp), DIMENSION(A2D_T(ktgi),       KJPT), INTENT(in   ) ::   pgui, pgvi ! tracer gradient at top   levels
+      REAL(wp), DIMENSION(A2D_T(ktt),    JPK,KJPT), INTENT(in   ) ::   pt         ! tracer (kpass=1) or laplacian of tracer (kpass=2)
+      REAL(wp), DIMENSION(A2D_T(ktt2),   JPK,KJPT), INTENT(in   ) ::   pt2        ! tracer (only used in kpass=2)
+      REAL(wp), DIMENSION(A2D_T(ktt_rhs),JPK,KJPT), INTENT(inout) ::   pt_rhs     ! tracer trend
       !
       INTEGER  ::  ji, jj, jk, jn   ! dummy loop indices
@@ -94,26 +119,25 @@
       REAL(wp) ::   ze1ur, ze2vr, ze3wr, zdxt, zdyt, zdzt
       REAL(wp) ::   zah, zah_slp, zaei_slp
-      REAL(wp), DIMENSION(jpi,jpj    ) ::   z2d                                              ! 2D workspace
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zdit, zdjt, zftu, zftv, ztfw, zpsi_uw, zpsi_vw   ! 3D     -
+      REAL(wp), DIMENSION(A2D(nn_hls),0:1)     ::   zdkt3d                         ! vertical tracer gradient at 2 levels
+      REAL(wp), DIMENSION(A2D(nn_hls)        ) ::   z2d                            ! 2D workspace
+      REAL(wp), DIMENSION(A2D(nn_hls)    ,jpk) ::   zdit, zdjt, zftu, zftv, ztfw   ! 3D     -
+      ! TEMP: [tiling] This can be A2D(nn_hls) if XIOS has subdomain support
+      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zpsi_uw, zpsi_vw
       !!----------------------------------------------------------------------
       !
-      IF( .NOT.ALLOCATED(zdkt3d) )  THEN
-         ALLOCATE( zdkt3d(jpi,jpj,0:1) , STAT=ierr )
-         CALL mpp_sum ( 'traldf_triad', ierr )
-         IF( ierr > 0 )   CALL ctl_stop('STOP', 'tra_ldf_triad: unable to allocate arrays')
-      ENDIF
-     !
-      IF( kpass == 1 .AND. kt == kit000 )  THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'tra_ldf_triad : rotated laplacian diffusion operator on ', cdtype
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~'
-      ENDIF
-      !   
-      l_hst = .FALSE.
-      l_ptr = .FALSE.
-      IF( cdtype == 'TRA' ) THEN
-         IF( iom_use( 'sophtldf' ) .OR. iom_use( 'sopstldf') )      l_ptr = .TRUE. 
-         IF( iom_use("uadv_heattr") .OR. iom_use("vadv_heattr") .OR.                   &
-         &   iom_use("uadv_salttr") .OR. iom_use("vadv_salttr")  )   l_hst = .TRUE.
+      IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile
+         IF( kpass == 1 .AND. kt == kit000 )  THEN
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) 'tra_ldf_triad : rotated laplacian diffusion operator on ', cdtype
+            IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~'
+         ENDIF
+         !
+         l_hst = .FALSE.
+         l_ptr = .FALSE.
+         IF( cdtype == 'TRA' ) THEN
+            IF( iom_use( 'sophtldf' ) .OR. iom_use( 'sopstldf') )      l_ptr = .TRUE.
+            IF( iom_use("uadv_heattr") .OR. iom_use("vadv_heattr") .OR.                   &
+            &   iom_use("uadv_salttr") .OR. iom_use("vadv_salttr")  )   l_hst = .TRUE.
+         ENDIF
       ENDIF
       !
@@ -128,27 +152,23 @@
       IF( kpass == 1 ) THEN         !==  first pass only  and whatever the tracer is  ==!
          !
-         akz     (:,:,:) = 0._wp      
-         ah_wslp2(:,:,:) = 0._wp
-         IF( ln_ldfeiv_dia ) THEN
-            zpsi_uw(:,:,:) = 0._wp
-            zpsi_vw(:,:,:) = 0._wp
-         ENDIF
+         DO_3D( 0, 0, 0, 0, 1, jpk )
+            akz     (ji,jj,jk) = 0._wp
+            ah_wslp2(ji,jj,jk) = 0._wp
+         END_3D
          !
          DO ip = 0, 1                            ! i-k triads
             DO kp = 0, 1
-               DO_3D( 1, 0, 1, 0, 1, jpkm1 )
-                  ze3wr = 1._wp / e3w(ji+ip,jj,jk+kp,Kmm)
-                  zbu   = e1e2u(ji,jj) * e3u(ji,jj,jk,Kmm)
-                  zah   = 0.25_wp * pahu(ji,jj,jk)
-                  zslope_skew = triadi_g(ji+ip,jj,jk,1-ip,kp)
+               DO_3D( 0, 0, 0, 0, 1, jpkm1 )
+                  ze3wr = 1._wp / e3w(ji,jj,jk+kp,Kmm)
+                  zbu   = e1e2u(ji-ip,jj) * e3u(ji-ip,jj,jk,Kmm)
+                  zah   = 0.25_wp * pahu(ji-ip,jj,jk)
+                  zslope_skew = triadi_g(ji,jj,jk,1-ip,kp)
                   ! Subtract s-coordinate slope at t-points to give slope rel to s-surfaces (do this by *adding* gradient of depth)
-                  zslope2 = zslope_skew + ( gdept(ji+1,jj,jk,Kmm) - gdept(ji,jj,jk,Kmm) ) * r1_e1u(ji,jj) * umask(ji,jj,jk+kp)
+                  zslope2 = zslope_skew + ( gdept(ji-ip+1,jj,jk,Kmm) - gdept(ji-ip,jj,jk,Kmm) ) * r1_e1u(ji-ip,jj) * umask(ji-ip,jj,jk+kp)
                   zslope2 = zslope2 *zslope2
-                  ah_wslp2(ji+ip,jj,jk+kp) = ah_wslp2(ji+ip,jj,jk+kp) + zah * zbu * ze3wr * r1_e1e2t(ji+ip,jj) * zslope2
-                  akz     (ji+ip,jj,jk+kp) = akz     (ji+ip,jj,jk+kp) + zah * r1_e1u(ji,jj)       &
-                     &                                                      * r1_e1u(ji,jj) * umask(ji,jj,jk+kp)
+                  ah_wslp2(ji,jj,jk+kp) = ah_wslp2(ji,jj,jk+kp) + zah * zbu * ze3wr * r1_e1e2t(ji,jj) * zslope2
+                  akz     (ji,jj,jk+kp) = akz     (ji,jj,jk+kp) + zah * r1_e1u(ji-ip,jj)       &
+                     &                                                      * r1_e1u(ji-ip,jj) * umask(ji-ip,jj,jk+kp)
                      !
-                 IF( ln_ldfeiv_dia )   zpsi_uw(ji,jj,jk+kp) = zpsi_uw(ji,jj,jk+kp)   &
-                     &                                       + 0.25_wp * aeiu(ji,jj,jk) * e2u(ji,jj) * zslope_skew
                END_3D
             END DO
@@ -157,19 +177,17 @@
          DO jp = 0, 1                            ! j-k triads 
             DO kp = 0, 1
-               DO_3D( 1, 0, 1, 0, 1, jpkm1 )
-                  ze3wr = 1.0_wp / e3w(ji,jj+jp,jk+kp,Kmm)
-                  zbv   = e1e2v(ji,jj) * e3v(ji,jj,jk,Kmm)
-                  zah   = 0.25_wp * pahv(ji,jj,jk)
-                  zslope_skew = triadj_g(ji,jj+jp,jk,1-jp,kp)
+               DO_3D( 0, 0, 0, 0, 1, jpkm1 )
+                  ze3wr = 1.0_wp / e3w(ji,jj,jk+kp,Kmm)
+                  zbv   = e1e2v(ji,jj-jp) * e3v(ji,jj-jp,jk,Kmm)
+                  zah   = 0.25_wp * pahv(ji,jj-jp,jk)
+                  zslope_skew = triadj_g(ji,jj,jk,1-jp,kp)
                   ! Subtract s-coordinate slope at t-points to give slope rel to s surfaces
                   !    (do this by *adding* gradient of depth)
-                  zslope2 = zslope_skew + ( gdept(ji,jj+1,jk,Kmm) - gdept(ji,jj,jk,Kmm) ) * r1_e2v(ji,jj) * vmask(ji,jj,jk+kp)
+                  zslope2 = zslope_skew + ( gdept(ji,jj-jp+1,jk,Kmm) - gdept(ji,jj-jp,jk,Kmm) ) * r1_e2v(ji,jj-jp) * vmask(ji,jj-jp,jk+kp)
                   zslope2 = zslope2 * zslope2
-                  ah_wslp2(ji,jj+jp,jk+kp) = ah_wslp2(ji,jj+jp,jk+kp) + zah * zbv * ze3wr * r1_e1e2t(ji,jj+jp) * zslope2
-                  akz     (ji,jj+jp,jk+kp) = akz     (ji,jj+jp,jk+kp) + zah * r1_e2v(ji,jj)     &
-                     &                                                      * r1_e2v(ji,jj) * vmask(ji,jj,jk+kp)
+                  ah_wslp2(ji,jj,jk+kp) = ah_wslp2(ji,jj,jk+kp) + zah * zbv * ze3wr * r1_e1e2t(ji,jj) * zslope2
+                  akz     (ji,jj,jk+kp) = akz     (ji,jj,jk+kp) + zah * r1_e2v(ji,jj-jp)     &
+                     &                                                      * r1_e2v(ji,jj-jp) * vmask(ji,jj-jp,jk+kp)
                   !
-                  IF( ln_ldfeiv_dia )   zpsi_vw(ji,jj,jk+kp) = zpsi_vw(ji,jj,jk+kp)   &
-                     &                                       + 0.25 * aeiv(ji,jj,jk) * e1v(ji,jj) * zslope_skew
                END_3D
             END DO
@@ -179,5 +197,5 @@
             !
             IF( ln_traldf_blp ) THEN                ! bilaplacian operator
-               DO_3D( 1, 0, 1, 0, 2, jpkm1 )
+               DO_3D( 0, 0, 0, 0, 2, jpkm1 )
                   akz(ji,jj,jk) = 16._wp           &
                      &   * ah_wslp2   (ji,jj,jk)   &
@@ -187,5 +205,5 @@
                END_3D
             ELSEIF( ln_traldf_lap ) THEN              ! laplacian operator
-               DO_3D( 1, 0, 1, 0, 2, jpkm1 )
+               DO_3D( 0, 0, 0, 0, 2, jpkm1 )
                   ze3w_2 = e3w(ji,jj,jk,Kmm) * e3w(ji,jj,jk,Kmm)
                   zcoef0 = rDt * (  akz(ji,jj,jk) + ah_wslp2(ji,jj,jk) / ze3w_2  )
@@ -195,8 +213,32 @@
            !
          ELSE                                    ! 33 flux set to zero with akz=ah_wslp2 ==>> computed in full implicit
-            akz(:,:,:) = ah_wslp2(:,:,:)      
-         ENDIF
-         !
-         IF( ln_ldfeiv_dia .AND. cdtype == 'TRA' )   CALL ldf_eiv_dia( zpsi_uw, zpsi_vw, Kmm )
+            DO_3D( 0, 0, 0, 0, 1, jpk )
+               akz(ji,jj,jk) = ah_wslp2(ji,jj,jk)
+            END_3D
+         ENDIF
+         !
+         ! TEMP: [tiling] These changes not necessary if XIOS has subdomain support
+         IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only for the full domain
+            IF( ln_ldfeiv_dia .AND. cdtype == 'TRA' ) THEN
+               IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 )
+
+               zpsi_uw(:,:,:) = 0._wp
+               zpsi_vw(:,:,:) = 0._wp
+
+               DO jp = 0, 1
+                  DO kp = 0, 1
+                     DO_3D( 1, 0, 1, 0, 1, jpkm1 )
+                        zpsi_uw(ji,jj,jk+kp) = zpsi_uw(ji,jj,jk+kp) &
+                           & + 0.25_wp * aeiu(ji,jj,jk) * e2u(ji,jj) * triadi_g(ji+jp,jj,jk,1-jp,kp)
+                        zpsi_vw(ji,jj,jk+kp) = zpsi_vw(ji,jj,jk+kp) &
+                           & + 0.25_wp * aeiv(ji,jj,jk) * e1v(ji,jj) * triadj_g(ji,jj+jp,jk,1-jp,kp)
+                     END_3D
+                  END DO
+               END DO
+               CALL ldf_eiv_dia( zpsi_uw, zpsi_vw, Kmm )
+
+               IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = nijtile )
+            ENDIF
+         ENDIF
          !
       ENDIF                                  !==  end 1st pass only  ==!
@@ -234,9 +276,14 @@
          DO jk = 1, jpkm1
             !                    !==  Vertical tracer gradient at level jk and jk+1
-            zdkt3d(:,:,1) = ( pt(:,:,jk,jn) - pt(:,:,jk+1,jn) ) * tmask(:,:,jk+1)
+            DO_2D( 1, 1, 1, 1 )
+               zdkt3d(ji,jj,1) = ( pt(ji,jj,jk,jn) - pt(ji,jj,jk+1,jn) ) * tmask(ji,jj,jk+1)
+            END_2D
             !
             !                    ! surface boundary condition: zdkt3d(jk=0)=zdkt3d(jk=1)
             IF( jk == 1 ) THEN   ;   zdkt3d(:,:,0) = zdkt3d(:,:,1)
-            ELSE                 ;   zdkt3d(:,:,0) = ( pt(:,:,jk-1,jn) - pt(:,:,jk,jn) ) * tmask(:,:,jk)
+            ELSE
+               DO_2D( 1, 1, 1, 1 )
+                  zdkt3d(ji,jj,0) = ( pt(ji,jj,jk-1,jn) - pt(ji,jj,jk,jn) ) * tmask(ji,jj,jk)
+               END_2D
             ENDIF
             !
@@ -380,5 +427,5 @@
       END DO                                                      ! end tracer loop
       !                                                           ! ===============
-   END SUBROUTINE tra_ldf_triad
+   END SUBROUTINE tra_ldf_triad_t
 
    !!==============================================================================
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/tramle.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/tramle.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/tramle.F90	(revision 14012)
@@ -79,11 +79,11 @@
       !!             Fox-Kemper and Ferrari, JPO, 38, 1166-1179, 2008
       !!----------------------------------------------------------------------
-      INTEGER                         , INTENT(in   ) ::   kt         ! ocean time-step index
-      INTEGER                         , INTENT(in   ) ::   kit000     ! first time step index
-      INTEGER                         , INTENT(in   ) ::   Kmm        ! ocean time level index
-      CHARACTER(len=3)                , INTENT(in   ) ::   cdtype     ! =TRA or TRC (tracer indicator)
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   pu         ! in : 3 ocean transport components
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   pv         ! out: same 3  transport components
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   pw         !   increased by the MLE induced transport
+      INTEGER                     , INTENT(in   ) ::   kt         ! ocean time-step index
+      INTEGER                     , INTENT(in   ) ::   kit000     ! first time step index
+      INTEGER                     , INTENT(in   ) ::   Kmm        ! ocean time level index
+      CHARACTER(len=3)            , INTENT(in   ) ::   cdtype     ! =TRA or TRC (tracer indicator)
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk), INTENT(inout) ::   pu         ! in : 3 ocean transport components
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk), INTENT(inout) ::   pv         ! out: same 3  transport components
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk), INTENT(inout) ::   pw         !   increased by the MLE induced transport
       !
       INTEGER  ::   ji, jj, jk          ! dummy loop indices
@@ -91,12 +91,17 @@
       REAL(wp) ::   zcuw, zmuw, zc      ! local scalar
       REAL(wp) ::   zcvw, zmvw          !   -      -
-      INTEGER , DIMENSION(jpi,jpj)     :: inml_mle
-      REAL(wp), DIMENSION(jpi,jpj)     :: zpsim_u, zpsim_v, zmld, zbm, zhu, zhv, zn2, zLf_NH, zLf_MH
-      REAL(wp), DIMENSION(jpi,jpj,jpk) :: zpsi_uw, zpsi_vw
+      INTEGER , DIMENSION(A2D(nn_hls))     :: inml_mle
+      REAL(wp), DIMENSION(A2D(nn_hls))     :: zpsim_u, zpsim_v, zmld, zbm, zhu, zhv, zn2, zLf_MH
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk) :: zpsi_uw, zpsi_vw
+      ! TEMP: [tiling] These changes not necessary if using XIOS (subdomain support)
+      REAL(wp), DIMENSION(:,:),   ALLOCATABLE, SAVE :: zLf_NH
+      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, SAVE :: zpsiu_mle, zpsiv_mle
       !!----------------------------------------------------------------------
       !
       !                                      !==  MLD used for MLE  ==!
       !                                                ! compute from the 10m density to deal with the diurnal cycle
-      inml_mle(:,:) = mbkt(:,:) + 1                    ! init. to number of ocean w-level (T-level + 1)
+      DO_2D( 1, 1, 1, 1 )
+         inml_mle(ji,jj) = mbkt(ji,jj) + 1                    ! init. to number of ocean w-level (T-level + 1)
+      END_2D
       IF ( nla10 > 0 ) THEN                            ! avoid case where first level is thicker than 10m
          DO_3DS( 1, 1, 1, 1, jpkm1, nlb10, -1 )        ! from the bottom to nlb10 (10m)
@@ -135,5 +140,7 @@
       END SELECT
       !                                                ! convert density into buoyancy
-      zbm(:,:) = + grav * zbm(:,:) / MAX( e3t(:,:,1,Kmm), zmld(:,:) )
+      DO_2D( 1, 1, 1, 1 )
+         zbm(ji,jj) = + grav * zbm(ji,jj) / MAX( e3t(ji,jj,1,Kmm), zmld(ji,jj) )
+      END_2D
       !
       !
@@ -206,16 +213,27 @@
       END DO
 
+      ! TEMP: [tiling] These changes not necessary if using XIOS (subdomain support)
       IF( cdtype == 'TRA') THEN              !==  outputs  ==!
-         !
-         zLf_NH(:,:) = SQRT( rb_c * zmld(:,:) ) * r1_ft(:,:)      ! Lf = N H / f
-         CALL iom_put( "Lf_NHpf" , zLf_NH  )    ! Lf = N H / f
+         IF( ntile == 0 .OR. ntile == 1 ) THEN                             ! Do only on the first tile
+            ALLOCATE( zLf_NH(jpi,jpj), zpsiu_mle(jpi,jpj,jpk), zpsiv_mle(jpi,jpj,jpk) )
+            zpsiu_mle(:,:,:) = 0._wp ; zpsiv_mle(:,:,:) = 0._wp
+         ENDIF
+         !
+         DO_2D( 0, 0, 0, 0 )
+            zLf_NH(ji,jj) = SQRT( rb_c * zmld(ji,jj) ) * r1_ft(ji,jj)      ! Lf = N H / f
+         END_2D
          !
          ! divide by cross distance to give streamfunction with dimensions m^2/s
-         DO jk = 1, ikmax+1
-            zpsi_uw(:,:,jk) = zpsi_uw(:,:,jk) * r1_e2u(:,:)
-            zpsi_vw(:,:,jk) = zpsi_vw(:,:,jk) * r1_e1v(:,:)
-         END DO
-         CALL iom_put( "psiu_mle", zpsi_uw )    ! i-mle streamfunction
-         CALL iom_put( "psiv_mle", zpsi_vw )    ! j-mle streamfunction
+         DO_3D( 0, 0, 0, 0, 1, ikmax+1 )
+            zpsiu_mle(ji,jj,jk) = zpsi_uw(ji,jj,jk) * r1_e2u(ji,jj)
+            zpsiv_mle(ji,jj,jk) = zpsi_vw(ji,jj,jk) * r1_e1v(ji,jj)
+         END_3D
+
+         IF( ntile == 0 .OR. ntile == nijtile ) THEN                       ! Do only on the last tile
+            CALL iom_put( "Lf_NHpf" , zLf_NH  )    ! Lf = N H / f
+            CALL iom_put( "psiu_mle", zpsiu_mle )    ! i-mle streamfunction
+            CALL iom_put( "psiv_mle", zpsiv_mle )    ! j-mle streamfunction
+            DEALLOCATE( zLf_NH, zpsiu_mle, zpsiv_mle )
+         ENDIF
       ENDIF
       !
@@ -283,5 +301,5 @@
             IF( ierr /= 0 )   CALL ctl_stop( 'tra_adv_mle_init: failed to allocate arrays' )
             z1_t2 = 1._wp / ( rn_time * rn_time )
-            DO_2D( 0, 1, 0, 1 )                      ! "coriolis+ time^-1" at u- & v-points
+            DO_2D( nn_hls-1, nn_hls, nn_hls-1, nn_hls )                      ! "coriolis+ time^-1" at u- & v-points
                zfu = ( ff_f(ji,jj) + ff_f(ji,jj-1) ) * 0.5_wp
                zfv = ( ff_f(ji,jj) + ff_f(ji-1,jj) ) * 0.5_wp
@@ -289,5 +307,5 @@
                rfv(ji,jj) = SQRT(  zfv * zfv + z1_t2 )
             END_2D
-            CALL lbc_lnk_multi( 'tramle', rfu, 'U', 1.0_wp , rfv, 'V', 1.0_wp )
+            IF (nn_hls.EQ.1) CALL lbc_lnk_multi( 'tramle', rfu, 'U', 1.0_wp , rfv, 'V', 1.0_wp )
             !
          ELSEIF( nn_mle == 1 ) THEN           ! MLE array allocation & initialisation
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/tranpc.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/tranpc.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/tranpc.F90	(revision 14012)
@@ -17,4 +17,6 @@
    USE oce            ! ocean dynamics and active tracers
    USE dom_oce        ! ocean space and time domain
+   ! TEMP: [tiling] This change not necessary after extra haloes development (lbc_lnk removed)
+   USE domain, ONLY : dom_tile
    USE phycst         ! physical constants
    USE zdf_oce        ! ocean vertical physics
@@ -32,4 +34,6 @@
 
    PUBLIC   tra_npc    ! routine called by step.F90
+
+   INTEGER  ::   nnpcc        ! number of statically instable water column
 
    !! * Substitutions
@@ -64,5 +68,4 @@
       !
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
-      INTEGER  ::   inpcc        ! number of statically instable water column
       INTEGER  ::   jiter, ikbot, ikp, ikup, ikdown, ilayer, ik_low   ! local integers
       LOGICAL  ::   l_bottom_reached, l_column_treated
@@ -70,12 +73,13 @@
       REAL(wp) ::   zsa, zbeta, zsum_sali, zsum_beta, zbw, zrw, z1_rDt
       REAL(wp), PARAMETER ::   zn2_zero = 1.e-14_wp             ! acceptance criteria for neutrality (N2==0)
-      REAL(wp), DIMENSION(        jpk     )   ::   zvn2         ! vertical profile of N2 at 1 given point...
-      REAL(wp), DIMENSION(        jpk,jpts)   ::   zvts, zvab   ! vertical profile of T & S , and  alpha & betaat 1 given point
-      REAL(wp), DIMENSION(jpi,jpj,jpk     )   ::   zn2          ! N^2 
-      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts)   ::   zab          ! alpha and beta
+      REAL(wp), DIMENSION(    jpk     )   ::   zvn2             ! vertical profile of N2 at 1 given point...
+      REAL(wp), DIMENSION(    jpk,jpts)   ::   zvts, zvab       ! vertical profile of T & S , and  alpha & betaat 1 given point
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk     )   ::   zn2              ! N^2
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk,jpts)   ::   zab              ! alpha and beta
       REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   ztrdt, ztrds ! 3D workspace
       !
       LOGICAL, PARAMETER :: l_LB_debug = .FALSE. ! set to true if you want to follow what is
       INTEGER :: ilc1, jlc1, klc1, nncpu         ! actually happening in a water column at point "ilc1, jlc1"
+      INTEGER :: isi, isj, iei, iej
       LOGICAL :: lp_monitor_point = .FALSE.      ! in CPU domain "nncpu"
       !!----------------------------------------------------------------------
@@ -87,5 +91,5 @@
          IF( l_trdtra )   THEN                    !* Save initial after fields
             ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) )
-            ztrdt(:,:,:) = pts(:,:,:,jp_tem,Kaa) 
+            ztrdt(:,:,:) = pts(:,:,:,jp_tem,Kaa)
             ztrds(:,:,:) = pts(:,:,:,jp_sal,Kaa)
          ENDIF
@@ -101,7 +105,13 @@
          CALL bn2    ( pts(:,:,:,:,Kaa), zab, zn2, Kmm )    ! after Brunt-Vaisala  (given on W-points)
          !
-         inpcc = 0
-         !
-         DO_2D( 0, 0, 0, 0 )                                ! interior column only
+         IF( ntile == 0 .OR. ntile == 1 ) nnpcc = 0         ! Do only on the first tile
+         !
+         IF( ntsi == Nis0 ) THEN ; isi = nn_hls ; ELSE ; isi = 0 ; ENDIF    ! Avoid double-counting when using tiling
+         IF( ntsj == Njs0 ) THEN ; isj = nn_hls ; ELSE ; isj = 0 ; ENDIF
+         IF( ntei == Nie0 ) THEN ; iei = nn_hls ; ELSE ; iei = 0 ; ENDIF
+         IF( ntej == Nje0 ) THEN ; iej = nn_hls ; ELSE ; iej = 0 ; ENDIF
+         !
+         ! NOTE: [tiling-comms-merge] Bounds changed to avoid repeating this calculation for overlapping rows when using tiling
+         DO_2D( isj, iej, isi, iei )                        ! interior column only
             !
             IF( tmask(ji,jj,2) == 1 ) THEN      ! At least 2 ocean points
@@ -160,5 +170,5 @@
                         ENDIF
                         !
-                        IF( jiter == 1 )   inpcc = inpcc + 1 
+                        IF( jiter == 1 )   nnpcc = nnpcc + 1
                         !
                         IF( lp_monitor_point )   WRITE(numout, *) 'Negative N2 at ikp =',ikp,' for layer #', ilayer
@@ -310,9 +320,9 @@
          ENDIF
          !
-         CALL lbc_lnk_multi( 'tranpc', pts(:,:,:,jp_tem,Kaa), 'T', 1.0_wp, pts(:,:,:,jp_sal,Kaa), 'T', 1.0_wp )
-         !
-         IF( lwp .AND. l_LB_debug ) THEN
-            WRITE(numout,*) 'Exiting tra_npc , kt = ',kt,', => numb. of statically instable water-columns: ', inpcc
-            WRITE(numout,*)
+         IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only for the full domain
+            IF( lwp .AND. l_LB_debug ) THEN
+               WRITE(numout,*) 'Exiting tra_npc , kt = ',kt,', => numb. of statically instable water-columns: ', nnpcc
+               WRITE(numout,*)
+            ENDIF
          ENDIF
          !
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traqsr.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traqsr.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/traqsr.F90	(revision 14012)
@@ -22,4 +22,5 @@
    USE phycst         ! physical constants
    USE dom_oce        ! ocean space and time domain
+   USE domain, ONLY : dom_tile
    USE sbc_oce        ! surface boundary condition: ocean
    USE trc_oce        ! share SMS/Ocean variables
@@ -107,5 +108,5 @@
       !
       INTEGER  ::   ji, jj, jk               ! dummy loop indices
-      INTEGER  ::   irgb                     ! local integers
+      INTEGER  ::   irgb, isi, iei, isj, iej ! local integers
       REAL(wp) ::   zchl, zcoef, z1_2        ! local scalars
       REAL(wp) ::   zc0 , zc1 , zc2 , zc3    !    -         -
@@ -120,12 +121,14 @@
       IF( ln_timing )   CALL timing_start('tra_qsr')
       !
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'tra_qsr : penetration of the surface solar radiation'
-         IF(lwp) WRITE(numout,*) '~~~~~~~'
+      IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile
+         IF( kt == nit000 ) THEN
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) 'tra_qsr : penetration of the surface solar radiation'
+            IF(lwp) WRITE(numout,*) '~~~~~~~'
+         ENDIF
       ENDIF
       !
       IF( l_trdtra ) THEN      ! trends diagnostic: save the input temperature trend
-         ALLOCATE( ztrdt(jpi,jpj,jpk) ) 
+         ALLOCATE( ztrdt(jpi,jpj,jpk) )
          ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs)
       ENDIF
@@ -134,16 +137,28 @@
       !                         !  before qsr induced heat content  !
       !                         !-----------------------------------!
+      ! NOTE: [tiling-comms-merge] Many DO loop bounds changed (probably more than necessary) to avoid changing results when using tiling. Some bounds were also adjusted to account for those changed in tra_atf
+      IF( ntsi == Nis0 ) THEN ; isi = nn_hls ; ELSE ; isi = 0 ; ENDIF    ! Avoid double-counting when using tiling
+      IF( ntsj == Njs0 ) THEN ; isj = nn_hls ; ELSE ; isj = 0 ; ENDIF
+      IF( ntei == Nie0 ) THEN ; iei = nn_hls ; ELSE ; iei = 0 ; ENDIF
+      IF( ntej == Nje0 ) THEN ; iej = nn_hls ; ELSE ; iej = 0 ; ENDIF
+
       IF( kt == nit000 ) THEN          !==  1st time step  ==!
          IF( ln_rstart .AND. iom_varid( numror, 'qsr_hc_b', ldstop = .FALSE. ) > 0  .AND. .NOT.l_1st_euler ) THEN    ! read in restart
-            IF(lwp) WRITE(numout,*) '          nit000-1 qsr tracer content forcing field read in the restart file'
             z1_2 = 0.5_wp
-            CALL iom_get( numror, jpdom_auto, 'qsr_hc_b', qsr_hc_b, ldxios = lrxios )   ! before heat content trend due to Qsr flux
+            IF( ntile == 0 .OR. ntile == 1 )  THEN                        ! Do only on the first tile
+               IF(lwp) WRITE(numout,*) '          nit000-1 qsr tracer content forcing field read in the restart file'
+               CALL iom_get( numror, jpdom_auto, 'qsr_hc_b', qsr_hc_b )   ! before heat content trend due to Qsr flux
+            ENDIF
          ELSE                                           ! No restart or restart not found: Euler forward time stepping
             z1_2 = 1._wp
-            qsr_hc_b(:,:,:) = 0._wp
+            DO_3D( isj, iej, isi, iei, 1, jpk )
+               qsr_hc_b(ji,jj,jk) = 0._wp
+            END_3D
          ENDIF
       ELSE                             !==  Swap of qsr heat content  ==!
          z1_2 = 0.5_wp
-         qsr_hc_b(:,:,:) = qsr_hc(:,:,:)
+         DO_3D( isj, iej, isi, iei, 1, jpk )
+            qsr_hc_b(ji,jj,jk) = qsr_hc(ji,jj,jk)
+         END_3D
       ENDIF
       !
@@ -154,16 +169,20 @@
       CASE( np_BIO )                   !==  bio-model fluxes  ==!
          !
-         DO jk = 1, nksr
-            qsr_hc(:,:,jk) = r1_rho0_rcp * ( etot3(:,:,jk) - etot3(:,:,jk+1) )
-         END DO
+         DO_3D( isj, iej, isi, iei, 1, nksr )
+            qsr_hc(ji,jj,jk) = r1_rho0_rcp * ( etot3(ji,jj,jk) - etot3(ji,jj,jk+1) )
+         END_3D
          !
       CASE( np_RGB , np_RGBc )         !==  R-G-B fluxes  ==!
          !
-         ALLOCATE( ze0 (jpi,jpj)           , ze1 (jpi,jpj) ,   &
-            &      ze2 (jpi,jpj)           , ze3 (jpi,jpj) ,   &
-            &      ztmp3d(jpi,jpj,nksr + 1)                     )
+         ALLOCATE( ze0 (A2D(nn_hls))           , ze1 (A2D(nn_hls)) ,   &
+            &      ze2 (A2D(nn_hls))           , ze3 (A2D(nn_hls)) ,   &
+            &      ztmp3d(A2D(nn_hls),nksr + 1)                     )
          !
          IF( nqsr == np_RGBc ) THEN          !*  Variable Chlorophyll
-            CALL fld_read( kt, 1, sf_chl )         ! Read Chl data and provides it at the current time step
+            IF( ntile == 0 .OR. ntile == 1 )  THEN                                         ! Do only for the full domain
+               IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 )            ! Use full domain
+               CALL fld_read( kt, 1, sf_chl )         ! Read Chl data and provides it at the current time step
+               IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 1 )            ! Revert to tile domain
+            ENDIF
             !
             ! Separation in R-G-B depending on the surface Chl
@@ -172,5 +191,5 @@
             ! most expensive calculations)
             !
-            DO_2D( 0, 0, 0, 0 )
+            DO_2D( isj, iej, isi, iei )
                        ! zlogc = log(zchl)
                zlogc = LOG ( MIN( 10. , MAX( 0.03, sf_chl(1)%fnow(ji,jj,1) ) ) )     
@@ -191,5 +210,5 @@
             
 !
-            DO_3D( 0, 0, 0, 0, 1, nksr + 1 )
+            DO_3D( isj, iej, isi, iei, 1, nksr + 1 )
                ! zchl    = ALOG( ze0(ji,jj) )
                zlogc = ze0(ji,jj)
@@ -216,10 +235,10 @@
             zlui = 41 + 20.*LOG10(zchl) + 1.e-15
             DO jk = 1, nksr + 1
-               ztmp3d(:,:,jk) = zlui 
+               ztmp3d(:,:,jk) = zlui
             END DO
          ENDIF
          !
          zcoef  = ( 1. - rn_abs ) / 3._wp    !* surface equi-partition in R-G-B
-         DO_2D( 0, 0, 0, 0 )
+         DO_2D( isj, iej, isi, iei )
             ze0(ji,jj) = rn_abs * qsr(ji,jj)
             ze1(ji,jj) = zcoef  * qsr(ji,jj)
@@ -232,5 +251,5 @@
          !
          !                                    !* interior equi-partition in R-G-B depending on vertical profile of Chl
-         DO_3D( 0, 0, 0, 0, 2, nksr + 1 )
+         DO_3D( isj, iej, isi, iei, 2, nksr + 1 )
             ze3t = e3t(ji,jj,jk-1,Kmm)
             irgb = NINT( ztmp3d(ji,jj,jk) )
@@ -246,5 +265,5 @@
          END_3D
          !
-         DO_3D( 0, 0, 0, 0, 1, nksr )          !* now qsr induced heat content
+         DO_3D( isj, iej, isi, iei, 1, nksr )          !* now qsr induced heat content
             qsr_hc(ji,jj,jk) = r1_rho0_rcp * ( ztmp3d(ji,jj,jk) - ztmp3d(ji,jj,jk+1) )
          END_3D
@@ -256,5 +275,5 @@
          zz0 =        rn_abs   * r1_rho0_rcp      ! surface equi-partition in 2-bands
          zz1 = ( 1. - rn_abs ) * r1_rho0_rcp
-         DO_3D( 0, 0, 0, 0, 1, nksr )             ! solar heat absorbed at T-point in the top 400m 
+         DO_3D( isj, iej, isi, iei, 1, nksr )          !* now qsr induced heat content
             zc0 = zz0 * EXP( -gdepw(ji,jj,jk  ,Kmm)*xsi0r ) + zz1 * EXP( -gdepw(ji,jj,jk  ,Kmm)*xsi1r )
             zc1 = zz0 * EXP( -gdepw(ji,jj,jk+1,Kmm)*xsi0r ) + zz1 * EXP( -gdepw(ji,jj,jk+1,Kmm)*xsi1r )
@@ -274,26 +293,28 @@
       !
       ! sea-ice: store the 1st ocean level attenuation coefficient
-      DO_2D( 0, 0, 0, 0 )
+      DO_2D( isj, iej, isi, iei )
          IF( qsr(ji,jj) /= 0._wp ) THEN   ;   fraqsr_1lev(ji,jj) = qsr_hc(ji,jj,1) / ( r1_rho0_rcp * qsr(ji,jj) )
          ELSE                             ;   fraqsr_1lev(ji,jj) = 1._wp
          ENDIF
       END_2D
-      CALL lbc_lnk( 'traqsr', fraqsr_1lev(:,:), 'T', 1._wp )
-      !
-      IF( iom_use('qsr3d') ) THEN      ! output the shortwave Radiation distribution
-         ALLOCATE( zetot(jpi,jpj,jpk) )
-         zetot(:,:,nksr+1:jpk) = 0._wp     ! below ~400m set to zero
-         DO jk = nksr, 1, -1
-            zetot(:,:,jk) = zetot(:,:,jk+1) + qsr_hc(:,:,jk) * rho0_rcp
-         END DO         
-         CALL iom_put( 'qsr3d', zetot )   ! 3D distribution of shortwave Radiation
-         DEALLOCATE( zetot ) 
-      ENDIF
-      !
-      IF( lrst_oce ) THEN     ! write in the ocean restart file
-         IF( lwxios ) CALL iom_swap(      cwxios_context          )
-         CALL iom_rstput( kt, nitrst, numrow, 'qsr_hc_b'   , qsr_hc     , ldxios = lwxios )
-         CALL iom_rstput( kt, nitrst, numrow, 'fraqsr_1lev', fraqsr_1lev, ldxios = lwxios ) 
-         IF( lwxios ) CALL iom_swap(      cxios_context          )
+      !
+      ! TEMP: [tiling] This change not necessary and working array can use A2D(nn_hls) if using XIOS (subdomain support)
+      IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only for the full domain
+         IF( iom_use('qsr3d') ) THEN      ! output the shortwave Radiation distribution
+            ALLOCATE( zetot(jpi,jpj,jpk) )
+            zetot(:,:,nksr+1:jpk) = 0._wp     ! below ~400m set to zero
+            DO jk = nksr, 1, -1
+               zetot(:,:,jk) = zetot(:,:,jk+1) + qsr_hc(:,:,jk) * rho0_rcp
+            END DO
+            CALL iom_put( 'qsr3d', zetot )   ! 3D distribution of shortwave Radiation
+            DEALLOCATE( zetot )
+         ENDIF
+      ENDIF
+      !
+      IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only on the last tile
+         IF( lrst_oce ) THEN     ! write in the ocean restart file
+            CALL iom_rstput( kt, nitrst, numrow, 'qsr_hc_b'   , qsr_hc      )
+            CALL iom_rstput( kt, nitrst, numrow, 'fraqsr_1lev', fraqsr_1lev )
+         ENDIF
       ENDIF
       !
@@ -301,5 +322,5 @@
          ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs) - ztrdt(:,:,:)
          CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_qsr, ztrdt )
-         DEALLOCATE( ztrdt ) 
+         DEALLOCATE( ztrdt )
       ENDIF
       !                       ! print mean trends (used for debugging)
@@ -431,14 +452,9 @@
       ! 1st ocean level attenuation coefficient (used in sbcssm)
       IF( iom_varid( numror, 'fraqsr_1lev', ldstop = .FALSE. ) > 0 ) THEN
-         CALL iom_get( numror, jpdom_auto, 'fraqsr_1lev'  , fraqsr_1lev, ldxios = lrxios  )
+         CALL iom_get( numror, jpdom_auto, 'fraqsr_1lev'  , fraqsr_1lev  )
       ELSE
          fraqsr_1lev(:,:) = 1._wp   ! default : no penetration
       ENDIF
       !
-      IF( lwxios ) THEN
-         CALL iom_set_rstw_var_active('qsr_hc_b')
-         CALL iom_set_rstw_var_active('fraqsr_1lev')
-      ENDIF
-      !
    END SUBROUTINE tra_qsr_init
 
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/trasbc.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/trasbc.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/trasbc.F90	(revision 14012)
@@ -76,7 +76,7 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts        ! active tracers and RHS of tracer equation
       !
-      INTEGER  ::   ji, jj, jk, jn              ! dummy loop indices  
-      INTEGER  ::   ikt, ikb                    ! local integers
-      REAL(wp) ::   zfact, z1_e3t, zdep, ztim   ! local scalar
+      INTEGER  ::   ji, jj, jk, jn               ! dummy loop indices
+      INTEGER  ::   ikt, ikb, isi, iei, isj, iej ! local integers
+      REAL(wp) ::   zfact, z1_e3t, zdep, ztim    ! local scalar
       REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::  ztrdt, ztrds
       !!----------------------------------------------------------------------
@@ -84,20 +84,30 @@
       IF( ln_timing )   CALL timing_start('tra_sbc')
       !
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'tra_sbc : TRAcer Surface Boundary Condition'
-         IF(lwp) WRITE(numout,*) '~~~~~~~ '
+      IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile
+         IF( kt == nit000 ) THEN
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) 'tra_sbc : TRAcer Surface Boundary Condition'
+            IF(lwp) WRITE(numout,*) '~~~~~~~ '
+         ENDIF
       ENDIF
       !
       IF( l_trdtra ) THEN                    !* Save ta and sa trends
-         ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) ) 
+         ALLOCATE( ztrdt(jpi,jpj,jpk), ztrds(jpi,jpj,jpk) )
          ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs)
          ztrds(:,:,:) = pts(:,:,:,jp_sal,Krhs)
       ENDIF
       !
+      ! NOTE: [tiling-comms-merge] Many DO loop bounds changed to avoid changing results when using tiling. Some bounds were also adjusted to account for those changed in tra_atf
+      IF( ntsi == Nis0 ) THEN ; isi = nn_hls ; ELSE ; isi = 0 ; ENDIF    ! Avoid double-counting when using tiling
+      IF( ntsj == Njs0 ) THEN ; isj = nn_hls ; ELSE ; isj = 0 ; ENDIF
+      IF( ntei == Nie0 ) THEN ; iei = nn_hls ; ELSE ; iei = 0 ; ENDIF
+      IF( ntej == Nje0 ) THEN ; iej = nn_hls ; ELSE ; iej = 0 ; ENDIF
+
 !!gm  This should be moved into sbcmod.F90 module ? (especially now that ln_traqsr is read in namsbc namelist)
       IF( .NOT.ln_traqsr ) THEN     ! no solar radiation penetration
-         qns(:,:) = qns(:,:) + qsr(:,:)      ! total heat flux in qns
-         qsr(:,:) = 0._wp                     ! qsr set to zero
+         DO_2D( isj, iej, isi, iei )
+            qns(ji,jj) = qns(ji,jj) + qsr(ji,jj)      ! total heat flux in qns
+            qsr(ji,jj) = 0._wp                        ! qsr set to zero
+         END_2D
       ENDIF
 
@@ -109,34 +119,43 @@
          IF( ln_rstart .AND.    &               ! Restart: read in restart file
               & iom_varid( numror, 'sbc_hc_b', ldstop = .FALSE. ) > 0 ) THEN
-            IF(lwp) WRITE(numout,*) '          nit000-1 sbc tracer content field read in the restart file'
             zfact = 0.5_wp
-            sbc_tsc(:,:,:) = 0._wp
-            CALL iom_get( numror, jpdom_auto, 'sbc_hc_b', sbc_tsc_b(:,:,jp_tem), ldxios = lrxios )   ! before heat content sbc trend
-            CALL iom_get( numror, jpdom_auto, 'sbc_sc_b', sbc_tsc_b(:,:,jp_sal), ldxios = lrxios )   ! before salt content sbc trend
+            IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile
+               IF(lwp) WRITE(numout,*) '          nit000-1 sbc tracer content field read in the restart file'
+               sbc_tsc(:,:,:) = 0._wp
+               CALL iom_get( numror, jpdom_auto, 'sbc_hc_b', sbc_tsc_b(:,:,jp_tem) )   ! before heat content sbc trend
+               CALL iom_get( numror, jpdom_auto, 'sbc_sc_b', sbc_tsc_b(:,:,jp_sal) )   ! before salt content sbc trend
+            ENDIF
          ELSE                                   ! No restart or restart not found: Euler forward time stepping
             zfact = 1._wp
-            sbc_tsc(:,:,:) = 0._wp
-            sbc_tsc_b(:,:,:) = 0._wp
+            DO_2D( isj, iej, isi, iei )
+               sbc_tsc(ji,jj,:) = 0._wp
+               sbc_tsc_b(ji,jj,:) = 0._wp
+            END_2D
          ENDIF
       ELSE                                !* other time-steps: swap of forcing fields
          zfact = 0.5_wp
-         sbc_tsc_b(:,:,:) = sbc_tsc(:,:,:)
+         DO_2D( isj, iej, isi, iei )
+            sbc_tsc_b(ji,jj,:) = sbc_tsc(ji,jj,:)
+         END_2D
       ENDIF
       !                             !==  Now sbc tracer content fields  ==!
-      DO_2D( 0, 1, 0, 0 )
+      DO_2D( isj, iej, isi, iei )
          sbc_tsc(ji,jj,jp_tem) = r1_rho0_rcp * qns(ji,jj)   ! non solar heat flux
          sbc_tsc(ji,jj,jp_sal) = r1_rho0     * sfx(ji,jj)   ! salt flux due to freezing/melting
       END_2D
       IF( ln_linssh ) THEN                !* linear free surface  
-         DO_2D( 0, 1, 0, 0 )                    !==>> add concentration/dilution effect due to constant volume cell
+         DO_2D( isj, iej, isi, iei )                    !==>> add concentration/dilution effect due to constant volume cell
             sbc_tsc(ji,jj,jp_tem) = sbc_tsc(ji,jj,jp_tem) + r1_rho0 * emp(ji,jj) * pts(ji,jj,1,jp_tem,Kmm)
             sbc_tsc(ji,jj,jp_sal) = sbc_tsc(ji,jj,jp_sal) + r1_rho0 * emp(ji,jj) * pts(ji,jj,1,jp_sal,Kmm)
          END_2D                                 !==>> output c./d. term
-         IF( iom_use('emp_x_sst') )   CALL iom_put( "emp_x_sst", emp (:,:) * pts(:,:,1,jp_tem,Kmm) )
-         IF( iom_use('emp_x_sss') )   CALL iom_put( "emp_x_sss", emp (:,:) * pts(:,:,1,jp_sal,Kmm) )
+         IF( ntile == 0 .OR. ntile == nijtile )  THEN             ! Do only on the last tile
+            IF( iom_use('emp_x_sst') )   CALL iom_put( "emp_x_sst", emp (:,:) * pts(:,:,1,jp_tem,Kmm) )
+            IF( iom_use('emp_x_sss') )   CALL iom_put( "emp_x_sss", emp (:,:) * pts(:,:,1,jp_sal,Kmm) )
+         ENDIF
       ENDIF
       !
       DO jn = 1, jpts               !==  update tracer trend  ==!
-         DO_2D( 0, 1, 0, 0 )
+         ! NOTE: [tiling-comms-merge] This looped over nn_hls, which changes the results when using tiling
+         DO_2D( 0, 0, 0, 0 )
             pts(ji,jj,1,jn,Krhs) = pts(ji,jj,1,jn,Krhs) + zfact * ( sbc_tsc_b(ji,jj,jn) + sbc_tsc(ji,jj,jn) )    &
                &                                                / e3t(ji,jj,1,Kmm)
@@ -144,9 +163,9 @@
       END DO
       !                  
-      IF( lrst_oce ) THEN           !==  write sbc_tsc in the ocean restart file  ==!
-         IF( lwxios ) CALL iom_swap(      cwxios_context          )
-         CALL iom_rstput( kt, nitrst, numrow, 'sbc_hc_b', sbc_tsc(:,:,jp_tem), ldxios = lwxios )
-         CALL iom_rstput( kt, nitrst, numrow, 'sbc_sc_b', sbc_tsc(:,:,jp_sal), ldxios = lwxios )
-         IF( lwxios ) CALL iom_swap(      cxios_context          )
+      IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only on the last tile
+         IF( lrst_oce ) THEN           !==  write sbc_tsc in the ocean restart file  ==!
+            CALL iom_rstput( kt, nitrst, numrow, 'sbc_hc_b', sbc_tsc(:,:,jp_tem) )
+            CALL iom_rstput( kt, nitrst, numrow, 'sbc_sc_b', sbc_tsc(:,:,jp_sal) )
+         ENDIF
       ENDIF
       !
@@ -157,5 +176,5 @@
       IF( ln_rnf ) THEN         ! input of heat and salt due to river runoff 
          zfact = 0.5_wp
-         DO_2D( 0, 1, 0, 0 )
+         DO_2D( 0, 0, 0, 0 )
             IF( rnf(ji,jj) /= 0._wp ) THEN
                zdep = zfact / h_rnf(ji,jj)
@@ -170,6 +189,8 @@
       ENDIF
 
-      IF( iom_use('rnf_x_sst') )   CALL iom_put( "rnf_x_sst", rnf*pts(:,:,1,jp_tem,Kmm) )   ! runoff term on sst
-      IF( iom_use('rnf_x_sss') )   CALL iom_put( "rnf_x_sss", rnf*pts(:,:,1,jp_sal,Kmm) )   ! runoff term on sss
+      IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only on the last tile
+         IF( iom_use('rnf_x_sst') )   CALL iom_put( "rnf_x_sst", rnf*pts(:,:,1,jp_tem,Kmm) )   ! runoff term on sst
+         IF( iom_use('rnf_x_sss') )   CALL iom_put( "rnf_x_sss", rnf*pts(:,:,1,jp_sal,Kmm) )   ! runoff term on sss
+      ENDIF
 
 #if defined key_asminc
@@ -182,5 +203,5 @@
       	 !
          IF( ln_linssh ) THEN 
-            DO_2D( 0, 1, 0, 0 )
+            DO_2D( 0, 0, 0, 0 )
                ztim = ssh_iau(ji,jj) / e3t(ji,jj,1,Kmm)
                pts(ji,jj,1,jp_tem,Krhs) = pts(ji,jj,1,jp_tem,Krhs) + pts(ji,jj,1,jp_tem,Kmm) * ztim
@@ -188,5 +209,5 @@
             END_2D
          ELSE
-            DO_2D( 0, 1, 0, 0 )
+            DO_2D( 0, 0, 0, 0 )
                ztim = ssh_iau(ji,jj) / ( ht(ji,jj) + 1. - ssmask(ji, jj) )
                pts(ji,jj,:,jp_tem,Krhs) = pts(ji,jj,:,jp_tem,Krhs) + pts(ji,jj,:,jp_tem,Kmm) * ztim
@@ -204,5 +225,5 @@
          CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_nsr, ztrdt )
          CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_sal, jptra_nsr, ztrds )
-         DEALLOCATE( ztrdt , ztrds ) 
+         DEALLOCATE( ztrdt , ztrds )
       ENDIF
       !
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/trazdf.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/trazdf.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/trazdf.F90	(revision 14012)
@@ -13,5 +13,5 @@
    !!----------------------------------------------------------------------
    USE oce            ! ocean dynamics and tracers variables
-   USE dom_oce        ! ocean space and time domain variables 
+   USE dom_oce        ! ocean space and time domain variables
    USE domvvl         ! variable volume
    USE phycst         ! physical constant
@@ -55,5 +55,5 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts                 ! active tracers and RHS of tracer equation
       !
-      INTEGER  ::   jk   ! Dummy loop indices
+      INTEGER  ::   ji, jj, jk   ! Dummy loop indices
       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   ztrdt, ztrds   ! 3D workspace
       !!---------------------------------------------------------------------
@@ -62,11 +62,13 @@
       !
       IF( kt == nit000 )  THEN
-         IF(lwp)WRITE(numout,*)
-         IF(lwp)WRITE(numout,*) 'tra_zdf : implicit vertical mixing on T & S'
-         IF(lwp)WRITE(numout,*) '~~~~~~~ '
+         IF( ntile == 0 .OR. ntile == 1 )  THEN                   ! Do only on the first tile
+            IF(lwp)WRITE(numout,*)
+            IF(lwp)WRITE(numout,*) 'tra_zdf : implicit vertical mixing on T & S'
+            IF(lwp)WRITE(numout,*) '~~~~~~~ '
+         ENDIF
       ENDIF
       !
       IF( l_trdtra )   THEN                  !* Save ta and sa trends
-         ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) )
+         ALLOCATE( ztrdt(jpi,jpj,jpk), ztrds(jpi,jpj,jpk) )
          ztrdt(:,:,:) = pts(:,:,:,jp_tem,Kaa)
          ztrds(:,:,:) = pts(:,:,:,jp_sal,Kaa)
@@ -80,9 +82,9 @@
       ! JMM avoid negative salinities near river outlet ! Ugly fix
       ! JMM : restore negative salinities to small salinities:
-      WHERE( pts(:,:,:,jp_sal,Kaa) < 0._wp )   pts(:,:,:,jp_sal,Kaa) = 0.1_wp
+      WHERE( pts(A2D(0),:,jp_sal,Kaa) < 0._wp )   pts(A2D(0),:,jp_sal,Kaa) = 0.1_wp
 !!gm
 
       IF( l_trdtra )   THEN                      ! save the vertical diffusive trends for further diagnostics
-         DO jk = 1, jpkm1
+         DO jk = 1, jpk
             ztrdt(:,:,jk) = (   (  pts(:,:,jk,jp_tem,Kaa)*e3t(:,:,jk,Kaa)     &
                &                 - pts(:,:,jk,jp_tem,Kbb)*e3t(:,:,jk,Kbb)  )  &
@@ -94,4 +96,5 @@
                &          - ztrds(:,:,jk)
          END DO
+         ! NOTE: [tiling-comms-merge] The diagnostic results change along the north fold if this is removed
 !!gm this should be moved in trdtra.F90 and done on all trends
          CALL lbc_lnk_multi( 'trazdf', ztrdt, 'T', 1.0_wp , ztrds, 'T', 1.0_wp )
@@ -140,5 +143,5 @@
       INTEGER  ::  ji, jj, jk, jn   ! dummy loop indices
       REAL(wp) ::  zrhs, zzwi, zzws ! local scalars
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zwi, zwt, zwd, zws
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk) ::  zwi, zwt, zwd, zws
       !!---------------------------------------------------------------------
       !
@@ -154,6 +157,12 @@
             !
             ! vertical mixing coef.: avt for temperature, avs for salinity and passive tracers
-            IF( cdtype == 'TRA' .AND. jn == jp_tem ) THEN   ;   zwt(:,:,2:jpk) = avt(:,:,2:jpk)
-            ELSE                                            ;   zwt(:,:,2:jpk) = avs(:,:,2:jpk)
+            IF( cdtype == 'TRA' .AND. jn == jp_tem ) THEN
+               DO_3D( 1, 1, 1, 1, 2, jpk )
+                  zwt(ji,jj,jk) = avt(ji,jj,jk)
+               END_3D
+            ELSE
+               DO_3D( 1, 1, 1, 1, 2, jpk )
+                  zwt(ji,jj,jk) = avs(ji,jj,jk)
+               END_3D
             ENDIF
             zwt(:,:,1) = 0._wp
@@ -222,5 +231,5 @@
          END_2D
          DO_3D( 0, 0, 0, 0, 2, jpkm1 )
-            zrhs =        e3t(ji,jj,jk,Kbb) * pt(ji,jj,jk,jn,Kbb)    & 
+            zrhs =        e3t(ji,jj,jk,Kbb) * pt(ji,jj,jk,jn,Kbb)    &
                & + p2dt * e3t(ji,jj,jk,Kmm) * pt(ji,jj,jk,jn,Krhs)   ! zrhs=right hand side
             pt(ji,jj,jk,jn,Kaa) = zrhs - zwi(ji,jj,jk) / zwt(ji,jj,jk-1) * pt(ji,jj,jk-1,jn,Kaa)
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/zpshde.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/zpshde.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRA/zpshde.F90	(revision 14012)
@@ -17,4 +17,5 @@
    USE oce             ! ocean: dynamics and tracers variables
    USE dom_oce         ! domain: ocean variables
+   USE domutl, ONLY : is_tile
    USE phycst          ! physical constants
    USE eosbn2          ! ocean equation of state
@@ -40,6 +41,27 @@
 CONTAINS
 
-   SUBROUTINE zps_hde( kt, Kmm, kjpt, pta, pgtu, pgtv,   &
-      &                          prd, pgru, pgrv    )
+   SUBROUTINE zps_hde( kt, Kmm, kjpt, pta, pgtu, pgtv,  &
+      &                               prd, pgru, pgrv )
+      !!
+      INTEGER                     , INTENT(in   )           ::  kt          ! ocean time-step index
+      INTEGER                     , INTENT(in   )           ::  Kmm         ! ocean time level index
+      INTEGER                     , INTENT(in   )           ::  kjpt        ! number of tracers
+      REAL(wp), DIMENSION(:,:,:,:), INTENT(inout)           ::  pta         ! 4D tracers fields
+      REAL(wp), DIMENSION(:,:,:)  , INTENT(  out)           ::  pgtu, pgtv  ! hor. grad. of ptra at u- & v-pts
+      REAL(wp), DIMENSION(:,:,:)  , INTENT(inout), OPTIONAL ::  prd         ! 3D density anomaly fields
+      REAL(wp), DIMENSION(:,:)    , INTENT(  out), OPTIONAL ::  pgru, pgrv  ! hor. grad of prd at u- & v-pts (bottom)
+      !
+      INTEGER :: itrd, itgr
+      !!
+      IF( PRESENT(prd)  ) THEN ; itrd = is_tile(prd)  ; ELSE ; itrd = 0 ; ENDIF
+      IF( PRESENT(pgru) ) THEN ; itgr = is_tile(pgru) ; ELSE ; itgr = 0 ; ENDIF
+
+      CALL zps_hde_t( kt, Kmm, kjpt, pta, is_tile(pta), pgtu, pgtv, is_tile(pgtu), &
+         &                           prd, itrd,         pgru, pgrv, itgr )
+   END SUBROUTINE zps_hde
+
+
+   SUBROUTINE zps_hde_t( kt, Kmm, kjpt, pta, ktta, pgtu, pgtv, ktgt,   &
+      &                                 prd, ktrd, pgru, pgrv, ktgr )
       !!----------------------------------------------------------------------
       !!                     ***  ROUTINE zps_hde  ***
@@ -85,20 +107,26 @@
       !!              - pgru, pgrv: horizontal gradient of rho (if present) at u- & v-points
       !!----------------------------------------------------------------------
-      INTEGER                              , INTENT(in   )           ::  kt          ! ocean time-step index
-      INTEGER                              , INTENT(in   )           ::  Kmm         ! ocean time level index
-      INTEGER                              , INTENT(in   )           ::  kjpt        ! number of tracers
-      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   )           ::  pta         ! 4D tracers fields
-      REAL(wp), DIMENSION(jpi,jpj,    kjpt), INTENT(  out)           ::  pgtu, pgtv  ! hor. grad. of ptra at u- & v-pts 
-      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(in   ), OPTIONAL ::  prd         ! 3D density anomaly fields
-      REAL(wp), DIMENSION(jpi,jpj         ), INTENT(  out), OPTIONAL ::  pgru, pgrv  ! hor. grad of prd at u- & v-pts (bottom)
+      INTEGER                                , INTENT(in   )           ::  kt          ! ocean time-step index
+      INTEGER                                , INTENT(in   )           ::  Kmm         ! ocean time level index
+      INTEGER                                , INTENT(in   )           ::  kjpt        ! number of tracers
+      INTEGER                                , INTENT(in   )           ::  ktta, ktgt, ktrd, ktgr
+      REAL(wp), DIMENSION(A2D_T(ktta),JPK,KJPT), INTENT(inout)           ::  pta         ! 4D tracers fields
+      REAL(wp), DIMENSION(A2D_T(ktgt)    ,KJPT), INTENT(  out)           ::  pgtu, pgtv  ! hor. grad. of ptra at u- & v-pts
+      REAL(wp), DIMENSION(A2D_T(ktrd),JPK     ), INTENT(inout), OPTIONAL ::  prd         ! 3D density anomaly fields
+      REAL(wp), DIMENSION(A2D_T(ktgr)         ), INTENT(  out), OPTIONAL ::  pgru, pgrv  ! hor. grad of prd at u- & v-pts (bottom)
       !
       INTEGER  ::   ji, jj, jn                  ! Dummy loop indices
       INTEGER  ::   iku, ikv, ikum1, ikvm1      ! partial step level (ocean bottom level) at u- and v-points
       REAL(wp) ::   ze3wu, ze3wv, zmaxu, zmaxv  ! local scalars
-      REAL(wp), DIMENSION(jpi,jpj)      ::   zri, zrj, zhi, zhj   ! NB: 3rd dim=1 to use eos
-      REAL(wp), DIMENSION(jpi,jpj,kjpt) ::   zti, ztj             ! 
+      REAL(wp), DIMENSION(A2D(nn_hls))      ::   zri, zrj, zhi, zhj   ! NB: 3rd dim=1 to use eos
+      REAL(wp), DIMENSION(A2D(nn_hls),kjpt) ::   zti, ztj             !
       !!----------------------------------------------------------------------
       !
       IF( ln_timing )   CALL timing_start( 'zps_hde')
+      ! NOTE: [tiling-comms-merge] Some lbc_lnks in tra_adv and tra_ldf can be taken out in the zps case, because this lbc_lnk is called when zps_hde is called in the stp routine. In the zco case they are still needed.
+      IF (nn_hls.EQ.2) THEN
+         CALL lbc_lnk( 'zpshde', pta, 'T', 1.0_wp)
+         IF(PRESENT(prd)) CALL lbc_lnk( 'zpshde', prd, 'T', 1.0_wp)
+      END IF
       !
       pgtu(:,:,:) = 0._wp   ;   zti (:,:,:) = 0._wp   ;   zhi (:,:) = 0._wp
@@ -107,5 +135,5 @@
       DO jn = 1, kjpt      !==   Interpolation of tracers at the last ocean level   ==!
          !
-         DO_2D( 1, 0, 1, 0 )
+         DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )              ! Gradient of density at the last level
             iku = mbku(ji,jj)   ;   ikum1 = MAX( iku - 1 , 1 )    ! last and before last ocean level at u- & v-points
             ikv = mbkv(ji,jj)   ;   ikvm1 = MAX( ikv - 1 , 1 )    ! if level first is a p-step, ik.m1=1
@@ -146,10 +174,10 @@
       END DO
       !
-      CALL lbc_lnk_multi( 'zpshde', pgtu(:,:,:), 'U', -1.0_wp , pgtv(:,:,:), 'V', -1.0_wp )   ! Lateral boundary cond.
+      IF (nn_hls.EQ.1) CALL lbc_lnk_multi( 'zpshde', pgtu(:,:,:), 'U', -1.0_wp , pgtv(:,:,:), 'V', -1.0_wp )   ! Lateral boundary cond.
       !                
       IF( PRESENT( prd ) ) THEN    !==  horizontal derivative of density anomalies (rd)  ==!    (optional part)
          pgru(:,:) = 0._wp
          pgrv(:,:) = 0._wp                ! depth of the partial step level
-         DO_2D( 1, 0, 1, 0 )
+         DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )
             iku = mbku(ji,jj)
             ikv = mbkv(ji,jj)
@@ -167,5 +195,5 @@
          CALL eos( ztj, zhj, zrj )        ! at the partial step depth output in  zri, zrj 
          !
-         DO_2D( 1, 0, 1, 0 )              ! Gradient of density at the last level
+         DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )              ! Gradient of density at the last level
             iku = mbku(ji,jj)
             ikv = mbkv(ji,jj)
@@ -179,5 +207,5 @@
             ENDIF
          END_2D
-         CALL lbc_lnk_multi( 'zpshde', pgru , 'U', -1.0_wp , pgrv , 'V', -1.0_wp )   ! Lateral boundary conditions
+         IF (nn_hls.EQ.1) CALL lbc_lnk_multi( 'zpshde', pgru , 'U', -1.0_wp , pgrv , 'V', -1.0_wp )   ! Lateral boundary conditions
          !
       END IF
@@ -185,9 +213,33 @@
       IF( ln_timing )   CALL timing_stop( 'zps_hde')
       !
-   END SUBROUTINE zps_hde
+   END SUBROUTINE zps_hde_t
 
 
    SUBROUTINE zps_hde_isf( kt, Kmm, kjpt, pta, pgtu, pgtv, pgtui, pgtvi,  &
-      &                          prd, pgru, pgrv, pgrui, pgrvi )
+      &                                   prd, pgru, pgrv, pgrui, pgrvi )
+      !!
+      INTEGER                     , INTENT(in   )           ::  kt           ! ocean time-step index
+      INTEGER                     , INTENT(in   )           ::  Kmm          ! ocean time level index
+      INTEGER                     , INTENT(in   )           ::  kjpt         ! number of tracers
+      REAL(wp), DIMENSION(:,:,:,:), INTENT(inout)           ::  pta          ! 4D tracers fields
+      REAL(wp), DIMENSION(:,:,:)  , INTENT(  out)           ::  pgtu, pgtv   ! hor. grad. of ptra at u- & v-pts
+      REAL(wp), DIMENSION(:,:,:)  , INTENT(  out)           ::  pgtui, pgtvi ! hor. grad. of stra at u- & v-pts (ISF)
+      REAL(wp), DIMENSION(:,:,:)  , INTENT(inout), OPTIONAL ::  prd          ! 3D density anomaly fields
+      REAL(wp), DIMENSION(:,:)    , INTENT(  out), OPTIONAL ::  pgru, pgrv   ! hor. grad of prd at u- & v-pts (bottom)
+      REAL(wp), DIMENSION(:,:)    , INTENT(  out), OPTIONAL ::  pgrui, pgrvi ! hor. grad of prd at u- & v-pts (top)
+      !
+      INTEGER :: itrd, itgr, itgri
+      !!
+      IF( PRESENT(prd)   ) THEN ; itrd  = is_tile(prd)   ; ELSE ; itrd  = 0 ; ENDIF
+      IF( PRESENT(pgru)  ) THEN ; itgr  = is_tile(pgru)  ; ELSE ; itgr  = 0 ; ENDIF
+      IF( PRESENT(pgrui) ) THEN ; itgri = is_tile(pgrui) ; ELSE ; itgri = 0 ; ENDIF
+
+      CALL zps_hde_isf_t( kt, Kmm, kjpt, pta, is_tile(pta), pgtu, pgtv, is_tile(pgtu), pgtui, pgtvi, is_tile(pgtui),  &
+      &                                  prd, itrd,         pgru, pgrv, itgr,          pgrui, pgrvi, itgri )
+   END SUBROUTINE zps_hde_isf
+
+
+   SUBROUTINE zps_hde_isf_t( kt, Kmm, kjpt, pta, ktta, pgtu, pgtv, ktgt, pgtui, pgtvi, ktgti,  &
+      &                                     prd, ktrd, pgru, pgrv, ktgr, pgrui, pgrvi, ktgri )
       !!----------------------------------------------------------------------
       !!                     ***  ROUTINE zps_hde_isf  ***
@@ -236,23 +288,29 @@
       !!              - pgru, pgrv, pgrui, pgtvi: horizontal gradient of rho (if present) at u- & v-points
       !!----------------------------------------------------------------------
-      INTEGER                              , INTENT(in   )           ::  kt           ! ocean time-step index
-      INTEGER                              , INTENT(in   )           ::  Kmm          ! ocean time level index
-      INTEGER                              , INTENT(in   )           ::  kjpt         ! number of tracers
-      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   )           ::  pta          ! 4D tracers fields
-      REAL(wp), DIMENSION(jpi,jpj,    kjpt), INTENT(  out)           ::  pgtu, pgtv   ! hor. grad. of ptra at u- & v-pts 
-      REAL(wp), DIMENSION(jpi,jpj,    kjpt), INTENT(  out)           ::  pgtui, pgtvi ! hor. grad. of stra at u- & v-pts (ISF)
-      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(in   ), OPTIONAL ::  prd          ! 3D density anomaly fields
-      REAL(wp), DIMENSION(jpi,jpj         ), INTENT(  out), OPTIONAL ::  pgru, pgrv   ! hor. grad of prd at u- & v-pts (bottom)
-      REAL(wp), DIMENSION(jpi,jpj         ), INTENT(  out), OPTIONAL ::  pgrui, pgrvi ! hor. grad of prd at u- & v-pts (top)
+      INTEGER                                , INTENT(in   )           ::  kt           ! ocean time-step index
+      INTEGER                                , INTENT(in   )           ::  Kmm          ! ocean time level index
+      INTEGER                                , INTENT(in   )           ::  kjpt         ! number of tracers
+      INTEGER                                , INTENT(in   )           ::  ktta, ktgt, ktgti, ktrd, ktgr, ktgri
+      REAL(wp), DIMENSION(A2D_T(ktta),JPK,KJPT), INTENT(inout)           ::  pta          ! 4D tracers fields
+      REAL(wp), DIMENSION(A2D_T(ktgt)    ,KJPT), INTENT(  out)           ::  pgtu, pgtv   ! hor. grad. of ptra at u- & v-pts
+      REAL(wp), DIMENSION(A2D_T(ktgti)   ,KJPT), INTENT(  out)           ::  pgtui, pgtvi ! hor. grad. of stra at u- & v-pts (ISF)
+      REAL(wp), DIMENSION(A2D_T(ktrd),JPK     ), INTENT(inout), OPTIONAL ::  prd          ! 3D density anomaly fields
+      REAL(wp), DIMENSION(A2D_T(ktgr)         ), INTENT(  out), OPTIONAL ::  pgru, pgrv   ! hor. grad of prd at u- & v-pts (bottom)
+      REAL(wp), DIMENSION(A2D_T(ktgri)        ), INTENT(  out), OPTIONAL ::  pgrui, pgrvi ! hor. grad of prd at u- & v-pts (top)
       !
       INTEGER  ::   ji, jj, jn      ! Dummy loop indices
       INTEGER  ::   iku, ikv, ikum1, ikvm1,ikup1, ikvp1   ! partial step level (ocean bottom level) at u- and v-points
       REAL(wp) ::  ze3wu, ze3wv, zmaxu, zmaxv             ! temporary scalars
-      REAL(wp), DIMENSION(jpi,jpj)      ::  zri, zrj, zhi, zhj   ! NB: 3rd dim=1 to use eos
-      REAL(wp), DIMENSION(jpi,jpj,kjpt) ::  zti, ztj             ! 
+      REAL(wp), DIMENSION(A2D(nn_hls))      ::  zri, zrj, zhi, zhj   ! NB: 3rd dim=1 to use eos
+      REAL(wp), DIMENSION(A2D(nn_hls),kjpt) ::  zti, ztj             !
       !!----------------------------------------------------------------------
       !
       IF( ln_timing )   CALL timing_start( 'zps_hde_isf')
       !
+      IF (nn_hls.EQ.2) THEN
+         CALL lbc_lnk( 'zpshde', pta, 'T', 1.0_wp)
+         IF (PRESENT(prd)) CALL lbc_lnk( 'zpshde', prd, 'T', 1.0_wp)
+      END IF
+
       pgtu (:,:,:) = 0._wp   ;   pgtv (:,:,:) =0._wp
       pgtui(:,:,:) = 0._wp   ;   pgtvi(:,:,:) =0._wp
@@ -262,5 +320,5 @@
       DO jn = 1, kjpt      !==   Interpolation of tracers at the last ocean level   ==!
          !
-         DO_2D( 1, 0, 1, 0 )
+         DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )
 
             iku = mbku(ji,jj); ikum1 = MAX( iku - 1 , 1 )    ! last and before last ocean level at u- & v-points
@@ -302,5 +360,5 @@
       END DO
       !
-      CALL lbc_lnk_multi( 'zpshde', pgtu(:,:,:), 'U', -1.0_wp , pgtv(:,:,:), 'V', -1.0_wp )   ! Lateral boundary cond.
+      IF (nn_hls.EQ.1) CALL lbc_lnk_multi( 'zpshde', pgtu(:,:,:), 'U', -1.0_wp , pgtv(:,:,:), 'V', -1.0_wp )   ! Lateral boundary cond.
 
       ! horizontal derivative of density anomalies (rd)
@@ -308,5 +366,5 @@
          pgru(:,:)=0.0_wp   ; pgrv(:,:)=0.0_wp ; 
          !
-         DO_2D( 1, 0, 1, 0 )
+         DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )
 
             iku = mbku(ji,jj)
@@ -329,5 +387,5 @@
          CALL eos( ztj, zhj, zrj )
 
-         DO_2D( 1, 0, 1, 0 )            ! Gradient of density at the last level
+         DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )
             iku = mbku(ji,jj)
             ikv = mbkv(ji,jj)
@@ -344,5 +402,5 @@
          END_2D
 
-         CALL lbc_lnk_multi( 'zpshde', pgru , 'U', -1.0_wp , pgrv , 'V', -1.0_wp )   ! Lateral boundary conditions
+         IF (nn_hls.EQ.1) CALL lbc_lnk_multi( 'zpshde', pgru , 'U', -1.0_wp , pgrv , 'V', -1.0_wp )   ! Lateral boundary conditions
          !
       END IF
@@ -351,5 +409,5 @@
       !
       DO jn = 1, kjpt      !==   Interpolation of tracers at the last ocean level   ==!            !
-         DO_2D( 1, 0, 1, 0 )
+         DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )
             iku = miku(ji,jj); ikup1 = miku(ji,jj) + 1
             ikv = mikv(ji,jj); ikvp1 = mikv(ji,jj) + 1
@@ -395,10 +453,10 @@
          !
       END DO
-      CALL lbc_lnk_multi( 'zpshde', pgtui(:,:,:), 'U', -1.0_wp , pgtvi(:,:,:), 'V', -1.0_wp )   ! Lateral boundary cond.
+      IF (nn_hls.EQ.1) CALL lbc_lnk_multi( 'zpshde', pgtui(:,:,:), 'U', -1.0_wp , pgtvi(:,:,:), 'V', -1.0_wp )   ! Lateral boundary cond.
 
       IF( PRESENT( prd ) ) THEN    !==  horizontal derivative of density anomalies (rd)  ==!    (optional part)
          !
          pgrui(:,:)  =0.0_wp; pgrvi(:,:)  =0.0_wp;
-         DO_2D( 1, 0, 1, 0 )
+         DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )
 
             iku = miku(ji,jj)
@@ -420,5 +478,5 @@
          CALL eos( ztj, zhj, zrj )        ! at the partial step depth output in  zri, zrj 
          !
-         DO_2D( 1, 0, 1, 0 )              ! Gradient of density at the last level
+         DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )
             iku = miku(ji,jj) 
             ikv = mikv(ji,jj) 
@@ -434,5 +492,5 @@
 
          END_2D
-         CALL lbc_lnk_multi( 'zpshde', pgrui, 'U', -1.0_wp , pgrvi, 'V', -1.0_wp )   ! Lateral boundary conditions
+         IF (nn_hls.EQ.1) CALL lbc_lnk_multi( 'zpshde', pgrui, 'U', -1.0_wp , pgrvi, 'V', -1.0_wp )   ! Lateral boundary conditions
          !
       END IF  
@@ -440,5 +498,5 @@
       IF( ln_timing )   CALL timing_stop( 'zps_hde_isf')
       !
-   END SUBROUTINE zps_hde_isf
+   END SUBROUTINE zps_hde_isf_t
 
    !!======================================================================
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRD/trdini.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRD/trdini.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/TRD/trdini.F90	(revision 14012)
@@ -11,4 +11,5 @@
    !!----------------------------------------------------------------------
    USE dom_oce        ! ocean domain
+   USE domain, ONLY : dom_tile
    USE trd_oce        ! trends: ocean variables
    USE trdken         ! trends: 3D kinetic   energy
@@ -88,5 +89,11 @@
       !
 !      IF( .NOT.ln_linssh .AND. ( l_trdtra .OR. l_trddyn ) )  CALL ctl_stop( 'trend diagnostics with variable volume not validated' )
-      
+
+      IF( ln_tile .AND. ( l_trdtra .OR. l_trddyn ) ) THEN
+         CALL ctl_warn('Tiling is not yet implemented for the trends diagnostics; ln_tile is forced to FALSE')
+         ln_tile = .FALSE.
+         CALL dom_tile( ntsi, ntsj, ntei, ntej )
+      ENDIF
+
 !!gm  : Potential BUG : 3D output only for vector invariant form!  add a ctl_stop or code the flux form case
 !!gm  : bug/pb for vertical advection of tracer in vvl case: add T.dt[eta] in the output... 
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/USR/usrdef_nam.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/USR/usrdef_nam.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/USR/usrdef_nam.F90	(revision 14012)
@@ -70,5 +70,5 @@
       kk_cfg = nn_GYRE
       !
-      kpi = 30 * nn_GYRE + 2       !                     
+      kpi = 30 * nn_GYRE + 2       !
       kpj = 20 * nn_GYRE + 2
 #if defined key_agrif
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/ZDF/zdfgls.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/ZDF/zdfgls.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/ZDF/zdfgls.F90	(revision 14012)
@@ -1057,11 +1057,4 @@
       CALL gls_rst( nit000, 'READ' )      ! (en, avt_k, avm_k, hmxl_n)
       !
-      IF( lwxios ) THEN
-         CALL iom_set_rstw_var_active('en')
-         CALL iom_set_rstw_var_active('avt_k')
-         CALL iom_set_rstw_var_active('avm_k')
-         CALL iom_set_rstw_var_active('hmxl_n')
-      ENDIF
-      !
    END SUBROUTINE zdf_gls_init
 
@@ -1097,8 +1090,8 @@
             !
             IF( MIN( id1, id2, id3, id4 ) > 0 ) THEN        ! all required arrays exist
-               CALL iom_get( numror, jpdom_auto, 'en'    , en    , ldxios = lrxios )
-               CALL iom_get( numror, jpdom_auto, 'avt_k' , avt_k , ldxios = lrxios )
-               CALL iom_get( numror, jpdom_auto, 'avm_k' , avm_k , ldxios = lrxios )
-               CALL iom_get( numror, jpdom_auto, 'hmxl_n', hmxl_n, ldxios = lrxios )
+               CALL iom_get( numror, jpdom_auto, 'en'    , en     )
+               CALL iom_get( numror, jpdom_auto, 'avt_k' , avt_k  )
+               CALL iom_get( numror, jpdom_auto, 'avm_k' , avm_k  )
+               CALL iom_get( numror, jpdom_auto, 'hmxl_n', hmxl_n )
             ELSE                        
                IF(lwp) WRITE(numout,*)
@@ -1119,10 +1112,8 @@
          !                                   ! -------------------
          IF(lwp) WRITE(numout,*) '---- gls-rst ----'
-         IF( lwxios ) CALL iom_swap(      cwxios_context         )
-         CALL iom_rstput( kt, nitrst, numrow, 'en'    , en    , ldxios = lwxios )
-         CALL iom_rstput( kt, nitrst, numrow, 'avt_k' , avt_k , ldxios = lwxios )
-         CALL iom_rstput( kt, nitrst, numrow, 'avm_k' , avm_k , ldxios = lwxios )
-         CALL iom_rstput( kt, nitrst, numrow, 'hmxl_n', hmxl_n, ldxios = lwxios )
-         IF( lwxios ) CALL iom_swap(      cxios_context          )
+         CALL iom_rstput( kt, nitrst, numrow, 'en'    , en     )
+         CALL iom_rstput( kt, nitrst, numrow, 'avt_k' , avt_k  )
+         CALL iom_rstput( kt, nitrst, numrow, 'avm_k' , avm_k  )
+         CALL iom_rstput( kt, nitrst, numrow, 'hmxl_n', hmxl_n )
          !
       ENDIF
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/ZDF/zdfosm.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/ZDF/zdfosm.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/ZDF/zdfosm.F90	(revision 14012)
@@ -1437,9 +1437,4 @@
      ghamv(:,:,:) = 0.
      !
-     IF( lwxios ) THEN
-        CALL iom_set_rstw_var_active('wn')
-        CALL iom_set_rstw_var_active('hbl')
-        CALL iom_set_rstw_var_active('hbli')
-     ENDIF
    END SUBROUTINE zdf_osm_init
 
@@ -1474,5 +1469,5 @@
         id1 = iom_varid( numror, 'wn'   , ldstop = .FALSE. )
         IF( id1 > 0 ) THEN                       ! 'wn' exists; read
-           CALL iom_get( numror, jpdom_auto, 'wn', ww, ldxios = lrxios )
+           CALL iom_get( numror, jpdom_auto, 'wn', ww )
            WRITE(numout,*) ' ===>>>> :  ww read from restart file'
         ELSE
@@ -1483,6 +1478,6 @@
         id2 = iom_varid( numror, 'hbli'   , ldstop = .FALSE. )
         IF( id1 > 0 .AND. id2 > 0) THEN                       ! 'hbl' exists; read and return
-           CALL iom_get( numror, jpdom_auto, 'hbl' , hbl , ldxios = lrxios )
-           CALL iom_get( numror, jpdom_auto, 'hbli', hbli, ldxios = lrxios  )
+           CALL iom_get( numror, jpdom_auto, 'hbl' , hbl  )
+           CALL iom_get( numror, jpdom_auto, 'hbli', hbli  )
            WRITE(numout,*) ' ===>>>> :  hbl & hbli read from restart file'
            RETURN
@@ -1496,8 +1491,10 @@
      !!-----------------------------------------------------------------------------
      IF( TRIM(cdrw) == 'WRITE') THEN     !* Write hbli into the restart file, then return
+        IF( ntile /= 0 .AND. ntile /= nijtile ) RETURN        ! Do only on the last tile
+
         IF(lwp) WRITE(numout,*) '---- osm-rst ----'
-         CALL iom_rstput( kt, nitrst, numrow, 'wn'     , ww  , ldxios = lwxios )
-         CALL iom_rstput( kt, nitrst, numrow, 'hbl'    , hbl , ldxios = lwxios )
-         CALL iom_rstput( kt, nitrst, numrow, 'hbli'   , hbli, ldxios = lwxios )
+         CALL iom_rstput( kt, nitrst, numrow, 'wn'     , ww   )
+         CALL iom_rstput( kt, nitrst, numrow, 'hbl'    , hbl  )
+         CALL iom_rstput( kt, nitrst, numrow, 'hbli'   , hbli )
         RETURN
      END IF
@@ -1550,7 +1547,9 @@
       !
       IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'tra_osm : OSM non-local tracer fluxes'
-         IF(lwp) WRITE(numout,*) '~~~~~~~   '
+         IF( ntile == 0 .OR. ntile == 1 ) THEN                    ! Do only on the first tile
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) 'tra_osm : OSM non-local tracer fluxes'
+            IF(lwp) WRITE(numout,*) '~~~~~~~   '
+         ENDIF
       ENDIF
 
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/ZDF/zdfric.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/ZDF/zdfric.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/ZDF/zdfric.F90	(revision 14012)
@@ -103,8 +103,4 @@
       CALL ric_rst( nit000, 'READ' )  !* read or initialize all required files
       !
-      IF( lwxios ) THEN
-         CALL iom_set_rstw_var_active('avt_k')
-         CALL iom_set_rstw_var_active('avm_k')
-      ENDIF
    END SUBROUTINE zdf_ric_init
 
@@ -214,6 +210,6 @@
             !
             IF( MIN( id1, id2 ) > 0 ) THEN         ! restart exists => read it
-               CALL iom_get( numror, jpdom_auto, 'avt_k', avt_k, ldxios = lrxios )
-               CALL iom_get( numror, jpdom_auto, 'avm_k', avm_k, ldxios = lrxios )
+               CALL iom_get( numror, jpdom_auto, 'avt_k', avt_k )
+               CALL iom_get( numror, jpdom_auto, 'avm_k', avm_k )
             ENDIF
          ENDIF
@@ -223,8 +219,6 @@
          !                                   ! -------------------
          IF(lwp) WRITE(numout,*) '---- ric-rst ----'
-         IF( lwxios ) CALL iom_swap(      cwxios_context          )
-         CALL iom_rstput( kt, nitrst, numrow, 'avt_k', avt_k, ldxios = lwxios )
-         CALL iom_rstput( kt, nitrst, numrow, 'avm_k', avm_k, ldxios = lwxios)
-         IF( lwxios ) CALL iom_swap(      cxios_context          )
+         CALL iom_rstput( kt, nitrst, numrow, 'avt_k', avt_k )
+         CALL iom_rstput( kt, nitrst, numrow, 'avm_k', avm_k)
          !
       ENDIF
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/ZDF/zdftke.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/ZDF/zdftke.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/ZDF/zdftke.F90	(revision 14012)
@@ -721,10 +721,4 @@
       CALL tke_rst( nit000, 'READ' )      ! (en, avt_k, avm_k, dissl) 
       !
-      IF( lwxios ) THEN
-         CALL iom_set_rstw_var_active('en')
-         CALL iom_set_rstw_var_active('avt_k')
-         CALL iom_set_rstw_var_active('avm_k')
-         CALL iom_set_rstw_var_active('dissl')
-      ENDIF
    END SUBROUTINE zdf_tke_init
 
@@ -758,8 +752,8 @@
             !
             IF( MIN( id1, id2, id3, id4 ) > 0 ) THEN      ! fields exist
-               CALL iom_get( numror, jpdom_auto, 'en'   , en   , ldxios = lrxios )
-               CALL iom_get( numror, jpdom_auto, 'avt_k', avt_k, ldxios = lrxios )
-               CALL iom_get( numror, jpdom_auto, 'avm_k', avm_k, ldxios = lrxios )
-               CALL iom_get( numror, jpdom_auto, 'dissl', dissl, ldxios = lrxios )
+               CALL iom_get( numror, jpdom_auto, 'en'   , en    )
+               CALL iom_get( numror, jpdom_auto, 'avt_k', avt_k )
+               CALL iom_get( numror, jpdom_auto, 'avm_k', avm_k )
+               CALL iom_get( numror, jpdom_auto, 'dissl', dissl )
             ELSE                                          ! start TKE from rest
                IF(lwp) WRITE(numout,*)
@@ -780,10 +774,8 @@
          !                                   ! -------------------
          IF(lwp) WRITE(numout,*) '---- tke_rst ----'
-         IF( lwxios ) CALL iom_swap(      cwxios_context          ) 
-         CALL iom_rstput( kt, nitrst, numrow, 'en'   , en   , ldxios = lwxios )
-         CALL iom_rstput( kt, nitrst, numrow, 'avt_k', avt_k, ldxios = lwxios )
-         CALL iom_rstput( kt, nitrst, numrow, 'avm_k', avm_k, ldxios = lwxios )
-         CALL iom_rstput( kt, nitrst, numrow, 'dissl', dissl, ldxios = lwxios )
-         IF( lwxios ) CALL iom_swap(      cxios_context          )
+         CALL iom_rstput( kt, nitrst, numrow, 'en'   , en    )
+         CALL iom_rstput( kt, nitrst, numrow, 'avt_k', avt_k )
+         CALL iom_rstput( kt, nitrst, numrow, 'avm_k', avm_k )
+         CALL iom_rstput( kt, nitrst, numrow, 'dissl', dissl )
          !
       ENDIF
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/do_loop_substitute.h90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/do_loop_substitute.h90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/do_loop_substitute.h90	(revision 14012)
@@ -59,5 +59,14 @@
 #endif
 
-#define DO_2D(B, T, L, R) DO jj = Njs0-(B), Nje0+(T)   ;   DO ji = Nis0-(L), Nie0+(R)
+#define DO_2D(B, T, L, R) DO jj = ntsj-(B), ntej+(T)   ;   DO ji = ntsi-(L), ntei+(R)
+#define A1Di(H) ntsi-H:ntei+H
+#define A1Dj(H) ntsj-H:ntej+H
+#define A2D(H) A1Di(H),A1Dj(H)
+#define A1Di_T(T) (ntsi-nn_hls-1)*T+1:
+#define A1Dj_T(T) (ntsj-nn_hls-1)*T+1:
+#define A2D_T(T) A1Di_T(T),A1Dj_T(T)
+#define JPK  :
+#define JPTS  :
+#define KJPT  :
 
 #define DO_3D(B, T, L, R, ks, ke) DO jk = ks, ke   ;   DO_2D(B, T, L, R)
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/nemogcm.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/nemogcm.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/nemogcm.F90	(revision 14012)
@@ -437,5 +437,5 @@
      CALL Agrif_Declare_Var_ini   !  "      "   "   "      "  DOM
 #endif
-                           CALL     dom_init( Nbb, Nnn, Naa, "OPA") ! Domain
+                           CALL     dom_init( Nbb, Nnn, Naa ) ! Domain
       IF( ln_crs       )   CALL     crs_init(      Nnn )       ! coarsened grid: domain initialization 
       IF( sn_cfctl%l_prtctl )   &
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/par_oce.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/par_oce.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/par_oce.F90	(revision 14012)
@@ -65,4 +65,12 @@
    INTEGER, PUBLIC ::   jpjmax! = ( Nj0glo + jpnj-1 ) / jpnj + 2*nn_hls            !: maximum jpj
 
+   ! Domain tiling
+   INTEGER, PUBLIC ::   nijtile    !: number of tiles in total
+   INTEGER, PUBLIC ::   ntile      !: current tile number
+   INTEGER, PUBLIC ::   ntsi       !: start of internal part of tile domain
+   INTEGER, PUBLIC ::   ntsj       !
+   INTEGER, PUBLIC ::   ntei       !: end of internal part of tile domain
+   INTEGER, PUBLIC ::   ntej       !
+
    !!---------------------------------------------------------------------
    !! Active tracer parameters
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/step.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/step.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/step.F90	(revision 14012)
@@ -55,4 +55,6 @@
    INTEGER, PUBLIC :: Nbb, Nnn, Naa, Nrhs          !! used by nemo_init
 
+   !! * Substitutions
+#  include "do_loop_substitute.h90"
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
@@ -85,5 +87,5 @@
       !!              -8- Outputs and diagnostics
       !!----------------------------------------------------------------------
-      INTEGER ::   ji, jj, jk   ! dummy loop indice
+      INTEGER ::   ji, jj, jk, jtile   ! dummy loop indice
 !!gm kcall can be removed, I guess
       INTEGER ::   kcall        ! optional integer argument (dom_vvl_sf_nxt)
@@ -124,4 +126,21 @@
          IF( ln_crs      )   CALL iom_init( TRIM(cxios_context)//"_crs" )  ! for coarse grid
       ENDIF
+      IF((kstp == nitrst) .AND. lwxios) THEN
+         CALL iom_swap(      cw_ocerst_cxt          )
+         CALL iom_init_closedef(cw_ocerst_cxt)
+         CALL iom_setkt( kstp - nit000 + 1,      cw_ocerst_cxt          )
+#if defined key_top
+         CALL iom_swap(      cw_toprst_cxt          )
+         CALL iom_init_closedef(cw_toprst_cxt)
+         CALL iom_setkt( kstp - nit000 + 1,      cw_toprst_cxt          )
+#endif
+      ENDIF
+#if defined key_si3
+      IF(((kstp + nn_fsbc - 1) == nitrst) .AND. lwxios) THEN
+         CALL iom_swap(      cw_icerst_cxt          )
+         CALL iom_init_closedef(cw_icerst_cxt)
+         CALL iom_setkt( kstp - nit000 + 1,      cw_icerst_cxt          )
+      ENDIF
+#endif
       IF( kstp /= nit000 )   CALL day( kstp )         ! Calendar (day was already called at nit000 in day_init)
                              CALL iom_setkt( kstp - nit000 + 1,      cxios_context          )   ! tell IOM we are at time step kstp
@@ -246,28 +265,45 @@
       ! Active tracers                              
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-                         ts(:,:,:,:,Nrhs) = 0._wp         ! set tracer trends to zero
-
-      IF(  lk_asminc .AND. ln_asmiau .AND. &
-         & ln_trainc )   CALL tra_asm_inc( kstp, Nbb, Nnn, ts, Nrhs )  ! apply tracer assimilation increment
-                         CALL tra_sbc    ( kstp,      Nnn, ts, Nrhs )  ! surface boundary condition
-      IF( ln_traqsr  )   CALL tra_qsr    ( kstp,      Nnn, ts, Nrhs )  ! penetrative solar radiation qsr
-      IF( ln_isf     )   CALL tra_isf    ( kstp,      Nnn, ts, Nrhs )  ! ice shelf heat flux
-      IF( ln_trabbc  )   CALL tra_bbc    ( kstp,      Nnn, ts, Nrhs )  ! bottom heat flux
-      IF( ln_trabbl  )   CALL tra_bbl    ( kstp, Nbb, Nnn, ts, Nrhs )  ! advective (and/or diffusive) bottom boundary layer scheme
-      IF( ln_tradmp  )   CALL tra_dmp    ( kstp, Nbb, Nnn, ts, Nrhs )  ! internal damping trends
-      IF( ln_bdy     )   CALL bdy_tra_dmp( kstp, Nbb,      ts, Nrhs )  ! bdy damping trends
-#if defined key_agrif
-      IF(.NOT. Agrif_Root())  & 
-               &         CALL Agrif_Sponge_tra        ! tracers sponge
-#endif
-                         CALL tra_adv    ( kstp, Nbb, Nnn, ts, Nrhs )  ! hor. + vert. advection	==> RHS
-      IF( ln_zdfosm  )   CALL tra_osm    ( kstp,      Nnn, ts, Nrhs )  ! OSMOSIS non-local tracer fluxes ==> RHS
-      IF( lrst_oce .AND. ln_zdfosm ) &
-           &             CALL osm_rst    ( kstp,      Nnn, 'WRITE'  )  ! write OSMOSIS outputs + ww (so must do here) to restarts
-                         CALL tra_ldf    ( kstp, Nbb, Nnn, ts, Nrhs )  ! lateral mixing
-
-                         CALL tra_zdf    ( kstp, Nbb, Nnn, Nrhs, ts, Naa  )  ! vertical mixing and after tracer fields
-      IF( ln_zdfnpc  )   CALL tra_npc    ( kstp,      Nnn, Nrhs, ts, Naa  )  ! update after fields by non-penetrative convection
-
+      ! Loop over tile domains
+      DO jtile = 1, nijtile
+         IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = jtile )
+
+         DO_3D( 0, 0, 0, 0, 1, jpk )
+            ts(ji,jj,jk,:,Nrhs) = 0._wp                                         ! set tracer trends to zero
+         END_3D
+
+         IF(  lk_asminc .AND. ln_asmiau .AND. &
+            & ln_trainc )   CALL tra_asm_inc( kstp, Nbb, Nnn, ts, Nrhs )  ! apply tracer assimilation increment
+                            CALL tra_sbc    ( kstp,      Nnn, ts, Nrhs )  ! surface boundary condition
+         IF( ln_traqsr  )   CALL tra_qsr    ( kstp,      Nnn, ts, Nrhs )  ! penetrative solar radiation qsr
+         IF( ln_isf     )   CALL tra_isf    ( kstp,      Nnn, ts, Nrhs )  ! ice shelf heat flux
+         IF( ln_trabbc  )   CALL tra_bbc    ( kstp,      Nnn, ts, Nrhs )  ! bottom heat flux
+         IF( ln_trabbl  )   CALL tra_bbl    ( kstp, Nbb, Nnn, ts, Nrhs )  ! advective (and/or diffusive) bottom boundary layer scheme
+         IF( ln_tradmp  )   CALL tra_dmp    ( kstp, Nbb, Nnn, ts, Nrhs )  ! internal damping trends
+         IF( ln_bdy     )   CALL bdy_tra_dmp( kstp, Nbb,      ts, Nrhs )  ! bdy damping trends
+      END DO
+
+#if defined key_agrif
+         IF(.NOT. Agrif_Root()) THEN
+            IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 )
+            CALL Agrif_Sponge_tra        ! tracers sponge
+         ENDIF
+#endif
+
+      ! TEMP: [tiling] Separate loop over tile domains (due to tra_adv workarounds for tiling)
+      DO jtile = 1, nijtile
+         IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = jtile )
+
+                            CALL tra_adv    ( kstp, Nbb, Nnn, ts, Nrhs )  ! hor. + vert. advection	==> RHS
+         IF( ln_zdfosm  )   CALL tra_osm    ( kstp,      Nnn, ts, Nrhs )  ! OSMOSIS non-local tracer fluxes ==> RHS
+         IF( lrst_oce .AND. ln_zdfosm ) &
+              &             CALL osm_rst    ( kstp,      Nnn, 'WRITE'  )  ! write OSMOSIS outputs + ww (so must do here) to restarts
+                            CALL tra_ldf    ( kstp, Nbb, Nnn, ts, Nrhs )  ! lateral mixing
+
+                            CALL tra_zdf    ( kstp, Nbb, Nnn, Nrhs, ts, Naa  )  ! vertical mixing and after tracer fields
+         IF( ln_zdfnpc  )   CALL tra_npc    ( kstp,      Nnn, Nrhs, ts, Naa  )  ! update after fields by non-penetrative convection
+      END DO
+
+      IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 ) ! Revert to tile over full domain
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
       ! Set boundary conditions, time filter and swap time levels
@@ -338,4 +374,5 @@
       IF( kstp == nit000 ) THEN                          ! 1st time step only
                                         CALL iom_close( numror )   ! close input  ocean restart file
+         IF( lrxios )                   CALL iom_context_finalize(      cr_ocerst_cxt         )
          IF(lwm)                        CALL FLUSH    ( numond )   ! flush output namelist oce
          IF(lwm .AND. numoni /= -1 )    CALL FLUSH    ( numoni )   ! flush output namelist ice (if exist)
@@ -353,5 +390,4 @@
       IF( kstp == nitend .OR. nstop > 0 ) THEN 
                       CALL iom_context_finalize(      cxios_context          ) ! needed for XIOS+AGRIF
-         IF( lrxios ) CALL iom_context_finalize(      crxios_context         )
          IF( ln_crs ) CALL iom_context_finalize( trim(cxios_context)//"_crs" ) ! 
       ENDIF
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/step_oce.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/step_oce.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/step_oce.F90	(revision 14012)
@@ -9,4 +9,5 @@
    USE oce             ! ocean dynamics and tracers variables
    USE dom_oce         ! ocean space and time domain variables
+   USE domain, ONLY : dom_tile
    USE zdf_oce         ! ocean vertical physics variables
    USE zdfdrg  ,  ONLY : ln_drgimp   ! implicit top/bottom friction
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/stpMLF.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/stpMLF.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/stpMLF.F90	(revision 14012)
@@ -364,5 +364,5 @@
       IF( kstp == nitend .OR. indic < 0 ) THEN
                       CALL iom_context_finalize(      cxios_context          ) ! needed for XIOS+AGRIF
-         IF(lrxios) CALL iom_context_finalize(      crxios_context          )
+         IF(lrxios) CALL iom_context_finalize(      cr_ocerst_cxt          )
          IF( ln_crs ) CALL iom_context_finalize( trim(cxios_context)//"_crs" ) !
       ENDIF
Index: /NEMO/branches/2020/tickets_icb_1900/src/OCE/timing.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OCE/timing.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OCE/timing.F90	(revision 14012)
@@ -109,5 +109,5 @@
 
       s_timer%l_tdone = .FALSE.
-      s_timer%niter = s_timer%niter + 1
+      IF( ntile == 0 .OR. ntile == 1 ) s_timer%niter = s_timer%niter + 1      ! All tiles count as one iteration
       s_timer%t_cpu = 0.
       s_timer%t_clock = 0.
Index: /NEMO/branches/2020/tickets_icb_1900/src/OFF/dtadyn.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OFF/dtadyn.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OFF/dtadyn.F90	(revision 14012)
@@ -46,5 +46,5 @@
    USE fldread         ! read input fields 
    USE timing          ! Timing
-   USE trc, ONLY : ln_rsttr, numrtr, numrtw, lrst_trc
+   USE trc, ONLY : ln_rsttr, lrst_trc
 
    IMPLICIT NONE
@@ -795,5 +795,5 @@
       !!---------------------------------------------------------------------
       INTEGER ,                              INTENT(in ) :: kt       ! time step
-      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in ) :: pts      ! temperature/salinity
+      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(inout) :: pts      ! temperature/salinity
       REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(out) :: puslp    ! zonal isopycnal slopes
       REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(out) :: pvslp    ! meridional isopycnal slopes
Index: /NEMO/branches/2020/tickets_icb_1900/src/OFF/nemogcm.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/OFF/nemogcm.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/OFF/nemogcm.F90	(revision 14012)
@@ -126,4 +126,10 @@
          ENDIF
          !
+      IF((istp == nitrst) .AND. lwxios) THEN
+         CALL iom_swap(      cw_toprst_cxt          )
+         CALL iom_init_closedef(cw_toprst_cxt)
+         CALL iom_setkt( istp - nit000 + 1,      cw_toprst_cxt          )
+      ENDIF
+
          IF( istp /= nit000 )   CALL day        ( istp )         ! Calendar (day was already called at nit000 in day_init)
                                 CALL iom_setkt  ( istp - nit000 + 1, cxios_context )   ! say to iom that we are at time step kstp
@@ -340,5 +346,5 @@
                            CALL     eos_init        ! Equation of state
       IF( lk_c1d       )   CALL     c1d_init        ! 1D column configuration
-                           CALL     dom_init( Nbb, Nnn, Naa, "OPA") ! Domain
+                           CALL     dom_init( Nbb, Nnn, Naa ) ! Domain
       IF( sn_cfctl%l_prtctl )   &
          &                 CALL prt_ctl_init        ! Print control
Index: /NEMO/branches/2020/tickets_icb_1900/src/SAO/nemogcm.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/SAO/nemogcm.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/SAO/nemogcm.F90	(revision 14012)
@@ -235,5 +235,5 @@
                            CALL phy_cst            ! Physical constants
                            CALL eos_init           ! Equation of state
-                           CALL dom_init( Nbb, Nnn, Naa, 'SAO')    ! Domain
+                           CALL dom_init( Nbb, Nnn, Naa )    ! Domain
 
 
Index: /NEMO/branches/2020/tickets_icb_1900/src/SAS/nemogcm.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/SAS/nemogcm.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/SAS/nemogcm.F90	(revision 14012)
@@ -375,5 +375,5 @@
      CALL Agrif_Declare_Var_ini   !  "      "   "   "      "  DOM
 #endif
-                           CALL dom_init( Nbb, Nnn, Naa, 'SAS') ! Domain
+                           CALL dom_init( Nbb, Nnn, Naa ) ! Domain
       IF( sn_cfctl%l_prtctl )   &
          &                 CALL prt_ctl_init        ! Print control
Index: /NEMO/branches/2020/tickets_icb_1900/src/SAS/step.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/SAS/step.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/SAS/step.F90	(revision 14012)
@@ -89,6 +89,24 @@
 #endif   
       IF( kstp == nit000 )   CALL iom_init( cxios_context ) ! iom_put initialization (must be done after nemo_init for AGRIF+XIOS+OASIS)
+                             CALL iom_setkt( kstp - nit000 + 1, cxios_context )   ! tell iom we are at time step kstp
+      IF((kstp == nitrst) .AND. lwxios) THEN
+         CALL iom_swap(      cw_ocerst_cxt          )
+         CALL iom_init_closedef(cw_ocerst_cxt)
+         CALL iom_setkt( kstp - nit000 + 1,      cw_ocerst_cxt          )
+#if defined key_top
+         CALL iom_swap(      cw_toprst_cxt          )
+         CALL iom_init_closedef(cw_toprst_cxt)
+         CALL iom_setkt( kstp - nit000 + 1,      cw_toprst_cxt          )
+#endif
+      ENDIF
       IF( kstp /= nit000 )   CALL day( kstp )             ! Calendar (day was already called at nit000 in day_init)
-                             CALL iom_setkt( kstp - nit000 + 1, cxios_context )   ! tell iom we are at time step kstp
+
+#if defined key_si3
+      IF(((kstp + nn_fsbc - 1) == nitrst) .AND. lwxios) THEN
+         CALL iom_swap(      cw_icerst_cxt          )
+         CALL iom_init_closedef(cw_icerst_cxt)
+         CALL iom_setkt( kstp - nit000 + 1,      cw_icerst_cxt          )
+      ENDIF
+#endif
 
       ! ==> clem: open boundaries is mandatory for sea-ice because ice BDY is not decoupled from  
@@ -128,5 +146,8 @@
       ! File manipulation at the end of the first time step
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<                         
-      IF( kstp == nit000   ) CALL iom_close( numror )                          ! close input  ocean restart file
+      IF( kstp == nit000   ) THEN
+            CALL iom_close( numror )                          ! close input  ocean restart file
+            IF( lrxios )     CALL iom_context_finalize(      cr_ocerst_cxt      )
+      ENDIF
       
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@@ -140,5 +161,7 @@
             CALL iom_close( numrow )     
          ELSE
-            CALL iom_context_finalize( cwxios_context )
+            CALL iom_context_finalize( cw_ocerst_cxt )
+            iom_file(numrow)%nfid       = 0
+            numrow = 0
          ENDIF
          lrst_oce = .FALSE.
Index: /NEMO/branches/2020/tickets_icb_1900/src/SWE/domain.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/SWE/domain.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/SWE/domain.F90	(revision 14012)
@@ -66,5 +66,5 @@
 CONTAINS
 
-   SUBROUTINE dom_init( Kbb, Kmm, Kaa, cdstr )
+   SUBROUTINE dom_init( Kbb, Kmm, Kaa )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE dom_init  ***
@@ -82,5 +82,4 @@
       !!----------------------------------------------------------------------
       INTEGER          , INTENT(in) :: Kbb, Kmm, Kaa          ! ocean time level indices
-      CHARACTER (len=*), INTENT(in) :: cdstr                  ! model: NEMO or SAS. Determines core restart variables
       !
 !!st6
@@ -135,17 +134,4 @@
       CALL dom_nam                     ! read namelist ( namrun, namdom )
       !
-      IF( lwxios ) THEN
-!define names for restart write and set core output (restart.F90)
-         CALL iom_set_rst_vars(rst_wfields)
-         CALL iom_set_rstw_core(cdstr)
-      ENDIF
-!reset namelist for SAS
-      IF(cdstr == 'SAS') THEN
-         IF(lrxios) THEN
-               IF(lwp) write(numout,*) 'Disable reading restart file using XIOS for SAS'
-               lrxios = .FALSE.
-         ENDIF
-      ENDIF
-      !
       CALL dom_hgr                      ! Horizontal mesh
 
Index: /NEMO/branches/2020/tickets_icb_1900/src/SWE/domvvl.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/SWE/domvvl.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/SWE/domvvl.F90	(revision 14012)
@@ -1105,5 +1105,5 @@
          IF( ln_rstart ) THEN                   !* Read the restart file
             CALL rst_read_open                  !  open the restart file if necessary
-            CALL iom_get( numror, jpdom_auto, 'sshn'   , ssh(:,:,Kmm), ldxios = lrxios    )
+            CALL iom_get( numror, jpdom_auto, 'sshn'   , ssh(:,:,Kmm)    )
             !
             id1 = iom_varid( numror, 'e3t_b', ldstop = .FALSE. )
@@ -1118,6 +1118,6 @@
             !
             IF( MIN( id1, id2 ) > 0 ) THEN       ! all required arrays exist
-               CALL iom_get( numror, jpdom_auto, 'e3t_b', e3t(:,:,:,Kbb), ldxios = lrxios )
-               CALL iom_get( numror, jpdom_auto, 'e3t_n', e3t(:,:,:,Kmm), ldxios = lrxios )
+               CALL iom_get( numror, jpdom_auto, 'e3t_b', e3t(:,:,:,Kbb) )
+               CALL iom_get( numror, jpdom_auto, 'e3t_n', e3t(:,:,:,Kmm) )
                ! needed to restart if land processor not computed 
                IF(lwp) write(numout,*) 'dom_vvl_rst : e3t(:,:,:,Kbb) and e3t(:,:,:,Kmm) found in restart files'
@@ -1133,5 +1133,5 @@
                IF(lwp) write(numout,*) 'e3t_n set equal to e3t_b.'
                IF(lwp) write(numout,*) 'l_1st_euler is forced to true'
-               CALL iom_get( numror, jpdom_auto, 'e3t_b', e3t(:,:,:,Kbb), ldxios = lrxios )
+               CALL iom_get( numror, jpdom_auto, 'e3t_b', e3t(:,:,:,Kbb) )
                e3t(:,:,:,Kmm) = e3t(:,:,:,Kbb)
                l_1st_euler = .true.
@@ -1140,5 +1140,5 @@
                IF(lwp) write(numout,*) 'e3t_b set equal to e3t_n.'
                IF(lwp) write(numout,*) 'l_1st_euler is forced to true'
-               CALL iom_get( numror, jpdom_auto, 'e3t_n', e3t(:,:,:,Kmm), ldxios = lrxios )
+               CALL iom_get( numror, jpdom_auto, 'e3t_n', e3t(:,:,:,Kmm) )
                e3t(:,:,:,Kbb) = e3t(:,:,:,Kmm)
                l_1st_euler = .true.
@@ -1165,6 +1165,6 @@
                !                          ! ----------------------- !
                IF( MIN( id3, id4 ) > 0 ) THEN  ! all required arrays exist
-                  CALL iom_get( numror, jpdom_auto, 'tilde_e3t_b', tilde_e3t_b(:,:,:), ldxios = lrxios )
-                  CALL iom_get( numror, jpdom_auto, 'tilde_e3t_n', tilde_e3t_n(:,:,:), ldxios = lrxios )
+                  CALL iom_get( numror, jpdom_auto, 'tilde_e3t_b', tilde_e3t_b(:,:,:) )
+                  CALL iom_get( numror, jpdom_auto, 'tilde_e3t_n', tilde_e3t_n(:,:,:) )
                ELSE                            ! one at least array is missing
                   tilde_e3t_b(:,:,:) = 0.0_wp
@@ -1175,5 +1175,5 @@
                   !                       ! ------------ !
                   IF( id5 > 0 ) THEN  ! required array exists
-                     CALL iom_get( numror, jpdom_auto, 'hdiv_lf', hdiv_lf(:,:,:), ldxios = lrxios )
+                     CALL iom_get( numror, jpdom_auto, 'hdiv_lf', hdiv_lf(:,:,:) )
                   ELSE                ! array is missing
                      hdiv_lf(:,:,:) = 0.0_wp
@@ -1251,23 +1251,21 @@
          !                                   ! ===================
          IF(lwp) WRITE(numout,*) '---- dom_vvl_rst ----'
-         IF( lwxios ) CALL iom_swap(      cwxios_context          )
          !                                           ! --------- !
          !                                           ! all cases !
          !                                           ! --------- !
-         CALL iom_rstput( kt, nitrst, numrow, 'e3t_b', e3t(:,:,:,Kbb), ldxios = lwxios )
-         CALL iom_rstput( kt, nitrst, numrow, 'e3t_n', e3t(:,:,:,Kmm), ldxios = lwxios )
+         CALL iom_rstput( kt, nitrst, numrow, 'e3t_b', e3t(:,:,:,Kbb) )
+         CALL iom_rstput( kt, nitrst, numrow, 'e3t_n', e3t(:,:,:,Kmm) )
          !                                           ! ----------------------- !
          IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN  ! z_tilde and layer cases !
             !                                        ! ----------------------- !
-            CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_b', tilde_e3t_b(:,:,:), ldxios = lwxios)
-            CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_n', tilde_e3t_n(:,:,:), ldxios = lwxios)
+            CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_b', tilde_e3t_b(:,:,:))
+            CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_n', tilde_e3t_n(:,:,:))
          END IF
          !                                           ! -------------!    
          IF( ln_vvl_ztilde ) THEN                    ! z_tilde case !
             !                                        ! ------------ !
-            CALL iom_rstput( kt, nitrst, numrow, 'hdiv_lf', hdiv_lf(:,:,:), ldxios = lwxios)
+            CALL iom_rstput( kt, nitrst, numrow, 'hdiv_lf', hdiv_lf(:,:,:))
          ENDIF
          !
-         IF( lwxios ) CALL iom_swap(      cxios_context          )
       ENDIF
       !
Index: /NEMO/branches/2020/tickets_icb_1900/src/SWE/nemogcm.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/SWE/nemogcm.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/SWE/nemogcm.F90	(revision 14012)
@@ -383,5 +383,5 @@
                            CALL     phy_cst         ! Physical constants
                            
-                           CALL     dom_init( Nbb, Nnn, Naa, "OPA") ! Domain
+                           CALL     dom_init( Nbb, Nnn, Naa ) ! Domain
 
       IF( sn_cfctl%l_prtctl )   &
Index: /NEMO/branches/2020/tickets_icb_1900/src/SWE/step.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/SWE/step.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/SWE/step.F90	(revision 14012)
@@ -304,5 +304,5 @@
       IF( kstp == nitend .OR. indic < 0 ) THEN 
                       CALL iom_context_finalize(      cxios_context          ) ! needed for XIOS+AGRIF
-                      IF(lrxios) CALL iom_context_finalize(      crxios_context          )
+                      IF(lrxios) CALL iom_context_finalize(      cr_ocerst_cxt          )
       ENDIF
 #endif
Index: /NEMO/branches/2020/tickets_icb_1900/src/SWE/stepLF.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/SWE/stepLF.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/SWE/stepLF.F90	(revision 14012)
@@ -318,5 +318,5 @@
       IF( kstp == nitend .OR. indic < 0 ) THEN 
                       CALL iom_context_finalize(      cxios_context          ) ! needed for XIOS+AGRIF
-                      IF(lrxios) CALL iom_context_finalize(      crxios_context          )
+                      IF(lrxios) CALL iom_context_finalize(      cr_ocerst_cxt          )
       ENDIF
 #endif
Index: /NEMO/branches/2020/tickets_icb_1900/src/SWE/stpRK3.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/SWE/stpRK3.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/SWE/stpRK3.F90	(revision 14012)
@@ -361,5 +361,5 @@
       IF( kstp == nitend .OR. indic < 0 ) THEN 
                       CALL iom_context_finalize(      cxios_context          ) ! needed for XIOS+AGRIF
-                      IF(lrxios) CALL iom_context_finalize(      crxios_context          )
+                      IF(lrxios) CALL iom_context_finalize(      cr_ocerst_cxt          )
       ENDIF
 #endif
Index: /NEMO/branches/2020/tickets_icb_1900/src/TOP/C14/trcsms_c14.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/TOP/C14/trcsms_c14.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/TOP/C14/trcsms_c14.F90	(revision 14012)
@@ -144,9 +144,9 @@
          IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~'
          !
-         CALL iom_rstput( kt, nitrst, numrtw, 'co2sbc', co2sbc )       ! These five need      &
-         CALL iom_rstput( kt, nitrst, numrtw, 'c14sbc', c14sbc )     ! &    to be written   &
+         CALL iom_rstput( kt, nitrst, numrtw, 'co2sbc', co2sbc ) ! These five need      &
+         CALL iom_rstput( kt, nitrst, numrtw, 'c14sbc', c14sbc ) ! &    to be written   &
          CALL iom_rstput( kt, nitrst, numrtw, 'exch_co2', exch_co2 ) ! &    for temporal    &
          CALL iom_rstput( kt, nitrst, numrtw, 'exch_c14', exch_c14 ) ! &    averages        &
-         CALL iom_rstput( kt, nitrst, numrtw, 'qtr_c14', qtr_c14 )   ! &    to be coherent.
+         CALL iom_rstput( kt, nitrst, numrtw, 'qtr_c14', qtr_c14   ) ! &    to be coherent.
          CALL iom_rstput( kt, nitrst, numrtw, 'qint_c14', qint_c14 ) ! Cumulative
          !
Index: /NEMO/branches/2020/tickets_icb_1900/src/TOP/PISCES/P4Z/p4zsms.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/TOP/PISCES/P4Z/p4zsms.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/TOP/PISCES/P4Z/p4zsms.F90	(revision 14012)
@@ -369,6 +369,6 @@
             IF(lwp) WRITE(numout,*) '~~~~~~~'
          ENDIF
-         CALL iom_rstput( kt, nitrst, numrtw, 'PH', hi(:,:,:) )
-         CALL iom_rstput( kt, nitrst, numrtw, 'Silicalim', xksi(:,:) )
+         CALL iom_rstput( kt, nitrst, numrtw, 'PH', hi(:,:,:)           )
+         CALL iom_rstput( kt, nitrst, numrtw, 'Silicalim', xksi(:,:)    )
          CALL iom_rstput( kt, nitrst, numrtw, 'Silicamax', xksimax(:,:) )
          CALL iom_rstput( kt, nitrst, numrtw, 'tcflxcum', t_oce_co2_flx_cum )
Index: /NEMO/branches/2020/tickets_icb_1900/src/TOP/PISCES/SED/sed.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/TOP/PISCES/SED/sed.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/TOP/PISCES/SED/sed.F90	(revision 14012)
@@ -44,5 +44,4 @@
    REAL    , PUBLIC               ::  sedmask
    REAL(wp), PUBLIC               ::  denssol                !: density of solid material
-   INTEGER , PUBLIC               ::  numrsr, numrsw   !: logical unit for sed restart (read and write)
    LOGICAL , PUBLIC               ::  lrst_sed       !: logical to control the trc restart write
    LOGICAL , PUBLIC               ::  ln_rst_sed  = .TRUE.     !: initialisation from a restart file or not
Index: /NEMO/branches/2020/tickets_icb_1900/src/TOP/PISCES/SED/sedrst.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/TOP/PISCES/SED/sedrst.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/TOP/PISCES/SED/sedrst.F90	(revision 14012)
@@ -42,4 +42,5 @@
       CHARACTER(LEN=50)   ::   clname   ! trc output restart file name
       CHARACTER(LEN=256)  ::   clpath   ! full path to ocean output restart file
+      CHARACTER(LEN=52)   ::   clpname   ! trc output restart file name including AGRIF
       !!----------------------------------------------------------------------
       !
@@ -80,5 +81,22 @@
          IF(lwp) WRITE(numsed,*) &
              '             open sed restart.output NetCDF file: ',TRIM(clpath)//clname
-         CALL iom_open( TRIM(clpath)//TRIM(clname), numrsw, ldwrt = .TRUE., kdlev = jpksed, cdcomp = 'SED' )
+         IF(.NOT.lwxios) THEN
+            CALL iom_open( TRIM(clpath)//TRIM(clname), numrsw, ldwrt = .TRUE., kdlev = jpksed, cdcomp = 'SED' )
+         ELSE
+#if defined key_iomput
+            cw_sedrst_cxt = "rstws_"//TRIM(ADJUSTL(clkt))
+            IF( TRIM(Agrif_CFixed()) == '0' ) THEN
+               clpname = clname
+            ELSE
+               clpname = TRIM(Agrif_CFixed())//"_"//clname
+            ENDIF
+            numrsw = iom_xios_setid(TRIM(clpath)//TRIM(clpname))
+            CALL iom_init( cw_sedrst_cxt, kdid = numrsw, ld_closedef = .FALSE. )
+#else
+               clinfo = 'Can not use XIOS in trc_rst_opn'
+               CALL ctl_stop(TRIM(clinfo))
+#endif
+            ENDIF
+
          lrst_sed = .TRUE.
       ENDIF
@@ -196,5 +214,4 @@
       CALL pack_arr( jpoce, sedligand(1:jpoce,1:jpksed), &
          &             zdta2(1:jpi,1:jpj,1:jpksed), iarroce(1:jpoce) )
-
       IF( ln_timing )  CALL timing_stop('sed_rst_read')
      
@@ -240,7 +257,6 @@
       !! 1. WRITE in nutwrs
       !! ------------------
-
-      zinfo(1) = REAL( kt)
-      CALL iom_rstput( kt, nitrst, numrsw, 'kt', zinfo  )
+!     zinfo(1) = REAL( kt)
+      CALL iom_rstput( kt, nitrst, numrsw, 'kt', REAL( kt    , wp) )
 
       ! Back to 2D geometry
@@ -299,5 +315,11 @@
 
       IF( kt == nitrst ) THEN
-          CALL iom_close( numrsw )     ! close the restart file (only at last time step)
+          IF(.NOT.lwxios) THEN
+             CALL iom_close( numrsw )     ! close the restart file (only at last time step)
+          ELSE
+             CALL iom_context_finalize( cw_sedrst_cxt ) 
+             iom_file(numrsw)%nfid       = 0
+             numrsw = 0
+          ENDIF
           IF( l_offline .AND. ln_rst_list ) THEN
              nrst_lst = nrst_lst + 1
@@ -342,4 +364,5 @@
       REAL(wp) ::  zkt, zrdttrc1
       REAL(wp) ::  zndastp
+      CHARACTER(len = 82) :: clpname
 
       ! Time domain : restart
@@ -353,7 +376,18 @@
 
          IF( ln_rst_sed ) THEN
+            lxios_sini = .FALSE.
             CALL iom_open( TRIM(cn_sedrst_indir)//'/'//cn_sedrst_in, numrsr )
+
+            IF( lrxios) THEN
+                cr_sedrst_cxt = 'sed_rst'
+                IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS for SED'
+!               IF( TRIM(Agrif_CFixed()) == '0' ) THEN
+!                  clpname = cn_sedrst_in
+!               ELSE
+!                  clpname = TRIM(Agrif_CFixed())//"_"//cn_sedrst_in   
+!               ENDIF
+                CALL iom_init( cr_sedrst_cxt, kdid = numrsr, ld_closedef = .TRUE. )
+            ENDIF
             CALL iom_get ( numrsr, 'kt', zkt )   ! last time-step of previous run
-
             IF(lwp) THEN
                WRITE(numsed,*) ' *** Info read in restart : '
@@ -402,9 +436,10 @@
             IF(lwp) WRITE(numsed,*) 'trc_wri : write the TOP restart file (NetCDF) at it= ', kt, ' date= ', ndastp
             IF(lwp) WRITE(numsed,*) '~~~~~~~'
+            IF( lwxios ) CALL iom_init_closedef(cw_sedrst_cxt)
          ENDIF
          CALL iom_rstput( kt, nitrst, numrsw, 'kt'     , REAL( kt    , wp) )   ! time-step
          CALL iom_rstput( kt, nitrst, numrsw, 'ndastp' , REAL( ndastp, wp) )   ! date
-         CALL iom_rstput( kt, nitrst, numrsw, 'adatrj' , adatrj            )   ! number of elapsed days since
-         !                                                                     ! the begining of the run [s]
+         CALL iom_rstput( kt, nitrst, numrsw, 'adatrj' , adatrj )   ! number of elapsed days since
+         !                                                                                      ! the begining of the run [s]
       ENDIF
 
Index: /NEMO/branches/2020/tickets_icb_1900/src/TOP/PISCES/SED/sedstp.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/TOP/PISCES/SED/sedstp.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/TOP/PISCES/SED/sedstp.F90	(revision 14012)
@@ -86,5 +86,6 @@
       IF( kt == nitsed000 ) THEN
           CALL iom_close( numrsr )       ! close input tracer restart file
-!          IF(lwm) CALL FLUSH( numont )   ! flush namelist output
+          IF(lrxios) CALL iom_context_finalize(      cr_sedrst_cxt  )
+!         IF(lwm) CALL FLUSH( numont )   ! flush namelist output
       ENDIF
       IF( lrst_sed )            CALL sed_rst_wri( kt )   ! restart file output
Index: /NEMO/branches/2020/tickets_icb_1900/src/TOP/TRP/trcadv.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/TOP/TRP/trcadv.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/TOP/TRP/trcadv.F90	(revision 14012)
@@ -22,5 +22,7 @@
    USE traadv_cen     ! centered scheme           (tra_adv_cen  routine)
    USE traadv_fct     ! FCT      scheme           (tra_adv_fct  routine)
+   USE traadv_fct_lf  ! FCT      scheme           (tra_adv_fct  routine - loop fusion version)
    USE traadv_mus     ! MUSCL    scheme           (tra_adv_mus  routine)
+   USE traadv_mus_lf  ! MUSCL    scheme           (tra_adv_mus  routine - loop fusion version)
    USE traadv_ubs     ! UBS      scheme           (tra_adv_ubs  routine)
    USE traadv_qck     ! QUICKEST scheme           (tra_adv_qck  routine)
@@ -124,12 +126,37 @@
       !
       CASE ( np_CEN )                                 ! Centered : 2nd / 4th order
+         IF (nn_hls.EQ.2) CALL lbc_lnk( 'trcadv', ptr(:,:,:,:,Kmm), 'T', 1.)
          CALL tra_adv_cen( kt, nittrc000,'TRC',          zuu, zvv, zww,      Kmm, ptr, jptra, Krhs, nn_cen_h, nn_cen_v )
       CASE ( np_FCT )                                 ! FCT      : 2nd / 4th order
-         CALL tra_adv_fct( kt, nittrc000,'TRC', rDt_trc, zuu, zvv, zww, Kbb, Kmm, ptr, jptra, Krhs, nn_fct_h, nn_fct_v )
+         IF (nn_hls.EQ.2) THEN
+            CALL lbc_lnk_multi( 'trcadv', ptr(:,:,:,:,Kbb), 'T', 1., ptr(:,:,:,:,Kmm), 'T', 1.)
+            CALL lbc_lnk_multi( 'traadv', zuu(:,:,:), 'U', -1., zvv(:,:,:), 'V', -1., zww(:,:,:), 'W', 1.)
+#if defined key_loop_fusion
+            CALL tra_adv_fct_lf( kt, nittrc000,'TRC', rDt_trc, zuu, zvv, zww, Kbb, Kmm, ptr, jptra, Krhs, nn_fct_h, nn_fct_v )
+#else
+            CALL tra_adv_fct( kt, nittrc000,'TRC', rDt_trc, zuu, zvv, zww, Kbb, Kmm, ptr, jptra, Krhs, nn_fct_h, nn_fct_v )
+#endif
+         ELSE
+            CALL tra_adv_fct( kt, nittrc000,'TRC', rDt_trc, zuu, zvv, zww, Kbb, Kmm, ptr, jptra, Krhs, nn_fct_h, nn_fct_v )
+         END IF
       CASE ( np_MUS )                                 ! MUSCL
-         CALL tra_adv_mus( kt, nittrc000,'TRC', rDt_trc, zuu, zvv, zww, Kbb, Kmm, ptr, jptra, Krhs, ln_mus_ups         ) 
+         IF (nn_hls.EQ.2) THEN
+            IF (nn_hls.EQ.2) CALL lbc_lnk( 'trcadv', ptr(:,:,:,:,Kbb), 'T', 1.)
+#if defined key_loop_fusion
+            CALL tra_adv_mus_lf( kt, nittrc000,'TRC', rDt_trc, zuu, zvv, zww, Kbb, Kmm, ptr, jptra, Krhs, ln_mus_ups ) 
+#else
+            CALL tra_adv_mus( kt, nittrc000,'TRC', rDt_trc, zuu, zvv, zww, Kbb, Kmm, ptr, jptra, Krhs, ln_mus_ups ) 
+#endif
+         ELSE
+            CALL tra_adv_mus( kt, nittrc000,'TRC', rDt_trc, zuu, zvv, zww, Kbb, Kmm, ptr, jptra, Krhs, ln_mus_ups ) 
+         END IF
       CASE ( np_UBS )                                 ! UBS
+         IF (nn_hls.EQ.2) CALL lbc_lnk( 'trcadv', ptr(:,:,:,:,Kbb), 'T', 1.)
          CALL tra_adv_ubs( kt, nittrc000,'TRC', rDt_trc, zuu, zvv, zww, Kbb, Kmm, ptr, jptra, Krhs, nn_ubs_v           )
       CASE ( np_QCK )                                 ! QUICKEST
+         IF (nn_hls.EQ.2) THEN
+            CALL lbc_lnk_multi( 'trcadv', zuu(:,:,:), 'U', -1., zvv(:,:,:), 'V', -1.)
+            CALL lbc_lnk( 'traadv', ptr(:,:,:,:,Kbb), 'T', 1.)
+         END IF
          CALL tra_adv_qck( kt, nittrc000,'TRC', rDt_trc, zuu, zvv, zww, Kbb, Kmm, ptr, jptra, Krhs                     )
       !
Index: /NEMO/branches/2020/tickets_icb_1900/src/TOP/TRP/trcldf.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/TOP/TRP/trcldf.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/TOP/TRP/trcldf.F90	(revision 14012)
@@ -101,4 +101,5 @@
            &                     ptr(:,:,:,:,Kbb), ptr(:,:,:,:,Kbb), ptr(:,:,:,:,Krhs), jptra, 1 )
       CASE ( np_blp , np_blp_i , np_blp_it )                                                               ! bilaplacian: all operator (iso-level, -neutral)
+         IF(nn_hls.EQ.2) CALL lbc_lnk( 'trc_ldf', ptr(:,:,:,:,Kbb), 'T',1.)
          CALL tra_ldf_blp  ( kt, Kmm, nittrc000,'TRC', zahu, zahv, gtru, gtrv, gtrui, gtrvi,            &
            &                     ptr(:,:,:,:,Kbb) , ptr(:,:,:,:,Krhs),                 jptra, nldf_trc )
Index: /NEMO/branches/2020/tickets_icb_1900/src/TOP/trc.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/TOP/trc.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/TOP/trc.F90	(revision 14012)
@@ -21,6 +21,4 @@
    INTEGER, PUBLIC ::   numonr     = -1   !: reference passive tracer namelist output output.namelist.top
    INTEGER, PUBLIC ::   numstr            !: tracer statistics
-   INTEGER, PUBLIC ::   numrtr     = -1   !: trc restart (read )
-   INTEGER, PUBLIC ::   numrtw            !: trc restart ( write )
    CHARACTER(:), ALLOCATABLE, PUBLIC ::   numnat_ref   !: character buffer for reference passive tracer namelist_top_ref
    CHARACTER(:), ALLOCATABLE, PUBLIC ::   numnat_cfg   !: character buffer for configuration specific passive tracer namelist_top_cfg
Index: /NEMO/branches/2020/tickets_icb_1900/src/TOP/trcrst.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/TOP/trcrst.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/TOP/trcrst.F90	(revision 14012)
@@ -52,4 +52,5 @@
       CHARACTER(LEN=50)   ::   clname   ! trc output restart file name
       CHARACTER(LEN=256)  ::   clpath   ! full path to ocean output restart file
+      CHARACTER(LEN=50)   ::   clpname  ! trc output restart file name including AGRIF
       !!----------------------------------------------------------------------
       !
@@ -91,5 +92,21 @@
          IF(lwp) WRITE(numout,*) &
              '             open trc restart.output NetCDF file: ',TRIM(clpath)//clname
-         CALL iom_open( TRIM(clpath)//TRIM(clname), numrtw, ldwrt = .TRUE. )
+         IF(.NOT.lwxios) THEN
+            CALL iom_open( TRIM(clpath)//TRIM(clname), numrtw, ldwrt = .TRUE. )
+         ELSE
+#if defined key_iomput
+            cw_toprst_cxt = "rstwt_"//TRIM(ADJUSTL(clkt))
+            IF( TRIM(Agrif_CFixed()) == '0' ) THEN
+               clpname = clname
+            ELSE
+               clpname = TRIM(Agrif_CFixed())//"_"//clname
+            ENDIF
+            numrtw = iom_xios_setid(TRIM(clpath)//TRIM(clpname))
+            CALL iom_init( cw_toprst_cxt, kdid = numrtw, ld_closedef = .FALSE. )
+#else
+               clinfo = 'Can not use XIOS in trc_rst_opn'
+               CALL ctl_stop(TRIM(clinfo))
+#endif
+            ENDIF
          lrst_trc = .TRUE.
       ENDIF
@@ -121,6 +138,5 @@
       END DO
       !
-      CALL iom_delay_rst( 'READ', 'TOP', numrtr )   ! read only TOP delayed global communication variables
-      
+      IF(.NOT.lrxios) CALL iom_delay_rst( 'READ', 'TOP', numrtr )   ! read only TOP delayed global communication variables
    END SUBROUTINE trc_rst_read
 
@@ -147,10 +163,16 @@
          CALL iom_rstput( kt, nitrst, numrtw, 'TRB'//ctrcnm(jn), tr(:,:,:,jn,Kbb) )
       END DO
-      !
-      CALL iom_delay_rst( 'WRITE', 'TOP', numrtw )   ! save only TOP delayed global communication variables
+
+      IF( .NOT. lwxios ) CALL iom_delay_rst( 'WRITE', 'TOP', numrtw )   ! save only TOP delayed global communication variables
     
       IF( kt == nitrst ) THEN
           CALL trc_rst_stat( Kmm, Krhs )             ! statistics
-          CALL iom_close( numrtw )     ! close the restart file (only at last time step)
+          IF(lwxios) THEN
+             CALL iom_context_finalize(      cw_toprst_cxt          )
+             iom_file(numrtw)%nfid       = 0
+             numrtw = 0
+          ELSE
+             CALL iom_close( numrtw )     ! close the restart file (only at last time step)
+          ENDIF
 #if ! defined key_trdmxl_trc
           lrst_trc = .FALSE.
@@ -196,4 +218,5 @@
       REAL(wp) ::  zrdttrc1, zkt, zndastp, zdayfrac, ksecs, ktime
       INTEGER  ::   ihour, iminute
+      CHARACTER(len=82) :: clpname
 
       ! Time domain : restart
@@ -207,5 +230,17 @@
 
          IF( ln_rsttr ) THEN
+            lxios_sini = .FALSE.
             CALL iom_open( TRIM(cn_trcrst_indir)//'/'//cn_trcrst_in, numrtr )
+            IF( lrxios) THEN
+                cr_toprst_cxt = 'top_rst'
+                IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS for TOP'
+!               IF( TRIM(Agrif_CFixed()) == '0' ) THEN
+!                  clpname = cn_trcrst_in
+!               ELSE
+!                  clpname = TRIM(Agrif_CFixed())//"_"//cn_trcrst_in   
+!               ENDIF
+                CALL iom_init( cr_toprst_cxt, kdid = numrtr, ld_closedef = .TRUE. )
+            ENDIF
+
             CALL iom_get ( numrtr, 'kt', zkt )   ! last time-step of previous run
 
@@ -293,9 +328,9 @@
             IF(lwp) WRITE(numout,*) '~~~~~~~'
          ENDIF
-         CALL iom_rstput( kt, nitrst, numrtw, 'kt'     , REAL( kt    , wp) )   ! time-step
-         CALL iom_rstput( kt, nitrst, numrtw, 'ndastp' , REAL( ndastp, wp) )   ! date
-         CALL iom_rstput( kt, nitrst, numrtw, 'adatrj' , adatrj            )   ! number of elapsed days since
+         CALL iom_rstput( kt, nitrst, numrtw, 'kt'     , REAL( kt    , wp)   )   ! time-step
+         CALL iom_rstput( kt, nitrst, numrtw, 'ndastp' , REAL( ndastp, wp)   )   ! date
+         CALL iom_rstput( kt, nitrst, numrtw, 'adatrj' , adatrj              )   ! number of elapsed days since
          !                                                                     ! the begining of the run [s]
-         CALL iom_rstput( kt, nitrst, numrtw, 'ntime'  , REAL( nn_time0, wp)) ! time
+         CALL iom_rstput( kt, nitrst, numrtw, 'ntime'  , REAL( nn_time0, wp) ) ! time
       ENDIF
 
Index: /NEMO/branches/2020/tickets_icb_1900/src/TOP/trcstp.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/src/TOP/trcstp.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/src/TOP/trcstp.F90	(revision 14012)
@@ -110,4 +110,5 @@
       IF( kt == nittrc000 ) THEN
          CALL iom_close( numrtr )                         ! close input tracer restart file
+         IF(lrxios) CALL iom_context_finalize(      cr_toprst_cxt          )
          IF(lwm) CALL FLUSH( numont )                     ! flush namelist output
       ENDIF
@@ -196,5 +197,4 @@
            &                              .AND. iom_varid( numrtr, 'ktdcy'    , ldstop = .FALSE. ) > 0  &
            &                              .AND. iom_varid( numrtr, 'nrdcy'    , ldstop = .FALSE. ) > 0  ) THEN
-
             CALL iom_get( numrtr, 'ktdcy', zkt )  
             rsecfst = INT( zkt ) * rn_Dt
Index: /NEMO/branches/2020/tickets_icb_1900/tests/CANAL/MY_SRC/domvvl.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/tests/CANAL/MY_SRC/domvvl.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/tests/CANAL/MY_SRC/domvvl.F90	(revision 14012)
@@ -282,22 +282,4 @@
       ENDIF
       !
-      IF(lwxios) THEN
-! define variables in restart file when writing with XIOS
-         CALL iom_set_rstw_var_active('e3t_b')
-         CALL iom_set_rstw_var_active('e3t_n')
-         !                                           ! ----------------------- !
-         IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN  ! z_tilde and layer cases !
-            !                                        ! ----------------------- !
-            CALL iom_set_rstw_var_active('tilde_e3t_b')
-            CALL iom_set_rstw_var_active('tilde_e3t_n')
-         END IF
-         !                                           ! -------------!    
-         IF( ln_vvl_ztilde ) THEN                    ! z_tilde case !
-            !                                        ! ------------ !
-            CALL iom_set_rstw_var_active('hdiv_lf')
-         ENDIF
-         !
-      ENDIF
-      !
    END SUBROUTINE dom_vvl_zgr
 
@@ -803,5 +785,5 @@
          IF( ln_rstart ) THEN                   !* Read the restart file
             CALL rst_read_open                  !  open the restart file if necessary
-            CALL iom_get( numror, jpdom_auto, 'sshn'   , ssh(:,:,Kmm), ldxios = lrxios    )
+            CALL iom_get( numror, jpdom_auto, 'sshn'   , ssh(:,:,Kmm)    )
             !
             id1 = iom_varid( numror, 'e3t_b', ldstop = .FALSE. )
@@ -816,6 +798,6 @@
             !
             IF( MIN( id1, id2 ) > 0 ) THEN       ! all required arrays exist
-               CALL iom_get( numror, jpdom_auto, 'e3t_b', e3t(:,:,:,Kbb), ldxios = lrxios )
-               CALL iom_get( numror, jpdom_auto, 'e3t_n', e3t(:,:,:,Kmm), ldxios = lrxios )
+               CALL iom_get( numror, jpdom_auto, 'e3t_b', e3t(:,:,:,Kbb) )
+               CALL iom_get( numror, jpdom_auto, 'e3t_n', e3t(:,:,:,Kmm) )
                ! needed to restart if land processor not computed 
                IF(lwp) write(numout,*) 'dom_vvl_rst : e3t(:,:,:,Kbb) and e3t(:,:,:,Kmm) found in restart files'
@@ -831,5 +813,5 @@
                IF(lwp) write(numout,*) 'e3t_n set equal to e3t_b.'
                IF(lwp) write(numout,*) 'l_1st_euler is forced to true'
-               CALL iom_get( numror, jpdom_auto, 'e3t_b', e3t(:,:,:,Kbb), ldxios = lrxios )
+               CALL iom_get( numror, jpdom_auto, 'e3t_b', e3t(:,:,:,Kbb) )
                e3t(:,:,:,Kmm) = e3t(:,:,:,Kbb)
                l_1st_euler = .true.
@@ -838,5 +820,5 @@
                IF(lwp) write(numout,*) 'e3t_b set equal to e3t_n.'
                IF(lwp) write(numout,*) 'l_1st_euler is forced to true'
-               CALL iom_get( numror, jpdom_auto, 'e3t_n', e3t(:,:,:,Kmm), ldxios = lrxios )
+               CALL iom_get( numror, jpdom_auto, 'e3t_n', e3t(:,:,:,Kmm) )
                e3t(:,:,:,Kbb) = e3t(:,:,:,Kmm)
                l_1st_euler = .true.
@@ -863,6 +845,6 @@
                !                          ! ----------------------- !
                IF( MIN( id3, id4 ) > 0 ) THEN  ! all required arrays exist
-                  CALL iom_get( numror, jpdom_auto, 'tilde_e3t_b', tilde_e3t_b(:,:,:), ldxios = lrxios )
-                  CALL iom_get( numror, jpdom_auto, 'tilde_e3t_n', tilde_e3t_n(:,:,:), ldxios = lrxios )
+                  CALL iom_get( numror, jpdom_auto, 'tilde_e3t_b', tilde_e3t_b(:,:,:) )
+                  CALL iom_get( numror, jpdom_auto, 'tilde_e3t_n', tilde_e3t_n(:,:,:) )
                ELSE                            ! one at least array is missing
                   tilde_e3t_b(:,:,:) = 0.0_wp
@@ -873,5 +855,5 @@
                   !                       ! ------------ !
                   IF( id5 > 0 ) THEN  ! required array exists
-                     CALL iom_get( numror, jpdom_auto, 'hdiv_lf', hdiv_lf(:,:,:), ldxios = lrxios )
+                     CALL iom_get( numror, jpdom_auto, 'hdiv_lf', hdiv_lf(:,:,:) )
                   ELSE                ! array is missing
                      hdiv_lf(:,:,:) = 0.0_wp
@@ -947,23 +929,21 @@
          !                                   ! ===================
          IF(lwp) WRITE(numout,*) '---- dom_vvl_rst ----'
-         IF( lwxios ) CALL iom_swap(      cwxios_context          )
          !                                           ! --------- !
          !                                           ! all cases !
          !                                           ! --------- !
-         CALL iom_rstput( kt, nitrst, numrow, 'e3t_b', e3t(:,:,:,Kbb), ldxios = lwxios )
-         CALL iom_rstput( kt, nitrst, numrow, 'e3t_n', e3t(:,:,:,Kmm), ldxios = lwxios )
+         CALL iom_rstput( kt, nitrst, numrow, 'e3t_b', e3t(:,:,:,Kbb) )
+         CALL iom_rstput( kt, nitrst, numrow, 'e3t_n', e3t(:,:,:,Kmm) )
          !                                           ! ----------------------- !
          IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN  ! z_tilde and layer cases !
             !                                        ! ----------------------- !
-            CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_b', tilde_e3t_b(:,:,:), ldxios = lwxios)
-            CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_n', tilde_e3t_n(:,:,:), ldxios = lwxios)
+            CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_b', tilde_e3t_b(:,:,:))
+            CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_n', tilde_e3t_n(:,:,:))
          END IF
          !                                           ! -------------!    
          IF( ln_vvl_ztilde ) THEN                    ! z_tilde case !
             !                                        ! ------------ !
-            CALL iom_rstput( kt, nitrst, numrow, 'hdiv_lf', hdiv_lf(:,:,:), ldxios = lwxios)
+            CALL iom_rstput( kt, nitrst, numrow, 'hdiv_lf', hdiv_lf(:,:,:))
          ENDIF
          !
-         IF( lwxios ) CALL iom_swap(      cxios_context          )
       ENDIF
       !
Index: /NEMO/branches/2020/tickets_icb_1900/tests/CANAL/MY_SRC/trazdf.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/tests/CANAL/MY_SRC/trazdf.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/tests/CANAL/MY_SRC/trazdf.F90	(revision 14012)
@@ -54,5 +54,5 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts                 ! active tracers and RHS of tracer equation
       !
-      INTEGER  ::   jk   ! Dummy loop indices
+      INTEGER  ::   ji, jj, jk   ! Dummy loop indices
       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   ztrdt, ztrds   ! 3D workspace
       !!---------------------------------------------------------------------
@@ -61,7 +61,9 @@
       !
       IF( kt == nit000 )  THEN
-         IF(lwp)WRITE(numout,*)
-         IF(lwp)WRITE(numout,*) 'tra_zdf : implicit vertical mixing on T & S'
-         IF(lwp)WRITE(numout,*) '~~~~~~~ '
+         IF( ntile == 0 .OR. ntile == 1 )  THEN                   ! Do only on the first tile
+            IF(lwp)WRITE(numout,*)
+            IF(lwp)WRITE(numout,*) 'tra_zdf : implicit vertical mixing on T & S'
+            IF(lwp)WRITE(numout,*) '~~~~~~~ '
+         ENDIF
       ENDIF
       !
@@ -83,9 +85,13 @@
 
       IF( l_trdtra )   THEN                      ! save the vertical diffusive trends for further diagnostics
-         DO jk = 1, jpkm1
-            ztrdt(:,:,jk) = ( ( pts(:,:,jk,jp_tem,Kaa)*e3t(:,:,jk,Kaa) - pts(:,:,jk,jp_tem,Kbb)*e3t(:,:,jk,Kbb) ) &
-               &          / (e3t(:,:,jk,Kmm)*rDt) ) - ztrdt(:,:,jk)
-            ztrds(:,:,jk) = ( ( pts(:,:,jk,jp_sal,Kaa)*e3t(:,:,jk,Kaa) - pts(:,:,jk,jp_sal,Kbb)*e3t(:,:,jk,Kbb) ) &
-              &           / (e3t(:,:,jk,Kmm)*rDt) ) - ztrds(:,:,jk)
+         DO jk = 1, jpk
+            ztrdt(:,:,jk) = (   (  pts(:,:,jk,jp_tem,Kaa)*e3t(:,:,jk,Kaa)     &
+               &                 - pts(:,:,jk,jp_tem,Kbb)*e3t(:,:,jk,Kbb)  )  &
+               &              / (  e3t(:,:,jk,Kmm)*rDt  )   )                 &
+               &          - ztrdt(:,:,jk)
+            ztrds(:,:,jk) = (   (  pts(:,:,jk,jp_sal,Kaa)*e3t(:,:,jk,Kaa)     &
+               &                 - pts(:,:,jk,jp_sal,Kbb)*e3t(:,:,jk,Kbb)  )  &
+               &             / (   e3t(:,:,jk,Kmm)*rDt  )   )                 &
+               &          - ztrds(:,:,jk)
          END DO
 !!gm this should be moved in trdtra.F90 and done on all trends
@@ -135,5 +141,5 @@
       INTEGER  ::  ji, jj, jk, jn   ! dummy loop indices
       REAL(wp) ::  zrhs, zzwi, zzws ! local scalars
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zwi, zwt, zwd, zws
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk) ::  zwi, zwt, zwd, zws
       !!---------------------------------------------------------------------
       !
@@ -149,6 +155,12 @@
             !
             ! vertical mixing coef.: avt for temperature, avs for salinity and passive tracers
-            IF( cdtype == 'TRA' .AND. jn == jp_tem ) THEN   ;   zwt(:,:,2:jpk) = avt(:,:,2:jpk)
-            ELSE                                            ;   zwt(:,:,2:jpk) = avs(:,:,2:jpk)
+            IF( cdtype == 'TRA' .AND. jn == jp_tem ) THEN
+               DO_3D( 1, 1, 1, 1, 2, jpk )
+                  zwt(ji,jj,jk) = avt(ji,jj,jk)
+               END_3D
+            ELSE
+               DO_3D( 1, 1, 1, 1, 2, jpk )
+                  zwt(ji,jj,jk) = avs(ji,jj,jk)
+               END_3D
             ENDIF
             zwt(:,:,1) = 0._wp
Index: /NEMO/branches/2020/tickets_icb_1900/tests/ISOMIP+/MY_SRC/dtatsd.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/tests/ISOMIP+/MY_SRC/dtatsd.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/tests/ISOMIP+/MY_SRC/dtatsd.F90	(revision 14012)
@@ -18,4 +18,5 @@
    USE phycst          ! physical constants
    USE dom_oce         ! ocean space and time domain
+   USE domain, ONLY : dom_tile
    USE fldread         ! read input fields
    !
@@ -163,21 +164,40 @@
       INTEGER                              , INTENT(in   ) ::   kt     ! ocean time-step
       CHARACTER(LEN=3)                     , INTENT(in   ) ::   cddta  ! dmp or ini
-      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(  out) ::   ptsd   ! T & S data
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk,jpts), INTENT(  out) ::   ptsd   ! T & S data
       !
       INTEGER ::   ji, jj, jk, jl, jkk   ! dummy loop indicies
       INTEGER ::   ik, il0, il1, ii0, ii1, ij0, ij1   ! local integers
+      INTEGER ::   itile
       REAL(wp)::   zl, zi                             ! local scalars
       REAL(wp), DIMENSION(jpk) ::  ztp, zsp   ! 1D workspace
       !!----------------------------------------------------------------------
       !
+      IF( ntile == 0 .OR. ntile == 1 )  THEN                                         ! Do only for the full domain
+         itile = ntile
+         IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 )            ! Use full domain
+
+         SELECT CASE(cddta)
+         CASE('ini')
+            CALL fld_read( kt, 1, sf_tsdini ) !==   read T & S data at kt time step   ==!
+         CASE('dmp')
+            CALL fld_read( kt, 1, sf_tsddmp ) !==   read T & S data at kt time step   ==!
+         CASE DEFAULT
+            CALL ctl_stop('STOP', 'dta_tsd: cddta case unknown')
+         END SELECT
+
+         IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = itile )            ! Revert to tile domain
+      ENDIF
+      !
       SELECT CASE(cddta)
-      CASE('ini') 
-         CALL fld_read( kt, 1, sf_tsdini ) !==   read T & S data at kt time step   ==!
-         ptsd(:,:,:,jp_tem) = sf_tsdini(jp_tem)%fnow(:,:,:)    ! NO mask
-         ptsd(:,:,:,jp_sal) = sf_tsdini(jp_sal)%fnow(:,:,:) 
+      CASE('ini')
+         DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpk )
+            ptsd(ji,jj,jk,jp_tem) = sf_tsdini(jp_tem)%fnow(ji,jj,jk)    ! NO mask
+            ptsd(ji,jj,jk,jp_sal) = sf_tsdini(jp_sal)%fnow(ji,jj,jk)
+         END_3D
       CASE('dmp')
-         CALL fld_read( kt, 1, sf_tsddmp ) !==   read T & S data at kt time step   ==!
-         ptsd(:,:,:,jp_tem) = sf_tsddmp(jp_tem)%fnow(:,:,:)    ! NO mask
-         ptsd(:,:,:,jp_sal) = sf_tsddmp(jp_sal)%fnow(:,:,:) 
+         DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpk )
+            ptsd(ji,jj,jk,jp_tem) = sf_tsddmp(jp_tem)%fnow(ji,jj,jk)    ! NO mask
+            ptsd(ji,jj,jk,jp_sal) = sf_tsddmp(jp_sal)%fnow(ji,jj,jk)
+         END_3D
       CASE DEFAULT
          CALL ctl_stop('STOP', 'dta_tsd: cddta case unknown')
@@ -186,7 +206,9 @@
       IF( ln_sco ) THEN                   !==   s- or mixed s-zps-coordinate   ==!
          !
-         IF( kt == nit000 .AND. lwp )THEN
-            WRITE(numout,*)
-            WRITE(numout,*) 'dta_tsd: interpolates T & S data onto the s- or mixed s-z-coordinate mesh'
+         IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile
+            IF( kt == nit000 .AND. lwp )THEN
+               WRITE(numout,*)
+               WRITE(numout,*) 'dta_tsd: interpolates T & S data onto the s- or mixed s-z-coordinate mesh'
+            ENDIF
          ENDIF
          !
@@ -220,6 +242,8 @@
       ELSE                                !==   z- or zps- coordinate   ==!
          !                             
-         ptsd(:,:,:,jp_tem) = ptsd(:,:,:,jp_tem) * tmask(:,:,:)    ! Mask
-         ptsd(:,:,:,jp_sal) = ptsd(:,:,:,jp_sal) * tmask(:,:,:)
+         DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpk )
+            ptsd(ji,jj,jk,jp_tem) = ptsd(ji,jj,jk,jp_tem) * tmask(ji,jj,jk)    ! Mask
+            ptsd(ji,jj,jk,jp_sal) = ptsd(ji,jj,jk,jp_sal) * tmask(ji,jj,jk)
+         END_3D
          !
          IF( ln_zps ) THEN                      ! zps-coordinate (partial steps) interpolation at the last ocean level
Index: /NEMO/branches/2020/tickets_icb_1900/tests/ISOMIP+/MY_SRC/eosbn2.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/tests/ISOMIP+/MY_SRC/eosbn2.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/tests/ISOMIP+/MY_SRC/eosbn2.F90	(revision 14012)
@@ -39,4 +39,5 @@
    !!----------------------------------------------------------------------
    USE dom_oce        ! ocean space and time domain
+   USE domutl, ONLY : is_tile
    USE phycst         ! physical constants
    USE stopar         ! Stochastic T/S fluctuations
@@ -191,4 +192,14 @@
 
    SUBROUTINE eos_insitu( pts, prd, pdep )
+      !!
+      REAL(wp), DIMENSION(:,:,:,:), INTENT(in   ) ::   pts   ! 1 : potential temperature  [Celsius]
+      !                                                      ! 2 : salinity               [psu]
+      REAL(wp), DIMENSION(:,:,:)  , INTENT(  out) ::   prd   ! in situ density            [-]
+      REAL(wp), DIMENSION(:,:,:)  , INTENT(in   ) ::   pdep  ! depth                      [m]
+      !!
+      CALL eos_insitu_t( pts, is_tile(pts), prd, is_tile(prd), pdep, is_tile(pdep) )
+   END SUBROUTINE eos_insitu
+
+   SUBROUTINE eos_insitu_t( pts, ktts, prd, ktrd, pdep, ktdep )
       !!----------------------------------------------------------------------
       !!                   ***  ROUTINE eos_insitu  ***
@@ -228,8 +239,9 @@
       !!                TEOS-10 Manual, 2010
       !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in   ) ::   pts   ! 1 : potential temperature  [Celsius]
+      INTEGER                                 , INTENT(in   ) ::   ktts, ktrd, ktdep
+      REAL(wp), DIMENSION(A2D_T(ktts) ,JPK,JPTS), INTENT(in   ) ::   pts   ! 1 : potential temperature  [Celsius]
       !                                                               ! 2 : salinity               [psu]
-      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(  out) ::   prd   ! in situ density            [-]
-      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(in   ) ::   pdep  ! depth                      [m]
+      REAL(wp), DIMENSION(A2D_T(ktrd) ,JPK     ), INTENT(  out) ::   prd   ! in situ density            [-]
+      REAL(wp), DIMENSION(A2D_T(ktdep),JPK     ), INTENT(in   ) ::   pdep  ! depth                      [m]
       !
       INTEGER  ::   ji, jj, jk                ! dummy loop indices
@@ -312,8 +324,20 @@
       IF( ln_timing )   CALL timing_stop('eos-insitu')
       !
-   END SUBROUTINE eos_insitu
+   END SUBROUTINE eos_insitu_t
 
 
    SUBROUTINE eos_insitu_pot( pts, prd, prhop, pdep )
+      !!
+      REAL(wp), DIMENSION(:,:,:,:), INTENT(in   ) ::   pts    ! 1 : potential temperature  [Celsius]
+      !                                                       ! 2 : salinity               [psu]
+      REAL(wp), DIMENSION(:,:,:)  , INTENT(  out) ::   prd    ! in situ density            [-]
+      REAL(wp), DIMENSION(:,:,:)  , INTENT(  out) ::   prhop  ! potential density (surface referenced)
+      REAL(wp), DIMENSION(:,:,:)  , INTENT(in   ) ::   pdep   ! depth                      [m]
+      !!
+      CALL eos_insitu_pot_t( pts, is_tile(pts), prd, is_tile(prd), prhop, is_tile(prhop), pdep, is_tile(pdep) )
+   END SUBROUTINE eos_insitu_pot
+
+
+   SUBROUTINE eos_insitu_pot_t( pts, ktts, prd, ktrd, prhop, ktrhop, pdep, ktdep )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE eos_insitu_pot  ***
@@ -328,9 +352,10 @@
       !!
       !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in   ) ::   pts    ! 1 : potential temperature  [Celsius]
+      INTEGER                                  , INTENT(in   ) ::   ktts, ktrd, ktrhop, ktdep
+      REAL(wp), DIMENSION(A2D_T(ktts)  ,JPK,JPTS), INTENT(in   ) ::   pts    ! 1 : potential temperature  [Celsius]
       !                                                                ! 2 : salinity               [psu]
-      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(  out) ::   prd    ! in situ density            [-]
-      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(  out) ::   prhop  ! potential density (surface referenced)
-      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(in   ) ::   pdep   ! depth                      [m]
+      REAL(wp), DIMENSION(A2D_T(ktrd)  ,JPK     ), INTENT(  out) ::   prd    ! in situ density            [-]
+      REAL(wp), DIMENSION(A2D_T(ktrhop),JPK     ), INTENT(  out) ::   prhop  ! potential density (surface referenced)
+      REAL(wp), DIMENSION(A2D_T(ktdep) ,JPK     ), INTENT(in   ) ::   pdep   ! depth                      [m]
       !
       INTEGER  ::   ji, jj, jk, jsmp             ! dummy loop indices
@@ -482,8 +507,19 @@
       IF( ln_timing )   CALL timing_stop('eos-pot')
       !
-   END SUBROUTINE eos_insitu_pot
+   END SUBROUTINE eos_insitu_pot_t
 
 
    SUBROUTINE eos_insitu_2d( pts, pdep, prd )
+      !!
+      REAL(wp), DIMENSION(:,:,:), INTENT(in   ) ::   pts   ! 1 : potential temperature  [Celsius]
+      !                                                    ! 2 : salinity               [psu]
+      REAL(wp), DIMENSION(:,:)  , INTENT(in   ) ::   pdep  ! depth                      [m]
+      REAL(wp), DIMENSION(:,:)  , INTENT(  out) ::   prd   ! in situ density
+      !!
+      CALL eos_insitu_2d_t( pts, is_tile(pts), pdep, is_tile(pdep), prd, is_tile(prd) )
+   END SUBROUTINE eos_insitu_2d
+
+
+   SUBROUTINE eos_insitu_2d_t( pts, ktts, pdep, ktdep, prd, ktrd )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE eos_insitu_2d  ***
@@ -496,8 +532,9 @@
       !!
       !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj,jpts), INTENT(in   ) ::   pts   ! 1 : potential temperature  [Celsius]
+      INTEGER                            , INTENT(in   ) ::   ktts, ktdep, ktrd
+      REAL(wp), DIMENSION(A2D_T(ktts),JPTS), INTENT(in   ) ::   pts   ! 1 : potential temperature  [Celsius]
       !                                                           ! 2 : salinity               [psu]
-      REAL(wp), DIMENSION(jpi,jpj)     , INTENT(in   ) ::   pdep  ! depth                      [m]
-      REAL(wp), DIMENSION(jpi,jpj)     , INTENT(  out) ::   prd   ! in situ density
+      REAL(wp), DIMENSION(A2D_T(ktdep)    ), INTENT(in   ) ::   pdep  ! depth                      [m]
+      REAL(wp), DIMENSION(A2D_T(ktrd)     ), INTENT(  out) ::   prd   ! in situ density
       !
       INTEGER  ::   ji, jj, jk                ! dummy loop indices
@@ -584,8 +621,18 @@
       IF( ln_timing )   CALL timing_stop('eos2d')
       !
-   END SUBROUTINE eos_insitu_2d
+   END SUBROUTINE eos_insitu_2d_t
 
 
    SUBROUTINE rab_3d( pts, pab, Kmm )
+      !!
+      INTEGER                     , INTENT(in   ) ::   Kmm   ! time level index
+      REAL(wp), DIMENSION(:,:,:,:), INTENT(in   ) ::   pts   ! pot. temperature & salinity
+      REAL(wp), DIMENSION(:,:,:,:), INTENT(  out) ::   pab   ! thermal/haline expansion ratio
+      !!
+      CALL rab_3d_t( pts, is_tile(pts), pab, is_tile(pab), Kmm )
+   END SUBROUTINE rab_3d
+
+
+   SUBROUTINE rab_3d_t( pts, ktts, pab, ktab, Kmm )
       !!----------------------------------------------------------------------
       !!                 ***  ROUTINE rab_3d  ***
@@ -598,6 +645,7 @@
       !!----------------------------------------------------------------------
       INTEGER                              , INTENT(in   ) ::   Kmm   ! time level index
-      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in   ) ::   pts   ! pot. temperature & salinity
-      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(  out) ::   pab   ! thermal/haline expansion ratio
+      INTEGER                                , INTENT(in   ) ::   ktts, ktab
+      REAL(wp), DIMENSION(A2D_T(ktts),JPK,JPTS), INTENT(in   ) ::   pts   ! pot. temperature & salinity
+      REAL(wp), DIMENSION(A2D_T(ktab),JPK,JPTS), INTENT(  out) ::   pab   ! thermal/haline expansion ratio
       !
       INTEGER  ::   ji, jj, jk                ! dummy loop indices
@@ -706,8 +754,19 @@
       IF( ln_timing )   CALL timing_stop('rab_3d')
       !
-   END SUBROUTINE rab_3d
+   END SUBROUTINE rab_3d_t
 
 
    SUBROUTINE rab_2d( pts, pdep, pab, Kmm )
+      !!
+      INTEGER                   , INTENT(in   ) ::   Kmm   ! time level index
+      REAL(wp), DIMENSION(:,:,:), INTENT(in   ) ::   pts    ! pot. temperature & salinity
+      REAL(wp), DIMENSION(:,:)  , INTENT(in   ) ::   pdep   ! depth                  [m]
+      REAL(wp), DIMENSION(:,:,:), INTENT(  out) ::   pab    ! thermal/haline expansion ratio
+      !!
+      CALL rab_2d_t(pts, is_tile(pts), pdep, is_tile(pdep), pab, is_tile(pab), Kmm)
+   END SUBROUTINE rab_2d
+
+
+   SUBROUTINE rab_2d_t( pts, ktts, pdep, ktdep, pab, ktab, Kmm )
       !!----------------------------------------------------------------------
       !!                 ***  ROUTINE rab_2d  ***
@@ -718,7 +777,8 @@
       !!----------------------------------------------------------------------
       INTEGER                              , INTENT(in   ) ::   Kmm   ! time level index
-      REAL(wp), DIMENSION(jpi,jpj,jpts)    , INTENT(in   ) ::   pts    ! pot. temperature & salinity
-      REAL(wp), DIMENSION(jpi,jpj)         , INTENT(in   ) ::   pdep   ! depth                  [m]
-      REAL(wp), DIMENSION(jpi,jpj,jpts)    , INTENT(  out) ::   pab    ! thermal/haline expansion ratio
+      INTEGER                            , INTENT(in   ) ::   ktts, ktdep, ktab
+      REAL(wp), DIMENSION(A2D_T(ktts),JPTS), INTENT(in   ) ::   pts    ! pot. temperature & salinity
+      REAL(wp), DIMENSION(A2D_T(ktdep)    ), INTENT(in   ) ::   pdep   ! depth                  [m]
+      REAL(wp), DIMENSION(A2D_T(ktab),JPTS), INTENT(  out) ::   pab    ! thermal/haline expansion ratio
       !
       INTEGER  ::   ji, jj, jk                ! dummy loop indices
@@ -829,5 +889,5 @@
       IF( ln_timing )   CALL timing_stop('rab_2d')
       !
-   END SUBROUTINE rab_2d
+   END SUBROUTINE rab_2d_t
 
 
@@ -942,4 +1002,15 @@
 
    SUBROUTINE bn2( pts, pab, pn2, Kmm )
+      !!
+      INTEGER                              , INTENT(in   ) ::  Kmm   ! time level index
+      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in   ) ::  pts   ! pot. temperature and salinity   [Celsius,psu]
+      REAL(wp), DIMENSION(:,:,:,:)         , INTENT(in   ) ::  pab   ! thermal/haline expansion coef.  [Celsius-1,psu-1]
+      REAL(wp), DIMENSION(:,:,:)           , INTENT(  out) ::  pn2   ! Brunt-Vaisala frequency squared [1/s^2]
+      !!
+      CALL bn2_t( pts, pab, is_tile(pab), pn2, is_tile(pn2), Kmm )
+   END SUBROUTINE bn2
+
+
+   SUBROUTINE bn2_t( pts, pab, ktab, pn2, ktn2, Kmm )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE bn2  ***
@@ -956,7 +1027,8 @@
       !!----------------------------------------------------------------------
       INTEGER                              , INTENT(in   ) ::   Kmm   ! time level index
+      INTEGER                                , INTENT(in   ) ::  ktab, ktn2
       REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in   ) ::  pts   ! pot. temperature and salinity   [Celsius,psu]
-      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in   ) ::  pab   ! thermal/haline expansion coef.  [Celsius-1,psu-1]
-      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(  out) ::  pn2   ! Brunt-Vaisala frequency squared [1/s^2]
+      REAL(wp), DIMENSION(A2D_T(ktab),JPK,JPTS), INTENT(in   ) ::  pab   ! thermal/haline expansion coef.  [Celsius-1,psu-1]
+      REAL(wp), DIMENSION(A2D_T(ktn2),JPK     ), INTENT(  out) ::  pn2   ! Brunt-Vaisala frequency squared [1/s^2]
       !
       INTEGER  ::   ji, jj, jk      ! dummy loop indices
@@ -982,5 +1054,5 @@
       IF( ln_timing )   CALL timing_stop('bn2')
       !
-   END SUBROUTINE bn2
+   END SUBROUTINE bn2_t
 
 
@@ -1043,4 +1115,14 @@
 
    SUBROUTINE  eos_fzp_2d( psal, ptf, pdep )
+      !!
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   )           ::   psal   ! salinity   [psu]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ), OPTIONAL ::   pdep   ! depth      [m]
+      REAL(wp), DIMENSION(:,:)    , INTENT(out  )           ::   ptf    ! freezing temperature [Celsius]
+      !!
+      CALL eos_fzp_2d_t( psal, ptf, is_tile(ptf), pdep )
+   END SUBROUTINE eos_fzp_2d
+
+
+   SUBROUTINE  eos_fzp_2d_t( psal, ptf, kttf, pdep )
       !!----------------------------------------------------------------------
       !!                 ***  ROUTINE eos_fzp  ***
@@ -1054,7 +1136,8 @@
       !! Reference  :   UNESCO tech. papers in the marine science no. 28. 1978
       !!----------------------------------------------------------------------
+      INTEGER                       , INTENT(in   )           ::   kttf
       REAL(wp), DIMENSION(jpi,jpj), INTENT(in   )           ::   psal   ! salinity   [psu]
       REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ), OPTIONAL ::   pdep   ! depth      [m]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(out  )           ::   ptf    ! freezing temperature [Celsius]
+      REAL(wp), DIMENSION(A2D_T(kttf)), INTENT(out  )           ::   ptf    ! freezing temperature [Celsius]
       !
       INTEGER  ::   ji, jj          ! dummy loop indices
@@ -1089,5 +1172,5 @@
       END SELECT      
       !
-  END SUBROUTINE eos_fzp_2d
+  END SUBROUTINE eos_fzp_2d_t
 
 
Index: /NEMO/branches/2020/tickets_icb_1900/tests/ISOMIP+/MY_SRC/tradmp.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/tests/ISOMIP+/MY_SRC/tradmp.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/tests/ISOMIP+/MY_SRC/tradmp.F90	(revision 14012)
@@ -95,5 +95,5 @@
       !
       INTEGER ::   ji, jj, jk, jn   ! dummy loop indices
-      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts)     ::  zts_dta
+      REAL(wp), DIMENSION(A2D(nn_hls),jpk,jpts)     ::  zts_dta
       REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::  ztrdts
       !!----------------------------------------------------------------------
Index: /NEMO/branches/2020/tickets_icb_1900/tests/VORTEX/MY_SRC/domvvl.F90
===================================================================
--- /NEMO/branches/2020/tickets_icb_1900/tests/VORTEX/MY_SRC/domvvl.F90	(revision 14011)
+++ /NEMO/branches/2020/tickets_icb_1900/tests/VORTEX/MY_SRC/domvvl.F90	(revision 14012)
@@ -282,22 +282,4 @@
       ENDIF
       !
-      IF(lwxios) THEN
-! define variables in restart file when writing with XIOS
-         CALL iom_set_rstw_var_active('e3t_b')
-         CALL iom_set_rstw_var_active('e3t_n')
-         !                                           ! ----------------------- !
-         IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN  ! z_tilde and layer cases !
-            !                                        ! ----------------------- !
-            CALL iom_set_rstw_var_active('tilde_e3t_b')
-            CALL iom_set_rstw_var_active('tilde_e3t_n')
-         END IF
-         !                                           ! -------------!    
-         IF( ln_vvl_ztilde ) THEN                    ! z_tilde case !
-            !                                        ! ------------ !
-            CALL iom_set_rstw_var_active('hdiv_lf')
-         ENDIF
-         !
-      ENDIF
-      !
    END SUBROUTINE dom_vvl_zgr
 
@@ -803,5 +785,5 @@
          IF( ln_rstart ) THEN                   !* Read the restart file
             CALL rst_read_open                  !  open the restart file if necessary
-            CALL iom_get( numror, jpdom_auto, 'sshn'   , ssh(:,:,Kmm), ldxios = lrxios    )
+            CALL iom_get( numror, jpdom_auto, 'sshn'   , ssh(:,:,Kmm)    )
             !
             id1 = iom_varid( numror, 'e3t_b', ldstop = .FALSE. )
@@ -816,6 +798,6 @@
             !
             IF( MIN( id1, id2 ) > 0 ) THEN       ! all required arrays exist
-               CALL iom_get( numror, jpdom_auto, 'e3t_b', e3t(:,:,:,Kbb), ldxios = lrxios )
-               CALL iom_get( numror, jpdom_auto, 'e3t_n', e3t(:,:,:,Kmm), ldxios = lrxios )
+               CALL iom_get( numror, jpdom_auto, 'e3t_b', e3t(:,:,:,Kbb) )
+               CALL iom_get( numror, jpdom_auto, 'e3t_n', e3t(:,:,:,Kmm) )
                ! needed to restart if land processor not computed 
                IF(lwp) write(numout,*) 'dom_vvl_rst : e3t(:,:,:,Kbb) and e3t(:,:,:,Kmm) found in restart files'
@@ -831,5 +813,5 @@
                IF(lwp) write(numout,*) 'e3t_n set equal to e3t_b.'
                IF(lwp) write(numout,*) 'l_1st_euler is forced to true'
-               CALL iom_get( numror, jpdom_auto, 'e3t_b', e3t(:,:,:,Kbb), ldxios = lrxios )
+               CALL iom_get( numror, jpdom_auto, 'e3t_b', e3t(:,:,:,Kbb) )
                e3t(:,:,:,Kmm) = e3t(:,:,:,Kbb)
                l_1st_euler = .true.
@@ -838,5 +820,5 @@
                IF(lwp) write(numout,*) 'e3t_b set equal to e3t_n.'
                IF(lwp) write(numout,*) 'l_1st_euler is forced to true'
-               CALL iom_get( numror, jpdom_auto, 'e3t_n', e3t(:,:,:,Kmm), ldxios = lrxios )
+               CALL iom_get( numror, jpdom_auto, 'e3t_n', e3t(:,:,:,Kmm) )
                e3t(:,:,:,Kbb) = e3t(:,:,:,Kmm)
                l_1st_euler = .true.
@@ -863,6 +845,6 @@
                !                          ! ----------------------- !
                IF( MIN( id3, id4 ) > 0 ) THEN  ! all required arrays exist
-                  CALL iom_get( numror, jpdom_auto, 'tilde_e3t_b', tilde_e3t_b(:,:,:), ldxios = lrxios )
-                  CALL iom_get( numror, jpdom_auto, 'tilde_e3t_n', tilde_e3t_n(:,:,:), ldxios = lrxios )
+                  CALL iom_get( numror, jpdom_auto, 'tilde_e3t_b', tilde_e3t_b(:,:,:) )
+                  CALL iom_get( numror, jpdom_auto, 'tilde_e3t_n', tilde_e3t_n(:,:,:) )
                ELSE                            ! one at least array is missing
                   tilde_e3t_b(:,:,:) = 0.0_wp
@@ -873,5 +855,5 @@
                   !                       ! ------------ !
                   IF( id5 > 0 ) THEN  ! required array exists
-                     CALL iom_get( numror, jpdom_auto, 'hdiv_lf', hdiv_lf(:,:,:), ldxios = lrxios )
+                     CALL iom_get( numror, jpdom_auto, 'hdiv_lf', hdiv_lf(:,:,:) )
                   ELSE                ! array is missing
                      hdiv_lf(:,:,:) = 0.0_wp
@@ -947,23 +929,21 @@
          !                                   ! ===================
          IF(lwp) WRITE(numout,*) '---- dom_vvl_rst ----'
-         IF( lwxios ) CALL iom_swap(      cwxios_context          )
          !                                           ! --------- !
          !                                           ! all cases !
          !                                           ! --------- !
-         CALL iom_rstput( kt, nitrst, numrow, 'e3t_b', e3t(:,:,:,Kbb), ldxios = lwxios )
-         CALL iom_rstput( kt, nitrst, numrow, 'e3t_n', e3t(:,:,:,Kmm), ldxios = lwxios )
+         CALL iom_rstput( kt, nitrst, numrow, 'e3t_b', e3t(:,:,:,Kbb) )
+         CALL iom_rstput( kt, nitrst, numrow, 'e3t_n', e3t(:,:,:,Kmm) )
          !                                           ! ----------------------- !
          IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN  ! z_tilde and layer cases !
             !                                        ! ----------------------- !
-            CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_b', tilde_e3t_b(:,:,:), ldxios = lwxios)
-            CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_n', tilde_e3t_n(:,:,:), ldxios = lwxios)
+            CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_b', tilde_e3t_b(:,:,:))
+            CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_n', tilde_e3t_n(:,:,:))
          END IF
          !                                           ! -------------!    
          IF( ln_vvl_ztilde ) THEN                    ! z_tilde case !
             !                                        ! ------------ !
-            CALL iom_rstput( kt, nitrst, numrow, 'hdiv_lf', hdiv_lf(:,:,:), ldxios = lwxios)
+            CALL iom_rstput( kt, nitrst, numrow, 'hdiv_lf', hdiv_lf(:,:,:))
          ENDIF
          !
-         IF( lwxios ) CALL iom_swap(      cxios_context          )
       ENDIF
       !
