Index: /LMDZ5/trunk/libf/phylmd/alpale_th.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/alpale_th.F90	(revision 2729)
+++ /LMDZ5/trunk/libf/phylmd/alpale_th.F90	(revision 2730)
@@ -38,6 +38,7 @@
   REAL, DIMENSION(klon), INTENT(INOUT)                       :: alp_bl
   REAL, DIMENSION(klon), INTENT(INOUT)                       :: alp_bl_stat
-
-  REAL, DIMENSION(klon), INTENT(OUT)                         :: proba_notrig, random_notrig
+  REAL, DIMENSION(klon), INTENT(INOUT)                       :: proba_notrig
+
+  REAL, DIMENSION(klon), INTENT(OUT)                         :: random_notrig
 
   include "thermcell.h"
@@ -73,4 +74,14 @@
 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 !
+!!
+!!  The following 3 lines should be commented if one wants to activate the 
+!! multiplication of no-trigger probabilities between calls to the convection 
+!! scheme.
+!!
+             do i=1,klon
+                proba_notrig(i)=1.
+             enddo
+!!
+!!
 !---------------------------------------
   IF (iflag_clos_bl .LT. 3) THEN
@@ -97,5 +108,5 @@
              !----Initialisations
              do i=1,klon
-                proba_notrig(i)=1.
+!!jyg                proba_notrig(i)=1.
                 random_notrig(i)=1e6*ale_bl_stat(i)-int(1e6*ale_bl_stat(i))
                 if ( random_notrig(i) > random_notrig_max ) random_notrig(i)=0.
@@ -120,6 +131,6 @@
                 do i=1,klon
                    if ( (ale_bl_stat(i) .gt. abs(cin(i))+1.e-10) )  then
-                      proba_notrig(i)=(1.-exp(-s_trig/s2(i)))** &
-                           (n2(i)*dtime/tau_trig(i))
+                      proba_notrig(i)=proba_notrig(i)* &
+                         (1.-exp(-s_trig/s2(i)))**(n2(i)*dtime/tau_trig(i))
                       !        print *, 'proba_notrig(i) ',proba_notrig(i)
                       if (random_notrig(i) .ge. proba_notrig(i)) then 
@@ -129,5 +140,5 @@
                       endif
                    else
-                      proba_notrig(i)=1.
+!!jyg                      proba_notrig(i)=1.
                       random_notrig(i)=0.
                       ale_bl_trig(i)=0.
@@ -139,6 +150,6 @@
                 do i=1,klon
                    if ( (Ale_bl(i) .gt. abs(cin(i))+1.e-10) )  then
-                      proba_notrig(i)=(1.-exp(-s_trig/s2(i)))** &
-                           (n2(i)*dtime/tau_trig(i))
+                      proba_notrig(i)=proba_notrig(i)* &
+                         (1.-exp(-s_trig/s2(i)))**(n2(i)*dtime/tau_trig(i))
                       !        print *, 'proba_notrig(i) ',proba_notrig(i)
                       if (random_notrig(i) .ge. proba_notrig(i)) then 
@@ -148,5 +159,5 @@
                       endif
                    else
-                      proba_notrig(i)=1.
+!!jyg                      proba_notrig(i)=1.
                       random_notrig(i)=0.
                       ale_bl_trig(i)=0.
@@ -223,5 +234,5 @@
         !----Initializations and random number generation
         do i=1,klon
-           proba_notrig(i)=1.
+!!jyg           proba_notrig(i)=1.
            random_notrig(i)=1e6*ale_bl_stat(i)-int(1e6*ale_bl_stat(i))
            if ( ale_bl_trig(i) .lt. abs(cin(i))+1.e-10 ) then 
@@ -244,5 +255,5 @@
               birth_number = n2(i)*exp(-s_trig/s2(i))
               birth_rate(i) = birth_number/(tau_trig(i)*cell_area(i))
-              proba_notrig(i)=exp(-birth_number*dtime/tau_trig(i))
+              proba_notrig(i)=proba_notrig(i)*exp(-birth_number*dtime/tau_trig(i))
               Alp_bl(i) = Alp_bl(i)* &
                           umexp(-birth_number*cv_feed_area/cell_area(i))/ &
@@ -250,5 +261,5 @@
                           tau_trig(i)*cv_feed_area/(dtime*cell_area(i))
           else 
-              proba_notrig(i)=1.
+!!jyg              proba_notrig(i)=1.
               random_notrig(i)=0.
               alp_bl(i)=0.
Index: /LMDZ5/trunk/libf/phylmd/clesphys.h
===================================================================
--- /LMDZ5/trunk/libf/phylmd/clesphys.h	(revision 2729)
+++ /LMDZ5/trunk/libf/phylmd/clesphys.h	(revision 2730)
@@ -13,5 +13,5 @@
        LOGICAL ok_limitvrai
        LOGICAL ok_all_xml
-       INTEGER nbapp_rad, iflag_con, nbapp_cv, iflag_ener_conserv
+       INTEGER nbapp_rad, iflag_con, nbapp_cv, nbapp_wk, iflag_ener_conserv
        REAL co2_ppm, co2_ppm0, solaire
        LOGICAL ok_suntime_rrtm
@@ -114,5 +114,5 @@
      &     , cycle_diurne, soil_model, new_oliq                         &
      &     , ok_orodr, ok_orolf, ok_limitvrai, nbapp_rad                &
-     &     , iflag_con, nbapp_cv                                        &
+     &     , iflag_con, nbapp_cv, nbapp_wk                              &
      &     , iflag_ener_conserv                                         &
      &     , ok_4xCO2atm                                                & 
Index: /LMDZ5/trunk/libf/phylmd/conf_phys_m.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/conf_phys_m.F90	(revision 2729)
+++ /LMDZ5/trunk/libf/phylmd/conf_phys_m.F90	(revision 2730)
@@ -207,5 +207,5 @@
     LOGICAL,SAVE  :: ok_orodr_omp, ok_orolf_omp, ok_limitvrai_omp
     INTEGER, SAVE :: nbapp_rad_omp, iflag_con_omp
-    INTEGER, SAVE :: nbapp_cv_omp
+    INTEGER, SAVE :: nbapp_cv_omp, nbapp_wk_omp
     INTEGER, SAVE :: iflag_ener_conserv_omp
     LOGICAL, SAVE :: ok_conserv_q_omp
@@ -789,4 +789,12 @@
     nbapp_cv_omp = 0
     CALL getin('nbapp_cv',nbapp_cv_omp)
+
+    !Config  Key  = nbapp_wk
+    !Config  Desc = Frequence d'appel aux wakes
+    !Config  Def  = 0
+    !Config  Help = Nombre  d'appels des routines de wakes
+    !Config         par jour. Si =0, appel a chaque pas de temps physique.
+    nbapp_wk_omp = 0
+    CALL getin('nbapp_wk',nbapp_wk_omp)
 
     !Config  Key  = iflag_ener_conserv
@@ -2066,4 +2074,5 @@
     iflag_con = iflag_con_omp
     nbapp_cv = nbapp_cv_omp
+    nbapp_wk = nbapp_wk_omp
     iflag_ener_conserv = iflag_ener_conserv_omp
     ok_conserv_q = ok_conserv_q_omp
@@ -2400,4 +2409,5 @@
     write(lunout,*)'iflag_con=',iflag_con
     write(lunout,*)'nbapp_cv=',nbapp_cv
+    write(lunout,*)'nbapp_wk=',nbapp_wk
     write(lunout,*)'iflag_ener_conserv=',iflag_ener_conserv
     write(lunout,*)'ok_conserv_q=',ok_conserv_q
Index: /LMDZ5/trunk/libf/phylmd/phys_state_var_mod.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/phys_state_var_mod.F90	(revision 2729)
+++ /LMDZ5/trunk/libf/phylmd/phys_state_var_mod.F90	(revision 2730)
@@ -18,7 +18,9 @@
       INTEGER, SAVE :: radpas
       INTEGER, SAVE :: cvpas
+      INTEGER, SAVE :: wkpas
       REAL, PARAMETER :: missing_val_nf90=nf90_fill_real
 !$OMP THREADPRIVATE(radpas)
 !$OMP THREADPRIVATE(cvpas)
+!$OMP THREADPRIVATE(wkpas)
       REAL, SAVE :: dtime, solaire_etat0
 !$OMP THREADPRIVATE(dtime, solaire_etat0)
Index: /LMDZ5/trunk/libf/phylmd/physiq_mod.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/physiq_mod.F90	(revision 2729)
+++ /LMDZ5/trunk/libf/phylmd/physiq_mod.F90	(revision 2730)
@@ -139,4 +139,5 @@
        kh, kh_x, kh_w, &
        !
+       wake_k, &
        ale_wake, alp_wake, & 
        wake_h, wake_omg, &
@@ -564,5 +565,6 @@
     !pourquoi y'a pas de save??
     !
-    INTEGER wake_k(klon)            ! Wake sommet
+!!!    INTEGER, SAVE, DIMENSION(klon)   :: wake_k
+!!!    !$OMP THREADPRIVATE(wake_k) 
     !
     !jyg<
@@ -782,7 +784,7 @@
     !ym      SAVE  
     !
-    INTEGER itapcv
-    SAVE itapcv
-    !$OMP THREADPRIVATE(itapcv)
+    INTEGER itapcv, itapwk
+    SAVE itapcv, itapwk
+    !$OMP THREADPRIVATE(itapcv, itapwk)
 
     !KE43
@@ -1285,4 +1287,5 @@
        itaprad = 0
        itapcv = 0
+       itapwk = 0
 
        ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -1313,5 +1316,6 @@
        ENDIF
        IF (nbapp_cv .EQ. 0) nbapp_cv=86400./dtime
-       print *,'physiq, nbapp_cv ',nbapp_cv
+       IF (nbapp_wk .EQ. 0) nbapp_wk=86400./dtime
+       print *,'physiq, nbapp_cv, nbapp_wk ',nbapp_cv,nbapp_wk
        IF (MOD(INT(86400./dtime),nbapp_cv).EQ.0) THEN
           cvpas = NINT( 86400./dtime/nbapp_cv)
@@ -1324,4 +1328,16 @@
           abort_message='nbre de pas de temps physique n est pas multiple ' &
                // 'de nbapp_cv'
+          call abort_physic(modname,abort_message,1)
+       ENDIF
+       IF (MOD(INT(86400./dtime),nbapp_wk).EQ.0) THEN
+          wkpas = NINT( 86400./dtime/nbapp_wk)
+       print *,'physiq, wkpas ',wkpas
+       ELSE 
+          WRITE(lunout,*) 'le nombre de pas de temps physique doit etre un ', &
+               'multiple de nbapp_wk'
+          WRITE(lunout,*) 'changer nbapp_wk ou alors commenter ce test ', &
+               'mais 1+1<>2'
+          abort_message='nbre de pas de temps physique n est pas multiple ' &
+               // 'de nbapp_wk'
           call abort_physic(modname,abort_message,1)
        ENDIF
@@ -2317,5 +2333,4 @@
     IF (prt_level.ge.1) write(lunout,*) 'omega(igout, :) = ', &
          omega(igout, :)
-
     !
     ! Appel de la convection tous les "cvpas"
@@ -2574,6 +2589,9 @@
     !    .              d_u_con, d_v_con)
 
+!jyg    Reinitialize proba_notrig and itapcv when convection has been called
+    proba_notrig(:) = 1.
     itapcv = 0
     ENDIF !  (MOD(itapcv,cvpas).EQ.0)
+!
     itapcv = itapcv+1
 
@@ -2640,62 +2658,68 @@
     IF (iflag_wake>=1) THEN
        !
-       !  Call wakes only when convection has been called
-       IF (itapcv .EQ. 1) THEN
-       !
-       DO k=1,klev
-          DO i=1,klon
-             dt_dwn(i,k)  = ftd(i,k) 
-             dq_dwn(i,k)  = fqd(i,k) 
-             M_dwn(i,k)   = dnwd0(i,k)
-             M_up(i,k)    = upwd(i,k)
-             dt_a(i,k)    = d_t_con(i,k)/dtime - ftd(i,k) 
-             dq_a(i,k)    = d_q_con(i,k)/dtime - fqd(i,k)
-          ENDDO
-       ENDDO
-
-       IF (iflag_wake==2) THEN
-          ok_wk_lsp(:)=max(sign(1.,wake_s(:)-wake_s_min_lsp),0.)
-          DO k = 1,klev
-             dt_dwn(:,k)= dt_dwn(:,k)+ &
-                  ok_wk_lsp(:)*(d_t_eva(:,k)+d_t_lsc(:,k))/dtime
-             dq_dwn(:,k)= dq_dwn(:,k)+ &
-                  ok_wk_lsp(:)*(d_q_eva(:,k)+d_q_lsc(:,k))/dtime
-          ENDDO
-       ELSEIF (iflag_wake==3) THEN
-          ok_wk_lsp(:)=max(sign(1.,wake_s(:)-wake_s_min_lsp),0.)
-          DO k = 1,klev
+       !
+       ! Call wakes every "wkpas" step
+       !
+       IF (MOD(itapwk,wkpas).EQ.0) THEN
+          !
+          DO k=1,klev
              DO i=1,klon
-                IF (rneb(i,k)==0.) THEN
-                   ! On ne tient compte des tendances qu'en dehors des
-                   ! nuages (c'est-\`a-dire a priri dans une region ou
-                   ! l'eau se reevapore).
-                   dt_dwn(i,k)= dt_dwn(i,k)+ &
-                        ok_wk_lsp(i)*d_t_lsc(i,k)/dtime
-                   dq_dwn(i,k)= dq_dwn(i,k)+ &
-                        ok_wk_lsp(i)*d_q_lsc(i,k)/dtime
-                ENDIF
+                dt_dwn(i,k)  = ftd(i,k) 
+                dq_dwn(i,k)  = fqd(i,k) 
+                M_dwn(i,k)   = dnwd0(i,k)
+                M_up(i,k)    = upwd(i,k)
+                dt_a(i,k)    = d_t_con(i,k)/dtime - ftd(i,k) 
+                dq_a(i,k)    = d_q_con(i,k)/dtime - fqd(i,k)
              ENDDO
           ENDDO
-       ENDIF
-
-       !
-       !calcul caracteristiques de la poche froide
-       CALL calWAKE (iflag_wake_tend, paprs, pplay, dtime, &
-            t_seri, q_seri, omega,  &
-            dt_dwn, dq_dwn, M_dwn, M_up,  &
-            dt_a, dq_a,  &
-            sigd,  &
-            wake_deltat, wake_deltaq, wake_s, wake_dens,  &
-            wake_dth, wake_h,  &
-            wake_pe, wake_fip, wake_gfl,  &
-            d_t_wake, d_q_wake,  &
-            wake_k, t_x, q_x,  &
-            wake_omgbdth, wake_dp_omgb,  &
-            wake_dtKE, wake_dqKE,  &
-            wake_omg, wake_dp_deltomg,  &
-            wake_spread, wake_Cstar, d_deltat_wk_gw,  &
-            d_deltat_wk, d_deltaq_wk, d_s_wk, d_dens_wk)
-         !
-       ENDIF  ! (mod(itapcv,cvpas) .EQ. 1)
+         
+          IF (iflag_wake==2) THEN
+             ok_wk_lsp(:)=max(sign(1.,wake_s(:)-wake_s_min_lsp),0.)
+             DO k = 1,klev
+                dt_dwn(:,k)= dt_dwn(:,k)+ &
+                     ok_wk_lsp(:)*(d_t_eva(:,k)+d_t_lsc(:,k))/dtime
+                dq_dwn(:,k)= dq_dwn(:,k)+ &
+                     ok_wk_lsp(:)*(d_q_eva(:,k)+d_q_lsc(:,k))/dtime
+             ENDDO
+          ELSEIF (iflag_wake==3) THEN
+             ok_wk_lsp(:)=max(sign(1.,wake_s(:)-wake_s_min_lsp),0.)
+             DO k = 1,klev
+                DO i=1,klon
+                   IF (rneb(i,k)==0.) THEN
+                      ! On ne tient compte des tendances qu'en dehors des
+                      ! nuages (c'est-\`a-dire a priri dans une region ou
+                      ! l'eau se reevapore).
+                      dt_dwn(i,k)= dt_dwn(i,k)+ &
+                           ok_wk_lsp(i)*d_t_lsc(i,k)/dtime
+                      dq_dwn(i,k)= dq_dwn(i,k)+ &
+                           ok_wk_lsp(i)*d_q_lsc(i,k)/dtime
+                   ENDIF
+                ENDDO
+             ENDDO
+          ENDIF
+         
+          !
+          !calcul caracteristiques de la poche froide
+          CALL calWAKE (iflag_wake_tend, paprs, pplay, dtime, &
+               t_seri, q_seri, omega,  &
+               dt_dwn, dq_dwn, M_dwn, M_up,  &
+               dt_a, dq_a,  &
+               sigd,  &
+               wake_deltat, wake_deltaq, wake_s, wake_dens,  &
+               wake_dth, wake_h,  &
+               wake_pe, wake_fip, wake_gfl,  &
+               d_t_wake, d_q_wake,  &
+               wake_k, t_x, q_x,  &
+               wake_omgbdth, wake_dp_omgb,  &
+               wake_dtKE, wake_dqKE,  &
+               wake_omg, wake_dp_deltomg,  &
+               wake_spread, wake_Cstar, d_deltat_wk_gw,  &
+               d_deltat_wk, d_deltaq_wk, d_s_wk, d_dens_wk)
+          !
+          !jyg    Reinitialize itapwk when wakes have been called
+          itapwk = 0
+       ENDIF !  (MOD(itapwk,wkpas).EQ.0)
+       !
+       itapwk = itapwk+1
        !
        !-----------------------------------------------------------------------
@@ -2705,5 +2729,5 @@
        !------------------------------------------------------------------------
 
-!       Increment Wake state variables
+       ! Increment Wake state variables
        IF (iflag_wake_tend .GT. 0.) THEN
 
