Index: /NEMO/branches/2019/dev_r11233_AGRIF-05_jchanut_vert_coord_interp/src/NST/agrif_oce.F90
===================================================================
--- /NEMO/branches/2019/dev_r11233_AGRIF-05_jchanut_vert_coord_interp/src/NST/agrif_oce.F90	(revision 12118)
+++ /NEMO/branches/2019/dev_r11233_AGRIF-05_jchanut_vert_coord_interp/src/NST/agrif_oce.F90	(revision 12119)
@@ -65,5 +65,4 @@
    INTEGER, PUBLIC :: scales_t_id
    INTEGER, PUBLIC :: avt_id, avm_id, en_id                ! TKE related identificators
-   INTEGER, PUBLIC :: umsk_id, vmsk_id
    INTEGER, PUBLIC :: mbkt_id, ht0_id
    INTEGER, PUBLIC :: kindic_agr
Index: /NEMO/branches/2019/dev_r11233_AGRIF-05_jchanut_vert_coord_interp/src/NST/agrif_oce_interp.F90
===================================================================
--- /NEMO/branches/2019/dev_r11233_AGRIF-05_jchanut_vert_coord_interp/src/NST/agrif_oce_interp.F90	(revision 12118)
+++ /NEMO/branches/2019/dev_r11233_AGRIF-05_jchanut_vert_coord_interp/src/NST/agrif_oce_interp.F90	(revision 12119)
@@ -43,5 +43,5 @@
    PUBLIC   interptsn, interpsshn, interpavm
    PUBLIC   interpunb, interpvnb , interpub2b, interpvb2b
-   PUBLIC   interpe3t, interpumsk, interpvmsk
+   PUBLIC   interpe3t
 #if defined key_vertical
    PUBLIC   interpht0, interpmbkt
@@ -1132,5 +1132,5 @@
 
 
-   SUBROUTINE interpe3t( ptab, i1, i2, j1, j2, k1, k2, before, nb, ndir )
+   SUBROUTINE interpe3t( ptab, i1, i2, j1, j2, k1, k2, before )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE interpe3t  ***
@@ -1139,8 +1139,6 @@
       REAL(wp),DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) :: ptab
       LOGICAL                              , INTENT(in   ) :: before
-      INTEGER                              , INTENT(in   ) :: nb , ndir
       !
       INTEGER :: ji, jj, jk
-      LOGICAL :: western_side, eastern_side, northern_side, southern_side
       !!----------------------------------------------------------------------  
       !    
@@ -1148,31 +1146,13 @@
          ptab(i1:i2,j1:j2,k1:k2) = tmask(i1:i2,j1:j2,k1:k2) * e3t_0(i1:i2,j1:j2,k1:k2)
       ELSE
-         western_side  = (nb == 1).AND.(ndir == 1)
-         eastern_side  = (nb == 1).AND.(ndir == 2)
-         southern_side = (nb == 2).AND.(ndir == 1)
-         northern_side = (nb == 2).AND.(ndir == 2)
          !
          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
-                     IF (western_side.AND.(ptab(i1+nbghostcells-1,jj,jk)>0._wp)) THEN
-                        WRITE(numout,*) 'ERROR bathymetry merge at the western border ji,jj,jk ', ji+nimpp-1,jj+njmpp-1,jk
-                        WRITE(numout,*)  ptab(ji,jj,jk), e3t_0(ji,jj,jk) 
-                        kindic_agr = kindic_agr + 1
-                     ELSEIF (eastern_side.AND.(ptab(i2-nbghostcells+1,jj,jk)>0._wp)) THEN
-                        WRITE(numout,*) 'ERROR bathymetry merge at the eastern border ji,jj,jk ', ji+nimpp-1,jj+njmpp-1,jk
-                        WRITE(numout,*)  ptab(ji,jj,jk), e3t_0(ji,jj,jk)
-                        kindic_agr = kindic_agr + 1
-                     ELSEIF (southern_side.AND.(ptab(ji,j1+nbghostcells-1,jk)>0._wp)) THEN
-                        WRITE(numout,*) 'ERROR bathymetry merge at the southern border ji,jj,jk', ji+nimpp-1,jj+njmpp-1,jk
-                        WRITE(numout,*)  ptab(ji,jj,jk), e3t_0(ji,jj,jk)
-                        kindic_agr = kindic_agr + 1
-                     ELSEIF (northern_side.AND.(ptab(ji,j2-nbghostcells+1,jk)>0._wp)) THEN
-                        WRITE(numout,*) 'ERROR bathymetry merge at the northen border ji,jj,jk', ji+nimpp-1,jj+njmpp-1,jk
-                        WRITE(numout,*)  ptab(ji,jj,jk), e3t_0(ji,jj,jk)
-                        kindic_agr = kindic_agr + 1
-                     ENDIF
+                     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), &
+                     &                 ji+nimpp-1, jj+njmpp-1, jk
+                     kindic_agr = kindic_agr + 1
                   ENDIF
                END DO
@@ -1183,88 +1163,4 @@
       ! 
    END SUBROUTINE interpe3t
-
-
-   SUBROUTINE interpumsk( ptab, i1, i2, j1, j2, k1, k2, before, nb, ndir )
-      !!----------------------------------------------------------------------
-      !!                  ***  ROUTINE interpumsk  ***
-      !!----------------------------------------------------------------------  
-      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                              , INTENT(in   ) ::   nb , ndir
-      !
-      INTEGER ::   ji, jj, jk
-      LOGICAL ::   western_side, eastern_side   
-      !!----------------------------------------------------------------------  
-      !    
-      IF( before ) THEN
-         ptab(i1:i2,j1:j2,k1:k2) = umask(i1:i2,j1:j2,k1:k2)
-      ELSE
-         western_side = (nb == 1).AND.(ndir == 1)
-         eastern_side = (nb == 1).AND.(ndir == 2)
-         DO jk = k1, k2
-            DO jj = j1, j2
-               DO ji = i1, i2
-                   ! Velocity mask at boundary edge points:
-                  IF (ABS(ptab(ji,jj,jk) - umask(ji,jj,jk)) > 1.D-2) THEN
-                     IF (western_side) THEN
-                        WRITE(numout,*) 'ERROR with umask at the western border ji,jj,jk ', ji+nimpp-1,jj+njmpp-1,jk
-                        WRITE(numout,*) '      masks: parent, child ', ptab(ji,jj,jk), umask(ji,jj,jk)
-                        kindic_agr = kindic_agr + 1
-                     ELSEIF (eastern_side) THEN
-                        WRITE(numout,*) 'ERROR with umask at the eastern border ji,jj,jk ', ji+nimpp-1,jj+njmpp-1,jk
-                        WRITE(numout,*) '      masks: parent, child ', ptab(ji,jj,jk), umask(ji,jj,jk)
-                        kindic_agr = kindic_agr + 1
-                     ENDIF
-                  ENDIF
-               END DO
-            END DO
-         END DO
-         !
-      ENDIF
-      ! 
-   END SUBROUTINE interpumsk
-
-
-   SUBROUTINE interpvmsk( ptab, i1, i2, j1, j2, k1, k2, before, nb, ndir )
-      !!----------------------------------------------------------------------
-      !!                  ***  ROUTINE interpvmsk  ***
-      !!----------------------------------------------------------------------  
-      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                              , INTENT(in   ) :: nb , ndir
-      !
-      INTEGER ::   ji, jj, jk
-      LOGICAL ::   northern_side, southern_side     
-      !!----------------------------------------------------------------------  
-      !    
-      IF( before ) THEN
-         ptab(i1:i2,j1:j2,k1:k2) = vmask(i1:i2,j1:j2,k1:k2)
-      ELSE
-         southern_side = (nb == 2).AND.(ndir == 1)
-         northern_side = (nb == 2).AND.(ndir == 2)
-         DO jk = k1, k2
-            DO jj = j1, j2
-               DO ji = i1, i2
-                   ! Velocity mask at boundary edge points:
-                  IF (ABS(ptab(ji,jj,jk) - vmask(ji,jj,jk)) > 1.D-2) THEN
-                     IF (southern_side) THEN
-                        WRITE(numout,*) 'ERROR with vmask at the southern border ji,jj,jk ', ji+nimpp-1,jj+njmpp-1,jk
-                        WRITE(numout,*) '      masks: parent, child ', ptab(ji,jj,jk), vmask(ji,jj,jk)
-                        kindic_agr = kindic_agr + 1
-                     ELSEIF (northern_side) THEN
-                        WRITE(numout,*) 'ERROR with vmask at the northern border ji,jj,jk ', ji+nimpp-1,jj+njmpp-1,jk
-                        WRITE(numout,*) '      masks: parent, child ', ptab(ji,jj,jk), vmask(ji,jj,jk)
-                        kindic_agr = kindic_agr + 1
-                     ENDIF
-                  ENDIF
-               END DO
-            END DO
-         END DO
-         !
-      ENDIF
-      ! 
-   END SUBROUTINE interpvmsk
 
 
Index: /NEMO/branches/2019/dev_r11233_AGRIF-05_jchanut_vert_coord_interp/src/NST/agrif_oce_update.F90
===================================================================
--- /NEMO/branches/2019/dev_r11233_AGRIF-05_jchanut_vert_coord_interp/src/NST/agrif_oce_update.F90	(revision 12118)
+++ /NEMO/branches/2019/dev_r11233_AGRIF-05_jchanut_vert_coord_interp/src/NST/agrif_oce_update.F90	(revision 12119)
@@ -49,6 +49,12 @@
       IF (lwp.AND.lk_agrif_debug) Write(*,*) 'Update tracers  from grid Number',Agrif_Fixed()
 
+#if defined key_vertical
+! Effect of this has to be carrefully checked 
+! depending on what the nesting tools ensure for
+! volume conservation:
       Agrif_UseSpecialValueInUpdate = .FALSE.
-! jc_alt      Agrif_UseSpecialValueInUpdate = .TRUE.
+#else
+      Agrif_UseSpecialValueInUpdate = .TRUE.
+#endif
       Agrif_SpecialValueFineGrid    = 0._wp
       ! 
Index: /NEMO/branches/2019/dev_r11233_AGRIF-05_jchanut_vert_coord_interp/src/NST/agrif_user.F90
===================================================================
--- /NEMO/branches/2019/dev_r11233_AGRIF-05_jchanut_vert_coord_interp/src/NST/agrif_user.F90	(revision 12118)
+++ /NEMO/branches/2019/dev_r11233_AGRIF-05_jchanut_vert_coord_interp/src/NST/agrif_user.F90	(revision 12119)
@@ -259,4 +259,5 @@
       ! check if masks and bathymetries match
       IF(ln_chk_bathy) THEN
+         Agrif_UseSpecialValue = .FALSE.
          !
          IF(lwp) WRITE(numout,*) ' '
@@ -266,9 +267,5 @@
 # if ! defined key_vertical
          !
-         ! check if umask agree with parent along western and eastern boundaries:
-         CALL Agrif_Bc_variable(umsk_id,calledweight=1.,procname=interpumsk)
-         ! check if vmask agree with parent along northern and southern boundaries:
-         CALL Agrif_Bc_variable(vmsk_id,calledweight=1.,procname=interpvmsk)
-         ! check if tmask and vertical scale factors agree with parent over first two coarse grid points:
+         ! check if tmask and vertical scale factors agree with parent in sponge area:
          CALL Agrif_Bc_variable(e3t_id,calledweight=1.,procname=interpe3t)
          !
@@ -346,6 +343,5 @@
 
       CALL agrif_declare_variable((/2,2,0/),(/ind3,ind3,0/),(/'x','y','N'/),(/1,1,1/),(/nlci,nlcj,jpk/),e3t_id)
-      CALL agrif_declare_variable((/1,2,0/),(/ind2,ind3,0/),(/'x','y','N'/),(/1,1,1/),(/nlci,nlcj,jpk/),umsk_id)
-      CALL agrif_declare_variable((/2,1,0/),(/ind3,ind2,0/),(/'x','y','N'/),(/1,1,1/),(/nlci,nlcj,jpk/),vmsk_id)
+
 # if defined key_vertical
       CALL agrif_declare_variable((/2,2/),(/ind3,ind3/),(/'x','y'/),(/1,1/),(/nlci,nlcj/),mbkt_id)
@@ -401,6 +397,4 @@
 
       CALL Agrif_Set_bcinterp(e3t_id,interp=AGRIF_constant)
-      CALL Agrif_Set_bcinterp(umsk_id,interp=AGRIF_constant)
-      CALL Agrif_Set_bcinterp(vmsk_id,interp=AGRIF_constant)
 
 # if defined key_vertical
@@ -427,7 +421,8 @@
       CALL Agrif_Set_bc( vb2b_interp_id, (/0,ind1-1/) )
 
-      CALL Agrif_Set_bc(  e3t_id, (/-nn_sponge_len*Agrif_irhox(),ind1-1/) )     ! if west,  rhox=3, nn_sponge_len=2
-      CALL Agrif_Set_bc( umsk_id, (/0,0/) )                                     ! and nbghost=3:
-      CALL Agrif_Set_bc( vmsk_id, (/0,0/) )                                     ! columns 2 to 10
+!      CALL Agrif_Set_bc(  e3t_id, (/-nn_sponge_len*Agrif_irhox(),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/) )  
+
 # if defined key_vertical 
       ! extend the interpolation zone by 1 more point than necessary:
