Index: branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/NST_SRC/agrif_opa_update.F90
===================================================================
--- branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/NST_SRC/agrif_opa_update.F90	(revision 5839)
+++ branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/NST_SRC/agrif_opa_update.F90	(revision 5845)
@@ -26,5 +26,4 @@
    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -67,4 +66,5 @@
       !
    END SUBROUTINE Agrif_Update_Tra
+
 
    RECURSIVE SUBROUTINE Agrif_Update_Dyn( )
@@ -153,4 +153,5 @@
 
 # if defined key_zdftke
+
    SUBROUTINE Agrif_Update_Tke( kt )
       !!---------------------------------------------
@@ -175,4 +176,5 @@
       
    END SUBROUTINE Agrif_Update_Tke
+   
 # endif /* key_zdftke */
 
@@ -181,5 +183,4 @@
       !!           *** ROUTINE updateT ***
       !!---------------------------------------------
-#  include "domzgr_substitute.h90"
       INTEGER, INTENT(in) :: i1,i2,j1,j2,k1,k2,n1,n2
       REAL(wp),DIMENSION(i1:i2,j1:j2,k1:k2,n1:n2), INTENT(inout) :: tabres
@@ -231,10 +232,9 @@
    END SUBROUTINE updateTS
 
+
    SUBROUTINE updateu( tabres, i1, i2, j1, j2, k1, k2, before )
       !!---------------------------------------------
       !!           *** ROUTINE updateu ***
       !!---------------------------------------------
-#  include "domzgr_substitute.h90"
-      !!
       INTEGER, INTENT(in) :: i1, i2, j1, j2, k1, k2
       REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) :: tabres
@@ -250,6 +250,5 @@
             DO jj=j1,j2
                DO ji=i1,i2
-                  tabres(ji,jj,jk) = e2u(ji,jj) * un(ji,jj,jk)
-                  tabres(ji,jj,jk) = tabres(ji,jj,jk) * fse3u_n(ji,jj,jk)
+                  tabres(ji,jj,jk) = e2u(ji,jj) * e3u_n(ji,jj,jk) * un(ji,jj,jk)
                END DO
             END DO
@@ -260,5 +259,5 @@
             DO jj=j1,j2
                DO ji=i1,i2
-                  tabres(ji,jj,jk) = tabres(ji,jj,jk) / e2u(ji,jj) / fse3u_n(ji,jj,jk)
+                  tabres(ji,jj,jk) = tabres(ji,jj,jk) / ( e2u(ji,jj) * e3u_n(ji,jj,jk) )
                   !
                   IF (.NOT.(lk_agrif_fstep.AND.(neuler==0))) THEN ! Add asselin part
@@ -275,10 +274,9 @@
    END SUBROUTINE updateu
 
+
    SUBROUTINE updatev( tabres, i1, i2, j1, j2, k1, k2, before )
       !!---------------------------------------------
       !!           *** ROUTINE updatev ***
       !!---------------------------------------------
-#  include "domzgr_substitute.h90"
-      !!
       INTEGER :: i1,i2,j1,j2,k1,k2
       INTEGER :: ji,jj,jk
@@ -294,6 +292,5 @@
             DO jj=j1,j2
                DO ji=i1,i2
-                  tabres(ji,jj,jk) = e1v(ji,jj) * vn(ji,jj,jk)
-                  tabres(ji,jj,jk) = tabres(ji,jj,jk) * fse3v_n(ji,jj,jk)
+                  tabres(ji,jj,jk) = e1v(ji,jj) * e3v_n(ji,jj,jk) * vn(ji,jj,jk)
                END DO
             END DO
@@ -304,5 +301,5 @@
             DO jj=j1,j2
                DO ji=i1,i2
-                  tabres(ji,jj,jk) = tabres(ji,jj,jk) / e1v(ji,jj) / fse3v_n(ji,jj,jk)
+                  tabres(ji,jj,jk) = tabres(ji,jj,jk) / ( e1v(ji,jj) * e3v_n(ji,jj,jk) )
                   !
                   IF (.NOT.(lk_agrif_fstep.AND.(neuler==0))) THEN ! Add asselin part
@@ -319,10 +316,9 @@
    END SUBROUTINE updatev
 
+
    SUBROUTINE updateu2d( tabres, i1, i2, j1, j2, before )
       !!---------------------------------------------
       !!          *** ROUTINE updateu2d ***
       !!---------------------------------------------
-#  include "domzgr_substitute.h90"
-      !!
       INTEGER, INTENT(in) :: i1, i2, j1, j2
       REAL(wp), DIMENSION(i1:i2,j1:j2), INTENT(inout) :: tabres
@@ -338,5 +334,5 @@
          DO jj=j1,j2
             DO ji=i1,i2
-               tabres(ji,jj) = un_b(ji,jj) * hu(ji,jj) * e2u(ji,jj)
+               tabres(ji,jj) = un_b(ji,jj) * hu_n(ji,jj) * e2u(ji,jj)
             END DO
          END DO
@@ -345,12 +341,12 @@
          DO jj=j1,j2
             DO ji=i1,i2
-               tabres(ji,jj) =  tabres(ji,jj) * hur(ji,jj) / e2u(ji,jj)  
+               tabres(ji,jj) =  tabres(ji,jj) * r1_hu_n(ji,jj) * r1_e2u(ji,jj)  
                !    
                ! Update "now" 3d velocities:
                spgu(ji,jj) = 0.e0
                DO jk=1,jpkm1
-                  spgu(ji,jj) = spgu(ji,jj) + fse3u_n(ji,jj,jk) * un(ji,jj,jk)
-               END DO
-               spgu(ji,jj) = spgu(ji,jj) * hur(ji,jj)
+                  spgu(ji,jj) = spgu(ji,jj) + e3u_n(ji,jj,jk) * un(ji,jj,jk)
+               END DO
+               spgu(ji,jj) = spgu(ji,jj) * r1_hu_n(ji,jj)
                !
                zcorr = tabres(ji,jj) - spgu(ji,jj)
@@ -371,7 +367,7 @@
                spgu(ji,jj) = 0.e0
                DO jk=1,jpkm1
-                  spgu(ji,jj) = spgu(ji,jj) + fse3u_b(ji,jj,jk) * ub(ji,jj,jk)
-               END DO
-               spgu(ji,jj) = spgu(ji,jj) * hur_b(ji,jj)
+                  spgu(ji,jj) = spgu(ji,jj) + e3u_b(ji,jj,jk) * ub(ji,jj,jk)
+               END DO
+               spgu(ji,jj) = spgu(ji,jj) * r1_hu_b(ji,jj)
                !
                zcorr = ub_b(ji,jj) - spgu(ji,jj)
@@ -385,4 +381,5 @@
       !
    END SUBROUTINE updateu2d
+
 
    SUBROUTINE updatev2d( tabres, i1, i2, j1, j2, before )
@@ -403,5 +400,5 @@
          DO jj=j1,j2
             DO ji=i1,i2
-               tabres(ji,jj) = vn_b(ji,jj) * hv(ji,jj) * e1v(ji,jj) 
+               tabres(ji,jj) = vn_b(ji,jj) * hv_n(ji,jj) * e1v(ji,jj) 
             END DO
          END DO
@@ -410,12 +407,12 @@
          DO jj=j1,j2
             DO ji=i1,i2
-               tabres(ji,jj) =  tabres(ji,jj) * hvr(ji,jj) / e1v(ji,jj)  
+               tabres(ji,jj) =  tabres(ji,jj) * r1_hv_n(ji,jj) * r1_e1v(ji,jj)  
                !    
                ! Update "now" 3d velocities:
                spgv(ji,jj) = 0.e0
                DO jk=1,jpkm1
-                  spgv(ji,jj) = spgv(ji,jj) + fse3v_n(ji,jj,jk) * vn(ji,jj,jk)
-               END DO
-               spgv(ji,jj) = spgv(ji,jj) * hvr(ji,jj)
+                  spgv(ji,jj) = spgv(ji,jj) + e3v_n(ji,jj,jk) * vn(ji,jj,jk)
+               END DO
+               spgv(ji,jj) = spgv(ji,jj) * r1_hv_n(ji,jj)
                !
                zcorr = tabres(ji,jj) - spgv(ji,jj)
@@ -436,7 +433,7 @@
                spgv(ji,jj) = 0.e0
                DO jk=1,jpkm1
-                  spgv(ji,jj) = spgv(ji,jj) + fse3v_b(ji,jj,jk) * vb(ji,jj,jk)
-               END DO
-               spgv(ji,jj) = spgv(ji,jj) * hvr_b(ji,jj)
+                  spgv(ji,jj) = spgv(ji,jj) + e3v_b(ji,jj,jk) * vb(ji,jj,jk)
+               END DO
+               spgv(ji,jj) = spgv(ji,jj) * r1_hv_b(ji,jj)
                !
                zcorr = vb_b(ji,jj) - spgv(ji,jj)
@@ -489,4 +486,5 @@
    END SUBROUTINE updateSSH
 
+
    SUBROUTINE updateub2b( tabres, i1, i2, j1, j2, before )
       !!---------------------------------------------
@@ -519,4 +517,5 @@
    END SUBROUTINE updateub2b
 
+
    SUBROUTINE updatevb2b( tabres, i1, i2, j1, j2, before )
       !!---------------------------------------------
@@ -555,12 +554,11 @@
       !!           *** ROUTINE updateT ***
       !!---------------------------------------------
-#  include "domzgr_substitute.h90"
-
       INTEGER, INTENT(in) :: i1,i2,j1,j2,k1,k2,n1,n2
       REAL(wp),DIMENSION(i1:i2,j1:j2,k1:k2,n1:n2), INTENT(inout) :: tabres
       LOGICAL, iNTENT(in) :: before
-
+      !
       INTEGER :: ji,jj,jk
       REAL(wp) :: ztemp
+      !!---------------------------------------------
 
       IF (before) THEN
@@ -600,4 +598,5 @@
 
 # if defined key_zdftke
+
    SUBROUTINE updateEN( ptab, i1, i2, j1, j2, k1, k2, before )
       !!---------------------------------------------
