Index: trunk/LMDZ.GENERIC/libf/phystd/ave_stelspec.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/ave_stelspec.F90	(revision 862)
+++ trunk/LMDZ.GENERIC/libf/phystd/ave_stelspec.F90	(revision 863)
@@ -98,12 +98,17 @@
 	   Case(6)
             file_id='/stellar_spectra/BD_Teff-1600K.txt'
-            tstellar=1600. ! Segura et al. (2003)
+            tstellar=1600. 
             file_id_lam='/stellar_spectra/lamBD.txt'
             Nfine=5000
 	   Case(7)
             file_id='/stellar_spectra/BD_Teff-1000K.txt'
-            tstellar=1000. ! Segura et al. (2003)
+            tstellar=1000. 
             file_id_lam='/stellar_spectra/lamBD.txt'
             Nfine=5000
+	   Case(8)
+            file_id='/stellar_spectra/Flux_K5_Teff4700_logg4.5_Met-0.5_BTsettle.dat'
+            tstellar=4700. 
+            file_id_lam='/stellar_spectra/lambda_K5_Teff4700_logg4.5_Met-0.5_BTsettle.dat'
+            Nfine=3986
 	   Case Default
             print*,'Error: unknown star type chosen'
Index: trunk/LMDZ.GENERIC/libf/phystd/dimphys.h
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/dimphys.h	(revision 862)
+++ trunk/LMDZ.GENERIC/libf/phystd/dimphys.h	(revision 863)
@@ -9,6 +9,6 @@
 ! nsoilmx : number of subterranean layers
       !integer, parameter :: nsoilmx = 4 ! for a test 
-      integer, parameter :: nsoilmx = 18 ! for z1=0.0002 cm, depth = 18 m => mars case 
-      !integer, parameter :: nsoilmx = 13 ! for z1=0.03 cm, depth = 104.8 m => earth case
+      integer, parameter :: nsoilmx = 18 ! for z1=0.0002 m, depth = 18 m => mars case 
+      !integer, parameter :: nsoilmx = 13 ! for z1=0.03 m, depth = 104.8 m => earth case
 !-----------------------------------------------------------------------
 
Index: trunk/LMDZ.GENERIC/libf/phystd/hydrol.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/hydrol.F90	(revision 862)
+++ trunk/LMDZ.GENERIC/libf/phystd/hydrol.F90	(revision 863)
@@ -91,9 +91,7 @@
       real ztsurf(ngrid)
 
-      integer ivap, iliq, iice
-      save ivap, iliq, iice
-
-      logical firstcall
-      save firstcall
+      integer, save :: ivap, iliq, iice
+
+      logical, save :: firstcall
 
       data firstcall /.true./
@@ -333,5 +331,6 @@
          enddo
 
-      endif
+      endif         
+
 
 !     Re-add the albedo effects of CO2 ice if necessary
Index: trunk/LMDZ.GENERIC/libf/phystd/largescale.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/largescale.F90	(revision 862)
+++ trunk/LMDZ.GENERIC/libf/phystd/largescale.F90	(revision 863)
@@ -138,5 +138,5 @@
 	       zcond(i) = zcond(i) + zcond_iter
 	       if (ABS(zcond_iter/alpha).lt.qthreshold) exit
-	       zt(i) = zt(i) + zcond_iter*RLVTT/RCPD
+	       zt(i) = zt(i) + zcond_iter*RLVTT/RCPD*rneb(i,k)
                call Psat_water(zt(i),pplay(i,k),psat_tmp,zqs(i))
 	    End do ! niter
Index: trunk/LMDZ.GENERIC/libf/phystd/physiq.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/physiq.F90	(revision 862)
+++ trunk/LMDZ.GENERIC/libf/phystd/physiq.F90	(revision 863)
@@ -240,4 +240,5 @@
       
       real zdmassmr(ngrid,nlayermx),zdpsrfmr(ngrid)
+      real zdmassmr_col(ngridmx)
 
       real zdqdif(ngrid,nlayermx,nq), zdqsdif(ngrid,nq)
@@ -1242,7 +1243,11 @@
 		 + dqmoist(1:ngrid,1:nlayermx,igcm_h2o_vap)             &
 		 + dqvaplscale(1:ngrid,1:nlayermx) )
-		 
+
+            do ig = 1, ngrid
+	       zdmassmr_col(ig)=SUM(zdmassmr(ig,1:nlayermx))
+            enddo
             
 	    call writediagfi(ngrid,"mass_evap","mass gain"," ",3,zdmassmr)
+	    call writediagfi(ngrid,"mass_evap_col","mass gain col"," ",2,zdmassmr_col)
 	    call writediagfi(ngrid,"mass","mass"," ",3,mass)
 
@@ -1702,7 +1707,7 @@
 !     Temporary inclusions for heating diagnostics
 !        call writediagfi(ngrid,"zdtdyn","Dyn. heating","T s-1",3,zdtdyn)
-!        call writediagfi(ngrid,"zdtsw","SW heating","T s-1",3,zdtsw)
-!        call writediagfi(ngrid,"zdtlw","LW heating","T s-1",3,zdtlw)
-!        call writediagfi(ngrid,"dtrad","radiative heating","K s-1",3,dtrad)
+        call writediagfi(ngrid,"zdtsw","SW heating","T s-1",3,zdtsw)
+        call writediagfi(ngrid,"zdtlw","LW heating","T s-1",3,zdtlw)
+        call writediagfi(ngrid,"dtrad","radiative heating","K s-1",3,dtrad)
 
         ! debugging
Index: trunk/LMDZ.GENERIC/libf/phystd/radii_mod.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/radii_mod.F90	(revision 862)
+++ trunk/LMDZ.GENERIC/libf/phystd/radii_mod.F90	(revision 863)
@@ -119,5 +119,4 @@
 
 !==================================================================
-!   subroutine h2o_reffrad(ngrid,nq,pq,pt,reffrad,nueffrad)
    subroutine h2o_reffrad(ngrid,pq,pt,reffrad,nueffrad)
 !==================================================================
@@ -131,8 +130,5 @@
 !
 !==================================================================
-!      use radinc_h, only: naerkind
       use watercommon_h, Only: T_h2O_ice_liq,T_h2O_ice_clouds,rhowater,rhowaterice
-!      use aerosol_mod, only : iaero_h2o
-!      USE tracer_h, only: igcm_h2o_ice
       Implicit none
 
@@ -143,13 +139,9 @@
 
       integer,intent(in) :: ngrid
-!      intent,integer(in) :: nq
-
-!      real, intent(in) :: pq(ngrid,nlayermx,nq) !tracer mixing ratios (kg/kg)
+
       real, intent(in) :: pq(ngrid,nlayermx) !water ice mixing ratios (kg/kg)
       real, intent(in) :: pt(ngrid,nlayermx) !temperature (K)
       real, intent(out) :: reffrad(ngrid,nlayermx)      !aerosol radii
-!      real, intent(out) :: reffrad(ngrid,nlayermx,naerkind)      !aerosols radii
       real, intent(out) :: nueffrad(ngrid,nlayermx) ! dispersion      
-!      real, intent(out) :: nueffrad(ngrid,nlayermx,naerkind) ! dispersion      
 
       integer :: ig,l
@@ -163,7 +155,5 @@
                zfice = 1.0 - (pt(ig,l)-T_h2O_ice_clouds) / (T_h2O_ice_liq-T_h2O_ice_clouds)
                zfice = MIN(MAX(zfice,0.0),1.0)
-!               reffrad(ig,l,iaero_h2o)= rad_h2o * (1.-zfice) + rad_h2o_ice * zfice
                reffrad(ig,l)= rad_h2o * (1.-zfice) + rad_h2o_ice * zfice
-!               nueffrad(ig,l,iaero_h2o) = coef_chaud * (1.-zfice) + coef_froid * zfice
                nueffrad(ig,l) = coef_chaud * (1.-zfice) + coef_froid * zfice
             enddo
@@ -174,13 +164,10 @@
                zfice = 1.0 - (pt(ig,l)-T_h2O_ice_clouds) / (T_h2O_ice_liq-T_h2O_ice_clouds)
                zfice = MIN(MAX(zfice,0.0),1.0)
-!	       zrad_liq  = CBRT( 3*pq(ig,l,igcm_h2o_ice)/(4*Nmix_h2o*pi*rhowater) )
 	       zrad_liq  = CBRT( 3*pq(ig,l)/(4*Nmix_h2o*pi*rhowater) )
-!	       zrad_ice  = CBRT( 3*pq(ig,l,igcm_h2o_ice)/(4*Nmix_h2o_ice*pi*rhowaterice) )
 	       zrad_ice  = CBRT( 3*pq(ig,l)/(4*Nmix_h2o_ice*pi*rhowaterice) )
-!               nueffrad(ig,l,iaero_h2o) = coef_chaud * (1.-zfice) + coef_froid * zfice
                nueffrad(ig,l) = coef_chaud * (1.-zfice) + coef_froid * zfice
                zrad = zrad_liq * (1.-zfice) + zrad_ice * zfice
-!	       reffrad(ig,l,iaero_h2o) = min(max(zrad,1.e-6),100.e-6)
-	       reffrad(ig,l) = min(max(zrad,1.e-6),100.e-6)
+
+	       reffrad(ig,l) = min(max(zrad,1.e-6),1000.e-6)
                enddo
             enddo      
@@ -204,5 +191,4 @@
 !==================================================================
       use watercommon_h, Only: rhowater,rhowaterice
-!      USE tracer_h
       Implicit none
 
@@ -225,7 +211,7 @@
       else
 	 reffliq(1:ngrid,1:nlayermx)  = CBRT( 3*pql(1:ngrid,1:nlayermx)/(4*Nmix_h2o*pi*rhowater) )
-	 reffliq(1:ngrid,1:nlayermx)  = min(max(reffliq(1:ngrid,1:nlayermx),1.e-6),100.e-6)
+	 reffliq(1:ngrid,1:nlayermx)  = min(max(reffliq(1:ngrid,1:nlayermx),1.e-6),1000.e-6)
 	 reffice(1:ngrid,1:nlayermx)  = CBRT( 3*pql(1:ngrid,1:nlayermx)/(4*Nmix_h2o_ice*pi*rhowaterice) )
-	 reffice(1:ngrid,1:nlayermx)  = min(max(reffice(1:ngrid,1:nlayermx),1.e-6),100.e-6)
+	 reffice(1:ngrid,1:nlayermx)  = min(max(reffice(1:ngrid,1:nlayermx),1.e-6),1000.e-6)
       end if
 
@@ -247,6 +233,4 @@
 !
 !==================================================================
-!      use radinc_h, only: naerkind
-!      use aerosol_mod, only : iaero_co2
       USE tracer_h, only:igcm_co2_ice,rho_co2
       Implicit none
@@ -260,6 +244,5 @@
 
       real, intent(in) :: pq(ngrid,nlayermx,nq) !tracer mixing ratios (kg/kg)
-!      real, intent(out) :: reffrad(ngrid,nlayermx,naerkind)      !aerosols radii (K)
-      real, intent(out) :: reffrad(ngrid,nlayermx)      !aerosols radii (K)
+      real, intent(out) :: reffrad(ngrid,nlayermx)      !co2 ice particles radii (K)
 
       integer :: ig,l
@@ -270,5 +253,4 @@
 
       if (radfixed) then
-!         reffrad(1:ngrid,1:nlayermx,iaero_co2) = 5.e-5 ! CO2 ice
          reffrad(1:ngrid,1:nlayermx) = 5.e-5 ! CO2 ice
       else
@@ -276,5 +258,4 @@
             do ig=1,ngrid
                zrad = CBRT( 3*pq(ig,l,igcm_co2_ice)/(4*Nmix_co2*pi*rho_co2) )
-!               reffrad(ig,l,iaero_co2) = min(max(zrad,1.e-6),100.e-6)
                reffrad(ig,l) = min(max(zrad,1.e-6),100.e-6)
             enddo
@@ -299,18 +280,14 @@
 !
 !==================================================================
-!      use radinc_h, only: naerkind
-!      use aerosol_mod, only : iaero_dust
-      Implicit none
-
-#include "callkeys.h"
-#include "dimensions.h"
-#include "dimphys.h"
-
-      integer,intent(in) :: ngrid
-
-!      real, intent(out) :: reffrad(ngrid,nlayermx,naerkind)      !aerosols radii (K)
-      real, intent(out) :: reffrad(ngrid,nlayermx)      !aerosols radii (K)
+      Implicit none
+
+#include "callkeys.h"
+#include "dimensions.h"
+#include "dimphys.h"
+
+      integer,intent(in) :: ngrid
+
+      real, intent(out) :: reffrad(ngrid,nlayermx)      !dust particles radii (K)
             
-!      reffrad(1:ngrid,1:nlayermx,iaero_dust) = 2.e-6 ! dust
       reffrad(1:ngrid,1:nlayermx) = 2.e-6 ! dust
 
@@ -331,18 +308,14 @@
 !
 !==================================================================
-!      use radinc_h, only: naerkind
-!      use aerosol_mod, only : iaero_h2so4
-      Implicit none
-
-#include "callkeys.h"
-#include "dimensions.h"
-#include "dimphys.h"
-
-      integer,intent(in) :: ngrid
-
-!      real, intent(out) :: reffrad(ngrid,nlayermx,naerkind)      !aerosols radii (K)
-      real, intent(out) :: reffrad(ngrid,nlayermx)      !aerosols radii (K)
+      Implicit none
+
+#include "callkeys.h"
+#include "dimensions.h"
+#include "dimphys.h"
+
+      integer,intent(in) :: ngrid
+
+      real, intent(out) :: reffrad(ngrid,nlayermx)      !h2so4 particle radii (K)
                 
-!      reffrad(1:ngrid,1:nlayermx,iaero_h2so4) = 1.e-6 ! h2so4
       reffrad(1:ngrid,1:nlayermx) = 1.e-6 ! h2so4
 
Index: trunk/LMDZ.GENERIC/libf/phystd/rain.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/rain.F90	(revision 862)
+++ trunk/LMDZ.GENERIC/libf/phystd/rain.F90	(revision 863)
@@ -209,8 +209,8 @@
 
                   if(zt(i,k).gt.Tsat(i,k))then
-!		     treat the case where all liquid water should boil
-		     zqev=MIN((zt(i,k)-Tsat(i,k))*RCPD*l2c(i,k)/RLVTT,zrfl(i))
+!!		     treat the case where all liquid water should boil
+		     zqev=MIN((zt(i,k)-Tsat(i,k))*RCPD*l2c(i,k)/RLVTT/ptimestep,zrfl(i))
 		     zrfl(i)=MAX(zrfl(i)-zqev,0.)
-		     d_q(i,k)=zqev/l2c(i,k)
+		     d_q(i,k)=zqev/l2c(i,k)*ptimestep
 		     d_t(i,k) = - d_q(i,k) * RLVTT/RCPD
 		  else
