Index: branches/DEV_r2106_LOCEAN2010/NEMO/OPA_SRC/TRA/tranxt.F90
===================================================================
--- branches/DEV_r2106_LOCEAN2010/NEMO/OPA_SRC/TRA/tranxt.F90	(revision 2111)
+++ branches/DEV_r2106_LOCEAN2010/NEMO/OPA_SRC/TRA/tranxt.F90	(revision 2120)
@@ -32,4 +32,5 @@
    USE trdtra          ! ocean active tracers trends 
    USE phycst
+   USE obc_oce
    USE obctra          ! open boundary condition (obc_tra routine)
    USE bdytra          ! Unstructured open boundary condition (bdy_tra routine)
@@ -40,5 +41,4 @@
    USE agrif_opa_update
    USE agrif_opa_interp
-   USE obc_oce
 
    IMPLICIT NONE
@@ -106,13 +106,15 @@
       CALL tra_unswap
 #endif
+
 #if defined key_obc
       IF( lk_obc )   CALL obc_tra( kt )  ! OBC open boundaries
 #endif
-#if defined key_bdy
-      CALL bdy_tra( kt )               ! BDY open boundaries
+#if defined key_bdy 
+      IF( lk_bdy )   CALL bdy_tra( kt )  ! BDY open boundaries
 #endif
 #if defined key_agrif
-      CALL Agrif_tra                   ! AGRIF zoom boundaries
-#endif
+      CALL Agrif_tra                     ! AGRIF zoom boundaries
+#endif
+
 #if defined key_obc || defined key_bdy || defined key_agrif
       CALL tra_swap
@@ -199,20 +201,18 @@
       ENDIF
       !
-      !                                              ! ----------------------- !
-      IF( ln_dynhpg_imp ) THEN                       ! semi-implicite hpg case !
+      !
+      IF( neuler == 0 .AND. kt == nit000 ) THEN        ! Euler time-stepping at first time-step
+         !                                             ! (only swap)
+         DO jn = 1, kjpt
+            DO jk = 1, jpkm1                              
+               ptn(:,:,jk,jn) = pta(:,:,jk,jn)     ! ptb <-- ptn
+            END DO
+         END DO
+         !                                              
+      ELSE                                           ! general case (Leapfrog + Asselin filter
+         !
          !                                           ! ----------------------- !
-         !
-         IF( neuler == 0 .AND. kt == nit000 ) THEN        ! Euler time-stepping at first time-step
-            !                                             ! (only swap)
-            DO jn = 1, kjpt
-               DO jk = 1, jpkm1                              
-                  DO jj = 1, jpj
-                     DO ji = 1, jpi
-                        ptn(ji,jj,jk,jn) = pta(ji,jj,jk,jn)     ! ptb <-- ptn
-                     END DO
-                  END DO
-               END DO
-            END DO
-         ELSE                                             ! general case (Leapfrog + Asselin filter
+         IF( ln_dynhpg_imp ) THEN                    ! semi-implicite hpg case !
+            !                                        ! ----------------------- !
             DO jn = 1, kjpt
                DO jk = 1, jpkm1
@@ -220,5 +220,5 @@
                      DO ji = 1, jpi
                         ztm = 0.25 * ( pta(ji,jj,jk,jn) + 2.* ptn(ji,jj,jk,jn) + ptb(ji,jj,jk,jn) )  ! mean pt
-                        ztf = atfp * ( pta(ji,jj,jk,jn) - 2.* ptn(ji,jj,jk,jn) + ptn(ji,jj,jk,jn) )  ! Asselin filter on pt 
+                        ztf = atfp * ( pta(ji,jj,jk,jn) - 2.* ptn(ji,jj,jk,jn) + ptb(ji,jj,jk,jn) )  ! Asselin filter on pt 
                         ptb(ji,jj,jk,jn) = ptn(ji,jj,jk,jn) + ztf                                      ! ptb <-- filtered ptn 
                         ptn(ji,jj,jk,jn) = pta(ji,jj,jk,jn)                                            ! ptn <-- pta
@@ -228,20 +228,7 @@
                END DO
             END DO
-         ENDIF
-         !                                           ! ----------------------- !
-      ELSE                                           !    explicit hpg case    !
-         !                                           ! ----------------------- !
-         !
-         IF( neuler == 0 .AND. kt == nit000 ) THEN        ! Euler time-stepping at first time-step
-            DO jn = 1, kjpt
-               DO jk = 1, jpkm1
-                  DO jj = 1, jpj
-                     DO ji = 1, jpi
-                        ptn(ji,jj,jk,jn) = pta(ji,jj,jk,jn)                                             ! ptn <-- pta
-                     END DO
-                  END DO
-               END DO
-            END DO
-         ELSE                                             ! general case (Leapfrog + Asselin filter
+            !                                           ! ----------------------- !
+         ELSE                                           !    explicit hpg case    !
+            !                                           ! ----------------------- !
             DO jn = 1, kjpt
                DO jk = 1, jpkm1
@@ -255,4 +242,5 @@
                END DO
             END DO
+            !
          ENDIF
          !
@@ -304,20 +292,19 @@
       ENDIF
       !
-      !                                              ! ----------------------- !
-      IF( ln_dynhpg_imp ) THEN                       ! semi-implicite hpg case !
-         !                                           ! ----------------------- !
+      !
+      IF( neuler == 0 .AND. kt == nit000 ) THEN        ! Euler time-stepping at first time-step
+         !                                             ! (only swap)
+         DO jn = 1, kjpt
+            DO jk = 1, jpkm1                              
+               ptn(:,:,jk,jn) = pta(:,:,jk,jn)         ! ptb <-- ptn
+            END DO
+         END DO
+         !                                              
+      ELSE                                              ! general case (Leapfrog + Asselin filter
          !
-         IF( neuler == 0 .AND. kt == nit000 ) THEN        ! Euler time-stepping at first time-step
-            DO jn = 1, kjpt                               ! (only swap)
-               DO jk = 1, jpkm1                              
-                  DO jj = 1, jpj
-                     DO ji = 1, jpi
-                        ptn(ji,jj,jk,jn) = pta(ji,jj,jk,jn)                    ! tn <-- ta
-                     END DO
-                  END DO
-               END DO
-            END DO
-         ELSE
-            DO jn = 1, kjpt                               ! (only swap)
+         !                                              ! ----------------------- !
+         IF( ln_dynhpg_imp ) THEN                       ! semi-implicite hpg case !
+            !                                           ! ----------------------- !
+            DO jn = 1, kjpt                               
                DO jk = 1, jpkm1
                   DO jj = 1, jpj
@@ -351,21 +338,7 @@
                END DO
             END DO
-         ENDIF
-         !                                           ! ----------------------- !
-      ELSE                                           !    explicit hpg case    !
-         !                                           ! ----------------------- !
-         !
-         IF( neuler == 0 .AND. kt == nit000 ) THEN        ! case of Euler time-stepping at first time-step
-            DO jn = 1, kjpt                               ! No filter nor thickness weighting computation required    
-               DO jk = 1, jpkm1                           ! ONLY swap                        
-                  DO jj = 1, jpj                             
-                     DO ji = 1, jpi
-                        ptn(ji,jj,jk,jn) = pta(ji,jj,jk,jn)                                 ! tn <-- ta
-                     END DO
-                  END DO
-               END DO
-            END DO
-            !                                             ! general case (Leapfrog + Asselin filter)
-         ELSE                                             ! apply filter on thickness weighted tracer and swap
+            !                                        ! ----------------------- !
+         ELSE                                        !    explicit hpg case    !
+            !                                        ! ----------------------- !
             DO jn = 1, kjpt      
                DO jk = 1, jpkm1
@@ -388,11 +361,13 @@
                         ztf   =  ( ztcn  + ztc_f ) * ze3fr
                         !                                         ! swap of arrays
-                        ptb(ji,jj,jk,jn) = ztf                  ! tb <-- tn filtered
-                        ptn(ji,jj,jk,jn) = pta(ji,jj,jk,jn)   ! tn <-- ta
+                        ptb(ji,jj,jk,jn) = ztf                    ! tb <-- tn filtered
+                        ptn(ji,jj,jk,jn) = pta(ji,jj,jk,jn)       ! tn <-- ta
                      END DO
                   END DO
                END DO
             END DO
+            !
          ENDIF
+         !
       ENDIF
       !
