Index: LMDZ6/trunk/libf/phylmd/physiq_mod.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/physiq_mod.F90	(revision 3179)
+++ LMDZ6/trunk/libf/phylmd/physiq_mod.F90	(revision 3180)
@@ -896,4 +896,9 @@
     LOGICAL, SAVE :: ok_bug_cv_trac = .TRUE.
     !$OMP THREADPRIVATE(ok_bug_cv_trac)
+    !
+    ! Logical switch to a bug : changing wake_deltat when thermals are active
+    ! even when there are no wakes.
+    LOGICAL, SAVE :: ok_bug_split_th = .TRUE.
+    !$OMP THREADPRIVATE(ok_bug_split_th)
 
     !
@@ -1280,4 +1285,5 @@
        CALL getin_p('ok_bad_ecmwf_thermo',ok_bad_ecmwf_thermo)
        CALL getin_p('ok_bug_cv_trac',ok_bug_cv_trac)
+       CALL getin_p('ok_bug_split_th',ok_bug_split_th)
        fl_ebil = 0 ! by default, conservation diagnostics are desactivated
        CALL getin_p('fl_ebil',fl_ebil)
@@ -3117,8 +3123,11 @@
              ENDDO
           !
-!!             CALL add_wake_tend &
-!!                 (d_deltat_the, d_deltaq_the, dsig0, ddens0, wkoccur1, 'the', abortphy) 
-             CALL add_wake_tend &
-                 (d_deltat_the, d_deltaq_the, dsig0, ddens0, wake_k, 'the', abortphy) 
+             IF (ok_bug_split_th) THEN
+               CALL add_wake_tend &
+                   (d_deltat_the, d_deltaq_the, dsig0, ddens0, wkoccur1, 'the', abortphy) 
+             ELSE
+               CALL add_wake_tend &
+                   (d_deltat_the, d_deltaq_the, dsig0, ddens0, wake_k, 'the', abortphy) 
+             ENDIF
              call prt_enerbil('the',itap)
           !
