Index: /branches/2011/dev_LOCEAN_2011/NEMOGCM/NEMO/TOP_SRC/C14b/trcsms_c14b.F90
===================================================================
--- /branches/2011/dev_LOCEAN_2011/NEMOGCM/NEMO/TOP_SRC/C14b/trcsms_c14b.F90	(revision 3027)
+++ /branches/2011/dev_LOCEAN_2011/NEMOGCM/NEMO/TOP_SRC/C14b/trcsms_c14b.F90	(revision 3028)
@@ -96,5 +96,5 @@
       USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
       USE wrk_nemo, ONLY:   zatmbc14 => wrk_2d_1
-      USE wrk_nemo, ONLY:   zw3d     => wrk_3d_1
+      USE wrk_nemo, ONLY:   zdecay   => wrk_3d_1
       !
       INTEGER, INTENT(in) ::   kt    ! ocean time-step index
@@ -251,10 +251,4 @@
             ! cumulation of surface flux at each time step
             qint_c14(ji,jj) = qint_c14(ji,jj) + qtr_c14(ji,jj) * rdt
-
-            !                                        ! Save 2D diagnostics
-            IF( .NOT.lk_iomput .AND. ln_diatrc ) THEN
-               trc2d(ji,jj,jp_c14b0_2d    ) = qtr_c14 (ji,jj)
-               trc2d(ji,jj,jp_c14b0_2d + 1) = qint_c14(ji,jj)
-            ENDIF 
             !
          END DO
@@ -266,15 +260,9 @@
             DO ji = 1, jpi
 #if defined key_degrad
-               ztra = trn(ji,jj,jk,jpc14) * ( 1. - EXP( -xlambda * rdt * facvol(ji,jj,jk) ) )
+               zdecay(ji,jj,jk) = trn(ji,jj,jk,jpc14) * ( 1. - EXP( -xlambda * rdt * facvol(ji,jj,jk) ) )
 #else
-               ztra = trn(ji,jj,jk,jpc14) * xaccum
+               zdecay(ji,jj,jk) = trn(ji,jj,jk,jpc14) * xaccum
 #endif
-               tra(ji,jj,jk,jpc14) = tra(ji,jj,jk,jpc14) - ztra / rdt
-               !                                     ! save 3D diag : radioactive decay
-               IF( ln_diatrc ) THEN
-                  IF( lk_iomput ) THEN   ;   zw3d(ji,jj,jk)               = ztra
-                  ELSE                   ;   trc3d(ji,jj,jk,jp_c14b0_3d ) = ztra
-                  ENDIF
-               ENDIF
+               tra(ji,jj,jk,jpc14) = tra(ji,jj,jk,jpc14) - zdecay(ji,jj,jk) / rdt
                !
             END DO
@@ -282,8 +270,14 @@
       END DO
 
-      IF( lk_iomput ) THEN
-         CALL iom_put( "qtrC14b"  , qtr_c14  )
-         CALL iom_put( "qintC14b" , qint_c14 )
-         CALL iom_put( "fdecay"   , zw3d     )
+      IF( ln_diatrc ) THEN
+         IF( lk_iomput ) THEN
+            CALL iom_put( "qtrC14b"  , qtr_c14  )
+            CALL iom_put( "qintC14b" , qint_c14 )
+            CALL iom_put( "fdecay"   , zdecay   )
+          ELSE
+            trc2d(:,:  ,jp_c14b0_2d     ) = qtr_c14 (:,:)
+            trc2d(:,:  ,jp_c14b0_2d + 1 ) = qint_c14(:,:)
+            trc3d(:,:,:,jp_c14b0_3d     ) = zdecay  (:,:,:)
+          ENDIF
       ENDIF
 
Index: /branches/2011/dev_LOCEAN_2011/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcbio.F90
===================================================================
--- /branches/2011/dev_LOCEAN_2011/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcbio.F90	(revision 3027)
+++ /branches/2011/dev_LOCEAN_2011/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcbio.F90	(revision 3028)
@@ -80,5 +80,5 @@
       !!---------------------------------------------------------------------
 
-      IF( ln_diatrc .AND. lk_iomput ) THEN
+      IF( ln_diatrc ) THEN
          IF( ( wrk_in_use(3, 2) ) .OR. ( wrk_in_use(4, 1) ) ) THEN
             CALL ctl_stop('trc_bio : requested workspace arrays unavailable.')  ;  RETURN
@@ -97,13 +97,6 @@
       fbod(:,:) = 0.e0
       IF( ln_diatrc ) THEN
-         !
-         IF( lk_iomput ) THEN
-            zw2d  (:,:,:) = 0.e0
-            zw3d(:,:,:,:) = 0.e0
-         ELSE
-            trc2d(:,:,  jp_lob0_2d:jp_lob1_2d) = 0.e0
-            trc3d(:,:,:,jp_lob0_3d:jp_lob1_3d) = 0.e0
-         ENDIF
-         !
+         zw2d  (:,:,:) = 0.e0
+         zw3d(:,:,:,:) = 0.e0
       ENDIF
 
@@ -223,53 +216,25 @@
                   ! convert fluxes in per day
                   ze3t = fse3t(ji,jj,jk) * 86400.
-                  IF( lk_iomput ) THEN
-                     zw2d(ji,jj,1)  = zw2d(ji,jj,1)  + zno3phy * ze3t
-                     zw2d(ji,jj,2)  = zw2d(ji,jj,2)  + znh4phy * ze3t
-                     zw2d(ji,jj,3)  = zw2d(ji,jj,3)  + zphydom * ze3t
-                     zw2d(ji,jj,4)  = zw2d(ji,jj,4)  + zphynh4 * ze3t
-                     zw2d(ji,jj,5)  = zw2d(ji,jj,5)  + zphyzoo * ze3t
-                     zw2d(ji,jj,6)  = zw2d(ji,jj,6)  + zphydet * ze3t
-                     zw2d(ji,jj,7)  = zw2d(ji,jj,7)  + zdetzoo * ze3t
-                     zw2d(ji,jj,8)  = zw2d(ji,jj,8)  + zzoodet * ze3t
-                     zw2d(ji,jj,9)  = zw2d(ji,jj,9)  + zzoobod * ze3t
-                     zw2d(ji,jj,10) = zw2d(ji,jj,10) + zzoonh4 * ze3t
-                     zw2d(ji,jj,11) = zw2d(ji,jj,11) + zzoodom * ze3t
-                     zw2d(ji,jj,12) = zw2d(ji,jj,12) + znh4no3 * ze3t
-                     zw2d(ji,jj,13) = zw2d(ji,jj,13) + zdomnh4 * ze3t
-                     zw2d(ji,jj,14) = zw2d(ji,jj,14) + zdetnh4 * ze3t
-                     zw2d(ji,jj,15) = zw2d(ji,jj,15) + ( zno3phy + znh4phy - zphynh4 - zphydom - zphyzoo - zphydet ) * ze3t
-                     zw2d(ji,jj,16) = zw2d(ji,jj,16) + ( zphyzoo + zdetzoo - zzoodet - zzoobod - zzoonh4 - zzoodom ) * ze3t
-                     zw2d(ji,jj,17) = zw2d(ji,jj,17) + zdetdom * ze3t
-                     !   
-                     zw3d(ji,jj,jk,1) = zno3phy * 86400
-                     zw3d(ji,jj,jk,2) = znh4phy * 86400     
-                     zw3d(ji,jj,jk,3) = znh4no3 * 86400   
-                  ELSE   
-                     trc2d(ji,jj,jp_lob0_2d    ) = trc2d(ji,jj, jp_lob0_2d    ) + zno3phy * ze3t
-                     trc2d(ji,jj,jp_lob0_2d + 1) = trc2d(ji,jj, jp_lob0_2d + 1) + znh4phy * ze3t
-                     trc2d(ji,jj,jp_lob0_2d + 2) = trc2d(ji,jj, jp_lob0_2d + 2) + zphydom * ze3t
-                     trc2d(ji,jj,jp_lob0_2d + 3) = trc2d(ji,jj, jp_lob0_2d + 3) + zphynh4 * ze3t
-                     trc2d(ji,jj,jp_lob0_2d + 4) = trc2d(ji,jj, jp_lob0_2d + 4) + zphyzoo * ze3t
-                     trc2d(ji,jj,jp_lob0_2d + 5) = trc2d(ji,jj, jp_lob0_2d + 5) + zphydet * ze3t
-                     trc2d(ji,jj,jp_lob0_2d + 6) = trc2d(ji,jj, jp_lob0_2d + 6) + zdetzoo * ze3t
-                     ! trend number 8 is in trcsed.F            
-                     trc2d(ji,jj,jp_lob0_2d +  8) = trc2d(ji,jj,jp_lob0_2d +  8) + zzoodet * ze3t
-                     trc2d(ji,jj,jp_lob0_2d +  9) = trc2d(ji,jj,jp_lob0_2d +  9) + zzoobod * ze3t
-                     trc2d(ji,jj,jp_lob0_2d + 10) = trc2d(ji,jj,jp_lob0_2d + 10) + zzoonh4 * ze3t
-                     trc2d(ji,jj,jp_lob0_2d + 11) = trc2d(ji,jj,jp_lob0_2d + 11) + zzoodom * ze3t
-                     trc2d(ji,jj,jp_lob0_2d + 12) = trc2d(ji,jj,jp_lob0_2d + 12) + znh4no3 * ze3t
-                     trc2d(ji,jj,jp_lob0_2d + 13) = trc2d(ji,jj,jp_lob0_2d + 13) + zdomnh4 * ze3t
-                     trc2d(ji,jj,jp_lob0_2d + 14) = trc2d(ji,jj,jp_lob0_2d + 14) + zdetnh4 * ze3t
-                     trc2d(ji,jj,jp_lob0_2d + 15) = trc2d(ji,jj,jp_lob0_2d + 15) + (  zno3phy + znh4phy - zphynh4   &
-                        &                                 - zphydom - zphyzoo - zphydet ) * ze3t
-                     trc2d(ji,jj,jp_lob0_2d + 16) = trc2d(ji,jj,jp_lob0_2d + 16) + (  zphyzoo + zdetzoo - zzoodet   &
-                        &                                 - zzoobod - zzoonh4 - zzoodom ) * ze3t
-                     trc2d(ji,jj,jp_lob0_2d + 17) = trc2d(ji,jj,jp_lob0_2d + 17) + zdetdom * ze3t
-                     ! trend number 19 is in trcexp.F
-                     trc3d(ji,jj,jk,jp_lob0_3d    ) = zno3phy * 86400
-                     trc3d(ji,jj,jk,jp_lob0_3d + 1) = znh4phy * 86400
-                     trc3d(ji,jj,jk,jp_lob0_3d + 2) = znh4no3 * 86400
-                     !
-                  ENDIF
+                  zw2d(ji,jj,1)  = zw2d(ji,jj,1)  + zno3phy * ze3t
+                  zw2d(ji,jj,2)  = zw2d(ji,jj,2)  + znh4phy * ze3t
+                  zw2d(ji,jj,3)  = zw2d(ji,jj,3)  + zphydom * ze3t
+                  zw2d(ji,jj,4)  = zw2d(ji,jj,4)  + zphynh4 * ze3t
+                  zw2d(ji,jj,5)  = zw2d(ji,jj,5)  + zphyzoo * ze3t
+                  zw2d(ji,jj,6)  = zw2d(ji,jj,6)  + zphydet * ze3t
+                  zw2d(ji,jj,7)  = zw2d(ji,jj,7)  + zdetzoo * ze3t
+                  zw2d(ji,jj,8)  = zw2d(ji,jj,8)  + zzoodet * ze3t
+                  zw2d(ji,jj,9)  = zw2d(ji,jj,9)  + zzoobod * ze3t
+                  zw2d(ji,jj,10) = zw2d(ji,jj,10) + zzoonh4 * ze3t
+                  zw2d(ji,jj,11) = zw2d(ji,jj,11) + zzoodom * ze3t
+                  zw2d(ji,jj,12) = zw2d(ji,jj,12) + znh4no3 * ze3t
+                  zw2d(ji,jj,13) = zw2d(ji,jj,13) + zdomnh4 * ze3t
+                  zw2d(ji,jj,14) = zw2d(ji,jj,14) + zdetnh4 * ze3t
+                  zw2d(ji,jj,15) = zw2d(ji,jj,15) + ( zno3phy + znh4phy - zphynh4 - zphydom - zphyzoo - zphydet ) * ze3t
+                  zw2d(ji,jj,16) = zw2d(ji,jj,16) + ( zphyzoo + zdetzoo - zzoodet - zzoobod - zzoonh4 - zzoodom ) * ze3t
+                  zw2d(ji,jj,17) = zw2d(ji,jj,17) + zdetdom * ze3t
+                  !   
+                  zw3d(ji,jj,jk,1) = zno3phy * 86400
+                  zw3d(ji,jj,jk,2) = znh4phy * 86400     
+                  zw3d(ji,jj,jk,3) = znh4no3 * 86400   
                    ! 
                 ENDIF
@@ -372,53 +337,25 @@
                   ! convert fluxes in per day
                   ze3t = fse3t(ji,jj,jk) * 86400.
-                  IF( lk_iomput ) THEN
-                     zw2d(ji,jj,1)  = zw2d(ji,jj,1)  + zno3phy * ze3t
-                     zw2d(ji,jj,2)  = zw2d(ji,jj,2)  + znh4phy * ze3t
-                     zw2d(ji,jj,3)  = zw2d(ji,jj,3)  + zphydom * ze3t
-                     zw2d(ji,jj,4)  = zw2d(ji,jj,4)  + zphynh4 * ze3t
-                     zw2d(ji,jj,5)  = zw2d(ji,jj,5)  + zphyzoo * ze3t
-                     zw2d(ji,jj,6)  = zw2d(ji,jj,6)  + zphydet * ze3t
-                     zw2d(ji,jj,7)  = zw2d(ji,jj,7)  + zdetzoo * ze3t
-                     zw2d(ji,jj,8)  = zw2d(ji,jj,8)  + zzoodet * ze3t
-                     zw2d(ji,jj,9)  = zw2d(ji,jj,9)  + zzoobod * ze3t
-                     zw2d(ji,jj,10) = zw2d(ji,jj,10) + zzoonh4 * ze3t
-                     zw2d(ji,jj,11) = zw2d(ji,jj,11) + zzoodom * ze3t
-                     zw2d(ji,jj,12) = zw2d(ji,jj,12) + znh4no3 * ze3t
-                     zw2d(ji,jj,13) = zw2d(ji,jj,13) + zdomnh4 * ze3t
-                     zw2d(ji,jj,14) = zw2d(ji,jj,14) + zdetnh4 * ze3t
-                     zw2d(ji,jj,15) = zw2d(ji,jj,15) + ( zno3phy + znh4phy - zphynh4 - zphydom - zphyzoo - zphydet ) * ze3t
-                     zw2d(ji,jj,16) = zw2d(ji,jj,16) + ( zphyzoo + zdetzoo - zzoodet - zzoobod - zzoonh4 - zzoodom ) * ze3t
-                     zw2d(ji,jj,17) = zw2d(ji,jj,17) + zdetdom * ze3t
-                     !   
-                     zw3d(ji,jj,jk,1) = zno3phy * 86400
-                     zw3d(ji,jj,jk,2) = znh4phy * 86400
-                     zw3d(ji,jj,jk,3) = znh4no3 * 86400
-                  ELSE    
-                     trc2d(ji,jj,jp_lob0_2d    ) = trc2d(ji,jj, jp_lob0_2d    ) + zno3phy * ze3t
-                     trc2d(ji,jj,jp_lob0_2d + 1) = trc2d(ji,jj, jp_lob0_2d + 1) + znh4phy * ze3t
-                     trc2d(ji,jj,jp_lob0_2d + 2) = trc2d(ji,jj, jp_lob0_2d + 2) + zphydom * ze3t
-                     trc2d(ji,jj,jp_lob0_2d + 3) = trc2d(ji,jj, jp_lob0_2d + 3) + zphynh4 * ze3t
-                     trc2d(ji,jj,jp_lob0_2d + 4) = trc2d(ji,jj, jp_lob0_2d + 4) + zphyzoo * ze3t
-                     trc2d(ji,jj,jp_lob0_2d + 5) = trc2d(ji,jj, jp_lob0_2d + 5) + zphydet * ze3t
-                     trc2d(ji,jj,jp_lob0_2d + 6) = trc2d(ji,jj, jp_lob0_2d + 6) + zdetzoo * ze3t
-                     ! trend number 8 is in trcsed.F
-                     trc2d(ji,jj,jp_lob0_2d +  8) = trc2d(ji,jj,jp_lob0_2d +  8) + zzoodet * ze3t
-                     trc2d(ji,jj,jp_lob0_2d +  9) = trc2d(ji,jj,jp_lob0_2d +  9) + zzoobod * ze3t
-                     trc2d(ji,jj,jp_lob0_2d + 10) = trc2d(ji,jj,jp_lob0_2d + 10) + zzoonh4 * ze3t
-                     trc2d(ji,jj,jp_lob0_2d + 11) = trc2d(ji,jj,jp_lob0_2d + 11) + zzoodom * ze3t
-                     trc2d(ji,jj,jp_lob0_2d + 12) = trc2d(ji,jj,jp_lob0_2d + 12) + znh4no3 * ze3t
-                     trc2d(ji,jj,jp_lob0_2d + 13) = trc2d(ji,jj,jp_lob0_2d + 13) + zdomnh4 * ze3t
-                     trc2d(ji,jj,jp_lob0_2d + 14) = trc2d(ji,jj,jp_lob0_2d + 14) + zdetnh4 * ze3t
-                     trc2d(ji,jj,jp_lob0_2d + 15) = trc2d(ji,jj,jp_lob0_2d + 15) + (  zno3phy + znh4phy - zphynh4   &
-                        &                                 - zphydom - zphyzoo - zphydet ) * ze3t
-                     trc2d(ji,jj,jp_lob0_2d + 16) = trc2d(ji,jj,jp_lob0_2d + 16) + (  zphyzoo + zdetzoo - zzoodet   &
-                        &                                 - zzoobod - zzoonh4 - zzoodom ) * ze3t
-                     trc2d(ji,jj,jp_lob0_2d + 17) = trc2d(ji,jj,jp_lob0_2d + 17) + zdetdom * ze3t
-                     ! trend number 19 is in trcexp.F
-                     trc3d(ji,jj,jk,jp_lob0_3d    ) = zno3phy * 86400
-                     trc3d(ji,jj,jk,jp_lob0_3d + 1) = znh4phy * 86400
-                     trc3d(ji,jj,jk,jp_lob0_3d + 2) = znh4no3 * 86400
-                     !
-                  ENDIF
+                  zw2d(ji,jj,1)  = zw2d(ji,jj,1)  + zno3phy * ze3t
+                  zw2d(ji,jj,2)  = zw2d(ji,jj,2)  + znh4phy * ze3t
+                  zw2d(ji,jj,3)  = zw2d(ji,jj,3)  + zphydom * ze3t
+                  zw2d(ji,jj,4)  = zw2d(ji,jj,4)  + zphynh4 * ze3t
+                  zw2d(ji,jj,5)  = zw2d(ji,jj,5)  + zphyzoo * ze3t
+                  zw2d(ji,jj,6)  = zw2d(ji,jj,6)  + zphydet * ze3t
+                  zw2d(ji,jj,7)  = zw2d(ji,jj,7)  + zdetzoo * ze3t
+                  zw2d(ji,jj,8)  = zw2d(ji,jj,8)  + zzoodet * ze3t
+                  zw2d(ji,jj,9)  = zw2d(ji,jj,9)  + zzoobod * ze3t
+                  zw2d(ji,jj,10) = zw2d(ji,jj,10) + zzoonh4 * ze3t
+                  zw2d(ji,jj,11) = zw2d(ji,jj,11) + zzoodom * ze3t
+                  zw2d(ji,jj,12) = zw2d(ji,jj,12) + znh4no3 * ze3t
+                  zw2d(ji,jj,13) = zw2d(ji,jj,13) + zdomnh4 * ze3t
+                  zw2d(ji,jj,14) = zw2d(ji,jj,14) + zdetnh4 * ze3t
+                  zw2d(ji,jj,15) = zw2d(ji,jj,15) + ( zno3phy + znh4phy - zphynh4 - zphydom - zphyzoo - zphydet ) * ze3t
+                  zw2d(ji,jj,16) = zw2d(ji,jj,16) + ( zphyzoo + zdetzoo - zzoodet - zzoobod - zzoonh4 - zzoodom ) * ze3t
+                  zw2d(ji,jj,17) = zw2d(ji,jj,17) + zdetdom * ze3t
+                  !   
+                  zw3d(ji,jj,jk,1) = zno3phy * 86400
+                  zw3d(ji,jj,jk,2) = znh4phy * 86400
+                  zw3d(ji,jj,jk,3) = znh4no3 * 86400
                    !
                 ENDIF
@@ -429,11 +366,11 @@
       IF( ln_diatrc ) THEN
          !
+         DO jl = 1, 17 
+            CALL lbc_lnk( zw2d(:,:,jl),'T', 1. )
+         END DO
+         DO jl = 1, 3
+            CALL lbc_lnk( zw3d(:,:,:,jl),'T', 1. )
+         END DO
          IF( lk_iomput ) THEN
-            DO jl = 1, 17 
-               CALL lbc_lnk( zw2d(:,:,jl),'T', 1. )
-            END DO
-            DO jl = 1, 3
-               CALL lbc_lnk( zw3d(:,:,:,jl),'T', 1. )
-            END DO
             ! Save diagnostics
             CALL iom_put( "TNO3PHY", zw2d(:,:,1) )
@@ -460,13 +397,27 @@
          ELSE
             !
-           DO jl = jp_lob0_2d, jp_lob1_2d
-              CALL lbc_lnk( trc2d(:,:,jl),'T', 1. )
-           END DO 
-           !
-           DO jl = jp_lob0_3d, jp_lob1_3d
-             CALL lbc_lnk( trc3d(:,:,1,jl),'T', 1. )
-           END DO 
-           !
-        ENDIF
+            trc2d(:,:,jp_lob0_2d    ) = zw2d(:,:,1) 
+            trc2d(:,:,jp_lob0_2d + 1) = zw2d(:,:,2) 
+            trc2d(:,:,jp_lob0_2d + 2) = zw2d(:,:,3) 
+            trc2d(:,:,jp_lob0_2d + 3) = zw2d(:,:,4) 
+            trc2d(:,:,jp_lob0_2d + 4) = zw2d(:,:,5) 
+            trc2d(:,:,jp_lob0_2d + 5) = zw2d(:,:,6) 
+            trc2d(:,:,jp_lob0_2d + 6) = zw2d(:,:,7) 
+                     ! trend number 8 is in trcsed.F
+            trc2d(:,:,jp_lob0_2d +  8) = zw2d(:,:,8) 
+            trc2d(:,:,jp_lob0_2d +  9) = zw2d(:,:,9) 
+            trc2d(:,:,jp_lob0_2d + 10) = zw2d(:,:,10) 
+            trc2d(:,:,jp_lob0_2d + 11) = zw2d(:,:,11) 
+            trc2d(:,:,jp_lob0_2d + 12) = zw2d(:,:,12) 
+            trc2d(:,:,jp_lob0_2d + 13) = zw2d(:,:,13) 
+            trc2d(:,:,jp_lob0_2d + 14) = zw2d(:,:,14) 
+            trc2d(:,:,jp_lob0_2d + 15) = zw2d(:,:,15) 
+            trc2d(:,:,jp_lob0_2d + 16) = zw2d(:,:,16) 
+            trc2d(:,:,jp_lob0_2d + 17) = zw2d(:,:,17) 
+            ! trend number 19 is in trcexp.F
+            trc3d(:,:,:,jp_lob0_3d    ) = zw3d(:,:,:,1) 
+            trc3d(:,:,:,jp_lob0_3d + 1) = zw3d(:,:,:,2) 
+            trc3d(:,:,:,jp_lob0_3d + 2) = zw3d(:,:,:,3) 
+         ENDIF
         !
       ENDIF
Index: /branches/2011/dev_LOCEAN_2011/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcsed.F90
===================================================================
--- /branches/2011/dev_LOCEAN_2011/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcsed.F90	(revision 3027)
+++ /branches/2011/dev_LOCEAN_2011/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcsed.F90	(revision 3028)
@@ -57,10 +57,10 @@
       !!---------------------------------------------------------------------
       USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
-      USE wrk_nemo, ONLY: zw2d  => wrk_2d_1, zwork => wrk_3d_2
+      USE wrk_nemo, ONLY: zwork => wrk_3d_2, ztra => wrk_3d_3
+      USE wrk_nemo, ONLY: zw2d  => wrk_2d_1
       !!
       INTEGER, INTENT( in ) ::   kt      ! ocean time-step index      
       !!
       INTEGER  ::   ji, jj, jk, jl, ierr
-      REAL(wp) ::   ztra, ze3t
       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  ztrbio
       CHARACTER (len=25) :: charout
@@ -73,5 +73,5 @@
       ENDIF
 
-      IF( wrk_in_use(2, 1) .OR. wrk_in_use(3, 2) ) THEN
+      IF( wrk_in_use(2, 1) .OR. wrk_in_use(3, 2,3) ) THEN
          CALL ctl_stop('trc_sed : requested workspace arrays unavailable.')  ;  RETURN
       END IF
@@ -85,5 +85,5 @@
       ENDIF
 
-      IF( ln_diatrc .AND. lk_iomput )  zw2d(:,:) = 0.
+      IF( ln_diatrc )  zw2d(:,:) = 0.
 
       ! sedimentation of detritus  : upstream scheme
@@ -103,21 +103,28 @@
          DO jj = 1, jpj
             DO ji = 1, jpi
-               ztra  = - ( zwork(ji,jj,jk) - zwork(ji,jj,jk+1) ) / fse3t(ji,jj,jk)
-               tra(ji,jj,jk,jp_lob_det) = tra(ji,jj,jk,jp_lob_det) + ztra
-               !
-               IF( ln_diabio )  trbio(ji,jj,jk,jp_lob0_trd + 7) = ztra
-               IF( ln_diatrc ) THEN
-                  ze3t = ztra * fse3t(ji,jj,jk) * 86400.
-                  IF( lk_iomput ) THEN   ;  zw2d(ji,jj) = zw2d(ji,jj) + ze3t 
-                  ELSE                   ;  trc2d(ji,jj,jp_lob0_2d + 7) = trc2d(ji,jj,jp_lob0_2d + 7) + ze3t
-                  ENDIF
-               ENDIF
-               !
+               ztra(ji,jj,jk)  = - ( zwork(ji,jj,jk) - zwork(ji,jj,jk+1) ) / fse3t(ji,jj,jk)
+               tra(ji,jj,jk,jp_lob_det) = tra(ji,jj,jk,jp_lob_det) + ztra(ji,jj,jk) 
             END DO
          END DO
       END DO
 
-      IF( ln_diatrc .AND. lk_iomput )  CALL iom_put( "TDETSED", zw2d )
-
+      IF( ln_diatrc ) THEN 
+         zw2d(:,:) = 0.
+         DO jk = 1, jpkm1
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+                  zw2d(ji,jj) = zw2d(ji,jj) + ztra(ji,jj,jk) * fse3t(ji,jj,jk) * 86400.
+               END DO
+            END DO
+         END DO
+         IF( lk_iomput )  THEN
+           CALL iom_put( "TDETSED", zw2d )
+         ELSE
+           trc2d(:,:,jp_lob0_2d + 7) = zw2d(:,:)
+         ENDIF
+      ENDIF
+      !
+      IF( ln_diabio )  trbio(:,:,:,jp_lob0_trd + 7) = ztra(:,:,:)
+      !
       IF( l_trdtrc ) THEN
          ztrbio(:,:,:) = tra(:,:,:,jp_lob_det) - ztrbio(:,:,:)
@@ -133,5 +140,5 @@
       ENDIF
 
-      IF( ( wrk_not_released(2, 1) ) .OR. ( wrk_not_released(3, 2) ) )  &
+      IF( ( wrk_not_released(2, 1) ) .OR. ( wrk_not_released(3, 2,3) ) )  &
        &         CALL ctl_stop('trc_sed : failed to release workspace arrays.')
 
Index: /branches/2011/dev_LOCEAN_2011/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zflx.F90
===================================================================
--- /branches/2011/dev_LOCEAN_2011/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zflx.F90	(revision 3027)
+++ /branches/2011/dev_LOCEAN_2011/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zflx.F90	(revision 3028)
@@ -83,8 +83,8 @@
       !!              - Add option for time-interpolation of atcco2.txt  
       !!---------------------------------------------------------------------
-      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
-      USE wrk_nemo, ONLY:   zkgco2 => wrk_2d_11 , zkgo2 => wrk_2d_12 , zh2co3 => wrk_2d_13 
-      USE wrk_nemo, ONLY:   zoflx  => wrk_2d_14 , zkg   => wrk_2d_15
-      USE wrk_nemo, ONLY:   zdpco2 => wrk_2d_16 , zdpo2 => wrk_2d_17
+      USE wrk_nemo, ONLY:  wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:  zkgco2 => wrk_2d_11 , zkgo2 => wrk_2d_12 
+      USE wrk_nemo, ONLY:  zh2co3 => wrk_2d_13 , zoflx => wrk_2d_14 
+      USE wrk_nemo, ONLY:   
       !
       INTEGER, INTENT(in) ::   kt   !
@@ -98,5 +98,5 @@
       !!---------------------------------------------------------------------
 
-      IF( wrk_in_use(2, 11,12,13,14,15,16,17) ) THEN
+      IF( wrk_in_use(2, 11,12,13,14) ) THEN
          CALL ctl_stop('p4z_flx: requested workspace arrays unavailable')   ;   RETURN
       ENDIF
@@ -196,21 +196,6 @@
             zfld16 = atcox * patm(ji,jj) * chemc(ji,jj,2) * tmask(ji,jj,1) * zkgo2(ji,jj)          ! (mol/L) * (m/s)
             zflu16 = trn(ji,jj,1,jpoxy) * tmask(ji,jj,1) * zkgo2(ji,jj)
-            tra(ji,jj,1,jpoxy) = tra(ji,jj,1,jpoxy) + ( zfld16 - zflu16 ) / fse3t(ji,jj,1)
-
-            IF( ln_diatrc ) THEN          ! Save diagnostics
-              IF( lk_iomput ) THEN
-                 zoflx(ji,jj) = ( zfld16 - zflu16 ) * 1000. * tmask(ji,jj,1)
-                 zkg  (ji,jj) = zkgco2(ji,jj) * tmask(ji,jj,1)
-                 zdpco2(ji,jj) = ( satmco2(ji,jj) * patm(ji,jj) - zh2co3(ji,jj) / ( chemc(ji,jj,1) + rtrn ) ) * tmask(ji,jj,1)
-                 zdpo2 (ji,jj) = ( atcox * patm(ji,jj) - trn(ji,jj,1,jpoxy)    / ( chemc(ji,jj,2) + rtrn ) ) * tmask(ji,jj,1)
-              ELSE
-                 zfact = 1. / e1e2t(ji,jj) / rfact
-                 trc2d(ji,jj,jp_pcs0_2d    ) = oce_co2(ji,jj) * zfact
-                 trc2d(ji,jj,jp_pcs0_2d + 1) = ( zfld16 - zflu16 ) * 1000. * tmask(ji,jj,1)
-                 trc2d(ji,jj,jp_pcs0_2d + 2) = zkgco2(ji,jj) * tmask(ji,jj,1)
-                 trc2d(ji,jj,jp_pcs0_2d + 3) = ( satmco2(ji,jj)  * patm(ji,jj) - zh2co3(ji,jj) / ( chemc(ji,jj,1) + rtrn ) ) &
-                    &                            * tmask(ji,jj,1)
-              ENDIF
-           ENDIF
+            zoflx(ji,jj) = zfld16 - zflu16
+            tra(ji,jj,1,jpoxy) = tra(ji,jj,1,jpoxy) + zoflx(ji,jj) / fse3t(ji,jj,1)
          END DO
       END DO
@@ -241,13 +226,19 @@
 
       IF( ln_diatrc ) THEN
-         CALL iom_put( "Cflx" , oce_co2(:,:) / e1e2t(:,:) / rfact ) 
-         CALL iom_put( "Oflx" , zoflx  )
-         CALL iom_put( "Kg"   , zkg    )
-         CALL iom_put( "Dpco2", zdpco2 )
-         CALL iom_put( "Dpo2" , zdpo2  )
-      ENDIF
-      !
-      IF( wrk_not_released(2, 11,12,13,14,15,16,17) )  &
-        &             CALL ctl_stop('p4z_flx: failed to release workspace arrays')
+         IF( lk_iomput ) THEN
+            CALL iom_put( "Cflx" , oce_co2(:,:) / e1e2t(:,:) / rfact ) 
+            CALL iom_put( "Oflx" , zoflx(:,:) * 1000 * tmask(:,:,1)  )
+            CALL iom_put( "Kg"   , zkgco2(:,:) * tmask(:,:,1) )
+            CALL iom_put( "Dpco2", ( satmco2(:,:) * patm(:,:) - zh2co3(:,:) / ( chemc(:,:,1) + rtrn ) ) * tmask(:,:,1) )
+            CALL iom_put( "Dpo2" , ( atcox * patm(:,:) - trn(:,:,1,jpoxy) / ( chemc(:,:,2) + rtrn ) ) * tmask(:,:,1) )
+         ELSE
+            trc2d(:,:,jp_pcs0_2d    ) = oce_co2(:,:) / e1e2t(:,:) / rfact 
+            trc2d(:,:,jp_pcs0_2d + 1) = zoflx(:,:) * 1000 * tmask(:,:,1) 
+            trc2d(:,:,jp_pcs0_2d + 2) = zkgco2(:,:) * tmask(:,:,1) 
+            trc2d(:,:,jp_pcs0_2d + 3) = ( satmco2(:,:) * patm(:,:) - zh2co3(:,:) / ( chemc(:,:,1) + rtrn ) ) * tmask(:,:,1) 
+         ENDIF
+      ENDIF
+      !
+      IF( wrk_not_released(2, 11,12,13,14) ) CALL ctl_stop('p4z_flx: failed to release workspace arrays')
       !
    END SUBROUTINE p4z_flx
