Index: LMDZ.3.3/branches/rel-LF/libf/phylmd/calcratqs.F
===================================================================
--- LMDZ.3.3/branches/rel-LF/libf/phylmd/calcratqs.F	(revision 289)
+++ LMDZ.3.3/branches/rel-LF/libf/phylmd/calcratqs.F	(revision 290)
@@ -53,4 +53,5 @@
       flag_ratqs=1
       flag_ratqs=0
+	zpt_conv=0.
 c
 c Appeler le processus de condensation a grande echelle
Index: LMDZ.3.3/branches/rel-LF/libf/phylmd/clmain.F
===================================================================
--- LMDZ.3.3/branches/rel-LF/libf/phylmd/clmain.F	(revision 289)
+++ LMDZ.3.3/branches/rel-LF/libf/phylmd/clmain.F	(revision 290)
@@ -285,5 +285,9 @@
       y_flux_u = 0.0
       y_flux_v = 0.0
+C$$ PB
+      y_dflux_t = 0.0
+      y_dflux_q = 0.0
       ytsoil = 999999.
+      yrugoro = 0.
 
       DO nsrf = 1, nbsrf
@@ -466,4 +470,5 @@
 c
 c calculer la longueur de rugosite sur ocean
+      yrugm=0.
       IF (nsrf.EQ.is_oce) THEN
       DO j = 1, knon
@@ -499,5 +504,5 @@
         ENDDO
       ENDDO
-      
+
 
       evap(:,nsrf) = - flux_q(:,1,nsrf)
@@ -805,15 +810,22 @@
 C Appel a interfsurf (appel generique) routine d'interface avec la surface
 
+c initialisation
+       petAcoef =0. 
+	peqAcoef = 0.
+	petBcoef =0.
+	peqBcoef = 0.
+	p1lay =0.
+	
 c      do i = 1, knon
-        petAcoef=zx_ch(:,1)
-        peqAcoef=zx_cq(:,1)
-        petBcoef=zx_dh(:,1)
-        peqBcoef=zx_dq(:,1)
-        tq_cdrag=coef(:,1)
-        temp_air=t(:,1)
-        epot_air=local_h(:,1)
-        spechum=q(:,1)
-        p1lay = pplay(:,1)
-        zlev1 = delp(:,1)
+        petAcoef(1:knon) = zx_ch(1:knon,1)
+        peqAcoef(1:knon) = zx_cq(1:knon,1)
+        petBcoef(1:knon) =  zx_dh(1:knon,1)
+        peqBcoef(1:knon) = zx_dq(1:knon,1)
+        tq_cdrag(1:knon) =coef(1:knon,1)
+        temp_air(1:knon) =t(1:knon,1)
+        epot_air(1:knon) =local_h(1:knon,1)
+        spechum(1:knon)=q(1:knon,1)
+        p1lay(1:knon) = pplay(1:knon,1)
+        zlev1(1:knon) = delp(1:knon,1)
         swnet = swdown * (1. - albedo)
 c      enddo
Index: LMDZ.3.3/branches/rel-LF/libf/phylmd/interface_surf.F90
===================================================================
--- LMDZ.3.3/branches/rel-LF/libf/phylmd/interface_surf.F90	(revision 289)
+++ LMDZ.3.3/branches/rel-LF/libf/phylmd/interface_surf.F90	(revision 290)
@@ -42,6 +42,7 @@
   real, allocatable, dimension(:),save    :: run_off
   real, allocatable, dimension(:),save    :: coastalflow, riverflow
-
-
+!!$PB
+  REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: tmp_rriv, tmp_rcoa
+!!$
   CONTAINS
 !
@@ -268,4 +269,16 @@
         call abort_gcm(modname,abort_message,1)
       endif
+!!$PB
+      ALLOCATE (tmp_rriv(iim,jjm+1), stat=error)
+      if (error /= 0) then
+        abort_message='Pb allocation tmp_rriv'
+        call abort_gcm(modname,abort_message,1)
+      endif
+      ALLOCATE (tmp_rcoa(iim,jjm+1), stat=error)
+      if (error /= 0) then
+        abort_message='Pb allocation tmp_rcoa'
+        call abort_gcm(modname,abort_message,1)
+      endif
+!!$
     else if (size(coastalflow) /= knon) then
       write(*,*)'Bizarre, le nombre de points continentaux'
@@ -768,4 +781,5 @@
   integer :: indi, indj
   integer, dimension(klon) :: ktindex
+  REAL, dimension(klon) :: bidule
 ! Essai cdrag
   real, dimension(klon) :: cdrag
@@ -1061,11 +1075,18 @@
      & lon_scat, lat_scat)
 
-!  alb_new(:) = (albedo_out(:,1) + albedo_out(:,2)) / 2.
-  alb_new(1:knon) = albedo_out(1:knon,1) 
-  alblw(1:knon) = albedo_out(1:knon,2)
+    bidule=0.
+    bidule(1:knon)=riverflow(1:knon)
+    call gath2cpl(bidule, tmp_rriv, klon, knon,iim,jjm,                  ktindex)
+    bidule=0.
+    bidule(1:knon)=coastalflow(1:knon)
+    call gath2cpl(bidule, tmp_rcoa, klon, knon,iim,jjm,                  ktindex)
+    alb_new(1:knon) = albedo_out(1:knon,1) 
+    alblw(1:knon) = albedo_out(1:knon,2)
+
 
 ! Convention orchidee: positif vers le haut
-  fluxsens = -1. * fluxsens
-  fluxlat  = -1. * fluxlat
+  fluxsens(1:knon) = -1. * fluxsens(1:knon)
+  fluxlat(1:knon)  = -1. * fluxlat(1:knon)
+
 !  evap     = -1. * evap
 
@@ -1170,10 +1191,14 @@
   real, allocatable, dimension(:,:),save :: cpl_snow, cpl_evap, cpl_tsol
   real, allocatable, dimension(:,:),save :: cpl_fder, cpl_albe, cpl_taux
-  real, allocatable, dimension(:,:),save :: cpl_tauy, cpl_rriv, cpl_rcoa
+!!$PB  real, allocatable, dimension(:,:),save :: cpl_tauy, cpl_rriv, cpl_rcoa
+  real, allocatable, dimension(:,:),save :: cpl_tauy
+  real, allocatable, dimension(:,:),save :: cpl_rriv, cpl_rcoa
+!!$
 ! variables tampons avant le passage au coupleur
   real, allocatable, dimension(:,:,:),save :: tmp_sols, tmp_nsol, tmp_rain
   real, allocatable, dimension(:,:,:),save :: tmp_snow, tmp_evap, tmp_tsol
   real, allocatable, dimension(:,:,:),save :: tmp_fder, tmp_albe, tmp_taux
-  real, allocatable, dimension(:,:,:),save :: tmp_tauy, tmp_rriv, tmp_rcoa
+!!$  real, allocatable, dimension(:,:,:),save :: tmp_tauy, tmp_rriv, tmp_rcoa
+  REAL, ALLOCATABLE, DIMENSION(:,:,:),SAVE :: tmp_tauy
 ! variables a passer au coupleur
   real, dimension(iim, jjm+1) :: wri_sol_ice, wri_sol_sea, wri_nsol_ice 
@@ -1245,6 +1270,10 @@
     allocate(cpl_taux(klon,2), stat = error); sum_error = sum_error + error
     allocate(cpl_tauy(klon,2), stat = error); sum_error = sum_error + error
-    allocate(cpl_rcoa(klon,2), stat = error); sum_error = sum_error + error
-    allocate(cpl_rriv(klon,2), stat = error); sum_error = sum_error + error
+!!$PB
+!!$    allocate(cpl_rcoa(klon,2), stat = error); sum_error = sum_error + error
+!!$    allocate(cpl_rriv(klon,2), stat = error); sum_error = sum_error + error
+    ALLOCATE(cpl_rriv(iim,jjm+1), stat=error); sum_error = sum_error + error
+    ALLOCATE(cpl_rcoa(iim,jjm+1), stat=error); sum_error = sum_error + error
+!!
     allocate(read_sst(iim, jjm+1), stat = error); sum_error = sum_error + error
     allocate(read_sic(iim, jjm+1), stat = error); sum_error = sum_error + error
@@ -1347,9 +1376,13 @@
       cpl_tauy(ig,cpl_index) = cpl_tauy(ig,cpl_index) &
        &                          + tauy(ig)        / FLOAT(nexca)
-      cpl_rriv(ig,cpl_index) = cpl_rriv(ig,cpl_index) &
-       &                          + riverflow(ig)   / FLOAT(nexca)/dtime
-      cpl_rcoa(ig,cpl_index) = cpl_rcoa(ig,cpl_index) &
-       &                          + coastalflow(ig) / FLOAT(nexca)/dtime
+!!$      cpl_rriv(ig,cpl_index) = cpl_rriv(ig,cpl_index) &
+!!$       &                          + riverflow(ig)   / FLOAT(nexca)/dtime
+!!$      cpl_rcoa(ig,cpl_index) = cpl_rcoa(ig,cpl_index) &
+!!$       &                          + coastalflow(ig) / FLOAT(nexca)/dtime
     enddo
+    IF (cpl_index .EQ. 1) THEN 
+        cpl_rriv(:,:) = cpl_rriv(:,:) + tmp_rriv(:,:) / FLOAT(nexca)
+        cpl_rcoa(:,:) = cpl_rcoa(:,:) + tmp_rcoa(:,:) / FLOAT(nexca)
+    ENDIF
   endif
 
@@ -1448,6 +1481,6 @@
       allocate(tmp_taux(iim,jjm+1,2), stat=error); sum_error = sum_error + error
       allocate(tmp_tauy(iim,jjm+1,2), stat=error); sum_error = sum_error + error
-      allocate(tmp_rriv(iim,jjm+1,2), stat=error); sum_error = sum_error + error
-      allocate(tmp_rcoa(iim,jjm+1,2), stat=error); sum_error = sum_error + error
+!!$      allocate(tmp_rriv(iim,jjm+1,2), stat=error); sum_error = sum_error + error
+!!$      allocate(tmp_rcoa(iim,jjm+1,2), stat=error); sum_error = sum_error + error
       if (sum_error /= 0) then
         abort_message='Pb allocation variables couplees pour l''ecriture'
@@ -1471,6 +1504,6 @@
     call gath2cpl(cpl_taux(1,cpl_index), tmp_taux(1,1,cpl_index), klon, knon,iim,jjm,                  knindex)
     call gath2cpl(cpl_tauy(1,cpl_index), tmp_tauy(1,1,cpl_index), klon, knon,iim,jjm,                  knindex)
-    call gath2cpl(cpl_rriv(1,cpl_index), tmp_rriv(1,1,cpl_index), klon, knon,iim,jjm,                  knindex)
-    call gath2cpl(cpl_rcoa(1,cpl_index), tmp_rcoa(1,1,cpl_index), klon, knon,iim,jjm,                  knindex)
+!!$    call gath2cpl(cpl_rriv(1,cpl_index), tmp_rriv(1,1,cpl_index), klon, knon,iim,jjm,                  knindex)
+!!$    call gath2cpl(cpl_rcoa(1,cpl_index), tmp_rcoa(1,1,cpl_index), klon, knon,iim,jjm,                  knindex)
 
 !
@@ -1490,4 +1523,8 @@
       wri_evap_ice = tmp_evap(:,:,2)
       wri_evap_sea = tmp_evap(:,:,1)
+!!$PB
+      wri_rriv = cpl_rriv(:,:)
+      wri_rcoa = cpl_rcoa(:,:)
+
       where (tamp_zmasq /= 1.)
         deno =  tamp_srf(:,:,1) + tamp_srf(:,:,2)
@@ -1496,8 +1533,9 @@
         wri_snow = tmp_snow(:,:,1) * tamp_srf(:,:,1) / deno +    &
       &            tmp_snow(:,:,2) * tamp_srf(:,:,2) / deno
-        wri_rriv = tmp_rriv(:,:,1) * tamp_srf(:,:,1) / deno +    &
-      &            tmp_rriv(:,:,2) * tamp_srf(:,:,2) / deno
-        wri_rcoa = tmp_rcoa(:,:,1) * tamp_srf(:,:,1) / deno +    &
-      &            tmp_rcoa(:,:,2) * tamp_srf(:,:,2) / deno
+!!$PB
+!!$        wri_rriv = tmp_rriv(:,:,1) * tamp_srf(:,:,1) / deno +    &
+!!$      &            tmp_rriv(:,:,2) * tamp_srf(:,:,2) / deno
+!!$        wri_rcoa = tmp_rcoa(:,:,1) * tamp_srf(:,:,1) / deno +    &
+!!$      &            tmp_rcoa(:,:,2) * tamp_srf(:,:,2) / deno
         wri_taux = tmp_taux(:,:,1) * tamp_srf(:,:,1) / deno +    &
       &            tmp_taux(:,:,2) * tamp_srf(:,:,2) / deno
@@ -1557,5 +1595,6 @@
       & wri_nsol_sea, wri_fder_ice, wri_evap_ice, wri_evap_sea, wri_rain, &
       & wri_snow, wri_rcoa, wri_rriv, wri_tauxx, wri_tauyy, wri_tauzz, &
-      & wri_tauxx, wri_tauyy, wri_tauzz,lafin ) 
+      & wri_tauxx, wri_tauyy, wri_tauzz,lafin )
+! 
       cpl_sols = 0.; cpl_nsol = 0.; cpl_rain = 0.; cpl_snow = 0.
       cpl_evap = 0.; cpl_tsol = 0.; cpl_fder = 0.; cpl_albe = 0.
@@ -1575,6 +1614,7 @@
       deallocate(tmp_taux, stat=error); sum_error = sum_error + error
       deallocate(tmp_tauy, stat=error); sum_error = sum_error + error
-      deallocate(tmp_rriv, stat=error); sum_error = sum_error + error
-      deallocate(tmp_rcoa, stat=error); sum_error = sum_error + error
+!!$PB
+!!$      deallocate(tmp_rriv, stat=error); sum_error = sum_error + error
+!!$      deallocate(tmp_rcoa, stat=error); sum_error = sum_error + error
       if (sum_error /= 0) then
         abort_message='Pb deallocation variables couplees'
@@ -2133,4 +2173,9 @@
 ! Initialisation
 !
+  evap = 0.
+  fluxsens=0.
+  fluxlat=0.
+  dflux_s = 0.
+  dflux_l = 0.	
 !
 ! zx_qs = qsat en kg/kg
Index: LMDZ.3.3/branches/rel-LF/libf/phylmd/physiq.F
===================================================================
--- LMDZ.3.3/branches/rel-LF/libf/phylmd/physiq.F	(revision 289)
+++ LMDZ.3.3/branches/rel-LF/libf/phylmd/physiq.F	(revision 290)
@@ -1640,4 +1640,9 @@
 c
       ENDIF
+
+c$$$PB Positionner date0 pour initialisation de ORCHIDEE
+c$$$      date0 = zjulian
+      date0 = day_ini
+      WRITE(*,*) 'physiq date0 : ',date0
 c
 c
