Index: /branches/ORCHIDEE_2_2/ORCHIDEE/src_sechiba/intersurf.f90
===================================================================
--- /branches/ORCHIDEE_2_2/ORCHIDEE/src_sechiba/intersurf.f90	(revision 6159)
+++ /branches/ORCHIDEE_2_2/ORCHIDEE/src_sechiba/intersurf.f90	(revision 6160)
@@ -195,6 +195,6 @@
     REAL(r_std),DIMENSION (kjpindex)                      :: zcoastal      !! Work array to keep coastalflow (m^3/dt)
     REAL(r_std),DIMENSION (kjpindex)                      :: zriver        !! Work array to keep riverflow (m^3/dt)
-    REAL(r_std),DIMENSION (kjpindex)                      :: znetco2       !! Work array to keep netco2flux
-    REAL(r_std),DIMENSION (kjpindex)                      :: zcarblu       !! Work array to keep fco2_land_use
+    REAL(r_std),DIMENSION (kjpindex)                      :: znetco2       !! Work array to keep netco2flux (gC/m2/dt_sechiba)
+    REAL(r_std),DIMENSION (kjpindex)                      :: zcarblu       !! Work array to keep fco2_land_use (gC/m2/one_day)
     REAL(r_std),DIMENSION (kjpindex)                      :: ztsol_rad     !! Work array to keep tsol_rad
     REAL(r_std),DIMENSION (kjpindex)                      :: zvevapp       !! Work array to keep vevapp
@@ -500,6 +500,6 @@
     REAL(r_std),DIMENSION (kjpindex)                      :: zcoastal      !! Work array to keep coastalflow (m^3/dt)
     REAL(r_std),DIMENSION (kjpindex)                      :: zriver        !! Work array to keep riverflow (m^3/dt)
-    REAL(r_std),DIMENSION (kjpindex)                      :: znetco2       !! Work array to keep netco2flux
-    REAL(r_std),DIMENSION (kjpindex)                      :: zcarblu       !! Work array to keep fco2_land_use
+    REAL(r_std),DIMENSION (kjpindex)                      :: znetco2       !! Work array to keep netco2flux (gC/m2/dt_sechiba)
+    REAL(r_std),DIMENSION (kjpindex)                      :: zcarblu       !! Work array to keep fco2_land_use (gC/m2/one_day)
     REAL(r_std),DIMENSION (kjpindex)                      :: ztsol_rad     !! Work array to keep tsol_rad
     REAL(r_std),DIMENSION (kjpindex)                      :: zvevapp       !! Work array to keep vevapp
@@ -624,4 +624,7 @@
     CALL xios_orchidee_send_field("swdown",zswdown)
     CALL xios_orchidee_send_field("pb",zpb)
+    CALL xios_orchidee_send_field("zcarblu",zcarblu/1e3/one_day)    ! gC/m2/one_day -> kgC/m2/s
+    CALL xios_orchidee_send_field("znetco2",znetco2/1e3/dt_sechiba) ! gC/m2/dt_sechiba -> kgC/m2/s
+
     
     IF ( .NOT. almaoutput ) THEN
@@ -879,6 +882,6 @@
     REAL(r_std),DIMENSION (kjpindex)                      :: zcoastal      !! Work array to keep coastal flow
     REAL(r_std),DIMENSION (kjpindex)                      :: zriver        !! Work array to keep river out flow
-    REAL(r_std),DIMENSION (kjpindex)                      :: znetco2       !! Work array to keep netco2flux
-    REAL(r_std),DIMENSION (kjpindex)                      :: zcarblu       !! Work array to keep fco2_land_use
+    REAL(r_std),DIMENSION (kjpindex)                      :: znetco2       !! Work array to keep netco2flux (gC/m2/dt_sechiba) 
+    REAL(r_std),DIMENSION (kjpindex)                      :: zcarblu       !! Work array to keep fco2_land_use (gC/m2/one_day)
     REAL(r_std),DIMENSION (kjpindex)                      :: ztsol_rad     !! Work array to keep tsol_rad
     REAL(r_std),DIMENSION (kjpindex)                      :: zvevapp       !! Work array to keep vevapp
@@ -1333,6 +1336,6 @@
     REAL(r_std),DIMENSION (kjpindex)                      :: zcoastal      !! Work array to keep coastal flow
     REAL(r_std),DIMENSION (kjpindex)                      :: zriver        !! Work array to keep river out flow
-    REAL(r_std),DIMENSION (kjpindex)                      :: znetco2       !! Work array to keep netco2flux
-    REAL(r_std),DIMENSION (kjpindex)                      :: zcarblu       !! Work array to keep fco2_land_use
+    REAL(r_std),DIMENSION (kjpindex)                      :: znetco2       !! Work array to keep netco2flux (gC/m2/dt_sechiba)
+    REAL(r_std),DIMENSION (kjpindex)                      :: zcarblu       !! Work array to keep fco2_land_use (gC/m2/one_day)
     REAL(r_std),DIMENSION (kjpindex)                      :: ztsol_rad     !! Work array to keep tsol_rad
     REAL(r_std),DIMENSION (kjpindex)                      :: zvevapp       !! Work array to keep vevapp
@@ -1487,9 +1490,11 @@
              SELECT CASE(TRIM(field_in_names_loc(i)))
              CASE("fCO2_nep")
-                fields_in(ik,i) = znetco2(ik)
+                ! Transform from gC/m2/dt_sechiba into kgC/m2/s
+                fields_in(ik,i) = znetco2(ik)/1e3/dt_sechiba
              CASE("fCO2_fLuc")
-                fields_in(ik,i) = zcarblu(ik)
+                ! Transform from gC/m2/one_day into kgC/m2/s
+                fields_in(ik,i) = zcarblu(ik)/1e3/one_day 
              CASE("fCO2_nbp")
-                fields_in(ik,i) = znetco2(ik) + zcarblu(ik)
+                fields_in(ik,i) = znetco2(ik)/1e3/dt_sechiba + zcarblu(ik)/1e3/one_day 
              CASE DEFAULT
                 CALL ipslerr_p (3,'intersurf_main_gathered', &
@@ -1526,5 +1531,6 @@
     CALL xios_orchidee_send_field("riverflow_cpl",riverflow_cpl)
     CALL xios_orchidee_send_field("coastalflow_cpl",coastalflow_cpl)
-    
+    CALL xios_orchidee_send_field("zcarblu",zcarblu/1e3/one_day)    ! gC/m2/one_day -> kgC/m2/s
+    CALL xios_orchidee_send_field("znetco2",znetco2/1e3/dt_sechiba) ! gC/m2/dt_sechiba -> kgC/m2/s
     
     IF ( .NOT. almaoutput ) THEN
Index: /branches/ORCHIDEE_2_2/ORCHIDEE/src_sechiba/sechiba.f90
===================================================================
--- /branches/ORCHIDEE_2_2/ORCHIDEE/src_sechiba/sechiba.f90	(revision 6159)
+++ /branches/ORCHIDEE_2_2/ORCHIDEE/src_sechiba/sechiba.f90	(revision 6160)
@@ -210,5 +210,5 @@
   REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:,:)  :: evap_bare_lim_ns !! Bare soil stress
 !$OMP THREADPRIVATE(evap_bare_lim_ns)
-  REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:,:)  :: co2_flux       !! CO2 flux (gC/m**2 of average ground/s)
+  REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:,:)  :: co2_flux       !! CO2 flux (gC/m**2 of average ground/dt_sechiba)
 !$OMP THREADPRIVATE(co2_flux)
   REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:,:)  :: co2_to_bm      !! virtual CO2 flux (gC/m**2 of average ground/s)
@@ -407,7 +407,7 @@
     REAL(r_std),DIMENSION (kjpindex), INTENT (out)           :: emis_out          !! Emissivity (unitless)
     REAL(r_std),DIMENSION (kjpindex), INTENT (out)           :: netco2flux        !! Sum CO2 flux over PFTs 
-                                                                                  !! ??(gC m^{-2} s^{-1})??
+                                                                                  !! (gC/m2/dt_sechiba)
     REAL(r_std),DIMENSION (kjpindex), INTENT (out)           :: fco2_lu           !! Land Cover Change CO2 flux 
-                                                                                  !! ??(gC m^{-2} s^{-1})??
+                                                                                  !! (gC/m2/one_day )
     REAL(r_std),DIMENSION (kjpindex), INTENT (out)           :: temp_sol_new      !! New ground temperature (K)
 
@@ -662,7 +662,7 @@
     REAL(r_std),DIMENSION (kjpindex), INTENT (out)           :: emis_out          !! Emissivity (unitless)
     REAL(r_std),DIMENSION (kjpindex), INTENT (out)           :: netco2flux        !! Sum CO2 flux over PFTs 
-                                                                                  !! ??(gC m^{-2} s^{-1})??
+                                                                                  !! (gC/m2/dt_sechiba)
     REAL(r_std),DIMENSION (kjpindex), INTENT (out)           :: fco2_lu           !! Land Cover Change CO2 flux 
-                                                                                  !! ??(gC m^{-2} s^{-1})??
+                                                                                  !! (gC/m2/one_day)
     REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (out)       :: veget_out         !! Fraction of vegetation type (unitless, 0-1)
     REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (out)       :: lai_out           !! Leaf area index (m^2 m^{-2}) 
Index: /branches/ORCHIDEE_2_2/ORCHIDEE/src_stomate/stomate.f90
===================================================================
--- /branches/ORCHIDEE_2_2/ORCHIDEE/src_stomate/stomate.f90	(revision 6159)
+++ /branches/ORCHIDEE_2_2/ORCHIDEE/src_stomate/stomate.f90	(revision 6160)
@@ -430,4 +430,8 @@
                                                                          !! dimension(#pixels,0:100)
 !$OMP THREADPRIVATE(flux100)
+  REAL(r_std),ALLOCATABLE,SAVE,DIMENSION(:)      :: fco2_lu              !! CO2 flux between atmosphere and biosphere from land-use 
+                                                                         !! (without forest management)
+                                                                         !! @tex $(gC m^{-2} one_day^{-1})$ @endtex
+!$OMP THREADPRIVATE(fco2_lu)
   REAL(r_std),ALLOCATABLE,SAVE,DIMENSION(:)      :: convflux             !! Release during first year following land cover change 
                                                                          !! (paper, burned, etc...) 
@@ -626,5 +630,5 @@
          contfrac,       totfrac_nobio,     clay,         temp_air,          &
          lai,            veget,             veget_max,                       &
-         co2_flux,       co2_to_bm_radia,   fco2_lu,      deadleaf_cover,  assim_param, temp_growth )
+         co2_flux,       co2_to_bm_radia,   fco2_lu_out,  deadleaf_cover,  assim_param, temp_growth )
 
     IMPLICIT NONE
@@ -654,5 +658,5 @@
     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: co2_flux          !! CO2 flux between atmosphere and biosphere
     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: co2_to_bm_radia   !! virtual gpp flux between atmosphere and biosphere
-    REAL(r_std),DIMENSION(kjpindex),INTENT(out)     :: fco2_lu           !! CO2 flux between atmosphere and biosphere from land-use (without forest management)  
+    REAL(r_std),DIMENSION(kjpindex),INTENT(out)     :: fco2_lu_out       !! CO2 flux between atmosphere and biosphere from land-use (without forest management)  
     REAL(r_std),DIMENSION(kjpindex),INTENT(out)     :: deadleaf_cover    !! Fraction of soil covered by dead leaves (unitless)
     REAL(r_std),DIMENSION(kjpindex,nvm,npco2),INTENT(out) :: assim_param !! min+max+opt temperatures (K) & vmax for photosynthesis  
@@ -760,8 +764,6 @@
     
     !! 1.4.3.1 Read initial values for STOMATE's variables from the _restart_ file
-    ! ??Shouldn't this be included in stomate_init?? Looks like an initialization!
     co2_flux(:,:) = zero
-    fco2_lu(:) = zero
-    
+
     ! Get values from _restart_ file. Note that only ::kjpindex, ::index, ::lalo 
     ! and ::resolution are input variables, all others are output variables.
@@ -793,4 +795,5 @@
          litterpart, litter, dead_leaves, &
          carbon, lignin_struc,turnover_time,&
+         fco2_lu,&
          prod10,prod100,flux10, flux100, &
          convflux, cflux_prod10, cflux_prod100, &
@@ -804,4 +807,7 @@
          MatrixV, VectorU, previous_stock, current_stock, assim_param)
     
+    ! Copy module variable fco2_lu into local variable to allow it to be in the argument output list of the subroutine
+    fco2_lu_out(:)=fco2_lu(:)
+
     !! 1.4.5 Check time step
        
@@ -1155,5 +1161,5 @@
 !! MAIN OUTPUT VARIABLE(S): deadleaf_cover, assim_param, lai, height, veget, 
 !! veget_max, resp_maint, 
-!! resp_hetero,resp_growth, co2_flux, fco2_lu.
+!! resp_hetero,resp_growth, co2_flux, fco2_lu_out.
 !!
 !! REFERENCES	: 
@@ -1177,5 +1183,5 @@
        &  veget_max_new, woodharvest, totfrac_nobio_new, fraclut, &
        &  rest_id_stom, hist_id_stom, hist_id_stom_IPCC, &
-       &  co2_flux, fco2_lu, resp_maint,resp_hetero,resp_growth,co2_to_bm_radia,temp_growth)
+       &  co2_flux, fco2_lu_out, resp_maint,resp_hetero,resp_growth,co2_to_bm_radia,temp_growth)
     
     IMPLICIT NONE
@@ -1232,10 +1238,8 @@
     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: co2_flux          !! CO2 flux between atmosphere and biosphere per 
                                                                          !! average ground area 
-                                                                         !! @tex $(gC m^{-2} dt_stomate^{-1})$ @endtex  
-                                                                         !! [??CHECK] sign convention? 
-    REAL(r_std),DIMENSION(kjpindex),INTENT(out)     :: fco2_lu           !! CO2 flux between atmosphere and biosphere from 
+                                                                         !! @tex $(gC m^{-2} dt_sechiba^{-1})$ @endtex  
+    REAL(r_std),DIMENSION(kjpindex),INTENT(out)     :: fco2_lu_out       !! CO2 flux between atmosphere and biosphere from 
                                                                          !! land-use (without forest management)  
                                                                          !! @tex $(gC m^{-2} dt_stomate^{-1})$ @endtex  
-                                                                         !! [??CHECK] sign convention? 
     REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: resp_maint        !! Maitenance component of autotrophic respiration in 
                                                                          !! @tex $(gC m^{-2} dt_stomate^{-1})$ @endtex 
@@ -1864,5 +1868,9 @@
     
     temp_growth(:)=t2m_month(:)-tp_00 
-   
+
+    ! Copy module variable fco2_lu into local variable to allow it to be in the argument output list of the subroutine
+    fco2_lu_out(:)=fco2_lu(:)
+
+
   !! 7. Analytical spinup
 
@@ -2115,4 +2123,5 @@
          litterpart, litter, dead_leaves, &
          carbon, lignin_struc,turnover_time,&
+         fco2_lu,&
          prod10,prod100,flux10, flux100, &
          convflux, cflux_prod10, cflux_prod100, &
@@ -3071,4 +3080,11 @@
     ENDIF
 
+    ALLOCATE (fco2_lu(kjpindex), stat=ier)
+    l_error = l_error .OR. (ier /= 0)
+    IF (l_error) THEN
+       WRITE(numout,*) 'Memory allocation error for fco2_lu. We stop. We need kjpindex words',kjpindex
+       STOP 'stomate_init'
+    ENDIF
+
     ALLOCATE (prod10(kjpindex,0:10), stat=ier)
     l_error = l_error .OR. (ier /= 0)
@@ -3578,4 +3594,5 @@
     IF ( ALLOCATED (horip11_index)) DEALLOCATE (horip11_index)
     IF ( ALLOCATED (horip101_index)) DEALLOCATE (horip101_index)
+    IF ( ALLOCATED (fco2_lu)) DEALLOCATE (fco2_lu)
     IF ( ALLOCATED (prod10)) DEALLOCATE (prod10)
     IF ( ALLOCATED (prod100)) DEALLOCATE (prod100)
Index: /branches/ORCHIDEE_2_2/ORCHIDEE/src_stomate/stomate_io.f90
===================================================================
--- /branches/ORCHIDEE_2_2/ORCHIDEE/src_stomate/stomate_io.f90	(revision 6159)
+++ /branches/ORCHIDEE_2_2/ORCHIDEE/src_stomate/stomate_io.f90	(revision 6160)
@@ -80,4 +80,5 @@
        &  litterpart, litter, dead_leaves, &
        &  carbon, lignin_struc,turnover_time, &
+       &  fco2_lu, &
        &  prod10,prod100,flux10, flux100, &
        &  convflux, cflux_prod10, cflux_prod100, &
@@ -326,4 +327,5 @@
     ! products remaining in the 10/100 year-turnover pool after the annual release for each compartment
     ! (10 or 100 + 1 : input from year of land cover change)
+    REAL(r_std),DIMENSION(npts),INTENT(out)                                :: fco2_lu
     REAL(r_std),DIMENSION(npts,0:10),INTENT(out)                           :: prod10
     REAL(r_std),DIMENSION(npts,0:100),INTENT(out)                          :: prod100
@@ -1031,4 +1033,10 @@
     ! 18 land cover change
     !-
+    ! Read from restart file or set to zero if the variables or restart file were not found
+    var_name = 'fco2_lu'
+    CALL restget_p (rest_id_stomate, var_name, nbp_glo, 1, 1, itime, &
+         .TRUE., fco2_lu, 'gather', nbp_glo, index_g)
+    IF (ALL(fco2_lu(:) == val_exp)) fco2_lu(:) = zero
+       
     IF (vegetmap_reset) THEN
        ! Reset vegetation map related variables instead of reading from restart file
@@ -1324,4 +1332,5 @@
        &  litterpart, litter, dead_leaves, &
        &  carbon, lignin_struc, turnover_time, &
+       &  fco2_lu, &
        &  prod10,prod100 ,flux10, flux100, &
        &  convflux, cflux_prod10, cflux_prod100, & 
@@ -1561,4 +1570,5 @@
     ! products remaining in the 10/100 year-turnover pool after the annual release for each compartment
     ! (10 or 100 + 1 : input from year of land cover change)
+    REAL(r_std),DIMENSION(npts),INTENT(in)                                :: fco2_lu
     REAL(r_std),DIMENSION(npts,0:10),INTENT(in)                           :: prod10
     REAL(r_std),DIMENSION(npts,0:100),INTENT(in)                          :: prod100
@@ -2064,4 +2074,7 @@
     ! 18 land cover change
     !-
+    var_name = 'fco2_lu'
+    CALL restput_p (rest_id_stomate, var_name, nbp_glo, 1, 1, itime, &
+         &                fco2_lu, 'scatter', nbp_glo, index_g)
     var_name = 'prod10'
     CALL restput_p (rest_id_stomate, var_name, nbp_glo, 11, 1, itime, &
Index: /branches/ORCHIDEE_2_2/ORCHIDEE/src_xml/field_def_orchidee.xml
===================================================================
--- /branches/ORCHIDEE_2_2/ORCHIDEE/src_xml/field_def_orchidee.xml	(revision 6159)
+++ /branches/ORCHIDEE_2_2/ORCHIDEE/src_xml/field_def_orchidee.xml	(revision 6160)
@@ -360,4 +360,6 @@
     <field id="mrro_lut" name="mrroLut" long_name="Total runoff from land use tile" unit="kg m-2 s-1" grid_ref="grid_nlut"/>
     <field id="gpplut" name="gppLut" long_name="Gross primary productivity on Landuse tiles" unit="kgC m-2 s-1" grid_ref="grid_nlut" />
+    <field id="zcarblu" name="zcarblu" long_name="Land Cover Change CO2 flux (variable in interface to LMDZ)" unit="kgC m-2 s-1" />
+    <field id="znetco2" name="znetco2" long_name="Sum CO2 flux over PFTs (variable in interface to LMDZ)" unit="kgC m-2 s-1" />
   </field_group>
 
Index: /branches/ORCHIDEE_2_2/ORCHIDEE/src_xml/file_def_orchidee.xml
===================================================================
--- /branches/ORCHIDEE_2_2/ORCHIDEE/src_xml/file_def_orchidee.xml	(revision 6159)
+++ /branches/ORCHIDEE_2_2/ORCHIDEE/src_xml/file_def_orchidee.xml	(revision 6160)
@@ -348,4 +348,6 @@
     <field field_ref="snowtemp_read_current" grid_ref="grid_nsnow_out"  level="12"/>
     <field field_ref="mask_snow_interp_out" grid_ref="grid_nsnow_out"  level="12"/>
+    <field field_ref="zcarblu" level="12" />
+    <field field_ref="znetco2" level="12" />
    </field_group>
   </file>
