[787] | 1 | |
---|
| 2 | module tracer_h |
---|
| 3 | |
---|
| 4 | implicit none |
---|
| 5 | |
---|
[1980] | 6 | integer, save :: nqtot ! total number of tracers |
---|
[2542] | 7 | integer, save :: nesp ! number of species in the chemistry |
---|
[2690] | 8 | integer, save :: ngt ! number of generic tracers |
---|
[2806] | 9 | integer, save :: n_rgcs ! number of Radiative Generic Condensable Species |
---|
| 10 | !$OMP THREADPRIVATE(nqtot,nesp,ngt,n_rgcs) |
---|
[1621] | 11 | |
---|
[2436] | 12 | logical :: moderntracdef=.false. ! Standard or modern traceur.def |
---|
| 13 | !$OMP THREADPRIVATE(moderntracdef) |
---|
| 14 | |
---|
[1980] | 15 | character*30, save, allocatable :: noms(:) ! name of the tracer |
---|
[2690] | 16 | real, save, allocatable :: mmol(:) ! mole mass of tracer (g/mol) |
---|
[2542] | 17 | real, save, allocatable :: aki(:) ! to compute coefficient of thermal concduction if photochem |
---|
| 18 | real, save, allocatable :: cpi(:) ! to compute cpnew in concentration.F if photochem |
---|
[1980] | 19 | real, save, allocatable :: radius(:) ! dust and ice particle radius (m) |
---|
| 20 | real, save, allocatable :: rho_q(:) ! tracer densities (kg.m-3) |
---|
| 21 | real, save, allocatable :: qext(:) ! Single Scat. Extinction coeff at 0.67 um |
---|
| 22 | real, save, allocatable :: alpha_lift(:) ! saltation vertical flux/horiz flux ratio (m-1) |
---|
| 23 | real, save, allocatable :: alpha_devil(:) ! lifting coeeficient by dust devil |
---|
| 24 | real, save, allocatable :: qextrhor(:) ! Intermediate for computing opt. depth from q |
---|
[787] | 25 | |
---|
[1980] | 26 | real,save :: varian ! Characteristic variance of log-normal distribution |
---|
| 27 | real,save :: r3n_q ! used to compute r0 from number and mass mixing ratio |
---|
| 28 | real,save :: rho_dust ! Mars dust density (kg.m-3) |
---|
| 29 | real,save :: rho_ice ! Water ice density (kg.m-3) |
---|
| 30 | real,save :: rho_co2 ! CO2 ice density (kg.m-3) |
---|
| 31 | real,save :: ref_r0 ! for computing reff=ref_r0*r0 (in log.n. distribution) |
---|
[2542] | 32 | !$OMP THREADPRIVATE(noms,mmol,aki,cpi,radius,rho_q,qext,alpha_lift,alpha_devil,qextrhor, & |
---|
[1315] | 33 | !$OMP varian,r3n_q,rho_dust,rho_ice,rho_co2,ref_r0) |
---|
[787] | 34 | |
---|
[2542] | 35 | integer, save, allocatable :: is_chim(:) ! 1 if tracer used in chemistry, else 0 |
---|
[2543] | 36 | integer, save, allocatable :: is_rad(:) ! 1 if "" "" in radiative transfer, else 0 |
---|
| 37 | !$OMP THREADPRIVATE(is_chim,is_rad) |
---|
[2542] | 38 | |
---|
[2543] | 39 | integer, save, allocatable :: is_recomb(:) ! 1 if tracer used in recombining scheme, else 0 (if 1, must have is_rad=1) |
---|
| 40 | integer, save, allocatable :: is_recomb_qset(:) ! 1 if tracer k-corr assume predefined vmr, else 0 (if 1, must have is_recomb=1) |
---|
| 41 | integer, save, allocatable :: is_recomb_qotf(:) ! 1 if tracer recombination is done on-the-fly, else 0 (if 1, must have is_recomb_qset=0) |
---|
| 42 | !$OMP THREADPRIVATE(is_recomb,is_recomb_qset,is_recomb_qotf) |
---|
[2706] | 43 | integer, save, allocatable :: is_condensable(:) ! 1 if tracer is generic, else 0 (added LT) |
---|
[2804] | 44 | integer,save,allocatable :: is_rgcs(:) ! 1 if tracer is a radiative generic condensable specie, else 0 (added LT 2022) |
---|
[2712] | 45 | ! Lists of constants for condensable tracers |
---|
[3101] | 46 | real, save, allocatable :: constants_mass(:) ! molecular mass of the specie (g/mol) |
---|
| 47 | real, save, allocatable :: constants_delta_vapH(:) ! Enthalpy of vaporization (J/mol) |
---|
| 48 | real, save, allocatable :: constants_Tref(:) ! Ref temperature for Clausis-Clapeyron (K) |
---|
| 49 | real, save, allocatable :: constants_Pref(:) ! Reference pressure for Clausius Clapeyron (Pa) |
---|
| 50 | real, save, allocatable :: constants_epsi_generic(:) ! fractionnal molecular mass (m/mugaz) |
---|
| 51 | real, save, allocatable :: constants_RLVTT_generic(:) ! Latent heat of vaporization (J/kg) |
---|
| 52 | real, save, allocatable :: constants_metallicity_coeff(:) ! Coefficient to take into account the metallicity |
---|
| 53 | real, save, allocatable :: constants_RCPV_generic(:) ! specific heat capacity of the tracer vapor at Tref |
---|
[2785] | 54 | !$OMP THREADPRIVATE(constants_mass,constants_delta_vapH,constants_Tref) |
---|
| 55 | !$OMP THREADPRIVATE(constants_Pref,constants_epsi_generic) |
---|
[3101] | 56 | !$OMP THREADPRIVATE(constants_RLVTT_generic,constants_metallicity_coeff,constants_RCPV_generic) |
---|
[2712] | 57 | |
---|
[2804] | 58 | !$OMP THREADPRIVATE(is_condensable,is_rgcs) !also added by LT |
---|
[787] | 59 | ! tracer indexes: these are initialized in initracer and should be 0 if the |
---|
| 60 | ! corresponding tracer does not exist |
---|
[1980] | 61 | ! dust |
---|
| 62 | integer,save,allocatable :: igcm_dustbin(:) ! for dustbin 'dust' tracers |
---|
| 63 | ! dust, special doubleq case |
---|
| 64 | integer,save :: igcm_dust_mass ! dust mass mixing ratio (for transported dust) |
---|
| 65 | integer,save :: igcm_dust_number ! dust number mixing ratio (transported dust) |
---|
| 66 | ! water |
---|
| 67 | integer,save :: igcm_h2o_vap ! water vapour |
---|
| 68 | integer,save :: igcm_h2o_ice ! water ice |
---|
| 69 | ! chemistry: |
---|
| 70 | integer,save :: igcm_co2 |
---|
| 71 | integer,save :: igcm_co |
---|
| 72 | integer,save :: igcm_o |
---|
| 73 | integer,save :: igcm_o1d |
---|
| 74 | integer,save :: igcm_o2 |
---|
| 75 | integer,save :: igcm_o3 |
---|
| 76 | integer,save :: igcm_h |
---|
| 77 | integer,save :: igcm_h2 |
---|
| 78 | integer,save :: igcm_oh |
---|
| 79 | integer,save :: igcm_ho2 |
---|
| 80 | integer,save :: igcm_h2o2 |
---|
| 81 | integer,save :: igcm_n2 |
---|
| 82 | integer,save :: igcm_ar |
---|
| 83 | integer,save :: igcm_n |
---|
| 84 | integer,save :: igcm_no |
---|
| 85 | integer,save :: igcm_no2 |
---|
| 86 | integer,save :: igcm_n2d |
---|
| 87 | integer,save :: igcm_ch4 |
---|
[1799] | 88 | |
---|
[1980] | 89 | integer,save :: igcm_ch3 |
---|
| 90 | integer,save :: igcm_ch |
---|
| 91 | integer,save :: igcm_3ch2 |
---|
| 92 | integer,save :: igcm_1ch2 |
---|
| 93 | integer,save :: igcm_cho |
---|
| 94 | integer,save :: igcm_ch2o |
---|
| 95 | integer,save :: igcm_ch3o |
---|
| 96 | integer,save :: igcm_c |
---|
| 97 | integer,save :: igcm_c2 |
---|
| 98 | integer,save :: igcm_c2h |
---|
| 99 | integer,save :: igcm_c2h2 |
---|
| 100 | integer,save :: igcm_c2h3 |
---|
| 101 | integer,save :: igcm_c2h4 |
---|
| 102 | integer,save :: igcm_c2h6 |
---|
| 103 | integer,save :: igcm_ch2co |
---|
| 104 | integer,save :: igcm_ch3co |
---|
| 105 | integer,save :: igcm_hcaer |
---|
[1799] | 106 | |
---|
[1980] | 107 | ! other tracers |
---|
| 108 | integer,save :: igcm_ar_n2 ! for simulations using co2 +neutral gaz |
---|
| 109 | integer,save :: igcm_co2_ice ! CO2 ice |
---|
[2690] | 110 | !$OMP THREADPRIVATE(igcm_dustbin,igcm_dust_mass,igcm_dust_number,igcm_h2o_vap,igcm_h2o_ice, & |
---|
| 111 | !$OMP igcm_co2,igcm_co,igcm_o,igcm_o1d,igcm_o2,igcm_o3,igcm_h,igcm_h2,igcm_oh, & |
---|
| 112 | !$OMP igcm_ho2,igcm_h2o2,igcm_n2,igcm_ar,igcm_ar_n2,igcm_co2_ice, & |
---|
| 113 | !$OMP igcm_n,igcm_no,igcm_no2,igcm_n2d,igcm_ch4,igcm_ch3,igcm_ch,igcm_3ch2, & |
---|
| 114 | !$OMP igcm_1ch2,igcm_cho,igcm_ch2o,igcm_ch3o,igcm_c,igcm_c2,igcm_c2h,igcm_c2h2, & |
---|
[2712] | 115 | !$OMP igcm_c2h3,igcm_c2h4,igcm_c2h6,igcm_ch2co,igcm_ch3co,igcm_hcaer) |
---|
[787] | 116 | |
---|
[3299] | 117 | contains |
---|
| 118 | |
---|
| 119 | ! some basic auxiliary functions for tracers |
---|
| 120 | |
---|
| 121 | logical function is_known_tracer(tracer_name) |
---|
| 122 | ! checks if tracer_name is a know tracer |
---|
| 123 | ! returns .true. if yes and .false. otherwise |
---|
| 124 | implicit none |
---|
| 125 | character(len=*),intent(in) :: tracer_name |
---|
| 126 | integer :: iq |
---|
| 127 | ! initialization |
---|
| 128 | is_known_tracer=.false. |
---|
| 129 | do iq=1,nqtot |
---|
| 130 | if( trim(tracer_name) == trim(noms(iq)) ) then |
---|
| 131 | is_known_tracer=.true. |
---|
| 132 | exit |
---|
| 133 | endif |
---|
| 134 | enddo |
---|
| 135 | end function is_known_tracer |
---|
| 136 | |
---|
| 137 | integer function tracer_index(tracer_name) |
---|
| 138 | ! gets the index of the tracer tracer_name |
---|
| 139 | ! returns index or 0 if unknown tracer |
---|
| 140 | implicit none |
---|
| 141 | character(len=*),intent(in) :: tracer_name |
---|
| 142 | integer :: iq |
---|
| 143 | ! initialization |
---|
| 144 | tracer_index=0 |
---|
| 145 | do iq=1,nqtot |
---|
| 146 | if( trim(tracer_name) == trim(noms(iq)) ) then |
---|
| 147 | tracer_index=iq |
---|
| 148 | exit |
---|
| 149 | endif |
---|
| 150 | enddo |
---|
| 151 | end function tracer_index |
---|
| 152 | |
---|
[787] | 153 | end module tracer_h |
---|
| 154 | |
---|