Index: trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90	(revision 3341)
+++ trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90	(revision 3342)
@@ -1336,4 +1336,11 @@
          IF (water) THEN
             CALL evap(ngrid,nlayer,nq,ptimestep,pt,pq,pdq,pdt,dqevap,dtevap,zqtherm,zttherm)
+         !ALS24 adapats for generic tracer
+         ELSEIF (generic_condensation .and. .not. water) THEN
+            DO iq=1,nq
+               CALL generic_tracer_index(nq,iq,igcm_generic_vap,igcm_generic_ice,call_ice_vap_generic)
+               CALL evap_generic(ngrid,nlayer,nq,ptimestep,pt,pq,pdq,pdt,igcm_generic_vap, &
+                       igcm_generic_ice,dqevap,dtevap,zqtherm,zttherm)
+            ENDDO
          ELSE
             zttherm(:,:)   = pt(:,:)   + pdt(:,:)   * ptimestep
@@ -2522,4 +2529,11 @@
          call writediagfi(ngrid,'w_plm','Squared vertical velocity','m s$^{-1}$', 3, zw2_bis)
          call writediagfi(ngrid,'fraca','Updraft fraction','', 3, fraca)
+         call writediagfi(ngrid,"zdttherm","dt due to plumes","K-1 s-1",3,zdttherm) !ALS24
+         IF (tracer) THEN
+            call writediagfi(ngrid,"zdqtherm","dq due to plumes, iq = 1","kg kg-1 s-1",3, &
+                   zdqtherm(1:ngrid,1:nlayer,1)) !ALS24
+            call writediagfi(ngrid,"zdqtherm2","dq due to plumes; iq = 2","kg kg-1 s-1",3, &
+                   zdqtherm(1:ngrid,1:nlayer,2)) !ALS24
+         ENDIF
       endif
 
@@ -2655,4 +2669,6 @@
                call writediagfi(ngrid,"CLFt","H2O column cloud fraction"," ",2,totcloudfrac)
                call writediagfi(ngrid,"RH","relative humidity"," ",3,RH)
+               call writediagfi(ngrid,"vteta","virtual potential temperature","K",3,zh * (1.+(1./epsi-1.) * &
+                       zq(1:ngrid,1:nlayer,1)))
             endif
 
@@ -2667,4 +2683,6 @@
                call writediagfi(ngrid,"CLF","GCS cloud fraction"," ",3,cloudfrac)
                call writediagfi(ngrid,"RH_generic","GCS relative humidity"," ",3,RH_generic)
+               call writediagfi(ngrid,"vteta","virtual potential temperature","K",3,zh * (1.+(1./epsi_generic-1.) * &
+                       zq(1:ngrid,1:nlayer,1) ))
             endif
 
Index: trunk/LMDZ.GENERIC/libf/phystd/thermcell_dq.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/thermcell_dq.F90	(revision 3341)
+++ trunk/LMDZ.GENERIC/libf/phystd/thermcell_dq.F90	(revision 3342)
@@ -102,7 +102,11 @@
 ! Computation of tracer concentrations in the ascending plume
 !-------------------------------------------------------------------------------
-      
+      !ALS24 initialises qa in first layer
       DO ig=1,ngrid
-         DO l=1,nlay
+         qa(ig,1) = q(ig,1)
+      ENDDO
+
+      DO ig=1,ngrid
+         DO l=2,nlay
             IF ((fm(ig,l+1)+detr(ig,l))*ptimestep > 1.e-6*masse(ig,l)) THEN
                qa(ig,l) = (fm(ig,l) * qa(ig,l-1) + entr(ig,l) * q(ig,l))      &
Index: trunk/LMDZ.GENERIC/libf/phystd/thermcell_env.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/thermcell_env.F90	(revision 3341)
+++ trunk/LMDZ.GENERIC/libf/phystd/thermcell_env.F90	(revision 3342)
@@ -26,6 +26,9 @@
       USE watercommon_h, ONLY: RLvCp, RETV, Psat_water
       USE tracer_h, ONLY: igcm_h2o_vap, igcm_h2o_ice
-      USE callkeys_mod, ONLY: water
-      
+      USE callkeys_mod, ONLY: water, generic_condensation
+      USE comcstfi_mod, ONLY: r, cpp, mugaz
+      USE generic_cloud_common_h, ONLY: Psat_generic, epsi_generic, RLVTT_generic
+      USE generic_tracer_index_mod, ONLY: generic_tracer_index
+            
       IMPLICIT NONE
       
@@ -65,8 +68,15 @@
 !     ------
       
-      INTEGER ig, k
+      INTEGER ig, k, iq
       
       REAL psat                                       ! Dummy argument for Psat_water()
       
+      !ALS24 declaration for generic tracer
+      INTEGER :: igcm_generic_vap, igcm_generic_ice! index of the vap and ice of generic_tracer
+      LOGICAL :: call_ice_vap_generic ! to call only one time the ice/vap pair of a tracer
+      REAL, SAVE :: metallicity ! metallicity of planet --- is not used here, but necessary to call function Psat_generic
+      !$OMP THREADPRIVATE(metallicity)
+      REAL :: RETV_generic, RV_generic, RLvCp_generic
+
 !===============================================================================
 ! Initialization
@@ -81,4 +91,6 @@
       zql(:,:) = 0.
       
+      metallicity=0.0 ! default value --- is not used here but necessary to call function Psat_generic
+       
 !===============================================================================
 ! Condensation and latent heat release
@@ -103,5 +115,38 @@
             ENDDO
          ENDDO
-         
+      
+      ELSEIF (generic_condensation .AND. .NOT. water ) THEN
+
+         DO iq=1,nq
+
+            CALL generic_tracer_index(nq,iq,igcm_generic_vap,igcm_generic_ice,call_ice_vap_generic)
+
+            IF (call_ice_vap_generic) THEN ! to call only one time the ice/vap pair of a tracer
+
+               zqt(:,:) = pq(:,:,igcm_generic_vap)
+
+               DO k = 1,nlay
+                  DO ig=1,ngrid
+                     CALL Psat_generic(pt(ig,k),pplev(ig,k),metallicity,psat,zqs(ig,k))
+                  ENDDO
+               ENDDO
+
+               RV_generic = (8.314511*1000.)/(epsi_generic*mugaz)
+               RETV_generic = RV_generic/(r-1.)
+               RLvCp_generic = RLVTT_generic/cpp
+
+               DO k = 1,nlay
+                  DO ig=1,ngrid
+                     zql(ig,k) = max(0.,pq(ig,k,igcm_generic_vap) - zqs(ig,k))
+                     zt(ig,k)  = pt(ig,k) + RLvCp_generic * zql(ig,k)
+                     ztv(ig,k) = zt(ig,k) / zpopsk(ig,k)                      &
+                     &        * (1. + RETV_generic * (zqt(ig,k)-zql(ig,k)) - zql(ig,k))
+                  ENDDO
+               ENDDO
+
+            ENDIF !call_ice_vap_generic
+
+         ENDDO!nq
+   
       ELSE
          
Index: trunk/LMDZ.GENERIC/libf/phystd/thermcell_plume.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/thermcell_plume.F90	(revision 3341)
+++ trunk/LMDZ.GENERIC/libf/phystd/thermcell_plume.F90	(revision 3342)
@@ -26,5 +26,8 @@
       USE tracer_h, ONLY: igcm_h2o_vap
       USE thermcell_mod
-      
+      USE comcstfi_mod, ONLY: r, cpp, mugaz
+      USE callkeys_mod, ONLY: water, generic_condensation
+      USE generic_cloud_common_h, ONLY: Psat_generic, epsi_generic, RLVTT_generic
+
       IMPLICIT NONE
       
@@ -98,5 +101,9 @@
       LOGICAL active(ngrid)                           ! If the plume is active (speed and incoming mass flux > 0)
       LOGICAL activetmp(ngrid)                        ! If the plume is active (active=true and outgoing mass flux > 0)
-      
+
+      REAL, SAVE :: metallicity ! metallicity of planet --- is not used here, but necessary to call function Psat_generic
+      REAL :: RV_generic
+      REAL :: RETV_comp, RLvCp_comp !values used for computation (depends if water or generic tracer)
+
 !===============================================================================
 ! Initialization
@@ -129,5 +136,17 @@
       
       l_start = nlay
-      
+
+      metallicity=0.0 ! default value --- is not used here but necessary to call function Psat_generic
+
+      ! ALS24 for thermal plume model with generic tracer
+      IF (water) THEN
+         RETV_comp = RETV
+         RLvCp_comp = RLvCp 
+      ELSEIF (generic_condensation .AND. .NOT. water ) THEN
+         RV_generic = (8.314511*1000.)/(epsi_generic*mugaz)
+         RETV_comp = RV_generic/(r-1.)
+         RLvCp_comp = RLVTT_generic/cpp
+      ENDIF
+
 !===============================================================================
 ! First layer computation
@@ -180,5 +199,9 @@
          DO ig=1,ngrid
             IF (active(ig)) THEN
-               CALL Psat_water(ztemp(ig), pplev(ig,l), psat, zqsa_est(ig))
+               IF (water) THEN
+                  CALL Psat_water(ztemp(ig), pplev(ig,l), psat, zqsa_est(ig))
+               ELSEIF (generic_condensation .AND. .NOT.  water) THEN
+                  CALL Psat_generic(ztemp(ig),pplev(ig,l),metallicity,psat,zqsa_est(ig))
+               ENDIF
             ENDIF
          ENDDO
@@ -192,7 +215,7 @@
                zqla_est(ig,l) = MAX(0.,zqta(ig,l-1) - zqsa_est(ig))              ! zqla_est is set to ql   plume
                zta_est(ig,l)  = zhla(ig,l-1) * zpopsk(ig,l)                   &  ! zta_est  is set to TR   plume
-               &              + RLvCp * zqla_est(ig,l)
+               &              + RLvCp_comp * zqla_est(ig,l)
                ztva_est(ig,l) = zta_est(ig,l) / zpopsk(ig,l)                  &  ! ztva_est is set to TRPV plume
-               &              * (1. + RETV * (zqta(ig,l-1)-zqla_est(ig,l)) - zqla_est(ig,l))
+               &              * (1. + RETV_comp * (zqta(ig,l-1)-zqla_est(ig,l)) - zqla_est(ig,l))
                
                zbuoy(ig,l) = RG * (ztva_est(ig,l) - ztv(ig,l)) / ztv(ig,l)
@@ -263,5 +286,9 @@
          DO ig=1,ngrid
             IF (activetmp(ig)) THEN
-               CALL Psat_water(ztemp(ig), pplev(ig,l), psat, zqsa(ig,l))
+               IF (water) THEN
+                  CALL Psat_water(ztemp(ig), pplev(ig,l), psat, zqsa(ig,l))
+               ELSEIF (generic_condensation .AND. .NOT. water ) THEN
+                  CALL Psat_generic(ztemp(ig),pplev(ig,l),metallicity,psat,zqsa(ig,l))
+               ENDIF
             ENDIF
          ENDDO
@@ -275,7 +302,7 @@
                zqla(ig,l) = MAX(0.,zqta(ig,l) - zqsa(ig,l))                      ! zqla is set to ql   plume (mixed)
                zta(ig,l)  = zhla(ig,l) * zpopsk(ig,l)                         &  ! ztva is set to TR   plume (mixed)
-               &          + RLvCp * zqla(ig,l)
+               &          + RLvCp_comp * zqla(ig,l)
                ztva(ig,l) = zta(ig,l) / zpopsk(ig,l)                          &  ! ztva is set to TRPV plume (mixed)
-               &          * (1. + RETV*(zqta(ig,l)-zqla(ig,l)) - zqla(ig,l))
+               &          * (1. + RETV_comp*(zqta(ig,l)-zqla(ig,l)) - zqla(ig,l))
                
                zbuoy(ig,l) = RG * (ztva(ig,l) - ztv(ig,l)) / ztv(ig,l)
