Index: trunk/LMDZ.MARS/libf/phymars/aeropacity_mod.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/aeropacity_mod.F	(revision 2491)
+++ trunk/LMDZ.MARS/libf/phymars/aeropacity_mod.F	(revision 2494)
@@ -10,6 +10,6 @@
 
       SUBROUTINE aeropacity(ngrid,nlayer,nq,zday,pplay,pplev,ls,
-     &    pq,tauscaling,dust_rad_adjust,tau_pref_scenario,tau_pref_gcm,
-     &    tau,taucloudtes,aerosol,dsodust,reffrad,
+     &    pq,pt,tauscaling,dust_rad_adjust,tau_pref_scenario,
+     &    tau_pref_gcm,tau,taucloudtes,aerosol,dsodust,reffrad,
      &    QREFvis3d,QREFir3d,omegaREFir3d,
      &    totstormfract,clearatm,dsords,dsotop,
@@ -37,4 +37,5 @@
       use dust_param_mod, only: odpref, freedust
       use dust_scaling_mod, only: compute_dustscaling
+      use density_co2_ice_mod, only: density_co2_ice
        IMPLICIT NONE
 c=======================================================================
@@ -74,4 +75,5 @@
                          ! of the atmospheric layers
       REAL,INTENT(IN) ::  pq(ngrid,nlayer,nq) ! tracers
+      REAL,INTENT(IN) ::  pt(ngrid,nlayer) !temperature
       REAL,INTENT(OUT) :: tau_pref_scenario(ngrid) ! prescribed dust column
                           ! visible opacity at odpref from scenario
@@ -132,4 +134,10 @@
       REAL topdust0(ngrid)
 
+!      -- CO2 clouds
+       real CLFtotco2
+       real taucloudco2vis(ngrid)
+       real taucloudco2tes(ngrid)
+       real totcloudco2frac(ngrid) ! a mettre en (in) [CM]
+       double precision :: rho_ice_co2
 #ifdef DUSTSTORM
 !! Local dust storms
@@ -174,4 +182,6 @@
         ! identify scatterers that are dust
         naerdust=0
+        iaerdust(1:naerkind) = 0
+        nqdust(1:nq) = 0
         DO iaer=1,naerkind
           txt=name_iaer(iaer)
@@ -192,5 +202,4 @@
           ENDIF
         ENDDO
-
         IF (water.AND.activice) THEN
           i_ice=igcm_h2o_ice
@@ -236,5 +245,4 @@
                                        !avoid unrealistic values due to constant lifting
         ENDIF
-
 
 #ifndef DUSTSTORM
@@ -488,22 +496,26 @@
 c       1. Initialization
         aerosol(1:ngrid,1:nlayer,iaer) = 0.
-        taucloudvis(1:ngrid) = 0.
-        taucloudtes(1:ngrid) = 0.
+        taucloudco2vis(1:ngrid) = 0.
+        taucloudco2tes(1:ngrid) = 0.
 c       2. Opacity calculation
         ! NO CLOUDS
         IF (clearsky) THEN
-            aerosol(1:ngrid,1:nlayer,iaer) =1.e-9
+            aerosol(1:ngrid,1:nlayer,iaer) = 1.e-9
         ! CLOUDSs
         ELSE ! else (clearsky)
-          DO ig=1, ngrid
-            DO l=1,nlayer
+          DO ig = 1, ngrid
+            DO l = 1, nlayer
+              call density_co2_ice(dble(pt(ig,l)), rho_ice_co2)
+
               aerosol(ig,l,iaer) = max(1E-20,
      &          (  0.75 * QREFvis3d(ig,l,iaer) /
-     &          ( rho_ice * reffrad(ig,l,iaer) )  ) *
+     &          ( rho_ice_co2 * reffrad(ig,l,iaer) )  ) *
      &          pq(ig,l,i_co2ice) *
      &          ( pplev(ig,l) - pplev(ig,l+1) ) / g
      &                              )
-              taucloudvis(ig) = taucloudvis(ig) + aerosol(ig,l,iaer)
-              taucloudtes(ig) = taucloudtes(ig) + aerosol(ig,l,iaer)*
+              taucloudco2vis(ig) = taucloudco2vis(ig) 
+     &                             + aerosol(ig,l,iaer)
+              taucloudco2tes(ig) = taucloudco2tes(ig) 
+     &                             + aerosol(ig,l,iaer) *
      &          QREFir3d(ig,l,iaer) / QREFvis3d(ig,l,iaer) *
      &          ( 1.E0 - omegaREFir3d(ig,l,iaer) )
@@ -511,15 +523,15 @@
           ENDDO
           ! SUB-GRID SCALE CLOUDS
-          IF (CLFvarying) THEN
+          IF (CLFvaryingCO2) THEN
              DO ig=1, ngrid
-                DO l=1,nlayer-1
-                   CLFtot  = max(totcloudfrac(ig),0.01) 
+                DO l= 1, nlayer-1
+                   CLFtotco2  = max(totcloudco2frac(ig),0.01) 
                    aerosol(ig,l,iaer)=
-     &                    aerosol(ig,l,iaer)/CLFtot
+     &                    aerosol(ig,l,iaer)/CLFtotco2
                    aerosol(ig,l,iaer) = 
      &                    max(aerosol(ig,l,iaer),1.e-9)
                 ENDDO
              ENDDO
-          ENDIF ! end (CLFvarying)             
+          ENDIF ! end (CLFvaryingCO2)
         ENDIF ! end (clearsky)
 
Index: trunk/LMDZ.MARS/libf/phymars/callradite_mod.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/callradite_mod.F	(revision 2491)
+++ trunk/LMDZ.MARS/libf/phymars/callradite_mod.F	(revision 2494)
@@ -427,6 +427,7 @@
      &                rdust,rstormdust,rtopdust,rice,nuice,
      &                reffrad,nueffrad, riceco2, nuiceco2,
-     &                pq,tauscaling,tau,pplay)
+     &                pq,tauscaling,tau,pplay, pt)
 c     Computing 3D scattering parameters:
+      gVIS3d(:,:,:,:) = 0.
       CALL aeroptproperties(ngrid,nlayer,reffrad,nueffrad,
      &                      QVISsQREF3d,omegaVIS3d,gVIS3d,
@@ -436,14 +437,17 @@
 c     Computing aerosol optical depth in each layer:
       CALL aeropacity(ngrid,nlayer,nq,zday,pplay,pplev,ls,
-     &    pq,tauscaling,dust_rad_adjust,tau_pref_scenario,tau_pref_gcm,
-     &    tau,taucloudtes,aerosol,dsodust,reffrad,
+     &    pq,pt,tauscaling,dust_rad_adjust,tau_pref_scenario,
+     &    tau_pref_gcm,tau,taucloudtes,aerosol,dsodust,reffrad,
      &    QREFvis3d,QREFir3d,omegaREFir3d,
      &    totstormfract,clearatm,dsords,dsotop,
      &    alpha_hmons,nohmons,
      &    clearsky,totcloudfrac)
-
 c     Starting loop on sub-domain
 c     ----------------------------
-
+      zgVIS3d(:,:,:,:) = 0.
+      zfluxd_sw(:,:,:) = 0.
+      zfluxu_sw(:,:,:) = 0.
+      zQVISsQREF3d(:,:,:,:) = 0.
+      zomegaVIS3d(:,:,:,:) = 0.
       DO jd=1,ndomain
         ig0=(jd-1)*ndomainsz
@@ -479,5 +483,5 @@
          enddo
         enddo
-
+        zplev(:,:) = 0.
         do l=1,nlaylte+1
          do ig = 1,nd
@@ -485,5 +489,6 @@
          enddo
         enddo
-
+        zdp(:,:) = 0.
+        
         do l=1,nlaylte
          do ig = 1,nd
@@ -494,5 +499,5 @@
          enddo
         enddo
-
+        zaerosol(:,:,:) = 0.
         do n=1,naerkind
           do l=1,nlaylte
@@ -502,5 +507,5 @@
           enddo
         enddo
-
+        zalbedo(:,:) = 0.
         do j=1,2
           do ig = 1,nd
@@ -546,5 +551,5 @@
 c          1370 W.m-2 is the solar constant at 1 AU.
            cste_mars=1370./(dist_sol*dist_sol)
-
+           zzdtsw(:,:) = 0.
            call swmain ( nd, nflev,
      S     cste_mars, zalbedo,
@@ -552,5 +557,4 @@
      S     zzdtsw, zfluxd_sw, zfluxu_sw,
      &     zQVISsQREF3d,zomegaVIS3d,zgVIS3d)
-
 c       ------------------------------------------------------------
 c       Un-spliting output variable from sub-domain input variables
@@ -564,4 +568,5 @@
         enddo
 
+        ptlev(:, :) = 0.
         do l=1,nlaylte+1
          do ig = 1,nd
@@ -588,5 +593,4 @@
          enddo
       endif
-
 c     Output for debugging if lwrite=T
 c     --------------------------------
Index: trunk/LMDZ.MARS/libf/phymars/co2cloud.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/co2cloud.F90	(revision 2491)
+++ trunk/LMDZ.MARS/libf/phymars/co2cloud.F90	(revision 2494)
@@ -108,5 +108,5 @@
   use tracer_mod,      only: igcm_co2, igcm_co2_ice, igcm_dust_mass, igcm_dust_number, igcm_h2o_ice, &
                              igcm_ccn_mass, igcm_ccn_number, igcm_ccnco2_mass, igcm_ccnco2_number, rho_dust, &
-                             nuiceco2_sed, nuiceco2_ref, rho_ice_co2, r3n_q, rho_ice, nuice_sed
+                             nuiceco2_sed, nuiceco2_ref, r3n_q, rho_ice, nuice_sed
 
   use newsedim_mod,    only: newsedim
@@ -114,5 +114,5 @@
   use datafile_mod,    only: datadir
 
-  use improvedCO2clouds_mod, only: improvedCO2clouds, density_co2_ice
+  use improvedCO2clouds_mod, only: improvedCO2clouds
 
 #ifndef MESOSCALE
@@ -209,6 +209,7 @@
      dev2,                   &! 1. / ( sqrt(2.) * sigma_iceco2 )
      Qext1bins(nbinco2_cld), &! Extinction coefficients for rb_cldco2 radius of CO2 ice particles
+     Qextv1mic(var_dim_qext), &
+     radv(var_dim_qext),      &    ! radius of CO2 ice at 1 µm (read from file_qext)
      rb_cldco2(nbinco2_cld+1) ! boundary values of each rad_cldco2 bin (m)
-
   logical, save :: &
      firstcall = .true. ! Used to compute saved variables
@@ -273,6 +274,4 @@
      tau1mic(ngrid),                &! CO2 ice column opacity at 1µm
      Qext1bins2(ngrid,nlay),        &! CO2 ice opacities
-     radv(var_dim_qext),            &! radius of CO2 ice at 1 µm (read from file_qext)
-     Qextv1mic(var_dim_qext),       &! extinction coefficient of CO2 ice at 1 µm (read from file_qext)
 ! ---For Saturation Index computation
      rho,                           &! background density
@@ -285,6 +284,5 @@
 ! ---Misc
      myT,                           &! Temperature scalar for co2 density computation
-     tcond(ngrid,nlay),             &! CO2 condensation temperature
-     rho_ice_co2T(ngrid,nlay)        ! T-dependant CO2 ice density
+     tcond(ngrid,nlay)               ! CO2 condensation temperature
 
   logical :: &
@@ -419,5 +417,5 @@
   epaisseur(1:ngrid,1:nlay) = 0.
   masse(1:ngrid,1:nlay) = 0.
-
+  riceco2(1:ngrid, 1:nlay) = 0.
   zqsed0(1:ngrid,1:nlay,1:nq) = 0.
   sum_subpdqs_sedco2(1:ngrid) = 0.
@@ -611,4 +609,5 @@
                           subpdqcloudco2, subpdtcloudco2, nq, tauscaling, mem_Mccn_co2, mem_Mh2o_co2, mem_Nccn_co2, &
                           rb_cldco2, sigma_iceco2, dev2)
+
    do l = 1, nlay
      do ig = 1, ngrid
@@ -682,7 +681,4 @@
           zqsed(ig,l,:) = pqeff(ig,l,:) + sum_subpdq(ig,l,:) * microtimestep
 
-          ! density of co2 ice
-          call density_co2_ice(dble(ztsed(ig,l)), rho_ice_co2T(ig,l))
-
           ! assure positive value of co2_ice mmr, ccnco2 number, ccnco2 mass
           Niceco2 = max(zqsed(ig,l,igcm_co2_ice), threshold)
@@ -692,5 +688,6 @@
           ! Get density cloud and co2 ice particle radius
           if (Niceco2.ne.0d0) then
-            call updaterice_microco2(dble(Niceco2), dble(Qccnco2), dble(Nccnco2), tauscaling(ig), riceco2(ig,l), rhocloudco2t(ig,l))
+            call updaterice_microco2(dble(Niceco2), dble(Qccnco2), dble(Nccnco2), ztsed(ig,l), tauscaling(ig), &
+                                     riceco2(ig,l), rhocloudco2t(ig,l))
           else
             riceco2(ig,l) = 0.
@@ -776,5 +773,4 @@
     pdqs_sedco2(ig) = sum_subpdqs_sedco2(ig) / real(imicroco2)
   end do
-
   ! temperature tendency (T.s-1)
   do l = 1, nlay
@@ -835,11 +831,7 @@
       myT = pteff(ig,l) + (pdt(ig,l)+pdtcloudco2(ig,l))*ptimestep
 
-      ! compute density of co2 ice
-      call density_co2_ice(myT, rho_ice_co2T(ig,l))
-
-      rho_ice_co2 = rho_ice_co2T(ig,l) ! rho_ice_co2 is shared by tracer_mod and used in updaterice
-
       ! Compute particle size
-      call updaterice_microco2(dble(Niceco2), dble(Qccnco2), dble(Nccnco2), tauscaling(ig), riceco2(ig,l), rhocloudco2(ig,l))
+      call updaterice_microco2(dble(Niceco2), dble(Qccnco2), dble(Nccnco2), myT, tauscaling(ig), riceco2(ig,l), &
+                               rhocloudco2(ig,l))
 
      ! Compute opacities
Index: trunk/LMDZ.MARS/libf/phymars/co2condens_mod4micro.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/co2condens_mod4micro.F90	(revision 2491)
+++ trunk/LMDZ.MARS/libf/phymars/co2condens_mod4micro.F90	(revision 2494)
@@ -302,4 +302,6 @@
 
 ! Compute without microphysics
+ diff_zcondicea(1:ngrid, 1:nlayer) = 0.
+ diff_zfallice(1:ngrid) = 0.
  do l =1, nlayer
    do ig = 1, ngrid
@@ -319,6 +321,6 @@
 
  ztcond_2(:,nlayer+1)=ztcond_2(:,nlayer)
- zfallice_2(:,:) = 0
-
+ zfallice_2(:,:) = 0.
+ zcondicea_2(:,:) = 0.
  do l = nlayer , 1, -1
    do ig = 1, ngrid
Index: trunk/LMDZ.MARS/libf/phymars/improvedco2clouds_mod.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/improvedco2clouds_mod.F90	(revision 2491)
+++ trunk/LMDZ.MARS/libf/phymars/improvedco2clouds_mod.F90	(revision 2494)
@@ -7,6 +7,4 @@
 ! Contains subroutines:
 !     - improvedco2clouds_mod: nucleation
-!
-!     - density_co2_ice: compute density of co2 ice particle
 !======================================================================================================================!
 module improvedco2clouds_mod
@@ -72,9 +70,11 @@
   use tracer_mod,   only: igcm_dust_mass, igcm_dust_number, rho_dust, igcm_h2o_ice, igcm_ccn_mass, igcm_ccn_number, &
                           nuice_sed, igcm_co2, igcm_co2_ice, igcm_ccnco2_mass, igcm_ccnco2_number, nuiceco2_sed, &
-                          rho_ice_co2, nuiceco2_ref
+                          nuiceco2_ref
 
   use conc_mod,     only: mmean
 
   use datafile_mod, only: datadir
+
+  use density_co2_ice_mod, only: density_co2_ice
 
   implicit none
@@ -211,5 +211,5 @@
     rate(nbinco2_cld),                 &! nucleation rate
     rateh2o(nbinco2_cld),              &! nucleation rate for h2o
-    rho_ice_co2T(ngrid,nlay),          &! density of co2 ice
+    rho_ice_co2T,                      &! density of co2 ice Temperature-dependent
     riceco2(ngrid,nlay),               &! CO2 ice mean radius (m)
     vrat_cld,                          &! Volume ratio
@@ -232,7 +232,4 @@
     firstcall = .false.
 
-!   Volume of a co2 molecule (m3)
-    vo1co2 = m0co2 / dble(rho_ice_co2)
-
 !   Variance of the ice and CCN distributions
     sigma_ice = sqrt(log(1.+nuice_sed))
@@ -287,4 +284,5 @@
 
   ! pteff temperature layer; sum_subpdt dT.s-1
+  zt(1:ngrid,1:nlay) = 0.
   zt(:,:) = pteff(:,:) + sum_subpdt(:,:) * microtimestep
 
@@ -294,4 +292,5 @@
 
   zq0(:,:,:) = zq(:,:,:)
+  zqsat(:,:) = 0.
 !----------------------------------------------------------------------------------------------------------------------!
 ! 2. Compute saturation
@@ -338,8 +337,7 @@
 
       !T-dependant CO2 ice density
-      call density_co2_ice(dble(zt(ig,l)), rho_ice_co2T(ig,l))
-
-      vo2co2 = m0co2 / dble(rho_ice_co2T(ig,l))
-      rho_ice_co2 = rho_ice_co2T(ig,l)
+      call density_co2_ice(dble(zt(ig,l)), rho_ice_co2T)
+
+      vo2co2 = m0co2 / rho_ice_co2T
 !----------------------------------------------------------------------------------------------------------------------!
 ! 4.1 Nucleation
@@ -421,4 +419,5 @@
           ! Call to nucleation routine
           call nucleaCO2(dble(pco2), zt(ig,l), dble(satu), n_aer, rate, n_aer_h2oice, rad_h2oice, rateh2o, vo2co2)
+
           dN = 0.
           dM = 0.
@@ -492,7 +491,7 @@
       if (zq(ig,l,igcm_ccnco2_number) * tauscaling(ig) + threshold >= 1) then
 
-        call updaterice_microco2(dble(zq(ig,l,igcm_co2_ice)), dble(zq(ig,l,igcm_ccnco2_mass)), dble(zq(ig,l,igcm_ccnco2_number)), &
-                                 tauscaling(ig), riceco2(ig,l), rhocloudco2(ig,l))
-
+        call updaterice_microco2(dble(zq(ig,l,igcm_co2_ice)), dble(zq(ig,l,igcm_ccnco2_mass)), &
+                                 dble(zq(ig,l,igcm_ccnco2_number)), zt(ig,l), tauscaling(ig), riceco2(ig,l), &
+                                 rhocloudco2(ig,l))
         Ic_rice = 0.
 
@@ -594,30 +593,4 @@
   end subroutine improvedCO2clouds
 
-
-!**********************************************************************************************************************!
-!**********************************************************************************************************************!
-
-
-!======================================================================================================================!
-! SUBROUTINE: density_co2_ice =========================================================================================!
-!======================================================================================================================!
-! Subject:
-!---------
-!   Compute co2 ice particles density
-!======================================================================================================================!
-  subroutine density_co2_ice(temperature, density)
-
-  implicit none
-
-  double precision, intent(in) :: &
-     temperature
-
-  double precision, intent(out) :: &
-     density
-
-  density = 1000. * (1.72391 - 2.53e-4*temperature - 2.87e-6*temperature*temperature)
-
-  end subroutine density_co2_ice
-
 end module improvedCO2clouds_mod
 
Index: trunk/LMDZ.MARS/libf/phymars/initracer.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/initracer.F	(revision 2491)
+++ trunk/LMDZ.MARS/libf/phymars/initracer.F	(revision 2494)
@@ -497,4 +497,6 @@
                       ! of the water-ice size distribution
 
+      nuiceco2_ref=0.2    !C.M. Effective variance nueff of the
+                          ! co2-ice size distribution
       if (doubleq) then
 c       "doubleq" technique 
Index: trunk/LMDZ.MARS/libf/phymars/phyredem.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/phyredem.F90	(revision 2491)
+++ trunk/LMDZ.MARS/libf/phymars/phyredem.F90	(revision 2494)
@@ -302,4 +302,10 @@
       endif ! of if (txt.eq."hdo_vap")
 
+      ! co2_ice has been added to co2ice in co2condens4micro
+      if (txt.eq."co2_ice") then
+        write(*,*)"physdem1: skipping co2_ice tracer"
+        cycle
+      end if     
+
       call put_field(trim(txt),"tracer on surface",qsurf(:,iq),time)
     enddo
@@ -317,4 +323,5 @@
      call put_field("dv_nonoro_gwd","Meridional wind tendency due to GW",dv_nonoro_gwd,time)
   endif
+
   ! Close file
   call close_restartphy
Index: trunk/LMDZ.MARS/libf/phymars/physiq_mod.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/physiq_mod.F	(revision 2491)
+++ trunk/LMDZ.MARS/libf/phymars/physiq_mod.F	(revision 2494)
@@ -1320,4 +1320,7 @@
 
 c        Calling vdif (Martian version WITH CO2 condensation)
+         dwatercap_dif(:) = 0.
+         zcdh(:) = 0.
+         zcdv(:) = 0.
          CALL vdifc(ngrid,nlayer,nq,co2ice,zpopsk,
      $        ptimestep,capcal,lwrite,
@@ -1640,9 +1643,7 @@
 
 c Temperature variation due to latent heat release
-c            if (activice) then  !Maybe create activice_co2 ?
                pdt(1:ngrid,1:nlayer) = 
      &              pdt(1:ngrid,1:nlayer) + 
      &              zdtcloudco2(1:ngrid,1:nlayer)! --> in co2condens
-c            endif
             
 
@@ -1942,4 +1943,6 @@
      $                  zdqssed_co2,zcondicea_co2microp,
      &                  zdtcloudco2)
+         ! no scavenging yet
+         zdqsc(:,:) = 0.
         else
           CALL co2condens(ngrid,nlayer,nq,ptimestep,
@@ -2810,6 +2813,6 @@
 c        WRITEDIAGFI can ALSO be called from any other subroutines
 c        for any variables !!
-c         call WRITEDIAGFI(ngrid,"emis","Surface emissivity","w.m-1",2,
-c     &                  emis)
+         call WRITEDIAGFI(ngrid,"emis","Surface emissivity","w.m-1",2,
+     &                  emis)
 c        call WRITEDIAGFI(ngrid,"pplay","Pressure","Pa",3,zplay)
 c        call WRITEDIAGFI(ngrid,"pplev","Pressure","Pa",3,zplev)
@@ -3346,8 +3349,4 @@
             call WRITEDIAGFI(ngrid,"q15um","15 um cooling","K/s",
      $           3,zdtnlte)
-            call WRITEDIAGFI(ngrid,"quv","UV heating","K/s",
-     $           3,zdteuv)
-            call WRITEDIAGFI(ngrid,"cond","Thermal conduction","K/s",
-     $           3,zdtconduc)
             call WRITEDIAGFI(ngrid,"qnir","NIR heating","K/s",
      $           3,zdtnirco2)
@@ -3486,14 +3485,4 @@
           endif
 
-c         CALL writeg1d(ngrid,nlayer,zt,'temp','K')
-c         CALL writeg1d(ngrid,nlayer,riceco2,'riceco2','m')
-c         CALL writeg1d(ngrid,nlayer,satuco2,'satuco2','satu')
-         
-         
-c         call WRITEDIAGFI(ngrid,"satuco2","vap in satu","kg/kg",1,
-c     &        satuco2)
-c         call WRITEDIAGFI(ngrid,"riceco2","ice radius","m"
-c     &        ,1,riceco2)
-! or output in diagfi.nc (for testphys1d)
          call WRITEDIAGFI(ngrid,'ps','Surface pressure','Pa',0,ps)
          call WRITEDIAGFI(ngrid,'temp','Temperature ',
Index: trunk/LMDZ.MARS/libf/phymars/suaer.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/suaer.F90	(revision 2491)
+++ trunk/LMDZ.MARS/libf/phymars/suaer.F90	(revision 2494)
@@ -164,5 +164,5 @@
         longrefvis(iaer) = 0.67E-6  ! 1.5um OMEGA/MEx
 !       Reference wavelength in the infrared:
-        longrefir(iaer) = 1E-6   ! 1 micron a vérifier si on prends cette valeur
+        longrefir(iaer) = 4.26E-6  ! 2347 cm-1 OMEGA/MEx
 !==================================================================
         CASE("stormdust_doubleq") aerkind   ! Two-moment scheme for stormdust - radiative properties
Index: trunk/LMDZ.MARS/libf/phymars/updaterad.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/updaterad.F90	(revision 2491)
+++ trunk/LMDZ.MARS/libf/phymars/updaterad.F90	(revision 2494)
@@ -100,8 +100,9 @@
 !============================================================================
 !============================================================================
-
-subroutine updaterice_microco2(qice,qccn,nccn,coeff,rice,rhocloudco2)
-use tracer_mod, only: rho_dust, rho_ice_co2
-USE comcstfi_h, only:  pi
+subroutine updaterice_microco2(qice, qccn, nccn, temperature, coeff, rice, rhocloudco2)
+use tracer_mod, only: rho_dust
+use comcstfi_h, only: pi
+use density_co2_ice_mod, only: density_co2_ice
+
 implicit none
 !CO2 clouds parameter update by CL and JA 09/16
@@ -109,25 +110,30 @@
 DOUBLE PRECISION, intent(in)  :: qice,qccn,nccn
 real, intent(in)  :: coeff         ! this coeff is tauscaling if microphy = T (possibly ccn_factor^-1 otherwise)
+real, intent(in)  :: temperature ! temperature effective for density co2_ice computation
 real, intent(out) :: rhocloudco2 ! rhocloud is needed for sedimentation and is also a good diagnostic variable
 double precision, intent(out) :: rice
 real nccn_true,qccn_true ! nombre et masse de CCN 
-    
+double precision :: rho_ice_co2T ! density co2_ice Temperature-dependent
+
 nccn_true = max(nccn * coeff, 1.e-30)
 qccn_true = max(qccn * coeff, 1.e-30)
 
-
-  rhocloudco2 = (qice *rho_ice_co2 + qccn_true*rho_dust) / (qice + qccn_true)
-
-  rhocloudco2 = min(max(rhocloudco2,rho_ice_co2),rho_dust)
-
-  rice = (qice + qccn_true) * 0.75 / pi / rhocloudco2 / nccn_true
-
-  if (rice .le. r3iceco2min) then !r3icemin radius power 3 ?
-    rice = riceco2min
-  else if (rice .ge. r3iceco2max) then !r3icemin radius power 3 ?
-    rice = riceco2max
-  else
-    rice = rice**(1./3.) ! here rice is always positive
-  endif
+call density_co2_ice(dble(temperature), rho_ice_co2T)
+
+rhocloudco2 = (qice * rho_ice_co2T + qccn_true*rho_dust) / (qice + qccn_true)
+
+rhocloudco2 = min(max(rhocloudco2,rho_ice_co2T), rho_dust)
+
+rice = (qice + qccn_true) * 0.75 / pi / rhocloudco2 / nccn_true
+
+rhocloudco2 = (qice * rho_ice_co2T + qccn_true*rho_dust) / (qice + qccn_true)
+
+if (rice .le. r3iceco2min) then !r3icemin radius power 3 ?
+  rice = riceco2min
+else if (rice .ge. r3iceco2max) then !r3icemin radius power 3 ?
+  rice = riceco2max
+else 
+  rice = rice**(1./3.) ! here rice is always positive
+endif
 
 
Index: trunk/LMDZ.MARS/libf/phymars/updatereffrad_mod.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/updatereffrad_mod.F	(revision 2491)
+++ trunk/LMDZ.MARS/libf/phymars/updatereffrad_mod.F	(revision 2494)
@@ -8,5 +8,5 @@
      &                rdust,rstormdust,rtopdust,rice,nuice,
      &                reffrad,nueffrad, riceco2, nuiceco2,
-     &                pq,tauscaling,tau,pplay)
+     &                pq,tauscaling,tau,pplay, pt)
        USE updaterad, ONLY: updaterdust, updaterice_micro,
      &                      updaterice_microco2, updaterice_typ
@@ -18,5 +18,6 @@
      &                       ref_r0, igcm_dust_submicron,
      &                       igcm_stormdust_mass,igcm_stormdust_number,
-     &                       igcm_topdust_mass,igcm_topdust_number
+     &                       igcm_topdust_mass,igcm_topdust_number,
+     &                       rho_ice
        USE dimradmars_mod, only: nueffdust,naerkind,
      &            name_iaer,
@@ -73,5 +74,5 @@
       double precision, INTENT(out) :: riceco2(ngrid,nlayer) ! co2 ice radius
       REAL, INTENT(out) :: nuiceco2(ngrid,nlayer)
-
+      REAL, INTENT(in) :: pt(ngrid,nlayer) ! temperature
      
 c     Local variables:
@@ -185,18 +186,7 @@
 
 
-c       1.3 CO2-ice particles --- in progress.....
-c       ----------------------- j'ai juste copié-collé la partie 1.2
+c       1.3 CO2-ice particles
 
         IF (co2clouds.AND.activeco2ice) THEN
-
-c    At firstcall, the true number and true mass of cloud condensation nuclei are not known.
-c    Indeed it is scaled on the prescribed dust opacity via a 'tauscaling' coefficient
-c    computed after radiative transfer. If tauscaling is not in startfi, we make an assumption for its value.
-
-          IF (firstcall) THEN
-            !IF (minval(tauscaling).lt.0) tauscaling(:) = 1.e-3 ! default value when non-read in startfi is -1
-            !IF (freedust)                tauscaling(:) = 1.    ! if freedust, enforce no rescaling at all
-            firstcall = .false.
-          ENDIF
           DO l=1,nlayer
             DO ig=1,ngrid
@@ -204,4 +194,5 @@
      &                              dble(pq(ig,l,igcm_ccnco2_mass)),
      &                              dble(pq(ig,l,igcm_ccnco2_number)),
+     &                              pt(ig,l),
      &                              tauscaling(ig),riceco2(ig,l),
      &                              rhocloudco2(ig,l))
@@ -266,5 +257,5 @@
           DO l=1,nlayer
             DO ig=1,ngrid
-              reffrad(ig,l,iaer)=riceco2(ig,l)*(1.+nuiceco2_ref)
+              reffrad(ig,l,iaer)=real(riceco2(ig,l))*(1.+nuiceco2_ref)
               nueffrad(ig,l,iaer)=nuiceco2_ref
             ENDDO
Index: trunk/LMDZ.MARS/libf/phymars/watercloud_mod.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/watercloud_mod.F	(revision 2491)
+++ trunk/LMDZ.MARS/libf/phymars/watercloud_mod.F	(revision 2494)
@@ -681,12 +681,12 @@
      &      ,"kg/kg.s-1",3,pdqcloud(1:ngrid,1:nlay,
      &      igcm_ccn_mass)) 
-      call WRITEDIAGFI(ngrid,"pdqccnN2","pdqcloudccnN apres 
-     &      microphysique","nb/kg.s-1",3,pdqcloud(1:ngrid,1:nlay,
+      call WRITEDIAGFI(ngrid,"pdqccnN2","pdqcloudccnN apres "//
+     &      "microphysique","nb/kg.s-1",3,pdqcloud(1:ngrid,1:nlay,
      &      igcm_ccn_number))
-      call WRITEDIAGFI(ngrid,"pdqdust2", "pdqclouddust apres
-     &      microphysique","kg/kg.s-1",3,pdqcloud(1:ngrid,1:nlay,
+      call WRITEDIAGFI(ngrid,"pdqdust2", "pdqclouddust apres "//
+     &      "microphysique","kg/kg.s-1",3,pdqcloud(1:ngrid,1:nlay,
      &      igcm_dust_mass))
-      call WRITEDIAGFI(ngrid,"pdqdustN2", "pdqclouddustN apres
-     &      microphysique","nb/kg.s-1",3,pdqcloud(1:ngrid,1:nlay,
+      call WRITEDIAGFI(ngrid,"pdqdustN2", "pdqclouddustN apres "//
+     &      "microphysique","nb/kg.s-1",3,pdqcloud(1:ngrid,1:nlay,
      &      igcm_dust_number)) 
 c=======================================================================
