Index: /LMDZ4/trunk/libf/phylmd/interface_surf.F90
===================================================================
--- /LMDZ4/trunk/libf/phylmd/interface_surf.F90	(revision 556)
+++ /LMDZ4/trunk/libf/phylmd/interface_surf.F90	(revision 557)
@@ -1327,5 +1327,7 @@
   INTEGER :: ndexct(iim*(jjm+1)),ndexcs(iim*(jjm+1))
   REAL :: zx_lon(iim,jjm+1), zx_lat(iim,jjm+1), zjulian
-  integer :: idayref, itau_w
+  INTEGER,save :: idayref
+!med  integer :: itau_w
+  integer,save :: itau_w
 #include "param_cou.h"
 #include "inc_cpl.h"
@@ -1392,6 +1394,11 @@
 !
     idtime = int(dtime)
-    call inicma(npas , nexca, idtime,(jjm+1)*iim)
-
+#ifdef CPP_COUPLE
+#ifdef CPP_PSMILE
+   CALL inicma(iim, (jjm+1))
+#else
+   call inicma(npas , nexca, idtime,(jjm+1)*iim)
+#endif
+#endif
 !
 ! initialisation sorties netcdf
@@ -1497,6 +1504,14 @@
     if (nisurf == is_oce .and. .not. cumul) then
       if (check) write(*,*)'rentree fromcpl, itime-1 = ',itime-1
+#ifdef CPP_COUPLE
+#ifdef CPP_PSMILE
+      il_time_secs=(itime-1)*dtime
+      CALL fromcpl(il_time_secs, iim, (jjm+1),                           &
+     &        read_sst, read_sic, read_sit, read_alb_sic)
+#else
       call fromcpl(itime-1,(jjm+1)*iim,                                  &
      &        read_sst, read_sic, read_sit, read_alb_sic)
+#endif
+#endif
 !
 ! sorties NETCDF des champs recus
@@ -1697,8 +1712,19 @@
       CALL histsync(nidct)
 ! pas utile      IF (lafin) CALL histclo(nidct)
+#ifdef CPP_COUPLE
+#ifdef CPP_PSMILE
+      il_time_secs=(itime-1)*dtime
+
+      CALL intocpl(il_time_secs, iim, jjm+1, wri_sol_ice, wri_sol_sea, wri_nsol_ice,&
+      & wri_nsol_sea, wri_fder_ice, wri_evap_ice, wri_evap_sea, wri_rain, &
+      & wri_snow, wri_rcoa, wri_rriv, wri_calv, wri_tauxx, wri_tauyy,     &
+      & wri_tauzz, wri_tauxx, wri_tauyy, wri_tauzz,lafin )
+#else
       call intocpl(itime, (jjm+1)*iim, wri_sol_ice, wri_sol_sea, wri_nsol_ice,&
       & wri_nsol_sea, wri_fder_ice, wri_evap_ice, wri_evap_sea, wri_rain, &
       & wri_snow, wri_rcoa, wri_rriv, wri_calv, wri_tauxx, wri_tauyy,     &
       & wri_tauzz, wri_tauxx, wri_tauyy, wri_tauzz,lafin )
+#endif
+#endif
 ! 
       cpl_sols = 0.; cpl_nsol = 0.; cpl_rain = 0.; cpl_snow = 0.
@@ -2582,5 +2608,5 @@
 
 #include "YOETHF.inc"
-#include "FCTTRE.inc"
+!rv#include "FCTTRE.inc"
 #include "indicesol.inc"
 !IM cf JLD
@@ -2639,4 +2665,5 @@
   logical,save         :: first = .true.,second=.false.
   real                 :: coeff_rel
+#include "FCTTRE.inc"
 
 
Index: /LMDZ4/trunk/libf/phylmd/physiq.F
===================================================================
--- /LMDZ4/trunk/libf/phylmd/physiq.F	(revision 556)
+++ /LMDZ4/trunk/libf/phylmd/physiq.F	(revision 557)
@@ -34,11 +34,11 @@
 c   CLEFS CPP POUR LES IO
 c   =====================
-c #define histhf
+#define histhf
 #define histday
 #define histmth
 #define histins
-c #define histISCCP
-c #define histREGDYN
-c #define histmthNMC
+c#define histISCCP
+#define histREGDYN
+#define histmthNMC
 c======================================================================
 c    modif   ( P. Le Van ,  12/10/98 )
@@ -982,4 +982,19 @@
 #include "FCTTRE.h"
 c======================================================================
+!rv
+      u10m(:,:)=0.
+      v10m(:,:)=0.
+      t2m(:,:)=0.
+      q2m(:,:)=0.
+      ffonte(:,:)=0.
+      fqcalving(:,:)=0.
+      piz_ae(:,:,:)=0.
+      tau_ae(:,:,:)=0.
+      cg_ae(:,:,:)=0.
+      rain_con(:)=0.
+      snow_con(:)=0.
+      bl95_b0=0.
+      bl95_b1=0.
+!rv
       modname = 'physiq'
       IF (if_ebil.ge.1) THEN
@@ -1004,5 +1019,5 @@
 c======================================================================
 cIM BEG
-        DO k=1, nlev
+        DO k=1, nlevENS
           DO l=1, nlevSTD
 c
@@ -1870,15 +1885,16 @@
       entr_therm(:,:)=0.
 c
-      print*,'AVANT LA CONVECTION SECHE , iflag_thermals='
+      IF(prt_level>9)WRITE(lunout,*)
+     .    'AVANT LA CONVECTION SECHE , iflag_thermals='
      s   ,iflag_thermals,'   nsplit_thermals=',nsplit_thermals
       if(iflag_thermals.lt.0) then
 c  Rien
 c  ====
-         print*,'pas de convection'
+         IF(prt_level>9)WRITE(lunout,*)'pas de convection'
       else if(iflag_thermals.eq.0) then
 
 c  Ajustement sec
 c  ==============
-         print*,'ajsec'
+         IF(prt_level>9)WRITE(lunout,*)'ajsec'
          CALL ajsec(paprs, pplay, t_seri,q_seri, d_t_ajs, d_q_ajs)
          t_seri(:,:) = t_seri(:,:) + d_t_ajs(:,:)
@@ -1887,5 +1903,5 @@
 c  Thermiques
 c  ==========
-         print*,'JUSTE AVANT , iflag_thermals='
+         IF(prt_level>9)WRITE(lunout,*)'JUSTE AVANT , iflag_thermals='
      s   ,iflag_thermals,'   nsplit_thermals=',nsplit_thermals
          call calltherm(pdtphys
Index: /LMDZ4/trunk/libf/phylmd/radlwsw.F
===================================================================
--- /LMDZ4/trunk/libf/phylmd/radlwsw.F	(revision 556)
+++ /LMDZ4/trunk/libf/phylmd/radlwsw.F	(revision 557)
@@ -166,4 +166,9 @@
       REAL*8 ztopswai(kdlon), zsolswai(kdlon) ! dito, indirect
 cjq-end
+!rv
+      tauae(:,:,:)=0.
+      pizae(:,:,:)=0.
+      cgae(:,:,:)=0.
+!rv
       
 c
@@ -546,6 +551,15 @@
       REAL*8 ZFSUPAI(KDLON,KFLEV+1)
       REAL*8 ZFSDNAI(KDLON,KFLEV+1)
+      logical initialized
       SAVE ZFSUPAD, ZFSDNAD, ZFSUPAI, ZFSDNAI ! aerosol fluxes
+!rv
+      save flag_aer
+      data initialized/.false./
 cjq-end
+      if(.not.initialized) then
+        flag_aer=0.
+        initialized=.TRUE.
+      endif
+!rv
       
 c
