Index: trunk/NEMO/OPA_SRC/TRA/trabbl_adv.h90
===================================================================
--- trunk/NEMO/OPA_SRC/TRA/trabbl_adv.h90	(revision 3)
+++ trunk/NEMO/OPA_SRC/TRA/trabbl_adv.h90	(revision 21)
@@ -71,19 +71,13 @@
          zahu, zahv                        !    "                  "
       REAL(wp), DIMENSION(jpi,jpj) ::   &  ! temporary workspace arrays
-         zalphax,zalphay, zwu, zwv,     &  !    "                  "
-         zunb, zvnb, zind,              &  !    "                  "
+         zalphax, zwu, zunb,            &  !    "                  "
+         zalphay, zwv, zvnb,            &  !    "                  "
          zwx, zwy, zww, zwz                !    "                  "
       REAL(wp), DIMENSION(jpi,jpj,jpk) ::   &
          zhdivn                            ! temporary workspace arrays
       REAL(wp) ::   &
-         zfui, zfvj, zbt, zsigna,       &  ! temporary scalars
-         zcofi , zupsut, zupsus,        &  !    "         "
-         zcofj , zupsvt, zupsvs,        &  !    "         "
-         zcenut, zcenus,                &  !    "         "
-         zcenvt, zcenvs                    !    "         "
+         zfui, zfvj, zbt, zsigna           ! temporary scalars
       REAL(wp) ::   &
-         fsalbt, pft, pfs, pfh,         &  ! statement function
-         fsx, fsy, pfx1, pfx2,          &  !    "          "
-         pfu, pfv, pfy1, pfy2              !    "          "
+         fsalbt, pft, pfs, pfh             ! statement function
       !!----------------------------------------------------------------------
       ! ratio alpha/beta
@@ -106,13 +100,4 @@
              +(   0.791325e-08 * pft - 0.933746e-06 ) * pft                  &
                                      + 0.380374e-04 ) * pfh
-      ! Up Stream Advection Scheme
-      ! ==========================
-      !  fsx: along i-direction
-      !  fsy: along j-direction
-
-      fsx( pfx1, pfx2, pfu ) = ( ( pfu + abs(pfu) ) * pfx1   &
-                                +( pfu - abs(pfu) ) * pfx2 ) * 0.5
-      fsy( pfy1, pfy2, pfv ) = ( ( pfv + abs(pfv) ) * pfy1   &
-                                +( pfv - abs(pfv) ) * pfy2 ) * 0.5
       !!----------------------------------------------------------------------
 
@@ -142,11 +127,11 @@
 #endif
       END DO
-# if defined key_vectopt_loop   &&   ! defined key_autotasking 
-      j = 1
+#if defined key_vectopt_loop   &&   ! defined key_autotasking 
+      jj = 1
       DO ji = 1, jpij-jpi   ! vector opt. (forced unrolling)
             zunb(ji,jj) = un(ji,jj,mbku(ji,jj)) * umask(ji,jj,1)
             zvnb(ji,jj) = vn(ji,jj,mbkv(ji,jj)) * vmask(ji,jj,1)   ! retirer le mask en u, v et t !
       END DO
-# else
+#else
       DO jj = 1, jpjm1
          DO ji = 1, jpim1
@@ -178,7 +163,7 @@
             zahu(ji,jj) = atrbbl*e2u(ji,jj)*fse3u(ji,jj,iku)/e1u(ji,jj) * umask(ji,jj,1)
             zahv(ji,jj) = atrbbl*e1v(ji,jj)*fse3v(ji,jj,ikv)/e2v(ji,jj) * vmask(ji,jj,1)
-#if ! defined key_vectopt_loop   ||   defined key_autotasking
-         END DO
-#endif
+# if ! defined key_vectopt_loop   ||   defined key_autotasking
+         END DO
+# endif
       END DO
 #endif
@@ -259,8 +244,7 @@
       END SELECT
 
-
       ! lateral boundary conditions on zalphax and zalphay   (unchanged sign)
        CALL lbc_lnk( zalphax, 'U', 1. )   ;   CALL lbc_lnk( zalphay, 'V', 1. )
-#endif
+
 
       ! 3. Velocities that are exchanged between ajacent bottom boxes.
@@ -288,6 +272,6 @@
           END DO
 
-      ! lateral boundary conditions on uzbbl and vzbbl   (changed sign)
-       CALL lbc_lnk( uzbbl, 'U', -1. )   ;   CALL lbc_lnk( vzbbl, 'V', -1. )
+      ! lateral boundary conditions on u_bbl and v_bbl   (changed sign)
+       CALL lbc_lnk( u_bbl, 'U', -1. )   ;   CALL lbc_lnk( v_bbl, 'V', -1. )
 
 
@@ -384,8 +368,12 @@
 !           zwz(ji,jj) = 0.5* zfvj * ( zsnb(ji,jj) + zsnb(ji,jj+1) )
             ! upstream scheme
-            zwx(ji,jj) = fsx(ztbb(ji,jj),ztbb(ji+1,jj),zfui)
-            zwy(ji,jj) = fsy(ztbb(ji,jj),ztbb(ji,jj+1),zfvj)
-            zww(ji,jj) = fsx(zsbb(ji,jj),zsbb(ji+1,jj),zfui)
-            zwz(ji,jj) = fsy(zsbb(ji,jj),zsbb(ji,jj+1),zfvj)
+            zwx(ji,jj) = ( ( zfui + ABS( zfui ) ) * ztbb(ji  ,jj  )   &
+               &          +( zfui - ABS( zfui ) ) * ztbb(ji+1,jj  ) ) * 0.5
+            zwy(ji,jj) = ( ( zfui + ABS( zfvj ) ) * ztbb(ji  ,jj  )   &
+               &          +( zfui - ABS( zfvj ) ) * ztbb(ji  ,jj+1) ) * 0.5
+            zww(ji,jj) = ( ( zfui + ABS( zfui ) ) * zsbb(ji  ,jj  )   &
+               &          +( zfui - ABS( zfui ) ) * zsbb(ji+1,jj  ) ) * 0.5
+            zwz(ji,jj) = ( ( zfui + ABS( zfvj ) ) * zsbb(ji  ,jj  )   &
+               &          +( zfui - ABS( zfvj ) ) * zsbb(ji  ,jj+1) ) * 0.5
 #if ! defined key_vectopt_loop   ||   defined key_autotasking
          END DO
