Index: branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso_grif.F90
===================================================================
--- branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso_grif.F90	(revision 5038)
+++ branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso_grif.F90	(revision 5620)
@@ -113,7 +113,4 @@
       REAL(wp) ::   ze1ur, zdxt, ze2vr, ze3wr, zdyt, zdzt
       REAL(wp) ::   zah, zah_slp, zaei_slp
-#if defined key_diaar5
-      REAL(wp) ::   zztmp              ! local scalar
-#endif
       REAL(wp), POINTER, DIMENSION(:,:  ) :: z2d
       REAL(wp), POINTER, DIMENSION(:,:,:) :: zdit, zdjt, ztfw 
@@ -207,32 +204,34 @@
       END DO
       !
-#if defined key_iomput
-      IF( ln_traldf_gdia .AND. cdtype == 'TRA' ) THEN
-         CALL wrk_alloc( jpi , jpj , jpk  , zw3d )
-         DO jk=1,jpkm1
-            zw3d(:,:,jk) = (psix_eiv(:,:,jk+1) - psix_eiv(:,:,jk))/fse3u(:,:,jk)  ! u_eiv = -dpsix/dz
-         END DO
-         zw3d(:,:,jpk) = 0._wp
-         CALL iom_put( "uoce_eiv", zw3d )    ! i-eiv current
-
-         DO jk=1,jpk-1
-            zw3d(:,:,jk) = (psiy_eiv(:,:,jk+1) - psiy_eiv(:,:,jk))/fse3v(:,:,jk)  ! v_eiv = -dpsiy/dz
-         END DO
-         zw3d(:,:,jpk) = 0._wp
-         CALL iom_put( "voce_eiv", zw3d )    ! j-eiv current
-
-         DO jk=1,jpk-1
-            DO jj = 2, jpjm1
-               DO ji = fs_2, fs_jpim1  ! vector opt.
-                  zw3d(ji,jj,jk) = (psiy_eiv(ji,jj,jk) - psiy_eiv(ji,jj-1,jk))/e2t(ji,jj) + &
-                       &    (psix_eiv(ji,jj,jk) - psix_eiv(ji-1,jj,jk))/e1t(ji,jj) ! w_eiv = dpsiy/dy + dpsiy/dx
-               END DO
-            END DO
-         END DO
-         zw3d(:,:,jpk) = 0._wp
-         CALL iom_put( "woce_eiv", zw3d )    ! vert. eiv current
-         CALL wrk_dealloc( jpi , jpj , jpk  , zw3d )
+      IF( iom_use("uoce_eiv") .OR. iom_use("voce_eiv") .OR. iom_use("woce_eiv") )  THEN
+         !
+         IF( ln_traldf_gdia .AND. cdtype == 'TRA' ) THEN
+            CALL wrk_alloc( jpi , jpj , jpk  , zw3d )
+            DO jk=1,jpkm1
+               zw3d(:,:,jk) = (psix_eiv(:,:,jk+1) - psix_eiv(:,:,jk))/fse3u(:,:,jk)  ! u_eiv = -dpsix/dz
+            END DO
+            zw3d(:,:,jpk) = 0._wp
+            CALL iom_put( "uoce_eiv", zw3d )    ! i-eiv current
+
+            DO jk=1,jpk-1
+               zw3d(:,:,jk) = (psiy_eiv(:,:,jk+1) - psiy_eiv(:,:,jk))/fse3v(:,:,jk)  ! v_eiv = -dpsiy/dz
+            END DO
+            zw3d(:,:,jpk) = 0._wp
+            CALL iom_put( "voce_eiv", zw3d )    ! j-eiv current
+
+            DO jk=1,jpk-1
+               DO jj = 2, jpjm1
+                  DO ji = fs_2, fs_jpim1  ! vector opt.
+                     zw3d(ji,jj,jk) = (psiy_eiv(ji,jj,jk) - psiy_eiv(ji,jj-1,jk))/e2t(ji,jj) + &
+                          &    (psix_eiv(ji,jj,jk) - psix_eiv(ji-1,jj,jk))/e1t(ji,jj) ! w_eiv = dpsiy/dy + dpsiy/dx
+                  END DO
+               END DO
+            END DO
+            zw3d(:,:,jpk) = 0._wp
+            CALL iom_put( "woce_eiv", zw3d )    ! vert. eiv current
+            CALL wrk_dealloc( jpi , jpj , jpk  , zw3d )
+         ENDIF
+         !
       ENDIF
-#endif
       !                                                          ! ===========
       DO jn = 1, kjpt                                            ! tracer loop
@@ -387,36 +386,38 @@
          !
          !                             ! "Poleward" diffusive heat or salt transports (T-S case only)
-         IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( MOD( kt, nn_fptr ) == 0 ) ) THEN
-            IF( jn == jp_tem)   htr_ldf(:) = ptr_vj( zftv(:,:,:) )        ! 3.3  names
-            IF( jn == jp_sal)   str_ldf(:) = ptr_vj( zftv(:,:,:) )
+         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 defined key_diaar5
-         IF( cdtype == 'TRA' .AND. jn == jp_tem  ) THEN
-            z2d(:,:) = 0._wp
-            zztmp = rau0 * rcp
-            DO jk = 1, jpkm1
-               DO jj = 2, jpjm1
-                  DO ji = fs_2, fs_jpim1   ! vector opt.
-                     z2d(ji,jj) = z2d(ji,jj) + zftu(ji,jj,jk)
-                  END DO
-               END DO
-            END DO
-            z2d(:,:) = zztmp * z2d(:,:)
-            CALL lbc_lnk( z2d, 'U', -1. )
-            CALL iom_put( "udiff_heattr", z2d )                  ! heat transport in i-direction
-            z2d(:,:) = 0._wp
-            DO jk = 1, jpkm1
-               DO jj = 2, jpjm1
-                  DO ji = fs_2, fs_jpim1   ! vector opt.
-                     z2d(ji,jj) = z2d(ji,jj) + zftv(ji,jj,jk)
-                  END DO
-               END DO
-            END DO
-            z2d(:,:) = zztmp * z2d(:,:)
-            CALL lbc_lnk( z2d, 'V', -1. )
-            CALL iom_put( "vdiff_heattr", z2d )                  !  heat transport in j-direction
-         END IF
-#endif
+         IF( iom_use("udiff_heattr") .OR. iom_use("vdiff_heattr") ) THEN
+           !
+           IF( cdtype == 'TRA' .AND. jn == jp_tem  ) THEN
+               z2d(:,:) = 0._wp 
+               DO jk = 1, jpkm1
+                  DO jj = 2, jpjm1
+                     DO ji = fs_2, fs_jpim1   ! vector opt.
+                        z2d(ji,jj) = z2d(ji,jj) + zftu(ji,jj,jk) 
+                     END DO
+                  END DO
+               END DO
+               z2d(:,:) = rau0_rcp * z2d(:,:) 
+               CALL lbc_lnk( z2d, 'U', -1. )
+               CALL iom_put( "udiff_heattr", z2d )                  ! heat transport in i-direction
+               !
+               z2d(:,:) = 0._wp 
+               DO jk = 1, jpkm1
+                  DO jj = 2, jpjm1
+                     DO ji = fs_2, fs_jpim1   ! vector opt.
+                        z2d(ji,jj) = z2d(ji,jj) + zftv(ji,jj,jk) 
+                     END DO
+                  END DO
+               END DO
+               z2d(:,:) = rau0_rcp * z2d(:,:)     
+               CALL lbc_lnk( z2d, 'V', -1. )
+               CALL iom_put( "vdiff_heattr", z2d )                  !  heat transport in i-direction
+            END IF
+            !
+         ENDIF
          !
       END DO
