Index: trunk/LMDZ.MARS/libf/phymars/albedocaps.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/albedocaps.F90	(revision 3582)
+++ trunk/LMDZ.MARS/libf/phymars/albedocaps.F90	(revision 3586)
@@ -6,7 +6,6 @@
 use ioipsl_getin_p_mod, only: getin_p
 use geometry_mod, only: latitude ! grid point latitudes (rad)
-use surfdat_h, only: TESicealbedo, TESice_Ncoef, TESice_Scoef,       &
-                     emisice, albedice, watercaptag, albedo_h2o_cap, &
-                     emissiv, albedodat, albedo_perennialco2
+use surfdat_h, only: TESicealbedo, TESice_Ncoef, TESice_Scoef, &
+                     emisice, emissiv, albedice, albedodat, albedo_perennialco2
 USE mod_phys_lmdz_transfert_para, ONLY: bcast
 USE mod_phys_lmdz_para, ONLY: is_master
@@ -96,6 +95,18 @@
         icap = 1 ! Northern hemisphere
     endif
-
-    if (piceco2(ig) > 0) then ! CO2 frost
+    
+    ! Initialization with bare ground
+    ! set emissivity of surface to be bare ground emissivity
+    emisref(ig) = emissiv
+    ! set the surface albedo to bare ground albedo
+    psolaralb(ig,:) = albedodat(ig)
+
+    ! CO2 perennial ice
+    if (paleoclimate .and. piceco2_peren(ig) > 0.) then
+        psolaralb(ig,:) = albedo_perennialco2(icap)
+        emisref(ig) = emisice(icap)
+    endif
+    ! CO2 frost
+    if (piceco2(ig) > 0.) then
         ! set emissivity of surface to be the ice emissivity
         emisref(ig) = emisice(icap)
@@ -105,22 +116,7 @@
             psolaralb(ig,2) = psolaralb(ig,1)
         else
-            psolaralb(ig,1) = albedice(icap)
-            psolaralb(ig,2) = albedice(icap)
+            psolaralb(ig,:) = albedice(icap)
         endif
-    else if (paleoclimate .and. piceco2_peren(ig) > 0.) then ! CO2 perennial ice
-        psolaralb(ig,1) = albedo_perennialco2(icap)
-        psolaralb(ig,2) = albedo_perennialco2(icap)
-        emisref(ig) = emisice(icap)
-    else if (watercaptag(ig) .and. water) then ! H2O ice in polar caps
-        ! there is a water ice cap: set the surface albedo to the water ice one
-        ! to do : emissivity
-        emisref(ig) = 1
-        psolaralb(ig,:) = albedo_h2o_cap
-    else ! Bare ground
-        ! set emissivity of surface to be bare ground emissivity
-        emisref(ig) = emissiv
-        ! set the surface albedo to bare ground albedo
-        psolaralb(ig,:) = albedodat(ig)
-    endif ! of if (piceco2(ig).gt.0)
+    endif
 enddo ! of ig=1,ngrid
 
Index: trunk/LMDZ.MARS/libf/phymars/co2condens_mod.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/co2condens_mod.F	(revision 3582)
+++ trunk/LMDZ.MARS/libf/phymars/co2condens_mod.F	(revision 3586)
@@ -612,10 +612,9 @@
         alb_tmp = psolaralb(:,:,islope)
         emisref_tmp = 0.
-        perennial_co2ice_tmp =  perennial_co2ice(:,islope) 
+        perennial_co2ice_tmp =  perennial_co2ice(:,islope)
         CALL albedocaps(zls,ngrid,piceco2_tmp,perennial_co2ice_tmp,
      &                  alb_tmp,emisref_tmp)
         perennial_co2ice(:,islope) = perennial_co2ice_tmp
-        psolaralb(:,1,islope) =  alb_tmp(:,1)
-        psolaralb(:,2,islope) =  alb_tmp(:,2)
+        psolaralb(:,:,islope) =  alb_tmp(:,:)
         emisref(:,islope) = emisref_tmp
       ENDDO
Index: trunk/LMDZ.MARS/libf/phymars/dyn1d/init_testphys1d_mod.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/dyn1d/init_testphys1d_mod.F90	(revision 3582)
+++ trunk/LMDZ.MARS/libf/phymars/dyn1d/init_testphys1d_mod.F90	(revision 3586)
@@ -140,4 +140,5 @@
 obliquit = 25.2           ! Obliquity (deg) ~25.2
 eccentric = 0.0934        ! Eccentricity (0.0934)
+Lsperi = 251.             ! Solar longitude of perihelion
 
 ! Planetary Boundary Layer and Turbulence parameters
Index: trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F90	(revision 3582)
+++ trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F90	(revision 3586)
@@ -6,7 +6,7 @@
 use phyredem,            only: physdem0, physdem1
 use watersat_mod,        only: watersat
-use tracer_mod,          only: igcm_h2o_vap, igcm_h2o_ice, igcm_co2, noms
+use tracer_mod,          only: igcm_h2o_vap, igcm_h2o_ice, noms
 use comcstfi_h,          only: pi, g, rcp, cpp
-use time_phylmdz_mod, only: daysec
+use time_phylmdz_mod,    only: daysec
 use dimradmars_mod,      only: tauvis, totcloudfrac, albedo
 use dust_param_mod,      only: tauscaling
Index: trunk/LMDZ.MARS/libf/phymars/physiq_mod.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/physiq_mod.F	(revision 3582)
+++ trunk/LMDZ.MARS/libf/phymars/physiq_mod.F	(revision 3586)
@@ -2366,19 +2366,26 @@
 c              ALWAYS PLACE these lines after co2condens !!!
 c       -------------------------------------------------------------
-         do ig=1,ngrid
+         do ig = 1,ngrid
           do islope = 1,nslope
-           if ((qsurf(ig,igcm_co2,islope).eq.0).and.
-     &        (qsurf(ig,igcm_h2o_ice,islope)
-     &       .gt.frost_albedo_threshold)) then
-             if ((watercaptag(ig)).and.(cst_cap_albedo)) then
-               albedo(ig,1,islope) = albedo_h2o_cap
-               albedo(ig,2,islope) = albedo_h2o_cap
-             else
-               albedo(ig,1,islope) = albedo_h2o_frost
-               albedo(ig,2,islope) = albedo_h2o_frost
-             endif !((watercaptag(ig)).and.(cst_cap_albedo)) then
-c              write(*,*) "frost thickness", qsurf(ig,igcm_h2o_ice)
-c              write(*,*) "physiq.F frost :"
-c     &        ,latitude(ig)*180./pi, longitude(ig)*180./pi
+           if (abs(qsurf(ig,igcm_co2,islope)) < 1.e-10) then ! No CO2 frost
+
+             if (qsurf(ig,igcm_h2o_ice,islope) > frost_albedo_threshold)
+     & then ! There is H2O frost
+               if (cst_cap_albedo .and. watercaptag(ig) .and.
+     & abs(perennial_co2ice(ig,islope)) < 1.e-10) then ! Water cap remains unchanged by water frost deposition and no CO2 perennial ice
+                 albedo(ig,:,islope) = albedo_h2o_cap
+                 emis(ig,islope) = 1.
+               else
+                 albedo(ig,:,islope) = albedo_h2o_frost
+                 emis(ig,islope) = 1.
+               endif
+             else ! No H2O frost
+               if (abs(perennial_co2ice(ig,islope)) < 1.e-10 .and.
+     & watercaptag(ig)) then ! No CO2 perennial ice but there is water cap
+                 albedo(ig,:,islope) = albedo_h2o_cap
+                 emis(ig,islope) = 1.
+               endif
+             endif
+
            endif
           enddo ! islope
