Index: LMDZ6/trunk/libf/phylmd/cloudth_mod.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/cloudth_mod.F90	(revision 3494)
+++ LMDZ6/trunk/libf/phylmd/cloudth_mod.F90	(revision 3495)
@@ -1143,9 +1143,4 @@
       ctot_vol(ind1,ind2)=fraca(ind1,ind2)*cth_vol(ind1,ind2)+(1.-1.*fraca(ind1,ind2))*cenv_vol(ind1,ind2)
 
-
-
-
-
-
       ELSE IF (iflag_cloudth_vert == 5) THEN
       sigma1s=(0.71794+0.000498239*dz(ind1,ind2))*(fraca(ind1,ind2)**0.5)/(1-fraca(ind1,ind2))*(((sth-senv)**2)**0.5)+ratqs(ind1,ind2)*po(ind1) !Environment
@@ -1198,5 +1193,6 @@
       ENDIF ! of if (iflag_cloudth_vert==1 or 3 or 4)
 
-      if (ctot(ind1,ind2).lt.1.e-10) then
+!      if (ctot(ind1,ind2).lt.1.e-10) then
+      if (cenv(ind1,ind2).lt.1.e-10.or.cth(ind1,ind2).lt.1.e-10) then
       ctot(ind1,ind2)=0.
       ctot_vol(ind1,ind2)=0.
@@ -1225,23 +1221,26 @@
 !      qlbef=Max(po(ind1)-zqsatenv(ind1,ind2),0.)
       zthl(ind1,ind2)=t(ind1,ind2)*(101325/paprs(ind1,ind2))**(rdd/cppd)
-      alenv=(0.622*Lv*zqsatenv(ind1,ind2))/(rdd*zthl(ind1,ind2)**2)  
+      alenv=(0.622*Lv*zqsatenv(ind1,ind2))/(rdd*zthl(ind1,ind2)**2)
       aenv=1./(1.+(alenv*Lv/cppd))
-      senv=aenv*(po(ind1)-zqsatenv(ind1,ind2)) 
+      senv=aenv*(po(ind1)-zqsatenv(ind1,ind2))
+      sth=0.
       
 
       sigma1s=ratqs(ind1,ind2)*zqenv(ind1)
+      sigma2s=0.
 
       sqrt2pi=sqrt(2.*pi)
       xenv=senv/(sqrt(2.)*sigma1s)
       ctot(ind1,ind2)=0.5*(1.+1.*erf(xenv))
+      ctot_vol(ind1,ind2)=ctot(ind1,ind2)
       qltot(ind1,ind2)=sigma1s*((exp(-1.*xenv**2)/sqrt2pi)+xenv*sqrt(2.)*cenv(ind1,ind2))
       
       if (ctot(ind1,ind2).lt.1.e-3) then
       ctot(ind1,ind2)=0.
-      qcloud(ind1)=zqsatenv(ind1,ind2) 
+      qcloud(ind1)=zqsatenv(ind1,ind2)
 
       else   
                 
-      ctot(ind1,ind2)=ctot(ind1,ind2) 
+!      ctot(ind1,ind2)=ctot(ind1,ind2) 
       qcloud(ind1)=qltot(ind1,ind2)/ctot(ind1,ind2)+zqsatenv(ind1,ind2)
 
