module condensation_generic_mod implicit none contains subroutine condensation_generic(ngrid,nlayer,nq,ptimestep, pplev, pplay, & pt, pq, pdt, pdq, pdtlsc, pdqvaplsc, pdqliqlsc) use ioipsl_getin_p_mod, only: getin_p !-> to get the metallicity use generic_cloud_common_h, only : RLVTT, cpp, & Psat_generic,Lcpdqsat_generic,specie_parameters,specie_parameters_table USE tracer_h IMPLICIT none !======================================================================= ! ! Purpose ! ------- ! Calculates large-scale condensation of generic tracer "tname". ! By convention, tname ends with the suffix "_vap", as it represents the ! gas phase of the generic tracer ! ! Authors ! ------- ! Adapted from largescale.F90 by Lucas Teinturier (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_vap ! name of the tracer we consider. BY convention, it ends with _vap !!! 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 ! Options : real, save :: metallicity !metallicity of planet !$OMP THREADPRIVATE(metallicity) ! Local variables INTEGER i, k , nn, iq INTEGER,PARAMETER :: nitermax=5000 DOUBLE PRECISION,PARAMETER :: alpha=.1,qthreshold=1.d-8 ! JL13: if "careful, T