Index: trunk/LMDZ.PLUTO/libf/phypluto/condensation_generic_mod.F90
===================================================================
--- trunk/LMDZ.PLUTO/libf/phypluto/condensation_generic_mod.F90	(revision 3572)
+++ 	(revision )
@@ -1,260 +1,0 @@
-module condensation_generic_mod
-    implicit none
-    
-contains
-    
-    subroutine condensation_generic(ngrid,nlayer,nq,ptimestep, pplev, pplay,    &
-                pt, pq, pdt, pdq, pdtlsc, pdqvaplsc, pdqliqlsc, rneb)
-        use ioipsl_getin_p_mod, only: getin_p !-> to get the metallicity 
-        use generic_cloud_common_h
-        USE tracer_h
-        USE mod_phys_lmdz_para, only: is_master
-        use generic_tracer_index_mod, only: generic_tracer_index
-        IMPLICIT none
-
-!=======================================================================
-!     
-!     Purpose
-!     -------
-!     Calculates large-scale condensation of generic tracer "tname".
-!     By convention, tname ends with the suffix "_gas", as it represents the 
-!     gas phase of the generic tracer
-!     
-!     Authors
-!     -------
-!     Adapted from largescale.F90 by Lucas Teinturier & Noé Clément (2022)
-!     largescale.F90 adapted from the LMDTERRE code by R. Wordsworth (2009)
-!     Original author Z. X. Li (1993)
-!     
-!=========================================================================
-
-        INTEGER, intent(in) :: ngrid,nlayer,nq
-
-!       Arguments
-        REAL, intent(in) :: ptimestep             ! intervalle du temps (s)
-        REAL, intent(in) :: pplev(ngrid,nlayer+1) ! pression a inter-couche
-        REAL, intent(in) :: pplay(ngrid,nlayer)   ! pression au milieu de couche
-        REAL, intent(in) :: pt(ngrid,nlayer)      ! temperature (K)
-        REAL, intent(in) :: pq(ngrid,nlayer,nq)   ! tracer mixing ratio (kg/kg)
-        REAL, intent(in) :: pdt(ngrid,nlayer)     ! physical temperature tendency (K/s)
-        REAL, intent(in) :: pdq(ngrid,nlayer,nq)  ! physical tracer tendency (K/s)
-        ! CHARACTER(*), intent(in) :: tname_gas     ! name of the tracer we consider. BY convention, it ends with _gas !!!
-        REAL, intent(out) :: pdtlsc(ngrid,nlayer)  ! incrementation de la temperature (K)
-        REAL, intent(out) :: pdqvaplsc(ngrid,nlayer,nq) ! incrementation de la vapeur du traceur
-        REAL, intent(out) :: pdqliqlsc(ngrid,nlayer,nq) ! incrementation du traceur liquide
-        REAL, intent(out) :: rneb(ngrid,nlayer,nq)    ! fraction nuageuse
-
-!       Options : 
-        real, save :: metallicity !metallicity of planet
-        REAL, SAVE :: qvap_deep   ! deep mixing ratio of vapor when simulating bottom less planets
-        REAL, SAVE :: qvap_top   ! top mixing ratio of vapor when simulating bottom less planets
-        logical, save :: perfect_gas_profile
-!$OMP THREADPRIVATE(metallicity, qvap_deep, qvap_top, perfect_gas_profile)
-
-!       Local variables
-
-        ! to call only one time the ice/vap pair of a tracer
-        logical call_ice_gas_generic
-
-        INTEGER i, k , nn, iq
-        INTEGER,PARAMETER :: nitermax=5000
-        REAL tau ! tau is in seconds and must not be lower than the physical step time.
-        integer k_cold_trap
-        DOUBLE PRECISION,PARAMETER :: alpha=.1,qthreshold=1.d-8
-        ! JL13: if "careful, T<Tmin in psat water" appears often, you may want to stabilise the model by
-        !                   decreasing alpha and increasing nitermax accordingly
-        DOUBLE PRECISION zq(ngrid)
-        DOUBLE PRECISION zcond(ngrid),zcond_iter
-        DOUBLE PRECISION zqs(ngrid)
-        real zt(ngrid),local_p,psat_tmp,dlnpsat_tmp,Lcp,zqs_temp,zdqs
-        real zqs_temp_1, zqs_temp_2, zqs_temp_3
-        integer igcm_generic_gas, igcm_generic_ice! index of the vap and ice of generic_tracer
-        ! CHARACTER(len=*) :: tname_ice
-        ! evaporation calculations
-        REAL dqevap(ngrid,nlayer),dtevap(ngrid,nlayer)     
-        REAL qevap(ngrid,nlayer,nq)
-        REAL tevap(ngrid,nlayer)
-
-        DOUBLE PRECISION zx_q(ngrid)
-        DOUBLE PRECISION zy_q(ngrid)
-        LOGICAL,SAVE :: firstcall=.true.
-!$OMP THREADPRIVATE(firstcall)
-        IF (firstcall) THEN
-                write(*,*) "value for metallicity? "
-                metallicity=0.0 ! default value
-                call getin_p("metallicity",metallicity)
-                write(*,*) " metallicity = ",metallicity
-
-                write(*,*) "Deep generic tracer vapor mixing ratio ? (no effect if negative) "
-                qvap_deep=-1. ! default value
-                call getin_p("qvap_deep",qvap_deep)
-                write(*,*) " qvap_deep = ",qvap_deep   
-
-                write(*,*) "top generic tracer vapor mixing ratio ? (no effect if negative) "
-                qvap_top=-1. ! default value
-                call getin_p("qvap_top",qvap_top)
-                write(*,*) " qvap_top = ",qvap_top 
-                
-                write(*,*) " perfect_gas_profile ? "
-                perfect_gas_profile=.false. ! default value
-                call getin_p("perfect_gas_profile",perfect_gas_profile)
-                write(*,*) " perfect_gas_profile = ",perfect_gas_profile
-
-                firstcall = .false.
-        ENDIF
-!       Initialisation of outputs and local variables
-        pdtlsc(1:ngrid,1:nlayer)  = 0.0
-        pdqvaplsc(1:ngrid,1:nlayer,1:nq)  = 0.0
-        pdqliqlsc(1:ngrid,1:nlayer,1:nq) = 0.0
-        dqevap(1:ngrid,1:nlayer)=0.0
-        dtevap(1:ngrid,1:nlayer)=0.0
-        qevap(1:ngrid,1:nlayer,1:nq)=0.0
-        tevap(1:ngrid,1:nlayer)=0.0
-        rneb(1:ngrid,1:nlayer,1:nq) = 0.0
-        ! Let's loop on tracers 
-        do iq=1,nq
-
-                call generic_tracer_index(nq,iq,igcm_generic_gas,igcm_generic_ice,call_ice_gas_generic)
-
-                if(call_ice_gas_generic) then ! to call only one time the ice/vap pair of a tracer
-                        m=constants_mass(iq)
-                        delta_gasH=constants_delta_gasH(iq)
-                        Tref=constants_Tref(iq)
-                        Pref=constants_Pref(iq)
-                        epsi_generic=constants_epsi_generic(iq)
-                        RLVTT_generic=constants_RLVTT_generic(iq)
-                        metallicity_coeff=constants_metallicity_coeff(iq)
-
-                        Lcp=RLVTT_generic/cpp ! need to be init here
-
-                        !  Vertical loop (from top to bottom)
-                        DO k = nlayer, 1, -1
-                                zt(1:ngrid)=pt(1:ngrid,k)+pdt(1:ngrid,k)*ptimestep
-
-                                ! Computes Psat and the partial condensation
-                                DO i = 1, ngrid
-                                        local_p=pplay(i,k)
-                                        if(zt(i).le.15.) then
-                                                print*,'in lsc',i,k,zt(i)
-                                        !	    zt(i)=15.   ! check too low temperatures
-                                        endif
-                                        zx_q(i) = pq(i,k,igcm_generic_gas)+pdq(i,k,igcm_generic_gas)*ptimestep
-
-                                        call Psat_generic(zt(i),local_p,metallicity,psat_tmp,zqs_temp)
-                                        zy_q(i) = pq(i,k,igcm_generic_ice)+pdq(i,k,igcm_generic_ice)*ptimestep
-                                        
-                                        if ((zx_q(i) .le. zqs_temp) .and. (zy_q(i) .eq. 0.)) then
-                                                ! if we are are not saturated and if there is no ice
-                                                ! then no change
-
-                                                zcond(i) = 0.0d0
-                                        
-                                        else    ! if we are saturated : we must evaporate
-                                                ! if there is ice : we must check if we can condensate
-
-                                                ! iterative process to stabilize the scheme when large water amounts JL12
-                                                zcond(i) = 0.0d0
-                                                Do nn=1,nitermax  
-                                                        call Psat_generic(zt(i),local_p,metallicity,psat_tmp,zqs_temp)
-                                                        zqs(i)=zqs_temp
-                                                        call Lcpdqsat_generic(zt(i),local_p,psat_tmp,zqs_temp,zdqs,dlnpsat_tmp)
-                                                        zcond_iter = alpha*(zx_q(i)-zqs(i))/(1.d0+zdqs)
-                                                        !zcond can be negative here
-                                                        zx_q(i) = zx_q(i) - zcond_iter
-                                                        zcond(i) = zcond(i) + zcond_iter
-                                                        zt(i) = zt(i) + zcond_iter*Lcp
-                                                        if (ABS(zcond_iter/alpha/zqs(i)).lt.qthreshold) exit
-                                                        if (nn.eq.nitermax) print*,'itermax in largescale'
-                                                End do ! niter
-
-                                                ! if zcond(i) > 0, zcond(i) is the amount of vapor that we can condensate
-                                                !                       because we are saturated. zcond(i) will not change below
-                                                ! if zcond(i) < 0, zcond(i) is the amount of ice that we can evaporate.
-                                                !                       We can not evaporate more than the existing ice, 
-                                                !                       so the line below is to check how much we can evaporate.
-                                                !                       If there is no ice available, zcond(i) will be 0. (first condidition of "if")
-
-                                                zcond(i)=MAX(zcond(i),-(pq(i,k,igcm_generic_ice)+pdq(i,k,igcm_generic_ice)*ptimestep))
-                                        
-                                        endif
-
-                                        if (zcond(i) .gt. 0.) then
-                                                rneb(i,k,iq)=1
-                                        else
-                                                rneb(i,k,iq)=0.
-                                        endif
-
-                                        zcond(i) = zcond(i)/ptimestep
-                                ENDDO ! i=1,ngrid
-
-                                !Tendances de t et q
-                                pdqvaplsc(1:ngrid,k,igcm_generic_gas)  = - zcond(1:ngrid) 
-                                pdqliqlsc(1:ngrid,k,igcm_generic_ice) = - pdqvaplsc(1:ngrid,k,igcm_generic_gas)
-                                pdtlsc(1:ngrid,k)  = pdtlsc(1:ngrid,k) + pdqliqlsc(1:ngrid,k,igcm_generic_ice)*Lcp
-
-                        Enddo ! k= nlayer, 1, -1
-
-                        if ((perfect_gas_profile) .and. (ngrid.eq.1)) then
-                                ! perfect_gas_profile is a mode that should a priori only be used in 1D:
-                                ! as it is written below, it aims to force the vap profile:
-                                ! - below condensation, it is forced to qvap_deep
-                                ! - at condensation levels, it is forced to 99% of sat
-                                ! - above the cold trap, it is forced to the value allowed by the cold trap
-
-                                ! perfect_gas_profile can be customed as you want
-                                
-                                tau = 10. * ptimestep ! tau must not be lower than the physical step time. 
-
-                                k_cold_trap = 2
-                                do k=2,nlayer-1
-
-                                        zt(1)=pt(1,k-1)+pdt(1,k-1)*ptimestep
-                                        call Psat_generic(zt(1),pplay(1,k-1),metallicity,psat_tmp,zqs_temp_1)
-                                        zt(1)=pt(1,k)+pdt(1,k)*ptimestep
-                                        call Psat_generic(zt(1),pplay(1,k),metallicity,psat_tmp,zqs_temp_2)
-                                        zt(1)=pt(1,k+1)+pdt(1,k+1)*ptimestep
-                                        call Psat_generic(zt(1),pplay(1,k+1),metallicity,psat_tmp,zqs_temp_3)
-
-                                        if ((zqs_temp_1 .gt. zqs_temp_2) .and. (zqs_temp_3 .gt. zqs_temp_2)) then
-                                                k_cold_trap = k
-                                                exit
-                                        endif
-                                enddo
-                                if (k_cold_trap .lt. nlayer) then
-                                        do k=k_cold_trap+1,nlayer
-                                                pdqvaplsc(1,k,igcm_generic_gas) = (pq(1,k_cold_trap,igcm_generic_gas) - pq(1,k,igcm_generic_gas))/tau - pdq(1,k,igcm_generic_gas)
-                                        enddo
-                                endif
-
-                                do k=1,k_cold_trap
-                                        zt(1)=pt(1,k)+pdt(1,k)*ptimestep
-                                        call Psat_generic(zt(1),pplay(1,k),metallicity,psat_tmp,zqs_temp)
-                                        if (zqs_temp .gt. qvap_deep) then
-                                                pdqvaplsc(1,k,igcm_generic_gas)  = (qvap_deep - pq(1,k,igcm_generic_gas))/tau - pdq(1,k,igcm_generic_gas)
-                                        endif
-                                        if (zqs_temp .lt. qvap_deep) then
-                                                pdqvaplsc(1,k,igcm_generic_gas)  = (0.99*zqs_temp - pq(1,k,igcm_generic_gas))/tau - pdq(1,k,igcm_generic_gas)
-                                        endif
-                                enddo
-
-                                pdqliqlsc(1:ngrid,:,igcm_generic_ice) = 0.
-                                pdtlsc(1:ngrid,:)  = 0.
-                        endif
-
-                        if (qvap_deep >= 0.) then
-                                tau = 10. * ptimestep ! tau must not be lower than the physical step time. 
-                                ! brings lower generic vapor ratio to a fixed value.
-                                ! tau is in seconds and must not be lower than the physical step time.
-                                pdqvaplsc(1:ngrid,1,igcm_generic_gas) = (qvap_deep - pq(1:ngrid,1,igcm_generic_gas))/tau - pdq(1:ngrid,1,igcm_generic_gas)
-                        endif
-                        if (qvap_top >= 0.) then
-                                tau = 10. * ptimestep ! tau must not be lower than the physical step time. 
-                                ! brings lower generic vapor ratio to a fixed value.
-                                ! tau is in seconds and must not be lower than the physical step time.
-                                pdqvaplsc(1:ngrid,nlayer,igcm_generic_gas) = (qvap_top - pq(1:ngrid,nlayer,igcm_generic_gas))/tau - pdq(1:ngrid,nlayer,igcm_generic_gas)
-                        endif
-                endif !if(call_ice_gas_generic)
-        enddo ! iq=1,nq
-
-    end subroutine condensation_generic
-end module condensation_generic_mod
Index: trunk/LMDZ.PLUTO/libf/phypluto/generic_cloud_common_h.F90
===================================================================
--- trunk/LMDZ.PLUTO/libf/phypluto/generic_cloud_common_h.F90	(revision 3572)
+++ 	(revision )
@@ -1,277 +1,0 @@
-module generic_cloud_common_h
-
-    !============================================================================
-    ! Purpose
-    ! -------
-    ! Set up relevant constants and parameters for generic condensable tracers cycles, 
-    ! and generic condensable tracers cloud properties
-    !
-    ! Authors
-    ! -------
-    ! Adapted from watercommon_h.F90
-    ! by Lucas Teinturier & Noé Clément (2022)
-    !============================================================================
-
-    use comcstfi_mod, only: r, cpp, mugaz
-    implicit none 
-    real, save :: m  ! molecular mass of the specie (g/mol)
-    real, save :: delta_gasH ! Enthalpy of vaporization (J/mol)
-    real,save :: Tref ! Ref temperature for Clausis-Clapeyron (K)
-    real,save :: Pref ! Reference pressure for Clausius Clapeyron (Pa)
-    real, save :: epsi_generic ! fractionnal molecular mass (m/mugaz)
-    real,save :: RLVTT_generic !Latent heat of vaporization (J/kg)
-    real,save :: metallicity_coeff ! Coefficient to take into account the metallicity
-    real,save :: RCPV_generic ! specific heat capacity of the tracer vapor at Tref
-    
-    contains 
-
-    subroutine specie_parameters(specname)
-        
-        implicit none
-
-    !============================================================================
-    !   Load the adequate set of parameters for specname
-    !   We use Clausius Clapeyron.
-    !   Values are based on Vissher (2010) and Morley (2012).
-    !
-    !   Also set up few others useful parameters, such as epsi_generic=m/mugaz, RLVTT_generic and
-    !   the metallicity_coeff.
-    !   Authors 
-    !   --------
-    !   Lucas Teinturier (2022) 
-    !============================================================================
-        ! Inputs
-        character(*), intent(in) :: specname
-        print*,"entree dans specie_parameters avec specname = ",specname
-        if (trim(specname) .eq. "Mg") then
-            print*,"Loading data for Mg"
-            delta_gasH = 521.7E3 !J/mol
-            Tref = 2303.0 !K
-            Pref =   1.0E5 !in Pa
-            m = 140.6931
-            RLVTT_generic = delta_gasH/(m/1000.)
-            metallicity_coeff=1.0*log(10.0)
-            
-        else if (trim(specname) .eq. "Na") then
-            print*,"Loading data for Na"
-            delta_gasH = 265.9E3
-            Tref = 1624.0
-            Pref =  1.0E5
-            m = 78.04454 !Na2S
-            RLVTT_generic = delta_gasH/(m/1000.)
-            metallicity_coeff=0.5*log(10.0)
-            
-        else if (trim(specname) .eq. "Fe") then 
-            print*,"Loading data for Fe"
-            delta_gasH = 401.9E3 
-            Tref = 2903.0
-            Pref  = 1.0E5
-            m = 55.8450
-            RLVTT_generic = delta_gasH/(m/1000.)
-            metallicity_coeff=0.0*log(10.0)
-            
-        else if (trim(specname) .eq. "Cr") then
-            print*,"Loading data for Cr"
-            delta_gasH = 394.2E3
-            Tref = 2749.0
-            Pref  = 1.0E5
-            m = 51.9961
-            RLVTT_generic = delta_gasH/(m/1000.)
-            metallicity_coeff=0.0*log(10.0)
-            
-        else if (trim(specname) .eq. "KCl") then 
-            print*,"Loading data for KCl"
-            delta_gasH = 217.9E3
-            Tref = 1495.0
-            Pref = 1.0E5
-            metallicity_coeff=0.0*log(10.0)
-            m = 74.5498
-            RLVTT_generic = delta_gasH/(m/1000.)
-        else if (trim(specname) .eq. "Mn") then 
-            print*,"Loading data for Mn"
-            delta_gasH = 455.8E3
-            Tref = 2064.0
-            Pref = 1.0E5
-            metallicity_coeff=1.0*log(10.0)
-            m = 87.003049
-            RLVTT_generic = delta_gasH/(m/1000.)
-        else if (trim(specname) .eq. "Zn") then 
-            print*,"Loading data for Zn"
-            delta_gasH = 303.9E3
-            Tref = 1238.0
-            Pref = 1.0E5
-            metallicity_coeff=1.0*log(10.0)
-            m = 97.445
-            RLVTT_generic = delta_gasH/(m/1000.)
-        else
-            print*,"Unknow species (not in Mg, Fe, Na, KCl, Cr, Mn or Zn)"
-        endif
-        epsi_generic = m/mugaz
-    end subroutine specie_parameters
-
-
-    subroutine specie_parameters_table(specname)
-        use datafile_mod, only: datadir
-        implicit none
-    !============================================================================
-    !   Load the adequate set of parameters for specname
-    !   From a table of traceurs
-    !
-    !   Also set up few others useful parameters, such as epsi_generic=m/mugaz, RLVTT_generic and
-    !   the metallicity_coeff.
-    !   Authors 
-    !   --------
-    !   Noé Clément (2022) 
-    !============================================================================
-
-        character(*), intent(in) :: specname
-        integer :: ios
-        character(len=500):: table_traceurs_line ! table_traceurs_line lines with parameters
-
-        open(117,file=trim(datadir)//'/table_tracers_condensable',form='formatted',status='old')
-
-        read(117,'(A)') table_traceurs_line
-
-        do
-            read(117,'(A)', iostat=ios) table_traceurs_line
-            
-            if (index(table_traceurs_line,specname) /= 0) then
-                
-                if (index(table_traceurs_line,'delta_gasH='   ) /= 0) then
-                    read(table_traceurs_line(index(table_traceurs_line,'delta_gasH=')+len('delta_gasH='):),*) delta_gasH
-                    print*, 'delta_gasH ', delta_gasH
-                end if
-                if (index(table_traceurs_line,'Tref='   ) /= 0) then
-                    read(table_traceurs_line(index(table_traceurs_line,'Tref=')+len('Tref='):),*) Tref
-                    print*, 'Tref', Tref
-                end if 
-                if (index(table_traceurs_line,'Pref='   ) /= 0) then
-                    read(table_traceurs_line(index(table_traceurs_line,'Pref=')+len('Pref='):),*) Pref
-                    print*, 'Pref', Pref
-                end if
-                if (index(table_traceurs_line,'mass='   ) /= 0) then
-                    read(table_traceurs_line(index(table_traceurs_line,'mass=')+len('mass='):),*) m
-                    print*, 'mass', m
-                end if
-                if (index(table_traceurs_line,'metallicity_coeff='   ) /= 0) then
-                   read(table_traceurs_line(index(table_traceurs_line,'metallicity_coeff=')+len('metallicity_coeff='):),*) metallicity_coeff
-                   print*, 'metallicity_coeff', metallicity_coeff
-                end if
-                if (index(table_traceurs_line,'RCPV_generic='   ) /= 0) then
-                    read(table_traceurs_line(index(table_traceurs_line,'RCPV_generic=')+len('RCPV_generic='):),*) RCPV_generic
-                    print*, 'RCPV_generic', RCPV_generic
-                end if
-                         
-                ios=1
-            end if
-
-            if (ios /= 0) exit
-            
-        end do
-
-        if (ios .eq. -1) then ! If the file has been read but there is no data on the speci, then we have ios equal to -1
-
-            write(*,*), "ERROR : the following traceur is not referenced in the table_tracers_condensable : ", specname
-
-        end if
-        
-        close(117)
-
-        RLVTT_generic=delta_gasH/(m/1000.)
-
-        write(*,*) 'RLVTT_generic', RLVTT_generic
-
-        epsi_generic = m/mugaz
-
-    end subroutine specie_parameters_table
-
-    subroutine Psat_generic(T,p,metallicity,psat,qsat)
-        IMPLICIT NONE 
-    !============================================================================
-    !   Clausius-Clapeyron relation : 
-    !   d(Ln(psat))/dT = delta_gasH/(RT^2)
-    !   ->Psat = Pref * exp(-delta_gasH/R*(1/T-1/Tref))
-    !
-    !   Authors 
-    !   --------
-    !   Lucas Teinturier (2022) adapted from Psat_water of Jeremy Leconte (2012)
-    !============================================================================
-        !Inputs
-        real, intent(in) :: T, p ! Temperature and pressure of the layer (in K and Pas)
-        real, intent(in) :: metallicity ! metallycity (log10)
-        !Outputs 
-        real, intent(out) :: psat,qsat !saturation vapor pressure (Pa) and mass mixing ratio at saturation (kg/kg) of the layer 
-
-        psat = pref*exp(-delta_gasH/(r*mugaz/1000.)*(1/T-1/Tref)-metallicity_coeff*metallicity) ! in Pa (because pref in Pa)
-
-        if (psat .gt. p) then 
-            qsat = 1. ! is the maximum amount of vapor that a parcel can hold without condensation, in specific concentration.
-        else 
-            qsat = epsi_generic *psat/(p-(1-epsi_generic)*psat)
-        endif
-    end subroutine Psat_generic 
-
-    subroutine Lcpdqsat_generic(T,p,psat,qsat,dqsat,dlnpsat)
-        implicit none 
-
-    !===============================================================================
-    !   Compute dqsat = L/cp* d(qsat)/dT and d(Ln(psat)) = L/cp*d(Ln(psat))/dT
-    !   we have d(ln(psat))/dT =  delta_gasH/R*(1/T^2) for clausius-clapeyron
-    !   r*mugaz/1000. is the perfect gaz constant in the computation of "dummy"
-    !   Authors 
-    !   --------
-    !   Lucas Teinturier (2022) adapted from Lcpdqsat_water of Jeremy Leconte (2012)
-    !===============================================================================
-        ! Inputs 
-        real, intent(in) :: T ! Temperature (K)
-        real, intent(in) :: p ! Pressure (Pa)
-        real, intent(in) :: psat ! Saturation vapor pressure (Pa)
-        real, intent(in) :: qsat ! Mass mixing ratio at saturation (kg/kg)
-
-        ! Outputs 
-        real, intent(out) :: dqsat,dlnpsat 
-
-        ! Variables 
-        real :: dummy ! used to store d(ln(psat))/dT
-
-        dummy = delta_gasH/((r*mugaz/1000.)*(T**2)) 
-
-        if (psat .gt. p) then 
-            dqsat =0.
-        else 
-            dqsat = (RLVTT_generic/cpp) *qsat*(p/(p-(1-epsi_generic)*psat))*dummy
-            dlnpsat = (RLVTT_generic/cpp) * dummy 
-        endif
-
-    end subroutine Lcpdqsat_generic
-
-    !==================================================================
-    subroutine Tsat_generic(p,Tsat)
-
-        implicit none
-
-    !==================================================================
-    !     Purpose
-    !     -------
-    !     Compute the saturation temperature
-    !     for a given pressure (Pa)
-    !
-    !     Authors
-    !     -------
-    !     Noé Clément (2022)
-    !
-    !==================================================================
-
-        ! input
-        real p
-    
-        ! output
-        real Tsat
-
-
-        Tsat = 1/(1/Tref - (r*mugaz/1000.)/delta_gasH*Log(p/Pref))
-
-    end subroutine Tsat_generic
-    !==================================================================
-
-end module generic_cloud_common_h
Index: trunk/LMDZ.PLUTO/libf/phypluto/generic_tracer_index_mod.F90
===================================================================
--- trunk/LMDZ.PLUTO/libf/phypluto/generic_tracer_index_mod.F90	(revision 3572)
+++ 	(revision )
@@ -1,78 +1,0 @@
-module generic_tracer_index_mod
-
-!======================================================================C
-!
-!     This module is to get back the index of a generic condensable tracer
-!     for both the vap & ice parts of the tracer
-!
-!     call_ice_gas_generic is a boolean which tells if the tracer is condensable
-!     and allows, if it is condensable, to call the vap/ice pair
-!
-!     Noé Clément & Lucas Teinturier (2022)
-!
-!======================================================================C
-
-    implicit none
-
-    contains
-
-    subroutine generic_tracer_index(nq,iq,igcm_generic_gas,igcm_generic_ice,call_ice_gas_generic)
-
-        USE tracer_h, only: noms, is_condensable
-        integer nq,iq, igcm_generic_gas, igcm_generic_ice, i_shortname, ii
-        logical call_ice_gas_generic
-        character(len=10) :: shortname
-        if((is_condensable(iq)==1) .and. (index(noms(iq),"gas") .ne. 0) &
-                                                    .and. (index(noms(iq),"h2o") .eq. 0) .and. (index(noms(iq),"n2") .eq. 0)) then
-            ! Let's get the index of our tracers (we look for igcm _generic_gas and igcm_generic_ice)
-
-            igcm_generic_gas = iq
-            igcm_generic_ice = -1
-
-            ! ! ! We look for the corresponding ice traceur (before or after in the list of traceurs, maybe could be generalised to the whole list)
-            ! ! if (iq .ne. nq) then
-            ! !     if ((noms(iq)(1:len(trim(noms(iq)))-4) .eq. noms(iq+1)(1:len(trim(noms(iq+1)))-4)) .and. (index(noms(iq+1),"ice") .ne. 0)) then
-            ! !         igcm_generic_ice = iq+1
-            ! !     end if
-            ! ! end if
-            ! ! if ((iq .gt. 1)) then
-            ! !     if ((noms(iq)(1:len(trim(noms(iq)))-4) .eq. noms(iq-1)(1:len(trim(noms(iq-1)))-4)) .and. (index(noms(iq-1),"ice") .ne. 0)) then
-            ! !             igcm_generic_ice = iq-1
-            ! !     end if
-            ! ! end if
-            ! ! if (igcm_generic_ice .eq. -1) then
-            ! !     write(*,*) "ERROR : You set a vap traceur but you forgot to set the corresponding ice traceur, &
-            ! !     or the pair vap/ice is not written one after another in traceur.def"
-            ! ! endif
-
-            ! ! call_ice_gas_generic = .true.
-            i_shortname = index(noms(iq),'_')-1
-            shortname=noms(iq)(1:i_shortname)
-            ! We look for the corresponding ice traceur, first if it's before the vap traceur in pq
-            if (iq>1 ) then
-                do ii=1,iq-1
-                    if (index(noms(ii),adjustl(trim(shortname))) .ne. 0) then
-                        igcm_generic_ice=ii
-                        exit
-                    endif
-                ENDDO
-            endif
-            ! if we didn't find it before, we look after the vap tracer in pq
-            if (igcm_generic_ice .eq. -1 .and. (iq<nq)) then
-                do ii=iq+1,nq
-                    if (index(noms(ii),adjustl(trim(shortname))) .ne. 0) then
-                        igcm_generic_ice=ii
-                        exit
-                    endif
-                enddo
-            endif
-            call_ice_gas_generic = .true.
-        else
-
-            call_ice_gas_generic = .false.
-
-        end if ! if((is_condensable(iq)==1) .and. (index(noms(iq),"vap") .ne. 0))
-
-    end subroutine generic_tracer_index
-
-end module generic_tracer_index_mod
