Index: /branches/CMIP5_IPSL/NEMO/TOP_SRC/PISCES/p4zflx.F90
===================================================================
--- /branches/CMIP5_IPSL/NEMO/TOP_SRC/PISCES/p4zflx.F90	(revision 2503)
+++ /branches/CMIP5_IPSL/NEMO/TOP_SRC/PISCES/p4zflx.F90	(revision 2504)
@@ -41,13 +41,9 @@
       xconv  = 0.01/3600      !: coefficients for conversion 
 
-   INTEGER  ::  nspyr         !: number of timestep per year
-
-#if defined key_cpl_carbon_cycle
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::  &
-      oce_co2            !: ocean carbon flux
-   REAL(wp) :: &
-      t_atm_co2_flx,  &  !: Total atmospheric carbon flux per year
-      t_oce_co2_flx      !: Total ocean carbon flux per year
-#endif
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::  oce_co2            !: ocean carbon flux 
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::  satmco2            !: atmospheric pco2
+   REAL(wp)                             ::  t_oce_co2_flx      !: Total ocean carbon flux 
+   REAL(wp)                             ::  t_atm_co2_flx      !: global mean of atmospheric pco2
+   REAL(wp)                             ::  area               !: ocean surface
 
    !!* Substitution
@@ -88,4 +84,8 @@
       !     SURFACE LAYER); THE RESULT OF THIS CALCULATION
       !     IS USED TO COMPUTE AIR-SEA FLUX OF CO2
+
+#if defined key_cpl_carbon_cycle
+      satmco2(:,:) = atm_co2(:,:)
+#endif
 
       DO jrorr = 1, 10
@@ -152,14 +152,9 @@
          DO ji = 1, jpi
             ! Compute CO2 flux for the sea and air
-#if ! defined key_cpl_carbon_cycle
-            zfld = atcco2 * tmask(ji,jj,1) * chemc(ji,jj,1) * zkgco2(ji,jj)
+            zfld = satmco2(ji,jj) * tmask(ji,jj,1) * chemc(ji,jj,1) * zkgco2(ji,jj)
             zflu = zh2co3(ji,jj) * tmask(ji,jj,1) * zkgco2(ji,jj)
-#else
-            zfld = atm_co2(ji,jj) * tmask(ji,jj,1) * chemc(ji,jj,1) * zkgco2(ji,jj)
-            zflu = zh2co3(ji,jj) * tmask(ji,jj,1) * zkgco2(ji,jj)
-            ! compute flux of carbon
             oce_co2(ji,jj) = ( zfld - zflu ) * rfact &
                &             * e1t(ji,jj) * e2t(ji,jj) * tmask(ji,jj,1) * 1000.
-#endif
+            ! compute the trend
             tra(ji,jj,1,jpdic) = tra(ji,jj,1,jpdic) + ( zfld - zflu ) / fse3t(ji,jj,1)
 
@@ -175,5 +170,5 @@
             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) = ( atcco2 - zh2co3(ji,jj) / ( chemc(ji,jj,1) + rtrn ) ) &
+            trc2d(ji,jj,jp_pcs0_2d + 3) = ( satmco2(ji,jj) - zh2co3(ji,jj) / ( chemc(ji,jj,1) + rtrn ) ) &
                &                            * tmask(ji,jj,1)
 #  else
@@ -181,8 +176,6 @@
             zoflx(ji,jj) = ( zfld16 - zflu16 ) * 1000. * tmask(ji,jj,1)
             zkg  (ji,jj) = zkgco2(ji,jj) * tmask(ji,jj,1)
-            zdpco2(ji,jj) = ( atcco2 - zh2co3(ji,jj)      / ( chemc(ji,jj,1) + rtrn ) ) &
-              &             * tmask(ji,jj,1)
-            zdpo2 (ji,jj) = ( atcox  - trn(ji,jj,1,jpoxy) / ( chemc(ji,jj,2) + rtrn ) ) &
-              &             * tmask(ji,jj,1)
+            zdpco2(ji,jj) = ( satmco2(ji,jj) - zh2co3(ji,jj) / ( chemc(ji,jj,1) + rtrn ) ) * tmask(ji,jj,1)
+            zdpo2 (ji,jj) = ( atcox  - trn(ji,jj,1,jpoxy) / ( chemc(ji,jj,2) + rtrn ) ) * tmask(ji,jj,1)
 #  endif
 #endif
@@ -190,35 +183,24 @@
       END DO
 
-#if defined key_cpl_carbon_cycle
-      ! Total Flux of Carbon
-      DO jj = 1, jpj 
-        DO ji = 1, jpi
-           t_atm_co2_flx = t_atm_co2_flx + atm_co2(ji,jj) * tmask_i(ji,jj)
-           t_oce_co2_flx = t_oce_co2_flx + oce_co2(ji,jj) * tmask_i(ji,jj)
-        END DO
-      END DO
-
-      IF( MOD( kt, nspyr ) == 0 ) THEN
-        IF( lk_mpp ) THEN
-          CALL mpp_sum( t_atm_co2_flx )   ! sum over the global domain
-          CALL mpp_sum( t_oce_co2_flx )   ! sum over the global domain
-        ENDIF
-        ! Conversion in GtC/yr ; negative for outgoing from ocean
-        t_oce_co2_flx = (-1.) * t_oce_co2_flx  * 12. / 1.e15
-        !
-        WRITE(numout,*) ' Atmospheric pCO2    :'
-        WRITE(numout,*) '-------------------- : ',kt,'  ',t_atm_co2_flx
-        WRITE(numout,*) '(ppm)'
-        WRITE(numout,*) 'Total Flux of Carbon out of the ocean :'
-        WRITE(numout,*) '-------------------- : ',t_oce_co2_flx
-        WRITE(numout,*) '(GtC/yr)'
-        t_atm_co2_flx = 0.
-        t_oce_co2_flx = 0.
-# if defined key_iomput
-        CALL iom_put( "tatpco2" , t_atm_co2_flx  )
-        CALL iom_put( "tco2flx" , t_oce_co2_flx  )
-#endif
+      t_oce_co2_flx = t_oce_co2_flx + SUM( oce_co2(:,:) * tmask_i(:,:) )           ! Cumulative Total Flux of Carbon
+      IF( kt == nitend ) THEN
+         t_atm_co2_flx = SUM( satmco2(:,:) * e1t(:,:) * e2t(:,:) * tmask_i(:,:) )  ! Total atmospheric pCO2
+         !
+         IF( lk_mpp ) THEN                                                         ! sum over the global domain
+           CALL mpp_sum( t_atm_co2_flx )   
+           CALL mpp_sum( t_oce_co2_flx )   
+         ENDIF
+         t_oce_co2_flx = (-1.) * t_oce_co2_flx  * 12. / 1.e15                      ! Conversion in PgC ; negative for out of the ocean
+         t_atm_co2_flx = t_atm_co2_flx  / area                                     ! global mean of atmospheric pCO2
+         !
+         IF( lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) ' Global mean of atmospheric pCO2 (ppm) at it= ', kt, ' date= ', ndastp, ' : ',t_atm_co2_flx
+            WRITE(numout,*) 
+            WRITE(numout,*) ' Cumulative total Flux of Carbon out of the ocean (PgC) :' , t_oce_co2_flx
+            WRITE(numout,*) 
+         ENDIF
+         !
       ENDIF
-#endif
 
       IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
@@ -263,13 +245,14 @@
       ENDIF
 
-      ! number of time step per year  
-      nspyr = INT( nyear_len(1) * rday / rdt )
-
-#if defined key_cpl_carbon_cycle
+      ! interior global domain surface
+      area = SUM( e1t(:,:) * e2t(:,:) * tmask_i(:,:) )
+      IF( lk_mpp ) CALL mpp_sum( area )
+
       ! Initialization of Flux of Carbon
       oce_co2(:,:) = 0.
       t_atm_co2_flx = 0.
+      ! Initialisation of atmospheric pco2
+      satmco2(:,:) = atcco2
       t_oce_co2_flx = 0.
-#endif
 
    END SUBROUTINE p4z_flx_init
Index: /branches/CMIP5_IPSL/NEMO/TOP_SRC/PISCES/p4zprod.F90
===================================================================
--- /branches/CMIP5_IPSL/NEMO/TOP_SRC/PISCES/p4zprod.F90	(revision 2503)
+++ /branches/CMIP5_IPSL/NEMO/TOP_SRC/PISCES/p4zprod.F90	(revision 2504)
@@ -49,6 +49,4 @@
       rpis180                    ,  &  !: rpi / 180
       tpp                              !: Total primary production
-
-   INTEGER  ::  nspyr                  !: number of timesteps per year
 
    !!* Substitution
@@ -347,11 +345,9 @@
       END DO
 
-
-      IF( MOD( kt, nspyr ) == 0 .AND. jnt == nrdttrc ) THEN
+     IF( kt == nitend .AND. jnt == nrdttrc ) THEN
         IF( lk_mpp ) CALL mpp_sum( tpp )
-        WRITE(numout,*) 'Total PP :'
+        WRITE(numout,*) 'Total PP (Gtc) :'
         WRITE(numout,*) '-------------------- : ',tpp * 12. / 1.E12
-        WRITE(numout,*) '(GtC/yr)'
-        tpp = 0.
+        WRITE(numout,*)
       ENDIF
 
@@ -469,7 +465,4 @@
       ENDIF
 
-      ! number of timesteps per year
-      nspyr  = INT( nyear_len(1) * rday / rdt )
-
       rpis180   = rpi / 180.
       texcret   = 1.0 - excret
