Index: /LMDZ5/trunk/libf/phylmd/conf_phys_m.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/conf_phys_m.F90	(revision 2005)
+++ /LMDZ5/trunk/libf/phylmd/conf_phys_m.F90	(revision 2006)
@@ -146,6 +146,8 @@
     INTEGER,SAVE :: iflag_pdf_omp
     INTEGER,SAVE :: iflag_ice_thermo_omp
+    INTEGER,SAVE :: iflag_t_glace_omp
     REAL,SAVE :: rad_froid_omp, rad_chau1_omp, rad_chau2_omp
     REAL,SAVE :: t_glace_min_omp, t_glace_max_omp
+    REAL,SAVE :: exposant_glace_omp
     REAL,SAVE :: rei_min_omp, rei_max_omp
     REAL,SAVE :: inertie_sol_omp,inertie_sno_omp,inertie_ice_omp
@@ -1006,4 +1008,22 @@
 
     !
+    !Config Key  = exposant_glace
+    !Config Desc =  
+    !Config Def  = 2.
+    !Config Help = 
+    !
+    exposant_glace_omp = 1.
+    call getin('exposant_glace',exposant_glace_omp)
+
+    !
+    !Config Key  = iflag_t_glace
+    !Config Desc =  
+    !Config Def  = 0
+    !Config Help = 
+    !
+    iflag_t_glace_omp = 0
+    call getin('iflag_t_glace',iflag_t_glace_omp)
+
+    !
     !Config Key  = iflag_ice_thermo
     !Config Desc =  
@@ -1764,4 +1784,6 @@
     t_glace_min = t_glace_min_omp
     t_glace_max = t_glace_max_omp
+    exposant_glace = exposant_glace_omp
+    iflag_t_glace = iflag_t_glace_omp
     iflag_ice_thermo = iflag_ice_thermo_omp
     rei_min = rei_min_omp
@@ -1993,4 +2015,6 @@
     write(lunout,*)' t_glace_min = ',t_glace_min
     write(lunout,*)' t_glace_max = ',t_glace_max
+    write(lunout,*)' exposant_glace = ',exposant_glace
+    write(lunout,*)' iflag_t_glace = ',iflag_t_glace
     write(lunout,*)' iflag_ice_thermo = ',iflag_ice_thermo
     write(lunout,*)' rei_min = ',rei_min
Index: /LMDZ5/trunk/libf/phylmd/fisrtilp.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/fisrtilp.F90	(revision 2005)
+++ /LMDZ5/trunk/libf/phylmd/fisrtilp.F90	(revision 2006)
@@ -13,4 +13,5 @@
   !
   USE dimphy
+  USE microphys_mod ! cloud microphysics (JBM 3/14)
   IMPLICIT none
   !======================================================================
@@ -26,4 +27,5 @@
   include "tracstoke.h"
   include "fisrtilp.h"
+  include "nuage.h" ! JBM (3/14)
   include "iniprint.h"
 
@@ -111,6 +113,10 @@
   REAL zoliq(klon), zcond(klon), zq(klon), zqn(klon), zdelq 
   REAL zoliqp(klon), zoliqi(klon)
-  REAL ztglace, zt(klon)
-  INTEGER nexpo ! exponentiel pour glace/eau
+  REAL zt(klon)
+! JBM (3/14) nexpo is replaced by exposant_glace
+! REAL nexpo ! exponentiel pour glace/eau
+! INTEGER, PARAMETER :: nexpo=6
+  INTEGER exposant_glace_old
+  REAL t_glace_min_old
   REAL zdz(klon),zrho(klon),ztot      , zrhol(klon)
   REAL zchau      ,zfroi      ,zfice(klon),zneb(klon)
@@ -202,11 +208,17 @@
   !  nexpo regle la raideur de la transition eau liquide / eau glace.
   !
-  ztglace = RTT - 15.0
-!AJ<
-  IF (ice_thermo) THEN
-    nexpo = 2
-  ELSE
-    nexpo = 6
+  IF (iflag_t_glace.EQ.0) THEN
+!   ztglace = RTT - 15.0
+    t_glace_min_old = RTT - 15.0
+    !AJ<
+    IF (ice_thermo) THEN
+!     nexpo = 2
+      exposant_glace_old = 2
+    ELSE
+!     nexpo = 6
+      exposant_glace_old = 6
+    ENDIF
   ENDIF
+  
 !!  RLVTT = 2.501e6 ! pas de redefinition des constantes physiques (jyg)
 !!  RLSTT = 2.834e6 ! pas de redefinition des constantes physiques (jyg)
@@ -710,9 +722,11 @@
         endif
      ELSE
+       IF (iflag_t_glace.EQ.0) THEN
          if (iflag_fisrtilp_qsat.lt.1) then
            DO i = 1, klon
-              zfice(i) = 1.0 - (zt(i)-ztglace) / (273.15-ztglace)
+              zfice(i) = 1.0 - (zt(i)-t_glace_min_old) / (273.15-t_glace_min_old)
               zfice(i) = MIN(MAX(zfice(i),0.0),1.0)
-              zfice(i) = zfice(i)**nexpo
+              zfice(i) = zfice(i)**exposant_glace_old
+!             zfice(i) = zfice(i)**nexpo
               zt(i) = zt(i) + (1.-zfice(i))*zcond(i) * RLVTT/RCPD/(1.0+RVTMP2*zq(i)) &
                        +zfice(i)*zcond(i) * RLSTT/RCPD/(1.0+RVTMP2*zq(i))
@@ -720,7 +734,8 @@
          else
            DO i=1, klon
-              zfice(i) = 1.0 - (zt(i)-ztglace) / (273.15-ztglace)
+              zfice(i) = 1.0 - (zt(i)-t_glace_min_old) / (273.15-t_glace_min_old)
               zfice(i) = MIN(MAX(zfice(i),0.0),1.0)
-              zfice(i) = zfice(i)**nexpo
+              zfice(i) = zfice(i)**exposant_glace_old
+!             zfice(i) = zfice(i)**nexpo
 !CR: ATTENTION zt different de Tbef: à corriger
               zt(i) = zt(i) + (1.-zfice(i))*zcond(i) * RLVTT/RCPD/(1.0+RVTMP2*(zq(i)+zcond(i))) &
@@ -729,4 +744,25 @@
          endif
 !         print*,zt(i),zrfl(i),zifl(i),'temp1'
+       ELSE ! of IF (iflag_t_glace.EQ.0)
+         if (iflag_fisrtilp_qsat.lt.1) then
+           DO i = 1, klon
+! JBM: icefrac_lsc is now a function contained in microphys_mod
+              zfice(i) = icefrac_lsc(zt(i), t_glace_min, &
+                                     t_glace_max, exposant_glace)
+              zt(i) = zt(i) + (1.-zfice(i))*zcond(i) * RLVTT/RCPD/(1.0+RVTMP2*zq(i)) &
+                       +zfice(i)*zcond(i) * RLSTT/RCPD/(1.0+RVTMP2*zq(i))
+           ENDDO
+         else
+           DO i=1, klon
+! JBM: icefrac_lsc is now a function contained in microphys_mod
+              zfice(i) = icefrac_lsc(zt(i), t_glace_min, &
+                                     t_glace_max, exposant_glace)
+!CR: ATTENTION zt different de Tbef: à corriger
+              zt(i) = zt(i) + (1.-zfice(i))*zcond(i) * RLVTT/RCPD/(1.0+RVTMP2*(zq(i)+zcond(i))) &
+                       +zfice(i)*zcond(i) * RLSTT/RCPD/(1.0+RVTMP2*(zq(i)+zcond(i)))
+           ENDDO
+         endif
+!         print*,zt(i),zrfl(i),zifl(i),'temp1'
+       ENDIF
      ENDIF
 !>AJ
@@ -743,12 +779,23 @@
 !AJ<
      IF (.NOT. ice_thermo) THEN
-     DO i = 1, klon
-        IF (rneb(i,k).GT.0.0) THEN
-           zfice(i) = 1.0 - (zt(i)-ztglace) / (273.13-ztglace)
-           zfice(i) = MIN(MAX(zfice(i),0.0),1.0)
-           zfice(i) = zfice(i)**nexpo
-     !!      zfice(i)=0.
-        ENDIF
-     ENDDO
+       IF (iflag_t_glace.EQ.0) THEN
+         DO i = 1, klon
+            IF (rneb(i,k).GT.0.0) THEN
+               zfice(i) = 1.0 - (zt(i)-t_glace_min_old) / (273.13-t_glace_min_old)
+               zfice(i) = MIN(MAX(zfice(i),0.0),1.0)
+               zfice(i) = zfice(i)**exposant_glace_old
+!              zfice(i) = zfice(i)**nexpo
+         !!      zfice(i)=0.
+            ENDIF
+         ENDDO
+       ELSE ! of IF (iflag_t_glace.EQ.0)
+         DO i = 1, klon
+            IF (rneb(i,k).GT.0.0) THEN
+! JBM: icefrac_lsc is now a function contained in microphys_mod
+              zfice(i) = icefrac_lsc(zt(i), t_glace_min, &
+                                     t_glace_max, exposant_glace)
+            ENDIF
+         ENDDO
+       ENDIF
      ENDIF
      DO i = 1, klon
@@ -895,9 +942,17 @@
         IF (rneb(i,k).GT.0.0.and.zprec_cond(i).gt.0.) THEN
            !AA lessivage nucleation LMD5 dans la couche elle-meme
-           if (t(i,k) .GE. ztglace) THEN
+          IF (iflag_t_glace.EQ.0) THEN
+           if (t(i,k) .GE. t_glace_min_old) THEN
               zalpha_tr = a_tr_sca(3)
            else
               zalpha_tr = a_tr_sca(4)
            endif
+          ELSE ! of IF (iflag_t_glace.EQ.0)
+           if (t(i,k) .GE. t_glace_min) THEN
+              zalpha_tr = a_tr_sca(3)
+           else
+              zalpha_tr = a_tr_sca(4)
+           endif
+          ENDIF
            zfrac_lessi = 1. - EXP(zalpha_tr*zprec_cond(i)/zneb(i))
            pfrac_nucl(i,k)=pfrac_nucl(i,k)*(1.-zneb(i)*zfrac_lessi)
@@ -915,9 +970,17 @@
         DO i = 1, klon
            IF (rneb(i,k).GT.0.0.and.zprec_cond(i).gt.0.) THEN
-              if (t(i,kk) .GE. ztglace) THEN
+             IF (iflag_t_glace.EQ.0) THEN
+              if (t(i,kk) .GE. t_glace_min_old) THEN
                  zalpha_tr = a_tr_sca(1)
               else
                  zalpha_tr = a_tr_sca(2)
               endif
+             ELSE ! of IF (iflag_t_glace.EQ.0)
+              if (t(i,kk) .GE. t_glace_min) THEN
+                 zalpha_tr = a_tr_sca(1)
+              else
+                 zalpha_tr = a_tr_sca(2)
+              endif
+             ENDIF
               zfrac_lessi = 1. - EXP(zalpha_tr*zprec_cond(i)/zneb(i))
               pfrac_impa(i,kk)=pfrac_impa(i,kk)*(1.-zneb(i)*zfrac_lessi)
Index: /LMDZ5/trunk/libf/phylmd/microphys_mod.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/microphys_mod.F90	(revision 2006)
+++ /LMDZ5/trunk/libf/phylmd/microphys_mod.F90	(revision 2006)
@@ -0,0 +1,31 @@
+!
+! $Header$
+!
+MODULE microphys_mod
+
+CONTAINS
+!*******************************************************************
+
+FUNCTION icefrac_lsc(temp, tmin, tmax, nexpo)
+  IMPLICIT NONE
+  !
+  ! Compute the ice fraction 1-xliq (see e.g.
+  ! Doutriaux-Boucher & Quaas 2004, section 2.2.)
+  !
+  ! (JBM 3/14)
+  REAL :: icefrac_lsc ! ice fraction 
+  REAL :: temp ! temperature
+  REAL :: tmin ! if T < Tmin, the cloud is only made of water ice
+  REAL :: tmax ! if T > Tmax, the cloud is only made of liquid water
+  REAL :: nexpo ! controls the sharpness of the transition
+
+  icefrac_lsc = 1.0 - (temp-tmin) / (tmax-tmin)
+  icefrac_lsc = MIN(MAX(icefrac_lsc,0.0),1.0)
+  icefrac_lsc = icefrac_lsc**nexpo
+
+  RETURN
+END FUNCTION icefrac_lsc
+
+!*******************************************************************
+!
+END MODULE microphys_mod
Index: /LMDZ5/trunk/libf/phylmd/newmicro.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/newmicro.F90	(revision 2005)
+++ /LMDZ5/trunk/libf/phylmd/newmicro.F90	(revision 2006)
@@ -12,4 +12,5 @@
     reffclwc, cldnvi, lcc3d, lcc3dcon, lcc3dstra
   USE phys_state_var_mod, ONLY: rnebcon, clwcon
+  USE microphys_mod ! cloud microphysics (JBM 3/14)
   IMPLICIT NONE
   ! ======================================================================
@@ -106,7 +107,11 @@
   PARAMETER (seuil_neb=0.001)
 
-  INTEGER nexpo ! exponentiel pour glace/eau
-  PARAMETER (nexpo=6)
-  ! PARAMETER (nexpo=1)
+! JBM (3/14) nexpo is replaced by exposant_glace
+! INTEGER nexpo ! exponentiel pour glace/eau
+! PARAMETER (nexpo=6)
+! PARAMETER (nexpo=1)
+! if iflag_t_glace=0, the old values are used:
+  REAL, PARAMETER :: t_glace_min_old = 258.
+  REAL, PARAMETER :: t_glace_max_old = 273.13
 
   REAL rel, tc, rei
@@ -180,18 +185,35 @@
   reice_pi = 0.
 
-  DO k = 1, klev
-    DO i = 1, klon
-      ! -layer calculation
-      rhodz(i, k) = (paprs(i,k)-paprs(i,k+1))/rg ! kg/m2
-      zrho(i, k) = pplay(i, k)/t(i, k)/rd ! kg/m3
-      dh(i, k) = rhodz(i, k)/zrho(i, k) ! m
-      ! -Fraction of ice in cloud using a linear transition
-      zfice(i, k) = 1.0 - (t(i,k)-t_glace_min)/(t_glace_max-t_glace_min)
-      zfice(i, k) = min(max(zfice(i,k),0.0), 1.0)
-      ! -IM Total Liquid/Ice water content
-      xflwc(i, k) = (1.-zfice(i,k))*pqlwp(i, k)
-      xfiwc(i, k) = zfice(i, k)*pqlwp(i, k)
-    END DO
-  END DO
+  IF (iflag_t_glace.EQ.0) THEN
+    DO k = 1, klev
+      DO i = 1, klon
+        ! -layer calculation
+        rhodz(i, k) = (paprs(i,k)-paprs(i,k+1))/rg ! kg/m2
+        zrho(i, k) = pplay(i, k)/t(i, k)/rd ! kg/m3
+        dh(i, k) = rhodz(i, k)/zrho(i, k) ! m
+        ! -Fraction of ice in cloud using a linear transition
+        zfice(i, k) = 1.0 - (t(i,k)-t_glace_min_old)/(t_glace_max_old-t_glace_min_old)
+        zfice(i, k) = min(max(zfice(i,k),0.0), 1.0)
+        ! -IM Total Liquid/Ice water content
+        xflwc(i, k) = (1.-zfice(i,k))*pqlwp(i, k)
+        xfiwc(i, k) = zfice(i, k)*pqlwp(i, k)
+      END DO
+    END DO
+  ELSE ! of IF (iflag_t_glace.EQ.0)
+    DO k = 1, klev
+      DO i = 1, klon
+        ! -layer calculation
+        rhodz(i, k) = (paprs(i,k)-paprs(i,k+1))/rg ! kg/m2
+        zrho(i, k) = pplay(i, k)/t(i, k)/rd ! kg/m3
+        dh(i, k) = rhodz(i, k)/zrho(i, k) ! m
+        ! JBM: icefrac_lsc is now a function contained in microphys_mod
+        zfice(i, k) = icefrac_lsc(t(i,k), t_glace_min, &
+                                  t_glace_max, exposant_glace)
+        ! -IM Total Liquid/Ice water content
+        xflwc(i, k) = (1.-zfice(i,k))*pqlwp(i, k)
+        xfiwc(i, k) = zfice(i, k)*pqlwp(i, k)
+      END DO
+    END DO
+  ENDIF
 
   IF (ok_cdnc) THEN
Index: /LMDZ5/trunk/libf/phylmd/nuage.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/nuage.F90	(revision 2005)
+++ /LMDZ5/trunk/libf/phylmd/nuage.F90	(revision 2006)
@@ -5,4 +5,5 @@
     cldtaupi, re, fl)
   USE dimphy
+  USE microphys_mod ! cloud microphysics (JBM 3/14)
   IMPLICIT NONE
   ! ======================================================================
@@ -34,4 +35,5 @@
 
   include "YOMCST.h"
+  include "nuage.h" ! JBM 3/14
 
   ! ym#include "dimensions.h"
@@ -54,14 +56,20 @@
   REAL zflwp, zradef, zfice, zmsac
 
-  REAL radius, rad_froid, rad_chaud, rad_chau1, rad_chau2
-  PARAMETER (rad_chau1=13.0, rad_chau2=9.0, rad_froid=35.0)
+  REAL radius, rad_chaud
+! JBM (3/14) parameters already defined in nuage.h:
+! REAL rad_froid, rad_chau1, rad_chau2
+! PARAMETER (rad_chau1=13.0, rad_chau2=9.0, rad_froid=35.0)
   ! cc      PARAMETER (rad_chaud=15.0, rad_froid=35.0)
   ! sintex initial      PARAMETER (rad_chaud=10.0, rad_froid=30.0)
   REAL coef, coef_froi, coef_chau
   PARAMETER (coef_chau=0.13, coef_froi=0.09)
-  REAL seuil_neb, t_glace
-  PARAMETER (seuil_neb=0.001, t_glace=273.0-15.0)
-  INTEGER nexpo ! exponentiel pour glace/eau
-  PARAMETER (nexpo=6)
+  REAL seuil_neb
+  PARAMETER (seuil_neb=0.001)
+! JBM (3/14) nexpo is replaced by exposant_glace
+! REAL nexpo ! exponentiel pour glace/eau
+! PARAMETER (nexpo=6.)
+  REAL, PARAMETER :: t_glace_min_old = 258.
+  INTEGER, PARAMETER :: exposant_glace_old = 6
+
 
   ! jq for the aerosol indirect effect
@@ -96,7 +104,13 @@
       pclc(i, k) = max(pclc(i,k), seuil_neb)
       zflwp = 1000.*pqlwp(i, k)/rg/pclc(i, k)*(paprs(i,k)-paprs(i,k+1))
-      zfice = 1.0 - (t(i,k)-t_glace)/(273.13-t_glace)
-      zfice = min(max(zfice,0.0), 1.0)
-      zfice = zfice**nexpo
+      IF (iflag_t_glace.EQ.0) THEN
+        zfice = 1.0 - (t(i,k)-t_glace_min_old)/(273.13-t_glace_min_old)
+        zfice = min(max(zfice,0.0), 1.0)
+        zfice = zfice**exposant_glace_old
+      ELSE ! of IF (iflag_t_glace.EQ.0)
+! JBM: icefrac_lsc is now a function contained in microphys_mod
+        zfice = icefrac_lsc(t(i,k), t_glace_min, &
+                            t_glace_max, exposant_glace)
+      ENDIF
 
       IF (ok_aie) THEN
Index: /LMDZ5/trunk/libf/phylmd/nuage.h
===================================================================
--- /LMDZ5/trunk/libf/phylmd/nuage.h	(revision 2005)
+++ /LMDZ5/trunk/libf/phylmd/nuage.h	(revision 2006)
@@ -3,7 +3,11 @@
 !
       REAL rad_froid, rad_chau1, rad_chau2, t_glace_max, t_glace_min
+      REAL exposant_glace
       REAL rei_min,rei_max
 
+      INTEGER iflag_t_glace
+
       common /nuagecom/ rad_froid,rad_chau1, rad_chau2,t_glace_max,     &
-     &                  t_glace_min,rei_min,rei_max
+     &                  t_glace_min,exposant_glace,rei_min,rei_max,     &
+     &                  iflag_t_glace
 !$OMP THREADPRIVATE(/nuagecom/)
Index: /LMDZ5/trunk/libf/phylmd/physiq.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/physiq.F90	(revision 2005)
+++ /LMDZ5/trunk/libf/phylmd/physiq.F90	(revision 2006)
@@ -512,5 +512,6 @@
   EXTERNAL fisrtilp  ! schema de condensation a grande echelle (pluie)
   !AA 
-  EXTERNAL fisrtilp_tr ! schema de condensation a grande echelle (pluie)
+! JBM (3/14) fisrtilp_tr not loaded
+! EXTERNAL fisrtilp_tr ! schema de condensation a grande echelle (pluie)
   !                          ! stockage des coefficients necessaires au
   !                          ! lessivage OFF-LINE et ON-LINE
