Index: LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/clesphys.h
===================================================================
--- LMDZ5/trunk/libf/phylmd/clesphys.h	(revision 2898)
+++ LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/clesphys.h	(revision 2924)
@@ -1,4 +1,2 @@
-
-!
 ! $Id$
 !
@@ -15,4 +13,6 @@
        INTEGER nbapp_rad, iflag_con, nbapp_cv, nbapp_wk, iflag_ener_conserv
        REAL co2_ppm, co2_ppm0, solaire
+!FC
+       REAL Cd_frein
        LOGICAL ok_suntime_rrtm
        REAL(kind=8) RCO2, RCH4, RN2O, RCFC11, RCFC12  
@@ -109,4 +109,6 @@
      &     , qsol0,albsno0,evap0                                        &
      &     , co2_ppm0                                                   &
+!FC
+     &     , Cd_frein                                                   &
      &     , ecrit_LES                                                  &
      &     , ecrit_ins, ecrit_hf, ecrit_day                             &
Index: LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/coef_diff_turb_mod.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/coef_diff_turb_mod.F90	(revision 2898)
+++ LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/coef_diff_turb_mod.F90	(revision 2924)
@@ -14,5 +14,5 @@
   SUBROUTINE coef_diff_turb(dtime, nsrf, knon, ni, &
        ypaprs, ypplay, yu, yv, yq, yt, yts, yqsurf, ycdragm, &
-       ycoefm, ycoefh ,yq2)
+       ycoefm, ycoefh ,yq2, ydrgpro)
  
     USE dimphy
@@ -37,4 +37,7 @@
     REAL, DIMENSION(klon), INTENT(IN)          :: yts, yqsurf
     REAL, DIMENSION(klon), INTENT(IN)          :: ycdragm
+!FC
+    REAL, DIMENSION(klon,klev), INTENT(IN)     :: ydrgpro
+
 
 ! InOutput arguments
@@ -167,5 +170,6 @@
                yzlev,yzlay,yu,yv,yteta, &
                ycdragm,yq2,ykmm,ykmn,ykmq,yustar, &
-               iflag_pbl)
+               iflag_pbl,ydrgpro)
+!FC
        ENDIF
        
Index: LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/compbl.h
===================================================================
--- LMDZ5/trunk/libf/phylmd/compbl.h	(revision 2898)
+++ LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/compbl.h	(revision 2924)
@@ -5,6 +5,8 @@
 !!      integer iflag_pbl,iflag_pbl_split
 !!      common/compbl/iflag_pbl,iflag_pbl_split
-      integer iflag_pbl, iflag_pbl_split, iflag_order2_sollw
-      common/compbl/iflag_pbl, iflag_pbl_split, iflag_order2_sollw
+!!FC      integer iflag_pbl, iflag_pbl_split, iflag_order2_sollw
+!FC      common/compbl/iflag_pbl, iflag_pbl_split, iflag_order2_sollw
+      integer iflag_pbl, iflag_pbl_split, iflag_order2_sollw, ifl_pbltree
+      common/compbl/iflag_pbl, iflag_pbl_split, iflag_order2_sollw, ifl_pbltree
 !>jyg+al1
 !$OMP THREADPRIVATE(/compbl/)
Index: LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/conf_phys_m.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/conf_phys_m.F90	(revision 2898)
+++ LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/conf_phys_m.F90	(revision 2924)
@@ -186,4 +186,8 @@
     INTEGER,SAVE :: iflag_pbl_omp,lev_histhf_omp,lev_histday_omp,lev_histmth_omp
     INTEGER,SAVE :: iflag_pbl_split_omp
+!FC
+    INTEGER,SAVE :: ifl_pbltree_omp
+    REAL,SAVE :: Cd_frein_omp
+!FC
     INTEGER,SAVE :: iflag_order2_sollw_omp
     INTEGER, SAVE :: lev_histins_omp, lev_histLES_omp 
@@ -1367,4 +1371,22 @@
     iflag_pbl_omp = 1
     CALL getin('iflag_pbl',iflag_pbl_omp)
+
+!FC
+    !Config Key  = ifl_pbltree
+    !Config Desc = drag from trees 0 no activated
+    !Config Def  = 0
+    !Config Help =
+    !
+    ifl_pbltree_omp = 0
+    CALL getin('ifl_pbltree',ifl_pbltree_omp)
+!FC
+    !Config Key  = Cd_frein
+    !Config Desc = drag from trees 
+    !Config Def  = 7.5E-02 (valeur Masson mais fait planter avec des LAI eleves)
+    !Config Help =
+    !
+    Cd_frein_omp = 7.5E-02
+    CALL getin('Cd_frein',Cd_frein_omp)
+
     !
     !Config Key  = iflag_pbl_split
@@ -2159,4 +2181,7 @@
     iflag_pbl = iflag_pbl_omp
     iflag_pbl_split = iflag_pbl_split_omp
+!FC
+    ifl_pbltree = ifl_pbltree_omp
+    Cd_frein    =Cd_frein_omp
     iflag_order2_sollw = iflag_order2_sollw_omp
     lev_histhf = lev_histhf_omp
@@ -2525,4 +2550,6 @@
     write(lunout,*)' freq_calNMC = ',freq_calNMC
     write(lunout,*)' iflag_pbl = ', iflag_pbl
+!FC
+    write(lunout,*)' ifl_pbltree = ', ifl_pbltree
     write(lunout,*)' iflag_pbl_split = ', iflag_pbl_split
     write(lunout,*)' iflag_order2_sollw = ', iflag_order2_sollw
Index: LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/indice_sol_mod.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/indice_sol_mod.F90	(revision 2898)
+++ LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/indice_sol_mod.F90	(revision 2924)
@@ -8,4 +8,6 @@
 
             CHARACTER(len=3), DIMENSION(nbsrf), PARAMETER :: clnsurf = (/'ter', 'lic', 'oce', 'sic'/)
+!FC 
+           INTEGER, SAVE    :: nvm_orch ! Nombre de type de vegetation ds ORCHIDEE                 
 
       END MODULE indice_sol_mod
Index: LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/pbl_surface_mod.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/pbl_surface_mod.F90	(revision 2898)
+++ LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/pbl_surface_mod.F90	(revision 2924)
@@ -39,4 +39,7 @@
   integer, save :: iflag_pbl_surface_t2m_bug
   !$OMP THREADPRIVATE(iflag_pbl_surface_t2m_bug)
+!FC
+!  integer, save :: iflag_frein
+!  !$OMP THREADPRIVATE(iflag_frein)
 
 CONTAINS
@@ -138,5 +141,8 @@
     iflag_pbl_surface_t2m_bug=0
     CALL getin_p('iflag_pbl_surface_t2m_bug',iflag_pbl_surface_t2m_bug)
-
+!FC
+!    iflag_frein = 0
+!    CALL getin_p('iflag_frein',iflag_frein)
+!
   END SUBROUTINE pbl_surface_init
 !  
@@ -196,4 +202,6 @@
 !!        tke_x,     tke_w                              &
        wake_dltke                                     &
+        , treedrg                                   &
+!FC
 !!!
                         )
@@ -281,4 +289,7 @@
     INCLUDE "compbl.h"
     INCLUDE "flux_arp.h"
+!FC 
+    INCLUDE "dimpft.h"
+
 !****************************************************************************************
     REAL,                         INTENT(IN)        :: dtime   ! time interval (s)
@@ -447,4 +458,7 @@
     REAL, DIMENSION(klon, klev, nbsrf), INTENT(OUT) :: flux_u     ! u wind tension (kg m/s)/(m**2 s) or Pascal
     REAL, DIMENSION(klon, klev, nbsrf), INTENT(OUT) :: flux_v     ! v wind tension (kg m/s)/(m**2 s) or Pascal
+!FC
+    REAL, DIMENSION(klon, klev, nbsrf), INTENT(INOUT)  :: treedrg      ! tree drag (m)               
+
 
 ! Output not needed
@@ -548,4 +562,14 @@
     REAL, DIMENSION(klon,klev+1)       :: ytke
     REAL, DIMENSION(klon,nsoilmx)      :: ytsoil
+!FC 
+    REAL, DIMENSION(klon,nvm_lmdz)          :: yveget
+    REAL, DIMENSION(klon,nvm_lmdz)          :: ylai
+    REAL, DIMENSION(klon,nvm_lmdz)          :: yheight
+    REAL, DIMENSION(klon,klev)              :: y_d_u_frein
+    REAL, DIMENSION(klon,klev)              :: y_d_v_frein
+    REAL, DIMENSION(klon,klev)              :: y_treedrg
+!FC
+
+
     CHARACTER(len=80)                  :: abort_message
     CHARACTER(len=20)                  :: modname = 'pbl_surface'
@@ -929,4 +953,7 @@
     yqsol = 0.0    
     ytherm = 0.0  ; ytke=0.
+!FC 
+    y_treedrg=0.
+
     ! Martin
     ysnowhgt = 0.0; yqsnow = 0.0     ; yrunoff = 0.0   ; ytoice =0.0
@@ -952,4 +979,10 @@
 !!!
     ytsoil = 999999. 
+!FC
+    y_d_u_frein(:,:)=0.
+    y_d_v_frein(:,:)=0.
+!FC
+
+
 
 
@@ -1240,4 +1273,9 @@
              ytke(j,k)   = tke_x(i,k,nsrf)
 !>jyg
+!FC
+             y_treedrg(j,k) =  treedrg(i,k,nsrf)
+!            print*,nsrf, "treedrg ",y_treedrg(j,k),j,k
+!FC
+
              yu(j,k) = u(i,k)
              yv(j,k) = v(i,k)
@@ -1435,5 +1473,7 @@
         CALL coef_diff_turb(dtime, nsrf, knon, ni,  &
             ypaprs, ypplay, yu, yv, yq, yt, yts, yqsurf, ycdragm, &
-            ycoefm, ycoefh, ytke)
+            ycoefm, ycoefh, ytke, y_treedrg)
+!            ycoefm, ycoefh, ytke)
+!FC y_treedrg ajouté
        IF (iflag_pbl>=20.AND.iflag_pbl<30) THEN
 ! In this case, coef_diff_turb is called for the Cd only
@@ -1462,5 +1502,7 @@
         CALL coef_diff_turb(dtime, nsrf, knon, ni,  &
             ypaprs, ypplay, yu_x, yv_x, yq_x, yt_x, yts_x, yqsurf, ycdragm_x, &
-            ycoefm_x, ycoefh_x, ytke_x)
+            ycoefm_x, ycoefh_x, ytke_x,y_treedrg)
+!            ycoefm_x, ycoefh_x, ytke_x)
+!FC doit on le mettre ( on ne l utilise pas si il y a du spliting)
        IF (iflag_pbl>=20.AND.iflag_pbl<30) THEN
 ! In this case, coef_diff_turb is called for the Cd only
@@ -1488,5 +1530,6 @@
         CALL coef_diff_turb(dtime, nsrf, knon, ni,  &
             ypaprs, ypplay, yu_w, yv_w, yq_w, yt_w, yts_w, yqsurf, ycdragm_w, &
-            ycoefm_w, ycoefh_w, ytke_w)
+            ycoefm_w, ycoefh_w, ytke_w,y_treedrg)
+!            ycoefm_w, ycoefh_w, ytke_w)
        IF (iflag_pbl>=20.AND.iflag_pbl<30) THEN
 ! In this case, coef_diff_turb is called for the Cd only
@@ -1775,5 +1818,14 @@
                yz0m, yz0h, SFRWL, yalb_dir_new, yalb_dif_new, yevap, yfluxsens,yfluxlat,&
                yqsurf, ytsurf_new, y_dflux_t, y_dflux_q, &
-               y_flux_u1, y_flux_v1 )
+               y_flux_u1, y_flux_v1, &
+               yveget,ylai,yheight )
+!FC quid qd yveget ylai yheight ne sont pas definit
+!FC  yveget,ylai,yheight, &
+            if (ifl_pbltree .eq. 1) then
+            CALL   freinage(knon, yu, yv, yt, &
+!              yveget,ylai, yheight,ypaprs,ypplay,y_d_u_frein,y_d_v_frein)
+              yveget,ylai, yheight,ypaprs,ypplay,y_treedrg, y_d_u_frein,y_d_v_frein)
+             endif
+
                
 ! Special DICE MPL 05082013 puis BOMEX
@@ -2182,4 +2234,14 @@
              y_d_u(j,k)  = y_d_u(j,k) * ypct(j)
              y_d_v(j,k)  = y_d_v(j,k) * ypct(j)
+!FC
+              if  (nsrf .EQ. is_ter .and. ifl_pbltree .eq. 1  ) then
+!            if (y_d_u_frein(j,k).ne.0. ) then
+!        print*, nsrf,'IS_TER ++', y_d_u_frein(j,k)*ypct(j),y_d_u(j,k),j,k
+!            endif
+             y_d_u(j,k) =y_d_u(j,k) + y_d_u_frein(j,k)*ypct(j)
+             y_d_v(j,k) =y_d_v(j,k) + y_d_v_frein(j,k)*ypct(j)
+             treedrg(i,k,nsrf)=y_treedrg(j,k)
+               endif
+!FC
 
              flux_t(i,k,nsrf) = y_flux_t(j,k)
Index: LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/phyetat0.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/phyetat0.F90	(revision 2898)
+++ LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/phyetat0.F90	(revision 2924)
@@ -18,5 +18,6 @@
        wake_deltat, wake_delta_pbl_TKE, delta_tsurf, wake_fip, wake_pe, &
        wake_s, wake_dens, zgam, zmax0, zmea, zpic, zsig, &
-       zstd, zthe, zval, ale_bl, ale_bl_trig, alp_bl, u10m, v10m
+       zstd, zthe, zval, ale_bl, ale_bl_trig, alp_bl, u10m, v10m, treedrg
+!FC
   USE geometry_mod, ONLY : longitude_deg, latitude_deg
   USE iostart, ONLY : close_startphy, get_field, get_var, open_startphy
@@ -319,4 +320,12 @@
      found=phyetat0_srf(1,z0h,"Z0h","Roughness length, enthalpy ",0.001)
   ENDIF
+!FC
+  !lecture du profile de freinage des arbres
+   IF (.not. found ) then
+     treedrg(:,1:klev,1:nbsrf)= 0.0
+   else
+  found=phyetat0_srf(klev,treedrg,"treedrg","freinage arbres",0.)
+   ENDIF
+
 
   ! Lecture de l'age de la neige:
Index: LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/phyredem.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/phyredem.F90	(revision 2898)
+++ LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/phyredem.F90	(revision 2924)
@@ -22,5 +22,6 @@
                                 wake_pe, wake_fip, fm_therm, entr_therm,     &
                                 detr_therm, Ale_bl, Ale_bl_trig, Alp_bl,     &
-                                du_gwd_rando, du_gwd_front, u10m, v10m
+                                du_gwd_rando, du_gwd_front, u10m, v10m,      &
+                                treedrg
   USE geometry_mod, ONLY : longitude_deg, latitude_deg
   USE iostart, ONLY: open_restartphy, close_restartphy, put_field, put_var
@@ -160,4 +161,7 @@
 ! ================== Tsoil =========================================
   CALL put_field_srf2("Tsoil","Temperature",tsoil(:,:,:))
+!FC
+  CALL put_field_srf2("treedrg","freinage arbres",treedrg(:,:,:))
+
 
   CALL put_field_srf1("QS"  , "Humidite",qsurf(:,:))
Index: LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/phys_output_ctrlout_mod.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/phys_output_ctrlout_mod.F90	(revision 2898)
+++ LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/phys_output_ctrlout_mod.F90	(revision 2924)
@@ -961,4 +961,16 @@
       ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'tke_sic',       &
       "Max Turb. Kinetic Energy "//clnsurf(4),"m2/s2", (/ ('', i=1, 10) /)) /)
+!FC
+!  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_treedrg_srf      = (/             &
+!      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'treedrg_ter',       &
+!      "Drag from trees "//clnsurf(1),"-", (/ ('', i=1, 10) /)), &
+!      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'treedrg_lic',       &
+!      "Drag from trees "//clnsurf(2),"-", (/ ('', i=1, 10) /)), &
+!      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'treedrg_oce',       &
+!      "Drag from trees "//clnsurf(3),"-", (/ ('', i=1, 10) /)), &
+!      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'treedrg_sic',       &
+!      "Drag from trees "//clnsurf(4),"-", (/ ('', i=1, 10) /)) /)
+!FC
+
 
   TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_l_mixmin      = (/             &
Index: LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/phys_output_write_mod.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/phys_output_write_mod.F90	(revision 2898)
+++ LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/phys_output_write_mod.F90	(revision 2924)
@@ -99,5 +99,5 @@
          o_SWdownOR, o_LWdownOR, o_snowl, &
          o_solldown, o_dtsvdfo, o_dtsvdft, &
-         o_dtsvdfg, o_dtsvdfi, o_z0m, o_z0h, o_od443aer, o_od550aer, &
+         o_dtsvdfg, o_dtsvdfi, o_z0m, o_z0h,  o_od443aer, o_od550aer, &
          o_dryod550aer, o_od865aer, o_abs550aer, o_od550lt1aer, &
          o_sconcso4, o_sconcno3, o_sconcoa, o_sconcbc, &
@@ -834,4 +834,8 @@
           ENDIF
 !>jyg
+!          IF (iflag_pbl > 1 .AND. ifl_pbltree  >=1 ) THEN
+!       CALL histwrite_phy(o_treedrg_srf(nsrf), treedrg(:,1:klev,nsrf))
+!            ENDIF
+
 
        ENDDO
@@ -1165,4 +1169,5 @@
        CALL histwrite_phy(o_z0m, z0m(:,nbsrf+1))
        CALL histwrite_phy(o_z0h, z0h(:,nbsrf+1))
+
        ! od550 per species
 !--OLIVIER
Index: LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/phys_state_var_mod.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/phys_state_var_mod.F90	(revision 2898)
+++ LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/phys_state_var_mod.F90	(revision 2924)
@@ -32,4 +32,8 @@
       REAL,ALLOCATABLE,SAVE :: qsol(:),fevap(:,:),z0m(:,:),z0h(:,:),agesno(:,:)
 !$OMP THREADPRIVATE(qsol,fevap,z0m,z0h,agesno)
+!FC drag des arbres
+      REAL, ALLOCATABLE, SAVE :: treedrg(:,:,:)
+!$OMP THREADPRIVATE(treedrg)
+
 !      character(len=6), SAVE :: ocean
 !!!!!!$OMP THREADPRIVATE(ocean)
@@ -430,4 +434,6 @@
       ALLOCATE(qsol(klon),fevap(klon,nbsrf))
       ALLOCATE(z0m(klon,nbsrf+1),z0h(klon,nbsrf+1),agesno(klon,nbsrf))
+!FC
+      ALLOCATE(treedrg(klon,klev,nbsrf))
       ALLOCATE(falb1(klon,nbsrf))
       ALLOCATE(falb2(klon,nbsrf))
@@ -603,4 +609,6 @@
       deallocate(pctsrf, ftsol, falb1, falb2)
       deallocate(qsol,fevap,z0m,z0h,agesno)
+!FC
+      deallocate(treedrg)
       deallocate(rain_fall, snow_fall, solsw, sollw, radsol, swradcorr)
       deallocate(zmea, zstd, zsig, zgam)
Index: LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/physiq_mod.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/physiq_mod.F90	(revision 2898)
+++ LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/physiq_mod.F90	(revision 2924)
@@ -2242,7 +2242,8 @@
             zxfluxt,   zxfluxq,   q2m,     fluxq, pbl_tke, &
                                 !nrlmd+jyg<
-            wake_delta_pbl_TKE &
+            wake_delta_pbl_TKE, &
                                 !>nrlmd+jyg
-            )
+             treedrg )
+!FC
        !
        !  Add turbulent diffusion tendency to the wake difference variables
Index: LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/surf_land_mod.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/surf_land_mod.F90	(revision 2898)
+++ LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/surf_land_mod.F90	(revision 2924)
@@ -1,5 +1,6 @@
 !
 MODULE surf_land_mod
-  
+#ifndef LMDZ_nofrein
+
   IMPLICIT NONE
 
@@ -19,5 +20,8 @@
        z0m, z0h, SFRWL, alb_dir_new, alb_dif_new, evap, fluxsens, fluxlat, &   
        qsurf, tsurf_new, dflux_s, dflux_l, &
-       flux_u1, flux_v1 ) 
+       flux_u1, flux_v1 , & 
+       veget,lai,height)
+
+!FCveget,lai,height, &
 
     USE dimphy
@@ -33,6 +37,10 @@
     USE surf_land_orchidee_noz0h_mod
 #else
-    ! Compilation with default interface
+#if ORCHIDEE_NOFREIN
+    ! Compilation with cpp key ORCHIDEE_NOFREIN
+    USE surf_land_orchidee_nofrein_mod
+#else
     USE surf_land_orchidee_mod
+#endif
 #endif
 #endif
@@ -47,4 +55,7 @@
     INCLUDE "clesphys.h"
 !albedo SB <<<
+!FC 
+   INCLUDE "dimpft.h"
+
 
 ! Input variables  
@@ -96,4 +107,7 @@
     REAL, DIMENSION(klon), INTENT(OUT)       :: dflux_s, dflux_l      
     REAL, DIMENSION(klon), INTENT(OUT)       :: flux_u1, flux_v1  ! flux for U and V at first model level
+!FC
+    REAL, DIMENSION(klon,nvm_lmdz), INTENT(OUT)       :: veget,lai
+    REAL, DIMENSION(klon,nvm_lmdz), INTENT(OUT)            :: height
 
 ! Local variables
@@ -150,5 +164,10 @@
             evap, fluxsens, fluxlat, &              
             tsol_rad, tsurf_new, alb1_new, alb2_new, &
-            emis_new, z0m, z0h, qsurf)       
+            emis_new, z0m, z0h, qsurf, &
+            veget, lai, height)       
+
+!    print*, " FC SORTIE surf_land_orchidee" ,height(1:100,2)
+!FC
+
 
 !  
@@ -217,4 +236,5 @@
 !****************************************************************************************
 !  
+#endif
 END MODULE surf_land_mod
 !
Index: LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/surf_land_orchidee_mod.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/surf_land_orchidee_mod.F90	(revision 2898)
+++ LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/surf_land_orchidee_mod.F90	(revision 2924)
@@ -3,4 +3,6 @@
 #ifndef ORCHIDEE_NOOPENMP
 #ifndef ORCHIDEE_NOZ0H
+#ifndef ORCHIDEE_NOFREIN
+!FC la derniere ligne et la fin
 !
 ! This module controles the interface towards the model ORCHIDEE.
@@ -44,5 +46,8 @@
        evap, fluxsens, fluxlat, &              
        tsol_rad, tsurf_new, alb1_new, alb2_new, &
-       emis_new, z0m_new, z0h_new, qsurf)
+       emis_new, z0m_new, z0h_new, qsurf, &
+       veget, lai, height )
+!FC
+
 
     USE mod_surf_para
@@ -109,4 +114,8 @@
 !
     INCLUDE "YOMCST.h"
+!FC
+    INCLUDE "dimpft.h"
+
+
   
 !
@@ -139,4 +148,9 @@
     REAL, DIMENSION(klon), INTENT(OUT)        :: alb1_new, alb2_new
     REAL, DIMENSION(klon), INTENT(OUT)        :: emis_new, z0m_new, z0h_new
+!FC
+    REAL, DIMENSION (klon,nvm_lmdz),INTENT(OUT)         :: veget
+    REAL, DIMENSION (klon,nvm_lmdz),INTENT(OUT)         :: lai
+    REAL, DIMENSION (klon,nvm_lmdz) ,INTENT(OUT)        :: height
+
 
 ! Local
@@ -217,4 +231,7 @@
 ! Test of coherence between variable ok_veget and cpp key CPP_VEGET
 #ifndef CPP_VEGET
+             print* , "nvm_orch FC  ", nvm_orch
+             print* , "nvm_lmdz FC  ", nvm_lmdz
+
        abort_message='Pb de coherence: ok_veget = .true. mais CPP_VEGET = .false.'
        CALL abort_physic(modname,abort_message,1)
@@ -409,5 +426,5 @@
                cdrag, petA_orc, peqA_orc, petB_orc, peqB_orc, &
                precip_rain, precip_snow, lwdown, swnet, swdown, ps, &
-               evap, fluxsens, fluxlat, coastalflow, riverflow, &
+               nvm_orch, evap, fluxsens, fluxlat, coastalflow, riverflow, &
                tsol_rad, tsurf_new, qsurf, albedo_out, emis_new, z0m_new, &
                lon_scat, lat_scat, q2m, t2m, z0h_new)
@@ -427,4 +444,11 @@
     IF (knon > 0) THEN
 #ifdef CPP_VEGET    
+!FC
+           if(nvm_orch .ne.nvm_lmdz ) then
+       abort_message='Pb de dimensiosn PFT: nvm_orch et nvm_lmdz differents.'
+       CALL abort_physic(modname,abort_message,1)
+           endif
+!FC
+
        CALL intersurf_main_gathered (itime+itau_phy, nbp_lon, nbp_lat, knon, ktindex, dtime,  &
             lrestart_read, lrestart_write, lalo, &
@@ -435,6 +459,9 @@
             evap(1:knon), fluxsens(1:knon), fluxlat(1:knon), coastalflow(1:knon), riverflow(1:knon), &
             tsol_rad(1:knon), tsurf_new(1:knon), qsurf(1:knon), albedo_out(1:knon,:), emis_new(1:knon), z0m_new(1:knon), &
-            lon_scat, lat_scat, q2m, t2m, z0h_new(1:knon), coszang=yrmu0(1:knon))
+            lon_scat, lat_scat, q2m, t2m, z0h_new(1:knon),&
+            veget(1:knon,:),lai(1:knon,:),height(1:knon,:),&
+              coszang=yrmu0(1:knon))
 #endif       
+!FC on doit mettre nvm_orch la ???
     ENDIF
 
@@ -665,3 +692,4 @@
 #endif
 #endif
+#endif
 END MODULE surf_land_orchidee_mod
Index: LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/yamada4.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/yamada4.F90	(revision 2898)
+++ LMDZ5/branches/LMDZ_tree_FC/libf/phylmd/yamada4.F90	(revision 2924)
@@ -2,5 +2,5 @@
 
 SUBROUTINE yamada4(ni, nsrf, ngrid, dt, g, rconst, plev, temp, zlev, zlay, u, v, teta, &
-    cd, tke, km, kn, kq, ustar, iflag_pbl)
+    cd, tke, km, kn, kq, ustar, iflag_pbl, drgpro)
 
   USE dimphy
@@ -101,4 +101,7 @@
   INTEGER ni(klon)
 
+!FC
+  REAL drgpro(klon,klev)
+  REAL winds(klon,klev)
 
   ! Local
@@ -479,8 +482,21 @@
          DO ig=1,ngrid
          tkeprov=q2(ig,k)/ydeux
-         disseff=dissip(ig,k)-min(0.,buoy(ig,k))
+
+!             if(ifl_pbltree .eq. 0) then
+!         disseff=dissip(ig,k)-min(0.,buoy(ig,k))
+!         tkeexp=exp(-dt*disseff/tkeprov)
+!         tkeprov= shear(ig,k)*tkeprov/disseff*(1.-tkeexp)+tkeprov*tkeexp
+!           else
+!FC on ajoute la dissipation due aux arbres
+         disseff=dissip(ig,k)-min(0.,buoy(ig,k)) + drgpro(ig,k)*tkeprov
          tkeexp=exp(-dt*disseff/tkeprov)
-         tkeprov= shear(ig,k)*tkeprov/disseff*(1.-tkeexp)+tkeprov*tkeexp
+! on prend en compte la tke cree par les arbres
+         winds(ig,k)=sqrt(u(ig,k)**2+v(ig,k)**2)
+         tkeprov= (shear(ig,k)+ &
+          & drgpro(ig,k)*(winds(ig,k))**3)*tkeprov/disseff*(1.-tkeexp)+tkeprov*tkeexp
+!               endif
+
          q2(ig,k)=tkeprov*ydeux
+
          ! En cas stable, on traite la flotabilite comme la
          ! dissipation, en supposant que buoy/q2^3 est constant.
