Index: trunk/NEMO/OPA_SRC/DYN/dynnxt.F90
===================================================================
--- trunk/NEMO/OPA_SRC/DYN/dynnxt.F90	(revision 608)
+++ trunk/NEMO/OPA_SRC/DYN/dynnxt.F90	(revision 642)
@@ -73,8 +73,9 @@
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
       REAL(wp) ::   z2dt         ! temporary scalar
+      REAL(wp) ::   zsshun1, zsshvn1         ! temporary scalar
       !! Variable volume
-      REAL(wp) ::   zsshun, zsshvn           ! temporary scalars
-      REAL(wp), DIMENSION(jpi,jpj)     ::  &
-         zsshub, zsshua, zsshvb, zsshva      ! 2D workspace
+      REAL(wp), DIMENSION(jpi,jpj)     ::  & ! 2D workspace
+         zsshub, zsshun, zsshua,           &
+         zsshvb, zsshvn, zsshva
       REAL(wp), DIMENSION(jpi,jpj,jpk) ::  &
          zfse3ub, zfse3un, zfse3ua, &        ! 3D workspace
@@ -134,39 +135,34 @@
          ! Scale factors at before and after time step
          ! -------------------------------------------
-         DO jk = 1, jpkm1
-            zfse3ub(:,:,jk)  = fsve3u(:,:,jk) * ( 1 + zsshub(:,:) * muu(:,:,jk) )
-            zfse3ua(:,:,jk)  = fsve3u(:,:,jk) * ( 1 + zsshua(:,:) * muu(:,:,jk) )
-            zfse3vb(:,:,jk)  = fsve3v(:,:,jk) * ( 1 + zsshvb(:,:) * muv(:,:,jk) )
-            zfse3va(:,:,jk)  = fsve3v(:,:,jk) * ( 1 + zsshva(:,:) * muv(:,:,jk) )
-         END DO
+         zfse3ub(:,:,:) = sfe3( zsshub, 'U' )   ;    zfse3ua(:,:,:) = sfe3( zsshua, 'U' )
+         zfse3vb(:,:,:) = sfe3( zsshvb, 'V' )   ;    zfse3va(:,:,:) = sfe3( zsshva, 'V' )
 
          ! Asselin filtered scale factor at now time step
          ! ----------------------------------------------
          IF( (neuler == 0 .AND. kt == nit000) .OR. lk_dynspg_ts ) THEN
-            zfse3un(:,:,:) = fse3u(:,:,:)
-            zfse3vn(:,:,:) = fse3v(:,:,:)
+            zfse3un(:,:,:) = sfe3ini( 'U' )
+            zfse3vn(:,:,:) = sfe3ini( 'V' )
          ELSE
-            DO jk = 1, jpkm1
-               DO jj = 1, jpj
-                  DO ji = 1, jpi
-                     zsshun = atfp * ( zsshub(ji,jj) + zsshua(ji,jj) ) + atfp1 * sshu(ji,jj)
-                     zsshvn = atfp * ( zsshvb(ji,jj) + zsshva(ji,jj) ) + atfp1 * sshv(ji,jj)
-                     zfse3un(ji,jj,jk) = fsve3u(ji,jj,jk) * ( 1 + zsshun * muu(ji,jj,jk) )
-                     zfse3vn(ji,jj,jk) = fsve3v(ji,jj,jk) * ( 1 + zsshvn * muv(ji,jj,jk) )
-                  END DO
-               END DO
-            END DO
+            zsshun(:,:) = atfp * ( zsshub(:,:) + zsshua(:,:) ) + atfp1 * sshu(:,:)
+            zsshvn(:,:) = atfp * ( zsshvb(:,:) + zsshva(:,:) ) + atfp1 * sshv(:,:)
+            zfse3un(:,:,:) = sfe3( zsshun, 'U' )   ;    zfse3vn(:,:,:) = sfe3( zsshvn, 'V' )
          ENDIF
 
          ! Thickness weighting
          ! -------------------
-         ua(:,:,1:jpkm1) = ua(:,:,1:jpkm1) * fse3u (:,:,1:jpkm1)
-         va(:,:,1:jpkm1) = va(:,:,1:jpkm1) * fse3v (:,:,1:jpkm1)
-
-         un(:,:,1:jpkm1) = un(:,:,1:jpkm1) * fse3u (:,:,1:jpkm1)
-         vn(:,:,1:jpkm1) = vn(:,:,1:jpkm1) * fse3v (:,:,1:jpkm1)
-
-         ub(:,:,1:jpkm1) = ub(:,:,1:jpkm1) * zfse3ub(:,:,1:jpkm1)
-         vb(:,:,1:jpkm1) = vb(:,:,1:jpkm1) * zfse3vb(:,:,1:jpkm1)
+         DO jk = 1, jpkm1
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+                  ua(ji,jj,jk) = ua(ji,jj,jk) * fse3u(ji,jj,jk)
+                  va(ji,jj,jk) = va(ji,jj,jk) * fse3v(ji,jj,jk)
+
+                  un(ji,jj,jk) = un(ji,jj,jk) * fse3u(ji,jj,jk)
+                  vn(ji,jj,jk) = vn(ji,jj,jk) * fse3v(ji,jj,jk)
+
+                  ub(ji,jj,jk) = ub(ji,jj,jk) * zfse3ub(ji,jj,jk)
+                  vb(ji,jj,jk) = vb(ji,jj,jk) * zfse3vb(ji,jj,jk)
+               END DO
+            END DO
+         END DO
 
       ENDIF
@@ -241,12 +237,12 @@
                DO jj = 1, jpj
                   DO ji = 1, jpi
-                     zsshun = umask(ji,jj,jk) / fse3u(ji,jj,jk)
-                     zsshvn = vmask(ji,jj,jk) / fse3v(ji,jj,jk)
-                     ub(ji,jj,jk) = un(ji,jj,jk) * zsshun * umask(ji,jj,jk)
-                     vb(ji,jj,jk) = vn(ji,jj,jk) * zsshvn * vmask(ji,jj,jk)
-                     zsshun = umask(ji,jj,jk) / zfse3ua(ji,jj,jk)
-                     zsshvn = vmask(ji,jj,jk) / zfse3va(ji,jj,jk)
-                     un(ji,jj,jk) = ua(ji,jj,jk) * zsshun * umask(ji,jj,jk)
-                     vn(ji,jj,jk) = va(ji,jj,jk) * zsshvn * vmask(ji,jj,jk)
+                     zsshun1 = umask(ji,jj,jk) / fse3u(ji,jj,jk)
+                     zsshvn1 = vmask(ji,jj,jk) / fse3v(ji,jj,jk)
+                     ub(ji,jj,jk) = un(ji,jj,jk) * zsshun1 * umask(ji,jj,jk)
+                     vb(ji,jj,jk) = vn(ji,jj,jk) * zsshvn1 * vmask(ji,jj,jk)
+                     zsshun1 = umask(ji,jj,jk) / zfse3ua(ji,jj,jk)
+                     zsshvn1 = vmask(ji,jj,jk) / zfse3va(ji,jj,jk)
+                     un(ji,jj,jk) = ua(ji,jj,jk) * zsshun1 * umask(ji,jj,jk)
+                     vn(ji,jj,jk) = va(ji,jj,jk) * zsshvn1 * vmask(ji,jj,jk)
                   END DO
                END DO
@@ -268,14 +264,14 @@
                DO jj = 1, jpj
                   DO ji = 1, jpi
-                     zsshun = umask(ji,jj,jk) / zfse3un(ji,jj,jk)
-                     zsshvn = vmask(ji,jj,jk) / zfse3vn(ji,jj,jk)
+                     zsshun1 = umask(ji,jj,jk) / zfse3un(ji,jj,jk)
+                     zsshvn1 = vmask(ji,jj,jk) / zfse3vn(ji,jj,jk)
                      ub(ji,jj,jk) = ( atfp  * ( ub(ji,jj,jk) + ua(ji,jj,jk) ) &
-                       &            + atfp1 * un(ji,jj,jk) ) * zsshun
+                       &            + atfp1 * un(ji,jj,jk) ) * zsshun1
                      vb(ji,jj,jk) = ( atfp  * ( vb(ji,jj,jk) + va(ji,jj,jk) ) &
-                       &            + atfp1 * vn(ji,jj,jk) ) * zsshvn
-                     zsshun = umask(ji,jj,jk) / zfse3ua(ji,jj,jk)
-                     zsshvn = vmask(ji,jj,jk) / zfse3va(ji,jj,jk)
-                     un(ji,jj,jk) = ua(ji,jj,jk) * zsshun
-                     vn(ji,jj,jk) = va(ji,jj,jk) * zsshvn
+                       &            + atfp1 * vn(ji,jj,jk) ) * zsshvn1
+                     zsshun1 = umask(ji,jj,jk) / zfse3ua(ji,jj,jk)
+                     zsshvn1 = vmask(ji,jj,jk) / zfse3va(ji,jj,jk)
+                     un(ji,jj,jk) = ua(ji,jj,jk) * zsshun1
+                     vn(ji,jj,jk) = va(ji,jj,jk) * zsshvn1
                   END DO
                END DO
Index: trunk/NEMO/OPA_SRC/DYN/dynspg_flt.F90
===================================================================
--- trunk/NEMO/OPA_SRC/DYN/dynspg_flt.F90	(revision 608)
+++ trunk/NEMO/OPA_SRC/DYN/dynspg_flt.F90	(revision 642)
@@ -187,18 +187,20 @@
          ! Scale factors at before and after time step
          ! -------------------------------------------
-         DO jk = 1, jpkm1
-            zfse3ua(:,:,jk)  = fsve3u(:,:,jk) * ( 1 + zsshua(:,:) * muu(:,:,jk) )
-            zfse3va(:,:,jk)  = fsve3v(:,:,jk) * ( 1 + zsshva(:,:) * muv(:,:,jk) )
-            zfse3ub(:,:,jk)  = fsve3u(:,:,jk) * ( 1 + zsshub(:,:) * muu(:,:,jk) )
-            zfse3vb(:,:,jk)  = fsve3v(:,:,jk) * ( 1 + zsshvb(:,:) * muv(:,:,jk) )
-         END DO
+         zfse3ua(:,:,:) = sfe3( zsshua, 'U' )    ;    zfse3ub(:,:,:) = sfe3( zsshub, 'U' )
+         zfse3va(:,:,:) = sfe3( zsshva, 'V' )    ;    zfse3vb(:,:,:) = sfe3( zsshvb, 'V' )
 
          ! Thickness weighting
          ! -------------------
-         ua(:,:,1:jpkm1) = ua(:,:,1:jpkm1) * fse3u(:,:,1:jpkm1)
-         va(:,:,1:jpkm1) = va(:,:,1:jpkm1) * fse3v(:,:,1:jpkm1)
-
-         zub(:,:,1:jpkm1) = ub(:,:,1:jpkm1) * zfse3ub(:,:,1:jpkm1)
-         zvb(:,:,1:jpkm1) = vb(:,:,1:jpkm1) * zfse3vb(:,:,1:jpkm1)
+         DO jk = 1, jpkm1
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+                  ua(ji,jj,jk) = ua(ji,jj,jk) * fse3u(ji,jj,jk)
+                  va(ji,jj,jk) = va(ji,jj,jk) * fse3v(ji,jj,jk)
+
+                  zub(ji,jj,jk) = ub(ji,jj,jk) * zfse3ub(ji,jj,jk)
+                  zvb(ji,jj,jk) = vb(ji,jj,jk) * zfse3vb(ji,jj,jk)
+               END DO
+            END DO
+         END DO
 
          ! Evaluate the masked next velocity (effect of the additional force not included)
Index: trunk/NEMO/OPA_SRC/DYN/dynspg_ts.F90
===================================================================
--- trunk/NEMO/OPA_SRC/DYN/dynspg_ts.F90	(revision 608)
+++ trunk/NEMO/OPA_SRC/DYN/dynspg_ts.F90	(revision 642)
@@ -511,8 +511,5 @@
             ! Scale factors at before and after time step
             ! -------------------------------------------
-            DO jk = 1, jpkm1
-               zfse3un_e(:,:,jk)  = fsve3u(:,:,jk) * ( 1 + zsshun_e(:,:) * muu(:,:,jk) )
-               zfse3vn_e(:,:,jk)  = fsve3v(:,:,jk) * ( 1 + zsshvn_e(:,:) * muv(:,:,jk) )
-            END DO
+            zfse3un_e(:,:,:) = sfe3( zsshun_e, 'U' )    ;    zfse3vn_e(:,:,:) = sfe3( zsshvn_e, 'V' )
 
             ! Ocean depth at U- and V-points
