Index: trunk/LMDZ.MARS/libf/phymars/updatereffrad.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/updatereffrad.F	(revision 742)
+++ trunk/LMDZ.MARS/libf/phymars/updatereffrad.F	(revision 744)
@@ -2,6 +2,6 @@
      &                rdust,rice,nuice,
      &                reffrad,nueffrad,
-     &                pq,tauscaling)
-
+     &                pq,tauscaling,tau,pplay)
+       USE updaterad
        IMPLICIT NONE
 c=======================================================================
@@ -46,5 +46,9 @@
 c     Tracer mass mixing ratio (kg/kg)
       REAL pq(ngrid,nlayer,nqmx)
-      real rdust(ngridmx,nlayermx) ! Dust geometric mean radius (m)
+      REAL rdust(ngridmx,nlayermx) ! Dust geometric mean radius (m)
+      
+      REAL pplay(ngrid,nlayer) ! altitude at the middle of the layers
+      REAL tau(ngrid,naerkind)
+
 
 c     Outputs:
@@ -96,8 +100,6 @@
           DO l=1,nlayer
             DO ig=1, ngrid
-              rdust(ig,l) = 
-     &          CBRT(r3n_q*pq(ig,l,igcm_dust_mass)/
-     &          max(pq(ig,l,igcm_dust_number),0.01))
-              rdust(ig,l)=min(max(rdust(ig,l),1.e-10),500.e-6)
+              call updaterdust(pq(ig,l,igcm_dust_mass),
+     &                         pq(ig,l,igcm_dust_number),rdust(ig,l))
               nueffdust(ig,l) = exp(varian**2.)-1.
              ENDDO
@@ -114,13 +116,16 @@
 c       1.2 Water-ice particles
 c       -----------------------
-        IF (water.AND.activice) THEN          
-          IF ((firstcall).or.(microphys.eqv..false.)) THEN
+
+        IF (water.AND.activice) THEN 
+         IF (microphys) THEN
+         
+          IF (firstcall) THEN
             DO l=1,nlayer
               DO ig=1,ngrid
-                rice(ig,l) = max(CBRT(
-     &            (pq(ig,l,igcm_h2o_ice)/rho_ice +
-     &            ccn0*(4./3.)*pi*rdust(ig,l)**3.) /
-     &            (ccn0*4./3.*pi)),rdust(ig,l) )
-                rice(ig,l)=min(max(rice(ig,l),1.e-10),500.e-6)
+                call updaterice_micro(pq(ig,l,igcm_h2o_ice),
+     &                                pq(ig,l,igcm_ccn_mass),
+     &                                pq(ig,l,igcm_ccn_number),
+     &                                1.e-3,rice(ig,l),
+     &                                rhocloud(ig,l))
                 nuice(ig,l) = nuice_ref
               ENDDO
@@ -130,24 +135,29 @@
 c    Indeed it is scaled on the prescribed dust opacity via a 'tauscaling' coefficient
 c    computed after radiative transfer.
-c    Therefore, we use a typical value ccn0 at firstcall, like it is done without microphysics.
           ELSE
             DO l=1,nlayer
               DO ig=1,ngrid
-                Mo = pq(ig,l,igcm_h2o_ice) + 
-     &              pq(ig,l,igcm_ccn_mass)* tauscaling(ig) + 1.e-30
-                No = pq(ig,l,igcm_ccn_number)* tauscaling(ig)+ 1e-30
-                rhocloud(ig,l) =  pq(ig,l,igcm_h2o_ice)*rho_ice / Mo
-     &           + pq(ig,l,igcm_ccn_mass)*tauscaling(ig)*rho_dust/Mo
-                rhocloud(ig,l) =
-     &            min(max(rhocloud(ig,l),rho_ice),rho_dust)
-                rice(ig,l) =
-     &           CBRT( Mo/No * 0.75 / pi / rhocloud(ig,l))
-                rice(ig,l)=min(max(rice(ig,l),1.e-10),500.e-6)
+                call updaterice_micro(pq(ig,l,igcm_h2o_ice),
+     &                                pq(ig,l,igcm_ccn_mass),
+     &                                pq(ig,l,igcm_ccn_number),
+     &                                tauscaling(ig),rice(ig,l),
+     &                                rhocloud(ig,l))
                 nuice(ig,l) = nuice_ref
-              ENDDO
-            ENDDO
-          ENDIF ! of if ((firstcall).or.(microphys.eq.false))
-        ENDIF ! of if (water.AND.activice)
-        
+               ENDDO
+             ENDDO
+          ENDIF ! of if firstcall
+          
+        ELSE ! if not microphys
+         
+          DO l=1,nlayer
+            DO ig=1,ngrid    
+              call updaterice_typ(pq(ig,l,igcm_h2o_ice),
+     &                          tau(ig,1),pplay(ig,l),rice(ig,l)) 
+              nuice(ig,l) = nuice_ref
+            ENDDO
+          ENDDO
+ 
+        ENDIF ! of if microphys
+       ENDIF ! of if (water.AND.activice)
 
 c==================================================================
