Index: LMDZ6/trunk/libf/phylmdiso/pbl_surface_mod.F90
===================================================================
--- LMDZ6/trunk/libf/phylmdiso/pbl_surface_mod.F90	(revision 4844)
+++ LMDZ6/trunk/libf/phylmdiso/pbl_surface_mod.F90	(revision 4881)
@@ -24,5 +24,5 @@
   USE climb_wind_mod,      ONLY : climb_wind_down, climb_wind_up
   USE coef_diff_turb_mod,  ONLY : coef_diff_turb
-  USE lmdz_call_atke,      ONLY :  call_atke
+  USE lmdz_call_atke,      ONLY : call_atke
   USE ioipsl_getin_p_mod,  ONLY : getin_p
   USE cdrag_mod
@@ -308,5 +308,5 @@
 !jyg<
 !!       zxfluxt,   zxfluxq,   q2m,      flux_q, tke,   &
-       zxfluxt,   zxfluxq, zxfluxqbs,   q2m, flux_q, flux_qbs, tke_x,  &
+       zxfluxt,   zxfluxq, zxfluxqbs,   q2m, flux_q, flux_qbs, tke_x, eps_x, &
 !>jyg
 !!! nrlmd+jyg le 02/05/2011 et le 20/02/2012
@@ -506,4 +506,6 @@
 ! Output variables
 !****************************************************************************************
+    REAL, DIMENSION(klon,klev+1,nbsrf+1), INTENT(OUT)   :: eps_x      ! TKE dissipation rate
+
     REAL, DIMENSION(klon),        INTENT(OUT)       :: cdragh     ! drag coefficient for T and Q
     REAL, DIMENSION(klon),        INTENT(OUT)       :: cdragm     ! drag coefficient for wind
@@ -765,5 +767,5 @@
     REAL, DIMENSION(klon,klev)         :: delp
     REAL, DIMENSION(klon,klev+1)       :: ypaprs
-    REAL, DIMENSION(klon,klev+1)       :: ytke
+    REAL, DIMENSION(klon,klev+1)       :: ytke, yeps
     REAL, DIMENSION(klon,nsoilmx)      :: ytsoil
 !FC 
@@ -785,5 +787,5 @@
     REAL, DIMENSION(klon)              :: ywake_s, ywake_cstar, ywake_dens
 !!!
-    REAL, DIMENSION(klon,klev+1)       :: ytke_x, ytke_w
+    REAL, DIMENSION(klon,klev+1)       :: ytke_x, ytke_w, yeps_x, yeps_w
     REAL, DIMENSION(klon,klev+1)       :: ywake_dltke
     REAL, DIMENSION(klon,klev)         :: yu_x, yv_x, yu_w, yv_w
@@ -1261,4 +1263,5 @@
 !!    tke(:,:,is_ave)=0.
     tke_x(:,:,is_ave)=0.
+    eps_x(:,:,is_ave)=0.
 
     wake_dltke(:,:,is_ave)=0.
@@ -1295,4 +1298,5 @@
 
     ytke=0.
+    yeps=0.
     yri0(:)=0.
 !FC 
@@ -1308,4 +1312,5 @@
 !!! nrlmd+jyg le 02/05/2011 et le 20/02/2012
     ytke_x=0.     ; ytke_w=0.        ; ywake_dltke=0.
+    yeps_x=0.     ; yeps_w=0.
     y_d_t_x=0.    ; y_d_t_w=0.       ; y_d_q_x=0.      ; y_d_q_w=0.
 !!    d_t_w=0.      ; d_q_w=0.         
@@ -1979,5 +1984,5 @@
         CALL call_atke(dtime,knon,klev,ycdragm(1:knon), ycdragh(1:knon),yus0(1:knon),yvs0(1:knon),yts(1:knon), &
                   yu(1:knon,:),yv(1:knon,:),yt(1:knon,:),yq(1:knon,:),ypplay(1:knon,:),ypaprs(1:knon,:),       &
-                  ytke(1:knon,:),ycoefm(1:knon,:), ycoefh(1:knon,:))
+                  ytke(1:knon,:),yeps(1:knon,:), ycoefm(1:knon,:), ycoefh(1:knon,:))
 
         ELSE
@@ -1985,5 +1990,5 @@
         CALL coef_diff_turb(dtime, nsrf, knon, ni,  &
             ypaprs, ypplay, yu, yv, yq, yt, yts, yqsurf, ycdragm, &
-            ycoefm, ycoefh, ytke, y_treedrg)
+            ycoefm, ycoefh, ytke, yeps, y_treedrg)
 !            ycoefm, ycoefh, ytke)
 !FC y_treedrg ajoute
@@ -2023,5 +2028,5 @@
         CALL call_atke(dtime,knon,klev,ycdragm_x(1:knon),ycdragh_x(1:knon),yus0(1:knon),yvs0(1:knon),yts_x(1:knon),    &
                        yu_x(1:knon,:),yv_x(1:knon,:),yt_x(1:knon,:),yq_x(1:knon,:),ypplay(1:knon,:),ypaprs(1:knon,:),  &
-                       ytke_x(1:knon,:),ycoefm_x(1:knon,:), ycoefh_x(1:knon,:))
+                       ytke_x(1:knon,:),yeps_x(1:knon,:),ycoefm_x(1:knon,:), ycoefh_x(1:knon,:))
 
         ELSE
@@ -2029,5 +2034,5 @@
         CALL coef_diff_turb(dtime, nsrf, knon, ni,  &
             ypaprs, ypplay, yu_x, yv_x, yq_x, yt_x, yts_x, yqsurf_x, ycdragm_x, &
-            ycoefm_x, ycoefh_x, ytke_x,y_treedrg)
+            ycoefm_x, ycoefh_x, ytke_x,yeps_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)
@@ -2063,12 +2068,11 @@
         CALL call_atke(dtime,knon,klev,ycdragm_w(1:knon),ycdragh_w(1:knon),yus0(1:knon),yvs0(1:knon),yts_w(1:knon), &
                 yu_w(1:knon,:),yv_w(1:knon,:),yt_w(1:knon,:),yq_w(1:knon,:),ypplay(1:knon,:),ypaprs(1:knon,:),      &
-                ytke_w(1:knon,:),ycoefm_w(1:knon,:), ycoefh_w(1:knon,:))
+                ytke_w(1:knon,:),yeps_w(1:knon,:),ycoefm_w(1:knon,:),ycoefh_w(1:knon,:))
 
         ELSE
-
 
         CALL coef_diff_turb(dtime, nsrf, knon, ni,  &
             ypaprs, ypplay, yu_w, yv_w, yq_w, yt_w, yts_w, yqsurf_w, ycdragm_w, &
-            ycoefm_w, ycoefh_w, ytke_w,y_treedrg)
+            ycoefm_w, ycoefh_w, ytke_w,yeps_w,y_treedrg)
 !            ycoefm_w, ycoefh_w, ytke_w)
        IF (iflag_pbl>=20.AND.iflag_pbl<30) THEN
@@ -3332,6 +3336,7 @@
 !!              tke(i,k,is_ave) = tke(i,k,is_ave) + ytke(j,k)*ypct(j)
               tke_x(i,k,nsrf)    = ytke(j,k)
-              tke_x(i,k,is_ave) = tke_x(i,k,is_ave) + ytke(j,k)*ypct(j)
-
+              tke_x(i,k,is_ave)  = tke_x(i,k,is_ave) + ytke(j,k)*ypct(j)
+              eps_x(i,k,nsrf)    = yeps(j,k)
+              eps_x(i,k,is_ave)  = eps_x(i,k,is_ave) + yeps(j,k)*ypct(j)
 !>jyg
            ENDDO
@@ -3347,5 +3352,7 @@
 !!            tke(i,k,is_ave) = tke(i,k,is_ave) + tke(i,k,nsrf)*ypct(j)
             tke_x(i,k,nsrf)   = ytke_x(j,k)
-            tke_x(i,k,is_ave)   = tke_x(i,k,is_ave) + tke_x(i,k,nsrf)*ypct(j)        
+            tke_x(i,k,is_ave)   = tke_x(i,k,is_ave) + tke_x(i,k,nsrf)*ypct(j)       
+            eps_x(i,k,nsrf)   = yeps_x(j,k)
+            eps_x(i,k,is_ave)   = eps_x(i,k,is_ave) + eps_x(i,k,nsrf)*ypct(j) 
             wake_dltke(i,k,is_ave)   = wake_dltke(i,k,is_ave) + wake_dltke(i,k,nsrf)*ypct(j)
             
Index: LMDZ6/trunk/libf/phylmdiso/phys_local_var_mod.F90
===================================================================
--- LMDZ6/trunk/libf/phylmdiso/phys_local_var_mod.F90	(revision 4844)
+++ LMDZ6/trunk/libf/phylmdiso/phys_local_var_mod.F90	(revision 4881)
@@ -22,6 +22,8 @@
       REAL, SAVE, ALLOCATABLE :: d_rneb_dyn(:,:)
       !$OMP THREADPRIVATE(d_rneb_dyn)
-      REAL, SAVE, ALLOCATABLE :: l_mixmin(:,:,:),l_mix(:,:,:),tke_dissip(:,:,:),wprime(:,:,:)
-      !$OMP THREADPRIVATE(l_mixmin, l_mix, tke_dissip,wprime)
+      REAL, SAVE, ALLOCATABLE :: l_mixmin(:,:,:),l_mix(:,:,:),wprime(:,:,:)
+      !$OMP THREADPRIVATE(l_mixmin, l_mix, wprime)
+      REAL, SAVE, ALLOCATABLE :: pbl_eps(:,:,:)
+      !$OMP THREADPRIVATE(pbl_eps)
       REAL, SAVE, ALLOCATABLE :: tr_seri(:,:,:)
       !$OMP THREADPRIVATE(tr_seri)
@@ -764,7 +766,7 @@
       ALLOCATE(t_seri(klon,klev),q_seri(klon,klev),ql_seri(klon,klev),qs_seri(klon,klev), qbs_seri(klon,klev))
       ALLOCATE(u_seri(klon,klev),v_seri(klon,klev))
-      ALLOCATE(l_mixmin(klon,klev+1,nbsrf),l_mix(klon,klev+1,nbsrf),tke_dissip(klon,klev+1,nbsrf),wprime(klon,klev+1,nbsrf))
-      l_mix(:,:,:)=0.;l_mixmin(:,:,:)=0.;tke_dissip(:,:,:)=0.;wprime(:,:,:)=0. ! doit etre initialse car pas toujours remplis
-
+      ALLOCATE(l_mixmin(klon,klev+1,nbsrf),l_mix(klon,klev+1,nbsrf),wprime(klon,klev+1,nbsrf))
+      l_mix(:,:,:)=0.;l_mixmin(:,:,:)=0.;wprime(:,:,:)=0. ! doit etre initialse car pas toujours remplis
+      ALLOCATE(pbl_eps(klon,klev+1,nbsrf))      
       ALLOCATE(tr_seri(klon,klev,nbtr))
       ALLOCATE(d_t_dyn(klon,klev),d_q_dyn(klon,klev))
@@ -1175,5 +1177,6 @@
       DEALLOCATE(t_seri,q_seri,ql_seri,qs_seri, qbs_seri)
       DEALLOCATE(u_seri,v_seri)
-      DEALLOCATE(l_mixmin,l_mix, tke_dissip,wprime)
+      DEALLOCATE(l_mixmin,l_mix,wprime)
+      DEALLOCATE(pbl_eps)
 
       DEALLOCATE(tr_seri)
Index: LMDZ6/trunk/libf/phylmdiso/physiq_mod.F90
===================================================================
--- LMDZ6/trunk/libf/phylmdiso/physiq_mod.F90	(revision 4844)
+++ LMDZ6/trunk/libf/phylmdiso/physiq_mod.F90	(revision 4881)
@@ -294,5 +294,5 @@
        zxfluxlat_x, zxfluxlat_w, &
        !
-       pbl_tke_input, tke_dissip, l_mix, wprime,&
+       pbl_tke_input, pbl_eps, l_mix, wprime,&
        t_therm, q_therm, u_therm, v_therm, &
        cdragh_x, cdragh_w, &
@@ -1321,5 +1321,5 @@
     integer iostat
 
-    REAL, dimension(klon,klev+1) :: tke_dissip_ave, l_mix_ave, wprime_ave
+    REAL, dimension(klon,klev+1) :: l_mix_ave, wprime_ave
     REAL zzz
     !albedo SB >>>
@@ -3192,5 +3192,5 @@
             fluxt,   fluxu,  fluxv, &
             dsens,     devap,     zxsnow, &
-            zxfluxt,   zxfluxq,  zxfluxqbs,  q2m, fluxq, fluxqbs, pbl_tke, &
+            zxfluxt,   zxfluxq,  zxfluxqbs,  q2m, fluxq, fluxqbs, pbl_tke, pbl_eps,  &
                                 !nrlmd+jyg<
             wake_delta_pbl_TKE, &
@@ -4756,5 +4756,4 @@
     ! water distribution
 
-    tke_dissip_ave(:,:)=0.
     l_mix_ave(:,:)=0.
     wprime_ave(:,:)=0.
@@ -4762,5 +4761,4 @@
     DO nsrf = 1, nbsrf
        DO i = 1, klon
-          tke_dissip_ave(i,:) = tke_dissip_ave(i,:) + tke_dissip(i,:,nsrf)*pctsrf(i,nsrf)
           l_mix_ave(i,:) = l_mix_ave(i,:) + l_mix(i,:,nsrf)*pctsrf(i,nsrf)
           wprime_ave(i,:) = wprime_ave(i,:) + wprime(i,:,nsrf)*pctsrf(i,nsrf)
@@ -4776,5 +4774,5 @@
          paprs,pplay,t_seri,q_seri, &
          qtc_cv, sigt_cv,detrain_cv,fm_cv,fqd,fqcomp,sigd,zqsat, &
-         omega,pbl_tke(:,:,is_ave),tke_dissip_ave,l_mix_ave,wprime_ave, &
+         omega,pbl_tke(:,:,is_ave),pbl_eps(:,:,is_ave),l_mix_ave,wprime_ave, &
          t2m,q2m,fm_therm,entr_therm,detr_therm,cell_area, &
          ratqs,ratqsc,ratqs_inter_)
