Index: branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen2.F90
===================================================================
--- branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen2.F90	(revision 6440)
+++ branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen2.F90	(revision 6442)
@@ -279,8 +279,5 @@
          END IF
          !                                 ! "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(:,:,:) )
-         ENDIF
+         IF( cdtype == 'TRA' .AND. ln_diaptr ) CALL dia_ptr_ohst_components( jn, 'adv', zwy(:,:,:) )
          !
       END DO
Index: branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl.F90
===================================================================
--- branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl.F90	(revision 6440)
+++ branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl.F90	(revision 6442)
@@ -219,8 +219,5 @@
          END IF
          !                                 ! "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(:,:,:) )
-         ENDIF
+         IF( cdtype == 'TRA' .AND. ln_diaptr )  CALL dia_ptr_ohst_components( jn, 'adv', zwy(:,:,:)  )
 
          ! II. Vertical advective fluxes
Index: branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl2.F90
===================================================================
--- branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl2.F90	(revision 6440)
+++ branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl2.F90	(revision 6442)
@@ -200,8 +200,5 @@
 
          !                                 ! "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(:,:,:) )
-         ENDIF
+         IF( cdtype == 'TRA' .AND. ln_diaptr ) CALL dia_ptr_ohst_components( jn, 'adv', zwy(:,:,:)  )
 
          ! II. Vertical advective fluxes
Index: branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_qck.F90
===================================================================
--- branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_qck.F90	(revision 6440)
+++ branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_qck.F90	(revision 6442)
@@ -355,8 +355,5 @@
          IF( l_trd )   CALL trd_tra( kt, cdtype, jn, jptra_yad, zwy, pvn, ptn(:,:,:,jn) )
          !                                 ! "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(:,:,:) )
-         ENDIF
+         IF( cdtype == 'TRA' .AND. ln_diaptr )  CALL dia_ptr_ohst_components( jn, 'adv', zwy(:,:,:) )
          !
       END DO
Index: branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_tvd.F90
===================================================================
--- branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_tvd.F90	(revision 6440)
+++ branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_tvd.F90	(revision 6442)
@@ -86,4 +86,5 @@
       REAL(wp), POINTER, DIMENSION(:,:,:) :: zwi, zwz
       REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrdx, ztrdy, ztrdz
+      REAL(wp), POINTER, DIMENSION(:,:,:) :: zptry
       !!----------------------------------------------------------------------
       !
@@ -104,4 +105,9 @@
          CALL wrk_alloc( jpi, jpj, jpk, ztrdx, ztrdy, ztrdz )
          ztrdx(:,:,:) = 0.e0   ;    ztrdy(:,:,:) = 0.e0   ;   ztrdz(:,:,:) = 0.e0
+      ENDIF
+      !
+      IF( cdtype == 'TRA' .AND. ln_diaptr ) THEN  
+         CALL wrk_alloc( jpi, jpj, jpk, zptry )
+         zptry(:,:,:) = 0._wp
       ENDIF
       !
@@ -193,8 +199,5 @@
          END IF
          !                                 ! "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(:,:,:) )
-         ENDIF
+         IF( cdtype == 'TRA' .AND. ln_diaptr )    zptry(:,:,:) = zwy(:,:,:) 
 
          ! 3. antidiffusive flux : high order minus low order
@@ -265,6 +268,6 @@
          !                                 ! "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(:,:,:) ) + htr_adv(:)
-           IF( jn == jp_sal )  str_adv(:) = ptr_sj( zwy(:,:,:) ) + str_adv(:)
+            zptry(:,:,:) = zptry(:,:,:) + zwy(:,:,:)  ! <<< Add to previously computed
+            CALL dia_ptr_ohst_components( jn, 'adv', zptry(:,:,:) )
          ENDIF
          !
@@ -273,4 +276,5 @@
                    CALL wrk_dealloc( jpi, jpj, jpk, zwi, zwz )
       IF( l_trd )  CALL wrk_dealloc( jpi, jpj, jpk, ztrdx, ztrdy, ztrdz )
+      IF( cdtype == 'TRA' .AND. ln_diaptr ) CALL wrk_dealloc( jpi, jpj, jpk, zptry )
       !
       IF( nn_timing == 1 )  CALL timing_stop('tra_adv_tvd')
@@ -319,4 +323,5 @@
       REAL(wp), POINTER, DIMENSION(:,:,:) :: zwi, zwz, zhdiv, zwz_sav, zwzts
       REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrdx, ztrdy, ztrdz
+      REAL(wp), POINTER, DIMENSION(:,:,:) :: zptry
       REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ztrs
       !!----------------------------------------------------------------------
@@ -340,4 +345,9 @@
          CALL wrk_alloc( jpi, jpj, jpk, ztrdx, ztrdy, ztrdz )
          ztrdx(:,:,:) = 0._wp  ;    ztrdy(:,:,:) = 0._wp  ;   ztrdz(:,:,:) = 0._wp
+      ENDIF
+      !
+      IF( cdtype == 'TRA' .AND. ln_diaptr ) THEN  
+         CALL wrk_alloc( jpi, jpj,jpk, zptry )
+         zptry(:,:,:) = 0._wp
       ENDIF
       !
@@ -430,8 +440,5 @@
          END IF
          !                                 ! "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(:,:,:) )
-         ENDIF
+         IF( cdtype == 'TRA' .AND. ln_diaptr )  zptry(:,:,:) = zwy(:,:,:)
 
          ! 3. antidiffusive flux : high order minus low order
@@ -557,6 +564,6 @@
          !                                 ! "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(:,:,:) ) + htr_adv(:)
-           IF( jn == jp_sal )  str_adv(:) = ptr_sj( zwy(:,:,:) ) + str_adv(:)
+            zptry(:,:,:) = zptry(:,:,:) + zwy(:,:,:) 
+            CALL dia_ptr_ohst_components( jn, 'adv', zptry(:,:,:) )
          ENDIF
          !
@@ -567,4 +574,5 @@
                    CALL wrk_dealloc( jpi, jpj, zwx_sav, zwy_sav )
       IF( l_trd )  CALL wrk_dealloc( jpi, jpj, jpk, ztrdx, ztrdy, ztrdz )
+      IF( cdtype == 'TRA' .AND. ln_diaptr ) CALL wrk_dealloc( jpi, jpj, jpk, zptry )
       !
       IF( nn_timing == 1 )  CALL timing_stop('tra_adv_tvd_zts')
Index: branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_ubs.F90
===================================================================
--- branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_ubs.F90	(revision 6440)
+++ branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_ubs.F90	(revision 6442)
@@ -177,8 +177,5 @@
          END IF
          !                                 ! "Poleward" heat and salt transports (contribution of upstream fluxes)
-         IF( cdtype == 'TRA' .AND. ln_diaptr ) THEN  
-            IF( jn == jp_tem )  htr_adv(:) = ptr_sj( ztv(:,:,:) )
-            IF( jn == jp_sal )  str_adv(:) = ptr_sj( ztv(:,:,:) )
-         ENDIF
+         IF( cdtype == 'TRA' .AND. ln_diaptr ) CALL dia_ptr_ohst_components( jn, 'adv', ztv(:,:,:) )
          
          ! TVD scheme for the vertical direction  
Index: branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_bilap.F90
===================================================================
--- branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_bilap.F90	(revision 6440)
+++ branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_bilap.F90	(revision 6442)
@@ -173,8 +173,5 @@
          !                                                
          ! "zonal" mean lateral diffusive heat and salt transport
-         IF( cdtype == 'TRA' .AND. ln_diaptr ) THEN  
-           IF( jn == jp_tem )  htr_ldf(:) = ptr_sj( ztv(:,:,:) )
-           IF( jn == jp_sal )  str_ldf(:) = ptr_sj( ztv(:,:,:) )
-         ENDIF
+         IF( cdtype == 'TRA' .AND. ln_diaptr )   CALL dia_ptr_ohst_components( jn, 'ldf', ztv(:,:,:) )
          !                                                ! ===========
       END DO                                              ! tracer loop
Index: branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_bilapg.F90
===================================================================
--- branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_bilapg.F90	(revision 6440)
+++ branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_bilapg.F90	(revision 6442)
@@ -247,9 +247,6 @@
          !                                                ! ===============
          ! "Poleward" diffusive heat or salt transport
-         IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( kaht == 2 ) ) THEN
-            ! note sign is reversed to give down-gradient diffusive transports (#1043)
-            IF( jn == jp_tem)   htr_ldf(:) = ptr_sj( -zftv(:,:,:) )
-            IF( jn == jp_sal)   str_ldf(:) = ptr_sj( -zftv(:,:,:) )
-         ENDIF
+        ! note sign is reversed to give down-gradient diffusive transports (#1043)
+         IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( kaht == 2 ) ) CALL dia_ptr_ohst_components( jn, 'ldf', -zftv(:,:,:) )
 
          !                             ! ************ !   ! ===============
Index: branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso.F90
===================================================================
--- branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso.F90	(revision 6440)
+++ branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso.F90	(revision 6442)
@@ -235,9 +235,6 @@
          !
          ! "Poleward" diffusive heat or salt transports (T-S case only)
-         IF( cdtype == 'TRA' .AND. ln_diaptr ) THEN
             ! note sign is reversed to give down-gradient diffusive transports (#1043)
-            IF( jn == jp_tem)   htr_ldf(:) = ptr_sj( -zftv(:,:,:) )
-            IF( jn == jp_sal)   str_ldf(:) = ptr_sj( -zftv(:,:,:) )
-         ENDIF
+         IF( cdtype == 'TRA' .AND. ln_diaptr ) CALL dia_ptr_ohst_components( jn, 'ldf', -zftv(:,:,:)  )
  
          IF( iom_use("udiff_heattr") .OR. iom_use("vdiff_heattr") ) THEN
Index: branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso_grif.F90
===================================================================
--- branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso_grif.F90	(revision 6440)
+++ branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso_grif.F90	(revision 6442)
@@ -386,8 +386,5 @@
          !
          !                             ! "Poleward" diffusive heat or salt transports (T-S case only)
-         IF( cdtype == 'TRA' .AND. ln_diaptr ) THEN
-            IF( jn == jp_tem)   htr_ldf(:) = ptr_sj( zftv(:,:,:) )        ! 3.3  names
-            IF( jn == jp_sal)   str_ldf(:) = ptr_sj( zftv(:,:,:) )
-         ENDIF
+         IF( cdtype == 'TRA' .AND. ln_diaptr )  CALL dia_ptr_ohst_components( jn, 'ldf', zftv(:,:,:) )
 
          IF( iom_use("udiff_heattr") .OR. iom_use("vdiff_heattr") ) THEN
Index: branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_lap.F90
===================================================================
--- branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_lap.F90	(revision 6440)
+++ branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_lap.F90	(revision 6442)
@@ -154,8 +154,5 @@
          !
          ! "Poleward" diffusive heat or salt transports
-         IF( cdtype == 'TRA' .AND. ln_diaptr ) THEN
-            IF( jn  == jp_tem)   htr_ldf(:) = ptr_sj( ztv(:,:,:) )
-            IF( jn  == jp_sal)   str_ldf(:) = ptr_sj( ztv(:,:,:) )
-         ENDIF
+         IF( cdtype == 'TRA' .AND. ln_diaptr )    CALL dia_ptr_ohst_components( jn, 'ldf', ztv(:,:,:) )
          !                                                  ! ==================
       END DO                                                ! end of tracer loop
