Index: /trunk/LMDZ.GENERIC/README
===================================================================
--- /trunk/LMDZ.GENERIC/README	(revision 2106)
+++ /trunk/LMDZ.GENERIC/README	(revision 2107)
@@ -1439,5 +1439,5 @@
 - Remove a potential division by zero in thermcell_plume with variable zw2m.
 
-==14/01/2018 == AB
+== 14/01/2018 == AB
 - add comment in README for revisions 2066 and 2067
 - allocate f0 only if calltherm=true
@@ -1445,10 +1445,10 @@
 - replace watersat subroutine by Psat_water in the thermal plume model, cf. revision 1993 or 29/08/2018 JL comment.
 
-==07/02/2018 == AB
+== 07/02/2018 == AB
 - uncomment two "corrections" in thermcell_flux. They are used only if iflag_thermals_optflux is set to 0 (1 by default)
 - remove useless parameter fact_shell in thermcell_mod
 - now take d_temp into acocunt in thermcell_plume to trigger the plume and compute first unstable layer speed.
 
-==15/02/2018 == AB
+== 15/02/2018 == AB
 - Fix a bug in thermcell_alim.F90 where loops were inverted.
 - In thermal plume model, arrays size is set with ngrid,nlay arguments, no longer thanks to dimphy module.
@@ -1456,5 +1456,5 @@
 - Some minor changes in thermcell_plume and thermcell_main.
 
-==18/02/2018 == AB
+== 18/02/2018 == AB
 - use detr as thermcell_dq argument (called in thermcell_main) and clean up thermcell_dq.
 - fix a bug in thermcell_flux with lmax.
@@ -1462,2 +1462,5 @@
 - add new correction in thermcell_flux when entrainement is too high.
 - evaporate ice before calling thermal plume model
+
+== 26/02/2019 == AB
+- now convective adjustment can be used for layers beyond thermals
Index: /trunk/LMDZ.GENERIC/libf/phystd/convadj.F
===================================================================
--- /trunk/LMDZ.GENERIC/libf/phystd/convadj.F	(revision 2106)
+++ /trunk/LMDZ.GENERIC/libf/phystd/convadj.F	(revision 2107)
@@ -4,5 +4,5 @@
      &                   pdufi,pdvfi,pdhfi,pdqfi,
      &                   pduadj,pdvadj,pdhadj,
-     &                   pdqadj)
+     &                   pdqadj,lmax)
 
       USE tracer_h
@@ -41,4 +41,5 @@
       REAL pu(ngrid,nlay),pdufi(ngrid,nlay),pduadj(ngrid,nlay)
       REAL pv(ngrid,nlay),pdvfi(ngrid,nlay),pdvadj(ngrid,nlay)
+      INTEGER lmax(ngrid)
 
 !     Tracers
@@ -156,8 +157,10 @@
       DO l=2,nlay
         DO ig=1,ngrid
-          IF(zhc(ig,l).LT.zhc(ig,l-1)) vtest(ig)=.true.
+          IF (zhc(ig,l).LT.zhc(ig,l-1).and.(l.GT.lmax(ig))) THEN
+            vtest(ig)=.true.
+          ENDIF
         ENDDO
       ENDDO
-
+      
 !     Make a list of them
       jcnt=0
@@ -194,5 +197,5 @@
             l2 = l2 + 1
             IF (l2 .GT. nlay) EXIT
-            IF (zhc(i, l2) .LT. zhc(i, l2-1)) THEN
+            IF ((zhc(i, l2).LT.zhc(i, l2-1)).and.(l.GT.lmax(i))) THEN
  
 !     l2 is the highest level of the unstable column
@@ -223,5 +226,5 @@
                 down = .false.
                 IF (l1 .ne. 1) then    !--  and then
-                  IF (zhmc .lt. zhc(i, l1-1)) then
+                  IF ((zhmc.LT.zhc(i, l1-1)).and.(l.GT.lmax(i))) then
                     down = .true.
                   END IF
Index: /trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90
===================================================================
--- /trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90	(revision 2106)
+++ /trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90	(revision 2107)
@@ -1189,5 +1189,5 @@
       
       IF (calltherm) THEN
-! AB : we need to evaporate ice before calling thermcell_main
+! AB : We need to evaporate ice before calling thermcell_main
          IF (water) THEN
             CALL evap(ngrid,nlayer,nq,ptimestep,pt,pq,pdq,pdt,dqevap,dtevap,zqtherm,zttherm)
@@ -1197,9 +1197,9 @@
          ENDIF
          
-! AB:  WARNING: if a plume stops, the parametrization never look above if somewhere the atmosphere is still unstable!
-!               As is, there cannot be more than one plume by grid point by time step.
+! AB:  If a plume stops, the parametrization never look above if somewhere the atmosphere is still unstable!
+!      Maybe it's a good idea to call convective adjustment too.
          CALL thermcell_main(icount, ngrid, nlayer, ptimestep,                   &
                              pplay, pplev, pphi, firstcall,                      &
-                             pu, pv, pt, pq(:,:,igcm_h2o_vap),                   &
+                             pu, pv, zttherm, zqtherm(:,:,igcm_h2o_vap),         &
                              zdutherm, zdvtherm, zdttherm, zdotherm,             &
                              f0, fm0, entr0, detr0,                              &
@@ -1208,5 +1208,5 @@
                              lmin, lmix, lalim, lmax,                            &
                              zpopsk, ratqscth, ratqsdiff,                        &
-! AB : next variables are only used for diagnoses
+! AB : Next variables are only used for diagnoses
                              Ale_bl,Alp_bl,lalim_conv,wght_th,                   &
                              pbl_tke,pctsrf,omega_therm,airephy,                 &
@@ -1231,4 +1231,8 @@
          ENDIF
          
+      ELSE
+         
+         lmax(1:ngrid) = 0
+         
       ENDIF ! end of 'calltherm'
       
@@ -1250,5 +1254,5 @@
                       pdu,pdv,zdh,pdq,                      &
                       zduadj,zdvadj,zdhadj,                 &
-                      zdqadj)
+                      zdqadj,lmax)
 
          pdu(1:ngrid,1:nlayer) = pdu(1:ngrid,1:nlayer) + zduadj(1:ngrid,1:nlayer)
