Index: LMDZ4/branches/IPSL-CM4_IPCC_patches/libf/dyn3d/conf_gcm.F
===================================================================
--- LMDZ4/branches/unlabeled-1.1.1/libf/dyn3d/conf_gcm.F	(revision 525)
+++ LMDZ4/branches/IPSL-CM4_IPCC_patches/libf/dyn3d/conf_gcm.F	(revision 540)
@@ -149,7 +149,7 @@
 !Config  Key  = iapp_tracvl
 !Config  Desc = frequence du groupement des flux 
-!Config  Def  = 5
+!Config  Def  = iperiod
 !Config  Help = frequence du groupement des flux (en pas de temps) 
-       iapp_tracvl = 5
+       iapp_tracvl = iperiod
        CALL getin('iapp_tracvl',iapp_tracvl)
 
Index: LMDZ4/branches/IPSL-CM4_IPCC_patches/libf/dyn3d/etat0_netcdf.F
===================================================================
--- LMDZ4/branches/unlabeled-1.1.1/libf/dyn3d/etat0_netcdf.F	(revision 525)
+++ LMDZ4/branches/IPSL-CM4_IPCC_patches/libf/dyn3d/etat0_netcdf.F	(revision 540)
@@ -51,4 +51,5 @@
       REAL :: pctsrf(klon, nbsrf)
       REAL :: t_ancien(klon,klev), q_ancien(klon,klev)      !
+      REAL :: run_off_lic_0(klon)
       real :: clwcon(klon,klev),rnebcon(klon,klev),ratqs(klon,klev)
       ! declarations pour lecture glace de mer
@@ -659,4 +660,5 @@
       rnebcon = 0.0
       ratqs = 0.0
+      run_off_lic_0 = 0.0
 
 cIM   call phyredem("startphy.nc",phystep,radpas, co2_ppm, solaire,
@@ -667,5 +669,6 @@
      $    radsol, frugs,  agesno, 
      $    zmea, zstd, zsig, zgam, zthe, zpic, zval, rugsrel, 
-     $    t_ancien, q_ancien, rnebcon, ratqs, clwcon)
+     $    t_ancien, q_ancien, rnebcon, ratqs, clwcon,
+     $    run_off_lic_0)
       print*,'sortie phyredem'
 
Index: LMDZ4/branches/IPSL-CM4_IPCC_patches/libf/dyn3d/startvar.F
===================================================================
--- LMDZ4/branches/unlabeled-1.1.1/libf/dyn3d/startvar.F	(revision 525)
+++ LMDZ4/branches/IPSL-CM4_IPCC_patches/libf/dyn3d/startvar.F	(revision 540)
@@ -558,9 +558,11 @@
     !  LOCAL
     !
-      REAL :: lev(1), date, dt
+!ac     REAL :: lev(1), date, dt
+      REAL :: date, dt
+      REAL, DIMENSION(:), ALLOCATABLE :: levphys_ini
+!ac
       INTEGER :: itau(1)
       INTEGER ::  llm_tmp, ttm_tmp
       INTEGER :: i, j
-      INTEGER :: iret
     !
       CHARACTER*25 title
@@ -579,12 +581,20 @@
      . ttm_tmp, fid_phys)
     !
-    !
       ALLOCATE (lat_phys(iml_phys,jml_phys))
       ALLOCATE (lon_phys(iml_phys,jml_phys))
+!ac
+      ALLOCATE (levphys_ini(llm_tmp))
+    !
+!      CALL flinopen(physfname, .FALSE., iml_phys, jml_phys, 
+!     . llm_tmp, lon_phys, lat_phys, lev, ttm_tmp, 
+!     . itau, date, dt, fid_phys)
     !
       CALL flinopen(physfname, .FALSE., iml_phys, jml_phys, 
-     . llm_tmp, lon_phys, lat_phys, lev, ttm_tmp, 
+     . llm_tmp, lon_phys, lat_phys, levphys_ini, ttm_tmp, 
      . itau, date, dt, fid_phys)
     !
+      DEALLOCATE (levphys_ini)
+!ac
+    !
     ! Allocate the space we will need to get the data out of this file
     !
@@ -593,7 +603,4 @@
     !   In case we have a file which is in degrees we do the transformation
     !
-      if (allocated(lon_rad)) DEALLOCATE(lon_rad, stat=iret)
-      if (allocated(lon_ini)) DEALLOCATE(lon_ini, stat=iret)
-
       ALLOCATE(lon_rad(iml_phys))
       ALLOCATE(lon_ini(iml_phys))
Index: LMDZ4/branches/IPSL-CM4_IPCC_patches/libf/phylmd/newmicro.F
===================================================================
--- LMDZ4/branches/unlabeled-1.1.1/libf/phylmd/newmicro.F	(revision 525)
+++ LMDZ4/branches/IPSL-CM4_IPCC_patches/libf/phylmd/newmicro.F	(revision 540)
@@ -193,5 +193,5 @@
      .           1.1 * ( (pqlwp(i,k) * pplay(i,k) / (RD * T(i,k)) )  
      .               / (4./3. * RPI * 1000. * cdnc_pi(i,k)) )**(1./3.)
-            radius = MAX(radius*1.e6, 3.) 
+            radius = MAX(radius*1.e6, 5.) 
             
             tc = t(i,k)-273.15
Index: LMDZ4/branches/IPSL-CM4_IPCC_patches/libf/phylmd/stdlevvar.F90
===================================================================
--- LMDZ4/branches/unlabeled-1.1.1/libf/phylmd/stdlevvar.F90	(revision 525)
+++ LMDZ4/branches/IPSL-CM4_IPCC_patches/libf/phylmd/stdlevvar.F90	(revision 540)
@@ -101,6 +101,10 @@
         ustar(i) = sqrt(cdram(i) * speed(i) * speed(i))
         zdte(i) = tpot(i) - ts1(i)
+!       PRINT*,'AVANT i,zdte',i,zdte(i)
 !IM cf FH : on prend le max : pour eviter le plantage sur SUN
-        zdte(i) = max(zdte(i),1.e-10)
+!IM BUG BUG BUG       zdte(i) = max(zdte(i),1.e-10)
+        zdte(i) = sign(max(abs(zdte(i)),1.e-10),zdte(i))
+!       PRINT*,'APRES i,zdte',i,zdte(i)
+!
         zdq(i) = max(q1(i),0.0) - max(qsurf(i),0.0)
 !
Index: LMDZ4/branches/IPSL-CM4_IPCC_patches/libf/phylmd/write_histday.h
===================================================================
--- LMDZ4/branches/unlabeled-1.1.1/libf/phylmd/write_histday.h	(revision 525)
+++ LMDZ4/branches/IPSL-CM4_IPCC_patches/libf/phylmd/write_histday.h	(revision 540)
@@ -326,4 +326,5 @@
       CALL histwrite(nid_day,"tsic",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
 c
+      zx_tmp_fi2d(1 : klon) = t2m(1 : klon, is_ter)
       CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d, zx_tmp_2d)
       CALL histwrite(nid_day,"t2mter",itau_w,zx_tmp_2d,iim*jjmp1,
