Index: LMDZ4/trunk/libf/phylmd/newmicro.F
===================================================================
--- LMDZ4/trunk/libf/phylmd/newmicro.F	(revision 1146)
+++ LMDZ4/trunk/libf/phylmd/newmicro.F	(revision 1279)
@@ -1,5 +1,4 @@
-!
-! $Header$
-!
+! $Id$
+!     
       SUBROUTINE newmicro (paprs, pplay,ok_newmicro,
      .                  t, pqlwp, pclc, pcltau, pclemi,
@@ -7,7 +6,8 @@
      s                  xflwp, xfiwp, xflwc, xfiwc,
      e                  ok_aie, 
-     e                  sulfate, sulfate_pi, 
+     e                  mass_solu_aero, mass_solu_aero_pi, 
      e                  bl95_b0, bl95_b1,
-     s                  cldtaupi, re, fl)
+     s                  cldtaupi, re, fl, reliq, reice)
+
       USE dimphy
       IMPLICIT none
@@ -22,6 +22,6 @@
 c 
 c ok_aie--input-L-apply aerosol indirect effect or not
-c sulfate-input-R-sulfate aerosol mass concentration [um/m^3]
-c sulfate_pi-input-R-dito, pre-industrial value
+c mass_solu_aero-----input-R-total mass concentration for all soluble aerosols[ug/m^3]
+c mass_solu_aero_pi--input-R-dito, pre-industrial value
 c bl95_b0-input-R-a parameter, may be varied for tests (s-sea, l-land)
 c bl95_b1-input-R-a parameter, may be varied for tests (    -"-      )
@@ -94,8 +94,8 @@
       LOGICAL ok_a1lwpdep       ! a1 LWP dependent?
       
-      REAL sulfate(klon, klev)  ! sulfate aerosol mass concentration [ug m-3]
+      REAL mass_solu_aero(klon, klev)    ! total mass concentration for all soluble aerosols [ug m-3]
+      REAL mass_solu_aero_pi(klon, klev) ! - " - (pre-industrial value)
       REAL cdnc(klon, klev)     ! cloud droplet number concentration [m-3]
       REAL re(klon, klev)       ! cloud droplet effective radius [um]
-      REAL sulfate_pi(klon, klev)  ! sulfate aerosol mass concentration [ug m-3] (pre-industrial value)
       REAL cdnc_pi(klon, klev)     ! cloud droplet number concentration [m-3] (pi value)
       REAL re_pi(klon, klev)       ! cloud droplet effective radius [um] (pi value)
@@ -119,4 +119,7 @@
       REAL diff_paprs(klon, klev), zfice1, zfice2(klon, klev)
       REAL rad_chaud_tab(klon, klev), zflwp_var, zfiwp_var
+
+! Abderrahmane oct 2009
+      Real reliq(klon, klev), reice(klon, klev)
 
 c
@@ -157,5 +160,5 @@
                                 !             
                   cdnc(i,k) = 10.**(bl95_b0+bl95_b1*
-     &                 log(MAX(sulfate(i,k),1.e-4))/log(10.))*1.e6 !-m-3
+     &               log(MAX(mass_solu_aero(i,k),1.e-4))/log(10.))*1.e6 !-m-3
                                 ! Cloud droplet number concentration (CDNC) is restricted
                                 ! to be within [20, 1000 cm^3]
@@ -165,5 +168,5 @@
                                 !
                   cdnc_pi(i,k) = 10.**(bl95_b0+bl95_b1*
-     &                 log(MAX(sulfate_pi(i,k),1.e-4))/log(10.))*1.e6 !-m-3
+     &               log(MAX(mass_solu_aero_pi(i,k),1.e-4))/log(10.))*1.e6 !-m-3
                   cdnc_pi(i,k)=MIN(1000.e6,MAX(20.e6,cdnc_pi(i,k)))
                ENDDO
@@ -221,4 +224,6 @@
                   re(i,k) = rad_chaud_tab(i,k)*fl(i,k)
                   
+                  rel = 0.
+                  rei = 0.
                   pclc(i,k) = 0.0
                   pcltau(i,k) = 0.0
@@ -252,4 +257,5 @@
                      cldtaupi(i,k) = 3.0/2.0 * zflwp_var / radius
      &                    + zfiwp_var * (3.448e-03  + 2.431/rei)
+
                   ENDIF         ! ok_aie
                                 ! For output diagnostics
@@ -280,7 +286,7 @@
 c     for ice clouds, Ebert & Curry (1992)] 
                   
-                  if (zflwp_var.eq.0.) rel = 1. 
-                  if (zfiwp_var.eq.0. .or. rei.le.0.) rei = 1. 
-                  pcltau(i,k) = 3.0/2.0 * ( zflwp_var/rel )
+                 if (zflwp_var.eq.0.) rel = 1. 
+                 if (zfiwp_var.eq.0. .or. rei.le.0.) rei = 1. 
+                 pcltau(i,k) = 3.0/2.0 * ( zflwp_var/rel )
      &                 + zfiwp_var * (3.448e-03  + 2.431/rei)
 c     -- cloud infrared emissivity:
@@ -296,5 +302,12 @@
 
                ENDIF
-               
+              reliq(i,k)=rel
+              reice(i,k)=rei 
+!              if (i.eq.1) then
+!              print*,'Dans newmicro rel, rei :',rel, rei
+!              print*,'Dans newmicro reliq, reice :',
+!     $             reliq(i,k),reice(i,k)
+!              endif
+
             ENDDO
          ENDDO
@@ -400,16 +413,16 @@
             DO i = 1, klon
                zclear(i)=zclear(i)*(1.-MAX(pclc(i,k),zcloud(i)))
-     &              /(1.-MIN(zcloud(i),1.-ZEPSEC))
+     &              /(1.-MIN(real(zcloud(i), kind=8),1.-ZEPSEC))
                pct(i)=1.-zclear(i) 
                IF (pplay(i,k).LE.cetahb*paprs(i,1)) THEN
                   pch(i) = pch(i)*(1.-MAX(pclc(i,k),zcloud(i)))
-     &                 /(1.-MIN(zcloud(i),1.-ZEPSEC))
+     &                 /(1.-MIN(real(zcloud(i), kind=8),1.-ZEPSEC))
                ELSE IF (pplay(i,k).GT.cetahb*paprs(i,1) .AND.
      &                 pplay(i,k).LE.cetamb*paprs(i,1)) THEN
                   pcm(i) = pcm(i)*(1.-MAX(pclc(i,k),zcloud(i)))
-     &                 /(1.-MIN(zcloud(i),1.-ZEPSEC))
+     &                 /(1.-MIN(real(zcloud(i), kind=8),1.-ZEPSEC))
                ELSE IF (pplay(i,k).GT.cetamb*paprs(i,1)) THEN 
                   pcl(i) = pcl(i)*(1.-MAX(pclc(i,k),zcloud(i)))
-     &                 /(1.-MIN(zcloud(i),1.-ZEPSEC))
+     &                 /(1.-MIN(real(zcloud(i), kind=8),1.-ZEPSEC))
                endif
                zcloud(i)=pclc(i,k)
