Index: /LMDZ6/trunk/libf/phylmdiso/clc_core_cp.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmdiso/clc_core_cp.F90	(revision 4723)
+++ /LMDZ6/trunk/libf/phylmdiso/clc_core_cp.F90	(revision 4723)
@@ -0,0 +1,1 @@
+link ../phylmd/clc_core_cp.F90
Index: /LMDZ6/trunk/libf/phylmdiso/coare30_flux_cnrm.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmdiso/coare30_flux_cnrm.F90	(revision 4723)
+++ /LMDZ6/trunk/libf/phylmdiso/coare30_flux_cnrm.F90	(revision 4723)
@@ -0,0 +1,1 @@
+link ../phylmd/coare30_flux_cnrm.F90
Index: /LMDZ6/trunk/libf/phylmdiso/coare_cp.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmdiso/coare_cp.F90	(revision 4723)
+++ /LMDZ6/trunk/libf/phylmdiso/coare_cp.F90	(revision 4723)
@@ -0,0 +1,1 @@
+link ../phylmd/coare_cp.F90
Index: /LMDZ6/trunk/libf/phylmdiso/ecumev6_flux.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmdiso/ecumev6_flux.F90	(revision 4723)
+++ /LMDZ6/trunk/libf/phylmdiso/ecumev6_flux.F90	(revision 4723)
@@ -0,0 +1,1 @@
+link ../phylmd/ecumev6_flux.F90
Index: /LMDZ6/trunk/libf/phylmdiso/ini_csts.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmdiso/ini_csts.F90	(revision 4723)
+++ /LMDZ6/trunk/libf/phylmdiso/ini_csts.F90	(revision 4723)
@@ -0,0 +1,1 @@
+link ../phylmd/ini_csts.F90
Index: /LMDZ6/trunk/libf/phylmdiso/modd_csts.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmdiso/modd_csts.F90	(revision 4723)
+++ /LMDZ6/trunk/libf/phylmdiso/modd_csts.F90	(revision 4723)
@@ -0,0 +1,1 @@
+link ../phylmd/modd_csts.F90
Index: /LMDZ6/trunk/libf/phylmdiso/pbl_surface_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmdiso/pbl_surface_mod.F90	(revision 4722)
+++ /LMDZ6/trunk/libf/phylmdiso/pbl_surface_mod.F90	(revision 4723)
@@ -438,5 +438,5 @@
     REAL, DIMENSION(klon),        INTENT(IN)        :: rugoro  ! rugosity length
     REAL, DIMENSION(klon),        INTENT(IN)        :: rmu0    ! cosine of solar zenith angle
-    REAL, DIMENSION(klon),        INTENT(IN)        :: rain_f  ! rain fall
+    REAL, DIMENSION(klon),        INTENT(INOUT)     :: rain_f  ! rain fall
     REAL, DIMENSION(klon),        INTENT(IN)        :: snow_f  ! snow fall
     REAL, DIMENSION(klon),        INTENT(IN)        :: bs_f  ! blowing snow fall
@@ -1286,5 +1286,5 @@
 !albedo SB <<<
     yrain_f = 0.0 ; ysnow_f = 0.0  ; ybs_f=0.0  ; yfder = 0.0     ; ysolsw = 0.0
-    ysollw = 0.0  ; yz0m = 0.0 ; yz0h = 0.0    ; yu1 = 0.0    
+    ysollw = 0.0  ; yz0m = 0.0 ; yz0h = 0.0    ; yz0h_oupas = 0.0 ; yu1 = 0.0    
     yv1 = 0.0     ; ypaprs = 0.0     ; ypplay = 0.0     ; yqbs1 = 0.0
     ydelp = 0.0   ; yu = 0.0         ; yv = 0.0        ; yt = 0.0         
@@ -1875,7 +1875,7 @@
         ENDDO
         CALL cdrag(knon, nsrf, &
-            speed, yt(:,1), yq(:,1), zgeo1, ypaprs(:,1),&
+            speed, yt(:,1), yq(:,1), zgeo1, ypaprs(:,1), s_pblh, &
             yts, yqsurf, yz0m, yz0h, yri0, 0, &
-            ycdragm, ycdragh, zri1, pref )
+            ycdragm, ycdragh, zri1, pref, rain_f, zxtsol, ypplay(:,1))
 
 ! --- special Dice: on force cdragm ( a defaut de forcer ustar) MPL 05082013
@@ -1909,7 +1909,7 @@
 
             CALL cdrag(knon, nsrf, &
-            speed_x, yt_x(:,1), yq_x(:,1), zgeo1_x, ypaprs(:,1),&
+            speed_x, yt_x(:,1), yq_x(:,1), zgeo1_x, ypaprs(:,1),s_pblh_x,&
             yts_x, yqsurf_x, yz0m, yz0h, yri0, 0, &
-            ycdragm_x, ycdragh_x, zri1_x, pref_x )
+            ycdragm_x, ycdragh_x, zri1_x, pref_x, rain_f, zxtsol, ypplay(:,1) )
 
 ! --- special Dice. JYG+MPL 25112013
@@ -1936,9 +1936,10 @@
         ENDDO
         CALL cdrag(knon, nsrf, &
-            speed_w, yt_w(:,1), yq_w(:,1), zgeo1_w, ypaprs(:,1),&
+            speed_w, yt_w(:,1), yq_w(:,1), zgeo1_w, ypaprs(:,1),s_pblh_w,&
             yts_w, yqsurf_w, yz0m, yz0h, yri0, 0, &
-            ycdragm_w, ycdragh_w, zri1_w, pref_w )
-!
-        zgeo1(:) = wake_s(:)*zgeo1_w(:) + (1.-wake_s(:))*zgeo1_x(:)
+            ycdragm_w, ycdragh_w, zri1_w, pref_w, rain_f, zxtsol, ypplay(:,1) )
+!
+!!!bug !!        zgeo1(:) = wake_s(:)*zgeo1_w(:) + (1.-wake_s(:))*zgeo1_x(:)
+        zgeo1(1:knon) = wake_s(1:knon)*zgeo1_w(1:knon) + (1.-wake_s(1:knon))*zgeo1_x(1:knon)
 
 ! --- special Dice. JYG+MPL 25112013 puis BOMEX
@@ -2380,5 +2381,5 @@
                yu(:,1), yv(:,1), yt(:,1), yq(:,1), zgeo1, &
                yts, yqsurf, yz0m, yz0h, ypaprs(:,1), ypplay(:,1), &
-               yt2m, yq2m, yt10m, yq10m, yu10m, yustar)
+               yt2m, yq2m, yt10m, yq10m, yu10m, yustar, ypblh, rain_f, zxtsol)
           ENDIF
           
@@ -3608,5 +3609,5 @@
        IF (iflag_split .eq.0) THEN
         IF (iflag_new_t2mq2m==1) THEN
-         CALL stdlevvarn(klon, knon, nsrf, zxli, &
+           CALL stdlevvarn(klon, knon, nsrf, zxli, &
             uzon, vmer, tair1, qair1, zgeo1, &
             tairsol, qairsol, yz0m, yz0h_oupas, psfce, patm, &
@@ -3617,5 +3618,5 @@
             uzon, vmer, tair1, qair1, zgeo1, &
             tairsol, qairsol, yz0m, yz0h_oupas, psfce, patm, &
-            yt2m, yq2m, yt10m, yq10m, yu10m, yustar)
+            yt2m, yq2m, yt10m, yq10m, yu10m, yustar, ypblh, rain_f, zxtsol)
         ENDIF
        ELSE  !(iflag_split .eq.0)
@@ -3635,9 +3636,9 @@
             uzon_x, vmer_x, tair1_x, qair1_x, zgeo1_x, &
             tairsol_x, qairsol, yz0m, yz0h_oupas, psfce, patm, &
-            yt2m_x, yq2m_x, yt10m_x, yq10m_x, yu10m_x, yustar_x)
+            yt2m_x, yq2m_x, yt10m_x, yq10m_x, yu10m_x, yustar_x, ypblh_x, rain_f, zxtsol)
         CALL stdlevvar(klon, knon, nsrf, zxli, &
             uzon_w, vmer_w, tair1_w, qair1_w, zgeo1_w, &
             tairsol_w, qairsol, yz0m, yz0h_oupas, psfce, patm, &
-            yt2m_w, yq2m_w, yt10m_w, yq10m_w, yu10m_w, yustar_w)
+            yt2m_w, yq2m_w, yt10m_w, yq10m_w, yu10m_w, yustar_w, ypblh_w, rain_f, zxtsol)
         ENDIF
 !!!
Index: /LMDZ6/trunk/libf/phylmdiso/physiq_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmdiso/physiq_mod.F90	(revision 4722)
+++ /LMDZ6/trunk/libf/phylmdiso/physiq_mod.F90	(revision 4723)
@@ -1333,4 +1333,10 @@
 #endif
     
+
+    REAL, dimension(klon,klev) :: t_env,q_env
+
+    REAL, dimension(klon) :: pr_et
+    REAL, dimension(klon) :: w_et, jlr_g_c, jlr_g_s
+
     REAL pi
     INTEGER ieru
@@ -3101,4 +3107,15 @@
        ELSE IF (iflag_gusts==2) THEN
           gustiness(1:klon)=f_gust_bl*ale_bl_stat(1:klon)+f_gust_wk*ale_wake(1:klon)
+       !!!! modif olivier torres
+       ELSE IF (iflag_gusts==3) THEN
+          w_et=wstar(1,3)
+          jlr_g_s=(0.65*w_et)**2
+          pr_et=rain_con*8640
+          jlr_g_c = (((19.8*(pr_et(1:klon)**2))/(1.5+pr_et(1:klon)+pr_et(1:klon)**2))**(0.4))**2
+          gustiness(1:klon)=jlr_g_c+jlr_g_s
+!!       write(*,*) "rain ",pr_et
+!!       write(*,*) "jlr_g_c",jlr_g_c
+!!       write(*,*) "wstar",wstar(1,3)
+!!       write(*,*) "jlr_g_s",jlr_g_s
           ! ELSE IF (iflag_gusts==2) THEN
           !    do i = 1, klon
Index: /LMDZ6/trunk/libf/phylmdiso/qsat_seawater.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmdiso/qsat_seawater.F90	(revision 4723)
+++ /LMDZ6/trunk/libf/phylmdiso/qsat_seawater.F90	(revision 4723)
@@ -0,0 +1,1 @@
+link ../phylmd/qsat_seawater.F90
Index: /LMDZ6/trunk/libf/phylmdiso/qsat_seawater2.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmdiso/qsat_seawater2.F90	(revision 4723)
+++ /LMDZ6/trunk/libf/phylmdiso/qsat_seawater2.F90	(revision 4723)
@@ -0,0 +1,1 @@
+link ../phylmd/qsat_seawater2.F90
Index: /LMDZ6/trunk/libf/phylmdiso/qsatseaw_1D.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmdiso/qsatseaw_1D.F90	(revision 4723)
+++ /LMDZ6/trunk/libf/phylmdiso/qsatseaw_1D.F90	(revision 4723)
@@ -0,0 +1,1 @@
+link ../phylmd/qsatseaw_1D.F90
