Index: /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/NST_SRC/agrif_user.F90
===================================================================
--- /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/NST_SRC/agrif_user.F90	(revision 8757)
+++ /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/NST_SRC/agrif_user.F90	(revision 8758)
@@ -28,6 +28,6 @@
       jpiglo  = nbcellsx + 2 + 2*nbghostcells
       jpjglo  = nbcellsy + 2 + 2*nbghostcells
-      jpi     = ( jpiglo-2*jpreci + (jpni-1+0) ) / jpni + 2*jpreci
-      jpj     = ( jpjglo-2*jprecj + (jpnj-1+0) ) / jpnj + 2*jprecj
+      jpi     = ( jpiglo-2*nn_hls + (jpni-1+0) ) / jpni + 2*nn_hls
+      jpj     = ( jpjglo-2*nn_hls + (jpnj-1+0) ) / jpnj + 2*nn_hls
 ! JC: change to allow for different vertical levels
 !     jpk is already set
Index: /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90
===================================================================
--- /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90	(revision 8757)
+++ /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90	(revision 8758)
@@ -150,7 +150,9 @@
       !! ** Purpose :   initialization of the nemo model in off-line mode
       !!----------------------------------------------------------------------
-      INTEGER ::   ji            ! dummy loop indices
-      INTEGER ::   ilocal_comm   ! local integer
-      INTEGER ::   ios, inum
+      INTEGER  ::   ji                 ! dummy loop indices
+      INTEGER  ::   ilocal_comm        ! local integer
+      INTEGER  ::   ios, inum          ! local integers
+      INTEGER  ::   iiarea, ijarea     ! local integers
+      INTEGER  ::   iirest, ijrest     ! local integers
       REAL(wp) ::   ziglo, zjglo, zkglo, zperio   ! local scalars
       CHARACTER(len=120), DIMENSION(30) ::   cltxt, cltxt2, clnam
@@ -198,5 +200,4 @@
          CALL usr_def_nam( cltxt2, clnam, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio )
       ENDIF
-      jpk    = jpkglo
       !
       !
@@ -246,13 +247,31 @@
       END IF
 
-      ! Calculate domain dimensions given calculated jpni and jpnj
-      ! This used to be done in par_oce.F90 when they were parameters rather
-      ! than variables
-      jpi = ( jpiglo-2*jpreci + (jpni-1) ) / jpni + 2*jpreci   ! first  dim.
-      jpj = ( jpjglo-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj   ! second dim.
+      iiarea = 1 + MOD( narea - 1 , jpni )
+      ijarea = 1 + ( narea - 1 ) / jpni
+      iirest = 1 + MOD( jpiglo - 2*nn_hls - 1 , jpni )
+      ijrest = 1 + MOD( jpjglo - 2*nn_hls - 1 , jpnj )
+#if defined key_nemocice_decomp
+      jpi = ( nx_global+2-2*nn_hls + (jpni-1) ) / jpni + 2*nn_hls    ! first  dim.
+      jpj = ( ny_global+2-2*nn_hls + (jpnj-1) ) / jpnj + 2*nn_hls    ! second dim. 
+      jpimax  = jpi
+      jpjmax  = jpj
+      IF( iiarea == jpni ) jpi = jpiglo - (jpni - 1) * (jpi - 2*nn_hls)
+      IF( ijarea == jpnj ) jpj = jpjglo - (jpnj - 1) * (jpj - 2*nn_hls)
+#else
+      jpi = ( jpiglo     -2*nn_hls + (jpni-1) ) / jpni + 2*nn_hls    ! first  dim.
+      jpj = ( jpjglo     -2*nn_hls + (jpnj-1) ) / jpnj + 2*nn_hls    ! second dim.
+      jpimax  = jpi
+      jpjmax  = jpj
+      IF( iiarea > iirest ) jpi = jpi - 1
+      IF( ijarea > ijrest ) jpj = jpj - 1
+#endif
+
+      jpk   = jpkglo                                           ! third dim
+
       jpim1 = jpi-1                                            ! inner domain indices
       jpjm1 = jpj-1                                            !   "           "
-      jpkm1 = jpk-1                                            !   "           "
+      jpkm1 = MAX( 1, jpk-1 )                                  !   "           "
       jpij  = jpi*jpj                                          !  jpi x j
+
 
 
Index: /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/CRS/crsdom.F90
===================================================================
--- /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/CRS/crsdom.F90	(revision 8757)
+++ /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/CRS/crsdom.F90	(revision 8758)
@@ -1895,6 +1895,6 @@
       jpjglo_crsm1 = jpjglo_crs - 1  
 
-      jpi_crs = ( jpiglo_crs   - 2 * jpreci + (jpni-1) ) / jpni + 2 * jpreci
-      jpj_crs = ( jpjglo_crsm1 - 2 * jprecj + (jpnj-1) ) / jpnj + 2 * jprecj   
+      jpi_crs = ( jpiglo_crs   - 2 * nn_hls + (jpni-1) ) / jpni + 2 * nn_hls
+      jpj_crs = ( jpjglo_crsm1 - 2 * nn_hls + (jpnj-1) ) / jpnj + 2 * nn_hls   
               
       IF( noso < 0 ) jpj_crs = jpj_crs + 1    ! add a local band on southern processors  
@@ -1940,5 +1940,5 @@
               CASE ( -1 )
                 IF( MOD( jpjglo - njmppt(jn), nn_facty) > 0 )  nlejt_crs(jn) = nlejt_crs(jn) + 1
-                nlcjt_crs(jn) = nlejt_crs(jn) + jprecj
+                nlcjt_crs(jn) = nlejt_crs(jn) + nn_hls
                 nldjt_crs(jn) = nldjt(jn)
               
@@ -1947,10 +1947,10 @@
                 nldjt_crs(jn) = nldjt(jn)
                 IF( nldjt(jn) == 1 )  nlejt_crs(jn) = nlejt_crs(jn) + 1
-                nlejt_crs(jn) = nlejt_crs(jn) + jprecj
-                nlcjt_crs(jn) = nlejt_crs(jn) + jprecj
+                nlejt_crs(jn) = nlejt_crs(jn) + nn_hls
+                nlcjt_crs(jn) = nlejt_crs(jn) + nn_hls
                 
               CASE ( 1, 2 )
               
-                nlejt_crs(jn) = nlejt_crs(jn) + jprecj
+                nlejt_crs(jn) = nlejt_crs(jn) + nn_hls
                 nlcjt_crs(jn) = nlejt_crs(jn)
                 nldjt_crs(jn) = nldjt(jn)
@@ -1990,16 +1990,16 @@
            SELECT CASE( ibonit(jn) )
               CASE ( -1 )
-                 nleit_crs(jn) = nleit_crs(jn) + jpreci           
-                 nlcit_crs(jn) = nleit_crs(jn) + jpreci
+                 nleit_crs(jn) = nleit_crs(jn) + nn_hls           
+                 nlcit_crs(jn) = nleit_crs(jn) + nn_hls
                  nldit_crs(jn) = nldit(jn) 
               
               CASE ( 0 )
-                 nleit_crs(jn) = nleit_crs(jn) + jpreci
-                 nlcit_crs(jn) = nleit_crs(jn) + jpreci
+                 nleit_crs(jn) = nleit_crs(jn) + nn_hls
+                 nlcit_crs(jn) = nleit_crs(jn) + nn_hls
                  nldit_crs(jn) = nldit(jn) 
                 
               CASE ( 1, 2 )
                  IF( MOD( jpiglo - nimppt(jn), nn_factx) > 0 )  nleit_crs(jn) = nleit_crs(jn) + 1
-                 nleit_crs(jn) = nleit_crs(jn) + jpreci
+                 nleit_crs(jn) = nleit_crs(jn) + nn_hls
                  nlcit_crs(jn) = nleit_crs(jn)
                  nldit_crs(jn) = nldit(jn) 
Index: /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/CRS/crsdomwri.F90
===================================================================
--- /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/CRS/crsdomwri.F90	(revision 8757)
+++ /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/CRS/crsdomwri.F90	(revision 8758)
@@ -133,8 +133,8 @@
       
       tmask_i_crs(:,:) = tmask_crs(:,:,1)
-      iif = jpreci
-      iil = nlci_crs - jpreci + 1
-      ijf = jpreci
-      ijl = nlcj_crs - jprecj + 1
+      iif = nn_hls
+      iil = nlci_crs - nn_hls + 1
+      ijf = nn_hls
+      ijl = nlcj_crs - nn_hls + 1
      
       tmask_i_crs( 1:iif ,    :  ) = 0._wp
Index: /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90
===================================================================
--- /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90	(revision 8757)
+++ /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90	(revision 8758)
@@ -98,6 +98,6 @@
          WRITE(numout,cform) '       ' ,'   jpij    : ', jpij
          WRITE(numout,*)     '      mpp local domain info (mpp):'
-         WRITE(numout,*)     '              jpni    : ', jpni, '   jpreci  : ', jpreci
-         WRITE(numout,*)     '              jpnj    : ', jpnj, '   jprecj  : ', jprecj
+         WRITE(numout,*)     '              jpni    : ', jpni, '   nn_hls  : ', nn_hls
+         WRITE(numout,*)     '              jpnj    : ', jpnj, '   nn_hls  : ', nn_hls
          WRITE(numout,*)     '              jpnij   : ', jpnij
          WRITE(numout,*)     '      lateral boundary of the Global domain : jperio  = ', jperio
Index: /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/DOM/dommsk.F90
===================================================================
--- /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/DOM/dommsk.F90	(revision 8757)
+++ /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/DOM/dommsk.F90	(revision 8758)
@@ -212,6 +212,6 @@
       ! --------------------
       !
-      iif = jpreci   ;   iil = nlci - jpreci + 1
-      ijf = jprecj   ;   ijl = nlcj - jprecj + 1
+      iif = nn_hls   ;   iil = nlci - nn_hls + 1
+      ijf = nn_hls   ;   ijl = nlcj - nn_hls + 1
       !
       !                          ! halo mask : 0 on the halo and 1 elsewhere
Index: /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/IOM/prtctl.F90
===================================================================
--- /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/IOM/prtctl.F90	(revision 8757)
+++ /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/IOM/prtctl.F90	(revision 8758)
@@ -441,14 +441,14 @@
 
 #if defined key_nemocice_decomp
-      ijpi = ( nx_global+2-2*jpreci + (isplt-1) ) / isplt + 2*jpreci
-      ijpj = ( ny_global+2-2*jprecj + (jsplt-1) ) / jsplt + 2*jprecj 
+      ijpi = ( nx_global+2-2*nn_hls + (isplt-1) ) / isplt + 2*nn_hls
+      ijpj = ( ny_global+2-2*nn_hls + (jsplt-1) ) / jsplt + 2*nn_hls 
 #else
-      ijpi = ( jpiglo-2*jpreci + (isplt-1) ) / isplt + 2*jpreci
-      ijpj = ( jpjglo-2*jprecj + (jsplt-1) ) / jsplt + 2*jprecj
+      ijpi = ( jpiglo-2*nn_hls + (isplt-1) ) / isplt + 2*nn_hls
+      ijpj = ( jpjglo-2*nn_hls + (jsplt-1) ) / jsplt + 2*nn_hls
 #endif
 
 
-      nrecil  = 2 * jpreci
-      nrecjl  = 2 * jprecj
+      nrecil  = 2 * nn_hls
+      nrecjl  = 2 * nn_hls
       irestil = MOD( jpiglo - nrecil , isplt )
       irestjl = MOD( jpjglo - nrecjl , jsplt )
@@ -563,10 +563,10 @@
          ibonitl(jn) = nbondil
          
-         nldil =  1   + jpreci
-         nleil = nlcil - jpreci
+         nldil =  1   + nn_hls
+         nleil = nlcil - nn_hls
          IF( nbondil == -1 .OR. nbondil == 2 )   nldil = 1
          IF( nbondil ==  1 .OR. nbondil == 2 )   nleil = nlcil
-         nldjl =  1   + jprecj
-         nlejl = nlcjl - jprecj
+         nldjl =  1   + nn_hls
+         nlejl = nlcjl - nn_hls
          IF( nbondjl == -1 .OR. nbondjl == 2 )   nldjl = 1
          IF( nbondjl ==  1 .OR. nbondjl == 2 )   nlejl = nlcjl
Index: /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90
===================================================================
--- /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90	(revision 8757)
+++ /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90	(revision 8758)
@@ -535,12 +535,12 @@
       INTEGER, DIMENSION(MPI_STATUS_SIZE) ::   ml_stat   ! for key_mpi_isend
       !!
-      REAL(wp), DIMENSION(1-jpri:jpi+jpri,jprecj+jprj,2) :: r2dns
-      REAL(wp), DIMENSION(1-jpri:jpi+jpri,jprecj+jprj,2) :: r2dsn
-      REAL(wp), DIMENSION(1-jprj:jpj+jprj,jpreci+jpri,2) :: r2dwe
-      REAL(wp), DIMENSION(1-jprj:jpj+jprj,jpreci+jpri,2) :: r2dew
-      !!----------------------------------------------------------------------
-
-      ipreci = jpreci + jpri      ! take into account outer extra 2D overlap area
-      iprecj = jprecj + jprj
+      REAL(wp), DIMENSION(1-jpri:jpi+jpri,nn_hls+jprj,2) :: r2dns
+      REAL(wp), DIMENSION(1-jpri:jpi+jpri,nn_hls+jprj,2) :: r2dsn
+      REAL(wp), DIMENSION(1-jprj:jpj+jprj,nn_hls+jpri,2) :: r2dwe
+      REAL(wp), DIMENSION(1-jprj:jpj+jprj,nn_hls+jpri,2) :: r2dew
+      !!----------------------------------------------------------------------
+
+      ipreci = nn_hls + jpri      ! take into account outer extra 2D overlap area
+      iprecj = nn_hls + jprj
 
 
@@ -553,6 +553,6 @@
          pt2d(:, jpj   :jpj+jprj) = pt2d ( :, 2         :2+jprj)
       ELSE                                   !* closed
-         IF( .NOT. cd_type == 'F' )   pt2d(:,  1-jprj   :  jprecj  ) = 0._wp     ! south except at F-point
-                                      pt2d(:,nlcj-jprecj+1:jpj+jprj) = 0._wp     ! north
+         IF( .NOT. cd_type == 'F' )   pt2d(:,  1-jprj   :  nn_hls  ) = 0._wp     ! south except at F-point
+                                      pt2d(:,nlcj-nn_hls+1:jpj+jprj) = 0._wp     ! north
       ENDIF
       !                                !== East-West boundaries
@@ -562,6 +562,6 @@
          pt2d(   jpi  :jpi+jpri,:) = pt2d(     2      :2+jpri,:)              ! west
       ELSE                                   !* closed
-         IF( .NOT. cd_type == 'F' )   pt2d(  1-jpri   :jpreci    ,:) = 0._wp  ! south except at F-point
-                                      pt2d(nlci-jpreci+1:jpi+jpri,:) = 0._wp  ! north
+         IF( .NOT. cd_type == 'F' )   pt2d(  1-jpri   :nn_hls    ,:) = 0._wp  ! south except at F-point
+                                      pt2d(nlci-nn_hls+1:jpi+jpri,:) = 0._wp  ! north
       ENDIF
       !
@@ -585,5 +585,5 @@
          iihom = nlci-nreci-jpri
          DO jl = 1, ipreci
-            r2dew(:,jl,1) = pt2d(jpreci+jl,:)
+            r2dew(:,jl,1) = pt2d(nn_hls+jl,:)
             r2dwe(:,jl,1) = pt2d(iihom +jl,:)
          END DO
@@ -612,5 +612,5 @@
       !
       !                           ! Write Dirichlet lateral conditions
-      iihom = nlci - jpreci
+      iihom = nlci - nn_hls
       !
       SELECT CASE ( nbondi )
@@ -638,5 +638,5 @@
          DO jl = 1, iprecj
             r2dsn(:,jl,1) = pt2d(:,ijhom +jl)
-            r2dns(:,jl,1) = pt2d(:,jprecj+jl)
+            r2dns(:,jl,1) = pt2d(:,nn_hls+jl)
          END DO
       ENDIF
@@ -664,5 +664,5 @@
       !
       !                           ! Write Dirichlet lateral conditions
-      ijhom = nlcj - jprecj
+      ijhom = nlcj - nn_hls
       !
       SELECT CASE ( nbondj )
@@ -1739,10 +1739,10 @@
       INTEGER, DIMENSION(MPI_STATUS_SIZE) ::   ml_stat   ! for key_mpi_isend
       !!
-      REAL(wp), DIMENSION(1-jpri:jpi+jpri,jprecj+jprj,2) ::   r2dns, r2dsn
-      REAL(wp), DIMENSION(1-jprj:jpj+jprj,jpreci+jpri,2) ::   r2dwe, r2dew
-      !!----------------------------------------------------------------------
-
-      ipreci = jpreci + jpri      ! take into account outer extra 2D overlap area
-      iprecj = jprecj + jprj
+      REAL(wp), DIMENSION(1-jpri:jpi+jpri,nn_hls+jprj,2) ::   r2dns, r2dsn
+      REAL(wp), DIMENSION(1-jprj:jpj+jprj,nn_hls+jpri,2) ::   r2dwe, r2dew
+      !!----------------------------------------------------------------------
+
+      ipreci = nn_hls + jpri      ! take into account outer extra 2D overlap area
+      iprecj = nn_hls + jprj
 
 
@@ -1758,6 +1758,6 @@
          !
       ELSE                                        !* closed
-         IF( .NOT. cd_type == 'F' )   pt2d(  1-jpri   :jpreci    ,:) = 0._wp    ! south except at F-point
-                                      pt2d(nlci-jpreci+1:jpi+jpri,:) = 0._wp    ! north
+         IF( .NOT. cd_type == 'F' )   pt2d(  1-jpri   :nn_hls    ,:) = 0._wp    ! south except at F-point
+                                      pt2d(nlci-nn_hls+1:jpi+jpri,:) = 0._wp    ! north
       ENDIF
       !
@@ -1782,5 +1782,5 @@
          iihom = nlci-nreci-jpri
          DO jl = 1, ipreci
-            r2dew(:,jl,1) = pt2d(jpreci+jl,:)
+            r2dew(:,jl,1) = pt2d(nn_hls+jl,:)
             r2dwe(:,jl,1) = pt2d(iihom +jl,:)
          END DO
@@ -1809,5 +1809,5 @@
       !
       !                           ! Write Dirichlet lateral conditions
-      iihom = nlci - jpreci
+      iihom = nlci - nn_hls
       !
       SELECT CASE ( nbondi )
@@ -1836,5 +1836,5 @@
          DO jl = 1, iprecj
             r2dsn(:,jl,1) = pt2d(:,ijhom +jl)
-            r2dns(:,jl,1) = pt2d(:,jprecj+jl)
+            r2dns(:,jl,1) = pt2d(:,nn_hls+jl)
          END DO
       ENDIF
@@ -1862,5 +1862,5 @@
       !
       !                           ! Write Dirichlet lateral conditions
-      ijhom = nlcj - jprecj
+      ijhom = nlcj - nn_hls
       !
       SELECT CASE ( nbondj )
Index: /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/LBC/mpp_bdy_generic.h90
===================================================================
--- /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/LBC/mpp_bdy_generic.h90	(revision 8757)
+++ /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/LBC/mpp_bdy_generic.h90	(revision 8758)
@@ -93,6 +93,6 @@
       ipf = F_SIZE(ptab)   ! 5th    -      use in "multi" case (array of pointers)
       !      
-      ALLOCATE( zt3ns(jpi,jprecj,ipk,ipl,ipf,2), zt3sn(jpi,jprecj,ipk,ipl,ipf,2),   &
-         &      zt3ew(jpj,jpreci,ipk,ipl,ipf,2), zt3we(jpj,jpreci,ipk,ipl,ipf,2)  )
+      ALLOCATE( zt3ns(jpi,nn_hls,ipk,ipl,ipf,2), zt3sn(jpi,nn_hls,ipk,ipl,ipf,2),   &
+         &      zt3ew(jpj,nn_hls,ipk,ipl,ipf,2), zt3we(jpj,nn_hls,ipk,ipl,ipf,2)  )
 
       zland = 0._wp
@@ -111,19 +111,19 @@
                ARRAY_IN(jpi,:,:,:,jf) = ARRAY_IN(  2  ,:,:,:,jf)
             ELSE                                   !* Closed
-               IF( .NOT. NAT_IN(jf) == 'F' )   ARRAY_IN(     1       :jpreci,:,:,:,jf) = zland  ! east except F-point
-                                               ARRAY_IN(nlci-jpreci+1:jpi   ,:,:,:,jf) = zland  ! west
+               IF( .NOT. NAT_IN(jf) == 'F' )   ARRAY_IN(     1       :nn_hls,:,:,:,jf) = zland  ! east except F-point
+                                               ARRAY_IN(nlci-nn_hls+1:jpi   ,:,:,:,jf) = zland  ! west
             ENDIF
          ELSEIF(nbondi == -1) THEN              ! subdomain to the east only
-            IF( .NOT. NAT_IN(jf) == 'F' )   ARRAY_IN(1:jpreci,:,:,:,jf) = zland     ! south except F-point
+            IF( .NOT. NAT_IN(jf) == 'F' )   ARRAY_IN(1:nn_hls,:,:,:,jf) = zland     ! south except F-point
             !
          ELSEIF(nbondi == 1) THEN               ! subdomain to the west only
-            ARRAY_IN(nlci-jpreci+1:jpi,:,:,:,jf) = zland    ! north
+            ARRAY_IN(nlci-nn_hls+1:jpi,:,:,:,jf) = zland    ! north
          ENDIF
          !                                ! North-South boundaries
          !
          IF (nbondj == 2 .OR. nbondj == -1) THEN      !* closed
-           IF( .NOT. NAT_IN(jf) == 'F' )   ARRAY_IN(:,1:jprecj,:,:,jf) = zland            ! south except F-point
+           IF( .NOT. NAT_IN(jf) == 'F' )   ARRAY_IN(:,1:nn_hls,:,:,jf) = zland            ! south except F-point
          ELSEIF (nbondj == 2 .OR. nbondj == 1) THEN
-                                           ARRAY_IN(:,nlcj-jprecj+1:jpj,:,:,jf) = zland   ! north
+                                           ARRAY_IN(:,nlcj-nn_hls+1:jpj,:,:,jf) = zland   ! north
          ENDIF
       END DO
@@ -140,6 +140,6 @@
                DO jl = 1, ipl
                   DO jk = 1, ipk
-                     DO jh = 1, jpreci
-                        zt3ew(:,jh,jk,jl,jf,1) = ARRAY_IN(jpreci+jh,:,jk,jl,jf)
+                     DO jh = 1, nn_hls
+                        zt3ew(:,jh,jk,jl,jf,1) = ARRAY_IN(nn_hls+jh,:,jk,jl,jf)
                         zt3we(:,jh,jk,jl,jf,1) = ARRAY_IN(iihom +jh,:,jk,jl,jf)
                      END DO
@@ -149,6 +149,6 @@
          !
          !                           ! Migrations
-!!gm      imigr = jpreci * jpj * ipk * ipl * ipf
-         imigr = jpreci * jpj * ipk * ipl
+!!gm      imigr = nn_hls * jpj * ipk * ipl * ipf
+         imigr = nn_hls * jpj * ipk * ipl
          !
          SELECT CASE ( nbondi_bdy(IBD_IN(jf)) )
@@ -171,5 +171,5 @@
          !
          !                           ! Write Dirichlet lateral conditions
-         iihom = nlci-jpreci
+         iihom = nlci-nn_hls
          !
          !
@@ -178,5 +178,5 @@
             DO jl = 1, ipl
                DO jk = 1, ipk
-                  DO jh = 1, jpreci
+                  DO jh = 1, nn_hls
                      ARRAY_IN(iihom+jh,:,jk,jl,jf) = zt3ew(:,jh,jk,jl,jf,2)
                   END DO
@@ -186,5 +186,5 @@
             DO jl = 1, ipl
                DO jk = 1, ipk
-                  DO jh = 1, jpreci
+                  DO jh = 1, nn_hls
                      ARRAY_IN(jh      ,:,jk,jl,jf) = zt3we(:,jh,jk,jl,jf,2)
                      ARRAY_IN(iihom+jh,:,jk,jl,jf) = zt3ew(:,jh,jk,jl,jf,2)
@@ -195,5 +195,5 @@
             DO jl = 1, ipl
                DO jk = 1, ipk
-                  DO jh = 1, jpreci
+                  DO jh = 1, nn_hls
                      ARRAY_IN(jh      ,:,jk,jl,jf) = zt3we(:,jh,jk,jl,jf,2)
                   END DO
@@ -213,7 +213,7 @@
             DO jl = 1, ipl
                DO jk = 1, ipk
-                  DO jh = 1, jprecj
+                  DO jh = 1, nn_hls
                      zt3sn(:,jh,jk,jl,jf,1) = ARRAY_IN(:,ijhom +jh,jk,jl,jf)
-                     zt3ns(:,jh,jk,jl,jf,1) = ARRAY_IN(:,jprecj+jh,jk,jl,jf)
+                     zt3ns(:,jh,jk,jl,jf,1) = ARRAY_IN(:,nn_hls+jh,jk,jl,jf)
                   END DO
                END DO
@@ -222,6 +222,6 @@
          !
          !                           ! Migrations
-!!gm      imigr = jprecj * jpi * ipk * ipl * ipf
-         imigr = jprecj * jpi * ipk * ipl
+!!gm      imigr = nn_hls * jpi * ipk * ipl * ipf
+         imigr = nn_hls * jpi * ipk * ipl
          !
          SELECT CASE ( nbondj_bdy(IBD_IN(jf)) )
@@ -244,5 +244,5 @@
          !
          !                           ! Write Dirichlet lateral conditions
-         ijhom = nlcj-jprecj
+         ijhom = nlcj-nn_hls
          !
          SELECT CASE ( nbondj_bdy_b(IBD_IN(jf)) )
@@ -250,5 +250,5 @@
             DO jl = 1, ipl
                DO jk = 1, ipk
-                  DO jh = 1, jprecj
+                  DO jh = 1, nn_hls
                      ARRAY_IN(:,ijhom+jh,jk,jl,jf) = zt3ns(:,jh,jk,jl,jf,2)
                   END DO
@@ -258,5 +258,5 @@
             DO jl = 1, ipl
                DO jk = 1, ipk
-                  DO jh = 1, jprecj
+                  DO jh = 1, nn_hls
                      ARRAY_IN(:,      jh,jk,jl,jf) = zt3sn(:,jh,jk,jl,jf,2)
                      ARRAY_IN(:,ijhom+jh,jk,jl,jf) = zt3ns(:,jh,jk,jl,jf,2)
@@ -267,5 +267,5 @@
             DO jl = 1, ipl
                DO jk = 1, ipk
-                  DO jh = 1, jprecj
+                  DO jh = 1, nn_hls
                      ARRAY_IN(:,jh,jk,jl,jf) = zt3sn(:,jh,jk,jl,jf,2)
                   END DO
Index: /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/LBC/mpp_lnk_generic.h90
===================================================================
--- /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/LBC/mpp_lnk_generic.h90	(revision 8757)
+++ /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/LBC/mpp_lnk_generic.h90	(revision 8758)
@@ -72,6 +72,6 @@
       ipf = F_SIZE(ptab)   ! 5th    -      use in "multi" case (array of pointers)
       !
-      ALLOCATE( zt3ns(jpi,jprecj,ipk,ipl,ipf,2), zt3sn(jpi,jprecj,ipk,ipl,ipf,2),   &
-         &      zt3ew(jpj,jpreci,ipk,ipl,ipf,2), zt3we(jpj,jpreci,ipk,ipl,ipf,2)  )
+      ALLOCATE( zt3ns(jpi,nn_hls,ipk,ipl,ipf,2), zt3sn(jpi,nn_hls,ipk,ipl,ipf,2),   &
+         &      zt3ew(jpj,nn_hls,ipk,ipl,ipf,2), zt3we(jpj,nn_hls,ipk,ipl,ipf,2)  )
       !
       ll_Iperio = nbondi == 2 .AND. (nperio == 1 .OR. nperio == 4 .OR. nperio == 6)
@@ -116,6 +116,6 @@
                ARRAY_IN(jpi,:,:,:,jf) = ARRAY_IN(  2  ,:,:,:,jf)
             ELSE                                   !* closed
-               IF( .NOT. NAT_IN(jf) == 'F' )   ARRAY_IN(     1       :jpreci,:,:,:,jf) = zland    ! east except F-point
-                                               ARRAY_IN(nlci-jpreci+1:jpi   ,:,:,:,jf) = zland    ! west
+               IF( .NOT. NAT_IN(jf) == 'F' )   ARRAY_IN(     1       :nn_hls,:,:,:,jf) = zland    ! east except F-point
+                                               ARRAY_IN(nlci-nn_hls+1:jpi   ,:,:,:,jf) = zland    ! west
             ENDIF
             !                                ! North-South boundaries
@@ -124,6 +124,6 @@
                ARRAY_IN(:,jpj,:,:,jf) = ARRAY_IN(:,   2  ,:,:,jf)
             ELSE                                   !* closed
-               IF( .NOT. NAT_IN(jf) == 'F' )   ARRAY_IN(:,     1       :jprecj,:,:,jf) = zland    ! south except F-point
-                                               ARRAY_IN(:,nlcj-jprecj+1:jpj   ,:,:,jf) = zland    ! north
+               IF( .NOT. NAT_IN(jf) == 'F' )   ARRAY_IN(:,     1       :nn_hls,:,:,jf) = zland    ! south except F-point
+                                               ARRAY_IN(:,nlcj-nn_hls+1:jpj   ,:,:,jf) = zland    ! north
             ENDIF
          END DO
@@ -142,6 +142,6 @@
             DO jl = 1, ipl
                DO jk = 1, ipk
-                  DO jh = 1, jpreci
-                     zt3ew(:,jh,jk,jl,jf,1) = ARRAY_IN(jpreci+jh,:,jk,jl,jf)
+                  DO jh = 1, nn_hls
+                     zt3ew(:,jh,jk,jl,jf,1) = ARRAY_IN(nn_hls+jh,:,jk,jl,jf)
                      zt3we(:,jh,jk,jl,jf,1) = ARRAY_IN(iihom +jh,:,jk,jl,jf)
                   END DO
@@ -152,5 +152,5 @@
       !
       !                           ! Migrations
-      imigr = jpreci * jpj * ipk * ipl * ipf
+      imigr = nn_hls * jpj * ipk * ipl * ipf
       !
       SELECT CASE ( nbondi )
@@ -173,5 +173,5 @@
       !
       !                           ! Write Dirichlet lateral conditions
-      iihom = nlci-jpreci
+      iihom = nlci-nn_hls
       !
       SELECT CASE ( nbondi )
@@ -180,5 +180,5 @@
             DO jl = 1, ipl
                DO jk = 1, ipk
-                  DO jh = 1, jpreci
+                  DO jh = 1, nn_hls
                      ARRAY_IN(iihom+jh,:,jk,jl,jf) = zt3ew(:,jh,jk,jl,jf,2)
                   END DO
@@ -190,5 +190,5 @@
             DO jl = 1, ipl
                DO jk = 1, ipk
-                  DO jh = 1, jpreci
+                  DO jh = 1, nn_hls
                      ARRAY_IN(jh      ,:,jk,jl,jf) = zt3we(:,jh,jk,jl,jf,2)
                      ARRAY_IN(iihom+jh,:,jk,jl,jf) = zt3ew(:,jh,jk,jl,jf,2)
@@ -201,5 +201,5 @@
             DO jl = 1, ipl
                DO jk = 1, ipk
-                  DO jh = 1, jpreci
+                  DO jh = 1, nn_hls
                      ARRAY_IN(jh      ,:,jk,jl,jf) = zt3we(:,jh,jk,jl,jf,2)
                   END DO
@@ -218,7 +218,7 @@
             DO jl = 1, ipl
                DO jk = 1, ipk
-                  DO jh = 1, jprecj
+                  DO jh = 1, nn_hls
                      zt3sn(:,jh,jk,jl,jf,1) = ARRAY_IN(:,ijhom +jh,jk,jl,jf)
-                     zt3ns(:,jh,jk,jl,jf,1) = ARRAY_IN(:,jprecj+jh,jk,jl,jf)
+                     zt3ns(:,jh,jk,jl,jf,1) = ARRAY_IN(:,nn_hls+jh,jk,jl,jf)
                   END DO
                END DO
@@ -228,5 +228,5 @@
       !
       !                           ! Migrations
-      imigr = jprecj * jpi * ipk * ipl * ipf
+      imigr = nn_hls * jpi * ipk * ipl * ipf
       !
       SELECT CASE ( nbondj )
@@ -249,5 +249,5 @@
       !
       !                           ! Write Dirichlet lateral conditions
-      ijhom = nlcj-jprecj
+      ijhom = nlcj-nn_hls
       !
       SELECT CASE ( nbondj )
@@ -256,5 +256,5 @@
             DO jl = 1, ipl
                DO jk = 1, ipk
-                  DO jh = 1, jprecj
+                  DO jh = 1, nn_hls
                      ARRAY_IN(:,ijhom+jh,jk,jl,jf) = zt3ns(:,jh,jk,jl,jf,2)
                   END DO
@@ -266,5 +266,5 @@
             DO jl = 1, ipl
                DO jk = 1, ipk
-                  DO jh = 1, jprecj
+                  DO jh = 1, nn_hls
                      ARRAY_IN(:,      jh,jk,jl,jf) = zt3sn(:,jh,jk,jl,jf,2)
                      ARRAY_IN(:,ijhom+jh,jk,jl,jf) = zt3ns(:,jh,jk,jl,jf,2)
@@ -277,5 +277,5 @@
             DO jl = 1, ipl
                DO jk = 1, ipk
-                  DO jh = 1, jprecj
+                  DO jh = 1, nn_hls
                      ARRAY_IN(:,jh,jk,jl,jf) = zt3sn(:,jh,jk,jl,jf,2)
                   END DO
Index: /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/LBC/mpp_nfd_generic.h90
===================================================================
--- /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/LBC/mpp_nfd_generic.h90	(revision 8757)
+++ /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/LBC/mpp_nfd_generic.h90	(revision 8758)
@@ -73,5 +73,5 @@
       ipj   = 4            ! 2nd dimension of message transfers (last j-lines)
       !
-      ALLOCATE( znorthloc(jpi,4,ipk,ipl,ipf) )
+      ALLOCATE( znorthloc(jpimax,4,ipk,ipl,ipf) )
       !
       znorthloc(:,:,:,:,:) = 0._wp
@@ -82,5 +82,5 @@
                DO jj = nlcj - ipj +1, nlcj
                   ij = jj - nlcj + ipj
-                  znorthloc(:,ij,jk,jl,jf) = ARRAY_IN(:,jj,jk,jl,jf)
+                  znorthloc(1:jpi,ij,jk,jl,jf) = ARRAY_IN(1:jpi,jj,jk,jl,jf)
                END DO
             END DO
@@ -89,5 +89,5 @@
       !
       !
-      itaille = jpi * ipj * ipk * ipl * ipf
+      itaille = jpimax * ipj * ipk * ipl * ipf
       !
       IF( l_north_nogather ) THEN      !==  ????  ==!
@@ -177,5 +177,5 @@
       ELSE                             !==  ????  ==!
          ALLOCATE( ztab       (jpiglo,4,ipk,ipl,ipf     ) )
-         ALLOCATE( znorthgloio(jpi   ,4,ipk,ipl,ipf,jpni) )
+         ALLOCATE( znorthgloio(jpimax,4,ipk,ipl,ipf,jpni) )
          !
          CALL MPI_ALLGATHER( znorthloc  , itaille, MPI_DOUBLE_PRECISION,                &
Index: /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/LBC/mppini.F90
===================================================================
--- /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/LBC/mppini.F90	(revision 8757)
+++ /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/LBC/mppini.F90	(revision 8758)
@@ -153,22 +153,24 @@
       !  dimensions divided by the number of processors minus the overlap array.
       !
-      nreci = 2 * jpreci
-      nrecj = 2 * jprecj
+      nreci = 2 * nn_hls
+      nrecj = 2 * nn_hls
       iresti = 1 + MOD( jpiglo - nreci -1 , jpni )
       irestj = 1 + MOD( jpjglo - nrecj -1 , jpnj )
       !
+      !  Need to use jpimax and jpjmax here since jpi and jpj have already been
+      !  shrunk to local sizes in nemogcm
 #if defined key_nemocice_decomp
       ! Change padding to be consistent with CICE
-      ilci(1:jpni-1      ,:) = jpi
-      ilci(jpni          ,:) = jpiglo - (jpni - 1) * (jpi - nreci)
-      !
-      ilcj(:,      1:jpnj-1) = jpj
-      ilcj(:,          jpnj) = jpjglo - (jpnj - 1) * (jpj - nrecj)
+      ilci(1:jpni-1      ,:) = jpimax
+      ilci(jpni          ,:) = jpiglo - (jpni - 1) * (jpimax - nreci)
+      !
+      ilcj(:,      1:jpnj-1) = jpjmax
+      ilcj(:,          jpnj) = jpjglo - (jpnj - 1) * (jpjmax - nrecj)
 #else
-      ilci(1:iresti      ,:) = jpi
-      ilci(iresti+1:jpni ,:) = jpi-1
-
-      ilcj(:,      1:irestj) = jpj
-      ilcj(:, irestj+1:jpnj) = jpj-1
+      ilci(1:iresti      ,:) = jpimax
+      ilci(iresti+1:jpni ,:) = jpimax-1
+
+      ilcj(:,      1:irestj) = jpjmax
+      ilcj(:, irestj+1:jpnj) = jpjmax-1
 #endif
       !
@@ -237,11 +239,11 @@
          ioea(ii,ij) = iproc + 1
          iono(ii,ij) = iproc + jpni
-         ildi(ii,ij) =  1  + jpreci
-         ilei(ii,ij) = ili - jpreci
+         ildi(ii,ij) =  1  + nn_hls
+         ilei(ii,ij) = ili - nn_hls
 
          IF( ibondi(ii,ij) == -1 .OR. ibondi(ii,ij) == 2 ) ildi(ii,ij) =  1
          IF( ibondi(ii,ij) ==  1 .OR. ibondi(ii,ij) == 2 ) ilei(ii,ij) = ili
-         ildj(ii,ij) =  1  + jprecj
-         ilej(ii,ij) = ilj - jprecj
+         ildj(ii,ij) =  1  + nn_hls
+         ilej(ii,ij) = ilj - nn_hls
          IF( ibondj(ii,ij) == -1 .OR. ibondj(ii,ij) == 2 ) ildj(ii,ij) =  1
          IF( ibondj(ii,ij) ==  1 .OR. ibondj(ii,ij) == 2 ) ilej(ii,ij) = ilj
@@ -441,6 +443,8 @@
       IF (lwp) THEN
          CALL ctl_opn( inum, 'layout.dat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE., narea )
-         WRITE(inum,'(a)') '   jpnij     jpi     jpj     jpk  jpiglo  jpjglo'
-         WRITE(inum,'(6i8)') jpnij,jpi,jpj,jpk,jpiglo,jpjglo
+         WRITE(inum,'(a)') '   jpnij   jpimax  jpjmax    jpk  jpiglo  jpjglo'//&
+   &           ' ( local:    narea     jpi     jpj)'
+         WRITE(inum,'(6i8,a,3i8,a)') jpnij,jpimax,jpjmax,jpk,jpiglo,jpjglo,&
+   &           ' ( local: ',narea,jpi,jpj,' )'
          WRITE(inum,'(a)') 'NAREA nlci nlcj nldi nldj nlei nlej nimp njmp nono noso nowe noea nbondi nbondj '
 
@@ -488,6 +492,5 @@
          WRITE(numout,*) ' nreci  = ', nreci  
          WRITE(numout,*) ' nrecj  = ', nrecj  
-         WRITE(numout,*) ' jpreci = ', jpreci 
-         WRITE(numout,*) ' jprecj = ', jprecj 
+         WRITE(numout,*) ' nn_hls = ', nn_hls 
       ENDIF
 
Index: /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
===================================================================
--- /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 8757)
+++ /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 8758)
@@ -239,4 +239,6 @@
       INTEGER  ::   ji                 ! dummy loop indices
       INTEGER  ::   ios, ilocal_comm   ! local integer
+      INTEGER  ::   iiarea, ijarea     ! local integers
+      INTEGER  ::   iirest, ijrest     ! local integers
       CHARACTER(len=120), DIMENSION(30) ::   cltxt, cltxt2, clnam
       !
@@ -282,17 +284,4 @@
       ENDIF
       !
-      jpk = jpkglo
-      !
-#if defined key_agrif
-      IF( .NOT. Agrif_Root() ) THEN       ! AGRIF children: specific setting (cf. agrif_user.F90)
-         jpiglo  = nbcellsx + 2 + 2*nbghostcells
-         jpjglo  = nbcellsy + 2 + 2*nbghostcells
-         jpi     = ( jpiglo-2*jpreci + (jpni-1+0) ) / jpni + 2*jpreci
-         jpj     = ( jpjglo-2*jprecj + (jpnj-1+0) ) / jpnj + 2*jprecj
-         nperio  = 0
-         jperio  = 0
-         ln_use_jattr = .false.
-      ENDIF
-#endif
       !
       !                             !--------------------------------------------!
@@ -353,18 +342,42 @@
 #endif
       ENDIF
+      !
+#if defined key_agrif
+      IF( .NOT. Agrif_Root() ) THEN       ! AGRIF children: specific setting (cf. agrif_user.F90)
+         jpiglo  = nbcellsx + 2 + 2*nbghostcells
+         jpjglo  = nbcellsy + 2 + 2*nbghostcells
+         jpi     = ( jpiglo-2*nn_hls + (jpni-1+0) ) / jpni + 2*nn_hls
+         jpj     = ( jpjglo-2*nn_hls + (jpnj-1+0) ) / jpnj + 2*nn_hls
+         jpimax  = jpi
+         jpjmax  = jpj
+         nperio  = 0
+         jperio  = 0
+         ln_use_jattr = .false.
+      ENDIF
+#endif
 
       IF( Agrif_Root() ) THEN       ! AGRIF mother: specific setting from jpni and jpnj
+         iiarea = 1 + MOD( narea - 1 , jpni )
+         ijarea = 1 + ( narea - 1 ) / jpni
+         iirest = 1 + MOD( jpiglo - 2*nn_hls - 1 , jpni )
+         ijrest = 1 + MOD( jpjglo - 2*nn_hls - 1 , jpnj )
 #if defined key_nemocice_decomp
-         jpi = ( nx_global+2-2*jpreci + (jpni-1) ) / jpni + 2*jpreci    ! first  dim.
-         jpj = ( ny_global+2-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj    ! second dim. 
+         jpi = ( nx_global+2-2*nn_hls + (jpni-1) ) / jpni + 2*nn_hls    ! first  dim.
+         jpj = ( ny_global+2-2*nn_hls + (jpnj-1) ) / jpnj + 2*nn_hls    ! second dim. 
+         jpimax  = jpi
+         jpjmax  = jpj
+         IF( iiarea == jpni ) jpi = jpiglo - (jpni - 1) * (jpi - 2*nn_hls)
+         IF( ijarea == jpnj ) jpj = jpjglo - (jpnj - 1) * (jpj - 2*nn_hls)
 #else
-         jpi = ( jpiglo     -2*jpreci + (jpni-1) ) / jpni + 2*jpreci    ! first  dim.
-         jpj = ( jpjglo     -2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj    ! second dim.
-#endif
-      ENDIF
-
-!!gm ???    why here  it has already been done in line 301 !
+         jpi = ( jpiglo     -2*nn_hls + (jpni-1) ) / jpni + 2*nn_hls    ! first  dim.
+         jpj = ( jpjglo     -2*nn_hls + (jpnj-1) ) / jpnj + 2*nn_hls    ! second dim.
+         jpimax  = jpi
+         jpjmax  = jpj
+         IF( iiarea > iirest ) jpi = jpi - 1
+         IF( ijarea > ijrest ) jpj = jpj - 1
+#endif
+      ENDIF
+
       jpk = jpkglo                                             ! third dim
-!!gm end
 
 #if defined key_agrif
@@ -414,4 +427,5 @@
       !                                      ! Domain decomposition
       CALL mpp_init
+      IF( ln_nnogather )    CALL nemo_northcomms! northfold neighbour lists (must be done after the masks are defined)
       !
       IF( nn_timing == 1 )  CALL timing_init
@@ -424,5 +438,5 @@
                             CALL     dom_init   ! Domain
       IF( ln_crs        )   CALL     crs_init   ! coarsened grid: domain initialization 
-      IF( ln_nnogather )    CALL nemo_northcomms! northfold neighbour lists (must be done after the masks are defined)
+      !IF( ln_nnogather )    CALL nemo_northcomms! northfold neighbour lists (must be done after the masks are defined)
       IF( ln_ctl        )   CALL prt_ctl_init   ! Print control
       
Index: /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/par_oce.F90
===================================================================
--- /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/par_oce.F90	(revision 8757)
+++ /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/par_oce.F90	(revision 8758)
@@ -54,6 +54,6 @@
 
    ! local domain size                !!! * local computational domain *
-   INTEGER, PUBLIC ::   jpi   ! = ( jpiglo-2*jpreci + (jpni-1) ) / jpni + 2*jpreci   !: first  dimension
-   INTEGER, PUBLIC ::   jpj   ! = ( jpjglo-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj   !: second dimension
+   INTEGER, PUBLIC ::   jpi   ! = ( jpiglo-2*nn_hls + (jpni-1) ) / jpni + 2*nn_hls   !: first  dimension
+   INTEGER, PUBLIC ::   jpj   ! = ( jpjglo-2*nn_hls + (jpnj-1) ) / jpnj + 2*nn_hls   !: second dimension
    INTEGER, PUBLIC ::   jpk   ! = jpkglo
    INTEGER, PUBLIC ::   jpim1 ! = jpi-1                                            !: inner domain indices
@@ -61,4 +61,6 @@
    INTEGER, PUBLIC ::   jpkm1 ! = jpk-1                                            !:   -     -      -
    INTEGER, PUBLIC ::   jpij  ! = jpi*jpj                                          !:  jpi x jpj
+   INTEGER, PUBLIC ::   jpimax! = maximum jpi across all areas 
+   INTEGER, PUBLIC ::   jpjmax! = maximum jpj across all areas
 
    !!---------------------------------------------------------------------
@@ -78,6 +80,5 @@
    INTEGER, PUBLIC, PARAMETER ::   jpr2di = 0   !: number of columns for extra outer halo 
    INTEGER, PUBLIC, PARAMETER ::   jpr2dj = 0   !: number of rows    for extra outer halo 
-   INTEGER, PUBLIC, PARAMETER ::   jpreci = 1   !: number of columns for overlap 
-   INTEGER, PUBLIC, PARAMETER ::   jprecj = 1   !: number of rows    for overlap 
+   INTEGER, PUBLIC, PARAMETER ::   nn_hls = 1   !: halo width (applies to both rows and columns)
 
    !!----------------------------------------------------------------------
Index: /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/SAO_SRC/nemogcm.F90
===================================================================
--- /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/SAO_SRC/nemogcm.F90	(revision 8757)
+++ /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/SAO_SRC/nemogcm.F90	(revision 8758)
@@ -93,4 +93,6 @@
       INTEGER ::   ji                 ! dummy loop indices
       INTEGER ::   ios, ilocal_comm   ! local integer
+      INTEGER  ::   iiarea, ijarea     ! local integers
+      INTEGER  ::   iirest, ijrest     ! local integers
       CHARACTER(len=120), DIMENSION(30) ::   cltxt, cltxt2, clnam
       !
@@ -209,21 +211,52 @@
 #endif
       ENDIF
+      !
+#if defined key_agrif
+      IF( .NOT. Agrif_Root() ) THEN       ! AGRIF children: specific setting (cf. agrif_user.F90)
+         jpiglo  = nbcellsx + 2 + 2*nbghostcells
+         jpjglo  = nbcellsy + 2 + 2*nbghostcells
+         jpi     = ( jpiglo-2*nn_hls + (jpni-1+0) ) / jpni + 2*nn_hls
+         jpj     = ( jpjglo-2*nn_hls + (jpnj-1+0) ) / jpnj + 2*nn_hls
+         jpimax  = jpi
+         jpjmax  = jpj
+         nperio  = 0
+         jperio  = 0
+         ln_use_jattr = .false.
+      ENDIF
+#endif
 
       IF( Agrif_Root() ) THEN       ! AGRIF mother: specific setting from jpni and jpnj
+         iiarea = 1 + MOD( narea - 1 , jpni )
+         ijarea = 1 + ( narea - 1 ) / jpni
+         iirest = 1 + MOD( jpiglo - 2*nn_hls - 1 , jpni )
+         ijrest = 1 + MOD( jpjglo - 2*nn_hls - 1 , jpnj )
 #if defined key_nemocice_decomp
-         jpi = ( nx_global+2-2*jpreci + (jpni-1) ) / jpni + 2*jpreci    ! first  dim.
-         jpj = ( ny_global+2-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj    ! second dim. 
+         jpi = ( nx_global+2-2*nn_hls + (jpni-1) ) / jpni + 2*nn_hls    ! first  dim.
+         jpj = ( ny_global+2-2*nn_hls + (jpnj-1) ) / jpnj + 2*nn_hls    ! second dim. 
+         jpimax  = jpi
+         jpjmax  = jpj
+         IF( iiarea == jpni ) jpi = jpiglo - (jpni - 1) * (jpi - 2*nn_hls)
+         IF( ijarea == jpnj ) jpj = jpjglo - (jpnj - 1) * (jpj - 2*nn_hls)
 #else
-         jpi = ( jpiglo     -2*jpreci + (jpni-1) ) / jpni + 2*jpreci    ! first  dim.
-         jpj = ( jpjglo     -2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj    ! second dim.
-#endif
-      ENDIF
-
-!!gm ???    why here  it has already been done in line 301 !
+         jpi = ( jpiglo     -2*nn_hls + (jpni-1) ) / jpni + 2*nn_hls    ! first  dim.
+         jpj = ( jpjglo     -2*nn_hls + (jpnj-1) ) / jpnj + 2*nn_hls    ! second dim.
+         jpimax  = jpi
+         jpjmax  = jpj
+         IF( iiarea > iirest ) jpi = jpi - 1
+         IF( ijarea > ijrest ) jpj = jpj - 1
+#endif
+      ENDIF
+
       jpk = jpkglo                                             ! third dim
-!!gm end
+
+#if defined key_agrif
+      ! simple trick to use same vertical grid as parent but different number of levels: 
+      ! Save maximum number of levels in jpkglo, then define all vertical grids with this number.
+      ! Suppress once vertical online interpolation is ok
+      IF(.NOT.Agrif_Root())   jpkglo = Agrif_Parent( jpkglo )
+#endif
       jpim1 = jpi-1                                            ! inner domain indices
       jpjm1 = jpj-1                                            !   "           "
-      jpkm1 = jpk-1                                            !   "           "
+      jpkm1 = MAX( 1, jpk-1 )                                  !   "           "
       jpij  = jpi*jpj                                          !  jpi x j
 
@@ -381,5 +414,5 @@
       !
       IF( numstp          /= -1 )   CLOSE( numstp          )   ! time-step file
-      IF( numsol          /= -1 )   CLOSE( numsol          )   ! solver file
+      IF( numrun          /= -1 )   CLOSE( numrun          )   ! run statistics file
       IF( numnam_ref      /= -1 )   CLOSE( numnam_ref      )   ! oce reference namelist
       IF( numnam_cfg      /= -1 )   CLOSE( numnam_cfg      )   ! oce configuration namelist
Index: /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90
===================================================================
--- /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90	(revision 8757)
+++ /branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90	(revision 8758)
@@ -74,5 +74,5 @@
       !
 #if defined key_agrif
-     CALL Agrif_Init_Grids()      ! AGRIF: set the meshes
+      CALL Agrif_Init_Grids()      ! AGRIF: set the meshes
 #endif
       !
@@ -167,4 +167,6 @@
       INTEGER  ::   ilocal_comm   ! local integer
       INTEGER  ::   ios, inum     !   -      -
+      INTEGER  ::   iiarea, ijarea     ! local integers
+      INTEGER  ::   iirest, ijrest     ! local integers
       CHARACTER(len=120), DIMENSION(30) ::   cltxt, cltxt2, clnam
       CHARACTER(len=80)                 ::   clname
@@ -220,17 +222,4 @@
       ENDIF
       !
-      jpk = jpkglo
-      !
-#if defined key_agrif
-      IF( .NOT. Agrif_Root() ) THEN       ! AGRIF children: specific setting (cf. agrif_user.F90)
-         jpiglo  = nbcellsx + 2 + 2*nbghostcells
-         jpjglo  = nbcellsy + 2 + 2*nbghostcells
-         jpi     = ( jpiglo-2*jpreci + (jpni-1+0) ) / jpni + 2*jpreci
-         jpj     = ( jpjglo-2*jprecj + (jpnj-1+0) ) / jpnj + 2*jprecj
-         nperio  = 0
-         jperio  = 0
-         ln_use_jattr = .false.
-      ENDIF
-#endif
       !
       !                             !--------------------------------------------!
@@ -289,14 +278,42 @@
 #endif
       ENDIF
+      !
+#if defined key_agrif
+      IF( .NOT. Agrif_Root() ) THEN       ! AGRIF children: specific setting (cf. agrif_user.F90)
+         jpiglo  = nbcellsx + 2 + 2*nbghostcells
+         jpjglo  = nbcellsy + 2 + 2*nbghostcells
+         jpi     = ( jpiglo-2*nn_hls + (jpni-1+0) ) / jpni + 2*nn_hls
+         jpj     = ( jpjglo-2*nn_hls + (jpnj-1+0) ) / jpnj + 2*nn_hls
+         jpimax  = jpi
+         jpjmax  = jpj
+         nperio  = 0
+         jperio  = 0
+         ln_use_jattr = .false.
+      ENDIF
+#endif
 
       IF( Agrif_Root() ) THEN       ! AGRIF mother: specific setting from jpni and jpnj
+         iiarea = 1 + MOD( narea - 1 , jpni )
+         ijarea = 1 + ( narea - 1 ) / jpni
+         iirest = 1 + MOD( jpiglo - 2*nn_hls - 1 , jpni )
+         ijrest = 1 + MOD( jpjglo - 2*nn_hls - 1 , jpnj )
 #if defined key_nemocice_decomp
-         jpi = ( nx_global+2-2*jpreci + (jpni-1) ) / jpni + 2*jpreci    ! first  dim.
-         jpj = ( ny_global+2-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj    ! second dim. 
+         jpi = ( nx_global+2-2*nn_hls + (jpni-1) ) / jpni + 2*nn_hls    ! first  dim.
+         jpj = ( ny_global+2-2*nn_hls + (jpnj-1) ) / jpnj + 2*nn_hls    ! second dim. 
+         jpimax  = jpi
+         jpjmax  = jpj
+         IF( iiarea == jpni ) jpi = jpiglo - (jpni - 1) * (jpi - 2*nn_hls)
+         IF( ijarea == jpnj ) jpj = jpjglo - (jpnj - 1) * (jpj - 2*nn_hls)
 #else
-         jpi = ( jpiglo     -2*jpreci + (jpni-1) ) / jpni + 2*jpreci    ! first  dim.
-         jpj = ( jpjglo     -2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj    ! second dim.
-#endif
-      ENDIF
+         jpi = ( jpiglo     -2*nn_hls + (jpni-1) ) / jpni + 2*nn_hls    ! first  dim.
+         jpj = ( jpjglo     -2*nn_hls + (jpnj-1) ) / jpnj + 2*nn_hls    ! second dim.
+         jpimax  = jpi
+         jpjmax  = jpj
+         IF( iiarea > iirest ) jpi = jpi - 1
+         IF( ijarea > ijrest ) jpj = jpj - 1
+#endif
+      ENDIF
+
+      jpk = jpkglo                                             ! third dim
 
 #if defined key_agrif
@@ -676,5 +693,5 @@
                 IF ((sxM .gt. sxT) .AND. (sxM .lt. dxT)) THEN
                    nsndto = nsndto + 1
-                     isendto(nsndto) = jn
+                   isendto(nsndto) = jn
                 ELSEIF ((sxM .le. sxT) .AND. (dxM .ge. dxT)) THEN
                    nsndto = nsndto + 1
