Index: /trunk/LMDZ.COMMON/libf/evolution/adsorption_mod.F90
===================================================================
--- /trunk/LMDZ.COMMON/libf/evolution/adsorption_mod.F90	(revision 2984)
+++ /trunk/LMDZ.COMMON/libf/evolution/adsorption_mod.F90	(revision 2985)
@@ -36,5 +36,5 @@
   subroutine regolith_adsorption(ngrid,nslope,nsoil_PEM,timelen,tend_h2oglaciers,tend_co2glaciers,waterice,co2ice,tsoil_PEM,TI_PEM,ps,q_co2,q_h2o, &
                                 m_h2o_completesoil,delta_mh2oreg, m_co2_completesoil,delta_mco2reg)
-#ifndef CPP_STD
+
 ! inputs
  INTEGER,INTENT(IN) :: ngrid, nslope, nsoil_PEM,timelen ! size dimension: physics x subslope x soil x timeseries
@@ -59,4 +59,5 @@
 ! -------------
 
+
 ! Compute H2O adsorption, then CO2 adsorption
 
@@ -68,5 +69,4 @@
                                                           tsoil_PEM,TI_PEM,m_co2_completesoil,delta_mco2reg)
 
-#endif
    RETURN
   end subroutine
@@ -85,7 +85,6 @@
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-#ifndef CPP_STD
       use comsoil_h_PEM, only: layer_PEM, mlayer_PEM,index_breccia,index_bedrock
-      USE comcstfi_h, only:  pi 
+      USE comconst_mod, only:  pi 
       use comslope_mod, only : subslope_dist,def_slope_mean
       use vertical_layers_mod, ONLY: ap,bp
@@ -93,5 +92,5 @@
                                       m_h2o,m_co2,m_noco2, & 
                                       rho_regolith
-#endif
+
 
  implicit none
@@ -123,7 +122,5 @@
 
  ! local variables
-#ifndef CPP_STD
  REAL :: deltam_reg_complete(ngrid,index_breccia,nslope)         ! Difference in the mass per slope and soil layer (kg/m^3)
-#endif
  real :: K                        ! Used to compute theta
  integer ig,iloop, islope,isoil,it   ! for loops
@@ -140,5 +137,5 @@
 
 ! 0. Some initializations
-#ifndef CPP_STD
+
 
      allocate(mass_mean(ngrid,timelen))
@@ -150,4 +147,6 @@
      theta_h2o_adsorbded(:,:,:) = 0.
      dm_h2o_regolith_slope(:,:,:) = 0.
+
+#ifndef CPP_STD
 
 !0.1 Look at perenial ice
@@ -184,7 +183,9 @@
      pvapor(:,:) = mass_mean(:,:)/m_h2o*q_h2o(:,:)*zplev_mean(:,:)
      pvapor_avg(:) = sum(pvapor(:,:),2)/timelen
+#endif
      deallocate(pvapor)
      deallocate(zplev_mean)
      deallocate(mass_mean)
+#ifndef CPP_STD
 
 ! 1. we compute the mass of H2O adsorded in each layer of the meshes  
@@ -240,11 +241,10 @@
   SUBROUTINE regolith_co2adsorption(ngrid,nslope,nsoil_PEM,timelen,tend_h2oglaciers,tend_co2glaciers,waterice,co2ice,ps,q_co2,q_h2o,&
                                    tsoil_PEM,TI_PEM,m_co2_completesoil,delta_mreg)
-#ifndef CPP_STD
+
       use comsoil_h_PEM, only: layer_PEM, mlayer_PEM,index_breccia,index_bedrock,index_breccia
-      USE comcstfi_h, only: pi
+      USE comconst_mod, only: pi
       use comslope_mod, only : subslope_dist,def_slope_mean
       use vertical_layers_mod, ONLY: ap,bp
       use constants_marspem_mod, only: m_co2, m_noco2,rho_regolith
-#endif
 
       IMPLICIT NONE
@@ -278,7 +278,5 @@
  INTEGER :: ispermanent_co2glaciers(ngrid,nslope)        ! Check if the co2 glacier is permanent
  INTEGER :: ispermanent_h2oglaciers(ngrid,nslope)        ! Check if the h2o glacier is permanent
-#ifndef CPP_STD
  REAL :: deltam_reg_complete(ngrid,index_breccia,nslope)         ! Difference in the mass per slope and soil layer (kg/m^3)
-#endif
  REAL :: deltam_reg_slope(ngrid,nslope)                  ! Difference in the mass per slope  (kg/m^3)
  REAL :: m_h2o_adsorbed(ngrid,nsoil_PEM,nslope)          ! Density of CO2 adsorbed (kg/m^3)
@@ -298,5 +296,5 @@
      allocate(pco2_avg(ngrid))
 
-#ifndef CPP_STD
+
   
       m_h2o_adsorbed(:,:,:) = 0.
@@ -306,4 +304,6 @@
      dm_co2_regolith_slope(:,:,:) = 0
      delta_mreg(:) = 0.
+
+#ifndef CPP_STD
 
 !0.1 Look at perenial ice
Index: /trunk/LMDZ.COMMON/libf/evolution/co2glaciers_mod.F90
===================================================================
--- /trunk/LMDZ.COMMON/libf/evolution/co2glaciers_mod.F90	(revision 2984)
+++ /trunk/LMDZ.COMMON/libf/evolution/co2glaciers_mod.F90	(revision 2985)
@@ -63,6 +63,5 @@
 subroutine compute_hmaxglaciers_co2(ngrid,nslope,iflat,Tcond,def_slope_mean,hmax)
 
-     USE comconst_mod, ONLY: pi
-     use comcstfi_h, only: g
+     USE comconst_mod, ONLY: pi,g
 
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Index: /trunk/LMDZ.COMMON/libf/evolution/ice_table_mod.F90
===================================================================
--- /trunk/LMDZ.COMMON/libf/evolution/ice_table_mod.F90	(revision 2984)
+++ /trunk/LMDZ.COMMON/libf/evolution/ice_table_mod.F90	(revision 2985)
@@ -51,5 +51,4 @@
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     use math_mod,only: findroot
-#ifndef CPP_STD
     USE comsoil_h_PEM, only: mlayer_PEM,layer_PEM                  ! Depth of the vertical grid 
     USE soil_thermalproperties_mod, only: ice_thermal_properties
@@ -134,5 +133,4 @@
 
       RETURN
-#endif
       END
 
Index: /trunk/LMDZ.COMMON/libf/evolution/pem.F90
===================================================================
--- /trunk/LMDZ.COMMON/libf/evolution/pem.F90	(revision 2984)
+++ /trunk/LMDZ.COMMON/libf/evolution/pem.F90	(revision 2985)
@@ -30,8 +30,16 @@
 PROGRAM pem
 
-!module needed for INITIALISATION
+! 1: Modules needed for reading and writting startfi:
+      use phyetat0_mod, only: phyetat0
+      use phyredem,     only: physdem0, physdem1
+      use netcdf,       only: nf90_open,NF90_NOWRITE,nf90_noerr,nf90_strerror, &
+                         nf90_get_var, nf90_inq_varid, nf90_inq_dimid, &
+                         nf90_inquire_dimension,nf90_close
+      ! netcdf is needed to read info like lat and lon in the physiq file
+      use turb_mod,     only: q2, wstar
+! 1a: Modules specific from the Marsian physiq
 #ifndef CPP_STD
-      use comsoil_h, only: tsoil, nsoilmx, ini_comsoil_h,inertiedat, mlayer,volcapa,inertiesoil
-      use surfdat_h, only: tsurf, emis,&
+      use comsoil_h,    only: tsoil, nsoilmx, ini_comsoil_h,inertiedat, mlayer,volcapa,inertiesoil
+      use surfdat_h,    only: tsurf, emis,&
                            qsurf,watercap, ini_surfdat_h, &
                            albedodat, zmea, zstd, zsig, zgam, zthe, &
@@ -40,69 +48,66 @@
       use dimradmars_mod, only: totcloudfrac, albedo
       use dust_param_mod, only: tauscaling
-      use tracer_mod, only: noms,igcm_h2o_ice,igcm_co2 ! tracer names
-#else
-      use comsoil_h, only: nsoilmx, ini_comsoil_h,inertiedat, mlayer,volcapa
-      use surfdat_h, only: albedodat, zmea, zstd, zsig, zgam, zthe, &
+      use tracer_mod,     only: noms,igcm_h2o_ice,igcm_co2 ! tracer names
+#else 
+! 1b: Modules specific from the Generic physiq
+      use comsoil_h,    only: nsoilmx, ini_comsoil_h,inertiedat, mlayer,volcapa
+      use surfdat_h,    only: albedodat, zmea, zstd, zsig, zgam, zthe, &
                            emissiv
-      use tracer_h, only: noms,igcm_h2o_ice,igcm_co2 ! tracer names
-      use phys_state_var_mod
-#endif
-      use phyetat0_mod, only: phyetat0
-      use phyredem, only: physdem0, physdem1
-      use turb_mod, only: q2, wstar
-      use netcdf, only: nf90_open,NF90_NOWRITE,nf90_noerr,nf90_strerror, &
-                        nf90_get_var, nf90_inq_varid, nf90_inq_dimid, &
-                        nf90_inquire_dimension,nf90_close
+      use tracer_h,     only: noms,igcm_h2o_ice,igcm_co2 ! tracer names
+      use phys_state_var_mod, only: cloudfrac, totcloudfrac, albedo_snow_SPECTV,HICE,RNAT, &
+                                    PCTSRF_SIC, TSLAB, TSEA_ICE, SEA_ICE,          &
+                                    ALBEDO_BAREGROUND,ALBEDO_CO2_ICE_SPECTV, phys_state_var_init
+      use aerosol_mod,  only : iniaerosol
+#endif
+! 1c: Modules specific from the 1d marsian physiq
 #ifndef CPP_1D
       USE iniphysiq_mod, ONLY: iniphysiq
-! For phyredem :
-      USE control_mod, ONLY: iphysiq, day_step,nsplit_phys
+      USE control_mod,   ONLY: iphysiq, day_step,nsplit_phys
 #else
       use time_phylmdz_mod, only: daysec, iphysiq,day_step
 #endif
-      USE logic_mod, ONLY: iflag_phys
+
 #ifndef CPP_STD
       use mod_phys_lmdz_para, only: is_parallel, is_sequential, &
                                    is_mpi_root, is_omp_root,    &
                                    is_master
-      use planete_h, only: aphelie, periheli, year_day, peri_day, &
+      use planete_h,     only: aphelie, periheli, year_day, peri_day, &
                           obliquit
 #else
-!      USE comcstfi_mod, ONLY: rad,g,r,cpp,pi
-!      USE inifis_mod, ONLY: inifis
-      use planete_mod, only: apoastr, periastr, year_day, peri_day, &
+      use planete_mod,   only: apoastr, periastr, year_day, peri_day, &
                           obliquit
 #endif
-      USE mod_const_mpi, ONLY: COMM_LMDZ
-      USE comslope_mod, ONLY: nslope,def_slope,def_slope_mean, &
+
+      USE comslope_mod,  ONLY: nslope,def_slope,def_slope_mean, &
                            subslope_dist,iflat,                &
                            major_slope,ini_comslope_h
+
+
+      USE logic_mod,        ONLY: iflag_phys
+      USE mod_const_mpi,    ONLY: COMM_LMDZ
       use time_phylmdz_mod, only: daysec,dtphys
-      USE comconst_mod, ONLY: rad,g,r,cpp,pi
+      USE comconst_mod,     ONLY: rad,g,r,cpp,pi
       USE infotrac
-      USE geometry_mod, only: latitude_deg 
-      use conf_pem_mod, only: conf_pem
-      use pemredem, only:  pemdem0,pemdem1
-      use co2glaciers_mod,only: co2glaciers_evol,co2glaciersflow
-      use criterion_pem_stop_mod,only: criterion_waterice_stop,criterion_co2_stop
-      use constants_marspem_mod,only: alpha_clap_co2,beta_clap_co2, alpha_clap_h2o,beta_clap_h2o, &
+      USE geometry_mod,     only: latitude_deg 
+
+      use conf_pem_mod,     only: conf_pem
+      use pemredem,         only:  pemdem0,pemdem1
+      use co2glaciers_mod,        only: co2glaciers_evol,co2glaciersflow
+      use criterion_pem_stop_mod, only: criterion_waterice_stop,criterion_co2_stop
+      use constants_marspem_mod,  only: alpha_clap_co2,beta_clap_co2, alpha_clap_h2o,beta_clap_h2o, &
                                       m_co2,m_noco2
       use evol_co2_ice_s_mod, only: evol_co2_ice_s
       use evol_h2o_ice_s_mod, only: evol_h2o_ice_s
-
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! SOIL
-      use comsoil_h_PEM, only: soil_pem,ini_comsoil_h_PEM,end_comsoil_h_PEM,nsoilmx_PEM, &
-                              TI_PEM,inertiedat_PEM,         &                        ! soil thermal inertia          
-                              tsoil_PEM, mlayer_PEM,layer_PEM,                  &     ! Soil temp, number of subsurface layers, soil mid layer depths
-                              fluxgeo, &                                              ! geothermal flux for the PEM and GCM
-                              water_reservoir                                         ! Water ressources
-      use adsorption_mod, only : regolith_adsorption,adsorption_pem, &                ! bool to check if adsorption, main subroutine
-                                 ini_adsorption_h_PEM, end_adsorption_h_PEM, &        ! allocate arrays                                
-                                 co2_adsorbded_phys, h2o_adsorbded_phys               ! mass of co2 and h2O adsorbded
-
-!!! For orbit parameters
-      USE temps_mod_evol, ONLY: dt_pem, evol_orbit_pem, Max_iter_pem
+      use comsoil_h_PEM,      only: soil_pem,ini_comsoil_h_PEM,end_comsoil_h_PEM,nsoilmx_PEM, &
+                               TI_PEM,inertiedat_PEM,         &                        ! soil thermal inertia          
+                               tsoil_PEM, mlayer_PEM,layer_PEM,                  &     ! Soil temp, number of subsurface layers, soil mid layer depths
+                               fluxgeo, &                                              ! geothermal flux for the PEM and GCM
+                               water_reservoir                                         ! Water ressources
+      use adsorption_mod,     only : regolith_adsorption,adsorption_pem, &                ! bool to check if adsorption, main subroutine
+                               ini_adsorption_h_PEM, end_adsorption_h_PEM, &        ! allocate arrays                                
+                               co2_adsorbded_phys, h2o_adsorbded_phys               ! mass of co2 and h2O adsorbded
+      USE temps_mod_evol,            ONLY: dt_pem, evol_orbit_pem, Max_iter_pem
       use orbit_param_criterion_mod, only : orbit_param_criterion
-      use recomp_orb_param_mod, only: recomp_orb_param
+      use recomp_orb_param_mod,      only: recomp_orb_param
       use ice_table_mod, only: porefillingice_depth,porefillingice_thickness,&
                                end_ice_table_porefilling,ini_ice_table_porefilling, &
@@ -111,8 +116,8 @@
 
 #ifdef CPP_1D
-      use regular_lonlat_mod, only: init_regular_lonlat
+      use regular_lonlat_mod,       only: init_regular_lonlat
       use physics_distribution_mod, only: init_physics_distribution
-      use mod_grid_phy_lmdz, only : regular_lonlat
-      use init_phys_1d_mod, only : init_phys_1d
+      use mod_grid_phy_lmdz,        only : regular_lonlat
+      use init_phys_1d_mod,         only : init_phys_1d
 #endif
 
@@ -147,5 +152,5 @@
   REAL ps(ip1jmp1)                       ! pression  au sol
 
-  REAL, dimension(:),allocatable :: ps_start_GCM !(ngrid)                       ! pression  au sol
+  REAL, dimension(:),allocatable :: ps_start_GCM    !(ngrid) pression  au sol
   REAL, dimension(:,:),allocatable :: ps_timeseries !(ngrid x timelen) ! pression  au sol instantannées
 
@@ -173,5 +178,5 @@
 
 ! Variable for h2o_ice evolution
-      REAL :: ini_surf_h2o
+      REAL :: ini_surf_h2o                                         ! Initial surface of sublimating h2o ice
       REAL :: ini_surf_co2                                         ! Initial surface of sublimating co2 ice
 
@@ -188,6 +193,6 @@
       LOGICAL :: STOPPING_1_water ! Logical : is there still water ice to sublimate?
       LOGICAL :: STOPPING_co2     ! Logical : is the criterion (% of change in the surface of sublimating water ice) reached?
-      LOGICAL :: STOPPING_pressure
-      INTEGER :: criterion_stop  ! which criterion is reached ? 1= h2o ice surf, 2 = co2 ice surf, 3 = ps, 4 = orb param
+      LOGICAL :: STOPPING_pressure! Logical : is the criterion (% of change in the surface pressure) reached?
+      INTEGER :: criterion_stop   ! which criterion is reached ? 1= h2o ice surf, 2 = co2 ice surf, 3 = ps, 4 = orb param
 
       real,save ::     A , B, mmean              ! Molar mass: intermediate A, B for computations of the  mean molar mass of the layer [mol/kg]
@@ -222,16 +227,16 @@
 
      REAL, ALLOCATABLE :: tsurf_ave(:,:)       ! Physic x SLOPE field : Averaged Surface Temperature [K]
-     REAL, ALLOCATABLE :: tsoil_ave(:,:,:)   ! Physic x SOIL x SLOPE field : Averaged Soil Temperature [K]
+     REAL, ALLOCATABLE :: tsoil_ave(:,:,:)     ! Physic x SOIL x SLOPE field : Averaged Soil Temperature [K]
      REAL, ALLOCATABLE :: tsurf_GCM_timeseries(:,:,:)    ! ngrid x SLOPE XTULES field : Surface Temperature in timeseries [K]
 
      REAL, ALLOCATABLE :: tsoil_phys_PEM_timeseries(:,:,:,:) !IG x SLOPE XTULES field : NOn averaged Soil Temperature [K]
-     REAL, ALLOCATABLE :: tsoil_GCM_timeseries(:,:,:,:)    !IG x SLOPE XTULES field : NOn averaged Soil Temperature [K]
-     REAL, ALLOCATABLE :: tsurf_ave_yr1(:,:) ! Physic x SLOPE field : Averaged Surface Temperature of first call of the gcm [K]
+     REAL, ALLOCATABLE :: tsoil_GCM_timeseries(:,:,:,:)      !IG x SLOPE XTULES field : NOn averaged Soil Temperature [K]
+     REAL, ALLOCATABLE :: tsurf_ave_yr1(:,:)                 ! Physic x SLOPE field : Averaged Surface Temperature of first call of the gcm [K]
 
      REAL,ALLOCATABLE  :: TI_locslope(:,:)    ! Physic x Soil: Intermediate thermal inertia  to compute Tsoil [SI]
      REAL,ALLOCATABLE  :: Tsoil_locslope(:,:) ! Physic x Soil: intermediate when computing Tsoil [K]
      REAL,ALLOCATABLE  :: Tsurf_locslope(:)   ! Physic x Soil: Intermediate surface temperature  to compute Tsoil [K]
-     REAL,ALLOCATABLE  :: watersoil_density_timeseries(:,:,:,:) ! Physic x Soil x Slope x Times water soil density, time series [kg /m^3]
-     REAL,ALLOCATABLE  :: watersurf_density_ave(:,:)            ! Physic  x Slope, water surface density, yearly averaged [kg/m^3]
+     REAL,ALLOCATABLE  :: watersoil_density_timeseries(:,:,:,:)     ! Physic x Soil x Slope x Times water soil density, time series [kg /m^3]
+     REAL,ALLOCATABLE  :: watersurf_density_ave(:,:)                ! Physic  x Slope, water surface density, yearly averaged [kg/m^3]
      REAL,ALLOCATABLE  :: watersoil_density_PEM_timeseries(:,:,:,:) ! Physic x Soil x Slope x Times, water soil density, time series [kg/m^3]
      REAL,ALLOCATABLE  :: watersoil_density_PEM_ave(:,:,:)          ! Physic x Soil x SLopes, water soil density, yearly averaged [kg/m^3]
@@ -252,17 +257,27 @@
 
 #ifdef CPP_STD
-!     INTEGER :: nsplit_phys=1
-!     LOGICAL :: iflag_phys=.true.
      REAL :: frost_albedo_threshold=0.05             ! frost albedo threeshold to convert fresh frost to old ice
      REAL :: albedo_h2o_frost                        ! albedo of h2o frost
-     REAL,ALLOCATABLE :: co2ice(:)                   ! Physics: co2 ice mesh averaged [kg/m^2]
+     REAL,allocatable :: tsurf_read_generic(:)       ! Temporary variable to do the subslope transfert dimensiion when reading form generic
+     REAL,allocatable :: qsurf_read_generic(:,:)     ! Temporary variable to do the subslope transfert dimensiion when reading form generic 
+     REAL,allocatable :: tsoil_read_generic(:,:)     ! Temporary variable to do the subslope transfert dimensiion when reading form generic
+     REAL,allocatable :: emis_read_generic(:)        ! Temporary variable to do the subslope transfert dimensiion when reading form generic
+     REAL,allocatable :: albedo_read_generic(:,:)    ! Temporary variable to do the subslope transfert dimensiion when reading form generic
+     REAL,allocatable :: tsurf(:,:)                  ! Subslope variable, only needed in the GENERIC case
+     REAL,allocatable :: qsurf(:,:,:)                ! Subslope variable, only needed in the GENERIC case
+     REAL,allocatable :: tsoil(:,:,:)                ! Subslope variable, only needed in the GENERIC case
+     REAL,allocatable :: emis(:,:)                   ! Subslope variable, only needed in the GENERIC case
+     REAL,allocatable :: watercap(:,:)               ! Subslope variable, only needed in the GENERIC case =0 no watercap in generic model
+     LOGICAL, allocatable :: WATERCAPTAG(:)          ! Subslope variable, only needed in the GENERIC case =false no watercaptag in generic model
+     REAL,allocatable :: albedo(:,:,:)               ! Subslope variable, only needed in the GENERIC case
+     REAL,allocatable :: inertiesoil(:,:,:)          ! Subslope variable, only needed in the GENERIC case
 #endif
 
 #ifdef CPP_1D
-INTEGER :: nsplit_phys
-integer,parameter:: jjm_value=jjm-1
-integer :: ierr
+  INTEGER :: nsplit_phys
+  integer,parameter:: jjm_value=jjm-1
+  integer :: ierr
 #else
-integer,parameter:: jjm_value=jjm
+  integer,parameter:: jjm_value=jjm
 #endif
 
@@ -449,17 +464,36 @@
          call initracer(ngrid,nq)
          call iniaerosol()
+         allocate(tsurf_read_generic(ngrid))
+         allocate(qsurf_read_generic(ngrid,nq))
+         allocate(tsoil_read_generic(ngrid,nsoilmx))
+         allocate(emis_read_generic(ngrid))
+         allocate(tsurf(ngrid,1))
+         allocate(qsurf(ngrid,nq,1))
+         allocate(tsoil(ngrid,nsoilmx,1))
+         allocate(emis(ngrid,1))
+         allocate(watercap(ngrid,1))
+         allocate(watercaptag(ngrid))
+         allocate(albedo_read_generic(ngrid,2))
+         allocate(albedo(ngrid,2,1))
+         allocate(inertiesoil(ngrid,nsoilmx,1))
          call phyetat0(.true.,                                 &
                        ngrid,nlayer,FILE_NAME,0,0,nsoilmx,nq,      &
-                       day_ini,time_phys,tsurf,tsoil,emis,q2,qsurf,   &
+                       day_ini,time_phys,tsurf_read_generic,tsoil_read_generic,emis_read_generic,q2,qsurf_read_generic,   &
                        cloudfrac,totcloudfrac,hice,                   &
                        rnat,pctsrf_sic,tslab, tsea_ice,sea_ice)
-         call surfini(ngrid,nq,qsurf,albedo,albedo_bareground,albedo_snow_SPECTV,albedo_co2_ice_SPECTV) 
-
-         call ini_comslope_h(ngrid,nsoilmx,nq)
-
-         allocate(co2ice(ngrid))
-         co2ice(:)=qsurf(:,igcm_co2)
-         co2ice_slope(:,1)=co2ice(:)
-         tsurf_slope(:,1)=tsurf(:)
+         call surfini(ngrid,nq,qsurf_read_generic,albedo_read_generic,albedo_bareground,albedo_snow_SPECTV,albedo_co2_ice_SPECTV) 
+
+         nslope=1
+         call ini_comslope_h(ngrid,1)
+
+         qsurf(:,:,1)=qsurf_read_generic(:,:)
+         tsurf(:,1)=tsurf_read_generic(:)
+         tsoil(:,:,1)=tsoil_read_generic(:,:)
+         emis(:,1)=emis_read_generic(:)
+         watercap(:,1)=0.
+         watercaptag(:)=.false.
+         albedo(:,1,1)=albedo_read_generic(:,1)
+         albedo(:,2,1)=albedo_read_generic(:,2)
+         inertiesoil(:,:,1)=inertiedat(:,:)
 
 if (nslope.eq.1) then
@@ -473,7 +507,7 @@
      DO i=1,ngrid
        DO nnq=1,nqtot
-         qsurf_slope(i,nnq,1)=qsurf(i,nnq)
-         if(qsurf(i,nnq).LT.0) then
-           qsurf(i,nnq)=0.
+         qsurf(i,nnq,1)=qsurf_read_generic(i,nnq)
+         if(qsurf(i,nnq,1).LT.0) then
+           qsurf(i,nnq,1)=0.
          endif
        enddo
@@ -529,4 +563,7 @@
      call nb_time_step_GCM("data_GCM_Y1.nc",timelen)
 
+     allocate(tsoil_ave(ngrid,nsoilmx,nslope))
+     allocate(watersoil_density_PEM_ave(ngrid,nsoilmx_PEM,nslope))
+
      allocate(vmr_co2_gcm(ngrid,timelen))
      allocate(ps_timeseries(ngrid,timelen))
@@ -537,5 +574,5 @@
      allocate(tsurf_ave_yr1(ngrid,nslope))
      allocate(tsurf_ave(ngrid,nslope))
-     allocate(tsoil_ave(ngrid,nsoilmx,nslope))
+
      allocate(tsurf_GCM_timeseries(ngrid,nslope,timelen))
      allocate(tsoil_GCM_timeseries(ngrid,nsoilmx,nslope,timelen))
@@ -549,5 +586,4 @@
      allocate(tsoil_phys_PEM_timeseries(ngrid,nsoilmx_PEM,nslope,timelen))
      allocate(watersoil_density_PEM_timeseries(ngrid,nsoilmx_PEM,nslope,timelen))
-     allocate(watersoil_density_PEM_ave(ngrid,nsoilmx_PEM,nslope))
      allocate(delta_co2_adsorbded(ngrid))
      allocate(delta_h2o_adsorbded(ngrid))
@@ -603,7 +639,7 @@
       ENDDO
       watersoil_density_PEM_ave(:,:,:) = SUM(watersoil_density_PEM_timeseries(:,:,:,:),4)/timelen
+  endif !soil_pem
       deallocate(tsoil_ave)
       deallocate(tsoil_GCM_timeseries)
-  endif !soil_pem
 
 !------------------------
@@ -1124,16 +1160,4 @@
 
 ! III_a.1 Ice update (for startfi)
-#ifdef CPP_STD
-! Co2 ice
-      DO ig = 1,ngrid
-        co2ice(ig) = 0.
-        DO islope = 1,nslope
-          co2ice(ig) = co2ice(ig) + co2ice_slope(ig,islope) &
-                      * subslope_dist(ig,islope) /          &
-                      cos(pi*def_slope_mean(islope)/180.)
-        ENDDO
-        qsurf(ig,igcm_co2)=co2ice(ig)
-      ENDDO ! of DO ig=1,ngrid
-#endif
 
 ! H2O ice
Index: /trunk/LMDZ.COMMON/libf/evolution/pemetat0.F90
===================================================================
--- /trunk/LMDZ.COMMON/libf/evolution/pemetat0.F90	(revision 2984)
+++ /trunk/LMDZ.COMMON/libf/evolution/pemetat0.F90	(revision 2985)
@@ -66,4 +66,9 @@
    real :: year_PEM_read                                              ! Year of the PEM previous run
    LOGICAL :: startpem_file                                           ! boolean to check if we read the startfile or not
+#ifdef CPP_STD   
+   logical :: watercaptag(ngrid)
+
+   watercaptag(:)=.false.
+#endif
 
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Index: /trunk/LMDZ.COMMON/libf/evolution/read_data_GCM.F90
===================================================================
--- /trunk/LMDZ.COMMON/libf/evolution/read_data_GCM.F90	(revision 2984)
+++ /trunk/LMDZ.COMMON/libf/evolution/read_data_GCM.F90	(revision 2985)
@@ -122,4 +122,6 @@
      print *, "Downloading data for h2o_ice_s_slope done"
 
+#ifndef CPP_STD
+
      print *, "Downloading data for watercap_slope ..."
 DO islope=1,nslope
@@ -129,4 +131,6 @@
 ENDDO            
      print *, "Downloading data for watercap_slope done"
+
+#endif
     
  print *, "Downloading data for tsurf_slope ..."
@@ -139,4 +143,6 @@
      print *, "Downloading data for tsurf_slope done"
 
+#ifndef CPP_STD
+
      if(soil_pem) then
 
@@ -169,4 +175,6 @@
 
   endif !soil_pem
+
+#endif
 
   else !nslope=1 no slope, we copy all the values
@@ -177,5 +185,7 @@
 #ifndef CPP_STD
 !    call get_var3("watercap", watercap_slope(:,:,1,:))
-  watercap_slope(:,:,1,:)=1.
+  watercap_slope(:,:,1,:)=0.
+  watersurf_density_dyn(:,:,:,:)=0.
+  watersoil_density_dyn(:,:,:,:,:)=0.
 #endif
 
@@ -188,5 +198,4 @@
   print *, "Computing the min of h2o_ice_slope"
   min_h2o_ice_dyn(:,:,:)=minval(h2o_ice_s_dyn+watercap_slope,4)
-!  min_h2o_ice_dyn(:,:,:)=minval(h2o_ice_s_dyn,4)
   print *, "Computing the min of co2_ice_slope"
   min_co2_ice_dyn(:,:,:)=minval(co2_ice_slope_dyn,4)
Index: /trunk/LMDZ.COMMON/libf/evolution/recomp_orb_param_mod.F90
===================================================================
--- /trunk/LMDZ.COMMON/libf/evolution/recomp_orb_param_mod.F90	(revision 2984)
+++ /trunk/LMDZ.COMMON/libf/evolution/recomp_orb_param_mod.F90	(revision 2985)
@@ -17,5 +17,5 @@
       USE planete_h, ONLY: e_elips, obliquit, timeperi, periheli,aphelie,p_elips,peri_day,year_day
 #else
-      use planete_mod, only: e_elips, obliquit, timeperi
+      use planete_mod, only: e_elips, obliquit, timeperi,periastr,apoastr,p_elips,peri_day,year_day
       USE comcstfi_mod, only: pi
 
@@ -53,5 +53,11 @@
       ! 0. Initializations
       ! **********************************************************************
+#ifdef CPP_STD 
+      real aphelie
+      real periheli
 
+      aphelie=apoastr
+      periheli=periastr
+#endif
 
           Year=year_bp_ini+year_PEM+final_iter
@@ -104,6 +110,7 @@
               unitastr=149.597927
               p_elips=0.5*(periheli+aphelie)*(1-e_elips*e_elips)/unitastr
-
+#ifndef CPP_STD  
               call call_dayperi(timeperi,e_elips,peri_day,year_day)
+#endif
              endif
               exit
Index: /trunk/LMDZ.COMMON/libf/evolution/soil_thermalproperties_mod.F90
===================================================================
--- /trunk/LMDZ.COMMON/libf/evolution/soil_thermalproperties_mod.F90	(revision 2984)
+++ /trunk/LMDZ.COMMON/libf/evolution/soil_thermalproperties_mod.F90	(revision 2985)
@@ -58,5 +58,5 @@
 
   SUBROUTINE update_soil_thermalproperties(ngrid,nslope,nsoil_PEM,tendencies_waterice,waterice,p_avg_new,ice_depth,ice_thickness,TI_PEM)
-#ifndef CPP_STD
+
  USE comsoil_h, only:  inertiedat, volcapa
  USE comsoil_h_PEM, only: layer_PEM,inertiedat_PEM,depth_breccia,depth_bedrock,index_breccia,index_bedrock,reg_thprop_dependp
@@ -232,5 +232,4 @@
 !=======================================================================
       RETURN
-#endif
       END subroutine update_soil_thermalproperties
 
Index: /trunk/LMDZ.COMMON/makelmdz_fcm
===================================================================
--- /trunk/LMDZ.COMMON/makelmdz_fcm	(revision 2984)
+++ /trunk/LMDZ.COMMON/makelmdz_fcm	(revision 2985)
@@ -488,7 +488,22 @@
 if [[ -d ${LIBFGCM}/evolution &&  "$code" == "pem" ]]
 then
+if [[ "$physique" == "std" ]]
+then
+   CPP_KEY="$CPP_KEY CPP_STD"
+fi
    EVOLUTION_PATH="${LIBFGCM}/evolution"
    INCLUDE="$INCLUDE -I${LIBFGCM}/evolution"
 fi
+
+if [[ -d ${LIBFGCM}/evolution &&  "$code" == "reshape_XIOS_output" ]]
+then
+if [[ "$physique" == "std" ]]
+then
+   CPP_KEY="$CPP_KEY CPP_STD"
+fi
+   EVOLUTION_PATH="${LIBFGCM}/evolution"
+   INCLUDE="$INCLUDE -I${LIBFGCM}/evolution"
+fi
+
 
 # NETCDF library include/library paths
Index: /trunk/LMDZ.GENERIC/deftank/field_def_physics.xml
===================================================================
--- /trunk/LMDZ.GENERIC/deftank/field_def_physics.xml	(revision 2984)
+++ /trunk/LMDZ.GENERIC/deftank/field_def_physics.xml	(revision 2985)
@@ -14,4 +14,19 @@
                    unit="degrees" />
         </field_group>
+
+        <field_group id="fields_altitude" grid_ref="altitude_grid">
+            <field id="aps"
+                   long_name="aps" />
+            <field id="bps"
+                   long_name="bps" />
+        </field_group>
+
+        <field_group id="fields_interlayer" grid_ref="interlayer_grid">
+            <field id="ap"
+                   long_name="ap" />
+            <field id="bp"
+                   long_name="bp" />
+        </field_group>
+
        <!-- 1D variables (spectral)-->
        <field_group id="IR_fields" grid_ref="grid_IR">
@@ -42,4 +57,19 @@
                    long_name="Absorbed stellar radiation"
                     unit="W/m2" />  
+            <field id="tsurf"
+                   long_name="Surface Temperature"
+                   unit="K" />
+            <field id="co2ice"
+                   long_name="CO2 ice thickness"
+                   unit="kg/m2" />
+            <field id="h2o_ice_s"
+                   long_name="H2O ice thickness"
+                   unit="kg/m2" />
+            <field id="h2o_cropped"
+                   long_name="h2o in the first layer"  
+                   unit="kg/kg" />
+            <field id="co2_cropped"
+                   long_name="co2 in the first layer"  
+                   unit="kg/kg" />
         </field_group>
 
@@ -74,6 +104,6 @@
                    long_name="Plume vertical velocity" 
                    unit="m/s" />
+        </field_group>
 
-        </field_group>
         <!--Spectral IR 3D variables-->
         <field_group id="spectral_IR_3D" grid_ref="grid_IR_3D">
Index: /trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90
===================================================================
--- /trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90	(revision 2984)
+++ /trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90	(revision 2985)
@@ -2695,4 +2695,10 @@
          CALL send_xios_field('h2o_vap',zq(:,:,igcm_h2o_vap))
          CALL send_xios_field('h2o_ice',zq(:,:,igcm_h2o_ice))
+
+         CALL send_xios_field('h2o_layer1',zq(:,1,igcm_h2o_vap))
+         CALL send_xios_field('co2_layer1',zq(:,1,igcm_co2_ice))
+         CALL send_xios_field('tsurf',tsurf)
+         CALL send_xios_field('co2ice',qsurf(1:ngrid,igcm_co2_ice))
+         CALL send_xios_field('h2o_ice_s',qsurf(1:ngrid,igcm_h2o_ice))
       ENDIF
 
