Index: trunk/NEMO/TOP_SRC/trcdia.F90
===================================================================
--- trunk/NEMO/TOP_SRC/trcdia.F90	(revision 1445)
+++ trunk/NEMO/TOP_SRC/trcdia.F90	(revision 1450)
@@ -29,4 +29,5 @@
    USE lib_mpp
    USE ioipsl
+   USE iom
 
    IMPLICIT NONE
@@ -117,4 +118,6 @@
       ! --------------
 
+      CALL iom_setkt( kt + ndttrc - 1 )
+
       ! local variable for debugging
       ll_print = .FALSE.                  ! change it to true for more control print
@@ -207,8 +210,7 @@
 
       DO jn = 1, jptra
-         IF( lutsav(jn) ) THEN
-            cltra = ctrcnm(jn)      ! short title for tracer
-            CALL histwrite( nit5, cltra, it, trn(:,:,:,jn), ndimt50, ndext50 )
-         ENDIF
+         cltra = ctrcnm(jn)      ! short title for tracer
+         IF( lutsav(jn) ) CALL histwrite( nit5, cltra, it, trn(:,:,:,jn), ndimt50, ndext50 )
+         CALL iom_put( ctrcnm(jn), trn(:,:,:,jn) )
       END DO
 
@@ -217,4 +219,6 @@
       IF( kt == nitend .OR. kindic < 0 )   CALL histclo( nit5 )
       !
+      CALL iom_setkt( kt )
+
    END SUBROUTINE trcdit_wr
 
@@ -252,4 +256,6 @@
       ! 0. Initialisation
       ! -----------------
+      
+      CALL iom_setkt( kt + ndttrc - 1 )
 
       ! local variable for debugging
@@ -439,4 +445,5 @@
             END DO
          END IF
+         CALL iom_put( ctrcnm(jn), trn(:,:,:,jn) )
       END DO
 
@@ -449,4 +456,6 @@
       ENDIF
       !
+      CALL iom_setkt( kt )
+
    END SUBROUTINE trcdid_wr
 
@@ -484,5 +493,5 @@
       CHARACTER (len=20) ::   cltra, cltrau
       CHARACTER (len=80) ::   cltral
-      INTEGER  ::   jn
+      INTEGER  ::   jl
       INTEGER  ::   iimi, iima, ijmi, ijma, ipk, it, itmod
       REAL(wp) ::   zsto, zout, zdt
@@ -491,5 +500,7 @@
       ! Initialisation
       ! --------------
-
+   
+      CALL iom_setkt( kt + ndttrc - 1 )
+      
       ! local variable for debugging
       ll_print = .FALSE.
@@ -546,8 +557,8 @@
 
          ! more 3D horizontal arrays
-         DO jn = 1, jpdia3d
-            cltra  = ctrc3d(jn)   ! short title for 3D diagnostic
-            cltral = ctrc3l(jn)   ! long title for 3D diagnostic
-            cltrau = ctrc3u(jn)   ! UNIT for 3D diagnostic
+         DO jl = 1, jpdia3d
+            cltra  = ctrc3d(jl)   ! short title for 3D diagnostic
+            cltral = ctrc3l(jl)   ! long title for 3D diagnostic
+            cltrau = ctrc3u(jl)   ! UNIT for 3D diagnostic
             CALL histdef( nitd, cltra, cltral, cltrau, jpi, jpj, nhoritd,   &
                &          ipk, 1, ipk,  ndepitd, 32, clop, zsto, zout )
@@ -555,8 +566,8 @@
 
          ! more 2D horizontal arrays
-         DO jn = 1, jpdia2d
-            cltra  = ctrc2d(jn)    ! short title for 2D diagnostic
-            cltral = ctrc2l(jn)   ! long title for 2D diagnostic
-            cltrau = ctrc2u(jn)   ! UNIT for 2D diagnostic
+         DO jl = 1, jpdia2d
+            cltra  = ctrc2d(jl)    ! short title for 2D diagnostic
+            cltral = ctrc2l(jl)   ! long title for 2D diagnostic
+            cltrau = ctrc2u(jl)   ! UNIT for 2D diagnostic
             CALL histdef( nitd, cltra, cltral, cltrau, jpi, jpj, nhoritd,  &
                &          1, 1, 1,  -99, 32, clop, zsto, zout )
@@ -583,13 +594,15 @@
 
       ! more 3D horizontal arrays
-      DO jn = 1, jpdia3d
-         cltra = ctrc3d(jn)   ! short title for 3D diagnostic
-         CALL histwrite( nitd, cltra, it, trc3d(:,:,:,jn), ndimt50 ,ndext50)
+      DO jl = 1, jpdia3d
+         cltra = ctrc3d(jl)   ! short title for 3D diagnostic
+         CALL histwrite( nitd, cltra, it, trc3d(:,:,:,jl), ndimt50 ,ndext50)
+         CALL iom_put( cltra, trc3d(:,:,:,jl) )
       END DO
 
       ! more 2D horizontal arrays
-      DO jn = 1, jpdia2d
-         cltra = ctrc2d(jn)   ! short title for 2D diagnostic
-         CALL histwrite(nitd, cltra, it, trc2d(:,:,jn), ndimt51  ,ndext51)
+      DO jl = 1, jpdia2d
+         cltra = ctrc2d(jl)   ! short title for 2D diagnostic
+         CALL histwrite(nitd, cltra, it, trc2d(:,:,jl), ndimt51  ,ndext51)
+         CALL iom_put( cltra, trc2d(:,:,jl) )
       END DO
 
@@ -598,4 +611,6 @@
       IF( kt == nitend .OR. kindic < 0 )   CALL histclo(nitd)
       !
+      CALL iom_setkt( kt )
+
    END SUBROUTINE trcdii_wr
 
@@ -634,5 +649,5 @@
       CHARACTER (len=20) ::   cltra, cltrau
       CHARACTER (len=80) ::   cltral
-      INTEGER  ::   ji, jj, jk, jn
+      INTEGER  ::   ji, jj, jk, jl
       INTEGER  ::   iimi, iima, ijmi, ijma, ipk, it, itmod
       REAL(wp) ::   zsto, zout, zdt
@@ -642,4 +657,6 @@
       ! --------------
 
+      CALL iom_setkt( kt + ndttrc - 1 )
+      
       ! local variable for debugging
       ll_print = .FALSE.
@@ -689,8 +706,8 @@
          ! Declare all the output fields as NETCDF variables
          ! biological trends
-         DO jn = 1, jpdiabio
-            cltra  = ctrbio(jn)   ! short title for biological diagnostic
-            cltral = ctrbil(jn)   ! long title for biological diagnostic
-            cltrau = ctrbiu(jn)   ! UNIT for biological diagnostic
+         DO jl = 1, jpdiabio
+            cltra  = ctrbio(jl)   ! short title for biological diagnostic
+            cltral = ctrbil(jl)   ! long title for biological diagnostic
+            cltrau = ctrbiu(jl)   ! UNIT for biological diagnostic
             CALL histdef( nitb, cltra, cltral, cltrau, jpi, jpj, nhoritb,  &
                &         ipk, 1, ipk,  ndepitb, 32, clop, zsto, zout)
@@ -715,7 +732,8 @@
       ENDIF
 
-      DO jn = 1, jpdiabio
-         cltra = ctrbio(jn)  ! short title for biological diagnostic
-         CALL histwrite(nitb, cltra, it, trbio(:,:,:,jn), ndimt50,ndext50)
+      DO jl = 1, jpdiabio
+         cltra = ctrbio(jl)  ! short title for biological diagnostic
+         CALL histwrite(nitb, cltra, it, trbio(:,:,:,jl), ndimt50,ndext50)
+         CALL iom_put( cltra, trbio(:,:,:,jl) )
       END DO
 
@@ -724,4 +742,6 @@
       IF( kt == nitend .OR. kindic < 0 )   CALL histclo( nitb )
       !
+      CALL iom_setkt( kt )
+
    END SUBROUTINE trcdib_wr
 
