Index: /LMDZ6/trunk/libf/phylmd/lmdz_wake.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/lmdz_wake.F90	(revision 4844)
+++ /LMDZ6/trunk/libf/phylmd/lmdz_wake.F90	(revision 4845)
@@ -395,6 +395,5 @@
   ! -------------------------------------------------------------------------
 
-  delta_t_min = 0.2
-! delta_t_min = 0.001
+   delta_t_min = 0.2
 
   ! 1. - Save initial values, initialize tendencies, initialize output fields
@@ -2416,5 +2415,5 @@
 
 SUBROUTINE pkupper (klon, klev, ptop, ph, p, pupper, kupper, &
-                    dth, hw_, rho, delta_t_min, &
+                    dth, hw_, rho, delta_t_min_in, &
                     ktop, wk_adv, h_zzz, ptop1, ktop1)
 
@@ -2422,5 +2421,5 @@
 USE lmdz_wake_ini , ONLY : RG
 USE lmdz_wake_ini , ONLY : hwmin
-USE lmdz_wake_ini , ONLY : iflag_wk_new_ptop
+USE lmdz_wake_ini , ONLY : iflag_wk_new_ptop, wk_delta_t_min, wk_frac_int_delta_t
 
 IMPLICIT NONE
@@ -2431,5 +2430,6 @@
 LOGICAL,    DIMENSION (klon)        , INTENT(IN) :: wk_adv
 REAL,       DIMENSION (klon,klev+1) , INTENT(IN) :: dth
-REAL,                                 INTENT(IN) :: delta_t_min
+REAL,                                 INTENT(IN) :: delta_t_min_in
+
 
 REAL,       DIMENSION (klon)  , INTENT(OUT)        :: hw_
@@ -2444,4 +2444,5 @@
 INTEGER :: i,k
 
+REAL                               :: delta_t_min
 REAL,     DIMENSION (klon)         :: dthmin
 REAL,     DIMENSION (klon)         :: ptop_provis,ptop_new
@@ -2455,5 +2456,4 @@
 REAL,     DIMENSION (klon,klev+1)                 :: zzz          !!
 REAL,     DIMENSION (klon)                 :: frac_int_dth          !!
-REAL                                              :: epsil        !!
 REAL                                              :: ddd!!
 
@@ -2476,4 +2476,11 @@
     ! -     1/ Pressure of the level where dth changes sign.
     !print*,'WAKE LJYF'
+
+
+if (iflag_wk_new_ptop==0) then
+    delta_t_min=delta_t_min_in
+else
+    delta_t_min=wk_delta_t_min
+endif
 
     DO i = 1, klon
@@ -2493,4 +2500,5 @@
       END DO
     END DO
+
 
     ! -     2/ dth integral
@@ -2586,8 +2594,8 @@
     ! nouveau calcul de hw et ptop
     ! -----------------------------------------------------------------------
-if (iflag_wk_new_ptop>0) then
+!if (iflag_wk_new_ptop>0) then
     
-    epsil = 0.05                            ! 5 pour cent
-   !  epsil = 0.20
+IF (iflag_wk_new_ptop/=0) THEN
+
     
        DO i = 1, klon
@@ -2603,5 +2611,6 @@
           IF (wk_adv(i)) THEN
              if (k<=k_ptop_provis(i)) then
-                  ddd=dth(i,k-1)*(ph(i,k-1) - min(ptop_provis(i),ph(i,k)))
+                !  ddd=dth(i,k-1)*(ph(i,k-1) - min(ptop_provis(i),ph(i,k)))
+                  ddd=dth(i,k-1)*(ph(i,k-1) - ph(i,k))
              else
                   ddd=0.
@@ -2619,5 +2628,5 @@
     DO i=1,klon
        IF (wk_adv(i)) THEN
-        frac_int_dth(i)=(1.-epsil)*int_dth(i,k_ptop_provis(i))
+        frac_int_dth(i)=wk_frac_int_delta_t*int_dth(i,k_ptop_provis(i))
        !ELSE
        ! frac_int_dth(i)=0.
@@ -2681,7 +2690,8 @@
     END DO
 
-endif
-
-if (iflag_wk_new_ptop==2) then
+ENDIF
+
+!if (iflag_wk_new_ptop==2) then
+IF (iflag_wk_new_ptop>0) THEN 
    do i=1,klon
       ptop(i)=ptop1(i)
@@ -2689,6 +2699,7 @@
       hw_(i)=h_zzz(i)
    enddo
-endif
-
+
+!endif
+ENDIF
 
  kupper = 0
Index: /LMDZ6/trunk/libf/phylmd/lmdz_wake_ini.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/lmdz_wake_ini.F90	(revision 4844)
+++ /LMDZ6/trunk/libf/phylmd/lmdz_wake_ini.F90	(revision 4845)
@@ -31,4 +31,11 @@
   REAL, SAVE, PROTECTED                                       :: tau_cv
   !$OMP THREADPRIVATE(tau_cv)
+
+   REAL, SAVE, PROTECTED                                       :: wk_delta_t_min
+  !$OMP THREADPRIVATE(wk_delta_t_min)
+
+   REAL, SAVE, PROTECTED                                       :: wk_frac_int_delta_t
+  !$OMP THREADPRIVATE(wk_frac_int_delta_t)
+
   REAL, SAVE, PROTECTED                                       :: rzero, aa0 ! minimal wake radius and area
   !$OMP THREADPRIVATE(rzero, aa0)
@@ -215,9 +222,17 @@
   CALL getin_p('iflag_wk_profile',iflag_wk_profile) ! switch between wdens prescribed 
                                                     ! and wdens prognostic
-  iflag_wk_profile = 0
+ ! iflag_wk_profile = 0
+  iflag_wk_new_ptop = 0
   CALL getin_p('iflag_wk_new_ptop',iflag_wk_new_ptop)
 
   tau_cv = 4000.
   CALL getin_p('tau_cv', tau_cv)
+  
+  wk_delta_t_min = 0.
+  CALL getin_p('wk_delta_t_min', wk_delta_t_min)
+  
+  wk_frac_int_delta_t = 0.9
+  CALL getin_p('wk_frac_int_delta_t', wk_frac_int_delta_t)
+
 
 !------------------------------------------------------------------------ 
@@ -245,4 +260,8 @@
   CALL getin_p('iflag_wk_check_trgl ', iflag_wk_check_trgl)
   WRITE(*,*) 'iflag_wk_check_trgl=', iflag_wk_check_trgl
+  
+  WRITE(*,*) 'wk_delta_t_min=', wk_delta_t_min
+  WRITE(*,*) 'wk_frac_int_delta_t=', wk_frac_int_delta_t
+  WRITE(*,*) 'iflag_wk_new_ptop=', iflag_wk_new_ptop
 
  RETURN
