Index: NEMO/trunk/src/NST/agrif_oce_interp.F90
===================================================================
--- NEMO/trunk/src/NST/agrif_oce_interp.F90	(revision 14967)
+++ NEMO/trunk/src/NST/agrif_oce_interp.F90	(revision 14976)
@@ -44,5 +44,5 @@
    PUBLIC   interptsn, interpsshn, interpavm
    PUBLIC   interpunb, interpvnb , interpub2b, interpvb2b
-   PUBLIC   interpe3t, interpglamt, interpgphit
+   PUBLIC   interpglamt, interpgphit
    PUBLIC   interpht0, interpmbkt, interpe3t0_vremap
    PUBLIC   agrif_istate_oce, agrif_istate_ssh   ! called by icestate.F90 and domvvl.F90
@@ -216,5 +216,5 @@
       IF( lk_west ) THEN
          ibdy1 = nn_hls + 2                  ! halo + land + 1
-         ibdy2 = nn_hls + 1 + nbghostcells + nn_shift_bar*Agrif_Rhox()   ! halo + land + nbghostcells
+         ibdy2 = nn_hls + nbghostcells + nn_shift_bar*Agrif_Rhox()   ! halo + land + nbghostcells
          !
          IF( .NOT.ln_dynspg_ts ) THEN  ! Store transport
@@ -265,5 +265,5 @@
       ! --- East --- !
       IF( lk_east) THEN
-         ibdy1 = jpiglo - ( nn_hls + nbghostcells + 1) - nn_shift_bar*Agrif_Rhox()    
+         ibdy1 = jpiglo - ( nn_hls + nbghostcells ) - nn_shift_bar*Agrif_Rhox()    
          ibdy2 = jpiglo - ( nn_hls + 2 )                 
          !
@@ -293,5 +293,5 @@
          END DO
          !
-         ibdy1 = jpiglo - ( nn_hls + nbghostcells ) - nn_shift_bar*Agrif_Rhox() 
+         ibdy1 = jpiglo - ( nn_hls + nbghostcells - 1 ) - nn_shift_bar*Agrif_Rhox() 
          ibdy2 = jpiglo - ( nn_hls + 1 )     
          !
@@ -326,5 +326,5 @@
       IF( lk_south ) THEN
          jbdy1 = nn_hls + 2                 
-         jbdy2 = nn_hls + 1 + nbghostcells + nn_shift_bar*Agrif_Rhoy()   
+         jbdy2 = nn_hls + nbghostcells + nn_shift_bar*Agrif_Rhoy()   
          !
          IF( .NOT.ln_dynspg_ts ) THEN
@@ -375,5 +375,5 @@
       ! --- North --- !
       IF( lk_north ) THEN
-         jbdy1 = jpjglo - ( nn_hls + nbghostcells + 1) - nn_shift_bar*Agrif_Rhoy() 
+         jbdy1 = jpjglo - ( nn_hls + nbghostcells ) - nn_shift_bar*Agrif_Rhoy() 
          jbdy2 = jpjglo - ( nn_hls + 2 )
          !
@@ -403,5 +403,5 @@
          END DO
          !
-         jbdy1 = jpjglo - ( nn_hls + nbghostcells ) - nn_shift_bar*Agrif_Rhoy()  
+         jbdy1 = jpjglo - ( nn_hls + nbghostcells -1 ) - nn_shift_bar*Agrif_Rhoy()  
          jbdy2 = jpjglo - ( nn_hls + 1 )
          !
@@ -451,5 +451,5 @@
       IF( lk_west ) THEN
          istart = nn_hls + 2                              ! halo + land + 1
-         iend   = nn_hls + 1 + nbghostcells  + nn_shift_bar*Agrif_Rhox()              ! halo + land + nbghostcells
+         iend   = nn_hls + nbghostcells  + nn_shift_bar*Agrif_Rhox()              ! halo + land + nbghostcells
          DO ji = mi0(istart), mi1(iend)
             DO jj=1,jpj
@@ -462,5 +462,5 @@
       !--- East ---!
       IF( lk_east ) THEN
-         istart = jpiglo - ( nn_hls + nbghostcells ) - nn_shift_bar*Agrif_Rhox() 
+         istart = jpiglo - ( nn_hls + nbghostcells -1 ) - nn_shift_bar*Agrif_Rhox() 
          iend   = jpiglo - ( nn_hls + 1 )                
          DO ji = mi0(istart), mi1(iend)
@@ -470,5 +470,5 @@
             END DO
          END DO
-         istart = jpiglo - ( nn_hls + nbghostcells + 1) - nn_shift_bar*Agrif_Rhox() 
+         istart = jpiglo - ( nn_hls + nbghostcells ) - nn_shift_bar*Agrif_Rhox() 
          iend   = jpiglo - ( nn_hls + 2 )                
          DO ji = mi0(istart), mi1(iend)
@@ -482,5 +482,5 @@
       IF( lk_south ) THEN
          jstart = nn_hls + 2                              
-         jend   = nn_hls + 1 + nbghostcells + nn_shift_bar*Agrif_Rhoy()           
+         jend   = nn_hls + nbghostcells + nn_shift_bar*Agrif_Rhoy()           
          DO jj = mj0(jstart), mj1(jend)
 
@@ -494,5 +494,5 @@
       !--- North ---!
       IF( lk_north ) THEN
-         jstart = jpjglo - ( nn_hls + nbghostcells ) - nn_shift_bar*Agrif_Rhoy()     
+         jstart = jpjglo - ( nn_hls + nbghostcells -1 ) - nn_shift_bar*Agrif_Rhoy()     
          jend   = jpjglo - ( nn_hls + 1 )                
          DO jj = mj0(jstart), mj1(jend)
@@ -501,5 +501,5 @@
             END DO
          END DO
-         jstart = jpjglo - ( nn_hls + nbghostcells + 1) - nn_shift_bar*Agrif_Rhoy() 
+         jstart = jpjglo - ( nn_hls + nbghostcells ) - nn_shift_bar*Agrif_Rhoy() 
          jend   = jpjglo - ( nn_hls + 2 )                
          DO jj = mj0(jstart), mj1(jend)
@@ -529,5 +529,5 @@
       IF( lk_west ) THEN
          istart = nn_hls + 2                              
-         iend   = nn_hls + 1 + nbghostcells + nn_shift_bar*Agrif_Rhox() 
+         iend   = nn_hls + nbghostcells + nn_shift_bar*Agrif_Rhox() 
          DO ji = mi0(istart), mi1(iend)
             DO jj=1,jpj
@@ -540,5 +540,5 @@
       !--- East ---!
       IF( lk_east ) THEN
-         istart = jpiglo - ( nn_hls + nbghostcells ) - nn_shift_bar*Agrif_Rhox()
+         istart = jpiglo - ( nn_hls + nbghostcells -1 ) - nn_shift_bar*Agrif_Rhox()
          iend   = jpiglo - ( nn_hls + 1 )                 
          DO ji = mi0(istart), mi1(iend)
@@ -547,5 +547,5 @@
             END DO
          END DO
-         istart = jpiglo - ( nn_hls + nbghostcells + 1) - nn_shift_bar*Agrif_Rhox() 
+         istart = jpiglo - ( nn_hls + nbghostcells ) - nn_shift_bar*Agrif_Rhox() 
          iend   = jpiglo - ( nn_hls + 2 )                 
          DO ji = mi0(istart), mi1(iend)
@@ -559,5 +559,5 @@
       IF( lk_south ) THEN
          jstart = nn_hls + 2                              
-         jend   = nn_hls + 1 + nbghostcells + nn_shift_bar*Agrif_Rhoy() 
+         jend   = nn_hls + nbghostcells + nn_shift_bar*Agrif_Rhoy() 
          DO jj = mj0(jstart), mj1(jend)
             DO ji=1,jpi
@@ -570,5 +570,5 @@
       !--- North ---!
       IF( lk_north ) THEN
-         jstart = jpjglo - ( nn_hls + nbghostcells ) - nn_shift_bar*Agrif_Rhoy() 
+         jstart = jpjglo - ( nn_hls + nbghostcells -1 ) - nn_shift_bar*Agrif_Rhoy() 
          jend   = jpjglo - ( nn_hls + 1 )                
          DO jj = mj0(jstart), mj1(jend)
@@ -577,5 +577,5 @@
             END DO
          END DO
-         jstart = jpjglo - ( nn_hls + nbghostcells + 1) - nn_shift_bar*Agrif_Rhoy() 
+         jstart = jpjglo - ( nn_hls + nbghostcells ) - nn_shift_bar*Agrif_Rhoy() 
          jend   = jpjglo - ( nn_hls + 2 )               
          DO jj = mj0(jstart), mj1(jend)
@@ -672,5 +672,5 @@
       IF(lk_west) THEN
          istart = nn_hls + 2                                                          ! halo + land + 1
-         iend   = nn_hls + 1 + nbghostcells + nn_shift_bar*Agrif_Rhox()               ! halo + land + nbghostcells
+         iend   = nn_hls + nbghostcells + nn_shift_bar*Agrif_Rhox()               ! halo + land + nbghostcells
          DO ji = mi0(istart), mi1(iend)
             DO jj = 1, jpj
@@ -682,5 +682,5 @@
       ! --- East --- !
       IF(lk_east) THEN
-         istart = jpiglo - ( nn_hls + nbghostcells ) - nn_shift_bar*Agrif_Rhox()       ! halo + land + nbghostcells - 1
+         istart = jpiglo - ( nn_hls + nbghostcells -1 ) - nn_shift_bar*Agrif_Rhox()       ! halo + land + nbghostcells - 1
          iend   = jpiglo - ( nn_hls + 1 )                                              ! halo + land + 1            - 1
          DO ji = mi0(istart), mi1(iend)
@@ -694,5 +694,5 @@
       IF(lk_south) THEN
          jstart = nn_hls + 2                                                          ! halo + land + 1
-         jend   = nn_hls + 1 + nbghostcells + nn_shift_bar*Agrif_Rhoy()               ! halo + land + nbghostcells
+         jend   = nn_hls + nbghostcells + nn_shift_bar*Agrif_Rhoy()               ! halo + land + nbghostcells
          DO jj = mj0(jstart), mj1(jend)
             DO ji = 1, jpi
@@ -704,5 +704,5 @@
       ! --- North --- !
       IF(lk_north) THEN
-         jstart = jpjglo - ( nn_hls + nbghostcells ) - nn_shift_bar*Agrif_Rhoy()     ! halo + land + nbghostcells - 1
+         jstart = jpjglo - ( nn_hls + nbghostcells -1 ) - nn_shift_bar*Agrif_Rhoy()     ! halo + land + nbghostcells - 1
          jend   = jpjglo - ( nn_hls + 1 )                                            ! halo + land + 1            - 1
          DO jj = mj0(jstart), mj1(jend)
@@ -731,5 +731,5 @@
       IF(lk_west) THEN
          istart = nn_hls + 2                                                        ! halo + land + 1
-         iend   = nn_hls + 1 + nbghostcells + nn_shift_bar*Agrif_Rhox()             ! halo + land + nbghostcells
+         iend   = nn_hls + nbghostcells + nn_shift_bar*Agrif_Rhox()             ! halo + land + nbghostcells
          DO ji = mi0(istart), mi1(iend)
             DO jj = 1, jpj
@@ -741,5 +741,5 @@
       ! --- East --- !
       IF(lk_east) THEN
-         istart = jpiglo - ( nn_hls + nbghostcells ) - nn_shift_bar*Agrif_Rhox()    ! halo + land + nbghostcells - 1
+         istart = jpiglo - ( nn_hls + nbghostcells -1 ) - nn_shift_bar*Agrif_Rhox()    ! halo + land + nbghostcells - 1
          iend   = jpiglo - ( nn_hls + 1 )                                           ! halo + land + 1            - 1
          DO ji = mi0(istart), mi1(iend)
@@ -753,5 +753,5 @@
       IF(lk_south) THEN
          jstart = nn_hls + 2                                                        ! halo + land + 1
-         jend   = nn_hls + 1 + nbghostcells + nn_shift_bar*Agrif_Rhoy()             ! halo + land + nbghostcells
+         jend   = nn_hls + nbghostcells + nn_shift_bar*Agrif_Rhoy()             ! halo + land + nbghostcells
          DO jj = mj0(jstart), mj1(jend)
             DO ji = 1, jpi
@@ -763,5 +763,5 @@
       ! --- North --- !
       IF(lk_north) THEN
-         jstart = jpjglo - ( nn_hls + nbghostcells ) - nn_shift_bar*Agrif_Rhoy()    ! halo + land + nbghostcells - 1
+         jstart = jpjglo - ( nn_hls + nbghostcells -1 ) - nn_shift_bar*Agrif_Rhoy()    ! halo + land + nbghostcells - 1
          jend   = jpjglo - ( nn_hls + 1 )                                           ! halo + land + 1            - 1
          DO jj = mj0(jstart), mj1(jend)
@@ -1418,5 +1418,5 @@
             DO jj=j1,j2
                IF (utint_stage(ji,jj)==0) THEN 
-                  zx = 2._wp*MOD(ABS(mig0(ji)-nbghostcells-1), INT(Agrif_Rhox()))/zrhox - 1._wp  
+                  zx = 2._wp*MOD(ABS(mig0(ji)-nbghostcells), INT(Agrif_Rhox()))/zrhox - 1._wp  
                   ubdy(ji,jj) = ubdy(ji,jj) + 0.25_wp*(1._wp-zx*zx) * ptab(ji,jj) & 
                               &         / zrhoy *r1_e2u(ji,jj) * umask(ji,jj,1) 
@@ -1522,5 +1522,5 @@
             DO jj=j1,j2
                IF (vtint_stage(ji,jj)==0) THEN 
-                  zy = 2._wp*MOD(ABS(mjg0(jj)-nbghostcells-1), INT(Agrif_Rhoy()))/zrhoy - 1._wp  
+                  zy = 2._wp*MOD(ABS(mjg0(jj)-nbghostcells), INT(Agrif_Rhoy()))/zrhoy - 1._wp  
                   vbdy(ji,jj) = vbdy(ji,jj) + 0.25_wp*(1._wp-zy*zy) * ptab(ji,jj) & 
                               &         / zrhox * r1_e1v(ji,jj) * vmask(ji,jj,1) 
@@ -1533,37 +1533,4 @@
       ! 
    END SUBROUTINE vb2b_cor
-
-
-   SUBROUTINE interpe3t( ptab, i1, i2, j1, j2, k1, k2, before )
-      !!----------------------------------------------------------------------
-      !!                  ***  ROUTINE interpe3t  ***
-      !!----------------------------------------------------------------------  
-      INTEGER                              , INTENT(in   ) :: i1, i2, j1, j2, k1, k2
-      REAL(wp),DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) :: ptab
-      LOGICAL                              , INTENT(in   ) :: before
-      !
-      INTEGER :: ji, jj, jk
-      !!----------------------------------------------------------------------  
-      !    
-      IF( before ) THEN
-         ptab(i1:i2,j1:j2,k1:k2) = tmask(i1:i2,j1:j2,k1:k2) * e3t_0(i1:i2,j1:j2,k1:k2)
-      ELSE
-         !
-         DO jk = k1, k2
-            DO jj = j1, j2
-               DO ji = i1, i2
-                  IF( ABS( ptab(ji,jj,jk) - tmask(ji,jj,jk) * e3t_0(ji,jj,jk) ) > 1.D-2) THEN
-                     WRITE(numout,*) ' Agrif error for e3t_0: parent , child, i, j, k ',  & 
-                     &                 ptab(ji,jj,jk), tmask(ji,jj,jk) * e3t_0(ji,jj,jk), &
-                     &                 mig0(ji), mjg0(jj), jk
-                     kindic_agr = kindic_agr + 1
-                  ENDIF
-               END DO
-            END DO
-         END DO
-         !
-      ENDIF
-      ! 
-   END SUBROUTINE interpe3t
 
 
@@ -1793,5 +1760,5 @@
       INTEGER, INTENT(inout) ::   iindic
       !!
-      INTEGER :: ji, jj
+      INTEGER :: ji, jj, jk
       INTEGER  :: istart, iend, jstart, jend, ispon
       !!----------------------------------------------------------------------  
@@ -1802,13 +1769,60 @@
          ispon  = nn_sponge_len * Agrif_irhox()
          istart = nn_hls + 2                                  ! halo + land + 1
-         iend   = nn_hls + 1 + nbghostcells + ispon           ! halo + land + nbghostcells + sponge
-         jstart = nn_hls + 2
+         iend   = nn_hls + nbghostcells + ispon           ! halo + land + nbghostcells + sponge
+         jstart = nn_hls + 2 
+         jend   = jpjglo - nn_hls - 1 
+         DO ji = mi0(istart), mi1(iend)
+            DO jj = mj0(jstart), mj1(jend)
+               IF ( ABS(ht0_parent(ji,jj)-ht_0(ji,jj)) > 1.e-3 ) iindic = iindic + 1
+               IF ( .NOT.ln_vert_remap) THEN
+                  DO jk = 1, jpkm1
+                     IF ( ABS(e3t0_parent(ji,jj,jk)-e3t_0(ji,jj,jk))*tmask(ji,jj,jk) > 1.e-3 ) iindic = iindic + 1
+                  END DO 
+               ENDIF
+            END DO
+            DO jj = mj0(jstart), mj1(jend-1)
+               IF ( ABS(hv0_parent(ji,jj)-hv_0(ji,jj)) > 1.e-3 ) iindic = iindic + 1
+               IF ( .NOT.ln_vert_remap) THEN
+                  DO jk = 1, jpkm1
+                     IF ( ABS(e3v0_parent(ji,jj,jk)-e3v_0(ji,jj,jk))*vmask(ji,jj,jk) > 1.e-3 ) iindic = iindic + 1
+                  END DO 
+               ENDIF
+            END DO
+         END DO
+         DO ji = mi0(istart), mi1(iend-1)
+            DO jj = mj0(jstart), mj1(jend)
+               IF ( ABS(hu0_parent(ji,jj)-hu_0(ji,jj)) > 1.e-3 ) iindic = iindic + 1
+               IF ( .NOT.ln_vert_remap) THEN
+                  DO jk = 1, jpkm1
+                     IF ( ABS(e3u0_parent(ji,jj,jk)-e3u_0(ji,jj,jk))*umask(ji,jj,jk) > 1.e-3 ) iindic = iindic + 1
+                  END DO 
+               ENDIF
+            END DO
+         END DO
+      ENDIF
+      !
+      ! --- East --- !
+      IF(lk_east) THEN
+         ispon  = nn_sponge_len * Agrif_irhox() 
+         istart = jpiglo - ( nn_hls + nbghostcells + ispon -1 )  ! halo + land + nbghostcells + sponge - 1
+         iend   = jpiglo - nn_hls - 1                            ! halo + land + 1                     - 1
+         jstart = nn_hls + 2 
          jend   = jpjglo - nn_hls - 1
          DO ji = mi0(istart), mi1(iend)
             DO jj = mj0(jstart), mj1(jend)
                IF ( ABS(ht0_parent(ji,jj)-ht_0(ji,jj)) > 1.e-3 ) iindic = iindic + 1
+               IF ( .NOT.ln_vert_remap) THEN
+                  DO jk = 1, jpkm1
+                     IF ( ABS(e3t0_parent(ji,jj,jk)-e3t_0(ji,jj,jk))*tmask(ji,jj,jk) > 1.e-3 ) iindic = iindic + 1
+                  END DO 
+               ENDIF
             END DO
             DO jj = mj0(jstart), mj1(jend-1)
                IF ( ABS(hv0_parent(ji,jj)-hv_0(ji,jj)) > 1.e-3 ) iindic = iindic + 1
+               IF ( .NOT.ln_vert_remap) THEN
+                  DO jk = 1, jpkm1
+                     IF ( ABS(e3v0_parent(ji,jj,jk)-e3v_0(ji,jj,jk))*vmask(ji,jj,jk) > 1.e-3 ) iindic = iindic + 1
+                  END DO 
+               ENDIF
             END DO
          END DO
@@ -1816,26 +1830,9 @@
             DO jj = mj0(jstart), mj1(jend)
                IF ( ABS(hu0_parent(ji,jj)-hu_0(ji,jj)) > 1.e-3 ) iindic = iindic + 1
-            END DO
-         END DO
-      ENDIF
-      !
-      ! --- East --- !
-      IF(lk_east) THEN
-         ispon  = nn_sponge_len * Agrif_irhox() 
-         istart = jpiglo - ( nn_hls + nbghostcells + ispon )  ! halo + land + nbghostcells + sponge - 1
-         iend   = jpiglo - ( nn_hls + 1 )                     ! halo + land + 1                     - 1
-         jstart = nn_hls + 2
-         jend   = jpjglo - nn_hls - 1 
-         DO ji = mi0(istart), mi1(iend)
-            DO jj = mj0(jstart), mj1(jend)
-               IF ( ABS(ht0_parent(ji,jj)-ht_0(ji,jj)) > 1.e-3 ) iindic = iindic + 1
-            END DO
-            DO jj = mj0(jstart), mj1(jend-1)
-               IF ( ABS(hv0_parent(ji,jj)-hv_0(ji,jj)) > 1.e-3 ) iindic = iindic + 1
-            END DO
-         END DO
-         DO ji = mi0(istart+1), mi1(iend-1)
-            DO jj = mj0(jstart), mj1(jend)
-               IF ( ABS(hu0_parent(ji,jj)-hu_0(ji,jj)) > 1.e-3 ) iindic = iindic + 1
+               IF ( .NOT.ln_vert_remap) THEN
+                  DO jk = 1, jpkm1
+                     IF ( ABS(e3u0_parent(ji,jj,jk)-e3u_0(ji,jj,jk))*umask(ji,jj,jk) > 1.e-3 ) iindic = iindic + 1
+                  END DO 
+               ENDIF
             END DO
          END DO
@@ -1844,15 +1841,25 @@
       ! --- South --- !
       IF(lk_south) THEN
-         ispon  = nn_sponge_len * Agrif_irhoy() 
+         ispon  = nn_sponge_len * Agrif_irhoy()  
          jstart = nn_hls + 2                                 ! halo + land + 1
-         jend   = nn_hls + 1 + nbghostcells + ispon          ! halo + land + nbghostcells + sponge
-         istart = nn_hls + 2
-         iend   = jpiglo - nn_hls - 1
+         jend   = nn_hls + nbghostcells + ispon          ! halo + land + nbghostcells + sponge
+         istart = nn_hls + 2 
+         iend   = jpiglo - nn_hls - 1 
          DO jj = mj0(jstart), mj1(jend)
             DO ji = mi0(istart), mi1(iend)
                IF ( ABS(ht0_parent(ji,jj)-ht_0(ji,jj)) > 1.e-3 ) iindic = iindic + 1
+               IF ( .NOT.ln_vert_remap) THEN
+                  DO jk = 1, jpkm1
+                     IF ( ABS(e3t0_parent(ji,jj,jk)-e3t_0(ji,jj,jk))*tmask(ji,jj,jk) > 1.e-3 ) iindic = iindic + 1
+                  END DO 
+               ENDIF
             END DO
             DO ji = mi0(istart), mi1(iend-1)
                IF ( ABS(hu0_parent(ji,jj)-hu_0(ji,jj)) > 1.e-3 ) iindic = iindic + 1
+               IF ( .NOT.ln_vert_remap) THEN
+                  DO jk = 1, jpkm1
+                     IF ( ABS(e3u0_parent(ji,jj,jk)-e3u_0(ji,jj,jk))*umask(ji,jj,jk) > 1.e-3 ) iindic = iindic + 1
+                  END DO 
+               ENDIF
             END DO
          END DO
@@ -1860,4 +1867,9 @@
             DO ji = mi0(istart), mi1(iend)
                IF ( ABS(hv0_parent(ji,jj)-hv_0(ji,jj)) > 1.e-3 ) iindic = iindic + 1
+               IF ( .NOT.ln_vert_remap) THEN
+                  DO jk = 1, jpkm1
+                     IF ( ABS(e3v0_parent(ji,jj,jk)-e3v_0(ji,jj,jk))*vmask(ji,jj,jk) > 1.e-3 ) iindic = iindic + 1
+                  END DO 
+               ENDIF
             END DO
          END DO
@@ -1867,19 +1879,34 @@
       IF(lk_north) THEN
          ispon  = nn_sponge_len * Agrif_irhoy() 
-         jstart = jpjglo - ( nn_hls + nbghostcells + ispon)  ! halo + land + nbghostcells +sponge - 1
-         jend   = jpjglo - ( nn_hls + 1 )                    ! halo + land + 1            - 1
-         istart = nn_hls + 2
-         iend   = jpiglo - nn_hls - 1
+         jstart = jpjglo - ( nn_hls + nbghostcells + ispon - 1)  ! halo + land + nbghostcells +sponge - 1
+         jend   = jpjglo - nn_hls - 1                            ! halo + land + 1            - 1
+         istart = nn_hls + 2 
+         iend   = jpiglo - nn_hls - 1 
          DO jj = mj0(jstart), mj1(jend)
             DO ji = mi0(istart), mi1(iend)
                IF ( ABS(ht0_parent(ji,jj)-ht_0(ji,jj)) > 1.e-3 ) iindic = iindic + 1
+               IF ( .NOT.ln_vert_remap) THEN
+                  DO jk = 1, jpkm1
+                     IF ( ABS(e3t0_parent(ji,jj,jk)-e3t_0(ji,jj,jk))*tmask(ji,jj,jk) > 1.e-3 ) iindic = iindic + 1
+                  END DO 
+               ENDIF
             END DO
             DO ji = mi0(istart), mi1(iend-1)
                IF ( ABS(hu0_parent(ji,jj)-hu_0(ji,jj)) > 1.e-3 ) iindic = iindic + 1
-            END DO
-         END DO
-         DO jj = mj0(jstart+1), mj1(jend-1)
+               IF ( .NOT.ln_vert_remap) THEN
+                  DO jk = 1, jpkm1
+                     IF ( ABS(e3u0_parent(ji,jj,jk)-e3u_0(ji,jj,jk))*umask(ji,jj,jk) > 1.e-3 ) iindic = iindic + 1
+                  END DO 
+               ENDIF
+            END DO
+         END DO
+         DO jj = mj0(jstart), mj1(jend-1)
             DO ji = mi0(istart), mi1(iend)
                IF ( ABS(hv0_parent(ji,jj)-hv_0(ji,jj)) > 1.e-3 ) iindic = iindic + 1
+               IF ( .NOT.ln_vert_remap) THEN
+                  DO jk = 1, jpkm1
+                     IF ( ABS(e3v0_parent(ji,jj,jk)-e3v_0(ji,jj,jk))*vmask(ji,jj,jk) > 1.e-3 ) iindic = iindic + 1
+                  END DO 
+               ENDIF
             END DO
          END DO
Index: NEMO/trunk/src/NST/agrif_oce_sponge.F90
===================================================================
--- NEMO/trunk/src/NST/agrif_oce_sponge.F90	(revision 14967)
+++ NEMO/trunk/src/NST/agrif_oce_sponge.F90	(revision 14976)
@@ -150,7 +150,7 @@
       ztabramp(:,:) = 0._wp
 
-      IF( lk_west ) THEN                             ! --- West --- !
-         ind1 = nn_hls + 1 + nbghostcells               ! halo + land + nbghostcells
-         ind2 = nn_hls + 1 + nbghostcells + ispongearea 
+      IF( lk_west ) THEN                            ! --- West --- !
+         ind1 = nn_hls + nbghostcells               ! halo + nbghostcells
+         ind2 = nn_hls + nbghostcells + ispongearea 
          DO ji = mi0(ind1), mi1(ind2)   
             DO jj = 1, jpj               
@@ -160,5 +160,5 @@
          ! ghost cells:
          ind1 = 1
-         ind2 = nn_hls + 1 + nbghostcells               ! halo + land + nbghostcells
+         ind2 = nn_hls +  nbghostcells              ! halo + nbghostcells
          DO ji = mi0(ind1), mi1(ind2)   
             DO jj = 1, jpj               
@@ -168,6 +168,6 @@
       ENDIF
       IF( lk_east ) THEN                             ! --- East --- !
-         ind1 = jpiglo - ( nn_hls + nbghostcells ) - ispongearea - 1
-         ind2 = jpiglo - ( nn_hls + nbghostcells ) - 1    ! halo + land + nbghostcells - 1
+         ind1 = jpiglo - ( nn_hls + nbghostcells -1 ) - ispongearea - 1
+         ind2 = jpiglo - ( nn_hls + nbghostcells -1 ) - 1    ! halo + land + nbghostcells - 1
          DO ji = mi0(ind1), mi1(ind2)
             DO jj = 1, jpj
@@ -176,5 +176,5 @@
          END DO
          ! ghost cells:
-         ind1 = jpiglo - ( nn_hls + nbghostcells ) - 1    ! halo + land + nbghostcells - 1
+         ind1 = jpiglo - ( nn_hls + nbghostcells -1 ) - 1    ! halo + land + nbghostcells - 1
          ind2 = jpiglo - 1
          DO ji = mi0(ind1), mi1(ind2)
@@ -185,6 +185,6 @@
       ENDIF      
       IF( lk_south ) THEN                            ! --- South --- !
-         ind1 = nn_hls + 1 + nbghostcells                 ! halo + land + nbghostcells
-         ind2 = nn_hls + 1 + nbghostcells + jspongearea 
+         ind1 = nn_hls + nbghostcells                ! halo + nbghostcells
+         ind2 = nn_hls + nbghostcells + jspongearea 
          DO jj = mj0(ind1), mj1(ind2) 
             DO ji = 1, jpi
@@ -194,5 +194,5 @@
          ! ghost cells:
          ind1 = 1
-         ind2 = nn_hls + 1 + nbghostcells                 ! halo + land + nbghostcells
+         ind2 = nn_hls + nbghostcells                ! halo + nbghostcells
          DO jj = mj0(ind1), mj1(ind2) 
             DO ji = 1, jpi
@@ -202,6 +202,6 @@
       ENDIF
       IF( lk_north ) THEN                            ! --- North --- !
-         ind1 = jpjglo - ( nn_hls + nbghostcells ) - jspongearea - 1
-         ind2 = jpjglo - ( nn_hls + nbghostcells ) - 1    ! halo + land + nbghostcells - 1
+         ind1 = jpjglo - ( nn_hls + nbghostcells -1 ) - jspongearea - 1
+         ind2 = jpjglo - ( nn_hls + nbghostcells -1 ) - 1    ! halo + nbghostcells - 1
          DO jj = mj0(ind1), mj1(ind2)
             DO ji = 1, jpi
@@ -210,5 +210,5 @@
          END DO
          ! ghost cells:
-         ind1 = jpjglo - ( nn_hls + nbghostcells )      ! halo + land + nbghostcells - 1
+         ind1 = jpjglo - ( nn_hls + nbghostcells -1 )      ! halo + land + nbghostcells - 1
          ind2 = jpjglo
          DO jj = mj0(ind1), mj1(ind2)
@@ -284,6 +284,6 @@
 
       IF( lk_west ) THEN                             ! --- West --- !
-         ind1 = nn_hls + 1 + nbghostcells + ishift
-         ind2 = nn_hls + 1 + nbghostcells + ishift + ispongearea 
+         ind1 = nn_hls + nbghostcells + ishift
+         ind2 = nn_hls + nbghostcells + ishift + ispongearea 
          DO ji = mi0(ind1), mi1(ind2)   
             DO jj = 1, jpj               
@@ -293,5 +293,5 @@
          ! ghost cells:
          ind1 = 1
-         ind2 = nn_hls + 1 + nbghostcells + ishift               ! halo + land + nbghostcells
+         ind2 = nn_hls + nbghostcells + ishift               ! halo + nbghostcells
          DO ji = mi0(ind1), mi1(ind2)   
             DO jj = 1, jpj               
@@ -301,6 +301,6 @@
       ENDIF
       IF( lk_east ) THEN                             ! --- East --- !
-         ind1 = jpiglo - ( nn_hls + nbghostcells + ishift) - ispongearea - 1
-         ind2 = jpiglo - ( nn_hls + nbghostcells + ishift) - 1    ! halo + land + nbghostcells - 1
+         ind1 = jpiglo - ( nn_hls + nbghostcells -1  + ishift) - ispongearea - 1
+         ind2 = jpiglo - ( nn_hls + nbghostcells -1  + ishift) - 1    ! halo + nbghostcells - 1
          DO ji = mi0(ind1), mi1(ind2)
             DO jj = 1, jpj
@@ -309,5 +309,5 @@
          END DO
          ! ghost cells:
-         ind1 = jpiglo - ( nn_hls + nbghostcells + ishift) - 1    ! halo + land + nbghostcells - 1
+         ind1 = jpiglo - ( nn_hls + nbghostcells -1 + ishift) - 1    ! halo + nbghostcells - 1
          ind2 = jpiglo - 1
          DO ji = mi0(ind1), mi1(ind2)
@@ -318,6 +318,6 @@
       ENDIF      
       IF( lk_south ) THEN                            ! --- South --- !
-         ind1 = nn_hls + 1 + nbghostcells + jshift                ! halo + land + nbghostcells
-         ind2 = nn_hls + 1 + nbghostcells + jshift + jspongearea 
+         ind1 = nn_hls + nbghostcells + jshift                ! halo + nbghostcells
+         ind2 = nn_hls + nbghostcells + jshift + jspongearea 
          DO jj = mj0(ind1), mj1(ind2) 
             DO ji = 1, jpi
@@ -327,5 +327,5 @@
          ! ghost cells:
          ind1 = 1
-         ind2 = nn_hls + 1 + nbghostcells + jshift                ! halo + land + nbghostcells
+         ind2 = nn_hls + nbghostcells + jshift                ! halo + land + nbghostcells
          DO jj = mj0(ind1), mj1(ind2) 
             DO ji = 1, jpi
@@ -335,6 +335,6 @@
       ENDIF
       IF( lk_north ) THEN                            ! --- North --- !
-         ind1 = jpjglo - ( nn_hls + nbghostcells + jshift) - jspongearea - 1
-         ind2 = jpjglo - ( nn_hls + nbghostcells + jshift) - 1    ! halo + land + nbghostcells - 1
+         ind1 = jpjglo - ( nn_hls + nbghostcells -1 + jshift) - jspongearea - 1
+         ind2 = jpjglo - ( nn_hls + nbghostcells -1 + jshift) - 1    ! halo + land + nbghostcells - 1
          DO jj = mj0(ind1), mj1(ind2)
             DO ji = 1, jpi
@@ -343,5 +343,5 @@
          END DO
          ! ghost cells:
-         ind1 = jpjglo - ( nn_hls + nbghostcells + jshift)      ! halo + land + nbghostcells - 1
+         ind1 = jpjglo - ( nn_hls + nbghostcells -1 + jshift)      ! halo + land + nbghostcells - 1
          ind2 = jpjglo
          DO jj = mj0(ind1), mj1(ind2)
@@ -741,5 +741,5 @@
 
          jmax = j2-1
-         ind1 = jpjglo - ( nn_hls + nbghostcells + 2 )   ! North
+         ind1 = jpjglo - ( nn_hls + nbghostcells + 1 )   ! North
          DO jj = mj0(ind1), mj1(ind1)                 
             jmax = MIN(jmax,jj)
@@ -905,5 +905,5 @@
 
          imax = i2 - 1
-         ind1 = jpiglo - ( nn_hls + nbghostcells + 2 )   ! East
+         ind1 = jpiglo - ( nn_hls + nbghostcells + 1 )   ! East
          DO ji = mi0(ind1), mi1(ind1)                
             imax = MIN(imax,ji)
@@ -1005,5 +1005,5 @@
 
          jmax = j2-1
-         ind1 = jpjglo - ( nn_hls + nbghostcells + 2 )   ! North
+         ind1 = jpjglo - ( nn_hls + nbghostcells + 1 )   ! North
          DO jj = mj0(ind1), mj1(ind1)                 
             jmax = MIN(jmax,jj)
@@ -1072,5 +1072,5 @@
 
          imax = i2 - 1
-         ind1 = jpiglo - ( nn_hls + nbghostcells + 2 )   ! East
+         ind1 = jpiglo - ( nn_hls + nbghostcells + 1 )   ! East
          DO ji = mi0(ind1), mi1(ind1)                
             imax = MIN(imax,ji)
Index: NEMO/trunk/src/NST/agrif_oce_update.F90
===================================================================
--- NEMO/trunk/src/NST/agrif_oce_update.F90	(revision 14967)
+++ NEMO/trunk/src/NST/agrif_oce_update.F90	(revision 14976)
@@ -1284,5 +1284,6 @@
       !!----------------------------------------------------------------------
       ! 
-      IF (( .NOT.ln_agrif_2way ).OR.(.NOT.ln_chk_bathy).OR.(Agrif_Root())) RETURN
+      IF (( .NOT.ln_agrif_2way ).OR.(.NOT.ln_chk_bathy) & 
+      & .OR.(.NOT.ln_vert_remap).OR.(Agrif_Root())) RETURN
       !
       Agrif_UseSpecialValueInUpdate = .FALSE.
Index: NEMO/trunk/src/NST/agrif_user.F90
===================================================================
--- NEMO/trunk/src/NST/agrif_user.F90	(revision 14967)
+++ NEMO/trunk/src/NST/agrif_user.F90	(revision 14976)
@@ -57,4 +57,5 @@
       !
       INTEGER :: ind1, ind2, ind3, imaxrho
+      INTEGER :: nbghostcellsfine_tot_x, nbghostcellsfine_tot_y
       INTEGER :: its
       External :: nemo_mapping
@@ -78,7 +79,10 @@
       ! 1. Declaration of the type of variable which have to be interpolated
       !---------------------------------------------------------------------
-      ind1 =              nbghostcells 
-      ind2 = nn_hls + 2 + nbghostcells_x
-      ind3 = nn_hls + 2 + nbghostcells_y_s
+!      ind1 =              nbghostcells 
+      ind2 = nn_hls + 1 + nbghostcells_x
+      ind3 = nn_hls + 1 + nbghostcells_y_s
+      nbghostcellsfine_tot_x = nbghostcells_x+1
+      nbghostcellsfine_tot_y = MAX(nbghostcells_y_s,nbghostcells_y_n)+1
+      ind1 = MAX(nbghostcellsfine_tot_x, nbghostcellsfine_tot_y)
       imaxrho = MAX(Agrif_irhox(), Agrif_irhoy())
 
@@ -120,13 +124,12 @@
        ! 3. Location of interpolation
       !-----------------------------
-!      CALL Agrif_Set_bc(  e3t_id, (/-nn_sponge_len*imaxrho,ind1-1/) )  
-! JC: check near the boundary only until matching in sponge has been sorted out:
-      CALL Agrif_Set_bc(    e3t_id, (/0,ind1-1/) )  
+      CALL Agrif_Set_bc(  e3t_id, (/-nn_sponge_len*imaxrho-2,ind1-1/) )  
 
       ! extend the interpolation zone by 1 more point than necessary:
       ! RB check here
-      CALL Agrif_Set_bc( e3t0_interp_id, (/-nn_sponge_len*imaxrho-2,ind1/) )
-      CALL Agrif_Set_bc(        mbkt_id, (/-nn_sponge_len*imaxrho-2,ind1/) )
-      CALL Agrif_Set_bc(         ht0_id, (/-nn_sponge_len*imaxrho-2,ind1/) )
+      CALL Agrif_Set_bc( e3t0_interp_id, (/-nn_sponge_len*imaxrho-2,ind1-1/) )
+      CALL Agrif_Set_bc(        mbkt_id, (/-nn_sponge_len*imaxrho-2,ind1-1/) )
+      CALL Agrif_Set_bc(         ht0_id, (/-nn_sponge_len*imaxrho-2,ind1-1/) )
+
       CALL Agrif_Set_bc(       tsini_id, (/0,ind1-1/) ) ! if west,  rhox=3 and nbghost=3: columns 2 to 4
       CALL Agrif_Set_bc(        uini_id, (/0,ind1-1/) ) 
@@ -142,5 +145,5 @@
 #endif      
 
-   !   CALL Agrif_Set_ExternalMapping(nemo_mapping)
+      CALL Agrif_Set_ExternalMapping(nemo_mapping)
       !
    END SUBROUTINE agrif_declare_var_ini
@@ -222,35 +225,32 @@
       !
       ! Build "intermediate" parent vertical grid on child domain
-      IF ( ln_vert_remap ) THEN
-
-         jpk_parent = Agrif_parent( jpk )
-         ALLOCATE(e3t0_parent(jpi,jpj,jpk_parent), &
-            &     e3u0_parent(jpi,jpj,jpk_parent), &
-            &     e3v0_parent(jpi,jpj,jpk_parent), STAT = ierr) 
-         IF( ierr  > 0 )   CALL ctl_warn('Agrif_Init_Domain: allocation of arrays failed')
+      jpk_parent = Agrif_parent( jpk )
+      ALLOCATE(e3t0_parent(jpi,jpj,jpk_parent), &
+         &     e3u0_parent(jpi,jpj,jpk_parent), &
+         &     e3v0_parent(jpi,jpj,jpk_parent), STAT = ierr) 
+      IF( ierr  > 0 )   CALL ctl_warn('Agrif_Init_Domain: allocation of arrays failed')
        
-         ! Retrieve expected parent scale factors on child grid:
-         Agrif_UseSpecialValue = .FALSE.
-         e3t0_parent(:,:,:) = 0._wp
-         CALL Agrif_Init_Variable(e3t0_interp_id, procname=interpe3t0_vremap)
-         !
-         ! Deduce scale factors at U and V points:
-         DO_3D( 0, 0, 0, 0, 1, jpk_parent )
-            e3u0_parent(ji,jj,jk) = 0.5_wp * (e3t0_parent(ji,jj,jk) + e3t0_parent(ji+1,jj  ,jk))
-            e3v0_parent(ji,jj,jk) = 0.5_wp * (e3t0_parent(ji,jj,jk) + e3t0_parent(ji  ,jj+1,jk))
-         END_3D
-
-         ! Assume a step at the bottom except if (pure) s-coordinates
-         IF ( .NOT.Agrif_Parent(ln_sco) ) THEN 
-            DO_2D( 1, 0, 1, 0 )
-               jk = mbku_parent(ji,jj)
-               e3u0_parent(ji,jj,jk) = MIN(e3t0_parent(ji,jj,jk), e3t0_parent(ji+1,jj  ,jk))
-               jk = mbkv_parent(ji,jj)
-               e3v0_parent(ji,jj,jk) = MIN(e3t0_parent(ji,jj,jk), e3t0_parent(ji  ,jj+1,jk))
-            END_2D
-         ENDIF
-
-         CALL lbc_lnk( 'Agrif_Init_Domain', e3u0_parent, 'U', 1.0_wp, e3v0_parent, 'V', 1.0_wp )
-      ENDIF
+      ! Retrieve expected parent scale factors on child grid:
+      Agrif_UseSpecialValue = .FALSE.
+      e3t0_parent(:,:,:) = 0._wp
+      CALL Agrif_Init_Variable(e3t0_interp_id, procname=interpe3t0_vremap)
+      !
+      ! Deduce scale factors at U and V points:
+      DO_3D( 0, 0, 0, 0, 1, jpk_parent )
+         e3u0_parent(ji,jj,jk) = 0.5_wp * (e3t0_parent(ji,jj,jk) + e3t0_parent(ji+1,jj  ,jk))
+         e3v0_parent(ji,jj,jk) = 0.5_wp * (e3t0_parent(ji,jj,jk) + e3t0_parent(ji  ,jj+1,jk))
+      END_3D
+
+      ! Assume a step at the bottom except if (pure) s-coordinates
+      IF ( .NOT.Agrif_Parent(ln_sco) ) THEN 
+         DO_2D( 1, 0, 1, 0 )
+            jk = mbku_parent(ji,jj)
+            e3u0_parent(ji,jj,jk) = MIN(e3t0_parent(ji,jj,jk), e3t0_parent(ji+1,jj  ,jk))
+            jk = mbkv_parent(ji,jj)
+            e3v0_parent(ji,jj,jk) = MIN(e3t0_parent(ji,jj,jk), e3t0_parent(ji  ,jj+1,jk))
+         END_2D
+      ENDIF
+
+      CALL lbc_lnk( 'Agrif_Init_Domain', e3u0_parent, 'U', 1.0_wp, e3v0_parent, 'V', 1.0_wp )
 
       ! check if masks and bathymetries match
@@ -262,15 +262,6 @@
          !
          kindic_agr = 0
-         IF( .NOT. ln_vert_remap ) THEN
-            !
-            ! check if tmask and vertical scale factors agree with parent in sponge area:
-            CALL Agrif_Bc_variable(e3t_id,calledweight=1.,procname=interpe3t)
-            !
-         ELSE
-            !
-            ! In case of vertical interpolation, check only that total depths agree between child and parent:
-                  
-            CALL Agrif_check_bat( kindic_agr )           
-         ENDIF
+         !         
+         CALL Agrif_check_bat( kindic_agr )           
          !
          CALL mpp_sum( 'agrif_InitValues_Domain', kindic_agr )
@@ -287,4 +278,6 @@
       WHERE (ssmask(:,:)  == 0._wp) mbkt_parent(:,:) = 0
       !
+      IF ( .NOT.ln_vert_remap ) DEALLOCATE(e3t0_parent, e3u0_parent, e3v0_parent)
+
    END SUBROUTINE Agrif_Init_Domain
 
@@ -440,6 +433,6 @@
       !---------------------------------------------------------------------
       ind1 =              nbghostcells
-      ind2 = nn_hls + 2 + nbghostcells_x
-      ind3 = nn_hls + 2 + nbghostcells_y_s
+      ind2 = nn_hls + 1 + nbghostcells_x
+      ind3 = nn_hls + 1 + nbghostcells_y_s
       imaxrho = MAX(Agrif_irhox(), Agrif_irhoy())
 
@@ -640,6 +633,6 @@
       !-------------------------------------------------------------------------------------
       ind1 =              nbghostcells
-      ind2 = nn_hls + 2 + nbghostcells_x
-      ind3 = nn_hls + 2 + nbghostcells_y_s
+      ind2 = nn_hls + 1 + nbghostcells_x
+      ind3 = nn_hls + 1 + nbghostcells_y_s
       ipl = jpl*(9+nlay_s+nlay_i)
       CALL agrif_declare_variable((/2,2,0/),(/ind2,ind3,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,ipl/),tra_ice_id)
@@ -780,6 +773,6 @@
       !---------------------------------------------------------------------
       ind1 =              nbghostcells
-      ind2 = nn_hls + 2 + nbghostcells_x
-      ind3 = nn_hls + 2 + nbghostcells_y_s
+      ind2 = nn_hls + 1 + nbghostcells_x
+      ind3 = nn_hls + 1 + nbghostcells_y_s
       imaxrho = MAX(Agrif_irhox(), Agrif_irhoy())
 
@@ -862,26 +855,41 @@
 
 ! JC => side effects of lines below to be checked:
-      lk_west  = .NOT. ( Agrif_Ix() == 1 )
-      lk_east  = .NOT. ( Agrif_Ix() + nbcellsx/AGRIF_Irhox() == Agrif_Parent(Ni0glo) -1 )
-      lk_south = .NOT. ( Agrif_Iy() == 1 )
-      lk_north = .NOT. ( Agrif_Iy() + nbcellsy/AGRIF_Irhoy() == Agrif_Parent(Nj0glo) -1 )
-      !
-      ! Set the number of ghost cells according to periodicity
-      nbghostcells_x   = nbghostcells
-      nbghostcells_y_s = nbghostcells
-      nbghostcells_y_n = nbghostcells
-      !
-      IF(    l_Iperio    )   nbghostcells_x   = 0
-      IF( .NOT. lk_south )   nbghostcells_y_s = 0
-      IF( .NOT. lk_north )   nbghostcells_y_n = 0
-      !
-      ! Some checks
-      IF( (.NOT.ln_vert_remap).AND.(jpkglo>Agrif_Parent(jpkglo)) )                    CALL ctl_stop( 'STOP',    &
-         &   'agrif_nemo_init: Agrif children must have less or equal number of vertical levels without ln_vert_remap defined' ) 
-      IF( jpiglo /= nbcellsx + 2 + 2*nn_hls + nbghostcells_x   + nbghostcells_x   )   CALL ctl_stop( 'STOP',    &
-         &   'agrif_nemo_init: Agrif children requires jpiglo == nbcellsx + 2 + 2*nn_hls + 2*nbghostcells_x' )
-      IF( jpjglo /= nbcellsy + 2 + 2*nn_hls + nbghostcells_y_s + nbghostcells_y_n )   CALL ctl_stop( 'STOP',    &
-         &   'agrif_nemo_init: Agrif children requires jpjglo == nbcellsy + 2 + 2*nn_hls + nbghostcells_y_s + nbghostcells_y_n' )
-      IF( ln_use_jattr )   CALL ctl_stop( 'STOP', 'agrif_nemo_init:Agrif children requires ln_use_jattr = .false. ' )
+      IF (.not.agrif_root()) THEN
+         nbghostcells_x   = nbghostcells
+         nbghostcells_y_s = nbghostcells
+         nbghostcells_y_n = nbghostcells
+ 
+
+         lk_west  = .TRUE.
+         lk_east  = .TRUE.
+         lk_south = .TRUE.
+         lk_north = .TRUE.
+         !
+         ! Correct number of ghost cells according to periodicity
+         !
+         IF( l_Iperio         ) THEN ; lk_west  = .FALSE. ; lk_east = .FALSE. ; nbghostcells_x = 0 ; ENDIF
+         IF( Agrif_Iy() == 1  ) THEN ; lk_south = .FALSE. ; nbghostcells_y_s = 1 ; ENDIF
+         IF( Agrif_Iy() + nbcellsy/AGRIF_Irhoy() ==  Agrif_Parent(Nj0glo) - 1 ) THEN ; lk_north = .FALSE. ; nbghostcells_y_n = 1 ; ENDIF
+         !
+         ! Some checks
+         IF( (.NOT.ln_vert_remap).AND.(jpkglo>Agrif_Parent(jpkglo)) )                    CALL ctl_stop( 'STOP',    &
+           &   'agrif_nemo_init: Agrif children must have less or equal number of vertical levels without ln_vert_remap defined' ) 
+         IF( Ni0glo /= nbcellsx + nbghostcells_x + nbghostcells_x   )   CALL ctl_stop( 'STOP',    &
+           &   'agrif_nemo_init: Agrif children requires jpiglo == nbcellsx + 2*nbghostcells_x' )
+         IF( Nj0glo /= nbcellsy + nbghostcells_y_s + nbghostcells_y_n )   CALL ctl_stop( 'STOP',    &
+           &   'agrif_nemo_init: Agrif children requires jpjglo == nbcellsy + nbghostcells_y_s + nbghostcells_y_n' )
+         IF( ln_use_jattr )   CALL ctl_stop( 'STOP', 'agrif_nemo_init:Agrif children requires ln_use_jattr = .false. ' )
+      ELSE
+         ! Root grid
+         nbghostcells_x   = 1 
+         nbghostcells_y_s = 1 
+         nbghostcells_y_n = 1 
+         IF ( l_Iperio.OR.l_NFold ) THEN
+           nbghostcells_x = 0
+         ENDIF
+         IF ( l_NFold ) THEN
+           nbghostcells_y_n = 0 ! for completeness
+         ENDIF
+      ENDIF
       !
       !
@@ -973,5 +981,5 @@
       ENDIF
 
-      IF( bounds(2,2,2) > jpjglo) THEN
+      IF(( bounds(2,2,2) > jpjglo).AND. ( l_NFold )) THEN
          IF( bounds(2,1,2) <=jpjglo) THEN
             nb_chunks = 2
@@ -1065,5 +1073,5 @@
          ENDIF
 
-      ELSE IF (bounds(1,1,2) < 1) THEN
+      ELSE IF ((bounds(1,1,2) < 1).AND.( l_Iperio )) THEN
          IF (bounds(1,2,2) > 0) THEN
             nb_chunks = 2
Index: NEMO/trunk/src/OCE/LBC/mppini.F90
===================================================================
--- NEMO/trunk/src/OCE/LBC/mppini.F90	(revision 14967)
+++ NEMO/trunk/src/OCE/LBC/mppini.F90	(revision 14976)
@@ -89,7 +89,5 @@
       !
 #if defined key_agrif
-    IF (.NOT.agrif_root()) THEN
       call agrif_nemo_init()
-    ENDIF
 #endif
    END SUBROUTINE mpp_init
@@ -307,7 +305,5 @@
 
 #if defined key_agrif
-      IF( .NOT. Agrif_Root() ) THEN       ! AGRIF children: specific setting (cf. agrif_user.F90)
          CALL agrif_nemo_init()
-      ENDIF
 #endif
       !
Index: NEMO/trunk/src/OCE/par_oce.F90
===================================================================
--- NEMO/trunk/src/OCE/par_oce.F90	(revision 14967)
+++ NEMO/trunk/src/OCE/par_oce.F90	(revision 14976)
@@ -47,5 +47,5 @@
    ! global domain size for AGRIF     !!! * total AGRIF computational domain *
    INTEGER, PUBLIC            ::   nbug_in_agrif_conv_do_not_remove_or_modify = 1 - 1
-   INTEGER, PUBLIC, PARAMETER ::   nbghostcells = 3   !: number of ghost cells: default value
+   INTEGER, PUBLIC, PARAMETER ::   nbghostcells = 4   !: number of ghost cells: default value
    INTEGER, PUBLIC            ::   nbghostcells_x     !: number of ghost cells in i-direction
    INTEGER, PUBLIC            ::   nbghostcells_y_s   !: number of ghost cells in j-direction at south
