Index: trunk/NEMO/OPA_SRC/DYN/dynadv_cen2.F90
===================================================================
--- trunk/NEMO/OPA_SRC/DYN/dynadv_cen2.F90	(revision 1128)
+++ trunk/NEMO/OPA_SRC/DYN/dynadv_cen2.F90	(revision 1129)
@@ -16,5 +16,8 @@
    USE dynspg_oce     ! surface pressure gradient
    USE in_out_manager ! I/O manager
-   USE dynspg_rl     ! I/O manager
+   USE dynspg_rl      ! surface pressure gradient
+   USE trdmod         ! ocean dynamics trends
+   USE trdmod_oce     ! ocean variables trends
+   USE prtctl         ! Print control
 
    IMPLICIT NONE
@@ -45,6 +48,4 @@
       !!
       !! ** Action : - Update (ua,va) with the now vorticity term trend
-      !!             - save the trends in (utrd,vtrd) in 2 parts (relative
-      !!               and planetary vorticity trends) ('key_trddyn')
       !!----------------------------------------------------------------------
       USE oce, ONLY:   zfu => ta,   & ! use ta as 3D workspace
@@ -66,4 +67,8 @@
       ENDIF
 
+      IF( l_trddyn ) THEN           ! Save ua and va trends
+         zfu_uw(:,:,:) = ua(:,:,:)
+         zfv_vw(:,:,:) = va(:,:,:)
+      ENDIF
 
       ! I. Horizontal advection
@@ -99,8 +104,4 @@
                ua(ji,jj,jk) = ua(ji,jj,jk) + zua
                va(ji,jj,jk) = va(ji,jj,jk) + zva
-#if defined key_trddyn
-               utrd(ji,jj,jk,1) = zua                    ! save the horizontal advective trend of momentum
-               vtrd(ji,jj,jk,1) = zva 
-#endif
             END DO
          END DO
@@ -109,7 +110,18 @@
       !                                                ! ===============
 
+      IF( l_trddyn ) THEN      ! save the horizontal advection trend for diagnostic
+         zfu_uw(:,:,:) = ua(:,:,:) - zfu_uw(:,:,:)
+         zfv_vw(:,:,:) = va(:,:,:) - zfv_vw(:,:,:)
+         CALL trd_mod( zfu_uw, zfv_vw, jpdyn_trd_had, 'DYN', kt )
+      ENDIF
+      !
 
       ! II. Vertical advection
       ! ----------------------
+
+      IF( l_trddyn ) THEN           ! Save ua and va trends
+         zfu_t(:,:,:) = ua(:,:,:)
+         zfv_t(:,:,:) = va(:,:,:)
+      ENDIF
 
       ! Second order centered tracer flux at w-point
@@ -159,4 +171,14 @@
       END DO
 
+      IF( l_trddyn ) THEN      ! save the vertical advection trend for diagnostic
+         zfu_t(:,:,:) = ua(:,:,:) - zfu_t(:,:,:)
+         zfv_t(:,:,:) = va(:,:,:) - zfv_t(:,:,:)
+         CALL trd_mod( zfu_t, zfv_t, jpdyn_trd_zad, 'DYN', kt )
+      ENDIF
+
+      !                             ! Control print
+      IF(ln_ctl)   CALL prt_ctl( tab3d_1=ua, clinfo1=' cen2 adv - Ua: ', mask1=umask,   &
+         &                       tab3d_2=va, clinfo2=           ' Va: ', mask2=vmask, clinfo3='dyn' )
+      !
    END SUBROUTINE dyn_adv_cen2
 
Index: trunk/NEMO/OPA_SRC/DYN/dynadv_ubs.F90
===================================================================
--- trunk/NEMO/OPA_SRC/DYN/dynadv_ubs.F90	(revision 1128)
+++ trunk/NEMO/OPA_SRC/DYN/dynadv_ubs.F90	(revision 1129)
@@ -17,6 +17,9 @@
    USE dynspg_oce     ! surface pressure gradient
    USE in_out_manager ! I/O manager
-   USE dynspg_rl      ! I/O manager
+   USE dynspg_rl      ! surface pressure gradient
    USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
+   USE trdmod         ! ocean dynamics trends
+   USE trdmod_oce     ! ocean variables trends
+   USE prtctl         ! Print control
 
    IMPLICIT NONE
@@ -97,5 +100,9 @@
       zlv_vu(:,:,:,:) = 0.e0 
 
-      
+      IF( l_trddyn ) THEN           ! Save ua and va trends
+         zfu_uw(:,:,:) = ua(:,:,:)
+         zfv_vw(:,:,:) = va(:,:,:)
+      ENDIF
+
       !                                                ! ===============
       DO jk = 1, jpkm1                                 ! Horizontal slab
@@ -191,8 +198,4 @@
                ua(ji,jj,jk) = ua(ji,jj,jk) + zua
                va(ji,jj,jk) = va(ji,jj,jk) + zva
-#if defined key_trddyn
-               utrd(ji,jj,jk,1) = zua                    ! save the horizontal advective trend of momentum
-               vtrd(ji,jj,jk,1) = zva 
-#endif
             END DO
          END DO
@@ -201,7 +204,17 @@
       !                                                ! ===============
 
+      IF( l_trddyn ) THEN      ! save the horizontal advection trend for diagnostic
+         zfu_uw(:,:,:) = ua(:,:,:) - zfu_uw(:,:,:)
+         zfv_vw(:,:,:) = va(:,:,:) - zfv_vw(:,:,:)
+         CALL trd_mod( zfu_uw, zfv_vw, jpdyn_trd_had, 'DYN', kt )
+      ENDIF
 
       ! II. Vertical advection
       ! ----------------------
+
+      IF( l_trddyn ) THEN           ! Save ua and va trends
+         zfu_t(:,:,:) = ua(:,:,:)
+         zfv_t(:,:,:) = va(:,:,:)
+      ENDIF
 
       ! Second order centered tracer flux at w-point
@@ -251,4 +264,14 @@
       END DO
 
+      IF( l_trddyn ) THEN      ! save the vertical advection trend for diagnostic
+         zfu_t(:,:,:) = ua(:,:,:) - zfu_t(:,:,:)
+         zfv_t(:,:,:) = va(:,:,:) - zfv_t(:,:,:)
+         CALL trd_mod( zfu_t, zfv_t, jpdyn_trd_zad, 'DYN', kt )
+      ENDIF
+
+      !                             ! Control print
+      IF(ln_ctl)   CALL prt_ctl( tab3d_1=ua, clinfo1=' ubs2 adv - Ua: ', mask1=umask,   &
+         &                       tab3d_2=va, clinfo2=           ' Va: ', mask2=vmask, clinfo3='dyn' )
+
    END SUBROUTINE dyn_adv_ubs
 
Index: trunk/NEMO/OPA_SRC/TRD/trdicp.F90
===================================================================
--- trunk/NEMO/OPA_SRC/TRD/trdicp.F90	(revision 1128)
+++ trunk/NEMO/OPA_SRC/TRD/trdicp.F90	(revision 1129)
@@ -472,18 +472,19 @@
             WRITE (numout,9504) umo(jpicpd_pvo) / tvolu, vmo(jpicpd_pvo) / tvolv
             WRITE (numout,9505) umo(jpicpd_ldf) / tvolu, vmo(jpicpd_ldf) / tvolv
-            WRITE (numout,9506) umo(jpicpd_zad) / tvolu, vmo(jpicpd_zad) / tvolv
-            WRITE (numout,9507) umo(jpicpd_zdf) / tvolu, vmo(jpicpd_zdf) / tvolv
-            WRITE (numout,9508) umo(jpicpd_spg) / tvolu, vmo(jpicpd_spg) / tvolv
-            WRITE (numout,9509) umo(jpicpd_swf) / tvolu, vmo(jpicpd_swf) / tvolv
-            WRITE (numout,9510) umo(jpicpd_dat) / tvolu, vmo(jpicpd_dat) / tvolv
-            WRITE (numout,9511) umo(jpicpd_bfr) / tvolu, vmo(jpicpd_bfr) / tvolv
-            WRITE (numout,9512)
-            WRITE (numout,9513)                                                 &
+            WRITE (numout,9506) umo(jpicpd_had) / tvolu, vmo(jpicpd_had) / tvolv
+            WRITE (numout,9507) umo(jpicpd_zad) / tvolu, vmo(jpicpd_zad) / tvolv
+            WRITE (numout,9508) umo(jpicpd_zdf) / tvolu, vmo(jpicpd_zdf) / tvolv
+            WRITE (numout,9509) umo(jpicpd_spg) / tvolu, vmo(jpicpd_spg) / tvolv
+            WRITE (numout,9510) umo(jpicpd_swf) / tvolu, vmo(jpicpd_swf) / tvolv
+            WRITE (numout,9511) umo(jpicpd_dat) / tvolu, vmo(jpicpd_dat) / tvolv
+            WRITE (numout,9512) umo(jpicpd_bfr) / tvolu, vmo(jpicpd_bfr) / tvolv
+            WRITE (numout,9513)
+            WRITE (numout,9514)                                                 &
             &     (  umo(jpicpd_hpg) + umo(jpicpd_keg) + umo(jpicpd_rvo) + umo(jpicpd_pvo) + umo(jpicpd_ldf)   &
-            &      + umo(jpicpd_zad) + umo(jpicpd_zdf) + umo(jpicpd_spg) + umo(jpicpd_dat) + umo(jpicpd_swf)   &
-            &      + umo(jpicpd_bfr) ) / tvolu,   &
+            &      + umo(jpicpd_had) + umo(jpicpd_zad) + umo(jpicpd_zdf) + umo(jpicpd_spg) + umo(jpicpd_dat)   &
+            &      + umo(jpicpd_swf) + umo(jpicpd_bfr) ) / tvolu,   &
             &     (  vmo(jpicpd_hpg) + vmo(jpicpd_keg) + vmo(jpicpd_rvo) + vmo(jpicpd_pvo) + vmo(jpicpd_ldf)   &
-            &      + vmo(jpicpd_zad) + vmo(jpicpd_zdf) + vmo(jpicpd_spg) + vmo(jpicpd_dat) + vmo(jpicpd_swf)   &
-            &      + vmo(jpicpd_bfr) ) / tvolv
+            &      + vmo(jpicpd_had) + vmo(jpicpd_zad) + vmo(jpicpd_zdf) + vmo(jpicpd_spg) + vmo(jpicpd_dat)   &
+            &      + vmo(jpicpd_swf) + vmo(jpicpd_bfr) ) / tvolv
          ENDIF
 
@@ -494,12 +495,13 @@
  9504    FORMAT(' coriolis term              u= ', e20.13, '    v= ', e20.13)
  9505    FORMAT(' horizontal diffusion       u= ', e20.13, '    v= ', e20.13)
- 9506    FORMAT(' vertical advection         u= ', e20.13, '    v= ', e20.13)
- 9507    FORMAT(' vertical diffusion         u= ', e20.13, '    v= ', e20.13)
- 9508    FORMAT(' surface pressure gradient  u= ', e20.13, '    v= ', e20.13)
- 9509    FORMAT(' surface wind forcing       u= ', e20.13, '    v= ', e20.13)
- 9510    FORMAT(' dampimg term               u= ', e20.13, '    v= ', e20.13)
- 9511    FORMAT(' bottom flux                u= ', e20.13, '    v= ', e20.13)
- 9512    FORMAT(' -----------------------------------------------------------------------------')
- 9513    FORMAT(' total trend                u= ', e20.13, '    v= ', e20.13)
+ 9506    FORMAT(' horizontal advection       u= ', e20.13, '    v= ', e20.13)
+ 9507    FORMAT(' vertical advection         u= ', e20.13, '    v= ', e20.13)
+ 9508    FORMAT(' vertical diffusion         u= ', e20.13, '    v= ', e20.13)
+ 9509    FORMAT(' surface pressure gradient  u= ', e20.13, '    v= ', e20.13)
+ 9510    FORMAT(' surface wind forcing       u= ', e20.13, '    v= ', e20.13)
+ 9511    FORMAT(' dampimg term               u= ', e20.13, '    v= ', e20.13)
+ 9512    FORMAT(' bottom flux                u= ', e20.13, '    v= ', e20.13)
+ 9513    FORMAT(' -----------------------------------------------------------------------------')
+ 9514    FORMAT(' total trend                u= ', e20.13, '    v= ', e20.13)
 
          IF(lwp) THEN
@@ -512,13 +514,15 @@
             WRITE (numout,9524) hke(jpicpd_pvo) / tvolt
             WRITE (numout,9525) hke(jpicpd_ldf) / tvolt
-            WRITE (numout,9526) hke(jpicpd_zad) / tvolt
-            WRITE (numout,9527) hke(jpicpd_zdf) / tvolt
-            WRITE (numout,9528) hke(jpicpd_spg) / tvolt
-            WRITE (numout,9529) hke(jpicpd_swf) / tvolt
-            WRITE (numout,9530) hke(jpicpd_dat) / tvolt
-            WRITE (numout,9531)
-            WRITE (numout,9532)   &
+            WRITE (numout,9526) hke(jpicpd_had) / tvolt
+            WRITE (numout,9527) hke(jpicpd_zad) / tvolt
+            WRITE (numout,9528) hke(jpicpd_zdf) / tvolt
+            WRITE (numout,9529) hke(jpicpd_spg) / tvolt
+            WRITE (numout,9530) hke(jpicpd_swf) / tvolt
+            WRITE (numout,9531) hke(jpicpd_dat) / tvolt
+            WRITE (numout,9532)
+            WRITE (numout,9533)   &
             &     (  hke(jpicpd_hpg) + hke(jpicpd_keg) + hke(jpicpd_rvo) + hke(jpicpd_pvo) + hke(jpicpd_ldf)   &
-            &      + hke(jpicpd_zad) + hke(jpicpd_zdf) + hke(jpicpd_spg) + hke(jpicpd_dat) + hke(jpicpd_swf) ) / tvolt
+            &      + hke(jpicpd_had) + hke(jpicpd_zad) + hke(jpicpd_zdf) + hke(jpicpd_spg) + hke(jpicpd_dat)   &
+            &      + hke(jpicpd_swf) ) / tvolt
          ENDIF
 
@@ -529,11 +533,12 @@
  9524    FORMAT(' coriolis term             u2= ', e20.13)
  9525    FORMAT(' horizontal diffusion      u2= ', e20.13)
- 9526    FORMAT(' vertical advection        u2= ', e20.13)
- 9527    FORMAT(' vertical diffusion        u2= ', e20.13)
- 9528    FORMAT(' surface pressure gradient u2= ', e20.13)
- 9529    FORMAT(' surface wind forcing      u2= ', e20.13)
- 9530    FORMAT(' dampimg term              u2= ', e20.13)
- 9531    FORMAT(' --------------------------------------------------')
- 9532    FORMAT(' total trend               u2= ', e20.13)
+ 9526    FORMAT(' horizontal advection      u2= ', e20.13)
+ 9527    FORMAT(' vertical advection        u2= ', e20.13)
+ 9528    FORMAT(' vertical diffusion        u2= ', e20.13)
+ 9529    FORMAT(' surface pressure gradient u2= ', e20.13)
+ 9530    FORMAT(' surface wind forcing      u2= ', e20.13)
+ 9531    FORMAT(' dampimg term              u2= ', e20.13)
+ 9532    FORMAT(' --------------------------------------------------')
+ 9533    FORMAT(' total trend               u2= ', e20.13)
 
          IF(lwp) THEN
@@ -541,6 +546,6 @@
             WRITE (numout,*)
             WRITE (numout,9540) kt
-            WRITE (numout,9541) ( hke(jpicpd_keg) + hke(jpicpd_rvo) + hke(jpicpd_zad) ) / tvolt
-            WRITE (numout,9542) ( hke(jpicpd_keg) + hke(jpicpd_zad) ) / tvolt
+            WRITE (numout,9541) ( hke(jpicpd_keg) + hke(jpicpd_rvo) + hke(jpicpd_had) + hke(jpicpd_zad) ) / tvolt
+            WRITE (numout,9542) ( hke(jpicpd_keg) + hke(jpicpd_had) + hke(jpicpd_zad) ) / tvolt
             WRITE (numout,9543) ( hke(jpicpd_pvo) ) / tvolt
             WRITE (numout,9544) ( hke(jpicpd_rvo) ) / tvolt
@@ -555,5 +560,5 @@
  9540    FORMAT(' energetic consistency at it= ', i6, ' :', /' =========================================')
  9541    FORMAT(' 0 = non linear term(true if key_vorenergy or key_combined): ', e20.13)
- 9542    FORMAT(' 0 = ke gradient + vertical advection                      : ', e20.13)
+ 9542    FORMAT(' 0 = ke gradient + horizontal + vertical advection         : ', e20.13)
  9543    FORMAT(' 0 = coriolis term  (true if key_vorenergy or key_combined): ', e20.13)
  9544    FORMAT(' 0 = uh.( rot(u) x uh ) (true if enstrophy conser.)        : ', e20.13)
Index: trunk/NEMO/OPA_SRC/TRD/trdicp_oce.F90
===================================================================
--- trunk/NEMO/OPA_SRC/TRD/trdicp_oce.F90	(revision 1128)
+++ trunk/NEMO/OPA_SRC/TRD/trdicp_oce.F90	(revision 1129)
@@ -56,13 +56,14 @@
         jpicpd_pvo =  4,   &  !: planetary vorticity
         jpicpd_ldf =  5,   &  !: lateral diffusion
-        jpicpd_zad =  6,   &  !: vertical advection
-        jpicpd_zdf =  7,   &  !: vertical diffusion
-        jpicpd_spg =  8,   &  !: surface pressure gradient
-        jpicpd_dat =  9,   &  !: damping term
-        jpicpd_swf = 10,   &  !: surface wind forcing
-        jpicpd_bfr = 11       !: bottom friction 
+        jpicpd_had =  6,   &  !: horizontal advection
+        jpicpd_zad =  7,   &  !: vertical advection
+        jpicpd_zdf =  8,   &  !: vertical diffusion
+        jpicpd_spg =  9,   &  !: surface pressure gradient
+        jpicpd_dat = 10,   &  !: damping term
+        jpicpd_swf = 11,   &  !: surface wind forcing
+        jpicpd_bfr = 12       !: bottom friction 
 
    INTEGER, PARAMETER ::   &  !: => Total dynamic trends indexes <=
-        jptot_dyn = 11        !: change it when adding/removing one indice above
+        jptot_dyn = 12        !: change it when adding/removing one indice above
    
 #if   defined key_trdtra   ||   defined key_trddyn   ||   defined key_esopa
Index: trunk/NEMO/OPA_SRC/TRD/trdmod.F90
===================================================================
--- trunk/NEMO/OPA_SRC/TRD/trdmod.F90	(revision 1128)
+++ trunk/NEMO/OPA_SRC/TRD/trdmod.F90	(revision 1129)
@@ -113,4 +113,5 @@
             CASE ( jpdyn_trd_pvo )   ;   CALL trd_icp( ptrdx, ptrdy, jpicpd_pvo, ctype )   ! planetary vorticity
             CASE ( jpdyn_trd_ldf )   ;   CALL trd_icp( ptrdx, ptrdy, jpicpd_ldf, ctype )   ! lateral diffusion 
+            CASE ( jpdyn_trd_had )   ;   CALL trd_icp( ptrdx, ptrdy, jpicpd_had, ctype )   ! horizontal advection 
             CASE ( jpdyn_trd_zad )   ;   CALL trd_icp( ptrdx, ptrdy, jpicpd_zad, ctype )   ! vertical advection 
             CASE ( jpdyn_trd_spg )   ;   CALL trd_icp( ptrdx, ptrdy, jpicpd_spg, ctype )   ! surface pressure grad.
@@ -164,4 +165,5 @@
          CASE ( jpdyn_trd_pvo )   ;   CALL trd_vor_zint( ptrdx, ptrdy, jpvor_pvo )   ! Planetary Vorticity Term 
          CASE ( jpdyn_trd_ldf )   ;   CALL trd_vor_zint( ptrdx, ptrdy, jpvor_ldf )   ! Horizontal Diffusion 
+         CASE ( jpdyn_trd_had )   ;   CALL ctl_warn('Vorticity for horizontal advection trend never checked')   
          CASE ( jpdyn_trd_zad )   ;   CALL trd_vor_zint( ptrdx, ptrdy, jpvor_zad )   ! Vertical Advection 
          CASE ( jpdyn_trd_spg )   ;   CALL trd_vor_zint( ptrdx, ptrdy, jpvor_spg )   ! Surface Pressure Grad. 
Index: trunk/NEMO/OPA_SRC/TRD/trdmod_oce.F90
===================================================================
--- trunk/NEMO/OPA_SRC/TRD/trdmod_oce.F90	(revision 1128)
+++ trunk/NEMO/OPA_SRC/TRD/trdmod_oce.F90	(revision 1129)
@@ -53,10 +53,11 @@
    INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_pvo =  4   !: planetary vorticity
    INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_ldf =  5   !: lateral diffusion
-   INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_zad =  6   !: vertical advection
-   INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_zdf =  7   !: vertical diffusion
-   INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_spg =  8   !: surface pressure gradient
-   INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_dat =  9   !: damping term
-   INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_swf = 10   !: surface wind forcing
-   INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_bfr = 11   !: bottom friction 
+   INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_had =  6   !: horizontal advection
+   INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_zad =  7   !: vertical advection
+   INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_zdf =  8   !: vertical diffusion
+   INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_spg =  9   !: surface pressure gradient
+   INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_dat = 10   !: damping term
+   INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_swf = 11   !: surface wind forcing
+   INTEGER, PUBLIC, PARAMETER ::   jpdyn_trd_bfr = 12   !: bottom friction 
 
    !!----------------------------------------------------------------------
