Index: NEMO/trunk/src/TOP/PISCES/P4Z/p4zfechem.F90
===================================================================
--- NEMO/trunk/src/TOP/PISCES/P4Z/p4zfechem.F90	(revision 12232)
+++ NEMO/trunk/src/TOP/PISCES/P4Z/p4zfechem.F90	(revision 12276)
@@ -15,5 +15,5 @@
    USE sms_pisces      ! PISCES Source Minus Sink variables
    USE p4zche          ! chemical model
-   USE p4zsbc          ! Boundary conditions from sediments
+   USE p4zsbc           ! Boundary conditions from sediments
    USE prtctl_trc      ! print control for debugging
    USE iom             ! I/O manager
@@ -71,7 +71,4 @@
       IF( ln_timing )   CALL timing_start('p4z_fechem')
       !
-      zFe3 (:,:,:) = 0.
-      zFeL1(:,:,:) = 0.
-      zTL1 (:,:,:) = 0.
 
       ! Total ligand concentration : Ligands can be chosen to be constant or variable
@@ -209,12 +206,24 @@
          IF( knt == nrdttrc ) THEN
             zrfact2 = 1.e3 * rfact2r  ! conversion from mol/L/timestep into mol/m3/s
-            IF( iom_use("Fe3")    )  CALL iom_put("Fe3"    , zFe3   (:,:,:)       * tmask(:,:,:) )   ! Fe3+
-            IF( iom_use("FeL1")   )  CALL iom_put("FeL1"   , zFeL1  (:,:,:)       * tmask(:,:,:) )   ! FeL1
-            IF( iom_use("TL1")    )  CALL iom_put("TL1"    , zTL1   (:,:,:)       * tmask(:,:,:) )   ! TL1
-            IF( iom_use("Totlig") )  CALL iom_put("Totlig" , ztotlig(:,:,:)       * tmask(:,:,:) )   ! TL
-            IF( iom_use("Biron")  )  CALL iom_put("Biron"  , biron  (:,:,:)  * 1e9 * tmask(:,:,:) )   ! biron
-            IF( iom_use("FESCAV") )  CALL iom_put("FESCAV" , zscav3d(:,:,:)  * 1e9 * tmask(:,:,:) * zrfact2 )
-            IF( iom_use("FECOLL") )  CALL iom_put("FECOLL" , zcoll3d(:,:,:)  * 1e9 * tmask(:,:,:) * zrfact2 )
-            IF( iom_use("LGWCOLL"))  CALL iom_put("LGWCOLL", zlcoll3d(:,:,:) * 1e9 * tmask(:,:,:) * zrfact2 )
+            IF( iom_use("Fe3")  )  THEN
+               zFe3(:,:,jpk) = 0.  ;  CALL iom_put("Fe3" , zFe3(:,:,:) * tmask(:,:,:) )   ! Fe3+
+            ENDIF
+            IF( iom_use("FeL1") )  THEN
+              zFeL1(:,:,jpk) = 0.  ;  CALL iom_put("FeL1", zFeL1(:,:,:) * tmask(:,:,:) )   ! FeL1
+            ENDIF
+            IF( iom_use("TL1")  )  THEN
+              zTL1(:,:,jpk) = 0.   ;  CALL iom_put("TL1" , zTL1(:,:,:) * tmask(:,:,:) )   ! TL1
+            ENDIF
+            CALL iom_put("Totlig" , ztotlig(:,:,:)       * tmask(:,:,:) )   ! TL
+            CALL iom_put("Biron"  , biron  (:,:,:)  * 1e9 * tmask(:,:,:) )   ! biron
+            IF( iom_use("FESCAV") )  THEN
+               zscav3d (:,:,jpk) = 0.  ;  CALL iom_put("FESCAV" , zscav3d(:,:,:)  * 1e9 * tmask(:,:,:) * zrfact2 )
+            ENDIF
+            IF( iom_use("FECOLL") ) THEN
+               zcoll3d (:,:,jpk) = 0.  ;   CALL iom_put("FECOLL" , zcoll3d(:,:,:)  * 1e9 * tmask(:,:,:) * zrfact2 )
+            ENDIF
+            IF( iom_use("LGWCOLL")) THEN
+               zlcoll3d(:,:,jpk) = 0.  ;  CALL iom_put("LGWCOLL", zlcoll3d(:,:,:) * 1e9 * tmask(:,:,:) * zrfact2 )
+            ENDIF
          ENDIF
       ENDIF
@@ -254,8 +263,9 @@
       ENDIF
       !
-      REWIND( numnatp_ref )            ! Namelist nampisfer in reference namelist : Pisces iron chemistry
+      REWIND( numnatp_ref )
       READ  ( numnatp_ref, nampisfer, IOSTAT = ios, ERR = 901)
 901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'nampisfer in reference namelist' )
-      REWIND( numnatp_cfg )            ! Namelist nampisfer in configuration namelist : Pisces iron chemistry
+
+      REWIND( numnatp_cfg )
       READ  ( numnatp_cfg, nampisfer, IOSTAT = ios, ERR = 902 )
 902   IF( ios >  0 )   CALL ctl_nam ( ios , 'nampisfer in configuration namelist' )
Index: NEMO/trunk/src/TOP/PISCES/P4Z/p4zflx.F90
===================================================================
--- NEMO/trunk/src/TOP/PISCES/P4Z/p4zflx.F90	(revision 12232)
+++ NEMO/trunk/src/TOP/PISCES/P4Z/p4zflx.F90	(revision 12276)
@@ -80,5 +80,4 @@
       CHARACTER (len=25) ::   charout
       REAL(wp), DIMENSION(jpi,jpj) ::   zkgco2, zkgo2, zh2co3, zoflx,  zpco2atm  
-      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zw2d
       !!---------------------------------------------------------------------
       !
@@ -160,7 +159,7 @@
             zfld = zfco2 * chemc(ji,jj,1) * zkgco2(ji,jj)  ! (mol/L) * (m/s)
             zflu = zh2co3(ji,jj) * zkgco2(ji,jj)                                   ! (mol/L) (m/s) ?
-            oce_co2(ji,jj) = ( zfld - zflu ) * rfact2 * e1e2t(ji,jj) * tmask(ji,jj,1) * 1000.
+            oce_co2(ji,jj) = ( zfld - zflu ) * tmask(ji,jj,1) 
             ! compute the trend
-            tra(ji,jj,1,jpdic) = tra(ji,jj,1,jpdic) + ( zfld - zflu ) * rfact2 / e3t_n(ji,jj,1) * tmask(ji,jj,1)
+            tra(ji,jj,1,jpdic) = tra(ji,jj,1,jpdic) + oce_co2(ji,jj) * rfact2 / e3t_n(ji,jj,1)
 
             ! Compute O2 flux 
@@ -174,5 +173,5 @@
       IF( iom_use("tcflx") .OR. iom_use("tcflxcum") .OR. kt == nitrst   &
          &                 .OR. (ln_check_mass .AND. kt == nitend) )    &
-         t_oce_co2_flx  = glob_sum( 'p4zflx', oce_co2(:,:) )                    !  Total Flux of Carbon
+         t_oce_co2_flx  = glob_sum( 'p4zflx', oce_co2(:,:) * e1e2t(:,:) * 1000. )                    !  Total Flux of Carbon
       t_oce_co2_flx_cum = t_oce_co2_flx_cum + t_oce_co2_flx       !  Cumulative Total Flux of Carbon
 !      t_atm_co2_flx     = glob_sum( 'p4zflx', satmco2(:,:) * e1e2t(:,:) )       ! Total atmospheric pCO2
@@ -186,29 +185,13 @@
 
       IF( lk_iomput .AND. knt == nrdttrc ) THEN
-         ALLOCATE( zw2d(jpi,jpj) )  
-         IF( iom_use( "Cflx"  ) )  THEN
-            zw2d(:,:) = oce_co2(:,:) / e1e2t(:,:) * rfact2r
-            CALL iom_put( "Cflx"     , zw2d ) 
-         ENDIF
-         IF( iom_use( "Oflx"  ) )  THEN
-            zw2d(:,:) =  zoflx(:,:) * 1000 * tmask(:,:,1)
-            CALL iom_put( "Oflx" , zw2d )
-         ENDIF
-         IF( iom_use( "Kg"    ) )  THEN
-            zw2d(:,:) =  zkgco2(:,:) * tmask(:,:,1)
-            CALL iom_put( "Kg"   , zw2d )
-         ENDIF
-         IF( iom_use( "Dpco2" ) ) THEN
-           zw2d(:,:) = ( zpco2atm(:,:) - zh2co3(:,:) / ( chemc(:,:,1) + rtrn ) ) * tmask(:,:,1)
-           CALL iom_put( "Dpco2" ,  zw2d )
-         ENDIF
-         IF( iom_use( "Dpo2" ) )  THEN
-           zw2d(:,:) = ( atcox * patm(:,:) - atcox * trb(:,:,1,jpoxy) / ( chemo2(:,:,1) + rtrn ) ) * tmask(:,:,1)
-           CALL iom_put( "Dpo2"  , zw2d )
-         ENDIF
-         CALL iom_put( "tcflx"    , t_oce_co2_flx * rfact2r )   ! molC/s
-         CALL iom_put( "tcflxcum" , t_oce_co2_flx_cum       )   ! molC
-         !
-         DEALLOCATE( zw2d )
+         CALL iom_put( "AtmCo2"  , satmco2(:,:) * tmask(:,:,1) )   ! Atmospheric CO2 concentration
+         CALL iom_put( "Cflx"    , oce_co2(:,:) * 1000. ) 
+         CALL iom_put( "Oflx"    , zoflx(:,:) * 1000.  )
+         CALL iom_put( "Kg"      , zkgco2(:,:) * tmask(:,:,1)  )
+         CALL iom_put( "Dpco2"   , ( zpco2atm(:,:) - zh2co3(:,:) / ( chemc(:,:,1) + rtrn ) ) * tmask(:,:,1) )
+         CALL iom_put( "pCO2sea" , ( zh2co3(:,:) / ( chemc(:,:,1) + rtrn ) ) * tmask(:,:,1) )
+         CALL iom_put( "Dpo2"    , ( atcox * patm(:,:) - atcox * trb(:,:,1,jpoxy) / ( chemo2(:,:,1) + rtrn ) ) * tmask(:,:,1) )
+         CALL iom_put( "tcflx"   , t_oce_co2_flx     )   ! molC/s
+         CALL iom_put( "tcflxcum", t_oce_co2_flx_cum )   ! molC
       ENDIF
       !
@@ -239,8 +222,9 @@
       ENDIF
       !
-      REWIND( numnatp_ref )              ! Namelist nampisext in reference namelist : Pisces atm. conditions
+      REWIND( numnatp_ref )
       READ  ( numnatp_ref, nampisext, IOSTAT = ios, ERR = 901)
 901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'nampisext in reference namelist' )
-      REWIND( numnatp_cfg )              ! Namelist nampisext in configuration namelist : Pisces atm. conditions
+
+      REWIND( numnatp_cfg )
       READ  ( numnatp_cfg, nampisext, IOSTAT = ios, ERR = 902 )
 902   IF( ios >  0 )   CALL ctl_nam ( ios , 'nampisext in configuration namelist' )
@@ -320,8 +304,6 @@
          ENDIF
          !
-         REWIND( numnatp_ref )              ! Namelist nampisatm in reference namelist : Pisces atm. sea level pressure file
          READ  ( numnatp_ref, nampisatm, IOSTAT = ios, ERR = 901)
 901      IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampisatm in reference namelist' )
-         REWIND( numnatp_cfg )              ! Namelist nampisatm in configuration namelist : Pisces atm. sea level pressure file 
          READ  ( numnatp_cfg, nampisatm, IOSTAT = ios, ERR = 902 )
 902      IF( ios >  0 )   CALL ctl_nam ( ios , 'nampisatm in configuration namelist' )
Index: NEMO/trunk/src/TOP/PISCES/P4Z/p4zligand.F90
===================================================================
--- NEMO/trunk/src/TOP/PISCES/P4Z/p4zligand.F90	(revision 12232)
+++ NEMO/trunk/src/TOP/PISCES/P4Z/p4zligand.F90	(revision 12276)
@@ -43,6 +43,5 @@
       INTEGER  ::   ji, jj, jk
       REAL(wp) ::   zlgwp, zlgwpr, zlgwr, zlablgw
-      REAL(wp), DIMENSION(jpi,jpj,jpk) :: zligrem, zligpr, zrligprod
-      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   zw3d
+      REAL(wp), DIMENSION(jpi,jpj,jpk) :: zligrem, zligpr, zligprod
       CHARACTER (len=25) ::   charout
       !!---------------------------------------------------------------------
@@ -69,5 +68,5 @@
                zligrem(ji,jj,jk)   = zlgwr
                zligpr(ji,jj,jk)    = zlgwpr
-               zrligprod(ji,jj,jk) = zlgwp
+               zligprod(ji,jj,jk)  = zlgwp
                !
             END DO
@@ -78,18 +77,13 @@
       !     ---------------------------------
       IF( lk_iomput .AND. knt == nrdttrc ) THEN
-         ALLOCATE( zw3d(jpi,jpj,jpk) )
          IF( iom_use( "LIGREM" ) ) THEN
-            zw3d(:,:,:) = zligrem(:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:)
-            CALL iom_put( "LIGREM", zw3d )
+           zligrem(:,:,jpk) = 0.  ; CALL iom_put( "LIGREM", zligrem(:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:) )
          ENDIF
          IF( iom_use( "LIGPR" ) ) THEN
-            zw3d(:,:,:) = zligpr(:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:) 
-            CALL iom_put( "LIGPR", zw3d )
+           zligpr(:,:,jpk) = 0.   ; CALL iom_put( "LIGPR" , zligpr(:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:) )
          ENDIF
          IF( iom_use( "LPRODR" ) ) THEN
-            zw3d(:,:,:) = zrligprod(:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:) 
-            CALL iom_put( "LPRODR", zw3d )
+           zligprod(:,:,jpk) = 0. ; CALL iom_put( "LPRODR", zligprod(:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:) )
          ENDIF
-         DEALLOCATE( zw3d )
       ENDIF
       !
@@ -125,8 +119,10 @@
          WRITE(numout,*) '~~~~~~~~~~~~~~~'
       ENDIF
-      REWIND( numnatp_ref )              ! Namelist nampislig in reference namelist : Pisces remineralization
+
+      REWIND( numnatp_ref )
       READ  ( numnatp_ref, nampislig, IOSTAT = ios, ERR = 901)
 901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'nampislig in reference namelist' )
-      REWIND( numnatp_cfg )              ! Namelist nampislig in configuration namelist : Pisces remineralization
+
+      REWIND( numnatp_cfg )
       READ  ( numnatp_cfg, nampislig, IOSTAT = ios, ERR = 902 )
 902   IF( ios >  0 )   CALL ctl_nam ( ios , 'nampislig in configuration namelist' )
Index: NEMO/trunk/src/TOP/PISCES/P4Z/p4zlim.F90
===================================================================
--- NEMO/trunk/src/TOP/PISCES/P4Z/p4zlim.F90	(revision 12232)
+++ NEMO/trunk/src/TOP/PISCES/P4Z/p4zlim.F90	(revision 12276)
@@ -215,9 +215,9 @@
       !
       IF( lk_iomput .AND. knt == nrdttrc ) THEN        ! save output diagnostics
-        IF( iom_use( "xfracal" ) )   CALL iom_put( "xfracal", xfracal(:,:,:) * tmask(:,:,:) )  ! euphotic layer deptht
-        IF( iom_use( "LNnut"   ) )   CALL iom_put( "LNnut"  , xlimphy(:,:,:) * tmask(:,:,:) )  ! Nutrient limitation term
-        IF( iom_use( "LDnut"   ) )   CALL iom_put( "LDnut"  , xlimdia(:,:,:) * tmask(:,:,:) )  ! Nutrient limitation term
-        IF( iom_use( "LNFe"    ) )   CALL iom_put( "LNFe"   , xlimnfe(:,:,:) * tmask(:,:,:) )  ! Iron limitation term
-        IF( iom_use( "LDFe"    ) )   CALL iom_put( "LDFe"   , xlimdfe(:,:,:) * tmask(:,:,:) )  ! Iron limitation term
+        CALL iom_put( "xfracal", xfracal(:,:,:) * tmask(:,:,:) )  ! euphotic layer deptht
+        CALL iom_put( "LNnut"  , xlimphy(:,:,:) * tmask(:,:,:) )  ! Nutrient limitation term
+        CALL iom_put( "LDnut"  , xlimdia(:,:,:) * tmask(:,:,:) )  ! Nutrient limitation term
+        CALL iom_put( "LNFe"   , xlimnfe(:,:,:) * tmask(:,:,:) )  ! Iron limitation term
+        CALL iom_put( "LDFe"   , xlimdfe(:,:,:) * tmask(:,:,:) )  ! Iron limitation term
       ENDIF
       !
@@ -252,8 +252,9 @@
       ENDIF
       !
-      REWIND( numnatp_ref )              ! Namelist nampislim in reference namelist : Pisces nutrient limitation parameters
+      REWIND( numnatp_ref )
       READ  ( numnatp_ref, namp4zlim, IOSTAT = ios, ERR = 901)
 901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namp4zlim in reference namelist' )
-      REWIND( numnatp_cfg )              ! Namelist nampislim in configuration namelist : Pisces nutrient limitation parameters 
+
+      REWIND( numnatp_cfg )
       READ  ( numnatp_cfg, namp4zlim, IOSTAT = ios, ERR = 902 )
 902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namp4zlim in configuration namelist' )
@@ -284,5 +285,11 @@
       ENDIF
       !
-      nitrfac (:,:,:) = 0._wp
+      nitrfac (:,:,jpk) = 0._wp
+      nitrfac2(:,:,jpk) = 0._wp
+      xfracal (:,:,jpk) = 0._wp
+      xlimphy (:,:,jpk) = 0._wp
+      xlimdia (:,:,jpk) = 0._wp
+      xlimnfe (:,:,jpk) = 0._wp
+      xlimdfe (:,:,jpk) = 0._wp
       !
    END SUBROUTINE p4z_lim_init
Index: NEMO/trunk/src/TOP/PISCES/P4Z/p4zlys.F90
===================================================================
--- NEMO/trunk/src/TOP/PISCES/P4Z/p4zlys.F90	(revision 12232)
+++ NEMO/trunk/src/TOP/PISCES/P4Z/p4zlys.F90	(revision 12276)
@@ -64,6 +64,4 @@
       IF( ln_timing )  CALL timing_start('p4z_lys')
       !
-      zco3    (:,:,:) = 0.
-      zcaldiss(:,:,:) = 0.
       zhinit  (:,:,:) = hi(:,:,:) * 1000. / ( rhop(:,:,:) + rtrn )
       !
@@ -123,8 +121,14 @@
 
       IF( lk_iomput .AND. knt == nrdttrc ) THEN
-         IF( iom_use( "PH"     ) ) CALL iom_put( "PH"    , -1. * LOG10( MAX( hi(:,:,:), rtrn ) ) * tmask(:,:,:) )
-         IF( iom_use( "CO3"    ) ) CALL iom_put( "CO3"   , zco3(:,:,:)     * 1.e+3               * tmask(:,:,:) )
-         IF( iom_use( "CO3sat" ) ) CALL iom_put( "CO3sat", zco3sat(:,:,:)  * 1.e+3               * tmask(:,:,:) )
-         IF( iom_use( "DCAL"   ) ) CALL iom_put( "DCAL"  , zcaldiss(:,:,:) * 1.e+3 * rfact2r     * tmask(:,:,:) )
+         CALL iom_put( "PH"  , -1. * LOG10( MAX( hi(:,:,:), rtrn ) ) * tmask(:,:,:) )
+         IF( iom_use( "CO3" ) ) THEN
+            zco3(:,:,jpk) = 0.    ; CALL iom_put( "CO3"   , zco3(:,:,:)     * 1.e+3           * tmask(:,:,:) )
+         ENDIF
+         IF( iom_use( "CO3sat" ) ) THEN
+           zco3sat(:,:,jpk) = 0.  ; CALL iom_put( "CO3sat", zco3sat(:,:,:)  * 1.e+3           * tmask(:,:,:) )
+         ENDIF
+         IF( iom_use( "DCAL" ) ) THEN
+           zcaldiss(:,:,jpk) = 0. ; CALL iom_put( "DCAL"  , zcaldiss(:,:,:) * 1.e+3 * rfact2r * tmask(:,:,:) )
+         ENDIF
       ENDIF
       !
@@ -162,8 +166,9 @@
       ENDIF
       !
-      REWIND( numnatp_ref )              ! Namelist nampiscal in reference namelist : Pisces CaCO3 dissolution
+      REWIND( numnatp_ref )
       READ  ( numnatp_ref, nampiscal, IOSTAT = ios, ERR = 901)
 901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'nampiscal in reference namelist' )
-      REWIND( numnatp_cfg )              ! Namelist nampiscal in configuration namelist : Pisces CaCO3 dissolution
+
+      REWIND( numnatp_cfg )
       READ  ( numnatp_cfg, nampiscal, IOSTAT = ios, ERR = 902 )
 902   IF( ios >  0 )   CALL ctl_nam ( ios , 'nampiscal in configuration namelist' )
Index: NEMO/trunk/src/TOP/PISCES/P4Z/p4zmeso.F90
===================================================================
--- NEMO/trunk/src/TOP/PISCES/P4Z/p4zmeso.F90	(revision 12232)
+++ NEMO/trunk/src/TOP/PISCES/P4Z/p4zmeso.F90	(revision 12276)
@@ -224,12 +224,13 @@
       !
       IF( lk_iomput .AND. knt == nrdttrc ) THEN
-         zgrazing2(:,:,jpk) = 0._wp
-         zfezoo2 (:,:,jpk) = 0._wp
-         CALL iom_put( "GRAZ2" , zgrazing2(:,:,:) * 1.e+3       * rfact2r * tmask(:,:,:) )  !   Total grazing of phyto by zooplankton
-         CALL iom_put( "PCAL"  , prodcal  (:,:,:) * 1.e+3       * rfact2r * tmask(:,:,:) )  !  Calcite production 
-         CALL iom_put( "FEZOO2", zfezoo2  (:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:) )
-         IF( ln_ligand )  THEN
-            zz2ligprod(:,:,jpk) = 0._wp
-            CALL iom_put( "LPRODZ2", zz2ligprod(:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:)  )
+         CALL iom_put( "PCAL"  , prodcal(:,:,:) * 1.e+3  * rfact2r * tmask(:,:,:) )  !  Calcite production 
+         IF( iom_use("GRAZ2") ) THEN  !   Total grazing of phyto by zooplankton
+           zgrazing2(:,:,jpk) = 0._wp ;  CALL iom_put( "GRAZ2" , zgrazing2(:,:,:) * 1.e+3  * rfact2r * tmask(:,:,:) ) 
+         ENDIF
+         IF( iom_use("FEZOO2") ) THEN  
+           zfezoo2 (:,:,jpk) = 0._wp ; CALL iom_put( "FEZOO2", zfezoo2(:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:) )
+         ENDIF
+         IF( ln_ligand ) THEN
+            zz2ligprod(:,:,jpk) = 0._wp ; CALL iom_put( "LPRODZ2", zz2ligprod(:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:)  )
          ENDIF
       ENDIF
@@ -270,8 +271,9 @@
       ENDIF
       !
-      REWIND( numnatp_ref )              ! Namelist nampismes in reference namelist : Pisces mesozooplankton
+      REWIND( numnatp_ref )
       READ  ( numnatp_ref, namp4zmes, IOSTAT = ios, ERR = 901)
 901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namp4zmes in reference namelist' )
-      REWIND( numnatp_cfg )              ! Namelist nampismes in configuration namelist : Pisces mesozooplankton
+
+      REWIND( numnatp_cfg )
       READ  ( numnatp_cfg, namp4zmes, IOSTAT = ios, ERR = 902 )
 902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namp4zmes in configuration namelist' )
Index: NEMO/trunk/src/TOP/PISCES/P4Z/p4zmicro.F90
===================================================================
--- NEMO/trunk/src/TOP/PISCES/P4Z/p4zmicro.F90	(revision 12232)
+++ NEMO/trunk/src/TOP/PISCES/P4Z/p4zmicro.F90	(revision 12276)
@@ -181,11 +181,12 @@
       !
       IF( lk_iomput .AND. knt == nrdttrc ) THEN
-         zgrazing(:,:,jpk) = 0._wp
-         zfezoo  (:,:,jpk) = 0._wp
-         CALL iom_put( "GRAZ1", zgrazing(:,:,:) * 1.e+3       * rfact2r * tmask(:,:,:) )  !   Total grazing of phyto by zooplankton
-         CALL iom_put( "FEZOO", zfezoo  (:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:) )
-         IF( ln_ligand )  THEN
-            zzligprod(:,:,jpk) = 0._wp
-            CALL iom_put( "LPRODZ", zzligprod(:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:)  )
+       IF( iom_use("GRAZ1") ) THEN  !   Total grazing of phyto by zooplankton
+           zgrazing(:,:,jpk) = 0._wp   ; CALL iom_put( "GRAZ1" , zgrazing(:,:,:) * 1.e+3  * rfact2r * tmask(:,:,:) ) 
+         ENDIF
+         IF( iom_use("FEZOO") ) THEN  
+           zfezoo (:,:,jpk) = 0._wp    ; CALL iom_put( "FEZOO" , zfezoo(:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:) )
+         ENDIF
+         IF( ln_ligand ) THEN
+            zzligprod(:,:,jpk) = 0._wp ; CALL iom_put( "LPRODZ", zzligprod(:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:))
          ENDIF
       ENDIF
@@ -227,8 +228,9 @@
       ENDIF
       !
-      REWIND( numnatp_ref )              ! Namelist nampiszoo in reference namelist : Pisces microzooplankton
+      REWIND( numnatp_ref )
       READ  ( numnatp_ref, namp4zzoo, IOSTAT = ios, ERR = 901)
 901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namp4zzoo in reference namelist' )
-      REWIND( numnatp_cfg )              ! Namelist nampiszoo in configuration namelist : Pisces microzooplankton
+
+      REWIND( numnatp_cfg )
       READ  ( numnatp_cfg, namp4zzoo, IOSTAT = ios, ERR = 902 )
 902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namp4zzoo in configuration namelist' )
Index: NEMO/trunk/src/TOP/PISCES/P4Z/p4zopt.F90
===================================================================
--- NEMO/trunk/src/TOP/PISCES/P4Z/p4zopt.F90	(revision 12232)
+++ NEMO/trunk/src/TOP/PISCES/P4Z/p4zopt.F90	(revision 12276)
@@ -71,5 +71,4 @@
       !
       IF( ln_timing )   CALL timing_start('p4z_opt')
-      IF( ln_p5z    )   ALLOCATE( zetmp5(jpi,jpj) )
 
       IF( knt == 1 .AND. ln_varpar )   CALL p4z_opt_sbc( kt )
@@ -133,5 +132,5 @@
          !
          DO jk = 1, nksrp      
-            etot (:,:,jk) =        ze1(:,:,jk) +        ze2(:,:,jk) +       ze3(:,:,jk)
+            etot (:,:,jk) =         ze1(:,:,jk) +        ze2(:,:,jk) +       ze3(:,:,jk)
             enano(:,:,jk) =  1.85 * ze1(:,:,jk) + 0.69 * ze2(:,:,jk) + 0.46 * ze3(:,:,jk)
             ediat(:,:,jk) =  1.62 * ze1(:,:,jk) + 0.74 * ze2(:,:,jk) + 0.63 * ze3(:,:,jk)
@@ -241,5 +240,5 @@
       !
       IF( ln_p5z ) THEN
-         zetmp5 (:,:) = 0.e0
+         ALLOCATE( zetmp5(jpi,jpj) )  ;   zetmp5 (:,:) = 0.e0
          DO jk = 1, nksrp
             DO jj = 1, jpj
@@ -264,14 +263,13 @@
             END DO
          END DO
-      ENDIF
-      IF( lk_iomput ) THEN
-        IF( knt == nrdttrc ) THEN
-           IF( iom_use( "Heup"  ) ) CALL iom_put( "Heup" , heup(:,:  ) * tmask(:,:,1) )  ! euphotic layer deptht
-           IF( iom_use( "PARDM" ) ) CALL iom_put( "PARDM", zpar(:,:,:) * tmask(:,:,:) )  ! Photosynthetically Available Radiation
-           IF( iom_use( "PAR"   ) ) CALL iom_put( "PAR"  , emoy(:,:,:) * tmask(:,:,:) )  ! Photosynthetically Available Radiation
-        ENDIF
-      ENDIF
-      !
-      IF( ln_p5z    )   DEALLOCATE( zetmp5 )
+         DEALLOCATE( zetmp5 )
+      ENDIF
+      !
+      IF( lk_iomput .AND.  knt == nrdttrc ) THEN
+         CALL iom_put( "Heup" , heup(:,:  ) * tmask(:,:,1) )  ! euphotic layer deptht
+         CALL iom_put( "PARDM", zpar(:,:,:) * tmask(:,:,:) )  ! Photosynthetically Available Radiation
+         CALL iom_put( "PAR"  , emoy(:,:,:) * tmask(:,:,:) )  ! Photosynthetically Available Radiation
+      ENDIF
+      !
       IF( ln_timing )   CALL timing_stop('p4z_opt')
       !
@@ -400,8 +398,10 @@
          WRITE(numout,*) '~~~~~~~~~~~~ '
       ENDIF
-      REWIND( numnatp_ref )              ! Namelist nampisopt in reference namelist : Pisces attenuation coef. and PAR
+
+      REWIND( numnatp_ref )
       READ  ( numnatp_ref, nampisopt, IOSTAT = ios, ERR = 901)
 901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'nampisopt in reference namelist' )
-      REWIND( numnatp_cfg )              ! Namelist nampisopt in configuration namelist : Pisces attenuation coef. and PAR
+
+      REWIND( numnatp_cfg )
       READ  ( numnatp_cfg, nampisopt, IOSTAT = ios, ERR = 902 )
 902   IF( ios >  0 )   CALL ctl_nam ( ios , 'nampisopt in configuration namelist' )
Index: NEMO/trunk/src/TOP/PISCES/P4Z/p4zprod.F90
===================================================================
--- NEMO/trunk/src/TOP/PISCES/P4Z/p4zprod.F90	(revision 12232)
+++ NEMO/trunk/src/TOP/PISCES/P4Z/p4zprod.F90	(revision 12276)
@@ -89,9 +89,9 @@
       !  Allocate temporary workspace
       !
-      zprorcan(:,:,:) = 0._wp ; zprorcad(:,:,:) = 0._wp ; zprofed (:,:,:) = 0._wp
-      zprofen (:,:,:) = 0._wp ; zysopt  (:,:,:) = 0._wp
-      zpronewn(:,:,:) = 0._wp ; zpronewd(:,:,:) = 0._wp ; zprdia  (:,:,:) = 0._wp
-      zprbio  (:,:,:) = 0._wp ; zprdch  (:,:,:) = 0._wp ; zprnch  (:,:,:) = 0._wp 
-      zmxl_fac(:,:,:) = 0._wp ; zmxl_chl(:,:,:) = 0._wp 
+      zprorcan(:,:,jpk) = 0._wp ; zprorcad(:,:,jpk) = 0._wp ; zprofed (:,:,jpk) = 0._wp
+      zprofen (:,:,jpk) = 0._wp ; zysopt  (:,:,jpk) = 0._wp
+      zpronewn(:,:,jpk) = 0._wp ; zpronewd(:,:,jpk) = 0._wp ; zprdia  (:,:,jpk) = 0._wp
+      zprbio  (:,:,jpk) = 0._wp ; zprdch  (:,:,jpk) = 0._wp ; zprnch  (:,:,jpk) = 0._wp 
+      zmxl_fac(:,:,jpk) = 0._wp ; zmxl_chl(:,:,jpk) = 0._wp 
 
       ! Computation of the optimal production
@@ -320,5 +320,5 @@
      !
      IF( ln_ligand ) THEN
-         zpligprod1(:,:,:) = 0._wp    ;    zpligprod2(:,:,:) = 0._wp
+         zpligprod1(:,:,jpk) = 0._wp    ;    zpligprod2(:,:,jpk) = 0._wp
          DO jk = 1, jpkm1
             DO jj = 1, jpj
@@ -341,117 +341,25 @@
          & tpp = glob_sum( 'p4zprod', ( zprorcan(:,:,:) + zprorcad(:,:,:) ) * cvol(:,:,:) )
 
-    IF( lk_iomput ) THEN
-       IF( knt == nrdttrc ) THEN
-          ALLOCATE( zw2d(jpi,jpj), zw3d(jpi,jpj,jpk) )
-          zfact = 1.e+3 * rfact2r  !  conversion from mol/l/kt to  mol/m3/s
-          !
-          IF( iom_use( "PPPHYN" ) .OR. iom_use( "PPPHYD" ) )  THEN
-              zw3d(:,:,:) = zprorcan(:,:,:) * zfact * tmask(:,:,:)  ! primary production by nanophyto
-              CALL iom_put( "PPPHYN"  , zw3d )
-              !
-              zw3d(:,:,:) = zprorcad(:,:,:) * zfact * tmask(:,:,:)  ! primary production by diatomes
-              CALL iom_put( "PPPHYD"  , zw3d )
-          ENDIF
-          IF( iom_use( "PPNEWN" ) .OR. iom_use( "PPNEWD" ) )  THEN
-              zw3d(:,:,:) = zpronewn(:,:,:) * zfact * tmask(:,:,:)  ! new primary production by nanophyto
-              CALL iom_put( "PPNEWN"  , zw3d )
-              !
-              zw3d(:,:,:) = zpronewd(:,:,:) * zfact * tmask(:,:,:)  ! new primary production by diatomes
-              CALL iom_put( "PPNEWD"  , zw3d )
-          ENDIF
-          IF( iom_use( "PBSi" ) )  THEN
-              zw3d(:,:,:) = zprorcad(:,:,:) * zfact * tmask(:,:,:) * zysopt(:,:,:) ! biogenic silica production
-              CALL iom_put( "PBSi"  , zw3d )
-          ENDIF
-          IF( iom_use( "PFeN" ) .OR. iom_use( "PFeD" ) )  THEN
-              zw3d(:,:,:) = zprofen(:,:,:) * zfact * tmask(:,:,:)  ! biogenic iron production by nanophyto
-              CALL iom_put( "PFeN"  , zw3d )
-              !
-              zw3d(:,:,:) = zprofed(:,:,:) * zfact * tmask(:,:,:)  ! biogenic iron production by  diatomes
-              CALL iom_put( "PFeD"  , zw3d )
-          ENDIF
-          IF( iom_use( "LPRODP" ) )  THEN
-              zw3d(:,:,:) = zpligprod1(:,:,:) * 1e9 * zfact * tmask(:,:,:)
-              CALL iom_put( "LPRODP"  , zw3d )
-          ENDIF
-          IF( iom_use( "LDETP" ) )  THEN
-              zw3d(:,:,:) = zpligprod2(:,:,:) * 1e9 * zfact * tmask(:,:,:)
-              CALL iom_put( "LDETP"  , zw3d )
-          ENDIF
-          IF( iom_use( "Mumax" ) )  THEN
-              zw3d(:,:,:) = zprmaxn(:,:,:) * tmask(:,:,:)   ! Maximum growth rate
-              CALL iom_put( "Mumax"  , zw3d )
-          ENDIF
-          IF( iom_use( "MuN" ) .OR. iom_use( "MuD" ) )  THEN
-              zw3d(:,:,:) = zprbio(:,:,:) * xlimphy(:,:,:) * tmask(:,:,:)  ! Realized growth rate for nanophyto
-              CALL iom_put( "MuN"  , zw3d )
-              !
-              zw3d(:,:,:) =  zprdia(:,:,:) * xlimdia(:,:,:) * tmask(:,:,:)  ! Realized growth rate for diatoms
-              CALL iom_put( "MuD"  , zw3d )
-          ENDIF
-          IF( iom_use( "LNlight" ) .OR. iom_use( "LDlight" ) )  THEN
-              zw3d(:,:,:) = zprbio (:,:,:) / (zprmaxn(:,:,:) + rtrn) * tmask(:,:,:) ! light limitation term
-              CALL iom_put( "LNlight"  , zw3d )
-              !
-              zw3d(:,:,:) = zprdia (:,:,:) / (zprmaxd(:,:,:) + rtrn) * tmask(:,:,:)  ! light limitation term
-              CALL iom_put( "LDlight"  , zw3d )
-          ENDIF
-          IF( iom_use( "TPP" ) )  THEN
-              zw3d(:,:,:) = ( zprorcan(:,:,:) + zprorcad(:,:,:) ) * zfact * tmask(:,:,:)  ! total primary production
-              CALL iom_put( "TPP"  , zw3d )
-          ENDIF
-          IF( iom_use( "TPNEW" ) )  THEN
-              zw3d(:,:,:) = ( zpronewn(:,:,:) + zpronewd(:,:,:) ) * zfact * tmask(:,:,:)  ! total new production
-              CALL iom_put( "TPNEW"  , zw3d )
-          ENDIF
-          IF( iom_use( "TPBFE" ) )  THEN
-              zw3d(:,:,:) = ( zprofen(:,:,:) + zprofed(:,:,:) ) * zfact * tmask(:,:,:)  ! total biogenic iron production
-              CALL iom_put( "TPBFE"  , zw3d )
-          ENDIF
-          IF( iom_use( "INTPPPHYN" ) .OR. iom_use( "INTPPPHYD" ) ) THEN  
-             zw2d(:,:) = 0.
-             DO jk = 1, jpkm1
-               zw2d(:,:) = zw2d(:,:) + zprorcan(:,:,jk) * e3t_n(:,:,jk) * zfact * tmask(:,:,jk)  ! vert. integrated  primary produc. by nano
-             ENDDO
-             CALL iom_put( "INTPPPHYN" , zw2d )
-             !
-             zw2d(:,:) = 0.
-             DO jk = 1, jpkm1
-                zw2d(:,:) = zw2d(:,:) + zprorcad(:,:,jk) * e3t_n(:,:,jk) * zfact * tmask(:,:,jk) ! vert. integrated  primary produc. by diatom
-             ENDDO
-             CALL iom_put( "INTPPPHYD" , zw2d )
-          ENDIF
-          IF( iom_use( "INTPP" ) ) THEN   
-             zw2d(:,:) = 0.
-             DO jk = 1, jpkm1
-                zw2d(:,:) = zw2d(:,:) + ( zprorcan(:,:,jk) + zprorcad(:,:,jk) ) * e3t_n(:,:,jk) * zfact * tmask(:,:,jk) ! vert. integrated pp
-             ENDDO
-             CALL iom_put( "INTPP" , zw2d )
-          ENDIF
-          IF( iom_use( "INTPNEW" ) ) THEN    
-             zw2d(:,:) = 0.
-             DO jk = 1, jpkm1
-                zw2d(:,:) = zw2d(:,:) + ( zpronewn(:,:,jk) + zpronewd(:,:,jk) ) * e3t_n(:,:,jk) * zfact * tmask(:,:,jk)  ! vert. integrated new prod
-             ENDDO
-             CALL iom_put( "INTPNEW" , zw2d )
-          ENDIF
-          IF( iom_use( "INTPBFE" ) ) THEN           !   total biogenic iron production  ( vertically integrated )
-             zw2d(:,:) = 0.
-             DO jk = 1, jpkm1
-                zw2d(:,:) = zw2d(:,:) + ( zprofen(:,:,jk) + zprofed(:,:,jk) ) * e3t_n(:,:,jk) * zfact * tmask(:,:,jk) ! vert integr. bfe prod
-             ENDDO
-            CALL iom_put( "INTPBFE" , zw2d )
-          ENDIF
-          IF( iom_use( "INTPBSI" ) ) THEN           !   total biogenic silica production  ( vertically integrated )
-             zw2d(:,:) = 0.
-             DO jk = 1, jpkm1
-                zw2d(:,:) = zw2d(:,:) + zprorcad(:,:,jk) * zysopt(:,:,jk) * e3t_n(:,:,jk) * zfact * tmask(:,:,jk)  ! vert integr. bsi prod
-             ENDDO
-             CALL iom_put( "INTPBSI" , zw2d )
-          ENDIF
-          IF( iom_use( "tintpp" ) )  CALL iom_put( "tintpp" , tpp * zfact )  !  global total integrated primary production molC/s
-          !
-          DEALLOCATE( zw2d, zw3d )
-       ENDIF
+    IF( lk_iomput .AND.  knt == nrdttrc ) THEN
+       zfact = 1.e+3 * rfact2r  !  conversion from mol/l/kt to  mol/m3/s
+       !
+       CALL iom_put( "PPPHYN"  , zprorcan(:,:,:) * zfact * tmask(:,:,:) )  ! primary production by nanophyto
+       CALL iom_put( "PPPHYD"  , zprorcad(:,:,:) * zfact * tmask(:,:,:)   ) ! primary production by diatomes
+       CALL iom_put( "PPNEWN"  , zpronewn(:,:,:) * zfact * tmask(:,:,:)    ) ! new primary production by nanophyto
+       CALL iom_put( "PPNEWD"  , zpronewd(:,:,:) * zfact * tmask(:,:,:)   ) ! new primary production by diatomes
+       CALL iom_put( "PBSi"    , zprorcad(:,:,:) * zfact * tmask(:,:,:) * zysopt(:,:,:)  ) ! biogenic silica production
+       CALL iom_put( "PFeN"    , zprofen(:,:,:) * zfact * tmask(:,:,:)  ) ! biogenic iron production by nanophyto
+       CALL iom_put( "PFeD"    , zprofed(:,:,:) * zfact * tmask(:,:,:)  ) ! biogenic iron production by  diatomes
+       CALL iom_put( "LPRODP"  , zpligprod1(:,:,:) * 1e9 * zfact * tmask(:,:,:) )
+       CALL iom_put( "LDETP"   , zpligprod2(:,:,:) * 1e9 * zfact * tmask(:,:,:) )
+       CALL iom_put( "Mumax"   , zprmaxn(:,:,:) * tmask(:,:,:)  ) ! Maximum growth rate
+       CALL iom_put( "MuN"     , zprbio(:,:,:) * xlimphy(:,:,:) * tmask(:,:,:) ) ! Realized growth rate for nanophyto
+       CALL iom_put( "MuD"     , zprdia(:,:,:) * xlimdia(:,:,:) * tmask(:,:,:) ) ! Realized growth rate for diatoms
+       CALL iom_put( "LNlight" , zprbio (:,:,:) / (zprmaxn(:,:,:) + rtrn) * tmask(:,:,:)  )  ! light limitation term
+       CALL iom_put( "LDlight" , zprdia (:,:,:) / (zprmaxd(:,:,:) + rtrn) * tmask(:,:,:)   )
+       CALL iom_put( "TPP"     , ( zprorcan(:,:,:) + zprorcad(:,:,:) ) * zfact * tmask(:,:,:)  )  ! total primary production
+       CALL iom_put( "TPNEW"   , ( zpronewn(:,:,:) + zpronewd(:,:,:) ) * zfact * tmask(:,:,:)  ) ! total new production
+       CALL iom_put( "TPBFE"   , ( zprofen(:,:,:) + zprofed(:,:,:) ) * zfact * tmask(:,:,:)  )  ! total biogenic iron production
+       CALL iom_put( "tintpp"  , tpp * zfact )  !  global total integrated primary production molC/s
      ENDIF
 
@@ -490,8 +398,9 @@
       ENDIF
       !
-      REWIND( numnatp_ref )              ! Namelist nampisprod in reference namelist : Pisces phytoplankton production
+      REWIND( numnatp_ref )
       READ  ( numnatp_ref, namp4zprod, IOSTAT = ios, ERR = 901)
 901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namp4zprod in reference namelist' )
-      REWIND( numnatp_cfg )              ! Namelist nampisprod in configuration namelist : Pisces phytoplankton production
+
+      REWIND( numnatp_cfg )
       READ  ( numnatp_cfg, namp4zprod, IOSTAT = ios, ERR = 902 )
 902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namp4zprod in configuration namelist' )
Index: NEMO/trunk/src/TOP/PISCES/P4Z/p4zrem.F90
===================================================================
--- NEMO/trunk/src/TOP/PISCES/P4Z/p4zrem.F90	(revision 12232)
+++ NEMO/trunk/src/TOP/PISCES/P4Z/p4zrem.F90	(revision 12276)
@@ -68,5 +68,4 @@
       REAL(wp), DIMENSION(jpi,jpj    ) :: ztempbac
       REAL(wp), DIMENSION(jpi,jpj,jpk) :: zdepbac, zolimi, zdepprod, zfacsi, zfacsib, zdepeff, zfebact
-      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: zw3d
       !!---------------------------------------------------------------------
       !
@@ -274,27 +273,15 @@
        ENDIF
 
-      IF( knt == nrdttrc ) THEN
-          zrfact2 = 1.e3 * rfact2r
-          ALLOCATE( zw3d(jpi,jpj,jpk) )
-          zfact = 1.e+3 * rfact2r  !  conversion from mol/l/kt to  mol/m3/s
+      IF( lk_iomput .AND. knt == nrdttrc ) THEN
+          zrfact2 = 1.e+3 * rfact2r  !  conversion from mol/l/kt to  mol/m3/s
           !
-          IF( iom_use( "REMIN" ) )  THEN
-              zw3d(:,:,:) = zolimi(:,:,:) * tmask(:,:,:) * zfact !  Remineralisation rate
-              CALL iom_put( "REMIN"  , zw3d )
+          IF( iom_use( "REMIN" ) )  THEN !  Remineralisation rate
+             zolimi(:,:,jpk) = 0. ; CALL iom_put( "REMIN"  , zolimi(:,:,:) * tmask(:,:,:) * zrfact2  )
           ENDIF
-          IF( iom_use( "DENIT" ) )  THEN
-              zw3d(:,:,:) = denitr(:,:,:) * rdenit * rno3 * tmask(:,:,:) * zfact ! Denitrification
-              CALL iom_put( "DENIT"  , zw3d )
+          CALL iom_put( "DENIT"  , denitr(:,:,:) * rdenit * rno3 * tmask(:,:,:) * zrfact2 ) ! Denitrification 
+          IF( iom_use( "BACT" ) )  THEN ! Bacterial biomass
+             zdepbac(:,:,jpk) = 0.  ;   CALL iom_put( "BACT", zdepbac(:,:,:) * 1.E6 * tmask(:,:,:) )
           ENDIF
-          IF( iom_use( "BACT" ) )  THEN
-               zw3d(:,:,:) = zdepbac(:,:,:) * 1.E6 * tmask(:,:,:)  ! Bacterial biomass
-               CALL iom_put( "BACT", zw3d )
-          ENDIF
-          IF( iom_use( "FEBACT" ) )  THEN
-               zw3d(:,:,:) = zfebact(:,:,:) * 1E9 * tmask(:,:,:) * zrfact2   ! Bacterial iron consumption
-               CALL iom_put( "FEBACT" , zw3d )
-          ENDIF
-          !
-          DEALLOCATE( zw3d )
+          CALL iom_put( "FEBACT" , zfebact(:,:,:) * 1E9 * tmask(:,:,:) * zrfact2  )
        ENDIF
       !
@@ -327,8 +314,9 @@
       ENDIF
       !
-      REWIND( numnatp_ref )              ! Namelist nampisrem in reference namelist : Pisces remineralization
+      REWIND( numnatp_ref )
       READ  ( numnatp_ref, nampisrem, IOSTAT = ios, ERR = 901)
 901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'nampisrem in reference namelist' )
-      REWIND( numnatp_cfg )              ! Namelist nampisrem in configuration namelist : Pisces remineralization
+
+      REWIND( numnatp_cfg )
       READ  ( numnatp_cfg, nampisrem, IOSTAT = ios, ERR = 902 )
 902   IF( ios >  0 )   CALL ctl_nam ( ios , 'nampisrem in configuration namelist' )
Index: NEMO/trunk/src/TOP/PISCES/P4Z/p4zsed.F90
===================================================================
--- NEMO/trunk/src/TOP/PISCES/P4Z/p4zsed.F90	(revision 12232)
+++ NEMO/trunk/src/TOP/PISCES/P4Z/p4zsed.F90	(revision 12276)
@@ -109,5 +109,5 @@
          tra(:,:,1,jpfer) = tra(:,:,1,jpfer) + zironice(:,:) 
          ! 
-         IF( lk_iomput .AND. knt == nrdttrc .AND. iom_use( "Ironice" ) )   &
+         IF( lk_iomput .AND. knt == nrdttrc )   &
             &   CALL iom_put( "Ironice", zironice(:,:) * 1.e+3 * rfact2r * e3t_n(:,:,1) * tmask(:,:,1) ) ! iron flux from ice
          !
@@ -143,11 +143,7 @@
          ENDDO
          ! 
-         IF( lk_iomput ) THEN
-            IF( knt == nrdttrc ) THEN
-                IF( iom_use( "Irondep" ) )   &
-                &  CALL iom_put( "Irondep", zirondep(:,:,1) * 1.e+3 * rfact2r * e3t_n(:,:,1) * tmask(:,:,1) ) ! surface downward dust depo of iron
-                IF( iom_use( "pdust" ) )   &
-                &  CALL iom_put( "pdust"  , dust(:,:) / ( wdust * rday )  * tmask(:,:,1) ) ! dust concentration at surface
-            ENDIF
+         IF( lk_iomput .AND. knt == nrdttrc ) THEN
+             CALL iom_put( "Irondep", zirondep(:,:,1) * 1.e+3 * rfact2r * e3t_n(:,:,1) * tmask(:,:,1) ) ! surface downward dust depo of iron
+             CALL iom_put( "pdust"  , dust(:,:) / ( wdust * rday )  * tmask(:,:,1) ) ! dust concentration at surface
          ENDIF
          DEALLOCATE( zsidep, zpdep, zirondep )
@@ -207,5 +203,5 @@
          ENDIF
          !
-         IF( lk_iomput .AND. knt == nrdttrc .AND. iom_use( "HYDR" ) )   &
+         IF( lk_iomput .AND. knt == nrdttrc )   &
             &   CALL iom_put( "HYDR", hydrofe(:,:,:) * 1.e+3 * tmask(:,:,:) ) ! hydrothermal iron input
       ENDIF
@@ -229,5 +225,5 @@
                             tra(:,:,:,jpfer) = tra(:,:,:,jpfer) + ironsed(:,:,:) * rfact2
             !
-            IF( lk_iomput .AND. knt == nrdttrc .AND. iom_use( "Ironsed" ) )   &
+            IF( lk_iomput .AND. knt == nrdttrc )   &
                &   CALL iom_put( "Ironsed", ironsed(:,:,:) * 1.e+3 * tmask(:,:,:) ) ! iron inputs from sediments
          ENDIF
@@ -467,16 +463,9 @@
          IF( knt == nrdttrc ) THEN
             zfact = 1.e+3 * rfact2r !  conversion from molC/l/kt  to molN/m3/s
-            IF( iom_use("Nfix"   ) ) CALL iom_put( "Nfix", nitrpot(:,:,:) * nitrfix * rno3 * zfact * tmask(:,:,:) )  ! nitrogen fixation 
-            IF( iom_use("INTNFIX") ) THEN   ! nitrogen fixation rate in ocean ( vertically integrated )
-               zwork(:,:) = 0.
-               DO jk = 1, jpkm1
-                 zwork(:,:) = zwork(:,:) + nitrpot(:,:,jk) * nitrfix * rno3 * zfact * e3t_n(:,:,jk) * tmask(:,:,jk)
-               ENDDO
-               CALL iom_put( "INTNFIX" , zwork ) 
-            ENDIF
-            IF( iom_use("SedCal" ) ) CALL iom_put( "SedCal", zsedcal(:,:) * zfact )
-            IF( iom_use("SedSi" ) )  CALL iom_put( "SedSi",  zsedsi (:,:) * zfact )
-            IF( iom_use("SedC" ) )   CALL iom_put( "SedC",   zsedc  (:,:) * zfact )
-            IF( iom_use("Sdenit" ) ) CALL iom_put( "Sdenit", sdenit (:,:) * zfact * rno3 )
+            CALL iom_put( "Nfix", nitrpot(:,:,:) * nitrfix * rno3 * zfact * tmask(:,:,:) )  ! nitrogen fixation 
+            CALL iom_put( "SedCal", zsedcal(:,:) * zfact )
+            CALL iom_put( "SedSi",  zsedsi (:,:) * zfact )
+            CALL iom_put( "SedC",   zsedc  (:,:) * zfact )
+            CALL iom_put( "Sdenit", sdenit (:,:) * zfact * rno3 )
          ENDIF
       ENDIF
Index: NEMO/trunk/src/TOP/PISCES/P4Z/p4zsink.F90
===================================================================
--- NEMO/trunk/src/TOP/PISCES/P4Z/p4zsink.F90	(revision 12232)
+++ NEMO/trunk/src/TOP/PISCES/P4Z/p4zsink.F90	(revision 12276)
@@ -62,6 +62,4 @@
       CHARACTER (len=25) :: charout
       REAL(wp) :: zmax, zfact
-      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: zw3d
-      REAL(wp), ALLOCATABLE, DIMENSION(:,:  ) :: zw2d
       !!---------------------------------------------------------------------
       !
@@ -129,45 +127,17 @@
         &   t_oce_co2_exp = glob_sum( 'p4zsink', ( sinking(:,:,ik100) + sinking2(:,:,ik100) ) * e1e2t(:,:) * tmask(:,:,1) )
      !
-     IF( lk_iomput ) THEN
-       IF( knt == nrdttrc ) THEN
-          ALLOCATE( zw2d(jpi,jpj), zw3d(jpi,jpj,jpk) )
-          zfact = 1.e+3 * rfact2r  !  conversion from mol/l/kt to  mol/m3/s
-          !
-          IF( iom_use( "EPC100" ) )  THEN
-              zw2d(:,:) = ( sinking(:,:,ik100) + sinking2(:,:,ik100) ) * zfact * tmask(:,:,1) ! Export of carbon at 100m
-              CALL iom_put( "EPC100"  , zw2d )
-          ENDIF
-          IF( iom_use( "EPFE100" ) )  THEN
-              zw2d(:,:) = ( sinkfer(:,:,ik100) + sinkfer2(:,:,ik100) ) * zfact * tmask(:,:,1) ! Export of iron at 100m
-              CALL iom_put( "EPFE100"  , zw2d )
-          ENDIF
-          IF( iom_use( "EPCAL100" ) )  THEN
-              zw2d(:,:) = sinkcal(:,:,ik100) * zfact * tmask(:,:,1) ! Export of calcite at 100m
-              CALL iom_put( "EPCAL100"  , zw2d )
-          ENDIF
-          IF( iom_use( "EPSI100" ) )  THEN
-              zw2d(:,:) =  sinksil(:,:,ik100) * zfact * tmask(:,:,1) ! Export of bigenic silica at 100m
-              CALL iom_put( "EPSI100"  , zw2d )
-          ENDIF
-          IF( iom_use( "EXPC" ) )  THEN
-              zw3d(:,:,:) = ( sinking(:,:,:) + sinking2(:,:,:) ) * zfact * tmask(:,:,:) ! Export of carbon in the water column
-              CALL iom_put( "EXPC"  , zw3d )
-          ENDIF
-          IF( iom_use( "EXPFE" ) )  THEN
-              zw3d(:,:,:) = ( sinkfer(:,:,:) + sinkfer2(:,:,:) ) * zfact * tmask(:,:,:) ! Export of iron 
-              CALL iom_put( "EXPFE"  , zw3d )
-          ENDIF
-          IF( iom_use( "EXPCAL" ) )  THEN
-              zw3d(:,:,:) = sinkcal(:,:,:) * zfact * tmask(:,:,:) ! Export of calcite 
-              CALL iom_put( "EXPCAL"  , zw3d )
-          ENDIF
-          IF( iom_use( "EXPSI" ) )  THEN
-              zw3d(:,:,:) = sinksil(:,:,:) * zfact * tmask(:,:,:) ! Export of bigenic silica
-              CALL iom_put( "EXPSI"  , zw3d )
-          ENDIF
-          IF( iom_use( "tcexp" ) )  CALL iom_put( "tcexp" , t_oce_co2_exp * zfact )   ! molC/s
-          ! 
-          DEALLOCATE( zw2d, zw3d )
-        ENDIF
+     IF( lk_iomput .AND.  knt == nrdttrc ) THEN
+       zfact = 1.e+3 * rfact2r  !  conversion from mol/l/kt to  mol/m3/s
+       !
+       CALL iom_put( "EPC100"  , ( sinking(:,:,ik100) + sinking2(:,:,ik100) ) * zfact * tmask(:,:,1) ) ! Export of carbon at 100m 
+       CALL iom_put( "EPFE100" , ( sinkfer(:,:,ik100) + sinkfer2(:,:,ik100) ) * zfact * tmask(:,:,1) ) ! Export of iron at 100m 
+       CALL iom_put( "EPCAL100", sinkcal(:,:,ik100) * zfact * tmask(:,:,1) )      ! Export of calcite at 100m 
+       CALL iom_put( "EPSI100" , sinksil(:,:,ik100) * zfact * tmask(:,:,1) )          ! Export of bigenic silica at 100m 
+       CALL iom_put( "EXPC"    , ( sinking(:,:,:) + sinking2(:,:,:) ) * zfact * tmask(:,:,:) ) ! Export of carbon in the water column 
+       CALL iom_put( "EXPFE"   , ( sinkfer(:,:,:) + sinkfer2(:,:,:) ) * zfact * tmask(:,:,:) ) ! Export of iron  
+       CALL iom_put( "EXPCAL"  , sinkcal(:,:,:) * zfact * tmask(:,:,:) )      ! Export of calcite 
+       CALL iom_put( "EXPSI"   , sinksil(:,:,:) * zfact * tmask(:,:,:) )      ! Export of bigenic silica
+       CALL iom_put( "tcexp"   , t_oce_co2_exp * zfact )   ! molC/s
+       ! 
       ENDIF
       !
Index: NEMO/trunk/src/TOP/PISCES/P4Z/p4zsms.F90
===================================================================
--- NEMO/trunk/src/TOP/PISCES/P4Z/p4zsms.F90	(revision 12232)
+++ NEMO/trunk/src/TOP/PISCES/P4Z/p4zsms.F90	(revision 12276)
@@ -35,5 +35,5 @@
    INTEGER ::    numco2, numnut, numnit      ! logical unit for co2 budget
    REAL(wp) ::   alkbudget, no3budget, silbudget, ferbudget, po4budget
-   REAL(wp) ::   xfact1, xfact2, xfact3
+   REAL(wp) ::   xfact, xfact1, xfact2, xfact3
 
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   xnegtr     ! Array used to indicate negative tracer values
@@ -63,4 +63,8 @@
       REAL(wp) ::  ztra
       CHARACTER (len=25) :: charout
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:    ) :: zw2d
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:  ) :: zw3d
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) ::   ztrdt   ! 4D workspace
+
       !!---------------------------------------------------------------------
       !
@@ -85,4 +89,11 @@
       rfact = r2dttrc
       !
+      ! trends computation initialisation
+      IF( l_trdtrc )  THEN
+         ALLOCATE( ztrdt(jpi,jpj,jpk,jp_pisces) )  !* store now fields before applying the Asselin filter
+         ztrdt(:,:,:,:)  = trn(:,:,:,:)
+      ENDIF
+      !
+
       IF( ( ln_top_euler .AND. kt == nittrc000 )  .OR. ( .NOT.ln_top_euler .AND. kt <= nittrc000 + nn_dttrc ) ) THEN
          rfactr  = 1. / rfact
@@ -90,4 +101,5 @@
          rfact2r = 1. / rfact2
          xstep = rfact2 / rday         ! Time step duration for biology
+         xfact = 1.e+3 * rfact2r
          IF(lwp) WRITE(numout,*) 
          IF(lwp) WRITE(numout,*) '    Passive Tracer  time step    rfact  = ', rfact, ' rdt = ', rdt
@@ -134,4 +146,52 @@
          END DO
         !
+        IF(  iom_use( 'INTdtAlk' ) .OR. iom_use( 'INTdtDIC' ) .OR. iom_use( 'INTdtFer' ) .OR.  &
+          &  iom_use( 'INTdtDIN' ) .OR. iom_use( 'INTdtDIP' ) .OR. iom_use( 'INTdtSil' ) )  THEN
+          !
+          ALLOCATE( zw3d(jpi,jpj,jpk), zw2d(jpi,jpj) )
+          zw3d(:,:,jpk) = 0.
+          DO jk = 1, jpkm1
+              zw3d(:,:,jk) = xnegtr(:,:,jk) * xfact * e3t_n(:,:,jk) * tmask(:,:,jk)
+          ENDDO
+          !
+          zw2d(:,:) = 0.
+          DO jk = 1, jpkm1
+             zw2d(:,:) = zw2d(:,:) + zw3d(:,:,jk) * tra(:,:,jk,jptal)
+          ENDDO
+          CALL iom_put( 'INTdtAlk', zw2d )
+          !
+          zw2d(:,:) = 0.
+          DO jk = 1, jpkm1
+             zw2d(:,:) = zw2d(:,:) + zw3d(:,:,jk) * tra(:,:,jk,jpdic)
+          ENDDO
+          CALL iom_put( 'INTdtDIC', zw2d )
+          !
+          zw2d(:,:) = 0.
+          DO jk = 1, jpkm1
+             zw2d(:,:) = zw2d(:,:) + zw3d(:,:,jk) * rno3 * ( tra(:,:,jk,jpno3) + tra(:,:,jk,jpnh4) )
+          ENDDO
+          CALL iom_put( 'INTdtDIN', zw2d )
+          !
+          zw2d(:,:) = 0.
+          DO jk = 1, jpkm1
+             zw2d(:,:) = zw2d(:,:) + zw3d(:,:,jk) * po4r * tra(:,:,jk,jppo4)
+          ENDDO
+          CALL iom_put( 'INTdtDIP', zw2d )
+          !
+          zw2d(:,:) = 0.
+          DO jk = 1, jpkm1
+             zw2d(:,:) = zw2d(:,:) + zw3d(:,:,jk) * tra(:,:,jk,jpfer)
+          ENDDO
+          CALL iom_put( 'INTdtFer', zw2d )
+          !
+          zw2d(:,:) = 0.
+          DO jk = 1, jpkm1
+             zw2d(:,:) = zw2d(:,:) + zw3d(:,:,jk) * tra(:,:,jk,jpsil)
+          ENDDO
+          CALL iom_put( 'INTdtSil', zw2d )
+          !
+          DEALLOCATE( zw3d, zw2d )
+        ENDIF
+        !
          DO jn = jp_pcs0, jp_pcs1
             tra(:,:,:,jn) = 0._wp
@@ -144,10 +204,11 @@
          ENDIF
       END DO
-
       !
       IF( l_trdtrc ) THEN
          DO jn = jp_pcs0, jp_pcs1
-           CALL trd_trc( tra(:,:,:,jn), jn, jptra_sms, kt )   ! save trends
+           ztrdt(:,:,:,jn) = ( trb(:,:,:,jn) - ztrdt(:,:,:,jn) ) * rfact2r 
+           CALL trd_trc( ztrdt(:,:,:,jn), jn, jptra_sms, kt )   ! save trends
          END DO
+         DEALLOCATE( ztrdt ) 
       END IF
 #endif
Index: NEMO/trunk/src/TOP/PISCES/P4Z/p5zlim.F90
===================================================================
--- NEMO/trunk/src/TOP/PISCES/P4Z/p5zlim.F90	(revision 12232)
+++ NEMO/trunk/src/TOP/PISCES/P4Z/p5zlim.F90	(revision 12276)
@@ -406,14 +406,14 @@
       !
       IF( lk_iomput .AND. knt == nrdttrc ) THEN        ! save output diagnostics
-        IF( iom_use( "xfracal" ) ) CALL iom_put( "xfracal", xfracal(:,:,:) * tmask(:,:,:) )  ! euphotic layer deptht
-        IF( iom_use( "LNnut"   ) ) CALL iom_put( "LNnut"  , xlimphy(:,:,:) * tmask(:,:,:) )  ! Nutrient limitation term
-        IF( iom_use( "LPnut"   ) ) CALL iom_put( "LPnut"  , xlimpic(:,:,:) * tmask(:,:,:) )  ! Nutrient limitation term
-        IF( iom_use( "LDnut"   ) ) CALL iom_put( "LDnut"  , xlimdia(:,:,:) * tmask(:,:,:) )  ! Nutrient limitation term
-        IF( iom_use( "LNFe"    ) ) CALL iom_put( "LNFe"   , xlimnfe(:,:,:) * tmask(:,:,:) )  ! Iron limitation term
-        IF( iom_use( "LPFe"    ) ) CALL iom_put( "LPFe"   , xlimpfe(:,:,:) * tmask(:,:,:) )  ! Iron limitation term
-        IF( iom_use( "LDFe"    ) ) CALL iom_put( "LDFe"   , xlimdfe(:,:,:) * tmask(:,:,:) )  ! Iron limitation term
-        IF( iom_use( "SIZEN"   ) ) CALL iom_put( "SIZEN"  , sizen(:,:,:) * tmask(:,:,:) )  ! Iron limitation term
-        IF( iom_use( "SIZEP"   ) ) CALL iom_put( "SIZEP"  , sizep(:,:,:) * tmask(:,:,:) )  ! Iron limitation term
-        IF( iom_use( "SIZED"   ) ) CALL iom_put( "SIZED"  , sized(:,:,:) * tmask(:,:,:) )  ! Iron limitation term
+        CALL iom_put( "xfracal", xfracal(:,:,:) * tmask(:,:,:) )  ! euphotic layer deptht
+        CALL iom_put( "LNnut"  , xlimphy(:,:,:) * tmask(:,:,:) )  ! Nutrient limitation term
+        CALL iom_put( "LPnut"  , xlimpic(:,:,:) * tmask(:,:,:) )  ! Nutrient limitation term
+        CALL iom_put( "LDnut"  , xlimdia(:,:,:) * tmask(:,:,:) )  ! Nutrient limitation term
+        CALL iom_put( "LNFe"   , xlimnfe(:,:,:) * tmask(:,:,:) )  ! Iron limitation term
+        CALL iom_put( "LPFe"   , xlimpfe(:,:,:) * tmask(:,:,:) )  ! Iron limitation term
+        CALL iom_put( "LDFe"   , xlimdfe(:,:,:) * tmask(:,:,:) )  ! Iron limitation term
+        CALL iom_put( "SIZEN"  , sizen  (:,:,:) * tmask(:,:,:) )  ! Iron limitation term
+        CALL iom_put( "SIZEP"  , sizep  (:,:,:) * tmask(:,:,:) )  ! Iron limitation term
+        CALL iom_put( "SIZED"  , sized  (:,:,:) * tmask(:,:,:) )  ! Iron limitation term
       ENDIF
       !
@@ -448,9 +448,9 @@
       !!----------------------------------------------------------------------
       !
-      REWIND( numnatp_ref )              ! Namelist nampislim in reference namelist : Pisces nutrient limitation parameters
+      REWIND( numnatp_ref )
       READ  ( numnatp_ref, namp5zlim, IOSTAT = ios, ERR = 901)
 901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampislim in reference namelist' )
       !
-      REWIND( numnatp_cfg )              ! Namelist nampislim in configuration namelist : Pisces nutrient limitation parameters 
+      REWIND( numnatp_cfg )
       READ  ( numnatp_cfg, namp5zlim, IOSTAT = ios, ERR = 902 )
 902   IF( ios >  0 ) CALL ctl_nam ( ios , 'nampislim in configuration namelist' )
@@ -489,9 +489,7 @@
       ENDIF
 
-      REWIND( numnatp_ref )              ! Namelist nampislim in reference namelist : Pisces nutrient limitation parameters
       READ  ( numnatp_ref, namp5zquota, IOSTAT = ios, ERR = 903)
 903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampisquota in reference namelist' )
       !
-      REWIND( numnatp_cfg )              ! Namelist nampislim in configuration namelist : Pisces nutrient limitation parameters 
       READ  ( numnatp_cfg, namp5zquota, IOSTAT = ios, ERR = 904 )
 904   IF( ios >  0 ) CALL ctl_nam ( ios , 'nampisquota in configuration namelist' )
@@ -526,5 +524,15 @@
       zpsiuptk = 2.3 * rno3
       !
-      nitrfac (:,:,:) = 0._wp
+      nitrfac(:,:,jpk) = 0._wp
+      xfracal(:,:,jpk) = 0._wp
+      xlimphy(:,:,jpk) = 0._wp
+      xlimpic(:,:,jpk) = 0._wp
+      xlimdia(:,:,jpk) = 0._wp
+      xlimnfe(:,:,jpk) = 0._wp
+      xlimpfe(:,:,jpk) = 0._wp
+      xlimdfe(:,:,jpk) = 0._wp
+      sizen  (:,:,jpk) = 0._wp
+      sizep  (:,:,jpk) = 0._wp
+      sized  (:,:,jpk) = 0._wp
       !
    END SUBROUTINE p5z_lim_init
Index: NEMO/trunk/src/TOP/PISCES/P4Z/p5zmeso.F90
===================================================================
--- NEMO/trunk/src/TOP/PISCES/P4Z/p5zmeso.F90	(revision 12232)
+++ NEMO/trunk/src/TOP/PISCES/P4Z/p5zmeso.F90	(revision 12276)
@@ -86,6 +86,5 @@
       CHARACTER (len=25) :: charout
       REAL(wp) :: zrfact2, zmetexcess
-      REAL(wp), DIMENSION(jpi,jpj,jpk) :: zgrazing, zfezoo2
-      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: zw3d, zz2ligprod
+      REAL(wp), DIMENSION(jpi,jpj,jpk) :: zgrazing2, zfezoo2, zz2ligprod
 
       !!---------------------------------------------------------------------
@@ -93,12 +92,4 @@
       IF( ln_timing )   CALL timing_start('p5z_meso')
       !
-
-      zgrazing(:,:,:) = 0._wp
-      zfezoo2 (:,:,:) = 0._wp
-      !
-      IF (ln_ligand) THEN
-         ALLOCATE( zz2ligprod(jpi,jpj,jpk) )
-         zz2ligprod(:,:,:) = 0._wp
-      ENDIF
 
       zmetexcess = 0.0
@@ -224,5 +215,5 @@
 
                ! Total grazing ( grazing by microzoo is already computed in p5zmicro )
-               zgrazing(ji,jj,jk) = zgraztotc
+               zgrazing2(ji,jj,jk) = zgraztotc
 
                !   Stoichiometruc ratios of the food ingested by zooplanton 
@@ -355,23 +346,15 @@
       END DO
       !
-      IF( lk_iomput .AND. knt == nrdttrc ) THEN
-         ALLOCATE( zw3d(jpi,jpj,jpk) )
-         IF( iom_use( "GRAZ2" ) ) THEN
-            zw3d(:,:,:) = zgrazing(:,:,:) * 1.e+3 * rfact2r * tmask(:,:,:)  !   Total grazing of phyto by zooplankton
-            CALL iom_put( "GRAZ2", zw3d )
+       IF( lk_iomput .AND. knt == nrdttrc ) THEN
+         CALL iom_put( "PCAL"  , prodcal(:,:,:) * 1.e+3  * rfact2r * tmask(:,:,:) )  !  Calcite production 
+         IF( iom_use("GRAZ2") ) THEN  !   Total grazing of phyto by zooplankton
+           zgrazing2(:,:,jpk) = 0._wp ;  CALL iom_put( "GRAZ2" , zgrazing2(:,:,:) * 1.e+3  * rfact2r * tmask(:,:,:) ) 
          ENDIF
-         IF( iom_use( "PCAL" ) ) THEN
-            zw3d(:,:,:) = prodcal(:,:,:) * 1.e+3 * rfact2r * tmask(:,:,:)   !  Calcite production
-            CALL iom_put( "PCAL", zw3d )
+         IF( iom_use("FEZOO2") ) THEN  
+           zfezoo2 (:,:,jpk) = 0._wp ; CALL iom_put( "FEZOO2", zfezoo2(:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:) )
          ENDIF
-         IF( iom_use( "FEZOO2" ) ) THEN
-            zw3d(:,:,:) = zfezoo2(:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:)   !
-            CALL iom_put( "FEZOO2", zw3d )
+         IF( ln_ligand ) THEN
+            zz2ligprod(:,:,jpk) = 0._wp ; CALL iom_put( "LPRODZ2", zz2ligprod(:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:)  )
          ENDIF
-         IF( iom_use( "LPRODZ2" ) .AND. ln_ligand )  THEN
-            zw3d(:,:,:) = zz2ligprod(:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:)
-            CALL iom_put( "LPRODZ2"  , zw3d )
-         ENDIF
-         DEALLOCATE( zw3d )
       ENDIF
       !
@@ -407,9 +390,9 @@
       !!----------------------------------------------------------------------
       !
-      REWIND( numnatp_ref )              ! Namelist nampismes in reference namelist : Pisces mesozooplankton
+      REWIND( numnatp_ref )
       READ  ( numnatp_ref, namp5zmes, IOSTAT = ios, ERR = 901)
 901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampismes in reference namelist' )
       !
-      REWIND( numnatp_cfg )              ! Namelist nampismes in configuration namelist : Pisces mesozooplankton
+      REWIND( numnatp_cfg )
       READ  ( numnatp_cfg, namp5zmes, IOSTAT = ios, ERR = 902 )
 902   IF( ios >  0 ) CALL ctl_nam ( ios , 'nampismes in configuration namelist' )
Index: NEMO/trunk/src/TOP/PISCES/P4Z/p5zmicro.F90
===================================================================
--- NEMO/trunk/src/TOP/PISCES/P4Z/p5zmicro.F90	(revision 12232)
+++ NEMO/trunk/src/TOP/PISCES/P4Z/p5zmicro.F90	(revision 12276)
@@ -84,15 +84,9 @@
       REAL(wp) :: zgrazdc, zgrazdn, zgrazdp, zgrazdf, zgraznf, zgrazz
       REAL(wp) :: zgrazpc, zgrazpn, zgrazpp, zgrazpf, zbeta, zrfact2, zmetexcess
-      REAL(wp), DIMENSION(jpi,jpj,jpk) :: zgrazing, zfezoo
-      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: zw3d, zzligprod
+      REAL(wp), DIMENSION(jpi,jpj,jpk) :: zgrazing, zfezoo, zzligprod
       CHARACTER (len=25) :: charout
       !!---------------------------------------------------------------------
       !
       IF( ln_timing )   CALL timing_start('p5z_micro')
-      !
-      IF (ln_ligand) THEN
-         ALLOCATE( zzligprod(jpi,jpj,jpk) )
-         zzligprod(:,:,:) = 0._wp
-      ENDIF
       !
       zmetexcess = 0.0
@@ -299,20 +293,13 @@
       END DO
       !
-      IF( lk_iomput ) THEN
-         IF( knt == nrdttrc ) THEN
-            ALLOCATE( zw3d(jpi,jpj,jpk) )
-            IF( iom_use( "GRAZ1" ) ) THEN
-               zw3d(:,:,:) = zgrazing(:,:,:) * 1.e+3 * rfact2r * tmask(:,:,:)  !  Total grazing of phyto by zooplankton
-               CALL iom_put( "GRAZ1", zw3d )
-            ENDIF
-            IF( iom_use( "FEZOO" ) ) THEN
-               zw3d(:,:,:) = zfezoo(:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:)   !
-               CALL iom_put( "FEZOO", zw3d )
-            ENDIF
-            IF( iom_use( "LPRODZ" ) .AND. ln_ligand )  THEN
-               zw3d(:,:,:) = zzligprod(:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:)
-               CALL iom_put( "LPRODZ"  , zw3d )
-            ENDIF
-            DEALLOCATE( zw3d )
+      IF( lk_iomput .AND. knt == nrdttrc ) THEN
+        IF( iom_use("GRAZ1") ) THEN  !   Total grazing of phyto by zooplankton
+           zgrazing(:,:,jpk) = 0._wp   ; CALL iom_put( "GRAZ1" , zgrazing(:,:,:) * 1.e+3  * rfact2r * tmask(:,:,:) ) 
+         ENDIF
+         IF( iom_use("FEZOO") ) THEN  
+           zfezoo (:,:,jpk) = 0._wp    ; CALL iom_put( "FEZOO" , zfezoo(:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:) )
+         ENDIF
+         IF( ln_ligand ) THEN
+            zzligprod(:,:,jpk) = 0._wp ; CALL iom_put( "LPRODZ", zzligprod(:,:,:) * 1e9 * 1.e+3 * rfact2r * tmask(:,:,:))
          ENDIF
       ENDIF
@@ -349,9 +336,9 @@
       !!----------------------------------------------------------------------
       !
-      REWIND( numnatp_ref )              ! Namelist nampiszoo in reference namelist : Pisces microzooplankton
+      REWIND( numnatp_ref )
       READ  ( numnatp_ref, namp5zzoo, IOSTAT = ios, ERR = 901)
 901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namp5zzoo in reference namelist' )
       !
-      REWIND( numnatp_cfg )              ! Namelist nampiszoo in configuration namelist : Pisces microzooplankton
+      REWIND( numnatp_cfg )
       READ  ( numnatp_cfg, namp5zzoo, IOSTAT = ios, ERR = 902 )
 902   IF( ios >  0 ) CALL ctl_nam ( ios , 'namp5zzoo in configuration namelist' )
Index: NEMO/trunk/src/TOP/PISCES/P4Z/p5zprod.F90
===================================================================
--- NEMO/trunk/src/TOP/PISCES/P4Z/p5zprod.F90	(revision 12232)
+++ NEMO/trunk/src/TOP/PISCES/P4Z/p5zprod.F90	(revision 12276)
@@ -94,19 +94,18 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk) :: zmxl_fac, zmxl_chl
       REAL(wp), DIMENSION(jpi,jpj,jpk) :: zpligprod1, zpligprod2
-      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: zw3d
-      REAL(wp), ALLOCATABLE, DIMENSION(:,:  ) :: zw2d
       !!---------------------------------------------------------------------
       !
       IF( ln_timing )   CALL timing_start('p5z_prod')
       !
-      zprorcan(:,:,:) = 0._wp ; zprorcap(:,:,:) = 0._wp ; zprorcad(:,:,:) = 0._wp
-      zprofed (:,:,:) = 0._wp ; zprofep (:,:,:) = 0._wp ; zprofen (:,:,:) = 0._wp
-      zpronewn(:,:,:) = 0._wp ; zpronewp(:,:,:) = 0._wp ; zpronewd(:,:,:) = 0._wp
-      zproregn(:,:,:) = 0._wp ; zproregp(:,:,:) = 0._wp ; zproregd(:,:,:) = 0._wp 
-      zpropo4n(:,:,:) = 0._wp ; zpropo4p(:,:,:) = 0._wp ; zpropo4d(:,:,:) = 0._wp
-      zprdia  (:,:,:) = 0._wp ; zprpic  (:,:,:) = 0._wp ; zprbio  (:,:,:) = 0._wp
-      zprodopn(:,:,:) = 0._wp ; zprodopp(:,:,:) = 0._wp ; zprodopd(:,:,:) = 0._wp
-      zysopt  (:,:,:) = 0._wp
-      zrespn  (:,:,:) = 0._wp ; zrespp  (:,:,:) = 0._wp ; zrespd  (:,:,:) = 0._wp 
+      zprorcan(:,:,jpk) = 0._wp ; zprorcap(:,:,jpk) = 0._wp ; zprorcad(:,:,jpk) = 0._wp
+      zcroissn(:,:,jpk) = 0._wp ; zcroissp(:,:,jpk) = 0._wp ; zcroissd(:,:,jpk) = 0._wp
+      zprofed (:,:,jpk) = 0._wp ; zprofep (:,:,jpk) = 0._wp ; zprofen (:,:,jpk) = 0._wp
+      zpronewn(:,:,jpk) = 0._wp ; zpronewp(:,:,jpk) = 0._wp ; zpronewd(:,:,jpk) = 0._wp
+      zproregn(:,:,jpk) = 0._wp ; zproregp(:,:,jpk) = 0._wp ; zproregd(:,:,jpk) = 0._wp 
+      zpropo4n(:,:,jpk) = 0._wp ; zpropo4p(:,:,jpk) = 0._wp ; zpropo4d(:,:,jpk) = 0._wp
+      zprdia  (:,:,jpk) = 0._wp ; zprpic  (:,:,jpk) = 0._wp ; zprbio  (:,:,jpk) = 0._wp
+      zprodopn(:,:,jpk) = 0._wp ; zprodopp(:,:,jpk) = 0._wp ; zprodopd(:,:,jpk) = 0._wp
+      zysopt  (:,:,jpk) = 0._wp 
+      zrespn  (:,:,jpk) = 0._wp ; zrespp  (:,:,jpk) = 0._wp ; zrespd  (:,:,jpk) = 0._wp 
 
       ! Computation of the optimal production
@@ -444,5 +443,5 @@
      !
      IF( ln_ligand ) THEN
-         zpligprod1(:,:,:) = 0._wp    ;    zpligprod2(:,:,:) = 0._wp
+         zpligprod1(:,:,jpk) = 0._wp    ;    zpligprod2(:,:,jpk) = 0._wp        
          DO jk = 1, jpkm1
             DO jj = 1, jpj
@@ -465,91 +464,33 @@
       & tpp = glob_sum( 'p5zprod', ( zprorcan(:,:,:) + zprorcad(:,:,:) + zprorcap(:,:,:) ) * cvol(:,:,:) )
 
-    IF( lk_iomput ) THEN
-       IF( knt == nrdttrc ) THEN
-          ALLOCATE( zw2d(jpi,jpj), zw3d(jpi,jpj,jpk) )
-          zfact = 1.e+3 * rfact2r  !  conversion from mol/l/kt to  mol/m3/s
-          !
-          IF( iom_use( "PPPHYN" ) .OR. iom_use( "PPPHYD" ) .OR. iom_use( "PPPHYP" ) )  THEN
-              zw3d(:,:,:) = zprorcan(:,:,:) * zfact * tmask(:,:,:)  ! primary production by nanophyto
-              CALL iom_put( "PPPHYN"  , zw3d )
-              !
-              zw3d(:,:,:) = zprorcap(:,:,:) * zfact * tmask(:,:,:)  ! primary production by picophyto
-              CALL iom_put( "PPPHYP"  , zw3d )
-              !
-              zw3d(:,:,:) = zprorcad(:,:,:) * zfact * tmask(:,:,:)  ! primary production by diatomes
-              CALL iom_put( "PPPHYD"  , zw3d )
-          ENDIF
-          IF( iom_use( "PPNEWN" ) .OR. iom_use( "PPNEWD" ) .OR. iom_use( "PPNEWP" ) )  THEN
-              zw3d(:,:,:) = zpronewn(:,:,:) * zfact * tmask(:,:,:)  ! new primary production by nanophyto
-              CALL iom_put( "PPNEWN"  , zw3d )
-              !
-              zw3d(:,:,:) = zpronewp(:,:,:) * zfact * tmask(:,:,:)  ! new primary production by picophyto
-              CALL iom_put( "PPNEWP"  , zw3d )
-              !
-              zw3d(:,:,:) = zpronewd(:,:,:) * zfact * tmask(:,:,:)  ! new primary production by diatomes
-              CALL iom_put( "PPNEWD"  , zw3d )
-          ENDIF
-          IF( iom_use( "PBSi" ) )  THEN
-              zw3d(:,:,:) = zprorcad(:,:,:) * zfact * tmask(:,:,:) * zysopt(:,:,:) ! biogenic silica production
-              CALL iom_put( "PBSi"  , zw3d )
-          ENDIF
-          IF( iom_use( "PFeN" ) .OR. iom_use( "PFeD" ) .OR. iom_use( "PFeP" ) )  THEN
-              zw3d(:,:,:) = zprofen(:,:,:) * zfact * tmask(:,:,:)  ! biogenic iron production by nanophyto
-              CALL iom_put( "PFeN"  , zw3d )
-              !
-              zw3d(:,:,:) = zprofep(:,:,:) * zfact * tmask(:,:,:)  ! biogenic iron production by picophyto
-              CALL iom_put( "PFeP"  , zw3d )
-              !
-              zw3d(:,:,:) = zprofed(:,:,:) * zfact * tmask(:,:,:)  ! biogenic iron production by  diatomes
-              CALL iom_put( "PFeD"  , zw3d )
-          ENDIF
-          IF( iom_use( "LPRODP" ) )  THEN
-              zw3d(:,:,:) = zpligprod1(:,:,:) * 1e9 * zfact * tmask(:,:,:)
-              CALL iom_put( "LPRODP"  , zw3d )
-          ENDIF
-          IF( iom_use( "LDETP" ) )  THEN
-              zw3d(:,:,:) = zpligprod2(:,:,:) * 1e9 * zfact * tmask(:,:,:)
-              CALL iom_put( "LDETP"  , zw3d )
-          ENDIF
-          IF( iom_use( "Mumax" ) )  THEN
-              zw3d(:,:,:) = zprmaxn(:,:,:) * tmask(:,:,:)   ! Maximum growth rate
-              CALL iom_put( "Mumax"  , zw3d )
-          ENDIF
-          IF( iom_use( "MuN" ) .OR. iom_use( "MuD" ) .OR. iom_use( "MuP" ) )  THEN
-              zw3d(:,:,:) = zprbio(:,:,:) * xlimphy(:,:,:) * tmask(:,:,:)  ! Realized growth rate for nanophyto
-              CALL iom_put( "MuN"  , zw3d )
-              !
-              zw3d(:,:,:) = zprpic(:,:,:) * xlimpic(:,:,:) * tmask(:,:,:)  ! Realized growth rate for picophyto
-              CALL iom_put( "MuP"  , zw3d )
-              !
-              zw3d(:,:,:) =  zprdia(:,:,:) * xlimdia(:,:,:) * tmask(:,:,:)  ! Realized growth rate for diatoms
-              CALL iom_put( "MuD"  , zw3d )
-          ENDIF
-          IF( iom_use( "LNlight" ) .OR. iom_use( "LDlight" ) .OR. iom_use( "LPlight" ) )  THEN
-              zw3d(:,:,:) = zprbio (:,:,:) / (zprmaxn(:,:,:) + rtrn) * tmask(:,:,:) ! light limitation term
-              CALL iom_put( "LNlight"  , zw3d )
-              !
-              zw3d(:,:,:) = zprpic (:,:,:) / (zprmaxp(:,:,:) + rtrn) * tmask(:,:,:) ! light limitation term
-              CALL iom_put( "LPlight"  , zw3d )
-              !
-              zw3d(:,:,:) =  zprdia (:,:,:) / (zprmaxd(:,:,:) + rtrn) * tmask(:,:,:)  ! light limitation term
-              CALL iom_put( "LDlight"  , zw3d )
-          ENDIF
-          IF( iom_use( "MunetN" ) .OR. iom_use( "MunetD" ) .OR. iom_use( "MunetP" ) )  THEN
-              zw3d(:,:,:) = zcroissn(:,:,:) * tmask(:,:,:) ! ! Realized growth rate for nanophyto
-              CALL iom_put( "MunetN"  , zw3d )
-              !
-              zw3d(:,:,:) = zcroissp(:,:,:) * tmask(:,:,:) ! ! Realized growth rate for picophyto
-              CALL iom_put( "MunetP"  , zw3d )
-              !
-              zw3d(:,:,:) = zcroissd(:,:,:) * tmask(:,:,:) ! ! Realized growth rate for diatomes
-              CALL iom_put( "MunetD"  , zw3d )
-              !
-          ENDIF
-
-          IF( iom_use( "tintpp" ) )  CALL iom_put( "tintpp" , tpp * zfact )  !  global total integrated primary production molC/s
-          !
-          DEALLOCATE( zw2d, zw3d )
-       ENDIF
+    IF( lk_iomput .AND.  knt == nrdttrc ) THEN
+       zfact = 1.e+3 * rfact2r  !  conversion from mol/l/kt to  mol/m3/s
+       !
+       CALL iom_put( "PPPHYP"  , zprorcap(:,:,:) * zfact * tmask(:,:,:)   ) ! primary production by picophyto
+       CALL iom_put( "PPPHYN"  , zprorcan(:,:,:) * zfact * tmask(:,:,:) )  ! primary production by nanophyto
+       CALL iom_put( "PPPHYD"  , zprorcad(:,:,:) * zfact * tmask(:,:,:)   ) ! primary production by diatomes
+       CALL iom_put( "PPNEWN"  , zpronewp(:,:,:) * zfact * tmask(:,:,:)    ) ! new primary production by picophyto
+       CALL iom_put( "PPNEWN"  , zpronewn(:,:,:) * zfact * tmask(:,:,:)    ) ! new primary production by nanophyto
+       CALL iom_put( "PPNEWD"  , zpronewd(:,:,:) * zfact * tmask(:,:,:)   ) ! new primary production by diatomes
+       CALL iom_put( "PBSi"    , zprorcad(:,:,:) * zfact * tmask(:,:,:) * zysopt(:,:,:)  ) ! biogenic silica production
+       CALL iom_put( "PFeP"    , zprofep(:,:,:) * zfact * tmask(:,:,:)  ) ! biogenic iron production by picophyto
+       CALL iom_put( "PFeN"    , zprofen(:,:,:) * zfact * tmask(:,:,:)  ) ! biogenic iron production by nanophyto
+       CALL iom_put( "PFeD"    , zprofed(:,:,:) * zfact * tmask(:,:,:)  ) ! biogenic iron production by  diatomes
+       CALL iom_put( "LPRODP"  , zpligprod1(:,:,:) * 1e9 * zfact * tmask(:,:,:) )
+       CALL iom_put( "LDETP"   , zpligprod2(:,:,:) * 1e9 * zfact * tmask(:,:,:) )
+       CALL iom_put( "Mumax"   , zprmaxn(:,:,:) * tmask(:,:,:)  ) ! Maximum growth rate
+       CALL iom_put( "MuP"     , zprpic(:,:,:) * xlimpic(:,:,:) * tmask(:,:,:) ) ! Realized growth rate for picophyto
+       CALL iom_put( "MuN"     , zprbio(:,:,:) * xlimphy(:,:,:) * tmask(:,:,:) ) ! Realized growth rate for nanophyto
+       CALL iom_put( "MuD"     , zprdia(:,:,:) * xlimdia(:,:,:) * tmask(:,:,:) ) ! Realized growth rate for diatoms
+       CALL iom_put( "LPlight" , zprpic(:,:,:) / (zprmaxp(:,:,:) + rtrn) * tmask(:,:,:)  )  ! light limitation term
+       CALL iom_put( "LNlight" , zprbio(:,:,:) / (zprmaxn(:,:,:) + rtrn) * tmask(:,:,:)  )  ! light limitation term
+       CALL iom_put( "LDlight" , zprdia(:,:,:) / (zprmaxd(:,:,:) + rtrn) * tmask(:,:,:)   )
+       CALL iom_put( "MunetP"  , zcroissp(:,:,:) * tmask(:,:,:) ) ! Realized growth rate for picophyto
+       CALL iom_put( "MunetN"  , zcroissn(:,:,:) * tmask(:,:,:) ) ! Realized growth rate for nanophyto
+       CALL iom_put( "MunetD"  , zcroissd(:,:,:) * tmask(:,:,:) ) ! Realized growth rate for diatoms
+       CALL iom_put( "TPP"     , ( zprorcap(:,:,:) + zprorcan(:,:,:) + zprorcad(:,:,:) ) * zfact * tmask(:,:,:)  )  ! total primary production
+       CALL iom_put( "TPNEW"   , ( zpronewp(:,:,:) + zpronewn(:,:,:) + zpronewd(:,:,:) ) * zfact * tmask(:,:,:)  ) ! total new production
+       CALL iom_put( "TPBFE"   , ( zprofep (:,:,:) + zprofen (:,:,:) + zprofed (:,:,:) ) * zfact * tmask(:,:,:)  )  ! total biogenic iron production
+       CALL iom_put( "tintpp"  , tpp * zfact )  !  global total integrated primary production molC/s
      ENDIF
 
@@ -582,9 +523,7 @@
       !!----------------------------------------------------------------------
 
-      REWIND( numnatp_ref )              ! Namelist nampisprod in reference namelist : Pisces phytoplankton production
       READ  ( numnatp_ref, namp5zprod, IOSTAT = ios, ERR = 901)
 901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namp5zprod in reference namelist' )
 
-      REWIND( numnatp_cfg )              ! Namelist nampisprod in configuration namelist : Pisces phytoplankton production
       READ  ( numnatp_cfg, namp5zprod, IOSTAT = ios, ERR = 902 )
 902   IF( ios >  0 ) CALL ctl_nam ( ios , 'namp5zprod in configuration namelist' )
