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 11791)
+++ NEMO/branches/2019/dev_r11233_AGRIF-05_jchanut_vert_coord_interp/src/NST/agrif_oce_update.F90	(revision 11802)
@@ -49,6 +49,6 @@
       IF (lwp.AND.lk_agrif_debug) Write(*,*) 'Update tracers  from grid Number',Agrif_Fixed()
 
-! jc_alt      Agrif_UseSpecialValueInUpdate = .FALSE.
-      Agrif_UseSpecialValueInUpdate = .TRUE.
+      Agrif_UseSpecialValueInUpdate = .FALSE.
+! jc_alt      Agrif_UseSpecialValueInUpdate = .TRUE.
       Agrif_SpecialValueFineGrid    = 0._wp
       ! 
@@ -300,7 +300,8 @@
                DO jj=j1,j2
                   DO ji=i1,i2
-                     tabres(ji,jj,jk,jn) = (tsn(ji,jj,jk,jn) * e3t_n(ji,jj,jk) ) &
-                                         &  * tmask(ji,jj,jk) + (tmask(ji,jj,jk)-1._wp) * 999._wp
-!jc_alt                     tabres(ji,jj,jk,jn) = tsn(ji,jj,jk,jn) * e3t_n(ji,jj,jk)
+!jc_alt
+!                     tabres(ji,jj,jk,jn) = (tsn(ji,jj,jk,jn) * e3t_n(ji,jj,jk) ) &
+!                                         &  * tmask(ji,jj,jk) + (tmask(ji,jj,jk)-1._wp) * 999._wp
+                     tabres(ji,jj,jk,jn) = tsn(ji,jj,jk,jn) * e3t_n(ji,jj,jk)
                   END DO
                END DO
@@ -310,7 +311,8 @@
             DO jj=j1,j2
                DO ji=i1,i2
-                  tabres(ji,jj,jk,n2) =      tmask(ji,jj,jk) * e3t_n(ji,jj,jk) &
-                                      &   + (tmask(ji,jj,jk) - 1._wp) * 999._wp
-! jc_alt                  tabres(ji,jj,jk,n2) = tmask(ji,jj,jk) * e3t_n(ji,jj,jk)
+!jc_alt
+!                  tabres(ji,jj,jk,n2) =      tmask(ji,jj,jk) * e3t_n(ji,jj,jk) &
+!                                      &   + (tmask(ji,jj,jk) - 1._wp) * 999._wp
+                  tabres(ji,jj,jk,n2) = tmask(ji,jj,jk) * e3t_n(ji,jj,jk)
                END DO
             END DO
@@ -323,6 +325,7 @@
                N_in = 0
                DO jk=k1,k2 !k2 = jpk of child grid
-                  IF (tabres(ji,jj,jk,n2) < -900._wp  ) EXIT
-! jc_alt                  IF (tabres(ji,jj,jk,n2) == 0._wp  ) EXIT
+! jc_alt
+!                  IF (tabres(ji,jj,jk,n2) < -900._wp  ) EXIT
+                  IF (tabres(ji,jj,jk,n2) == 0._wp  ) EXIT
                   N_in = N_in + 1
                   tabin(jk,:) = tabres(ji,jj,jk,n1:n2-1)/tabres(ji,jj,jk,n2)
@@ -476,14 +479,17 @@
       IF( before ) THEN
          zrhoy = Agrif_Rhoy()
-         AGRIF_SpecialValue = -999._wp
+!jc_alt
+!         AGRIF_SpecialValue = -999._wp
          DO jk=k1,k2
             DO jj=j1,j2
                DO ji=i1,i2
-                  tabres(ji,jj,jk,1) = zrhoy * e2u(ji,jj) * e3u_n(ji,jj,jk) * umask(ji,jj,jk) * un(ji,jj,jk)  &
-                                     &  + (umask(ji,jj,jk)-1._wp)*999._wp
-! jc_alt                  tabres(ji,jj,jk,1) = zrhoy * e2u(ji,jj) * e3u_n(ji,jj,jk) * umask(ji,jj,jk) * un(ji,jj,jk)  
-                  tabres(ji,jj,jk,2) = zrhoy * umask(ji,jj,jk) * e2u(ji,jj) * e3u_n(ji,jj,jk)  &
-                                     &  + (umask(ji,jj,jk)-1._wp)*999._wp
-! jc_alt                  tabres(ji,jj,jk,2) = zrhoy * umask(ji,jj,jk) * e2u(ji,jj) * e3u_n(ji,jj,jk)
+!jc_alt
+!                  tabres(ji,jj,jk,1) = zrhoy * e2u(ji,jj) * e3u_n(ji,jj,jk) * umask(ji,jj,jk) * un(ji,jj,jk)  &
+!                                     &  + (umask(ji,jj,jk)-1._wp)*999._wp
+                  tabres(ji,jj,jk,1) = zrhoy * e2u(ji,jj) * e3u_n(ji,jj,jk) * umask(ji,jj,jk) * un(ji,jj,jk)  
+!jc_alt
+!                  tabres(ji,jj,jk,2) = zrhoy * umask(ji,jj,jk) * e2u(ji,jj) * e3u_n(ji,jj,jk)  &
+!                                     &  + (umask(ji,jj,jk)-1._wp)*999._wp
+                  tabres(ji,jj,jk,2) = zrhoy * umask(ji,jj,jk) * e2u(ji,jj) * e3u_n(ji,jj,jk)
                END DO
             END DO
@@ -498,6 +504,7 @@
                tabin(:) = 0._wp
                DO jk=k1,k2 !k2=jpk of child grid
-                  IF( tabres(ji,jj,jk,2) < -900._wp) EXIT
-! jc_alt                  IF( tabres(ji,jj,jk,2) == 0.) EXIT
+!jc_alt
+!                  IF( tabres(ji,jj,jk,2) < -900._wp) EXIT
+                  IF( tabres(ji,jj,jk,2) == 0.) EXIT
                   N_in = N_in + 1
                   tabin(jk) = tabres(ji,jj,jk,1)/tabres(ji,jj,jk,2)
@@ -512,5 +519,5 @@
                IF (N_in * N_out > 0) THEN
                   h_diff = sum(h_out(1:N_out))-sum(h_in(1:N_in))
-                  excess  = 0._wp
+                  excess = 0._wp
                   IF (h_diff < -1.e-4) THEN
 !Even if bathy at T points match it's possible for the U points to be deeper in the child grid. 
@@ -674,14 +681,17 @@
       IF( before ) THEN
          zrhox = Agrif_Rhox()
-         AGRIF_SpecialValue = -999._wp
+!jc_alt
+!         AGRIF_SpecialValue = -999._wp
          DO jk=k1,k2
             DO jj=j1,j2
                DO ji=i1,i2
-                  tabres(ji,jj,jk,1) = zrhox * e1v(ji,jj) * e3v_n(ji,jj,jk) * vmask(ji,jj,jk) * vn(ji,jj,jk) &
-                                     & + (vmask(ji,jj,jk)-1._wp) * 999._wp
-! jc_alt                  tabres(ji,jj,jk,1) = zrhox * e1v(ji,jj) * e3v_n(ji,jj,jk) * vmask(ji,jj,jk) * vn(ji,jj,jk) 
-                  tabres(ji,jj,jk,2) = zrhox * e1v(ji,jj) * e3v_n(ji,jj,jk) * vmask(ji,jj,jk) &
-                                     & + (vmask(ji,jj,jk)-1._wp) * 999._wp
-! jc_alt                  tabres(ji,jj,jk,2) = zrhox * e1v(ji,jj) * e3v_n(ji,jj,jk) * vmask(ji,jj,jk)
+!jc_alt
+!                  tabres(ji,jj,jk,1) = zrhox * e1v(ji,jj) * e3v_n(ji,jj,jk) * vmask(ji,jj,jk) * vn(ji,jj,jk) &
+!                                     & + (vmask(ji,jj,jk)-1._wp) * 999._wp
+                  tabres(ji,jj,jk,1) = zrhox * e1v(ji,jj) * e3v_n(ji,jj,jk) * vmask(ji,jj,jk) * vn(ji,jj,jk) 
+!jc_alt
+!                  tabres(ji,jj,jk,2) = zrhox * e1v(ji,jj) * e3v_n(ji,jj,jk) * vmask(ji,jj,jk) &
+!                                     & + (vmask(ji,jj,jk)-1._wp) * 999._wp
+                  tabres(ji,jj,jk,2) = zrhox * e1v(ji,jj) * e3v_n(ji,jj,jk) * vmask(ji,jj,jk)
                END DO
             END DO
@@ -694,6 +704,7 @@
                N_in = 0
                DO jk=k1,k2
-                  IF (tabres(ji,jj,jk,2) < -900._wp) EXIT
-! jc_alt                  IF (tabres(ji,jj,jk,2) == 0) EXIT
+!jc_alt
+!                  IF (tabres(ji,jj,jk,2) < -900._wp) EXIT
+                  IF (tabres(ji,jj,jk,2) == 0) EXIT
                   N_in = N_in + 1
                   tabin(jk) = tabres(ji,jj,jk,1)/tabres(ji,jj,jk,2)
