Index: /branches/2015/dev_r4826_NOC_WAD/NEMOGCM/NEMO/OPA_SRC/DOM/domvvl.F90
===================================================================
--- /branches/2015/dev_r4826_NOC_WAD/NEMOGCM/NEMO/OPA_SRC/DOM/domvvl.F90	(revision 5440)
+++ /branches/2015/dev_r4826_NOC_WAD/NEMOGCM/NEMO/OPA_SRC/DOM/domvvl.F90	(revision 5441)
@@ -145,13 +145,15 @@
       fse3t_a(:,:,jpk) = e3t_0(:,:,jpk)
 
-      IF(ln_wd) THEN
-        DO jj = 1, jpj
-          DO ji = 1, jpi
-            IF(mbathy(ji,jj) == 2 .AND. e3t_0(ji,jj,1) <= 0.5_wp * rn_wdmin1) THEN
-             fse3t_a(ji,jj,1:2) = 0.5_wp * rn_wdmin1 
-            END IF
-          ENDDO
-        ENDDO
-      END IF
+      !IF(ln_wd) THEN
+      !  DO jj = 1, jpj
+      !    DO ji = 1, jpi
+      !      IF(mbathy(ji,jj) == 2 .AND. e3t_0(ji,jj,1) <= 0.5_wp * rn_wdmin1) THEN
+      !       fse3t_a(ji,jj,1:2) = 0.5_wp * rn_wdmin1 
+      !       fse3t_n(ji,jj,1:2) = 0.5_wp * rn_wdmin1 
+      !       fse3t_b(ji,jj,1:2) = 0.5_wp * rn_wdmin1 
+      !      END IF
+      !    ENDDO
+      !  ENDDO
+      !END IF
 
       ! Reconstruction of all vertical scale factors at now and before time steps
@@ -687,4 +689,7 @@
       !                                                                !   =  'U', 'V', 'W, 'F', 'UW' or 'VW'
       !! * Local declarations
+      REAL(wp) ::  zwad                                                ! = 1.0 when ln_wd = .true.
+                                                                       ! = 0.0 when ln_wd = .false.
+                                                                       ! 
       INTEGER ::   ji, jj, jk                                          ! dummy loop indices
       LOGICAL ::   l_is_orca                                           ! local logical
@@ -692,4 +697,10 @@
       IF( nn_timing == 1 )  CALL timing_start('dom_vvl_interpol')
          !
+      IF(ln_wd) THEN
+        zwad = 1.0_wp
+      ELSE
+        zwad = 0.0_wp
+      END IF
+
       l_is_orca = .FALSE.
       IF( cp_cfg == "orca" .AND. jp_cfg == 2 ) l_is_orca = .TRUE.      ! ORCA R2 configuration - will need to correct some locations
@@ -703,5 +714,6 @@
             DO jj = 1, jpjm1
                DO ji = 1, fs_jpim1   ! vector opt.
-                  pe3_out(ji,jj,jk) = 0.5_wp * umask(ji,jj,jk) * r1_e12u(ji,jj)                                   &
+                  !pe3_out(ji,jj,jk) = 0.5_wp * umask(ji,jj,jk) * r1_e12u(ji,jj)                                   &
+                  pe3_out(ji,jj,jk) = 0.5_wp * (umask(ji,jj,jk) * (1.0_wp - zwad) + zwad) * r1_e12u(ji,jj)        &
                      &                       * (   e12t(ji  ,jj) * ( pe3_in(ji  ,jj,jk) - e3t_0(ji  ,jj,jk) )     &
                      &                           + e12t(ji+1,jj) * ( pe3_in(ji+1,jj,jk) - e3t_0(ji+1,jj,jk) ) )
@@ -721,5 +733,6 @@
             DO jj = 1, jpjm1
                DO ji = 1, fs_jpim1   ! vector opt.
-                  pe3_out(ji,jj,jk) = 0.5_wp * vmask(ji,jj,jk) * r1_e12v(ji,jj)                                   &
+                  !pe3_out(ji,jj,jk) = 0.5_wp * vmask(ji,jj,jk) * r1_e12v(ji,jj)                                   &
+                  pe3_out(ji,jj,jk) = 0.5_wp * (vmask(ji,jj,jk) * (1.0_wp - zwad) + zwad) * r1_e12v(ji,jj)        &
                      &                       * (   e12t(ji,jj  ) * ( pe3_in(ji,jj  ,jk) - e3t_0(ji,jj  ,jk) )     &
                      &                           + e12t(ji,jj+1) * ( pe3_in(ji,jj+1,jk) - e3t_0(ji,jj+1,jk) ) )
@@ -739,5 +752,7 @@
             DO jj = 1, jpjm1
                DO ji = 1, fs_jpim1   ! vector opt.
-                  pe3_out(ji,jj,jk) = 0.5_wp * umask(ji,jj,jk) * umask(ji,jj+1,jk) * r1_e12f(ji,jj)               &
+                  !pe3_out(ji,jj,jk) = 0.5_wp * umask(ji,jj,jk) * umask(ji,jj+1,jk) * r1_e12f(ji,jj)               &
+                  pe3_out(ji,jj,jk) = 0.5_wp * (umask(ji,jj,jk) * umask(ji,jj+1,jk) * (1.0_wp - zwad) + zwad)     &
+                     &                       * r1_e12f(ji,jj)                                                     &
                      &                       * (   e12u(ji,jj  ) * ( pe3_in(ji,jj  ,jk) - e3u_0(ji,jj  ,jk) )     &
                      &                           + e12u(ji,jj+1) * ( pe3_in(ji,jj+1,jk) - e3u_0(ji,jj+1,jk) ) )
@@ -757,6 +772,10 @@
          ! - ML - The use of mask in this formaula enables the special treatment of the last w- point without indirect adressing
          DO jk = 2, jpk
-            pe3_out(:,:,jk) = e3w_0(:,:,jk) + ( 1.0_wp - 0.5_wp * tmask(:,:,jk) ) * ( pe3_in(:,:,jk-1) - e3t_0(:,:,jk-1) )   &
-               &                            +            0.5_wp * tmask(:,:,jk)   * ( pe3_in(:,:,jk  ) - e3t_0(:,:,jk  ) )
+            !pe3_out(:,:,jk) = e3w_0(:,:,jk) + ( 1.0_wp - 0.5_wp * tmask(:,:,jk) ) * ( pe3_in(:,:,jk-1) - e3t_0(:,:,jk-1) )   &
+            !   &                            +            0.5_wp * tmask(:,:,jk)   * ( pe3_in(:,:,jk  ) - e3t_0(:,:,jk  ) )
+            pe3_out(:,:,jk) = e3w_0(:,:,jk) + ( 1.0_wp - 0.5_wp * (tmask(:,:,jk) * (1.0_wp - zwad) + zwad) ) &
+               &                            * ( pe3_in(:,:,jk-1) - e3t_0(:,:,jk-1) )                         &
+               &                            +            0.5_wp * (tmask(:,:,jk) * (1.0_wp - zwad) + zwad)   &
+               &                            * ( pe3_in(:,:,jk  ) - e3t_0(:,:,jk  ) )
          END DO
          !               ! -------------------------------------- !
@@ -767,6 +786,10 @@
          ! - ML - The use of mask in this formaula enables the special treatment of the last w- point without indirect adressing
          DO jk = 2, jpk
-            pe3_out(:,:,jk) = e3uw_0(:,:,jk) + ( 1.0_wp - 0.5_wp * umask(:,:,jk) ) * ( pe3_in(:,:,jk-1) - e3u_0(:,:,jk-1) )   &
-               &                             +            0.5_wp * umask(:,:,jk)   * ( pe3_in(:,:,jk  ) - e3u_0(:,:,jk  ) )
+            !pe3_out(:,:,jk) = e3uw_0(:,:,jk) + ( 1.0_wp - 0.5_wp * umask(:,:,jk) ) * ( pe3_in(:,:,jk-1) - e3u_0(:,:,jk-1) )   &
+            !   &                             +            0.5_wp * umask(:,:,jk)   * ( pe3_in(:,:,jk  ) - e3u_0(:,:,jk  ) )
+            pe3_out(:,:,jk) = e3uw_0(:,:,jk) + ( 1.0_wp - 0.5_wp * (umask(:,:,jk) * (1.0_wp - zwad) + zwad) ) &
+               &                             * ( pe3_in(:,:,jk-1) - e3u_0(:,:,jk-1) )                         &
+               &                             +            0.5_wp * (umask(:,:,jk) * (1.0_wp - zwad) + zwad)   &
+               &                             * ( pe3_in(:,:,jk  ) - e3u_0(:,:,jk  ) )
          END DO
          !               ! -------------------------------------- !
@@ -777,6 +800,10 @@
          ! - ML - The use of mask in this formaula enables the special treatment of the last w- point without indirect adressing
          DO jk = 2, jpk
-            pe3_out(:,:,jk) = e3vw_0(:,:,jk) + ( 1.0_wp - 0.5_wp * vmask(:,:,jk) ) * ( pe3_in(:,:,jk-1) - e3v_0(:,:,jk-1) )   &
-               &                             +            0.5_wp * vmask(:,:,jk)   * ( pe3_in(:,:,jk  ) - e3v_0(:,:,jk  ) )
+            !pe3_out(:,:,jk) = e3vw_0(:,:,jk) + ( 1.0_wp - 0.5_wp * vmask(:,:,jk) ) * ( pe3_in(:,:,jk-1) - e3v_0(:,:,jk-1) )   &
+            !   &                             +            0.5_wp * vmask(:,:,jk)   * ( pe3_in(:,:,jk  ) - e3v_0(:,:,jk  ) )
+            pe3_out(:,:,jk) = e3vw_0(:,:,jk) + ( 1.0_wp - 0.5_wp * (vmask(:,:,jk) * (1.0_wp - zwad) + zwad) ) &
+               &                             * ( pe3_in(:,:,jk-1) - e3v_0(:,:,jk-1) )                         &
+               &                             +            0.5_wp * (vmask(:,:,jk) * (1.0_wp - zwad) + zwad)   &
+               &                             * ( pe3_in(:,:,jk  ) - e3v_0(:,:,jk  ) )
          END DO
       END SELECT
@@ -882,9 +909,12 @@
                 DO ji = 1, jpi
                   !IF(e3t_0(ji,jj,1) < 0._wp) THEN
-                  IF(mbathy(ji,jj) == 2 .AND. e3t_0(ji,jj,1) <= 0.5_wp * rn_wdmin1) THEN
-                    fse3t_b(ji,jj,1:2) = 0.5_wp * rn_wdmin1 
-                    fse3t_n(ji,jj,1:2) = 0.5_wp * rn_wdmin1 
+                  !IF(mbathy(ji,jj) == 2 .AND. e3t_0(ji,jj,1) <= 0.5_wp * rn_wdmin1) THEN
+                  IF( e3t_0(ji,jj,1) <= 0.5_wp * rn_wdmin1) THEN
+                    fse3t_b(ji,jj,:) = 0.5_wp * rn_wdmin1 
+                    fse3t_n(ji,jj,:) = 0.5_wp * rn_wdmin1 
+                    fse3t_a(ji,jj,:) = 0.5_wp * rn_wdmin1 
                     sshb(ji,jj) = rn_wdmin1 - bathy(ji,jj)
                     sshn(ji,jj) = rn_wdmin1 - bathy(ji,jj)
+                    ssha(ji,jj) = rn_wdmin1 - bathy(ji,jj)
                   ENDIF
                 ENDDO
