Index: /trunk/LMDZ.COMMON/libf/evolution/ComputeCO2Adsorption.F90
===================================================================
--- /trunk/LMDZ.COMMON/libf/evolution/ComputeCO2Adsorption.F90	(revision 2841)
+++ /trunk/LMDZ.COMMON/libf/evolution/ComputeCO2Adsorption.F90	(revision 2842)
@@ -1,3 +1,4 @@
    SUBROUTINE regolith_co2adsorption_old(ngrid,nslope,nsoil_PEM,ps,tsoil_PEM,TI_PEM,tend_h2oglaciers,tend_co2glaciers,co2ice,waterice,m_co2_completesoil,delta_mreg)
+#ifndef CPP_STD
       use comsoil_h_PEM, only: layer_PEM, mlayer_PEM,n_1km
       USE comcstfi_h, only: r, cpp, mugaz, g, rcp, pi, rad 
@@ -91,4 +92,5 @@
 
 !=======================================================================
+#endif
       RETURN
       END
Index: /trunk/LMDZ.COMMON/libf/evolution/adsorption_mod.F90
===================================================================
--- /trunk/LMDZ.COMMON/libf/evolution/adsorption_mod.F90	(revision 2841)
+++ /trunk/LMDZ.COMMON/libf/evolution/adsorption_mod.F90	(revision 2842)
@@ -4,7 +4,8 @@
 
   subroutine regolith_h2oadsorption(ngrid,nslope,nsoil_PEM,timelen, ps,q_co2,q_h2o,tsoil_PEM,TI_PEM, theta_h2o_adsorbded,m_h2o_adsorbed)
-
+#ifndef CPP_STD
  use vertical_layers_mod, ONLY: ap,bp
  use comsoil_h_PEM, only: n_1km
+#endif
 
  implicit none
@@ -52,8 +53,11 @@
      allocate(pvapor_avg(ngrid))
 
+
+
       m_h2o_adsorbed(:,:,:) = 0.
       theta_h2o_adsorbded(:,:,:) = 0.
       A =(1/m_co2 - 1/m_noco2)
       B=1/m_noco2
+#ifndef CPP_STD
 ! 1. Compute rho surface yearly averaged
 
@@ -98,11 +102,14 @@
 
  RETURN
+#endif
   end subroutine
 
   SUBROUTINE regolith_co2adsorption(ngrid,nslope,nsoil_PEM,timelen,ps,tsoil_PEM,TI_PEM,tend_h2oglaciers,tend_co2glaciers,co2ice,waterice,q_co2,q_h2o,m_co2_completesoil,delta_mreg)
+#ifndef CPP_STD
       use comsoil_h_PEM, only: layer_PEM, mlayer_PEM,n_1km
       USE comcstfi_h, only: r, cpp, mugaz, g, rcp, pi, rad 
       use comslope_mod, only : subslope_dist,def_slope_mean
       use vertical_layers_mod, ONLY: ap,bp
+#endif
 
       IMPLICIT NONE
@@ -138,5 +145,7 @@
  INTEGER :: ispermanent_co2glaciers(ngrid,nslope)        ! Check if the glacier is permanent
  INTEGER :: ispermanent_h2oglaciers(ngrid,nslope)        ! Check if the glacier is permanent
+#ifndef CPP_STD
  REAL :: deltam_reg_complete(ngrid,n_1km,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)
@@ -154,4 +163,6 @@
      allocate(pco2(ngrid,timelen))
      allocate(pco2_avg(ngrid))
+
+#ifndef CPP_STD
   
       m_h2o_adsorbed(:,:,:) = 0.
@@ -246,4 +257,5 @@
 !=======================================================================
       RETURN
+#endif
       END
 
Index: /trunk/LMDZ.COMMON/libf/evolution/computeice_table.F90
===================================================================
--- /trunk/LMDZ.COMMON/libf/evolution/computeice_table.F90	(revision 2841)
+++ /trunk/LMDZ.COMMON/libf/evolution/computeice_table.F90	(revision 2842)
@@ -1,3 +1,4 @@
    SUBROUTINE computeice_table(timelen,ngrid,nslope,nsoil_GCM,nsoil_PEM,tsoil,tsurf,q_co2,q_h2o,ps,ice_table)
+#ifndef CPP_STD
     USE comsoil_h, only:  inertiedat, volcapa
     USE vertical_layers_mod, ONLY: ap,bp
@@ -141,4 +142,4 @@
       RETURN
 
-
+#endif
       END
Index: /trunk/LMDZ.COMMON/libf/evolution/evol_co2_ice_s_mod_slope.F90
===================================================================
--- /trunk/LMDZ.COMMON/libf/evolution/evol_co2_ice_s_mod_slope.F90	(revision 2841)
+++ /trunk/LMDZ.COMMON/libf/evolution/evol_co2_ice_s_mod_slope.F90	(revision 2842)
@@ -32,10 +32,6 @@
 
   INTEGER :: i,j,ig0,islope                                  ! loop variable
-!  REAL :: not_budget, budget
-  REAL :: pos_tend, neg_tend, real_coefficient,negative_part
-  REAL ::  new_tendencies(ngrid)
 
   STOPPING=.false.
-
 
 ! Evolution of the water ice for each physical point
@@ -50,4 +46,3 @@
   enddo
 
-
 END SUBROUTINE evol_co2_ice_s_slope
Index: /trunk/LMDZ.COMMON/libf/evolution/ini_soil_mod.F90
===================================================================
--- /trunk/LMDZ.COMMON/libf/evolution/ini_soil_mod.F90	(revision 2841)
+++ /trunk/LMDZ.COMMON/libf/evolution/ini_soil_mod.F90	(revision 2842)
@@ -8,7 +8,10 @@
                therm_i, timestep,tsurf_ave,tsoil_ave,tsurf_inst, tsoil_inst,q_co2,q_h2o,ps,ice_table)
 
+#ifndef CPP_STD
+
       use vertical_layers_mod, only: ap,bp
       use comsoil_h_PEM, only:  fluxgeo,layer_PEM,inertiedat_PEM
       use comsoil_h,only: volcapa, nsoilmx
+#endif
 
    implicit none
@@ -86,4 +89,6 @@
 
     real,allocatable :: diff_rho(:)                    ! difference of vapor content
+
+#ifndef CPP_STD
 
     A =(1/m_co2 - 1/m_noco2)
@@ -227,4 +232,6 @@
      countloop = 0
    enddo
+
+#endif
  
       END SUBROUTINE ini_icetable
@@ -232,8 +239,9 @@
                therm_i,                          &
                timestep,tsurf,tsoil,alph,beta)
-
+#ifndef CPP_STD
       use comsoil_h_PEM, only: layer_PEM, mlayer_PEM,  &
                            mu_PEM,fluxgeo
       use comsoil_h,only: volcapa
+#endif
       implicit none
 
@@ -275,4 +283,6 @@
       real :: coefq_PEM(0:nsoil-1)
 
+#ifndef CPP_STD
+
 ! 0. Initialisations and preprocessing step
  if (firstcall) then
@@ -347,5 +357,5 @@
                        +coefd_PEM(ik))
       enddo
-
+#endif
       end
 
Index: /trunk/LMDZ.COMMON/libf/evolution/iostart_PEM.F90
===================================================================
--- /trunk/LMDZ.COMMON/libf/evolution/iostart_PEM.F90	(revision 2841)
+++ /trunk/LMDZ.COMMON/libf/evolution/iostart_PEM.F90	(revision 2842)
@@ -466,5 +466,9 @@
   USE mod_grid_phy_lmdz, only: klon_glo
   USE dimphy, only: klev, klevp1
+#ifndef CPP_STD
   USE tracer_mod, only: nqmx
+#else
+  use tracer_h, only:   nqtot
+#endif
   USE comsoil_h_PEM, only:  nsoilmx_PEM
   USE comslope_mod, only: nslope
@@ -473,4 +477,9 @@
     INTEGER                     :: ierr
     LOGICAL,SAVE :: already_created=.false.
+
+#ifdef CPP_STD
+    INTEGER :: nqmx
+    nqmx=nqtot
+#endif
     
     IF (is_master) THEN
Index: /trunk/LMDZ.COMMON/libf/evolution/orbit_param_criterion_mod.F90
===================================================================
--- /trunk/LMDZ.COMMON/libf/evolution/orbit_param_criterion_mod.F90	(revision 2841)
+++ /trunk/LMDZ.COMMON/libf/evolution/orbit_param_criterion_mod.F90	(revision 2842)
@@ -8,6 +8,10 @@
 
       USE temps_mod_evol, ONLY: year_bp_ini, year_PEM
+#ifndef CPP_STD
       USE planete_h, ONLY: e_elips, obliquit, timeperi
-      USE comcstfi_h, only: pi
+#else
+      use planete_mod, only: e_elips, obliquit, timeperi
+#endif
+      USE comconst_mod, ONLY: pi
       USE lask_param_mod, only: yearlask,oblask,exlask,lsplask, &
    				ini_lask_param_mod,last_ilask
Index: /trunk/LMDZ.COMMON/libf/evolution/pem.F90
===================================================================
--- /trunk/LMDZ.COMMON/libf/evolution/pem.F90	(revision 2841)
+++ /trunk/LMDZ.COMMON/libf/evolution/pem.F90	(revision 2842)
@@ -31,34 +31,45 @@
 
 !module needed for INITIALISATION
-      use phyetat0_mod, only: phyetat0
+#ifndef CPP_STD
       use comsoil_h, only: tsoil, nsoilmx, ini_comsoil_h,inertiedat, mlayer,volcapa
       use surfdat_h, only: tsurf, co2ice, emis,&
-      &                    qsurf,watercap, ini_surfdat_h, &
+                           qsurf,watercap, ini_surfdat_h, &
                            albedodat, zmea, zstd, zsig, zgam, zthe, &
                            hmons, summit, base,albedo_h2o_frost, &
-                          frost_albedo_threshold,emissiv
+                           frost_albedo_threshold,emissiv
       use dimradmars_mod, only: totcloudfrac, albedo
+      use dust_param_mod, only: tauscaling
+      use tracer_mod, only: noms,igcm_h2o_ice ! tracer names
+#else
+      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_ice ! 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 dust_param_mod, only: tauscaling
       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 phyredem, only: physdem0, physdem1
-      use tracer_mod, only: noms,igcm_h2o_ice ! tracer names
 
 ! For phyredem :
       USE control_mod, ONLY: iphysiq, day_step,nsplit_phys
-      use time_phylmdz_mod, only: daysec
+      USE iniphysiq_mod, ONLY: iniphysiq
+      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 time_phylmdz_mod, only: dtphys
+      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, &
+                          obliquit
+#endif
       USE mod_const_mpi, ONLY: COMM_LMDZ
-      USE comconst_mod, ONLY: rad,g,r,cpp
-      USE logic_mod, ONLY: iflag_phys
-      USE iniphysiq_mod, ONLY: iniphysiq
-      USE infotrac
-      USE comcstfi_h, only: pi 
-
       USE comslope_mod, ONLY: nslope,def_slope,def_slope_mean, &
                            subslope_dist,co2ice_slope, &
@@ -67,6 +78,8 @@
                            co2iceflow, beta_slope, capcal_slope,&
                            albedo_slope,emiss_slope,qsurf_slope,&
-                           iflat
-
+                           iflat,ini_comslope_h
+      use time_phylmdz_mod, only: daysec,dtphys
+      USE comconst_mod, ONLY: rad,g,r,cpp,pi
+      USE infotrac
       USE geometry_mod, only: latitude_deg 
 
@@ -83,6 +96,4 @@
 !!! For orbit parameters
       USE temps_mod_evol, ONLY: dt_pem, evol_orbit_pem, Max_iter_pem
-      use planete_h, only: aphelie, periheli, year_day, peri_day, &
-                          obliquit
       use orbit_param_criterion_mod, only : orbit_param_criterion
       use recomp_orb_param_mod, only: recomp_orb_param
@@ -266,4 +277,12 @@
      REAL :: totmass_adsorbded
 
+#ifdef CPP_STD
+!     INTEGER :: nsplit_phys=1
+!     LOGICAL :: iflag_phys=.true.
+     REAL :: frost_albedo_threshold=0.05
+     REAL :: albedo_h2o_frost
+     REAL,ALLOCATABLE :: co2ice(:)
+#endif
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
@@ -274,4 +293,5 @@
      REAL :: alpha = 23.3494
   
+#ifndef CPP_STD
 ! Parallel variables
       is_sequential=.true.
@@ -280,4 +300,5 @@
       is_omp_root=.true.
       is_master=.true.
+#endif
 
       day_ini=0    !test
@@ -369,8 +390,4 @@
           iflag_phys)
 
-     DO nnq=1,nqtot
-       if(noms(nnq).eq."h2o_ice") igcm_h2o_ice = nnq
-     ENDDO 
-
 !----------------------------READ startfi.nc --------------------- 
 
@@ -381,4 +398,5 @@
       allocate(inertiesoil(ngrid,nsoilmx))
 
+#ifndef CPP_STD
       CALL phyetat0 (FILE_NAME,0,0, &
               nsoilmx,ngrid,nlayer,nq,   &
@@ -405,4 +423,45 @@
        enddo
      enddo
+
+#else
+         call phys_state_var_init(nq)
+         IF (.NOT.ALLOCATED(noms)) ALLOCATE(noms(nq)) ! (because noms is an argument of physdem1 whether or not tracer is on)
+         call initracer(ngrid,nq)
+         call iniaerosol()
+         call phyetat0(.true.,                                 &
+                       ngrid,nlayer,FILE_NAME,0,0,nsoilmx,nq,      &
+                       day_ini,time_phys,tsurf,tsoil,emis,q2,qsurf,   &
+                       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_ice)
+         co2ice_slope(:,1)=co2ice(:)
+         tsurf_slope(:,1)=tsurf(:)
+
+if (nslope.eq.1) then
+def_slope(1) = 0
+def_slope(2) = 0
+def_slope_mean=0
+subslope_dist(:,1) = 1.
+endif
+
+! Remove unphysical values of surface tracer
+     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.
+         endif
+       enddo
+     enddo
+#endif
+
+     DO nnq=1,nqtot
+       if(noms(nnq).eq."h2o_ice") igcm_h2o_ice = nnq
+     ENDDO 
 
 !------------------------
@@ -440,5 +499,9 @@
          co2_hmax(5) = co2_hmax(3)
          co2_hmax(4) = 1000000.
-       endif
+     elseif(nslope.eq.1) then
+         co2_hmax(1) = 1000000.
+     else
+         print *, "Nslope must be=to 1 or 7 for now!!"
+     endif
 
      allocate(flag_co2flow(ngrid,nslope))
@@ -447,4 +510,5 @@
        flag_co2flow(:,:) = 0.     
        flag_co2flow_mesh(:) = 0.
+
 
 !---------------------------- READ GCM data --------------------- 
@@ -729,5 +793,4 @@
       tendencies_h2o_ice_phys_slope,tendencies_co2_ice_phys_slope,co2ice_slope,qsurf_slope(:,igcm_h2o_ice,:), co2_adsorbded_phys,delta_co2_adsorbded)
 
-
     if(soil_pem) then
      totmass_adsorbded = 0.
@@ -761,6 +824,9 @@
 !    I_h Read the PEMstar
 !    I_i Compute orbit criterion
-
+#ifndef CPP_STD
      CALL iniorbit(aphelie,periheli,year_day,peri_day,obliquit)
+#else
+     CALL iniorbit(apoastr, periastr, year_day, peri_day,obliquit)
+#endif
 
      if(evol_orbit_pem) then
@@ -1130,4 +1196,7 @@
                       cos(pi*def_slope_mean(islope)/180.)
         ENDDO
+#ifdef CPP_STD
+        qsurf(ig,igcm_co2_ice)=co2ice(ig)
+#endif
       ENDDO ! of DO ig=1,ngrid
 ! H2o ice
@@ -1158,4 +1227,5 @@
       ENDDO ! of DO ig=1,ngrid
 
+#ifndef CPP_STD
       DO ig = 1,ngrid
         DO iloop = 1,nsoilmx
@@ -1190,4 +1260,5 @@
       ENDDO
     ENDDO
+#endif
 
 ! III_a.4 Pressure (for start)
@@ -1274,5 +1345,5 @@
 
 ! III_b.2 WRITE restartfi.nc 
-      
+#ifndef CPP_STD
       call physdem0("restartfi_evol.nc",longitude,latitude, &
                         nsoilmx,ngrid,nlayer,nq,              &
@@ -1289,4 +1360,15 @@
                      tsurf_slope,tsoil_slope, albedo_slope,      &
                      emiss_slope,qsurf_slope,watercap_slope, TI_GCM_phys)
+#else
+     call physdem0("restartfi_evol.nc",longitude,latitude,nsoilmx,ngrid,nlayer,nq, &
+                         ptimestep,pday,time_phys,cell_area,          &
+                         albedo_bareground,inertiedat,zmea,zstd,zsig,zgam,zthe)
+
+     call physdem1("restartfi_evol.nc",nsoilmx,ngrid,nlayer,nq, &
+                          ptimestep,ztime_fin,                    &
+                          tsurf,tsoil,emis,q2,qsurf,         &
+                          cloudfrac,totcloudfrac,hice,            &
+                          rnat,pctsrf_sic,tslab,tsea_ice,sea_ice)
+#endif
 
       print *, "restartfi_evol.nc has been written"
Index: /trunk/LMDZ.COMMON/libf/evolution/pemredem.F90
===================================================================
--- /trunk/LMDZ.COMMON/libf/evolution/pemredem.F90	(revision 2841)
+++ /trunk/LMDZ.COMMON/libf/evolution/pemredem.F90	(revision 2842)
@@ -12,7 +12,14 @@
                       put_var, put_field, length
   use mod_grid_phy_lmdz, only : klon_glo
+#ifndef CPP_STD
   use planete_h, only: aphelie, emin_turb, lmixmin, obliquit, &
                        peri_day, periheli, year_day
   use comcstfi_h, only: g, mugaz, omeg, rad, rcp
+#else
+  use planete_mod, only: apoastr, emin_turb, lmixmin, obliquit, &
+                       peri_day, periastr, year_day
+  USE comconst_mod, ONLY: g, omeg, rad
+  use comcstfi_mod, only: mugaz, rcp
+#endif
   use time_phylmdz_mod, only: daysec
   implicit none
@@ -68,5 +75,7 @@
   implicit none
   
+#ifndef CPP_STD
   include "callkeys.h"
+#endif
   
   character(len=*),intent(in) :: filename
Index: /trunk/LMDZ.COMMON/libf/evolution/read_data_GCM.F90
===================================================================
--- /trunk/LMDZ.COMMON/libf/evolution/read_data_GCM.F90	(revision 2841)
+++ /trunk/LMDZ.COMMON/libf/evolution/read_data_GCM.F90	(revision 2842)
@@ -118,4 +118,6 @@
      print *, "Downloading data for co2ice_slope ..."
 
+if(nslope.gt.1) then
+
 DO islope=1,nslope
   write(num,fmt='(i2.2)') islope
@@ -160,5 +162,15 @@
      print *, "Downloading data for inertiesoil_slope done"
 
-  endif
+  endif !soil_pem
+
+  else !nslope=1 no slope, we copy all the values
+    co2_ice_slope(:,:,1,:)=co2_ice_s(:,:,:)
+    h2o_ice_s_slope(:,:,1,:)=h2o_ice_s(:,:,:)
+    call get_var3("tsurf",tsurf_gcm(:,:,1,:))
+    if(soil_pem) then
+      call get_var4("tsoil",tsoil_gcm(:,:,:,1,:))
+      call get_var4("inertiesoil",TI_gcm(:,:,:,1,:))
+    endif !soil_pem
+  endif !nslope=1
 
 ! Compute the minimum over the year for each point
Index: /trunk/LMDZ.COMMON/libf/evolution/recomp_orb_param_mod.F90
===================================================================
--- /trunk/LMDZ.COMMON/libf/evolution/recomp_orb_param_mod.F90	(revision 2841)
+++ /trunk/LMDZ.COMMON/libf/evolution/recomp_orb_param_mod.F90	(revision 2842)
@@ -8,6 +8,10 @@
 
       USE temps_mod_evol, ONLY: year_bp_ini, year_PEM
+#ifndef CPP_STD
       USE planete_h, ONLY: e_elips, obliquit, timeperi
-      USE comcstfi_h, only: pi
+#else
+      use planete_mod, only: e_elips, obliquit, timeperi
+#endif
+      USE comcstfi_mod, only: pi
       USE lask_param_mod, only: yearlask,oblask,exlask,lsplask, &
    				end_lask_param_mod,last_ilask
Index: /trunk/LMDZ.COMMON/libf/evolution/update_soil.F90
===================================================================
--- /trunk/LMDZ.COMMON/libf/evolution/update_soil.F90	(revision 2841)
+++ /trunk/LMDZ.COMMON/libf/evolution/update_soil.F90	(revision 2842)
@@ -1,5 +1,5 @@
    SUBROUTINE update_soil(ngrid,nslope,nsoil_PEM,tend_h2oglaciers,tend_co2glaciers,co2ice,waterice,p_avg_new,&
                           ice_depth,TI_PEM)
-
+#ifndef CPP_STD
  USE comsoil_h, only:  inertiedat, volcapa
  USE comsoil_h_PEM, only: layer_PEM,n_1km,inertiedat_PEM
@@ -138,3 +138,4 @@
 !=======================================================================
       RETURN
+#endif
       END
