Index: branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/LDF/ldfeiv.F90
===================================================================
--- branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/LDF/ldfeiv.F90	(revision 2287)
+++ branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/LDF/ldfeiv.F90	(revision 2371)
@@ -87,46 +87,83 @@
       ! 1. Compute lateral diffusive coefficient 
       ! ----------------------------------------
-
-      DO jk = 1, jpk
+      IF (ln_traldf_grif) THEN
+         DO jk = 1, jpk
 #  if defined key_vectopt_loop  
-!CDIR NOVERRCHK 
-         DO ji = 1, jpij   ! vector opt.
-            ! Take the max of N^2 and zero then take the vertical sum
-            ! of the square root of the resulting N^2 ( required to compute
-            ! internal Rossby radius Ro = .5 * sum_jpk(N) / f
-            zn2 = MAX( rn2b(ji,1,jk), 0.e0 )
-            zn(ji,1) = zn(ji,1) + SQRT( zn2 ) * fse3w(ji,1,jk)
-            ! Compute elements required for the inverse time scale of baroclinic
-            ! eddies using the isopycnal slopes calculated in ldfslp.F :
-            ! T^-1 = sqrt(m_jpk(N^2*(r1^2+r2^2)*e3w))
-            ze3w = fse3w(ji,1,jk) * tmask(ji,1,jk)
+            !CDIR NOVERRCHK 
+            DO ji = 1, jpij   ! vector opt.
+               ! Take the max of N^2 and zero then take the vertical sum
+               ! of the square root of the resulting N^2 ( required to compute
+               ! internal Rossby radius Ro = .5 * sum_jpk(N) / f
+               zn2 = MAX( rn2b(ji,1,jk), 0.e0 )
+               zn(ji,1) = zn(ji,1) + SQRT( zn2 ) * fse3w(ji,1,jk)
+               ! Compute elements required for the inverse time scale of baroclinic
+               ! eddies using the isopycnal slopes calculated in ldfslp.F :
+               ! T^-1 = sqrt(m_jpk(N^2*(r1^2+r2^2)*e3w))
+               ze3w = fse3w(ji,1,jk) * tmask(ji,1,jk)
+               zah(ji,1) = zah(ji,1) + zn2 * wslp2(ji,1,jk) * ze3w
+               zhw(ji,1) = zhw(ji,1) + ze3w
+            END DO
+#  else
+            DO jj = 2, jpjm1
+               !CDIR NOVERRCHK 
+               DO ji = 2, jpim1
+                  ! Take the max of N^2 and zero then take the vertical sum 
+                  ! of the square root of the resulting N^2 ( required to compute 
+                  ! internal Rossby radius Ro = .5 * sum_jpk(N) / f 
+                  zn2 = MAX( rn2b(ji,jj,jk), 0.e0 )
+                  zn(ji,jj) = zn(ji,jj) + SQRT( zn2 ) * fse3w(ji,jj,jk)
+                  ! Compute elements required for the inverse time scale of baroclinic
+                  ! eddies using the isopycnal slopes calculated in ldfslp.F : 
+                  ! T^-1 = sqrt(m_jpk(N^2*(r1^2+r2^2)*e3w))
+                  ze3w = fse3w(ji,jj,jk) * tmask(ji,jj,jk)
+                  zah(ji,jj) = zah(ji,jj) + zn2 * wslp2(ji,jj,jk) * ze3w
+                  zhw(ji,jj) = zhw(ji,jj) + ze3w
+               END DO
+            END DO
+#  endif
+         END DO
+      ELSE
+         DO jk = 1, jpk
+#  if defined key_vectopt_loop  
+            !CDIR NOVERRCHK 
+            DO ji = 1, jpij   ! vector opt.
+               ! Take the max of N^2 and zero then take the vertical sum
+               ! of the square root of the resulting N^2 ( required to compute
+               ! internal Rossby radius Ro = .5 * sum_jpk(N) / f
+               zn2 = MAX( rn2b(ji,1,jk), 0.e0 )
+               zn(ji,1) = zn(ji,1) + SQRT( zn2 ) * fse3w(ji,1,jk)
+               ! Compute elements required for the inverse time scale of baroclinic
+               ! eddies using the isopycnal slopes calculated in ldfslp.F :
+               ! T^-1 = sqrt(m_jpk(N^2*(r1^2+r2^2)*e3w))
+               ze3w = fse3w(ji,1,jk) * tmask(ji,1,jk)
                zah(ji,1) = zah(ji,1) + zn2   &
-                              * ( wslpi(ji,1,jk) * wslpi(ji,1,jk)    &
-                                + wslpj(ji,1,jk) * wslpj(ji,1,jk) )   &
-                              * ze3w
-            zhw(ji,1) = zhw(ji,1) + ze3w
-         END DO
+                    * ( wslpi(ji,1,jk) * wslpi(ji,1,jk)    &
+                    + wslpj(ji,1,jk) * wslpj(ji,1,jk) )   &
+                    * ze3w
+               zhw(ji,1) = zhw(ji,1) + ze3w
+            END DO
 #  else
-         DO jj = 2, jpjm1
-!CDIR NOVERRCHK 
-            DO ji = 2, jpim1
-               ! Take the max of N^2 and zero then take the vertical sum 
-               ! of the square root of the resulting N^2 ( required to compute 
-               ! internal Rossby radius Ro = .5 * sum_jpk(N) / f 
-               zn2 = MAX( rn2b(ji,jj,jk), 0.e0 )
-               zn(ji,jj) = zn(ji,jj) + SQRT( zn2 ) * fse3w(ji,jj,jk)
-               ! Compute elements required for the inverse time scale of baroclinic
-               ! eddies using the isopycnal slopes calculated in ldfslp.F : 
-               ! T^-1 = sqrt(m_jpk(N^2*(r1^2+r2^2)*e3w))
-               ze3w = fse3w(ji,jj,jk) * tmask(ji,jj,jk)
-               zah(ji,jj) = zah(ji,jj) + zn2   &
-                              * ( wslpi(ji,jj,jk) * wslpi(ji,jj,jk)    &
-                                + wslpj(ji,jj,jk) * wslpj(ji,jj,jk) )  &
-                              * ze3w
-               zhw(ji,jj) = zhw(ji,jj) + ze3w
-            END DO 
-         END DO 
+            DO jj = 2, jpjm1
+               !CDIR NOVERRCHK 
+               DO ji = 2, jpim1
+                  ! Take the max of N^2 and zero then take the vertical sum 
+                  ! of the square root of the resulting N^2 ( required to compute 
+                  ! internal Rossby radius Ro = .5 * sum_jpk(N) / f 
+                  zn2 = MAX( rn2b(ji,jj,jk), 0.e0 )
+                  zn(ji,jj) = zn(ji,jj) + SQRT( zn2 ) * fse3w(ji,jj,jk)
+                  ! Compute elements required for the inverse time scale of baroclinic
+                  ! eddies using the isopycnal slopes calculated in ldfslp.F : 
+                  ! T^-1 = sqrt(m_jpk(N^2*(r1^2+r2^2)*e3w))
+                  ze3w = fse3w(ji,jj,jk) * tmask(ji,jj,jk)
+                  zah(ji,jj) = zah(ji,jj) + zn2   &
+                       * ( wslpi(ji,jj,jk) * wslpi(ji,jj,jk)    &
+                       + wslpj(ji,jj,jk) * wslpj(ji,jj,jk) )  &
+                       * ze3w
+                  zhw(ji,jj) = zhw(ji,jj) + ze3w
+               END DO
+            END DO
 #  endif
-      END DO 
+         END DO
+      END IF
 
       DO jj = 2, jpjm1
