Index: branches/2015/dev_merge_2015/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen.F90
===================================================================
--- branches/2015/dev_merge_2015/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen.F90	(revision 6059)
+++ branches/2015/dev_merge_2015/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen.F90	(revision 6060)
@@ -2,5 +2,5 @@
    !!======================================================================
    !!                     ***  MODULE  traadv_cen  ***
-   !! Ocean  tracers:  horizontal & vertical advective trend (2nd/4th order centered)
+   !! Ocean  tracers:   advective trend (2nd/4th order centered)
    !!======================================================================
    !! History :  3.7  ! 2014-05  (G. Madec)  original code
@@ -8,21 +8,21 @@
 
    !!----------------------------------------------------------------------
-   !!   tra_adv_cen : update the tracer trend with the advection trends using a centered or scheme (2nd or 4th order)
-   !!                 NB: on the vertical it is actually a 4th order COMPACT scheme which is used
-   !!----------------------------------------------------------------------
-   USE oce, ONLY: tsn  ! now ocean temperature and salinity
-   USE dom_oce         ! ocean space and time domain
-   USE eosbn2          ! equation of state
-   USE traadv_fct      ! acces to routine interp_4th_cpt 
-   USE trd_oce         ! trends: ocean variables
-   USE trdtra          ! trends manager: tracers 
-   USE diaptr          ! poleward transport diagnostics
+   !!   tra_adv_cen   : update the tracer trend with the advection trends using a centered or scheme (2nd or 4th order)
+   !!                   NB: on the vertical it is actually a 4th order COMPACT scheme which is used
+   !!----------------------------------------------------------------------
+   USE oce      , ONLY: tsn ! now ocean temperature and salinity
+   USE dom_oce        ! ocean space and time domain
+   USE eosbn2         ! equation of state
+   USE traadv_fct     ! acces to routine interp_4th_cpt 
+   USE trd_oce        ! trends: ocean variables
+   USE trdtra         ! trends manager: tracers 
+   USE diaptr         ! poleward transport diagnostics
    !
-   USE in_out_manager  ! I/O manager
-   USE iom             ! IOM library
-   USE trc_oce         ! share passive tracers/Ocean variables
-   USE lib_mpp         ! MPP library
-   USE wrk_nemo        ! Memory Allocation
-   USE timing          ! Timing
+   USE in_out_manager ! I/O manager
+   USE iom            ! IOM library
+   USE trc_oce        ! share passive tracers/Ocean variables
+   USE lib_mpp        ! MPP library
+   USE wrk_nemo       ! Memory Allocation
+   USE timing         ! Timing
 
    IMPLICIT NONE
@@ -34,5 +34,4 @@
 
    !! * Substitutions
-#  include "domzgr_substitute.h90"
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
@@ -53,13 +52,12 @@
       !! ** Method  :   The advection is evaluated by a 2nd or 4th order scheme
       !!               using now fields (leap-frog scheme). 
-      !!
       !!       kn_cen_h = 2  ==>> 2nd order centered scheme on the horizontal
       !!                = 4  ==>> 4th order    -        -       -      -
-      !!
       !!       kn_cen_v = 2  ==>> 2nd order centered scheme on the vertical
       !!                = 4  ==>> 4th order COMPACT  scheme     -      -
       !!
-      !! ** Action :  - update pta  with the now advective tracer trends
-      !!              - send trends to trdtra module for further diagnostcs
+      !! ** Action : - update pta  with the now advective tracer trends
+      !!             - send trends to trdtra module for further diagnostcs (l_trdtra=T)
+      !!             - htr_adv, str_adv : poleward advective heat and salt transport (ln_diaptr=T)
       !!----------------------------------------------------------------------
       INTEGER                              , INTENT(in   ) ::   kt              ! ocean time-step index
@@ -90,13 +88,13 @@
       ENDIF
       !
-      !                          ! surface & bottom values 
-      IF( lk_vvl )   zwz(:,:, 1 ) = 0._wp             ! set to zero one for all
-                     zwz(:,:,jpk) = 0._wp             ! except at the surface in linear free surface
+      !                    
+      zwz(:,:, 1 ) = 0._wp       ! surface & bottom vertical flux set to zero for all tracers
+      zwz(:,:,jpk) = 0._wp
       !
       DO jn = 1, kjpt            !==  loop over the tracers  ==!
          !
-         SELECT CASE( kn_cen_h )          !--  Horizontal fluxes  --!
-         !
-         CASE(  2  )                               ! 2nd order centered
+         SELECT CASE( kn_cen_h )       !--  Horizontal fluxes  --!
+         !
+         CASE(  2  )                         !* 2nd order centered
             DO jk = 1, jpkm1
                DO jj = 1, jpjm1
@@ -108,9 +106,9 @@
             END DO
             !
-         CASE(  4  )                               ! 4th order centered
-            ztu(:,:,jpk) = 0._wp                            ! Bottom value : flux set to zero
+         CASE(  4  )                         !* 4th order centered
+            ztu(:,:,jpk) = 0._wp                   ! Bottom value : flux set to zero
             ztv(:,:,jpk) = 0._wp
-            DO jk = 1, jpkm1                                 ! gradient
-               DO jj = 2, jpjm1                                   ! masked derivative
+            DO jk = 1, jpkm1                       ! masked gradient
+               DO jj = 2, jpjm1
                   DO ji = fs_2, fs_jpim1   ! vector opt.
                      ztu(ji,jj,jk) = ( ptn(ji+1,jj  ,jk,jn) - ptn(ji,jj,jk,jn) ) * umask(ji,jj,jk)
@@ -121,5 +119,5 @@
             CALL lbc_lnk( ztu, 'U', -1. )   ;    CALL lbc_lnk( ztv, 'V', -1. )   ! Lateral boundary cond. (unchanged sgn)
             !
-            DO jk = 1, jpkm1                                 ! Horizontal advective fluxes
+            DO jk = 1, jpkm1                       ! Horizontal advective fluxes
                DO jj = 2, jpjm1
                   DO ji = 1, fs_jpim1   ! vector opt.
@@ -140,9 +138,7 @@
          END SELECT
          !
-         !                             !==  Vertical fluxes  ==!
-         !
-         SELECT CASE( kn_cen_v )             !* interior fluxes
-         !
-         CASE(  2  )                               ! 2nd order centered
+         SELECT CASE( kn_cen_v )       !--  Vertical fluxes  --!   (interior)
+         !
+         CASE(  2  )                         !* 2nd order centered
             DO jk = 2, jpk
                DO jj = 2, jpjm1
@@ -153,6 +149,6 @@
             END DO
             !
-         CASE(  4  )                               ! 4th order centered
-            CALL interp_4th_cpt( ptn(:,:,:,jn) , ztw )         ! 4th order compact interpolation of T at w-point
+         CASE(  4  )                         !* 4th order compact
+            CALL interp_4th_cpt( ptn(:,:,:,jn) , ztw )      ! ztw = interpolated value of T at w-point
             DO jk = 2, jpkm1
                DO jj = 2, jpjm1
@@ -165,9 +161,9 @@
          END SELECT
          !
-         IF(.NOT.lk_vvl ) THEN               !* top value   (only in linear free surf. as zwz is multiplied by wmask)
+         IF( ln_linssh ) THEN                !* top value   (linear free surf. only as zwz is multiplied by wmask)
             IF( ln_isfcav ) THEN                  ! ice-shelf cavities (top of the ocean)
                DO jj = 1, jpj
                   DO ji = 1, jpi
-                     zwz(ji,jj, mikt(ji,jj) ) = pwn(ji,jj,mikt(ji,jj)) * ptn(ji,jj,mikt(ji,jj),jn)   ! linear free surface 
+                     zwz(ji,jj, mikt(ji,jj) ) = pwn(ji,jj,mikt(ji,jj)) * ptn(ji,jj,mikt(ji,jj),jn) 
                   END DO
                END DO   
@@ -183,9 +179,9 @@
                      &             - (  zwx(ji,jj,jk) - zwx(ji-1,jj  ,jk  )    &
                      &                + zwy(ji,jj,jk) - zwy(ji  ,jj-1,jk  )    &
-                     &                + zwz(ji,jj,jk) - zwz(ji  ,jj  ,jk+1)  ) / ( e1e2t(ji,jj) *  fse3t_n(ji,jj,jk) )
+                     &                + zwz(ji,jj,jk) - zwz(ji  ,jj  ,jk+1)  ) * r1_e1e2t(ji,jj) / e3t_n(ji,jj,jk)
                END DO
             END DO
          END DO
-         !                                 ! trend diagnostics
+         !                             ! trend diagnostics
          IF( ( cdtype == 'TRA' .AND. l_trdtra ) .OR. ( cdtype == 'TRC' .AND. l_trdtrc ) ) THEN
             CALL trd_tra( kt, cdtype, jn, jptra_xad, zwx, pun, ptn(:,:,:,jn) )
@@ -193,8 +189,8 @@
             CALL trd_tra( kt, cdtype, jn, jptra_zad, zwz, pwn, ptn(:,:,:,jn) )
          END IF
-         !                                 ! "Poleward" heat and salt transports (contribution of upstream fluxes)
+         !                             ! "Poleward" heat and salt transports (contribution of upstream fluxes)
          IF( cdtype == 'TRA' .AND. ln_diaptr ) THEN  
-           IF( jn == jp_tem )  htr_adv(:) = ptr_sj( zwy(:,:,:) )
-           IF( jn == jp_sal )  str_adv(:) = ptr_sj( zwy(:,:,:) )
+           IF( jn == jp_tem )   htr_adv(:) = ptr_sj( zwy(:,:,:) )
+           IF( jn == jp_sal )   str_adv(:) = ptr_sj( zwy(:,:,:) )
          ENDIF
          !
