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 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 "_vap", 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_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 REAL, SAVE :: qvap_deep ! deep mixing ratio of water vapor when simulating bottom less planets !$OMP THREADPRIVATE(metallicity, qvap_deep) ! Local variables ! to call only one time the ice/vap pair of a tracer logical one_call_ice_vap_generic INTEGER i, k , nn, iq INTEGER,PARAMETER :: nitermax=5000 INTEGER,PARAMETER :: tau=14400. DOUBLE PRECISION,PARAMETER :: alpha=.1,qthreshold=1.d-8 ! JL13: if "careful, T