LCOV - code coverage report
Current view: top level - chemistry/mozart - mo_usrrxt.F90 (source / functions) Hit Total Coverage
Test: coverage.info Lines: 0 895 0.0 %
Date: 2024-12-17 17:57:11 Functions: 0 4 0.0 %

          Line data    Source code
       1             : module mo_usrrxt
       2             : 
       3             :   use shr_kind_mod,     only : r8 => shr_kind_r8
       4             :   use cam_logfile,      only : iulog
       5             :   use ppgrid,           only : pver, pcols
       6             : 
       7             :   implicit none
       8             : 
       9             :   private
      10             :   public :: usrrxt, usrrxt_inti, usrrxt_hrates
      11             : 
      12             :   save
      13             : 
      14             :   integer :: usr_O_O2_ndx
      15             :   integer :: usr_HO2_HO2_ndx
      16             :   integer :: usr_N2O5_M_ndx
      17             :   integer :: usr_HNO3_OH_ndx
      18             :   integer :: usr_HO2NO2_M_ndx
      19             :   integer :: usr_N2O5_aer_ndx
      20             :   integer :: usr_NO3_aer_ndx
      21             :   integer :: usr_NO2_aer_ndx
      22             :   integer :: usr_CO_OH_ndx
      23             :   integer :: usr_CO_OH_a_ndx
      24             :   integer :: usr_CO_OH_b_ndx
      25             :   integer :: usr_PAN_M_ndx
      26             :   integer :: usr_CH3COCH3_OH_ndx
      27             :   integer :: usr_MCO3_NO2_ndx
      28             :   integer :: usr_MPAN_M_ndx
      29             :   integer :: usr_XOOH_OH_ndx
      30             :   integer :: usr_SO2_OH_ndx
      31             :   integer :: usr_DMS_OH_ndx
      32             :   integer :: usr_HO2_aer_ndx
      33             :   integer :: usr_GLYOXAL_aer_ndx
      34             : 
      35             :   integer :: tag_NO2_NO3_ndx
      36             :   integer :: tag_NO2_OH_ndx
      37             :   integer :: tag_NO2_HO2_ndx
      38             :   integer :: tag_C2H4_OH_ndx
      39             :   integer :: tag_C3H6_OH_ndx
      40             :   integer :: tag_CH3CO3_NO2_ndx
      41             : 
      42             : !lke-TS1
      43             :   integer :: usr_PBZNIT_M_ndx
      44             :   integer :: tag_ACBZO2_NO2_ndx
      45             :   integer :: usr_ISOPNITA_aer_ndx
      46             :   integer :: usr_ISOPNITB_aer_ndx
      47             :   integer :: usr_ONITR_aer_ndx
      48             :   integer :: usr_HONITR_aer_ndx
      49             :   integer :: usr_TERPNIT_aer_ndx
      50             :   integer :: usr_NTERPOOH_aer_ndx
      51             :   integer :: usr_NC4CHO_aer_ndx
      52             :   integer :: usr_NC4CH2OH_aer_ndx
      53             : !TS2
      54             :  integer :: usr_ISOPZD1O2_ndx
      55             :  integer :: usr_ISOPZD4O2_ndx
      56             :  integer :: usr_ISOPFDN_aer_ndx
      57             :  integer :: usr_ISOPFNP_aer_ndx
      58             :  integer :: usr_ISOPN2B_aer_ndx
      59             :  integer :: usr_ISOPN1D_aer_ndx
      60             :  integer :: usr_ISOPN4D_aer_ndx
      61             :  integer :: usr_INOOHD_aer_ndx
      62             :  integer :: usr_INHEB_aer_ndx
      63             :  integer :: usr_INHED_aer_ndx
      64             :  integer :: usr_MACRN_aer_ndx
      65             :  integer :: usr_ISOPHFP_aer_ndx
      66             :  integer :: usr_IEPOX_aer_ndx
      67             :  integer :: usr_DHPMPAL_aer_ndx
      68             :  integer :: usr_ICHE_aer_ndx
      69             :  integer :: usr_ISOPFNC_aer_ndx
      70             :  integer :: usr_ISOPFDNC_aer_ndx
      71             :  integer :: usr_ISOPB1O2_NOn_ndx
      72             :  integer :: usr_ISOPB1O2_NOa_ndx
      73             :  integer :: usr_ISOPB4O2_NOn_ndx
      74             :  integer :: usr_ISOPB4O2_NOa_ndx
      75             :  integer :: usr_ISOPED1O2_NOn_ndx
      76             :  integer :: usr_ISOPED1O2_NOa_ndx
      77             :  integer :: usr_ISOPED4O2_NOn_ndx
      78             :  integer :: usr_ISOPED4O2_NOa_ndx
      79             :  integer :: usr_ISOPZD1O2_NOn_ndx
      80             :  integer :: usr_ISOPZD1O2_NOa_ndx
      81             :  integer :: usr_ISOPZD4O2_NOn_ndx
      82             :  integer :: usr_ISOPZD4O2_NOa_ndx
      83             :  integer :: usr_ISOPNO3_NOn_ndx
      84             :  integer :: usr_ISOPNO3_NOa_ndx
      85             :  integer :: usr_MVKO2_NOn_ndx
      86             :  integer :: usr_MVKO2_NOa_ndx
      87             :  integer :: usr_MACRO2_NOn_ndx
      88             :  integer :: usr_MACRO2_NOa_ndx
      89             :  integer :: usr_IEPOXOO_NOn_ndx
      90             :  integer :: usr_IEPOXOO_NOa_ndx
      91             :  integer :: usr_ISOPN1DO2_NOn_ndx
      92             :  integer :: usr_ISOPN1DO2_NOa_ndx
      93             :  integer :: usr_ISOPN2BO2_NOn_ndx
      94             :  integer :: usr_ISOPN2BO2_NOa_ndx
      95             :  integer :: usr_ISOPN3BO2_NOn_ndx
      96             :  integer :: usr_ISOPN3BO2_NOa_ndx
      97             :  integer :: usr_ISOPN4DO2_NOn_ndx
      98             :  integer :: usr_ISOPN4DO2_NOa_ndx
      99             :  integer :: usr_ISOPNBNO3O2_NOn_ndx
     100             :  integer :: usr_ISOPNBNO3O2_NOa_ndx
     101             :  integer :: usr_ISOPNOOHBO2_NOn_ndx
     102             :  integer :: usr_ISOPNOOHBO2_NOa_ndx
     103             :  integer :: usr_ISOPNOOHDO2_NOn_ndx
     104             :  integer :: usr_ISOPNOOHDO2_NOa_ndx
     105             :  integer :: usr_NC4CHOO2_NOn_ndx
     106             :  integer :: usr_NC4CHOO2_NOa_ndx
     107             :  integer :: tag_MCO3_NO2_ndx
     108             :  integer :: tag_TERPACO3_NO2_ndx
     109             :  integer :: usr_TERPAPAN_M_ndx
     110             :  integer :: tag_TERPA2CO3_NO2_ndx
     111             :  integer :: usr_TERPA2PAN_M_ndx
     112             :  integer :: tag_TERPA3CO3_NO2_ndx
     113             :  integer :: usr_TERPA3PAN_M_ndx
     114             :  integer :: usr_TERPNT_aer_ndx
     115             :  integer :: usr_TERPNT1_aer_ndx
     116             :  integer :: usr_TERPNPT_aer_ndx
     117             :  integer :: usr_TERPNPT1_aer_ndx
     118             :  integer :: usr_TERPFDN_aer_ndx
     119             :  integer :: usr_SQTN_aer_ndx
     120             :  integer :: usr_TERPHFN_aer_ndx
     121             :  integer :: usr_TERPDHDP_aer_ndx
     122             :  integer :: usr_TERPACID_aer_ndx
     123             : !
     124             :   integer :: usr_OA_O2_NDX
     125             :   integer :: usr_XNO2NO3_M_ndx
     126             :   integer :: usr_NO2XNO3_M_ndx
     127             :   integer :: usr_XHNO3_OH_ndx
     128             :   integer :: usr_XHO2NO2_M_ndx
     129             :   integer :: usr_XNO2NO3_aer_ndx
     130             :   integer :: usr_NO2XNO3_aer_ndx
     131             :   integer :: usr_XNO3_aer_ndx
     132             :   integer :: usr_XNO2_aer_ndx
     133             :   integer :: usr_XPAN_M_ndx
     134             :   integer :: usr_XMPAN_M_ndx
     135             :   integer :: usr_MCO3_XNO2_ndx
     136             : 
     137             :   integer :: usr_C2O3_NO2_ndx
     138             :   integer :: usr_C2H4_OH_ndx
     139             :   integer :: usr_XO2N_HO2_ndx
     140             :   integer :: usr_C2O3_XNO2_ndx
     141             : 
     142             :   integer :: tag_XO2N_NO_ndx
     143             :   integer :: tag_XO2_HO2_ndx
     144             :   integer :: tag_XO2_NO_ndx
     145             : 
     146             :   integer :: usr_O_O_ndx
     147             :   integer :: usr_CL2O2_M_ndx
     148             :   integer :: usr_SO3_H2O_ndx
     149             :   integer :: tag_CLO_CLO_M_ndx
     150             : 
     151             :   integer :: ion1_ndx, ion2_ndx, ion3_ndx, ion11_ndx
     152             :   integer :: elec1_ndx, elec2_ndx, elec3_ndx
     153             :   integer :: elec4_ndx, elec5_ndx, elec6_ndx
     154             :   integer :: het1_ndx
     155             : 
     156             :   integer, parameter :: nean = 3
     157             :   integer :: ean_ndx(nean)
     158             :   integer, parameter :: nrpe = 5
     159             :   integer :: rpe_ndx(nrpe)
     160             :   integer, parameter :: npir = 16
     161             :   integer :: pir_ndx(npir)
     162             :   integer, parameter :: nedn = 2
     163             :   integer :: edn_ndx(nedn)
     164             :   integer, parameter :: nnir = 13
     165             :   integer :: nir_ndx(nnir)
     166             :   integer, parameter :: niira = 112
     167             :   integer :: iira_ndx(niira)
     168             :   integer, parameter :: niirb = 14
     169             :   integer :: iirb_ndx(niirb)
     170             : 
     171             :   integer :: usr_clm_h2o_m_ndx, usr_clm_hcl_m_ndx
     172             :   integer :: usr_oh_co_ndx, het_no2_h2o_ndx, usr_oh_dms_ndx, aq_so2_h2o2_ndx, aq_so2_o3_ndx
     173             : 
     174             :   integer :: h2o_ndx
     175             : !
     176             : ! jfl
     177             : !
     178             :   integer, parameter :: num_strat_tau = 22
     179             :   integer :: usr_strat_tau_ndx(num_strat_tau)
     180             : !
     181             : !lke++
     182             :   integer :: usr_COhc_OH_ndx
     183             :   integer :: usr_COme_OH_ndx
     184             :   integer :: usr_CO01_OH_ndx
     185             :   integer :: usr_CO02_OH_ndx
     186             :   integer :: usr_CO03_OH_ndx
     187             :   integer :: usr_CO04_OH_ndx
     188             :   integer :: usr_CO05_OH_ndx
     189             :   integer :: usr_CO06_OH_ndx
     190             :   integer :: usr_CO07_OH_ndx
     191             :   integer :: usr_CO08_OH_ndx
     192             :   integer :: usr_CO09_OH_ndx
     193             :   integer :: usr_CO10_OH_ndx
     194             :   integer :: usr_CO11_OH_ndx
     195             :   integer :: usr_CO12_OH_ndx
     196             :   integer :: usr_CO13_OH_ndx
     197             :   integer :: usr_CO14_OH_ndx
     198             :   integer :: usr_CO15_OH_ndx
     199             :   integer :: usr_CO16_OH_ndx
     200             :   integer :: usr_CO17_OH_ndx
     201             :   integer :: usr_CO18_OH_ndx
     202             :   integer :: usr_CO19_OH_ndx
     203             :   integer :: usr_CO20_OH_ndx
     204             :   integer :: usr_CO21_OH_ndx
     205             :   integer :: usr_CO22_OH_ndx
     206             :   integer :: usr_CO23_OH_ndx
     207             :   integer :: usr_CO24_OH_ndx
     208             :   integer :: usr_CO25_OH_ndx
     209             :   integer :: usr_CO26_OH_ndx
     210             :   integer :: usr_CO27_OH_ndx
     211             :   integer :: usr_CO28_OH_ndx
     212             :   integer :: usr_CO29_OH_ndx
     213             :   integer :: usr_CO30_OH_ndx
     214             :   integer :: usr_CO31_OH_ndx
     215             :   integer :: usr_CO32_OH_ndx
     216             :   integer :: usr_CO33_OH_ndx
     217             :   integer :: usr_CO34_OH_ndx
     218             :   integer :: usr_CO35_OH_ndx
     219             :   integer :: usr_CO36_OH_ndx
     220             :   integer :: usr_CO37_OH_ndx
     221             :   integer :: usr_CO38_OH_ndx
     222             :   integer :: usr_CO39_OH_ndx
     223             :   integer :: usr_CO40_OH_ndx
     224             :   integer :: usr_CO41_OH_ndx
     225             :   integer :: usr_CO42_OH_ndx
     226             : !lke--
     227             : 
     228             :   real(r8), parameter :: t0     = 300._r8                ! K
     229             :   real(r8), parameter :: trlim2 = 17._r8/3._r8           ! K
     230             :   real(r8), parameter :: trlim3 = 15._r8/3._r8           ! K
     231             : 
     232             :   logical :: has_ion_rxts, has_d_chem
     233             : 
     234             : contains
     235             : 
     236           0 :   subroutine usrrxt_inti
     237             :     !-----------------------------------------------------------------
     238             :     !        ... intialize the user reaction constants module
     239             :     !-----------------------------------------------------------------
     240             : 
     241             :     use mo_chem_utls,   only : get_rxt_ndx, get_spc_ndx
     242             :     use spmd_utils,     only : masterproc
     243             : 
     244             :     implicit none
     245             : 
     246             :     character(len=4) :: xchar
     247             :     character(len=32) :: rxtname
     248             :     integer :: i
     249             : 
     250             : !
     251             : ! full tropospheric chemistry
     252             : !
     253           0 :     usr_O_O2_ndx         = get_rxt_ndx( 'usr_O_O2' )
     254           0 :     usr_HO2_HO2_ndx      = get_rxt_ndx( 'usr_HO2_HO2' )
     255           0 :     usr_N2O5_M_ndx       = get_rxt_ndx( 'usr_N2O5_M' )
     256           0 :     usr_HNO3_OH_ndx      = get_rxt_ndx( 'usr_HNO3_OH' )
     257           0 :     usr_HO2NO2_M_ndx     = get_rxt_ndx( 'usr_HO2NO2_M' )
     258           0 :     usr_N2O5_aer_ndx     = get_rxt_ndx( 'usr_N2O5_aer' )
     259           0 :     usr_NO3_aer_ndx      = get_rxt_ndx( 'usr_NO3_aer' )
     260           0 :     usr_NO2_aer_ndx      = get_rxt_ndx( 'usr_NO2_aer' )
     261           0 :     usr_CO_OH_ndx        = get_rxt_ndx( 'usr_CO_OH' )
     262           0 :     usr_CO_OH_a_ndx      = get_rxt_ndx( 'usr_CO_OH_a' )
     263           0 :     usr_CO_OH_b_ndx      = get_rxt_ndx( 'usr_CO_OH_b' )
     264           0 :     usr_PAN_M_ndx        = get_rxt_ndx( 'usr_PAN_M' )
     265           0 :     usr_CH3COCH3_OH_ndx  = get_rxt_ndx( 'usr_CH3COCH3_OH' )
     266           0 :     usr_MCO3_NO2_ndx     = get_rxt_ndx( 'usr_MCO3_NO2' )
     267           0 :     tag_MCO3_NO2_ndx     = get_rxt_ndx( 'tag_MCO3_NO2' )
     268           0 :     if( tag_MCO3_NO2_ndx<0 .and. usr_MCO3_NO2_ndx>0 ) then
     269           0 :        tag_MCO3_NO2_ndx = usr_MCO3_NO2_ndx
     270             :     endif
     271             : 
     272           0 :     usr_MPAN_M_ndx       = get_rxt_ndx( 'usr_MPAN_M' )
     273           0 :     usr_XOOH_OH_ndx      = get_rxt_ndx( 'usr_XOOH_OH' )
     274           0 :     usr_SO2_OH_ndx       = get_rxt_ndx( 'usr_SO2_OH' )
     275           0 :     usr_DMS_OH_ndx       = get_rxt_ndx( 'usr_DMS_OH' )
     276           0 :     usr_HO2_aer_ndx      = get_rxt_ndx( 'usr_HO2_aer' )
     277           0 :     usr_GLYOXAL_aer_ndx  = get_rxt_ndx( 'usr_GLYOXAL_aer' )
     278             :  !
     279           0 :     tag_NO2_NO3_ndx      = get_rxt_ndx( 'tag_NO2_NO3' )
     280           0 :     tag_NO2_OH_ndx       = get_rxt_ndx( 'tag_NO2_OH' )
     281           0 :     tag_NO2_HO2_ndx      = get_rxt_ndx( 'tag_NO2_HO2' )
     282           0 :     tag_C2H4_OH_ndx      = get_rxt_ndx( 'tag_C2H4_OH' )
     283           0 :     tag_C3H6_OH_ndx      = get_rxt_ndx( 'tag_C3H6_OH' )
     284           0 :     tag_CH3CO3_NO2_ndx   = get_rxt_ndx( 'tag_CH3CO3_NO2' )
     285             : !lke-TS1
     286           0 :     usr_PBZNIT_M_ndx     = get_rxt_ndx( 'usr_PBZNIT_M' )
     287           0 :     tag_ACBZO2_NO2_ndx   = get_rxt_ndx( 'tag_ACBZO2_NO2' )
     288           0 :     usr_ISOPNITA_aer_ndx = get_rxt_ndx( 'usr_ISOPNITA_aer' )
     289           0 :     usr_ISOPNITB_aer_ndx = get_rxt_ndx( 'usr_ISOPNITB_aer' )
     290           0 :     usr_ONITR_aer_ndx    = get_rxt_ndx( 'usr_ONITR_aer' )
     291           0 :     usr_HONITR_aer_ndx   = get_rxt_ndx( 'usr_HONITR_aer' )
     292           0 :     usr_TERPNIT_aer_ndx  = get_rxt_ndx( 'usr_TERPNIT_aer' )
     293           0 :     usr_NTERPOOH_aer_ndx = get_rxt_ndx( 'usr_NTERPOOH_aer' )
     294           0 :     usr_NC4CHO_aer_ndx   = get_rxt_ndx( 'usr_NC4CHO_aer' )
     295           0 :     usr_NC4CH2OH_aer_ndx = get_rxt_ndx( 'usr_NC4CH2OH_aer' )
     296             : !TS2
     297           0 :     usr_ISOPZD1O2_ndx        = get_rxt_ndx( 'usr_ISOPZD1O2' )
     298           0 :     usr_ISOPZD4O2_ndx        = get_rxt_ndx( 'usr_ISOPZD4O2' )
     299           0 :     usr_ISOPFDN_aer_ndx      = get_rxt_ndx( 'usr_ISOPFDN_aer' )
     300           0 :     usr_ISOPFNP_aer_ndx      = get_rxt_ndx( 'usr_ISOPFNP_aer' )
     301           0 :     usr_ISOPN2B_aer_ndx      = get_rxt_ndx( 'usr_ISOPN2B_aer' )
     302           0 :     usr_ISOPN1D_aer_ndx      = get_rxt_ndx( 'usr_ISOPN1D_aer' )
     303           0 :     usr_ISOPN4D_aer_ndx      = get_rxt_ndx( 'usr_ISOPN4D_aer' )
     304           0 :     usr_INOOHD_aer_ndx       = get_rxt_ndx( 'usr_INOOHD_aer' )
     305           0 :     usr_INHEB_aer_ndx        = get_rxt_ndx( 'usr_INHEB_aer' )
     306           0 :     usr_INHED_aer_ndx        = get_rxt_ndx( 'usr_INHED_aer' )
     307           0 :     usr_MACRN_aer_ndx        = get_rxt_ndx( 'usr_MACRN_aer' )
     308           0 :     usr_ISOPHFP_aer_ndx      = get_rxt_ndx( 'usr_ISOPHFP_aer' )
     309           0 :     usr_IEPOX_aer_ndx        = get_rxt_ndx( 'usr_IEPOX_aer' )
     310           0 :     usr_DHPMPAL_aer_ndx      = get_rxt_ndx( 'usr_DHPMPAL_aer' )
     311           0 :     usr_ICHE_aer_ndx         = get_rxt_ndx( 'usr_ICHE_aer' )
     312           0 :     usr_ISOPFNC_aer_ndx      = get_rxt_ndx( 'usr_ISOPFNC_aer' )
     313           0 :     usr_ISOPFDNC_aer_ndx     = get_rxt_ndx( 'usr_ISOPFDNC_aer' )
     314           0 :     usr_ISOPB1O2_NOn_ndx     = get_rxt_ndx( 'usr_ISOPB1O2_NOn' )
     315           0 :     usr_ISOPB1O2_NOa_ndx     = get_rxt_ndx( 'usr_ISOPB1O2_NOa' )
     316           0 :     usr_ISOPB4O2_NOn_ndx     = get_rxt_ndx( 'usr_ISOPB4O2_NOn' )
     317           0 :     usr_ISOPB4O2_NOa_ndx     = get_rxt_ndx( 'usr_ISOPB4O2_NOa' )
     318           0 :     usr_ISOPED1O2_NOn_ndx    = get_rxt_ndx( 'usr_ISOPED1O2_NOn' )
     319           0 :     usr_ISOPED1O2_NOa_ndx    = get_rxt_ndx( 'usr_ISOPED1O2_NOa' )
     320           0 :     usr_ISOPED4O2_NOn_ndx    = get_rxt_ndx( 'usr_ISOPED4O2_NOn' )
     321           0 :     usr_ISOPED4O2_NOa_ndx    = get_rxt_ndx( 'usr_ISOPED4O2_NOa' )
     322           0 :     usr_ISOPZD1O2_NOn_ndx    = get_rxt_ndx( 'usr_ISOPZD1O2_NOn' )
     323           0 :     usr_ISOPZD1O2_NOa_ndx    = get_rxt_ndx( 'usr_ISOPZD1O2_NOa' )
     324           0 :     usr_ISOPZD4O2_NOn_ndx    = get_rxt_ndx( 'usr_ISOPZD4O2_NOn' )
     325           0 :     usr_ISOPZD4O2_NOa_ndx    = get_rxt_ndx( 'usr_ISOPZD4O2_NOa' )
     326           0 :     usr_ISOPNO3_NOn_ndx      = get_rxt_ndx( 'usr_ISOPNO3_NOn' )
     327           0 :     usr_ISOPNO3_NOa_ndx      = get_rxt_ndx( 'usr_ISOPNO3_NOa' )
     328           0 :     usr_MVKO2_NOn_ndx        = get_rxt_ndx( 'usr_MVKO2_NOn' )
     329           0 :     usr_MVKO2_NOa_ndx        = get_rxt_ndx( 'usr_MVKO2_NOa' )
     330           0 :     usr_MACRO2_NOn_ndx       = get_rxt_ndx( 'usr_MACRO2_NOn' )
     331           0 :     usr_MACRO2_NOa_ndx       = get_rxt_ndx( 'usr_MACRO2_NOa' )
     332           0 :     usr_IEPOXOO_NOn_ndx     = get_rxt_ndx( 'usr_IEPOXOO_NOn' )
     333           0 :     usr_IEPOXOO_NOa_ndx     = get_rxt_ndx( 'usr_IEPOXOO_NOa' )
     334           0 :     usr_ISOPN1DO2_NOn_ndx     = get_rxt_ndx( 'usr_ISOPN1DO2_NOn' )
     335           0 :     usr_ISOPN1DO2_NOa_ndx     = get_rxt_ndx( 'usr_ISOPN1DO2_NOa' )
     336           0 :     usr_ISOPN2BO2_NOn_ndx     = get_rxt_ndx( 'usr_ISOPN2BO2_NOn' )
     337           0 :     usr_ISOPN2BO2_NOa_ndx     = get_rxt_ndx( 'usr_ISOPN2BO2_NOa' )
     338           0 :     usr_ISOPN3BO2_NOn_ndx     = get_rxt_ndx( 'usr_ISOPN3BO2_NOn' )
     339           0 :     usr_ISOPN3BO2_NOa_ndx     = get_rxt_ndx( 'usr_ISOPN3BO2_NOa' )
     340           0 :     usr_ISOPN4DO2_NOn_ndx     = get_rxt_ndx( 'usr_ISOPN4DO2_NOn' )
     341           0 :     usr_ISOPN4DO2_NOa_ndx     = get_rxt_ndx( 'usr_ISOPN4DO2_NOa' )
     342           0 :     usr_ISOPNBNO3O2_NOn_ndx     = get_rxt_ndx( 'usr_ISOPNBNO3O2_NOn' )
     343           0 :     usr_ISOPNBNO3O2_NOa_ndx     = get_rxt_ndx( 'usr_ISOPNBNO3O2_NOa' )
     344           0 :     usr_ISOPNOOHBO2_NOn_ndx     = get_rxt_ndx( 'usr_ISOPNOOHBO2_NOn' )
     345           0 :     usr_ISOPNOOHBO2_NOa_ndx     = get_rxt_ndx( 'usr_ISOPNOOHBO2_NOa' )
     346           0 :     usr_ISOPNOOHDO2_NOn_ndx     = get_rxt_ndx( 'usr_ISOPNOOHDO2_NOn' )
     347           0 :     usr_ISOPNOOHDO2_NOa_ndx     = get_rxt_ndx( 'usr_ISOPNOOHDO2_NOa' )
     348           0 :     usr_NC4CHOO2_NOn_ndx     = get_rxt_ndx( 'usr_NC4CHOO2_NOn' )
     349           0 :     usr_NC4CHOO2_NOa_ndx     = get_rxt_ndx( 'usr_NC4CHOO2_NOa' )
     350           0 :     tag_TERPACO3_NO2_ndx  = get_rxt_ndx( 'tag_TERPACO3_NO2' )
     351           0 :     usr_TERPAPAN_M_ndx     = get_rxt_ndx( 'usr_TERPAPAN_M' )
     352           0 :     tag_TERPA2CO3_NO2_ndx  = get_rxt_ndx( 'tag_TERPA2CO3_NO2' )
     353           0 :     usr_TERPA2PAN_M_ndx     = get_rxt_ndx( 'usr_TERPA2PAN_M' )
     354           0 :     tag_TERPA3CO3_NO2_ndx  = get_rxt_ndx( 'tag_TERPA3CO3_NO2' )
     355           0 :     usr_TERPA3PAN_M_ndx     = get_rxt_ndx( 'usr_TERPA3PAN_M' )
     356           0 :     usr_TERPNT_aer_ndx       = get_rxt_ndx( 'usr_TERPNT_aer' )
     357           0 :     usr_TERPNT1_aer_ndx      = get_rxt_ndx( 'usr_TERPNT1_aer' )
     358           0 :     usr_TERPNPT_aer_ndx      = get_rxt_ndx( 'usr_TERPNPT_aer' )
     359           0 :     usr_TERPNPT1_aer_ndx     = get_rxt_ndx( 'usr_TERPNPT1_aer' )
     360           0 :     usr_TERPFDN_aer_ndx        = get_rxt_ndx( 'usr_TERPFDN_aer' )
     361           0 :     usr_SQTN_aer_ndx        = get_rxt_ndx( 'usr_SQTN_aer' )
     362           0 :     usr_TERPHFN_aer_ndx        = get_rxt_ndx( 'usr_TERPHFN_aer' )
     363           0 :     usr_TERPDHDP_aer_ndx        = get_rxt_ndx( 'usr_TERPDHDP_aer' )
     364           0 :     usr_TERPACID_aer_ndx        = get_rxt_ndx( 'usr_TERPACID_aer' )
     365             :  !
     366             :  ! additional reactions for O3A/XNO
     367             :  !
     368           0 :     usr_OA_O2_ndx        = get_rxt_ndx( 'usr_OA_O2' )
     369           0 :     usr_XNO2NO3_M_ndx    = get_rxt_ndx( 'usr_XNO2NO3_M' )
     370           0 :     usr_NO2XNO3_M_ndx    = get_rxt_ndx( 'usr_NO2XNO3_M' )
     371           0 :     usr_XNO2NO3_aer_ndx  = get_rxt_ndx( 'usr_XNO2NO3_aer' )
     372           0 :     usr_NO2XNO3_aer_ndx  = get_rxt_ndx( 'usr_NO2XNO3_aer' )
     373           0 :     usr_XHNO3_OH_ndx     = get_rxt_ndx( 'usr_XHNO3_OH' )
     374           0 :     usr_XNO3_aer_ndx     = get_rxt_ndx( 'usr_XNO3_aer' )
     375           0 :     usr_XNO2_aer_ndx     = get_rxt_ndx( 'usr_XNO2_aer' )
     376           0 :     usr_MCO3_XNO2_ndx    = get_rxt_ndx( 'usr_MCO3_XNO2' )
     377           0 :     usr_XPAN_M_ndx       = get_rxt_ndx( 'usr_XPAN_M' )
     378           0 :     usr_XMPAN_M_ndx      = get_rxt_ndx( 'usr_XMPAN_M' )
     379           0 :     usr_XHO2NO2_M_ndx    = get_rxt_ndx( 'usr_XHO2NO2_M' )
     380             : !
     381             : ! reduced hydrocarbon chemistry
     382             : !
     383           0 :     usr_C2O3_NO2_ndx     = get_rxt_ndx( 'usr_C2O3_NO2' )
     384           0 :     usr_C2H4_OH_ndx      = get_rxt_ndx( 'usr_C2H4_OH' )
     385           0 :     usr_XO2N_HO2_ndx     = get_rxt_ndx( 'usr_XO2N_HO2' )
     386           0 :     usr_C2O3_XNO2_ndx    = get_rxt_ndx( 'usr_C2O3_XNO2' )
     387             : !
     388           0 :     tag_XO2N_NO_ndx      = get_rxt_ndx( 'tag_XO2N_NO' )
     389           0 :     tag_XO2_HO2_ndx      = get_rxt_ndx( 'tag_XO2_HO2' )
     390           0 :     tag_XO2_NO_ndx       = get_rxt_ndx( 'tag_XO2_NO' )
     391             : !
     392             : ! stratospheric chemistry
     393             : !
     394           0 :     usr_O_O_ndx          = get_rxt_ndx( 'usr_O_O' )
     395           0 :     usr_CL2O2_M_ndx      = get_rxt_ndx( 'usr_CL2O2_M' )
     396           0 :     usr_SO3_H2O_ndx      = get_rxt_ndx( 'usr_SO3_H2O' )
     397             : !
     398           0 :     tag_CLO_CLO_M_ndx      = get_rxt_ndx( 'tag_CLO_CLO_M' )
     399           0 :     if (tag_CLO_CLO_M_ndx<0) then ! for backwards compatibility
     400           0 :        tag_CLO_CLO_M_ndx   = get_rxt_ndx( 'tag_CLO_CLO' )
     401             :     endif
     402             : !
     403             : ! reactions to remove BAM aerosols in the stratosphere
     404             : !
     405           0 :     usr_strat_tau_ndx( 1) = get_rxt_ndx( 'usr_CB1_strat_tau' )
     406           0 :     usr_strat_tau_ndx( 2) = get_rxt_ndx( 'usr_CB2_strat_tau' )
     407           0 :     usr_strat_tau_ndx( 3) = get_rxt_ndx( 'usr_OC1_strat_tau' )
     408           0 :     usr_strat_tau_ndx( 4) = get_rxt_ndx( 'usr_OC2_strat_tau' )
     409           0 :     usr_strat_tau_ndx( 5) = get_rxt_ndx( 'usr_SO4_strat_tau' )
     410           0 :     usr_strat_tau_ndx( 6) = get_rxt_ndx( 'usr_SOA_strat_tau' )
     411           0 :     usr_strat_tau_ndx( 7) = get_rxt_ndx( 'usr_NH4_strat_tau' )
     412           0 :     usr_strat_tau_ndx( 8) = get_rxt_ndx( 'usr_NH4NO3_strat_tau' )
     413           0 :     usr_strat_tau_ndx( 9) = get_rxt_ndx( 'usr_SSLT01_strat_tau' )
     414           0 :     usr_strat_tau_ndx(10) = get_rxt_ndx( 'usr_SSLT02_strat_tau' )
     415           0 :     usr_strat_tau_ndx(11) = get_rxt_ndx( 'usr_SSLT03_strat_tau' )
     416           0 :     usr_strat_tau_ndx(12) = get_rxt_ndx( 'usr_SSLT04_strat_tau' )
     417           0 :     usr_strat_tau_ndx(13) = get_rxt_ndx( 'usr_DST01_strat_tau' )
     418           0 :     usr_strat_tau_ndx(14) = get_rxt_ndx( 'usr_DST02_strat_tau' )
     419           0 :     usr_strat_tau_ndx(15) = get_rxt_ndx( 'usr_DST03_strat_tau' )
     420           0 :     usr_strat_tau_ndx(16) = get_rxt_ndx( 'usr_DST04_strat_tau' )
     421           0 :     usr_strat_tau_ndx(17) = get_rxt_ndx( 'usr_SO2t_strat_tau' )
     422           0 :     usr_strat_tau_ndx(18) = get_rxt_ndx( 'usr_SOAI_strat_tau' )
     423           0 :     usr_strat_tau_ndx(19) = get_rxt_ndx( 'usr_SOAM_strat_tau' )
     424           0 :     usr_strat_tau_ndx(20) = get_rxt_ndx( 'usr_SOAB_strat_tau' )
     425           0 :     usr_strat_tau_ndx(21) = get_rxt_ndx( 'usr_SOAT_strat_tau' )
     426           0 :     usr_strat_tau_ndx(22) = get_rxt_ndx( 'usr_SOAX_strat_tau' )
     427             : !
     428             : ! stratospheric aerosol chemistry
     429             : !
     430           0 :     het1_ndx             = get_rxt_ndx( 'het1' )
     431             : !
     432             : ! ion chemistry
     433             : !
     434           0 :     ion1_ndx  = get_rxt_ndx( 'ion_Op_O2' )
     435           0 :     ion2_ndx  = get_rxt_ndx( 'ion_Op_N2' )
     436           0 :     ion3_ndx  = get_rxt_ndx( 'ion_N2p_Oa' )
     437           0 :     ion11_ndx = get_rxt_ndx( 'ion_N2p_Ob' )
     438             : 
     439           0 :     elec1_ndx  = get_rxt_ndx( 'elec1' )
     440           0 :     elec2_ndx  = get_rxt_ndx( 'elec2' )
     441           0 :     elec3_ndx  = get_rxt_ndx( 'elec3' )
     442             : 
     443           0 :     do i = 1,nean
     444           0 :       write (xchar,'(i4)') i
     445           0 :       rxtname = 'ean'//trim(adjustl(xchar))
     446           0 :       ean_ndx(i) = get_rxt_ndx(trim(rxtname))
     447             :     enddo
     448             : 
     449           0 :     do i = 1,nrpe
     450           0 :       write (xchar,'(i4)') i
     451           0 :       rxtname = 'rpe'//trim(adjustl(xchar))
     452           0 :       rpe_ndx(i) = get_rxt_ndx(trim(rxtname))
     453             :     enddo
     454             : 
     455           0 :     do i = 1,npir
     456           0 :       write (xchar,'(i4)') i
     457           0 :       rxtname = 'pir'//trim(adjustl(xchar))
     458           0 :       pir_ndx(i) = get_rxt_ndx(trim(rxtname))
     459             :     enddo
     460             : 
     461           0 :     do i = 1,nedn
     462           0 :       write (xchar,'(i4)') i
     463           0 :       rxtname = 'edn'//trim(adjustl(xchar))
     464           0 :       edn_ndx(i) = get_rxt_ndx(trim(rxtname))
     465             :     enddo
     466             : 
     467           0 :     do i = 1,nnir
     468           0 :       write (xchar,'(i4)') i
     469           0 :       rxtname = 'nir'//trim(adjustl(xchar))
     470           0 :       nir_ndx(i) = get_rxt_ndx(trim(rxtname))
     471             :     enddo
     472             : 
     473           0 :     do i = 1,niira
     474           0 :       write (xchar,'(i4)') i
     475           0 :       rxtname = 'iira'//trim(adjustl(xchar))
     476           0 :       iira_ndx(i) = get_rxt_ndx(trim(rxtname))
     477             :     enddo
     478             : 
     479           0 :     do i = 1,niirb
     480           0 :       write (xchar,'(i4)') i
     481           0 :       rxtname = 'iirb'//trim(adjustl(xchar))
     482           0 :       iirb_ndx(i) = get_rxt_ndx(trim(rxtname))
     483             :     enddo
     484             : 
     485           0 :     usr_clm_h2o_m_ndx = get_rxt_ndx( 'usr_CLm_H2O_M' )
     486           0 :     usr_clm_hcl_m_ndx = get_rxt_ndx( 'usr_CLm_HCL_M' )
     487             : 
     488           0 :     elec4_ndx  = get_rxt_ndx( 'Op2P_ea' )
     489           0 :     elec5_ndx  = get_rxt_ndx( 'Op2P_eb' )
     490           0 :     elec6_ndx  = get_rxt_ndx( 'Op2D_e' )
     491             : 
     492             :     has_ion_rxts = ion1_ndx>0 .and. ion2_ndx>0 .and. ion3_ndx>0 .and. elec1_ndx>0 &
     493           0 :                  .and. elec2_ndx>0 .and. elec3_ndx>0
     494             : 
     495             :     has_d_chem = &
     496             :          all(ean_ndx>0) .and. &
     497             :          all(rpe_ndx>0) .and. &
     498             :          all(pir_ndx>0) .and. &
     499             :          all(edn_ndx>0) .and. &
     500             :          all(nir_ndx>0) .and. &
     501             :          all(iira_ndx>0) .and. &
     502             :          all(iirb_ndx>0) .and. &
     503           0 :          usr_clm_h2o_m_ndx>0 .and. usr_clm_hcl_m_ndx>0
     504             : 
     505           0 :     h2o_ndx    = get_spc_ndx( 'H2O' )
     506             : 
     507             :     !
     508             :     ! llnl super fast
     509             :     !
     510           0 :     usr_oh_co_ndx  = get_rxt_ndx( 'usr_oh_co' )
     511           0 :     het_no2_h2o_ndx  = get_rxt_ndx( 'het_no2_h2o' )
     512           0 :     usr_oh_dms_ndx  = get_rxt_ndx( 'usr_oh_dms' )
     513           0 :     aq_so2_h2o2_ndx  = get_rxt_ndx( 'aq_so2_h2o2' )
     514           0 :     aq_so2_o3_ndx  = get_rxt_ndx( 'aq_so2_o3' )
     515             : 
     516             : !lke++
     517             : ! CO tags
     518             : !
     519           0 :     usr_COhc_OH_ndx      = get_rxt_ndx( 'usr_COhc_OH' )
     520           0 :     usr_COme_OH_ndx      = get_rxt_ndx( 'usr_COme_OH' )
     521           0 :     usr_CO01_OH_ndx      = get_rxt_ndx( 'usr_CO01_OH' )
     522           0 :     usr_CO02_OH_ndx      = get_rxt_ndx( 'usr_CO02_OH' )
     523           0 :     usr_CO03_OH_ndx      = get_rxt_ndx( 'usr_CO03_OH' )
     524           0 :     usr_CO04_OH_ndx      = get_rxt_ndx( 'usr_CO04_OH' )
     525           0 :     usr_CO05_OH_ndx      = get_rxt_ndx( 'usr_CO05_OH' )
     526           0 :     usr_CO06_OH_ndx      = get_rxt_ndx( 'usr_CO06_OH' )
     527           0 :     usr_CO07_OH_ndx      = get_rxt_ndx( 'usr_CO07_OH' )
     528           0 :     usr_CO08_OH_ndx      = get_rxt_ndx( 'usr_CO08_OH' )
     529           0 :     usr_CO09_OH_ndx      = get_rxt_ndx( 'usr_CO09_OH' )
     530           0 :     usr_CO10_OH_ndx      = get_rxt_ndx( 'usr_CO10_OH' )
     531           0 :     usr_CO11_OH_ndx      = get_rxt_ndx( 'usr_CO11_OH' )
     532           0 :     usr_CO12_OH_ndx      = get_rxt_ndx( 'usr_CO12_OH' )
     533           0 :     usr_CO13_OH_ndx      = get_rxt_ndx( 'usr_CO13_OH' )
     534           0 :     usr_CO14_OH_ndx      = get_rxt_ndx( 'usr_CO14_OH' )
     535           0 :     usr_CO15_OH_ndx      = get_rxt_ndx( 'usr_CO15_OH' )
     536           0 :     usr_CO16_OH_ndx      = get_rxt_ndx( 'usr_CO16_OH' )
     537           0 :     usr_CO17_OH_ndx      = get_rxt_ndx( 'usr_CO17_OH' )
     538           0 :     usr_CO18_OH_ndx      = get_rxt_ndx( 'usr_CO18_OH' )
     539           0 :     usr_CO19_OH_ndx      = get_rxt_ndx( 'usr_CO19_OH' )
     540           0 :     usr_CO20_OH_ndx      = get_rxt_ndx( 'usr_CO20_OH' )
     541           0 :     usr_CO21_OH_ndx      = get_rxt_ndx( 'usr_CO21_OH' )
     542           0 :     usr_CO22_OH_ndx      = get_rxt_ndx( 'usr_CO22_OH' )
     543           0 :     usr_CO23_OH_ndx      = get_rxt_ndx( 'usr_CO23_OH' )
     544           0 :     usr_CO24_OH_ndx      = get_rxt_ndx( 'usr_CO24_OH' )
     545           0 :     usr_CO25_OH_ndx      = get_rxt_ndx( 'usr_CO25_OH' )
     546           0 :     usr_CO26_OH_ndx      = get_rxt_ndx( 'usr_CO26_OH' )
     547           0 :     usr_CO27_OH_ndx      = get_rxt_ndx( 'usr_CO27_OH' )
     548           0 :     usr_CO28_OH_ndx      = get_rxt_ndx( 'usr_CO28_OH' )
     549           0 :     usr_CO29_OH_ndx      = get_rxt_ndx( 'usr_CO29_OH' )
     550           0 :     usr_CO30_OH_ndx      = get_rxt_ndx( 'usr_CO30_OH' )
     551           0 :     usr_CO31_OH_ndx      = get_rxt_ndx( 'usr_CO31_OH' )
     552           0 :     usr_CO32_OH_ndx      = get_rxt_ndx( 'usr_CO32_OH' )
     553           0 :     usr_CO33_OH_ndx      = get_rxt_ndx( 'usr_CO33_OH' )
     554           0 :     usr_CO34_OH_ndx      = get_rxt_ndx( 'usr_CO34_OH' )
     555           0 :     usr_CO35_OH_ndx      = get_rxt_ndx( 'usr_CO35_OH' )
     556           0 :     usr_CO36_OH_ndx      = get_rxt_ndx( 'usr_CO36_OH' )
     557           0 :     usr_CO37_OH_ndx      = get_rxt_ndx( 'usr_CO37_OH' )
     558           0 :     usr_CO38_OH_ndx      = get_rxt_ndx( 'usr_CO38_OH' )
     559           0 :     usr_CO39_OH_ndx      = get_rxt_ndx( 'usr_CO39_OH' )
     560           0 :     usr_CO40_OH_ndx      = get_rxt_ndx( 'usr_CO40_OH' )
     561           0 :     usr_CO41_OH_ndx      = get_rxt_ndx( 'usr_CO41_OH' )
     562           0 :     usr_CO42_OH_ndx      = get_rxt_ndx( 'usr_CO42_OH' )
     563             : !lke--
     564             : 
     565           0 :     if (masterproc) then
     566           0 :        write(iulog,*) ' '
     567           0 :        write(iulog,*) 'usrrxt_inti: diagnostics '
     568           0 :        write(iulog,'(10i5)') usr_O_O2_ndx,usr_HO2_HO2_ndx,tag_NO2_NO3_ndx,usr_N2O5_M_ndx,tag_NO2_OH_ndx,usr_HNO3_OH_ndx &
     569           0 :                             ,tag_NO2_HO2_ndx,usr_HO2NO2_M_ndx,usr_N2O5_aer_ndx,usr_NO3_aer_ndx,usr_NO2_aer_ndx &
     570           0 :                             ,usr_CO_OH_b_ndx,tag_C2H4_OH_ndx,tag_C3H6_OH_ndx,tag_CH3CO3_NO2_ndx,usr_PAN_M_ndx,usr_CH3COCH3_OH_ndx &
     571           0 :                             ,usr_MCO3_NO2_ndx,usr_MPAN_M_ndx,usr_XOOH_OH_ndx,usr_SO2_OH_ndx,usr_DMS_OH_ndx,usr_HO2_aer_ndx &
     572           0 :                             ,usr_GLYOXAL_aer_ndx,usr_ISOPNITA_aer_ndx,usr_ISOPNITB_aer_ndx,usr_ONITR_aer_ndx,usr_HONITR_aer_ndx &
     573           0 :                             ,usr_TERPNIT_aer_ndx,usr_NTERPOOH_aer_ndx,usr_NC4CHO_aer_ndx,usr_NC4CH2OH_aer_ndx,usr_ISOPZD1O2_ndx &
     574           0 :                             ,usr_ISOPZD4O2_ndx,usr_ISOPFDN_aer_ndx,usr_ISOPFNP_aer_ndx,usr_ISOPN2B_aer_ndx,usr_ISOPN1D_aer_ndx &
     575           0 :                             ,usr_ISOPN4D_aer_ndx,usr_INOOHD_aer_ndx,usr_INHEB_aer_ndx,usr_INHED_aer_ndx,usr_MACRN_aer_ndx &
     576           0 :                             ,usr_ISOPHFP_aer_ndx,usr_IEPOX_aer_ndx,usr_DHPMPAL_aer_ndx,usr_ISOPB1O2_NOn_ndx,usr_ISOPB1O2_NOa_ndx &
     577           0 :                             ,usr_ISOPB4O2_NOn_ndx,usr_ISOPB4O2_NOa_ndx,usr_ISOPED1O2_NOn_ndx,usr_ISOPED1O2_NOa_ndx &
     578           0 :                             ,usr_ISOPED4O2_NOn_ndx,usr_ISOPED4O2_NOa_ndx,usr_ISOPZD1O2_NOn_ndx,usr_ISOPZD1O2_NOa_ndx &
     579           0 :                             ,usr_ISOPZD4O2_NOn_ndx,usr_ISOPZD4O2_NOa_ndx,usr_ISOPNO3_NOn_ndx,usr_ISOPNO3_NOa_ndx &
     580           0 :                             ,usr_MVKO2_NOn_ndx,usr_MVKO2_NOa_ndx,usr_MACRO2_NOn_ndx,usr_MACRO2_NOa_ndx &
     581           0 :                             ,usr_IEPOXOO_NOn_ndx,usr_IEPOXOO_NOa_ndx,usr_ISOPN1DO2_NOn_ndx,usr_ISOPN1DO2_NOa_ndx &
     582           0 :                             ,usr_ISOPN2BO2_NOn_ndx,usr_ISOPN2BO2_NOa_ndx,usr_ISOPN3BO2_NOn_ndx,usr_ISOPN3BO2_NOa_ndx &
     583           0 :                             ,usr_ISOPN4DO2_NOn_ndx,usr_ISOPN4DO2_NOa_ndx,usr_ISOPNBNO3O2_NOn_ndx,usr_ISOPNBNO3O2_NOa_ndx &
     584           0 :                             ,usr_ISOPNOOHBO2_NOn_ndx,usr_ISOPNOOHBO2_NOa_ndx,usr_ISOPNOOHDO2_NOn_ndx,usr_ISOPNOOHDO2_NOa_ndx &
     585           0 :                             ,usr_NC4CHOO2_NOn_ndx,usr_NC4CHOO2_NOa_ndx,tag_MCO3_NO2_ndx &
     586           0 :                             ,usr_TERPNT_aer_ndx,tag_TERPA2CO3_NO2_ndx,usr_TERPA2PAN_M_ndx &
     587           0 :                             ,usr_TERPNT1_aer_ndx,usr_TERPNPT_aer_ndx,usr_TERPNPT1_aer_ndx,usr_TERPFDN_aer_ndx,usr_SQTN_aer_ndx &
     588           0 :                             ,usr_TERPHFN_aer_ndx,usr_TERPDHDP_aer_ndx,usr_TERPACID_aer_ndx,tag_TERPACO3_NO2_ndx &
     589           0 :                             ,usr_TERPAPAN_M_ndx,tag_TERPA3CO3_NO2_ndx, usr_TERPA3PAN_M_ndx,usr_ICHE_aer_ndx,usr_ISOPFNC_aer_ndx &
     590           0 :                             ,usr_ISOPFDNC_aer_ndx
     591             : 
     592             :     end if
     593             : 
     594           0 :   end subroutine usrrxt_inti
     595             : 
     596           0 :   subroutine usrrxt( rxt, temp, tempi, tempe, invariants, h2ovmr,  &
     597           0 :                      pmid, m, sulfate, mmr, relhum, strato_sad, &
     598           0 :                      tropchemlev, dlat, ncol, sad_trop, reff_trop, cwat, mbar, pbuf )
     599             : 
     600             : !-----------------------------------------------------------------
     601             : !        ... set the user specified reaction rates
     602             : !-----------------------------------------------------------------
     603             : 
     604             :     use mo_constants,  only : pi, avo => avogadro, boltz_cgs, rgas
     605             :     use chem_mods,     only : nfs, rxntot, gas_pcnst, inv_m_ndx=>indexm
     606             :     use mo_setinv,     only : inv_o2_ndx=>o2_ndx, inv_h2o_ndx=>h2o_ndx
     607             :     use physics_buffer,only : physics_buffer_desc
     608             :     use carma_flags_mod, only : carma_hetchem_feedback
     609             :     use aero_model,      only : aero_model_surfarea
     610             :     use rad_constituents,only : rad_cnst_get_info
     611             : 
     612             :     implicit none
     613             : 
     614             : !-----------------------------------------------------------------
     615             : !        ... dummy arguments
     616             : !-----------------------------------------------------------------
     617             :     integer, intent(in)     :: ncol
     618             :     integer, intent(in)     :: tropchemlev(pcols)         ! trop/strat reaction separation vertical index
     619             :     real(r8), intent(in)    :: dlat(:)                    ! degrees latitude
     620             :     real(r8), intent(in)    :: temp(pcols,pver)           ! temperature (K); neutral temperature
     621             :     real(r8), intent(in)    :: tempi(pcols,pver)          ! ionic temperature (K); only used if ion chemistry
     622             :     real(r8), intent(in)    :: tempe(pcols,pver)          ! electronic temperature (K); only used if ion chemistry
     623             :     real(r8), intent(in)    :: m(ncol,pver)               ! total atm density (/cm^3)
     624             :     real(r8), intent(in)    :: sulfate(ncol,pver)         ! sulfate aerosol (mol/mol)
     625             :     real(r8), intent(in)    :: strato_sad(pcols,pver)     ! stratospheric aerosol sad (1/cm)
     626             :     real(r8), intent(in)    :: h2ovmr(ncol,pver)          ! water vapor (mol/mol)
     627             :     real(r8), intent(in)    :: relhum(ncol,pver)          ! relative humidity
     628             :     real(r8), intent(in)    :: pmid(pcols,pver)           ! midpoint pressure (Pa)
     629             :     real(r8), intent(in)    :: invariants(ncol,pver,nfs)  ! invariants density (/cm^3)
     630             :     real(r8), intent(in)    :: mmr(pcols,pver,gas_pcnst)  ! species concentrations (kg/kg)
     631             :     real(r8), intent(in)    :: cwat(ncol,pver) !PJC Condensed Water (liquid+ice) (kg/kg)
     632             :     real(r8), intent(in)    :: mbar(ncol,pver) !PJC Molar mass of air (g/mol)
     633             :     real(r8), intent(inout) :: rxt(ncol,pver,rxntot)      ! gas phase rates
     634             :     real(r8), intent(out)   :: sad_trop(pcols,pver)       ! tropospheric surface area density (cm2/cm3)
     635             :     real(r8), intent(out)   :: reff_trop(pcols,pver)      ! tropospheric effective radius (cm)
     636             :     type(physics_buffer_desc), pointer :: pbuf(:)
     637             : 
     638             : !-----------------------------------------------------------------
     639             : !        ... local variables
     640             : !-----------------------------------------------------------------
     641             : 
     642             :     real(r8), parameter :: dg = 0.1_r8            ! mole diffusion =0.1 cm2/s (Dentener, 1993)
     643             : 
     644             : !-----------------------------------------------------------------
     645             : !       ... reaction probabilities for heterogeneous reactions
     646             : !-----------------------------------------------------------------
     647             :     real(r8), parameter :: gamma_n2o5 = 0.02_r8         ! JPL19
     648             :     real(r8), parameter :: gamma_ho2  = 0.10_r8         ! Gaubert et al., https://doi.org/10.5194/acp-20-14617-2020
     649             :     real(r8), parameter :: gamma_no2  = 8.0e-6_r8       ! Liu et al., Environ.Sci.&Tech, 53, 3517, 2019 doi:10.1021/acs.est.8b06367
     650             :     real(r8), parameter :: gamma_no3  = 0.002_r8        ! JPL19
     651             :     real(r8), parameter :: gamma_glyoxal  = 2.0e-4_r8   !  Washenfelder et al, JGR, 2011
     652             : !TS1 species
     653             :     real(r8), parameter :: gamma_isopnita  = 0.005_r8        ! from Fisher et al., ACP, 2016
     654             :     real(r8), parameter :: gamma_isopnitb  = 0.005_r8        !
     655             :     real(r8), parameter :: gamma_onitr     = 0.005_r8        !
     656             :     real(r8), parameter :: gamma_honitr    = 0.005_r8        !
     657             :     real(r8), parameter :: gamma_terpnit   = 0.01_r8         !
     658             :     real(r8), parameter :: gamma_nterpooh  = 0.01_r8         !
     659             :     real(r8), parameter :: gamma_nc4cho    = 0.02_r8        !
     660             :     real(r8), parameter :: gamma_nc4ch2oh  = 0.005_r8        !
     661             : !TS2 species
     662             :     real(r8), parameter :: gamma_isopfdn  = 0.1_r8          ! Marais 2015 for C5-LVOC
     663             :     real(r8), parameter :: gamma_isopfnp  = 0.1_r8          ! Marais 2015 for C5-LVOC
     664             :     real(r8), parameter :: gamma_isopn2b  = 0.02_r8        ! All isoprene nitrates Wolfe
     665             :     real(r8), parameter :: gamma_isopn1d  = 0.02_r8        !
     666             :     real(r8), parameter :: gamma_isopn4d  = 0.02_r8        !
     667             :     real(r8), parameter :: gamma_inoohd   = 0.02_r8        !
     668             :     real(r8), parameter :: gamma_inheb    = 0.02_r8       !Marais 2015 for IEPOX
     669             :     real(r8), parameter :: gamma_inhed    = 0.02_r8       !Marais 2015 for IEPOX
     670             :     real(r8), parameter :: gamma_macrn    = 0.02_r8        !
     671             :     real(r8), parameter :: gamma_isophfp  = 0.1_r8          !Marais 2015 for C5-LVOC
     672             :     real(r8), parameter :: gamma_iepox    = 0.0042_r8       !Marais 2015 for IEPOX
     673             :     real(r8), parameter :: gamma_dhpmpal  = 0.1_r8          !Marais 2015 for C5-LVOC
     674             :     real(r8), parameter :: gamma_iche     = 0.0042_r8       !Marais 2015 for IEPOX
     675             :     real(r8), parameter :: gamma_isopfnc  = 0.1_r8          ! Marais 2015 for C5-LVOC
     676             :     real(r8), parameter :: gamma_isopfdnc = 0.1_r8          ! Marais 2015 for C5-LVOC
     677             :     real(r8), parameter :: gamma_terpnt   = 0.02_r8        !
     678             :     real(r8), parameter :: gamma_terpnt1  = 0.02_r8        !
     679             :     real(r8), parameter :: gamma_terpnpt  = 0.02_r8        !
     680             :     real(r8), parameter :: gamma_terpnpt1 = 0.02_r8        !
     681             :     real(r8), parameter :: gamma_terpfdn  = 0.1_r8        !
     682             :     real(r8), parameter :: gamma_sqtn     = 0.1_r8        !
     683             :     real(r8), parameter :: gamma_terphfn  = 0.1_r8        !
     684             :     real(r8), parameter :: gamma_terpdhdp = 0.1_r8        !
     685             :     real(r8), parameter :: gamma_terpacid = 0.01_r8        !
     686             : 
     687             :     integer  ::  i, k
     688             :     integer  ::  l
     689           0 :     real(r8) ::  tp(ncol)                       ! 300/t
     690           0 :     real(r8) ::  tinv(ncol)                     ! 1/t
     691           0 :     real(r8) ::  ko(ncol)
     692           0 :     real(r8) ::  term1(ncol)
     693           0 :     real(r8) ::  term2(ncol)
     694           0 :     real(r8) ::  kinf(ncol)
     695           0 :     real(r8) ::  fc(ncol)
     696           0 :     real(r8) ::  xr(ncol)
     697           0 :     real(r8) ::  sur(ncol)
     698           0 :     real(r8) ::  sqrt_t(ncol)                   ! sqrt( temp )
     699           0 :     real(r8) ::  sqrt_t_58(ncol)                ! sqrt( temp / 58.)
     700           0 :     real(r8) ::  exp_fac(ncol)                  ! vector exponential
     701           0 :     real(r8) ::  lwc(ncol)
     702           0 :     real(r8) ::  ko_m(ncol)
     703           0 :     real(r8) ::  k0(ncol)
     704           0 :     real(r8) ::  kinf_m(ncol)
     705           0 :     real(r8) ::  o2(ncol)
     706             :     real(r8) ::  c_n2o5, c_ho2, c_no2, c_no3, c_glyoxal
     707             : !TS1 species
     708             :     real(r8) ::  c_isopnita, c_isopnitb, c_onitr, c_honitr, c_terpnit, c_nterpooh
     709             :     real(r8) ::  c_nc4cho, c_nc4ch2oh
     710             : !T2 species
     711             :     real(r8) ::  c_isopfdn, c_isopfnp, c_isopn2b, c_isopn1d, c_isopn4d, c_inoohd
     712             :     real(r8) ::  c_inheb, c_inhed, c_macrn, c_isophfp, c_iepox, c_dhpmpal
     713             :     real(r8) ::  c_iche, c_isopfnc, c_isopfdnc
     714             :     real(r8) ::  c_terpnt, c_terpnt1, c_terpnpt, c_terpnpt1, c_terpfdn, c_sqtn, c_terphfn, c_terpdhdp, c_terpacid
     715             : 
     716             :     real(r8) ::  amas
     717             :     !-----------------------------------------------------------------
     718             :     !   ... density of sulfate aerosol
     719             :     !-----------------------------------------------------------------
     720             :     real(r8), parameter :: gam1 = 0.04_r8                 ! N2O5+SUL ->2HNO3
     721             :     real(r8), parameter :: wso4 = 98._r8
     722             :     real(r8), parameter :: den  = 1.15_r8                 ! each molecule of SO4(aer) density g/cm3
     723             :     !-------------------------------------------------
     724             :     !   ... volume of sulfate particles
     725             :     !           assuming mean rm
     726             :     !           continient 0.05um  0.07um  0.09um
     727             :     !           ocean      0.09um  0.25um  0.37um
     728             :     !                      0.16um                  Blake JGR,7195, 1995
     729             :     !-------------------------------------------------
     730             :     real(r8), parameter :: rm1  = 0.16_r8*1.e-4_r8             ! mean radii in cm
     731             :     real(r8), parameter :: fare = 4._r8*pi*rm1*rm1             ! each mean particle(r=0.1u) area   cm2/cm3
     732             : 
     733             :     !-----------------------------------------------------------------------
     734             :     !        ... Aqueous phase sulfur quantities for SO2 + H2O2 and SO2 + O3
     735             :     !-----------------------------------------------------------------------
     736             :     real(r8), parameter  :: HENRY298_H2O2 =  7.45e+04_r8
     737             :     real(r8), parameter  :: H298_H2O2     = -1.45e+04_r8
     738             :     real(r8), parameter  :: HENRY298_SO2  =  1.23e+00_r8
     739             :     real(r8), parameter  :: H298_SO2      = -6.25e+03_r8
     740             :     real(r8), parameter  :: K298_SO2_HSO3 =  1.3e-02_r8
     741             :     real(r8), parameter  :: H298_SO2_HSO3 = -4.16e+03_r8
     742             :     real(r8), parameter  :: R_CONC        =  82.05e+00_r8 / avo
     743             :     real(r8), parameter  :: R_CAL         =  rgas * 0.239006e+00_r8
     744             :     real(r8), parameter  :: K_AQ          =  7.57e+07_r8
     745             :     real(r8), parameter  :: ER_AQ         =  4.43e+03_r8
     746             : 
     747             :     real(r8), parameter  :: HENRY298_O3   =  1.13e-02_r8
     748             :     real(r8), parameter  :: H298_O3       = -5.04e+03_r8
     749             :     real(r8), parameter  :: K298_HSO3_SO3 =  6.6e-08_r8
     750             :     real(r8), parameter  :: H298_HSO3_SO3 = -2.23e+03_r8
     751             :     real(r8), parameter  :: K0_AQ         =  2.4e+04_r8
     752             :     real(r8), parameter  :: ER0_AQ        =  0.0e+00_r8
     753             :     real(r8), parameter  :: K1_AQ         =  3.7e+05_r8
     754             :     real(r8), parameter  :: ER1_AQ        =  5.53e+03_r8
     755             :     real(r8), parameter  :: K2_AQ         =  1.5e+09_r8
     756             :     real(r8), parameter  :: ER2_AQ        =  5.28e+03_r8
     757             : 
     758             :     real(r8), parameter  :: pH            =  4.5e+00_r8
     759             : 
     760           0 :     real(r8), pointer :: sfc(:), dm_aer(:)
     761             :     integer :: ntot_amode
     762             : 
     763           0 :     real(r8), pointer :: sfc_array(:,:,:), dm_array(:,:,:)
     764             :  !TS2
     765           0 :     real(r8) ::  aterm(ncol)
     766             :     real(r8) ::  natom
     767             :     real(r8) ::  nyield
     768             :     real(r8) ::  acorr
     769             :     real(r8) ::  exp_natom
     770             : 
     771             :     ! get info about the modal aerosols
     772             :     ! get ntot_amode
     773           0 :     call rad_cnst_get_info(0, nmodes=ntot_amode)
     774             : 
     775           0 :     if (ntot_amode>0) then
     776           0 :        allocate(sfc_array(pcols,pver,ntot_amode), dm_array(pcols,pver,ntot_amode) )
     777             :     else
     778           0 :        allocate(sfc_array(pcols,pver,5), dm_array(pcols,pver,5) )
     779             :     endif
     780             : 
     781           0 :     sfc_array(:,:,:) = 0._r8
     782           0 :     dm_array(:,:,:) = 0._r8
     783           0 :     sad_trop(:,:) = 0._r8
     784           0 :     reff_trop(:,:) = 0._r8
     785             : 
     786           0 :     if( usr_NO2_aer_ndx > 0 .or. usr_NO3_aer_ndx > 0 .or. usr_N2O5_aer_ndx > 0 .or. usr_HO2_aer_ndx > 0 ) then
     787             : 
     788             : ! sad_trop should be set outside of usrrxt ??
     789           0 :        if( carma_hetchem_feedback ) then
     790           0 :           sad_trop(:ncol,:pver)=strato_sad(:ncol,:pver)
     791             :        else
     792             : 
     793             :           call aero_model_surfarea( &
     794             :                mmr, rm1, relhum, pmid, temp, strato_sad, sulfate, m, tropchemlev, dlat, &
     795           0 :                het1_ndx, pbuf, ncol, sfc_array, dm_array, sad_trop, reff_trop )
     796             : 
     797             :        endif
     798             :     endif
     799             : 
     800           0 :     level_loop : do k = 1,pver
     801           0 :        tinv(:)           = 1._r8 / temp(:ncol,k)
     802           0 :        tp(:)             = 300._r8 * tinv(:)
     803           0 :        sqrt_t(:)         = sqrt( temp(:ncol,k) )
     804           0 :        sqrt_t_58(:)      = sqrt( temp(:ncol,k) / 58.0_r8 )
     805             : 
     806             : !-----------------------------------------------------------------
     807             : !       ... o + o2 + m --> o3 + m (JPL15-10)
     808             : !-----------------------------------------------------------------
     809           0 :        if( usr_O_O2_ndx > 0 ) then
     810           0 :           rxt(:,k,usr_O_O2_ndx) = 6.e-34_r8 * tp(:)**2.4_r8
     811             :        end if
     812           0 :        if( usr_OA_O2_ndx > 0 ) then
     813           0 :           rxt(:,k,usr_OA_O2_ndx) = 6.e-34_r8 * tp(:)**2.4_r8
     814             :        end if
     815             : 
     816             : !-----------------------------------------------------------------
     817             : !       ... o + o + m -> o2 + m
     818             : !-----------------------------------------------------------------
     819           0 :        if ( usr_O_O_ndx > 0 ) then
     820           0 :           rxt(:,k,usr_O_O_ndx) = 2.76e-34_r8 * exp( 720.0_r8*tinv(:) )
     821             :        end if
     822             : 
     823             : !-----------------------------------------------------------------
     824             : !       ... cl2o2 + m -> 2*clo + m  (JPL15-10)
     825             : !-----------------------------------------------------------------
     826           0 :        if ( usr_CL2O2_M_ndx > 0 ) then
     827           0 :           if ( tag_CLO_CLO_M_ndx > 0 ) then
     828           0 :              ko(:)            = 2.16e-27_r8 * exp( 8537.0_r8* tinv(:) )
     829           0 :              rxt(:,k,usr_CL2O2_M_ndx) = rxt(:,k,tag_CLO_CLO_M_ndx)/ko(:)
     830             :           else
     831           0 :              rxt(:,k,usr_CL2O2_M_ndx) = 0._r8
     832             :           end if
     833             :        end if
     834             : 
     835             : !-----------------------------------------------------------------
     836             : !       ... so3 + 2*h2o --> h2so4 + h2o
     837             : !       Note: this reaction proceeds by the 2 intermediate steps below
     838             : !           so3 + h2o --> adduct
     839             : !           adduct + h2o --> h2so4 + h2o
     840             : !               (Lovejoy et al., JCP, pp. 19911-19916, 1996)
     841             : !       The first order rate constant used here is recommended by JPL 2011.
     842             : !       This rate involves the water vapor number density.
     843             : !-----------------------------------------------------------------
     844             : 
     845           0 :        if ( usr_SO3_H2O_ndx > 0 ) then
     846           0 :           call comp_exp( exp_fac, 6540.0_r8*tinv(:), ncol )
     847           0 :           if( h2o_ndx > 0 ) then
     848           0 :              fc(:) = 8.5e-21_r8 * m(:,k) * h2ovmr(:,k) * exp_fac(:)
     849             :           else
     850           0 :              fc(:) = 8.5e-21_r8 * invariants(:,k,inv_h2o_ndx) * exp_fac(:)
     851             :           end if
     852           0 :           rxt(:,k,usr_SO3_H2O_ndx) = 1.0e-20_r8 * fc(:)
     853             :        end if
     854             : 
     855             : !-----------------------------------------------------------------
     856             : !       ... n2o5 + m --> no2 + no3 + m (JPL15-10)
     857             : !-----------------------------------------------------------------
     858           0 :        if( usr_N2O5_M_ndx > 0 ) then
     859           0 :           if( tag_NO2_NO3_ndx > 0 ) then
     860           0 :              call comp_exp( exp_fac, -10840.0_r8*tinv, ncol )
     861           0 :              rxt(:,k,usr_N2O5_M_ndx) = rxt(:,k,tag_NO2_NO3_ndx) * 1.724138e26_r8 * exp_fac(:)
     862             :           else
     863           0 :              rxt(:,k,usr_N2O5_M_ndx) = 0._r8
     864             :           end if
     865             :        end if
     866           0 :        if( usr_XNO2NO3_M_ndx > 0 ) then
     867           0 :           if( tag_NO2_NO3_ndx > 0 ) then
     868           0 :              call comp_exp( exp_fac, -10840.0_r8*tinv, ncol )
     869           0 :              rxt(:,k,usr_XNO2NO3_M_ndx) = rxt(:,k,tag_NO2_NO3_ndx) *1.724138e26_r8 * exp_fac(:)
     870             :           else
     871           0 :              rxt(:,k,usr_XNO2NO3_M_ndx) = 0._r8
     872             :           end if
     873             :        end if
     874           0 :        if( usr_NO2XNO3_M_ndx > 0 ) then
     875           0 :           if( tag_NO2_NO3_ndx > 0 ) then
     876           0 :              call comp_exp( exp_fac, -10840.0_r8*tinv, ncol )
     877           0 :              rxt(:,k,usr_NO2XNO3_M_ndx) = rxt(:,k,tag_NO2_NO3_ndx) * 1.734138e26_r8 * exp_fac(:)
     878             :           else
     879           0 :              rxt(:,k,usr_NO2XNO3_M_ndx) = 0._r8
     880             :           end if
     881             :        end if
     882             : 
     883             : !-----------------------------------------------------------------
     884             : !       set rates for:
     885             : !       ... hno3 + oh --> no3 + h2o
     886             : !           ho2no2 + m --> ho2 + no2 + m
     887             : !-----------------------------------------------------------------
     888           0 :        if( usr_HNO3_OH_ndx > 0 ) then
     889           0 :           call comp_exp( exp_fac, 1335._r8*tinv, ncol )
     890           0 :           ko(:) = m(:,k) * 6.5e-34_r8 * exp_fac(:)
     891           0 :           call comp_exp( exp_fac, 2199._r8*tinv, ncol )
     892           0 :           ko(:) = ko(:) / (1._r8 + ko(:)/(2.7e-17_r8*exp_fac(:)))
     893           0 :           call comp_exp( exp_fac, 460._r8*tinv, ncol )
     894           0 :           rxt(:,k,usr_HNO3_OH_ndx) = ko(:) + 2.4e-14_r8*exp_fac(:)
     895             :        end if
     896           0 :        if( usr_XHNO3_OH_ndx > 0 ) then
     897           0 :           call comp_exp( exp_fac, 1335._r8*tinv, ncol )
     898           0 :           ko(:) = m(:,k) * 6.5e-34_r8 * exp_fac(:)
     899           0 :           call comp_exp( exp_fac, 2199._r8*tinv, ncol )
     900           0 :           ko(:) = ko(:) / (1._r8 + ko(:)/(2.7e-17_r8*exp_fac(:)))
     901           0 :           call comp_exp( exp_fac, 460._r8*tinv, ncol )
     902           0 :           rxt(:,k,usr_XHNO3_OH_ndx) = ko(:) + 2.4e-14_r8*exp_fac(:)
     903             :        end if
     904           0 :        if( usr_HO2NO2_M_ndx > 0 ) then
     905           0 :           if( tag_NO2_HO2_ndx > 0 ) then
     906           0 :              call comp_exp( exp_fac, -10900._r8*tinv, ncol )
     907           0 :              rxt(:,k,usr_HO2NO2_M_ndx) = rxt(:,k,tag_NO2_HO2_ndx) * exp_fac(:) / 2.1e-27_r8
     908             :           else
     909           0 :              rxt(:,k,usr_HO2NO2_M_ndx) = 0._r8
     910             :           end if
     911             :        end if
     912           0 :        if( usr_XHO2NO2_M_ndx > 0 ) then
     913           0 :           if( tag_NO2_HO2_ndx > 0 ) then
     914           0 :              call comp_exp( exp_fac, -10900._r8*tinv, ncol )
     915           0 :              rxt(:,k,usr_XHO2NO2_M_ndx) = rxt(:,k,tag_NO2_HO2_ndx) * exp_fac(:) / 2.1e-27_r8
     916             :           else
     917           0 :              rxt(:,k,usr_XHO2NO2_M_ndx) = 0._r8
     918             :           end if
     919             :        end if
     920             : !-----------------------------------------------------------------
     921             : !       ... co + oh --> co2 + ho2 (new single reaction for combined branches [JPL19])
     922             : !-----------------------------------------------------------------
     923           0 :        if( usr_CO_OH_ndx > 0 ) then
     924           0 :          ko  (:)  = 6.9e-33_r8 * ( 298._r8 / temp(:ncol,k) )**(2.1_r8)
     925           0 :          kinf(:)  = 1.1e-12_r8 * ( 298._r8 / temp(:ncol,k) )**(-1.3_r8)
     926             : 
     927           0 :          term2(:) = (1 + (log10( ko(:)*m(:,k) / kinf(:) ))**2)**(-1)
     928             : 
     929           0 :          term1(:) = (kinf(:) * ko(:)*m(:,k)) / (kinf(:) + ko(:)*m(:,k)) * (0.6_r8)**term2(:)
     930             : 
     931           0 :          rxt(:ncol,k,usr_CO_OH_ndx) = term1(:) + 1.85e-13_r8 * exp(-65._r8/temp(:ncol,k)) * (1._r8 - term1(:)/kinf(:))
     932             : 
     933             :        end if
     934             : !-----------------------------------------------------------------
     935             : !       ... co + oh --> co2 + ho2     (combined branches - do not use with CO_OH_b)
     936             : !       note: for mechanisms prior to Dec 2022
     937             : !-----------------------------------------------------------------
     938           0 :        if( usr_CO_OH_a_ndx > 0 ) then
     939           0 :           rxt(:,k,usr_CO_OH_a_ndx) = 1.5e-13_r8 * &
     940           0 :                (1._r8 + 6.e-7_r8*boltz_cgs*m(:,k)*temp(:ncol,k))
     941             :        end if
     942             : !-----------------------------------------------------------------
     943             : !       ... co + oh --> co2 + h (second branch JPL15-10, with CO+OH+M)
     944             : !       note: for mechanisms prior to Dec 2022
     945             : !-----------------------------------------------------------------
     946           0 :        if( usr_CO_OH_b_ndx > 0 ) then
     947           0 :          kinf(:)  = 2.1e+09_r8 * (temp(:ncol,k)/ t0)**(6.1_r8)
     948           0 :          ko  (:)  = 1.5e-13_r8
     949             : 
     950           0 :          term1(:) = ko(:) / ( (kinf(:) / m(:,k)) )
     951           0 :          term2(:) = ko(:) / (1._r8 + term1(:))
     952             : 
     953           0 :          term1(:) = log10( term1(:) )
     954           0 :          term1(:) = 1.0_r8 / (1.0_r8 + term1(:)*term1(:))
     955             : 
     956           0 :          rxt(:ncol,k,usr_CO_OH_b_ndx) = term2(:) * (0.6_r8)**term1(:)
     957             :        end if
     958             : 
     959             : !-----------------------------------------------------------------
     960             : !       ... ho2 + ho2 --> h2o2
     961             : !       note: this rate involves the water vapor number density
     962             : !-----------------------------------------------------------------
     963           0 :        if( usr_HO2_HO2_ndx > 0 ) then
     964             : 
     965           0 :           call comp_exp( exp_fac, 460._r8*tinv, ncol )
     966           0 :           ko(:)   = 3.0e-13_r8 * exp_fac(:)
     967           0 :           call comp_exp( exp_fac, 920._r8*tinv, ncol )
     968           0 :           kinf(:) = 2.1e-33_r8 * m(:,k) * exp_fac(:)
     969           0 :           call comp_exp( exp_fac, 2200._r8*tinv, ncol )
     970             : 
     971           0 :           if( h2o_ndx > 0 ) then
     972           0 :              fc(:) = 1._r8 + 1.4e-21_r8 * m(:,k) * h2ovmr(:,k) * exp_fac(:)
     973             :           else
     974           0 :              fc(:) = 1._r8 + 1.4e-21_r8 * invariants(:,k,inv_h2o_ndx) * exp_fac(:)
     975             :           end if
     976           0 :           rxt(:,k,usr_HO2_HO2_ndx) = (ko(:) + kinf(:)) * fc(:)
     977             : 
     978             :        end if
     979             : 
     980             : !-----------------------------------------------------------------
     981             : !       ... mco3 + no2 -> mpan
     982             : !-----------------------------------------------------------------
     983           0 :        if( usr_MCO3_NO2_ndx > 0 ) then
     984           0 :           rxt(:,k,usr_MCO3_NO2_ndx) = 1.1e-11_r8 * tp(:) / m(:,k)
     985             :        end if
     986           0 :        if( usr_MCO3_XNO2_ndx > 0 ) then
     987           0 :           rxt(:,k,usr_MCO3_XNO2_ndx) = 1.1e-11_r8 * tp(:) / m(:,k)
     988             :        end if
     989             : 
     990             : !-----------------------------------------------------------------
     991             : !       ... pan + m --> ch3co3 + no2 + m (JPL15-10)
     992             : !-----------------------------------------------------------------
     993           0 :        call comp_exp( exp_fac, -14000._r8*tinv, ncol )
     994           0 :        if( usr_PAN_M_ndx > 0 ) then
     995           0 :           if( tag_CH3CO3_NO2_ndx > 0 ) then
     996           0 :              rxt(:,k,usr_PAN_M_ndx) = rxt(:,k,tag_CH3CO3_NO2_ndx) * 1.111e28_r8 * exp_fac(:)
     997             :           else
     998           0 :              rxt(:,k,usr_PAN_M_ndx) = 0._r8
     999             :           end if
    1000             :        end if
    1001           0 :        if( usr_XPAN_M_ndx > 0 ) then
    1002           0 :           if( tag_CH3CO3_NO2_ndx > 0 ) then
    1003           0 :              rxt(:,k,usr_XPAN_M_ndx) = rxt(:,k,tag_CH3CO3_NO2_ndx) * 1.111e28_r8 * exp_fac(:)
    1004             :           else
    1005           0 :              rxt(:,k,usr_XPAN_M_ndx) = 0._r8
    1006             :           end if
    1007             :        end if
    1008             : 
    1009             : !-----------------------------------------------------------------
    1010             : !       ... mpan + m --> mco3 + no2 + m (JPL15-10)
    1011             : !-----------------------------------------------------------------
    1012           0 :        if( usr_MPAN_M_ndx > 0 ) then
    1013           0 :           if( tag_MCO3_NO2_ndx > 0 ) then
    1014           0 :              rxt(:,k,usr_MPAN_M_ndx) = rxt(:,k,tag_MCO3_NO2_ndx) * 1.111e28_r8 * exp_fac(:)
    1015             :           else
    1016           0 :              rxt(:,k,usr_MPAN_M_ndx) = 0._r8
    1017             :           end if
    1018             :        end if
    1019           0 :        if( usr_XMPAN_M_ndx > 0 ) then
    1020           0 :           if( tag_MCO3_NO2_ndx > 0 ) then
    1021           0 :              rxt(:,k,usr_XMPAN_M_ndx) = rxt(:,k,tag_MCO3_NO2_ndx) * 1.111e28_r8 * exp_fac(:)
    1022             :           else
    1023           0 :              rxt(:,k,usr_XMPAN_M_ndx) = 0._r8
    1024             :           end if
    1025             :        end if
    1026             : 
    1027             : !lke-TS1
    1028             : !-----------------------------------------------------------------
    1029             : !       ... pbznit + m --> acbzo2 + no2 + m
    1030             : !-----------------------------------------------------------------
    1031           0 :        if( usr_PBZNIT_M_ndx > 0 ) then
    1032           0 :           if( tag_ACBZO2_NO2_ndx > 0 ) then
    1033           0 :              rxt(:,k,usr_PBZNIT_M_ndx) = rxt(:,k,tag_ACBZO2_NO2_ndx) * 1.111e28_r8 * exp_fac(:)
    1034             :           else
    1035           0 :              rxt(:,k,usr_PBZNIT_M_ndx) = 0._r8
    1036             :           end if
    1037             :        end if
    1038             : !-----------------------------------------------------------------
    1039             : !       ... TERPAPAN + m --> TERPACO3 + no2 + m
    1040             : !-----------------------------------------------------------------
    1041           0 :        if( usr_TERPAPAN_M_ndx > 0 ) then
    1042           0 :           if( tag_TERPACO3_NO2_ndx > 0 ) then
    1043           0 :              rxt(:,k,usr_TERPAPAN_M_ndx) = rxt(:,k,tag_TERPACO3_NO2_ndx) * 1.111e28_r8 * exp_fac(:)
    1044             :           else
    1045           0 :              rxt(:,k,usr_TERPAPAN_M_ndx) = 0._r8
    1046             :           end if
    1047             :        end if
    1048             : !-----------------------------------------------------------------
    1049             : !       ... TERPA2PAN + m --> TERPA2CO3 + no2 + m
    1050             : !-----------------------------------------------------------------
    1051           0 :        if( usr_TERPA2PAN_M_ndx > 0 ) then
    1052           0 :           if( tag_TERPA2CO3_NO2_ndx > 0 ) then
    1053           0 :              rxt(:,k,usr_TERPA2PAN_M_ndx) = rxt(:,k,tag_TERPA2CO3_NO2_ndx) * 1.111e28_r8 * exp_fac(:)
    1054             :           else
    1055           0 :              rxt(:,k,usr_TERPA2PAN_M_ndx) = 0._r8
    1056             :           end if
    1057             :        end if
    1058             : !-----------------------------------------------------------------
    1059             : !       ... TERPA3PAN + m --> TERPA3CO3 + no2 + m
    1060             : !-----------------------------------------------------------------
    1061           0 :        if( usr_TERPA3PAN_M_ndx > 0 ) then
    1062           0 :           if( tag_TERPA3CO3_NO2_ndx > 0 ) then
    1063           0 :              rxt(:,k,usr_TERPA3PAN_M_ndx) = rxt(:,k,tag_TERPA3CO3_NO2_ndx) * 1.111e28_r8 * exp_fac(:)
    1064             :           else
    1065           0 :              rxt(:,k,usr_TERPA3PAN_M_ndx) = 0._r8
    1066             :           end if
    1067             :        end if
    1068             : !-----------------------------------------------------------------
    1069             : !       ... xooh + oh -> h2o + oh
    1070             : !-----------------------------------------------------------------
    1071           0 :        if( usr_XOOH_OH_ndx > 0 ) then
    1072           0 :           call comp_exp( exp_fac, 253._r8*tinv, ncol )
    1073           0 :           rxt(:,k,usr_XOOH_OH_ndx) = temp(:ncol,k)**2._r8 * 7.69e-17_r8 * exp_fac(:)
    1074             :        end if
    1075             : 
    1076             : !-----------------------------------------------------------------
    1077             : !       ... ch3coch3 + oh -> ro2 + h2o
    1078             : !-----------------------------------------------------------------
    1079           0 :        if( usr_CH3COCH3_OH_ndx > 0 ) then
    1080           0 :           call comp_exp( exp_fac, -2000._r8*tinv, ncol )
    1081           0 :           rxt(:,k,usr_CH3COCH3_OH_ndx) = 3.82e-11_r8 * exp_fac(:) + 1.33e-13_r8
    1082             :        end if
    1083             : 
    1084             : !-----------------------------------------------------------------
    1085             : !       ... DMS + OH  --> .5 * SO2
    1086             : !       JPL15-10 (use [O2] = 0.21*[M])
    1087             : !       k = 8.2E-39 * exp(5376/T) * [O2] / (1 + 1.05E-5 *([O2]/[M]) * exp(3644/T))
    1088             : !-----------------------------------------------------------------
    1089           0 :        if( usr_DMS_OH_ndx > 0 ) then
    1090           0 :           call comp_exp( exp_fac, 3644._r8*tinv, ncol )
    1091           0 :           ko(:) = 1._r8 + 1.05e-5_r8 * exp_fac * 0.21_r8
    1092           0 :           call comp_exp( exp_fac, 5376._r8*tinv, ncol )
    1093           0 :           rxt(:,k,usr_DMS_OH_ndx) = 8.2e-39_r8 * exp_fac * m(:,k) * 0.21_r8 / ko(:)
    1094             :        end if
    1095             : 
    1096             : !-----------------------------------------------------------------
    1097             : !       ... SO2 + OH  --> SO4  (REFERENCE?? - not Liao)
    1098             : !-----------------------------------------------------------------
    1099           0 :        if( usr_SO2_OH_ndx > 0 ) then
    1100           0 :           fc(:) = 3.0e-31_r8 *(300._r8*tinv(:))**3.3_r8
    1101           0 :           ko(:) = fc(:)*m(:,k)/(1._r8 + fc(:)*m(:,k)/1.5e-12_r8)
    1102           0 :           rxt(:,k,usr_SO2_OH_ndx) = ko(:)*.6_r8**(1._r8 + (log10(fc(:)*m(:,k)/1.5e-12_r8))**2._r8)**(-1._r8)
    1103             :        end if
    1104             : !RHS TS2
    1105             : !-----------------------------------------------------------------
    1106             : !       ... ISOPZD1O2 --> HPALD etc. Wennberg 2018 for rate
    1107             : !-----------------------------------------------------------------
    1108           0 :        if( usr_ISOPZD1O2_ndx > 0 ) then
    1109           0 :           call comp_exp( exp_fac, -12200._r8*tinv, ncol )
    1110           0 :           ko(:) = 5.05e15_r8 * exp_fac(:)
    1111           0 :           call comp_exp( exp_fac, 1.e8_r8*tinv**3._r8, ncol )
    1112           0 :           rxt(:,k,usr_ISOPZD1O2_ndx) = ko(:)*exp_fac(:)
    1113             :        end if
    1114             : !-----------------------------------------------------------------
    1115             : !       ... ISOPZD4O2 --> HPALD etc. Wennberg 2018 for rate
    1116             : !-----------------------------------------------------------------
    1117           0 :        if( usr_ISOPZD4O2_ndx > 0 ) then
    1118           0 :           call comp_exp( exp_fac, -7160._r8*tinv, ncol )
    1119           0 :           ko(:) = 2.22e9_r8 * exp_fac(:)
    1120           0 :           call comp_exp( exp_fac, 1.e8_r8*tinv**3._r8, ncol )
    1121           0 :           rxt(:,k,usr_ISOPZD4O2_ndx) = ko(:)*exp_fac(:)
    1122             :        end if
    1123             : !-----------------------------------------------------------------
    1124             : !       ... ISOPB1O2_NOn Temp/Pressure Dependent Nitrate Yield
    1125             : !-----------------------------------------------------------------
    1126           0 :        if( usr_ISOPB1O2_NOn_ndx > 0 ) then
    1127           0 :           nyield = (1._r8-0.14_r8)/0.14_r8
    1128           0 :           natom = 6.0_r8
    1129           0 :           exp_natom = exp( natom )
    1130             :           acorr = (2.0e-22_r8*exp_natom*2.45e19_r8)/(1._r8+((2.0e-22_r8* &
    1131             :                       exp_natom*2.45e19_r8)/(0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))* &
    1132             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*2.45e19_r8)/ &
    1133           0 :                       (0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))**2._r8))
    1134             :           aterm(:) = (2.0e-22_r8*exp_natom*m(:,k))/(1._r8+((2.0e-22_r8* &
    1135             :                       exp_natom*m(:,k))/(0.43_r8*(298._r8*tinv(:))**8._r8)))* &
    1136             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*m(:,k))/ &
    1137           0 :                       (0.43_r8*(298._r8*tinv(:))**8._r8)))**2._r8))
    1138           0 :           call comp_exp( exp_fac, 360._r8*tinv, ncol )
    1139           0 :           rxt(:,k,usr_ISOPB1O2_NOn_ndx) = 2.7e-12_r8 * exp_fac(:)*aterm(:)/(aterm(:)+acorr*nyield)
    1140             :           rxt(:,k,usr_ISOPB1O2_NOa_ndx) = 2.7e-12_r8 * exp_fac(:)*acorr*nyield/(aterm(:)+acorr*nyield)
    1141             :        end if
    1142             : !-----------------------------------------------------------------
    1143             : !       ... ISOPB4O2_NOn Temp/Pressure Dependent Nitrate Yield
    1144             : !-----------------------------------------------------------------
    1145           0 :        if( usr_ISOPB4O2_NOn_ndx > 0 ) then
    1146           0 :           nyield = (1._r8-0.13_r8)/0.13_r8
    1147           0 :           natom = 6.0_r8
    1148           0 :           exp_natom = exp( natom )
    1149             :           acorr = (2.0e-22_r8*exp_natom*2.45e19_r8)/(1._r8+((2.0e-22_r8* &
    1150             :                       exp_natom*2.45e19_r8)/(0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))* &
    1151             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*2.45e19_r8)/ &
    1152           0 :                       (0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))**2._r8))
    1153             :           aterm(:) = (2.0e-22_r8*exp_natom*m(:,k))/(1._r8+((2.0e-22_r8* &
    1154             :                       exp_natom*m(:,k))/(0.43_r8*(298._r8*tinv(:))**8._r8)))* &
    1155             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*m(:,k))/ &
    1156           0 :                       (0.43_r8*(298._r8*tinv(:))**8._r8)))**2._r8))
    1157           0 :           call comp_exp( exp_fac, 360._r8*tinv, ncol )
    1158           0 :           rxt(:,k,usr_ISOPB4O2_NOn_ndx) = 2.7e-12_r8 * exp_fac(:)*aterm(:)/(aterm(:)+acorr*nyield)
    1159             :           rxt(:,k,usr_ISOPB4O2_NOa_ndx) = 2.7e-12_r8 * exp_fac(:)*acorr*nyield/(aterm(:)+acorr*nyield)
    1160             :        end if
    1161             : !-----------------------------------------------------------------
    1162             : !       ... ISOPED1O2_NOn Temp/Pressure Dependent Nitrate Yield
    1163             : !-----------------------------------------------------------------
    1164           0 :        if( usr_ISOPED1O2_NOn_ndx > 0 ) then
    1165           0 :           nyield = (1._r8-0.12_r8)/0.12_r8
    1166           0 :           natom = 6.0_r8
    1167           0 :           exp_natom = exp( natom )
    1168             :           acorr = (2.0e-22_r8*exp_natom*2.45e19_r8)/(1._r8+((2.0e-22_r8* &
    1169             :                       exp_natom*2.45e19_r8)/(0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))* &
    1170             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*2.45e19_r8)/ &
    1171           0 :                       (0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))**2._r8))
    1172             :           aterm(:) = (2.0e-22_r8*exp_natom*m(:,k))/(1._r8+((2.0e-22_r8* &
    1173             :                       exp_natom*m(:,k))/(0.43_r8*(298._r8*tinv(:))**8._r8)))* &
    1174             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*m(:,k))/ &
    1175           0 :                       (0.43_r8*(298._r8*tinv(:))**8._r8)))**2._r8))
    1176           0 :           call comp_exp( exp_fac, 360._r8*tinv, ncol )
    1177           0 :         rxt(:,k,usr_ISOPED1O2_NOn_ndx) = 2.7e-12_r8 * exp_fac(:)*aterm(:)/(aterm(:)+acorr*nyield)
    1178             :         rxt(:,k,usr_ISOPED1O2_NOa_ndx) = 2.7e-12_r8 * exp_fac(:)*acorr*nyield/(aterm(:)+acorr*nyield)
    1179             :        end if
    1180             : !-----------------------------------------------------------------
    1181             : !       ... ISOPED4O2_NOn Temp/Pressure Dependent Nitrate Yield
    1182             : !-----------------------------------------------------------------
    1183           0 :        if( usr_ISOPED4O2_NOn_ndx > 0 ) then
    1184           0 :           nyield = (1._r8-0.12_r8)/0.12_r8
    1185           0 :           natom = 6.0_r8
    1186           0 :           exp_natom = exp( natom )
    1187             :           acorr = (2.0e-22_r8*exp_natom*2.45e19_r8)/(1._r8+((2.0e-22_r8* &
    1188             :                       exp_natom*2.45e19_r8)/(0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))* &
    1189             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*2.45e19_r8)/ &
    1190           0 :                       (0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))**2._r8))
    1191             :           aterm(:) = (2.0e-22_r8*exp_natom*m(:,k))/(1._r8+((2.0e-22_r8* &
    1192             :                       exp_natom*m(:,k))/(0.43_r8*(298._r8*tinv(:))**8._r8)))* &
    1193             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*m(:,k))/ &
    1194           0 :                       (0.43_r8*(298._r8*tinv(:))**8._r8)))**2._r8))
    1195           0 :           call comp_exp( exp_fac, 360._r8*tinv, ncol )
    1196           0 :           rxt(:,k,usr_ISOPED4O2_NOn_ndx) = 2.7e-12_r8 * exp_fac(:)*aterm(:)/(aterm(:)+acorr*nyield)
    1197             :           rxt(:,k,usr_ISOPED4O2_NOa_ndx) = 2.7e-12_r8 * exp_fac(:)*acorr*nyield/(aterm(:)+acorr*nyield)
    1198             :        end if
    1199             : !-----------------------------------------------------------------
    1200             : !       ... ISOPZD1O2_NOn Temp/Pressure Dependent Nitrate Yield
    1201             : !-----------------------------------------------------------------
    1202           0 :        if( usr_ISOPZD1O2_NOn_ndx > 0 ) then
    1203           0 :           nyield = (1._r8-0.12_r8)/0.12_r8
    1204           0 :           natom = 6.0_r8
    1205           0 :           exp_natom = exp( natom )
    1206             :           acorr = (2.0e-22_r8*exp_natom*2.45e19_r8)/(1._r8+((2.0e-22_r8* &
    1207             :                       exp_natom*2.45e19_r8)/(0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))* &
    1208             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*2.45e19_r8)/ &
    1209           0 :                       (0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))**2._r8))
    1210             :           aterm(:) = (2.0e-22_r8*exp_natom*m(:,k))/(1._r8+((2.0e-22_r8* &
    1211             :                       exp_natom*m(:,k))/(0.43_r8*(298._r8*tinv(:))**8._r8)))* &
    1212             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*m(:,k))/ &
    1213           0 :                       (0.43_r8*(298._r8*tinv(:))**8._r8)))**2._r8))
    1214           0 :           call comp_exp( exp_fac, 360._r8*tinv, ncol )
    1215           0 :           rxt(:,k,usr_ISOPZD1O2_NOn_ndx) = 2.7e-12_r8 * exp_fac(:)*aterm(:)/(aterm(:)+acorr*nyield)
    1216             :           rxt(:,k,usr_ISOPZD1O2_NOa_ndx) = 2.7e-12_r8 * exp_fac(:)*acorr*nyield/(aterm(:)+acorr*nyield)
    1217             :        end if
    1218             : !-----------------------------------------------------------------
    1219             : !       ... ISOPZD4O2_NOn Temp/Pressure Dependent Nitrate Yield
    1220             : !-----------------------------------------------------------------
    1221           0 :        if( usr_ISOPZD4O2_NOn_ndx > 0 ) then
    1222           0 :           nyield = (1._r8-0.12_r8)/0.12_r8
    1223           0 :           natom = 6.0_r8
    1224           0 :           exp_natom = exp( natom )
    1225             :           acorr = (2.0e-22_r8*exp_natom*2.45e19_r8)/(1._r8+((2.0e-22_r8* &
    1226             :                       exp_natom*2.45e19_r8)/(0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))* &
    1227             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*2.45e19_r8)/ &
    1228           0 :                       (0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))**2._r8))
    1229             :           aterm(:) = (2.0e-22_r8*exp_natom*m(:,k))/(1._r8+((2.0e-22_r8* &
    1230             :                       exp_natom*m(:,k))/(0.43_r8*(298._r8*tinv(:))**8._r8)))* &
    1231             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*m(:,k))/ &
    1232           0 :                       (0.43_r8*(298._r8*tinv(:))**8._r8)))**2._r8))
    1233           0 :           call comp_exp( exp_fac, 360._r8*tinv, ncol )
    1234           0 :           rxt(:,k,usr_ISOPZD4O2_NOn_ndx) = 2.7e-12_r8 * exp_fac(:)*aterm(:)/(aterm(:)+acorr*nyield)
    1235             :           rxt(:,k,usr_ISOPZD4O2_NOa_ndx) = 2.7e-12_r8 * exp_fac(:)*acorr*nyield/(aterm(:)+acorr*nyield)
    1236             :        end if
    1237             : !-----------------------------------------------------------------
    1238             : !       ... ISOPNO3_NOn Temp/Pressure Dependent Nitrate Yield
    1239             : !-----------------------------------------------------------------
    1240           0 :        if( usr_ISOPNO3_NOn_ndx > 0 ) then
    1241           0 :           nyield = (1._r8-0.135_r8)/0.135_r8
    1242           0 :           natom = 9.0_r8
    1243           0 :           exp_natom = exp( natom )
    1244             :           acorr = (2.0e-22_r8*exp_natom*2.45e19_r8)/(1._r8+((2.0e-22_r8* &
    1245             :                       exp_natom*2.45e19_r8)/(0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))* &
    1246             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*2.45e19_r8)/ &
    1247           0 :                       (0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))**2._r8))
    1248             :           aterm(:) = (2.0e-22_r8*exp_natom*m(:,k))/(1._r8+((2.0e-22_r8* &
    1249             :                       exp_natom*m(:,k))/(0.43_r8*(298._r8*tinv(:))**8._r8)))* &
    1250             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*m(:,k))/ &
    1251           0 :                       (0.43_r8*(298._r8*tinv(:))**8._r8)))**2._r8))
    1252           0 :           call comp_exp( exp_fac, 360._r8*tinv, ncol )
    1253           0 :           rxt(:,k,usr_ISOPNO3_NOn_ndx) = 2.7e-12_r8 * exp_fac(:)*aterm(:)/(aterm(:)+acorr*nyield)
    1254             :           rxt(:,k,usr_ISOPNO3_NOa_ndx) = 2.7e-12_r8 * exp_fac(:)*acorr*nyield/(aterm(:)+acorr*nyield)
    1255             :        end if
    1256             : !-----------------------------------------------------------------
    1257             : !       ... MVKO2_NOn Temp/Pressure Dependent Nitrate Yield
    1258             : !-----------------------------------------------------------------
    1259           0 :        if( usr_MVKO2_NOn_ndx > 0 ) then
    1260           0 :           nyield = (1._r8-0.04_r8)/0.04_r8
    1261           0 :           natom = 6.0_r8
    1262           0 :           exp_natom = exp( natom )
    1263             :           acorr = (2.0e-22_r8*exp_natom*2.45e19_r8)/(1._r8+((2.0e-22_r8* &
    1264             :                       exp_natom*2.45e19_r8)/(0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))* &
    1265             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*2.45e19_r8)/ &
    1266           0 :                       (0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))**2._r8))
    1267             :           aterm(:) = (2.0e-22_r8*exp_natom*m(:,k))/(1._r8+((2.0e-22_r8* &
    1268             :                       exp_natom*m(:,k))/(0.43_r8*(298._r8*tinv(:))**8._r8)))* &
    1269             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*m(:,k))/ &
    1270           0 :                       (0.43_r8*(298._r8*tinv(:))**8._r8)))**2._r8))
    1271           0 :           call comp_exp( exp_fac, 360._r8*tinv, ncol )
    1272           0 :           rxt(:,k,usr_MVKO2_NOn_ndx) = 2.7e-12_r8 * exp_fac(:)*aterm(:)/(aterm(:)+acorr*nyield)
    1273             :           rxt(:,k,usr_MVKO2_NOa_ndx) = 2.7e-12_r8 * exp_fac(:)*acorr*nyield/(aterm(:)+acorr*nyield)
    1274             :        end if
    1275             : !-----------------------------------------------------------------
    1276             : !       ... MACRO2_NOn Temp/Pressure Dependent Nitrate Yield
    1277             : !-----------------------------------------------------------------
    1278           0 :        if( usr_MACRO2_NOn_ndx > 0 ) then
    1279           0 :           nyield = (1._r8-0.06_r8)/0.06_r8
    1280           0 :           natom = 6.0_r8
    1281           0 :           exp_natom = exp( natom )
    1282             :           acorr = (2.0e-22_r8*exp_natom*2.45e19_r8)/(1._r8+((2.0e-22_r8* &
    1283             :                       exp_natom*2.45e19_r8)/(0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))* &
    1284             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*2.45e19_r8)/ &
    1285           0 :                       (0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))**2._r8))
    1286             :           aterm(:) = (2.0e-22_r8*exp_natom*m(:,k))/(1._r8+((2.0e-22_r8* &
    1287             :                       exp_natom*m(:,k))/(0.43_r8*(298._r8*tinv(:))**8._r8)))* &
    1288             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*m(:,k))/ &
    1289           0 :                       (0.43_r8*(298._r8*tinv(:))**8._r8)))**2._r8))
    1290           0 :           call comp_exp( exp_fac, 360._r8*tinv, ncol )
    1291           0 :         rxt(:,k,usr_MACRO2_NOn_ndx) = 2.7e-12_r8 * exp_fac(:)*aterm(:)/(aterm(:)+acorr*nyield)
    1292             :         rxt(:,k,usr_MACRO2_NOa_ndx) = 2.7e-12_r8 * exp_fac(:)*acorr*nyield/(aterm(:)+acorr*nyield)
    1293             :        end if
    1294             : !-----------------------------------------------------------------
    1295             : !       ... IEPOXOO_NOn Temp/Pressure Dependent Nitrate Yield
    1296             : !-----------------------------------------------------------------
    1297           0 :        if( usr_IEPOXOO_NOn_ndx > 0 ) then
    1298           0 :           nyield = (1._r8-0.025_r8)/0.025_r8
    1299           0 :           natom = 8.0_r8
    1300           0 :           exp_natom = exp( natom )
    1301             :           acorr = (2.0e-22_r8*exp_natom*2.45e19_r8)/(1._r8+((2.0e-22_r8* &
    1302             :                       exp_natom*2.45e19_r8)/(0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))* &
    1303             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*2.45e19_r8)/ &
    1304           0 :                       (0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))**2._r8))
    1305             :           aterm(:) = (2.0e-22_r8*exp_natom*m(:,k))/(1._r8+((2.0e-22_r8* &
    1306             :                       exp_natom*m(:,k))/(0.43_r8*(298._r8*tinv(:))**8._r8)))* &
    1307             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*m(:,k))/ &
    1308           0 :                       (0.43_r8*(298._r8*tinv(:))**8._r8)))**2._r8))
    1309           0 :           call comp_exp( exp_fac, 360._r8*tinv, ncol )
    1310           0 :           rxt(:,k,usr_IEPOXOO_NOn_ndx) = 2.7e-12_r8 * exp_fac(:)*aterm(:)/(aterm(:)+acorr*nyield)
    1311             :           rxt(:,k,usr_IEPOXOO_NOa_ndx) = 2.7e-12_r8 * exp_fac(:)*acorr*nyield/(aterm(:)+acorr*nyield)
    1312             :        end if
    1313             : !-----------------------------------------------------------------
    1314             : !       ... ISOPN1DO2_NOn Temp/Pressure Dependent Nitrate Yield
    1315             : !-----------------------------------------------------------------
    1316           0 :        if( usr_ISOPN1DO2_NOn_ndx > 0 ) then
    1317           0 :           nyield = (1._r8-0.084_r8)/0.084_r8
    1318           0 :           natom = 11.0_r8
    1319           0 :           exp_natom = exp( natom )
    1320             :           acorr = (2.0e-22_r8*exp_natom*2.45e19_r8)/(1._r8+((2.0e-22_r8* &
    1321             :                       exp_natom*2.45e19_r8)/(0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))* &
    1322             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*2.45e19_r8)/ &
    1323           0 :                       (0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))**2._r8))
    1324             :           aterm(:) = (2.0e-22_r8*exp_natom*m(:,k))/(1._r8+((2.0e-22_r8* &
    1325             :                       exp_natom*m(:,k))/(0.43_r8*(298._r8*tinv(:))**8._r8)))* &
    1326             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*m(:,k))/ &
    1327           0 :                       (0.43_r8*(298._r8*tinv(:))**8._r8)))**2._r8))
    1328           0 :           call comp_exp( exp_fac, 360._r8*tinv, ncol )
    1329           0 :           rxt(:,k,usr_ISOPN1DO2_NOn_ndx) = 2.7e-12_r8 * exp_fac(:)*aterm(:)/(aterm(:)+acorr*nyield)
    1330             :           rxt(:,k,usr_ISOPN1DO2_NOa_ndx) = 2.7e-12_r8 * exp_fac(:)*acorr*nyield/(aterm(:)+acorr*nyield)
    1331             :        end if
    1332             : !-----------------------------------------------------------------
    1333             : !       ... ISOPN2BO2_NOn Temp/Pressure Dependent Nitrate Yield
    1334             : !-----------------------------------------------------------------
    1335           0 :        if( usr_ISOPN2BO2_NOn_ndx > 0 ) then
    1336           0 :           nyield = (1._r8-0.065_r8)/0.065_r8
    1337           0 :           natom = 11.0_r8
    1338           0 :           exp_natom = exp( natom )
    1339             :           acorr = (2.0e-22_r8*exp_natom*2.45e19_r8)/(1._r8+((2.0e-22_r8* &
    1340             :                       exp_natom*2.45e19_r8)/(0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))* &
    1341             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*2.45e19_r8)/ &
    1342           0 :                       (0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))**2._r8))
    1343             :           aterm(:) = (2.0e-22_r8*exp_natom*m(:,k))/(1._r8+((2.0e-22_r8* &
    1344             :                       exp_natom*m(:,k))/(0.43_r8*(298._r8*tinv(:))**8._r8)))* &
    1345             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*m(:,k))/ &
    1346           0 :                       (0.43_r8*(298._r8*tinv(:))**8._r8)))**2._r8))
    1347           0 :           call comp_exp( exp_fac, 360._r8*tinv, ncol )
    1348           0 :         rxt(:,k,usr_ISOPN2BO2_NOn_ndx) = 2.7e-12_r8 * exp_fac(:)*aterm(:)/(aterm(:)+acorr*nyield)
    1349             :         rxt(:,k,usr_ISOPN2BO2_NOa_ndx) = 2.7e-12_r8 * exp_fac(:)*acorr*nyield/(aterm(:)+acorr*nyield)
    1350             :        end if
    1351             : !-----------------------------------------------------------------
    1352             : !       ... ISOPN3BO2_NOn Temp/Pressure Dependent Nitrate Yield
    1353             : !-----------------------------------------------------------------
    1354           0 :        if( usr_ISOPN3BO2_NOn_ndx > 0 ) then
    1355           0 :           nyield = (1._r8-0.053_r8)/0.053_r8
    1356           0 :           natom = 11.0_r8
    1357           0 :           exp_natom = exp( natom )
    1358             :           acorr = (2.0e-22_r8*exp_natom*2.45e19_r8)/(1._r8+((2.0e-22_r8* &
    1359             :                       exp_natom*2.45e19_r8)/(0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))* &
    1360             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*2.45e19_r8)/ &
    1361           0 :                       (0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))**2._r8))
    1362             :           aterm(:) = (2.0e-22_r8*exp_natom*m(:,k))/(1._r8+((2.0e-22_r8* &
    1363             :                       exp_natom*m(:,k))/(0.43_r8*(298._r8*tinv(:))**8._r8)))* &
    1364             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*m(:,k))/ &
    1365           0 :                       (0.43_r8*(298._r8*tinv(:))**8._r8)))**2._r8))
    1366           0 :           call comp_exp( exp_fac, 360._r8*tinv, ncol )
    1367           0 :           rxt(:,k,usr_ISOPN3BO2_NOn_ndx) = 2.7e-12_r8 * exp_fac(:)*aterm(:)/(aterm(:)+acorr*nyield)
    1368             :           rxt(:,k,usr_ISOPN3BO2_NOa_ndx) = 2.7e-12_r8 * exp_fac(:)*acorr*nyield/(aterm(:)+acorr*nyield)
    1369             :        end if
    1370             : !-----------------------------------------------------------------
    1371             : !       ... ISOPN4DO2_NOn Temp/Pressure Dependent Nitrate Yield
    1372             : !-----------------------------------------------------------------
    1373           0 :        if( usr_ISOPN4DO2_NOn_ndx > 0 ) then
    1374           0 :           nyield = (1._r8-0.165_r8)/0.165_r8
    1375           0 :           natom = 11.0_r8
    1376           0 :           exp_natom = exp( natom )
    1377             :           acorr = (2.0e-22_r8*exp_natom*2.45e19_r8)/(1._r8+((2.0e-22_r8* &
    1378             :                       exp_natom*2.45e19_r8)/(0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))* &
    1379             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*2.45e19_r8)/ &
    1380           0 :                       (0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))**2._r8))
    1381             :           aterm(:) = (2.0e-22_r8*exp_natom*m(:,k))/(1._r8+((2.0e-22_r8* &
    1382             :                       exp_natom*m(:,k))/(0.43_r8*(298._r8*tinv(:))**8._r8)))* &
    1383             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*m(:,k))/ &
    1384           0 :                       (0.43_r8*(298._r8*tinv(:))**8._r8)))**2._r8))
    1385           0 :           call comp_exp( exp_fac, 360._r8*tinv, ncol )
    1386           0 :           rxt(:,k,usr_ISOPN4DO2_NOn_ndx) = 2.7e-12_r8 * exp_fac(:)*aterm(:)/(aterm(:)+acorr*nyield)
    1387             :           rxt(:,k,usr_ISOPN4DO2_NOa_ndx) = 2.7e-12_r8 * exp_fac(:)*acorr*nyield/(aterm(:)+acorr*nyield)
    1388             :        end if
    1389             : !-----------------------------------------------------------------
    1390             : !       ... ISOPNBNO3O2_NOn Temp/Pressure Dependent Nitrate Yield
    1391             : !-----------------------------------------------------------------
    1392           0 :        if( usr_ISOPNBNO3O2_NOn_ndx > 0 ) then
    1393           0 :           nyield = (1._r8-0.203_r8)/0.203_r8
    1394           0 :           natom = 11.0_r8
    1395           0 :           exp_natom = exp( natom )
    1396             :           acorr = (2.0e-22_r8*exp_natom*2.45e19_r8)/(1._r8+((2.0e-22_r8* &
    1397             :                       exp_natom*2.45e19_r8)/(0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))* &
    1398             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*2.45e19_r8)/ &
    1399           0 :                       (0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))**2._r8))
    1400             :           aterm(:) = (2.0e-22_r8*exp_natom*m(:,k))/(1._r8+((2.0e-22_r8* &
    1401             :                       exp_natom*m(:,k))/(0.43_r8*(298._r8*tinv(:))**8._r8)))* &
    1402             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*m(:,k))/ &
    1403           0 :                       (0.43_r8*(298._r8*tinv(:))**8._r8)))**2._r8))
    1404           0 :           call comp_exp( exp_fac, 360._r8*tinv, ncol )
    1405           0 :           rxt(:,k,usr_ISOPNBNO3O2_NOn_ndx) = 2.7e-12_r8 * exp_fac(:)*aterm(:)/(aterm(:)+acorr*nyield)
    1406             :           rxt(:,k,usr_ISOPNBNO3O2_NOa_ndx) = 2.7e-12_r8 * exp_fac(:)*acorr*nyield/(aterm(:)+acorr*nyield)
    1407             :        end if
    1408             : !-----------------------------------------------------------------
    1409             : !       ... ISOPNOOHBO2_NOn Temp/Pressure Dependent Nitrate Yield
    1410             : !-----------------------------------------------------------------
    1411           0 :        if( usr_ISOPNOOHBO2_NOn_ndx > 0 ) then
    1412           0 :           nyield = (1._r8-0.141_r8)/0.141_r8
    1413           0 :           natom = 12.0_r8
    1414           0 :           exp_natom = exp( natom )
    1415             :           acorr = (2.0e-22_r8*exp_natom*2.45e19_r8)/(1._r8+((2.0e-22_r8* &
    1416             :                       exp_natom*2.45e19_r8)/(0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))* &
    1417             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*2.45e19_r8)/ &
    1418           0 :                       (0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))**2._r8))
    1419             :           aterm(:) = (2.0e-22_r8*exp_natom*m(:,k))/(1._r8+((2.0e-22_r8* &
    1420             :                       exp_natom*m(:,k))/(0.43_r8*(298._r8*tinv(:))**8._r8)))* &
    1421             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*m(:,k))/ &
    1422           0 :                       (0.43_r8*(298._r8*tinv(:))**8._r8)))**2._r8))
    1423           0 :           call comp_exp( exp_fac, 360._r8*tinv, ncol )
    1424           0 :           rxt(:,k,usr_ISOPNOOHBO2_NOn_ndx) = 2.7e-12_r8 * exp_fac(:)*aterm(:)/(aterm(:)+acorr*nyield)
    1425             :           rxt(:,k,usr_ISOPNOOHBO2_NOa_ndx) = 2.7e-12_r8 * exp_fac(:)*acorr*nyield/(aterm(:)+acorr*nyield)
    1426             :        end if
    1427             : !-----------------------------------------------------------------
    1428             : !       ... ISOPNOOHDO2_NOn Temp/Pressure Dependent Nitrate Yield
    1429             : !-----------------------------------------------------------------
    1430           0 :        if( usr_ISOPNOOHDO2_NOn_ndx > 0 ) then
    1431           0 :           nyield = (1._r8-0.045_r8)/0.045_r8
    1432           0 :           natom = 12.0_r8
    1433           0 :           exp_natom = exp( natom )
    1434             :           acorr = (2.0e-22_r8*exp_natom*2.45e19_r8)/(1._r8+((2.0e-22_r8* &
    1435             :                       exp_natom*2.45e19_r8)/(0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))* &
    1436             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*2.45e19_r8)/ &
    1437           0 :                       (0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))**2._r8))
    1438             :           aterm(:) = (2.0e-22_r8*exp_natom*m(:,k))/(1._r8+((2.0e-22_r8* &
    1439             :                       exp_natom*m(:,k))/(0.43_r8*(298._r8*tinv(:))**8._r8)))* &
    1440             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*m(:,k))/ &
    1441           0 :                       (0.43_r8*(298._r8*tinv(:))**8._r8)))**2._r8))
    1442           0 :           call comp_exp( exp_fac, 360._r8*tinv, ncol )
    1443           0 :           rxt(:,k,usr_ISOPNOOHDO2_NOn_ndx) = 2.7e-12_r8 * exp_fac(:)*aterm(:)/(aterm(:)+acorr*nyield)
    1444             :           rxt(:,k,usr_ISOPNOOHDO2_NOa_ndx) = 2.7e-12_r8 * exp_fac(:)*acorr*nyield/(aterm(:)+acorr*nyield)
    1445             :        end if
    1446             : !-----------------------------------------------------------------
    1447             : !       ... NC4CHOO2_NOn Temp/Pressure Dependent Nitrate Yield
    1448             : !-----------------------------------------------------------------
    1449           0 :        if( usr_NC4CHOO2_NOn_ndx > 0 ) then
    1450           0 :           nyield = (1._r8-0.021_r8)/0.021_r8
    1451           0 :           natom = 11.0_r8
    1452           0 :           exp_natom = exp( natom )
    1453             :           acorr = (2.0e-22_r8*exp_natom*2.45e19_r8)/(1._r8+((2.0e-22_r8* &
    1454             :                       exp_natom*2.45e19_r8)/(0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))* &
    1455             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*2.45e19_r8)/ &
    1456           0 :                       (0.43_r8*(298._r8*(1._r8/293._r8))**8._r8)))**2._r8))
    1457             :           aterm(:) = (2.0e-22_r8*exp_natom*m(:,k))/(1._r8+((2.0e-22_r8* &
    1458             :                       exp_natom*m(:,k))/(0.43_r8*(298._r8*tinv(:))**8._r8)))* &
    1459             :                       0.41_r8**(1._r8/(1._r8+(log10((2.0e-22_r8*exp_natom*m(:,k))/ &
    1460           0 :                       (0.43_r8*(298._r8*tinv(:))**8._r8)))**2._r8))
    1461           0 :           call comp_exp( exp_fac, 360._r8*tinv, ncol )
    1462           0 :           rxt(:,k,usr_NC4CHOO2_NOn_ndx) = 2.7e-12_r8 * exp_fac(:)*aterm(:)/(aterm(:)+acorr*nyield)
    1463             :           rxt(:,k,usr_NC4CHOO2_NOa_ndx) = 2.7e-12_r8 * exp_fac(:)*acorr*nyield/(aterm(:)+acorr*nyield)
    1464             :        end if
    1465             : !
    1466             : ! reduced hydrocarbon scheme
    1467             : !
    1468           0 :        if ( usr_C2O3_NO2_ndx > 0 ) then
    1469           0 :           ko(:)   = 2.6e-28_r8 * m(:,k)
    1470           0 :           kinf(:) = 1.2e-11_r8
    1471           0 :           rxt(:,k,usr_C2O3_NO2_ndx) = (ko/(1._r8+ko/kinf)) * 0.6_r8**(1._r8/(1._r8+(log10(ko/kinf))**2))
    1472             :        end if
    1473           0 :        if ( usr_C2O3_XNO2_ndx > 0 ) then
    1474           0 :           ko(:)   = 2.6e-28_r8 * m(:,k)
    1475           0 :           kinf(:) = 1.2e-11_r8
    1476           0 :           rxt(:,k,usr_C2O3_XNO2_ndx) = (ko/(1._r8+ko/kinf)) * 0.6_r8**(1._r8/(1._r8+(log10(ko/kinf))**2))
    1477             :        end if
    1478           0 :        if ( usr_C2H4_OH_ndx > 0 ) then
    1479           0 :           ko(:)   = 1.0e-28_r8 * m(:,k)
    1480           0 :           kinf(:) = 8.8e-12_r8
    1481           0 :           rxt(:,k,usr_C2H4_OH_ndx) = (ko/(1._r8+ko/kinf)) * 0.6_r8**(1._r8/(1._r8+(log(ko/kinf))**2))
    1482             :        end if
    1483           0 :        if ( usr_XO2N_HO2_ndx > 0 ) then
    1484           0 :           rxt(:,k,usr_XO2N_HO2_ndx) = rxt(:,k,tag_XO2N_NO_ndx)*rxt(:,k,tag_XO2_HO2_ndx)/(rxt(:,k,tag_XO2_NO_ndx)+1.e-36_r8)
    1485             :        end if
    1486             : 
    1487             : !
    1488             : ! hydrolysis reactions on wetted aerosols
    1489             : !
    1490             :        if( usr_NO2_aer_ndx > 0 .or. usr_NO3_aer_ndx > 0 .or. usr_N2O5_aer_ndx > 0 .or. usr_HO2_aer_ndx > 0 &
    1491           0 :          .or. usr_GLYOXAL_aer_ndx > 0 ) then
    1492             : 
    1493           0 :           long_loop : do i = 1,ncol
    1494             : 
    1495           0 :              sfc    => sfc_array(i,k,:)
    1496           0 :              dm_aer => dm_array(i,k,:)
    1497             : 
    1498           0 :              c_n2o5 = 1.40e3_r8 * sqrt_t(i)         ! mean molecular speed of n2o5
    1499           0 :              c_no3  = 1.85e3_r8 * sqrt_t(i)         ! mean molecular speed of no3
    1500           0 :              c_no2  = 2.15e3_r8 * sqrt_t(i)         ! mean molecular speed of no2
    1501           0 :              c_ho2  = 2.53e3_r8 * sqrt_t(i)         ! mean molecular speed of ho2
    1502           0 :              c_glyoxal = 1.455e4_r8 * sqrt_t_58(i)  ! mean molecular speed of ho2
    1503           0 :              c_isopnita = 1.20e3_r8 * sqrt_t(i)         ! mean molecular speed of isopnita
    1504           0 :              c_isopnitb = 1.20e3_r8 * sqrt_t(i)         ! mean molecular speed of isopnitb
    1505           0 :              c_onitr    = 1.20e3_r8 * sqrt_t(i)         ! mean molecular speed of onitr
    1506           0 :              c_honitr   = 1.26e3_r8 * sqrt_t(i)         ! mean molecular speed of honitr
    1507           0 :              c_terpnit  = 0.992e3_r8 * sqrt_t(i)        ! mean molecular speed of terpnit
    1508           0 :              c_nterpooh = 0.957e3_r8 * sqrt_t(i)        ! mean molecular speed of nterpooh
    1509           0 :              c_nc4cho   = 1.21e3_r8 * sqrt_t(i)         ! mean molecular speed of nc4cho
    1510           0 :              c_nc4ch2oh = 1.20e3_r8 * sqrt_t(i)         ! mean molecular speed of nc4ch2oh
    1511           0 :              c_isopfdn  = 9.68e2_r8 * sqrt_t(i)         ! mean molecular speed of isopfdn
    1512           0 :              c_isopfnp  = 1.04e3_r8 * sqrt_t(i)         ! mean molecular speed of isopfnp
    1513           0 :              c_isopn2b  = 1.20e3_r8 * sqrt_t(i)         ! mean molecular speed of isopn2
    1514           0 :              c_isopn1d  = 1.20e3_r8 * sqrt_t(i)         ! mean molecular speed of isopn1d
    1515           0 :              c_isopn4d  = 1.20e3_r8 * sqrt_t(i)         ! mean molecular speed of isopn4d
    1516           0 :              c_inoohd   = 1.14e3_r8 * sqrt_t(i)         ! mean molecular speed of inoohd
    1517           0 :              c_inheb    = 1.14e3_r8 * sqrt_t(i)         ! mean molecular speed of inheb
    1518           0 :              c_inhed    = 1.14e3_r8 * sqrt_t(i)         ! mean molecular speed of inhed
    1519           0 :              c_macrn    = 1.19e3_r8 * sqrt_t(i)         ! mean molecular speed of macrn
    1520           0 :              c_isophfp  = 1.19e3_r8 * sqrt_t(i)         ! mean molecular speed of isophfp
    1521           0 :              c_iepox    = 1.34e3_r8 * sqrt_t(i)         ! mean molecular speed of iepox
    1522           0 :              c_dhpmpal  = 1.24e3_r8 * sqrt_t(i)         ! mean molecular speed of dhpmpal
    1523           0 :              c_iche     = 1.35e3_r8 * sqrt_t(i)         ! mean molecular speed of iche
    1524           0 :              c_isopfnc  = 1.04e3_r8 * sqrt_t(i)         ! mean molecular speed of isopfnc
    1525           0 :              c_isopfdnc = 9.72e2_r8 * sqrt_t(i)         ! mean molecular speed of isopfdnc
    1526           0 :              c_terpnt   = 9.92e2_r8 * sqrt_t(i)         ! mean molecular speed of terpnt
    1527           0 :              c_terpnt1  = 9.92e2_r8 * sqrt_t(i)         ! mean molecular speed of terpnt1
    1528           0 :              c_terpnpt  = 9.57e2_r8 * sqrt_t(i)         ! mean molecular speed of terpnpt
    1529           0 :              c_terpnpt1 = 9.57e2_r8 * sqrt_t(i)         ! mean molecular speed of terpnpt1
    1530           0 :              c_terpfdn  = 8.48e2_r8 * sqrt_t(i)         ! mean molecular speed of terpfdn
    1531           0 :              c_sqtn     = 8.64e2_r8 * sqrt_t(i)         ! mean molecular speed of sqtn
    1532           0 :              c_terphfn  = 8.93e2_r8 * sqrt_t(i)         ! mean molecular speed of terphfn
    1533           0 :              c_terpdhdp = 9.47e2_r8 * sqrt_t(i)         ! mean molecular speed of terpdhdp
    1534           0 :              c_terpacid = 1.07e3_r8 * sqrt_t(i)         ! mean molecular speed of terpacid
    1535             :              !-------------------------------------------------------------------------
    1536             :              !  Heterogeneous reaction rates for uptake of a gas on an aerosol:
    1537             :              !    rxt = sfc / ( (rad_aer/Dg_gas) + (4/(c_gas*gamma_gas)))
    1538             :              !-------------------------------------------------------------------------
    1539             :              !-------------------------------------------------------------------------
    1540             :              !  ... n2o5 -> 2 hno3  (on sulfate, nh4no3, oc2, soa)
    1541             :              !-------------------------------------------------------------------------
    1542           0 :              if( usr_N2O5_aer_ndx > 0 ) then
    1543           0 :                 rxt(i,k,usr_N2O5_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_n2o5, gamma_n2o5 )
    1544             :              end if
    1545           0 :              if( usr_XNO2NO3_aer_ndx > 0 ) then
    1546           0 :                 rxt(i,k,usr_XNO2NO3_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_n2o5, gamma_n2o5 )
    1547             :              end if
    1548           0 :              if( usr_NO2XNO3_aer_ndx > 0 ) then
    1549           0 :                 rxt(i,k,usr_NO2XNO3_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_n2o5, gamma_n2o5 )
    1550             :              end if
    1551             :              !-------------------------------------------------------------------------
    1552             :              !  ... no3 -> hno3  (on sulfate, nh4no3, oc, soa)
    1553             :              !-------------------------------------------------------------------------
    1554           0 :              if( usr_NO3_aer_ndx > 0 ) then
    1555           0 :                 rxt(i,k,usr_NO3_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_no3, gamma_no3 )
    1556             :              end if
    1557           0 :              if( usr_XNO3_aer_ndx > 0 ) then
    1558           0 :                 rxt(i,k,usr_XNO3_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_no3, gamma_no3 )
    1559             :              end if
    1560             :              !-------------------------------------------------------------------------
    1561             :              !  ... no2 -> 0.5 * (ho+no+hno3)  (on sulfate, nh4no3, oc2, soa)
    1562             :              !-------------------------------------------------------------------------
    1563           0 :              if( usr_NO2_aer_ndx > 0 ) then
    1564           0 :                 rxt(i,k,usr_NO2_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_no2, gamma_no2 )
    1565             :              end if
    1566           0 :              if( usr_XNO2_aer_ndx > 0 ) then
    1567           0 :                 rxt(i,k,usr_XNO2_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_no2, gamma_no2 )
    1568             :              end if
    1569             : 
    1570             :              !-------------------------------------------------------------------------
    1571             :              !  ... ho2 -> 0.5 * h2o2  (on sulfate, nh4no3, oc2, soa)
    1572             :              !-------------------------------------------------------------------------
    1573           0 :              if( usr_HO2_aer_ndx > 0 ) then
    1574           0 :                 rxt(i,k,usr_HO2_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_ho2, gamma_ho2 )
    1575             :              end if
    1576             :              !-------------------------------------------------------------------------
    1577             :              !  ... glyoxal ->  soag1  (on sulfate, nh4no3, oc2, soa)
    1578             :              ! first order uptake, Fuchs and Sutugin, 1971,  dCg = 1/4 * gamma * ! A * |v_mol| * Cg * dt
    1579             :              !-------------------------------------------------------------------------
    1580           0 :              if( usr_GLYOXAL_aer_ndx > 0 ) then
    1581           0 :                 rxt(i,k,usr_GLYOXAL_aer_ndx) = hetrxtrate_gly( sfc, c_glyoxal, gamma_glyoxal )
    1582             :              end if
    1583             :              !-------------------------------------------------------------------------
    1584             :              !  ... ISOPNITA -> HNO3  (on sulfate, nh4no3, oc2, soa)
    1585             :              !-------------------------------------------------------------------------
    1586           0 :              if( usr_ISOPNITA_aer_ndx > 0 ) then
    1587           0 :                 rxt(i,k,usr_ISOPNITA_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_isopnita, gamma_isopnita )
    1588             :              end if
    1589             :              !-------------------------------------------------------------------------
    1590             :              !  ... ISOPNITB -> HNO3  (on sulfate, nh4no3, oc2, soa)
    1591             :              !-------------------------------------------------------------------------
    1592           0 :              if( usr_ISOPNITB_aer_ndx > 0 ) then
    1593           0 :                 rxt(i,k,usr_ISOPNITB_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_isopnitb, gamma_isopnitb )
    1594             :              end if
    1595             :              !-------------------------------------------------------------------------
    1596             :              !  ...  ONITR -> HNO3 (on sulfate, nh4no3, oc2, soa)
    1597             :              !-------------------------------------------------------------------------
    1598           0 :              if( usr_ONITR_aer_ndx > 0 ) then
    1599           0 :                 rxt(i,k,usr_ONITR_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_onitr, gamma_onitr )
    1600             :              end if
    1601             :              !-------------------------------------------------------------------------
    1602             :              !  ... HONITR -> HNO3  (on sulfate, nh4no3, oc2, soa)
    1603             :              !-------------------------------------------------------------------------
    1604           0 :              if( usr_HONITR_aer_ndx > 0 ) then
    1605           0 :                 rxt(i,k,usr_HONITR_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_honitr, gamma_honitr )
    1606             :              end if
    1607             :              !-------------------------------------------------------------------------
    1608             :              !  ... TERPNIT -> HNO3  (on sulfate, nh4no3, oc2, soa)
    1609             :              !-------------------------------------------------------------------------
    1610           0 :              if( usr_TERPNIT_aer_ndx > 0 ) then
    1611           0 :                 rxt(i,k,usr_TERPNIT_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_terpnit, gamma_terpnit )
    1612             :              end if
    1613             :              !-------------------------------------------------------------------------
    1614             :              !  ...  NTERPOOH -> HNO3 (on sulfate, nh4no3, oc2, soa)
    1615             :              !-------------------------------------------------------------------------
    1616           0 :              if( usr_NTERPOOH_aer_ndx > 0 ) then
    1617           0 :                 rxt(i,k,usr_NTERPOOH_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_nterpooh, gamma_nterpooh )
    1618             :              end if
    1619             :              !-------------------------------------------------------------------------
    1620             :              !  ...  NC4CHO -> HNO3 (on sulfate, nh4no3, oc2, soa)
    1621             :              !-------------------------------------------------------------------------
    1622           0 :              if( usr_NC4CHO_aer_ndx > 0 ) then
    1623           0 :                 rxt(i,k,usr_NC4CHO_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_nc4cho, gamma_nc4cho )
    1624             :              end if
    1625             :              !-------------------------------------------------------------------------
    1626             :              !  ...  NC4CH2OH -> HNO3 (on sulfate, nh4no3, oc2, soa)
    1627             :              !-------------------------------------------------------------------------
    1628           0 :              if( usr_NC4CH2OH_aer_ndx > 0 ) then
    1629           0 :                 rxt(i,k,usr_NC4CH2OH_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_nc4ch2oh, gamma_nc4ch2oh )
    1630             :              end if
    1631             :              !-------------------------------------------------------------------------
    1632             :              !  ...  ISOPFDN -> HNO3 (on sulfate, nh4no3, oc2, soa)
    1633             :              !-------------------------------------------------------------------------
    1634           0 :              if( usr_ISOPFDN_aer_ndx > 0 ) then
    1635           0 :                 rxt(i,k,usr_ISOPFDN_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_isopfdn, gamma_isopfdn )
    1636             :              end if
    1637             :              !-------------------------------------------------------------------------
    1638             :              !  ...  ISOPFNP ->  (on sulfate, nh4no3, oc2, soa)
    1639             :              !-------------------------------------------------------------------------
    1640           0 :              if( usr_ISOPFNP_aer_ndx > 0 ) then
    1641           0 :                 rxt(i,k,usr_ISOPFNP_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_isopfnp, gamma_isopfnp )
    1642             :              end if
    1643             :              !-------------------------------------------------------------------------
    1644             :              !  ...  ISOPN2B -> HNO3 (on sulfate, nh4no3, oc2, soa)
    1645             :              !-------------------------------------------------------------------------
    1646           0 :              if( usr_ISOPN2B_aer_ndx > 0 ) then
    1647           0 :                 rxt(i,k,usr_ISOPN2B_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_isopn2b, gamma_isopn2b )
    1648             :              end if
    1649             :              !-------------------------------------------------------------------------
    1650             :              !  ...  ISOPN1D -> HNO3 (on sulfate, nh4no3, oc2, soa)
    1651             :              !-------------------------------------------------------------------------
    1652           0 :              if( usr_ISOPN1D_aer_ndx > 0 ) then
    1653           0 :                 rxt(i,k,usr_ISOPN1D_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_isopn1d, gamma_isopn1d )
    1654             :              end if
    1655             :              !-------------------------------------------------------------------------
    1656             :              !  ...  ISOPN4D -> HNO3 (on sulfate, nh4no3, oc2, soa)
    1657             :              !-------------------------------------------------------------------------
    1658           0 :              if( usr_ISOPN4D_aer_ndx > 0 ) then
    1659           0 :                 rxt(i,k,usr_ISOPN4D_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_isopn4d, gamma_isopn4d )
    1660             :              end if
    1661             :              !-------------------------------------------------------------------------
    1662             :              !  ...  INOOHD -> HNO3 (on sulfate, nh4no3, oc2, soa)
    1663             :              !-------------------------------------------------------------------------
    1664           0 :              if( usr_INOOHD_aer_ndx > 0 ) then
    1665           0 :                 rxt(i,k,usr_INOOHD_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_inoohd, gamma_inoohd )
    1666             :              end if
    1667             :              !-------------------------------------------------------------------------
    1668             :              !  ...  INHEB -> HNO3 (on sulfate, nh4no3, oc2, soa)
    1669             :              !-------------------------------------------------------------------------
    1670           0 :              if( usr_INHEB_aer_ndx > 0 ) then
    1671           0 :                 rxt(i,k,usr_INHEB_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_inheb, gamma_inheb )
    1672             :              end if
    1673             :              !-------------------------------------------------------------------------
    1674             :              !  ...  INHED -> HNO3 (on sulfate, nh4no3, oc2, soa)
    1675             :              !-------------------------------------------------------------------------
    1676           0 :              if( usr_INHED_aer_ndx > 0 ) then
    1677           0 :                 rxt(i,k,usr_INHED_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_inhed, gamma_inhed )
    1678             :              end if
    1679             :              !-------------------------------------------------------------------------
    1680             :              !  ...  MACRN -> HNO3 (on sulfate, nh4no3, oc2, soa)
    1681             :              !-------------------------------------------------------------------------
    1682           0 :              if( usr_MACRN_aer_ndx > 0 ) then
    1683           0 :                 rxt(i,k,usr_MACRN_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_macrn, gamma_macrn )
    1684             :              end if
    1685             :              !-------------------------------------------------------------------------
    1686             :              !  ...  ISOPHFP ->  (on sulfate, nh4no3, oc2, soa)
    1687             :              !-------------------------------------------------------------------------
    1688           0 :              if( usr_ISOPHFP_aer_ndx > 0 ) then
    1689           0 :                 rxt(i,k,usr_ISOPHFP_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_isophfp, gamma_isophfp )
    1690             :              end if
    1691             :              !-------------------------------------------------------------------------
    1692             :              !  ...  IEPOX ->  (on sulfate, nh4no3, oc2, soa)
    1693             :              !-------------------------------------------------------------------------
    1694           0 :              if( usr_IEPOX_aer_ndx > 0 ) then
    1695           0 :                 rxt(i,k,usr_IEPOX_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_iepox, gamma_iepox )
    1696             :              end if
    1697             :              !-------------------------------------------------------------------------
    1698             :              !  ...  DHPMPAL ->  (on sulfate, nh4no3, oc2, soa)
    1699             :              !-------------------------------------------------------------------------
    1700           0 :              if( usr_DHPMPAL_aer_ndx > 0 ) then
    1701           0 :                 rxt(i,k,usr_DHPMPAL_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_dhpmpal, gamma_dhpmpal )
    1702             :              end if
    1703             :              !-------------------------------------------------------------------------
    1704             :              !  ...  ICHE ->  (on sulfate, nh4no3, oc2, soa)
    1705             :              !-------------------------------------------------------------------------
    1706           0 :              if( usr_ICHE_aer_ndx > 0 ) then
    1707           0 :                 rxt(i,k,usr_ICHE_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_iche, gamma_iche )
    1708             :              end if
    1709             :              !-------------------------------------------------------------------------
    1710             :              !  ...  ISOPFNC ->  (on sulfate, nh4no3, oc2, soa)
    1711             :              !-------------------------------------------------------------------------
    1712           0 :              if( usr_ISOPFNC_aer_ndx > 0 ) then
    1713           0 :                 rxt(i,k,usr_ISOPFNC_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_isopfnc, gamma_isopfnc )
    1714             :              end if
    1715             :              !-------------------------------------------------------------------------
    1716             :              !  ...  ISOPFDNC ->  (on sulfate, nh4no3, oc2, soa)
    1717             :              !-------------------------------------------------------------------------
    1718           0 :              if( usr_ISOPFDNC_aer_ndx > 0 ) then
    1719           0 :                 rxt(i,k,usr_ISOPFDNC_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_isopfdnc, gamma_isopfdnc )
    1720             :              end if
    1721             :              !-------------------------------------------------------------------------
    1722             :              !  ...  TERPNT -> HNO3 (on sulfate, nh4no3, oc2, soa)
    1723             :              !-------------------------------------------------------------------------
    1724           0 :              if( usr_TERPNT_aer_ndx > 0 ) then
    1725           0 :                 rxt(i,k,usr_TERPNT_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_terpnt, gamma_terpnt )
    1726             :              end if
    1727             :              !-------------------------------------------------------------------------
    1728             :              !  ...  TERPNT1 -> HNO3 (on sulfate, nh4no3, oc2, soa)
    1729             :              !-------------------------------------------------------------------------
    1730           0 :              if( usr_TERPNT1_aer_ndx > 0 ) then
    1731           0 :                 rxt(i,k,usr_TERPNT1_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_terpnt1, gamma_terpnt1 )
    1732             :              end if
    1733             :              !-------------------------------------------------------------------------
    1734             :              !  ...  TERPNPT -> HNO3 (on sulfate, nh4no3, oc2, soa)
    1735             :              !-------------------------------------------------------------------------
    1736           0 :              if( usr_TERPNPT_aer_ndx > 0 ) then
    1737           0 :                 rxt(i,k,usr_TERPNPT_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_terpnpt, gamma_terpnpt )
    1738             :              end if
    1739             :              !-------------------------------------------------------------------------
    1740             :              !  ...  TERPNPT1 -> HNO3 (on sulfate, nh4no3, oc2, soa)
    1741             :              !-------------------------------------------------------------------------
    1742           0 :              if( usr_TERPNPT1_aer_ndx > 0 ) then
    1743           0 :                 rxt(i,k,usr_TERPNPT1_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_terpnpt1, gamma_terpnpt1 )
    1744             :              end if
    1745             :              !-------------------------------------------------------------------------
    1746             :              !  ...  TERPFDN -> HNO3 (on sulfate, nh4no3, oc2, soa)
    1747             :              !-------------------------------------------------------------------------
    1748           0 :              if( usr_TERPFDN_aer_ndx > 0 ) then
    1749           0 :                 rxt(i,k,usr_TERPFDN_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_terpfdn, gamma_terpfdn )
    1750             :              end if
    1751             :              !-------------------------------------------------------------------------
    1752             :              !  ...  SQTN ->  (on sulfate, nh4no3, oc2, soa)
    1753             :              !-------------------------------------------------------------------------
    1754           0 :              if( usr_SQTN_aer_ndx > 0 ) then
    1755           0 :                 rxt(i,k,usr_SQTN_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_sqtn, gamma_sqtn )
    1756             :              end if
    1757             :              !-------------------------------------------------------------------------
    1758             :              !  ...  TERPHFN ->  (on sulfate, nh4no3, oc2, soa)
    1759             :              !-------------------------------------------------------------------------
    1760           0 :              if( usr_TERPHFN_aer_ndx > 0 ) then
    1761           0 :                 rxt(i,k,usr_TERPHFN_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_terphfn, gamma_terphfn )
    1762             :              end if
    1763             :              !-------------------------------------------------------------------------
    1764             :              !  ...  TERPDHDP ->  (on sulfate, nh4no3, oc2, soa)
    1765             :              !-------------------------------------------------------------------------
    1766           0 :              if( usr_TERPDHDP_aer_ndx > 0 ) then
    1767           0 :                 rxt(i,k,usr_TERPDHDP_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_terpdhdp, gamma_terpdhdp )
    1768             :              end if
    1769             :              !-------------------------------------------------------------------------
    1770             :              !  ...  TERPACID ->  (on sulfate, nh4no3, oc2, soa)
    1771             :              !-------------------------------------------------------------------------
    1772           0 :              if( usr_TERPACID_aer_ndx > 0 ) then
    1773           0 :                 rxt(i,k,usr_TERPACID_aer_ndx) = hetrxtrate( sfc, dm_aer, dg, c_terpacid, gamma_terpacid )
    1774             :              end if
    1775             : 
    1776             :           end do long_loop
    1777             :        end if
    1778             : 
    1779             :        ! LLNL super fast chem reaction rates
    1780             : 
    1781             :        !-----------------------------------------------------------------------
    1782             :        !     ... CO + OH --> CO2 + HO2
    1783             :        !-----------------------------------------------------------------------
    1784           0 :        if ( usr_oh_co_ndx > 0 ) then
    1785           0 :           ko(:)     = 5.9e-33_r8 * tp(:)**1.4_r8
    1786           0 :           kinf(:)   = 1.1e-12_r8 * (temp(:ncol,k) / 300._r8)**1.3_r8
    1787           0 :           ko_m(:)   = ko(:) * m(:,k)
    1788           0 :           k0(:)     = 1.5e-13_r8 * (temp(:ncol,k) / 300._r8)**0.6_r8
    1789           0 :           kinf_m(:) = (2.1e+09_r8 * (temp(:ncol,k) / 300._r8)**6.1_r8) / m(:,k)
    1790           0 :           rxt(:,k,usr_oh_co_ndx) = (ko_m(:)/(1._r8+(ko_m(:)/kinf(:)))) * &
    1791             :                0.6_r8**(1._r8/(1._r8+(log10(ko_m(:)/kinf(:)))**2._r8)) + &
    1792             :                (k0(:)/(1._r8+(k0(:)/kinf_m(:)))) * &
    1793           0 :                0.6_r8**(1._r8/(1._r8+(log10(k0(:)/kinf_m(:)))**2._r8))
    1794             :        endif
    1795             :        !-----------------------------------------------------------------------
    1796             :        !     ... NO2 + H2O --> 0.5 HONO + 0.5 HNO3
    1797             :        !-----------------------------------------------------------------------
    1798           0 :        if ( het_no2_h2o_ndx > 0 ) then
    1799           0 :           rxt(:,k,het_no2_h2o_ndx) = 4.0e-24_r8
    1800             :        endif
    1801             :        !-----------------------------------------------------------------------
    1802             :        !     ... DMS + OH --> 0.75 SO2 + 0.25 MSA
    1803             :        !-----------------------------------------------------------------------
    1804           0 :        if ( usr_oh_dms_ndx > 0 ) then
    1805           0 :           o2(:ncol) = invariants(:ncol,k,inv_o2_ndx)
    1806           0 :           rxt(:,k,usr_oh_dms_ndx) = 2.000e-10_r8 * exp(5820.0_r8 * tinv(:)) / &
    1807           0 :                ((2.000e29_r8 / o2(:)) + exp(6280.0_r8 * tinv(:)))
    1808             :        endif
    1809           0 :        if ( aq_so2_h2o2_ndx > 0 .or. aq_so2_o3_ndx > 0 ) then
    1810           0 :           lwc(:) = cwat(:ncol,k) * invariants(:ncol,k,inv_m_ndx) * mbar(:ncol,k) /avo !PJC convert kg/kg to g/cm3
    1811             :           !-----------------------------------------------------------------------
    1812             :           !     ... SO2 + H2O2 --> S(VI)
    1813             :           !-----------------------------------------------------------------------
    1814           0 :           if ( aq_so2_h2o2_ndx > 0 ) then
    1815           0 :              rxt(:,k,aq_so2_h2o2_ndx) = lwc(:) * 1.0e-03_r8 * avo * &
    1816             :                   K_AQ * &
    1817             : 
    1818             :                   exp(ER_AQ * ((1.0e+00_r8 / 298.0e+00_r8) - tinv(:))) * &
    1819             :                   HENRY298_SO2 * &
    1820             :                   K298_SO2_HSO3 * &
    1821             :                   HENRY298_H2O2 * &
    1822             :                   exp(((H298_SO2 + H298_SO2_HSO3 + H298_H2O2) / R_CAL) * &
    1823             :                   ((1.0e+00_r8 / 298.0e+00_r8) - tinv(:))) * &
    1824             :                   (R_CONC * temp(:ncol,k))**2.0e+00_r8 / &
    1825             : 
    1826           0 :                   (1.0e+00_r8 + 13.0e+00_r8 * 10.0e+00_r8**(-pH))
    1827             :           endif
    1828             :           !-----------------------------------------------------------------------
    1829             :           !     ... SO2 + O3 --> S(VI)
    1830             :           !-----------------------------------------------------------------------
    1831           0 :           if (aq_so2_o3_ndx >0) then
    1832           0 :              rxt(:,k,aq_so2_o3_ndx) = lwc(:) * 1.0e-03_r8 * avo * &
    1833             :                   HENRY298_SO2 * exp((H298_SO2 / R_CAL) * &
    1834             :                   ((1.0e+00_r8 / 298.0e+00_r8) - tinv(:))) * &
    1835             :                   (K0_AQ * exp(ER0_AQ * &
    1836             :                   ((1.0e+00_r8 / 298.0e+00_r8) - tinv(:))) + &
    1837             :                   K298_SO2_HSO3 * exp((H298_SO2_HSO3 / R_CAL) * &
    1838             :                   ((1.0e+00_r8 / 298.0e+00_r8) - tinv(:))) * &
    1839             :                   (K1_AQ * exp(ER1_AQ * &
    1840             :                   ((1.0e+00_r8 / 298.0e+00_r8) - tinv(:))) / &
    1841             :                   10.0e+00_r8**(-pH) + K2_AQ * exp(ER2_AQ * &
    1842             :                   ((1.0e+00_r8 / 298.0e+00_r8) - tinv(:))) * &
    1843             :                   K298_HSO3_SO3 * exp((H298_HSO3_SO3 / R_CAL) * &
    1844             :                   ((1.0e+00_r8 / 298.0e+00_r8) - tinv(:))) / &
    1845             :                   (10.0e+00_r8**(-pH))**2.0e+00_r8) ) * &
    1846             :                   HENRY298_O3 * exp((H298_O3 / R_CAL) * &
    1847             :                   ((1.0e+00_r8 / 298.0e+00_r8) - tinv(:))) * &
    1848           0 :                   (R_CONC * temp(:ncol,k))**2.0e+00_r8
    1849             :           endif
    1850             :        endif
    1851             : 
    1852           0 :     if ( has_d_chem ) then
    1853             : 
    1854           0 :         call comp_exp( exp_fac, -600._r8 * tinv, ncol )
    1855           0 :         rxt(:,k,ean_ndx(1))  = 1.e-31_r8 * tp(:) * exp_fac(:)
    1856             :         rxt(:,k,ean_ndx(2))  = 9.1e-12_r8 * tp(:)**(-1.46_r8)
    1857             :         call comp_exp( exp_fac, -193._r8 * tinv, ncol )
    1858             :         rxt(:,k,ean_ndx(3))  = (4.e-30_r8 * exp_fac(:)) * 0.21_r8
    1859             : 
    1860             :         rxt(:,k,rpe_ndx(1))  = 4.2e-6_r8 * tp(:)**0.5_r8
    1861             :         rxt(:,k,rpe_ndx(2))  = 6.3e-7_r8 * tp(:)**0.5_r8
    1862             :         rxt(:,k,rpe_ndx(3))  = 2.5e-6_r8 * tp(:)**0.1_r8
    1863             :         rxt(:,k,rpe_ndx(4))  = 2.48e-6_r8 * tp(:)**0.76_r8
    1864             :         rxt(:,k,rpe_ndx(5))  = 1.4e-6_r8 * tp(:)**0.4_r8
    1865             : 
    1866             :         rxt(:,k,pir_ndx(1)) = 4.e-30_r8 * tp(:)**2.93_r8
    1867             :         rxt(:,k,pir_ndx(2))  = 4.6e-27_r8 * tp(:)**4._r8
    1868             : 
    1869             :         call comp_exp( exp_fac, -15900._r8 * tinv, ncol )
    1870             :         rxt(:,k,pir_ndx(3))  = (2.5e-2_r8 * tp(:)**5._r8) * exp_fac(:)
    1871             :         rxt(:,k,pir_ndx(4))  = 2.3e-27_r8 * tp(:)**7.5_r8
    1872             : 
    1873             :         call comp_exp( exp_fac, -10272._r8 * tinv, ncol )
    1874             :         rxt(:,k,pir_ndx(5))  = (2.6e-3_r8 * tp(:)**8.5_r8) * exp_fac(:)
    1875             :         rxt(:,k,pir_ndx(6))  = 3.6e-27_r8 * tp(:)**8.1_r8
    1876             : 
    1877             :         call comp_exp( exp_fac, -9000._r8 * tinv, ncol )
    1878             :         rxt(:,k,pir_ndx(7))  = (1.5e-1_r8 * tp(:)**9.1_r8) * exp_fac(:)
    1879             :         rxt(:,k,pir_ndx(8))  = 4.6e-28_r8 * tp(:)**14._r8
    1880             : 
    1881             :         call comp_exp( exp_fac, -6400._r8 * tinv, ncol )
    1882             :         rxt(:,k,pir_ndx(9))  = (1.7e-3_r8 * tp(:)**15._r8) * exp_fac(:)
    1883             :         rxt(:,k,pir_ndx(10)) = 1.35e-28_r8 * tp(:)**2.83_r8
    1884             : 
    1885             :         rxt(:,k,pir_ndx(11)) = 1.e-27_r8 * (308._r8 * tinv(:))**4.7_r8
    1886             :         rxt(:,k,pir_ndx(12)) = rxt(:,k,pir_ndx(11))
    1887             :         rxt(:,k,pir_ndx(13)) = 1.4e-29_r8 * tp(:)**4._r8
    1888             : 
    1889             :         call comp_exp( exp_fac, -3872._r8 * tinv, ncol )
    1890             :         rxt(:,k,pir_ndx(14)) = (3.4e-7_r8 * tp(:)**5._r8) * exp_fac(:)
    1891             : 
    1892             :         rxt(:,k,pir_ndx(15)) = 3.0e-31_r8 * tp(:)**4.3_r8
    1893             :         call comp_exp( exp_fac, -2093._r8 * tinv, ncol )
    1894             :         rxt(:,k,pir_ndx(16)) = (1.5e-8_r8 * tp(:)**4.3_r8) * exp_fac(:)
    1895             : 
    1896             :         rxt(:,k,edn_ndx(1)) = 3.1e-10_r8 * tp(:)**0.83_r8
    1897             :         call comp_exp( exp_fac, -4990._r8 * tinv, ncol )
    1898             :         rxt(:,k,edn_ndx(2)) = (1.9e-12_r8 * tp(:)**(-1.5_r8)) * exp_fac(:)
    1899             : 
    1900             :         rxt(:,k,nir_ndx(1)) = 1.05e-12_r8 * tp(:)**2.15_r8
    1901             :         rxt(:,k,nir_ndx(2)) = 2.5e-11_r8 * tp(:)**0.79_r8
    1902             :         rxt(:,k,nir_ndx(3)) = 7.5e-11_r8 * tp(:)**0.79_r8
    1903             :         rxt(:,k,nir_ndx(4)) = rxt(:,k,nir_ndx(1))
    1904             :         rxt(:,k,nir_ndx(5)) = 1.3e-11_r8 * tp(:)**1.64_r8
    1905             :         rxt(:,k,nir_ndx(6)) = 3.3e-11_r8 * tp(:)**2.38_r8
    1906             : 
    1907             :         call comp_exp( exp_fac, -7300_r8 * tinv, ncol )
    1908             :         rxt(:,k,nir_ndx(7)) = (1.0e-3_r8 * tp(:)) * exp_fac(:)
    1909             :         call comp_exp( exp_fac, -7050_r8 * tinv, ncol )
    1910             :         rxt(:,k,nir_ndx(8)) = (7.2e-4_r8 * tp(:)) * exp_fac(:)
    1911             :         call comp_exp( exp_fac, -6800_r8 * tinv, ncol )
    1912             :         rxt(:,k,nir_ndx(9)) = (6.5e-3_r8 * tp(:)) * exp_fac(:)
    1913             :         call comp_exp( exp_fac, -7600_r8 * tinv, ncol )
    1914             :         rxt(:,k,nir_ndx(10)) = (5.7e-4_r8 * tp(:)) * exp_fac(:)
    1915             : 
    1916             :         call comp_exp( exp_fac, -7150_r8 * tinv, ncol )
    1917             :         rxt(:,k,nir_ndx(11)) = (1.5e-2_r8 * tp(:)) * exp_fac(:)
    1918             : 
    1919             :         call comp_exp( exp_fac, -13130_r8 * tinv, ncol )
    1920             :         rxt(:,k,nir_ndx(12)) = (6.0e-3_r8 * tp(:)) * exp_fac(:)
    1921             :         rxt(:,k,nir_ndx(13)) = 5.22e-28_r8 * tp(:)**2.62_r8
    1922             : 
    1923             :         rxt(:,k,iira_ndx(1)) = 6.0e-8_r8 * tp(:)**.5_r8
    1924             :         do i = 2,niira
    1925             :           rxt(:,k,iira_ndx(i)) = rxt(:,k,iira_ndx(i-1))
    1926             :         enddo
    1927             : 
    1928             :         rxt(:,k,iirb_ndx(1)) = 1.25e-25_r8 * tp(:)**4._r8
    1929             :         do i = 2,niirb
    1930             :           rxt(:,k,iirb_ndx(i)) = rxt(:,k,iirb_ndx(i-1))
    1931             :         enddo
    1932             : 
    1933             :         call comp_exp( exp_fac, -6600._r8 * tinv, ncol )
    1934             :         rxt(:,k,usr_clm_h2o_m_ndx) = 2.e-8_r8 * exp_fac(:)
    1935             : 
    1936             :         call comp_exp( exp_fac, -11926._r8 * tinv, ncol )
    1937             :         rxt(:,k,usr_clm_hcl_m_ndx) =  tinv(:) * exp_fac(:)
    1938             : 
    1939             :      endif
    1940             :     end do level_loop
    1941             : 
    1942             : !-----------------------------------------------------------------
    1943             : !       ... the ionic rates
    1944             : !-----------------------------------------------------------------
    1945           0 :     if ( has_ion_rxts ) then
    1946             :        level_loop2 : do k = 1,pver
    1947           0 :            tp(:ncol)         = (2._r8*tempi(:ncol,k) + temp(:ncol,k)) / ( 3._r8 * t0 )
    1948           0 :            tp(:)             = max( min( tp(:),20._r8 ),1._r8 )
    1949           0 :            rxt(:,k,ion1_ndx) = 2.82e-11_r8 + tp(:)*(-7.74e-12_r8 + tp(:)*(1.073e-12_r8  &
    1950           0 :                          + tp(:)*(-5.17e-14_r8 + 9.65e-16_r8*tp(:))))
    1951             :            tp(:ncol)         = (.6363_r8*tempi(:ncol,k) + .3637_r8*temp(:ncol,k)) / t0
    1952             :            tp(:)             = max( min( tp(:),trlim2 ),1._r8 )
    1953             :            rxt(:,k,ion2_ndx) = 1.533e-12_r8 + tp(:)*(-5.92e-13_r8 + tp(:)*8.6e-14_r8)
    1954             :            tp(:ncol)         = 2._r8 * t0 /(tempi(:ncol,k) + temp(:ncol,k))
    1955             :            where( tp(:ncol) < trlim3 )
    1956             :                   rxt(:,k,ion3_ndx)  = 1.4e-10_r8 * tp(:)**.44_r8
    1957             :                   rxt(:,k,ion11_ndx) = 1.e-11_r8 * tp(:)**.23_r8
    1958             :            elsewhere
    1959             :                   rxt(:,k,ion3_ndx)  = 5.2e-11_r8 / tp(:)**.2_r8
    1960             :               rxt(:,k,ion11_ndx) = 3.6e-12_r8 / tp(:)**.41_r8
    1961             :            end where
    1962             :            tp(:ncol)          = t0 / tempe(:ncol,k)
    1963             :            rxt(:,k,elec1_ndx) = 4.e-7_r8 * tp(:)**.85_r8
    1964             :            rxt(:,k,elec3_ndx) = 1.8e-7_r8 * tp(:)**.39_r8
    1965             :            where( tp(:ncol) < 4._r8 )
    1966             :               rxt(:,k,elec2_ndx) = 2.7e-7_r8 * tp(:)**.7_r8
    1967             :            elsewhere
    1968             :               rxt(:,k,elec2_ndx) = 1.6e-7_r8 * tp(:)**.55_r8
    1969             :            end where
    1970             :         end do level_loop2
    1971             :      endif
    1972             : 
    1973             :      ! quenching of O+(2P) and O+(2D) by e to produce O+
    1974             :      ! See TABLE 1 of Roble (1995)
    1975             :      ! drm 2015-07-27
    1976           0 :      if (elec4_ndx > 0 .and. elec5_ndx > 0 .and. elec6_ndx > 0) then
    1977             :          do k=1,pver
    1978           0 :             tp(:ncol)          = sqrt(300._r8 / tempe(:ncol,k))
    1979           0 :             rxt(:,k,elec4_ndx) = 1.5e-7_r8 * tp(:)
    1980             :             rxt(:,k,elec5_ndx) = 4.0e-8_r8 * tp(:)
    1981             :             rxt(:,k,elec6_ndx) = 6.6e-8_r8 * tp(:)
    1982             :          end do
    1983             :      endif
    1984             : 
    1985             : !-----------------------------------------------------------------
    1986             : !       ... tropospheric "aerosol" rate constants
    1987             : !-----------------------------------------------------------------
    1988           0 :      if ( het1_ndx > 0 .AND. (.NOT. usr_N2O5_aer_ndx > 0) ) then
    1989             :          amas = 4._r8*pi*rm1**3*den/3._r8            ! each mean particle(r=0.1u) mass (g)
    1990             :          do k = 1,pver
    1991             : !-------------------------------------------------------------------------
    1992             : !       ... estimate humidity effect on aerosols (from Shettle and Fenn, 1979)
    1993             : !           xr is a factor of the increase aerosol radii with hum (hum=0., factor=1)
    1994             : !-------------------------------------------------------------------------
    1995           0 :             xr(:)     = .999151_r8 + relhum(:ncol,k)*(1.90445_r8 + relhum(:ncol,k)*(-6.35204_r8 + relhum(:ncol,k)*5.32061_r8))
    1996             : !-------------------------------------------------------------------------
    1997             : !       ... estimate sulfate particles surface area (cm2/cm3) in each grid
    1998             : !-------------------------------------------------------------------------
    1999           0 :             if ( carma_hetchem_feedback ) then
    2000           0 :                sur(:ncol) = strato_sad(:ncol,k)
    2001             :             else
    2002             :                sur(:) = sulfate(:,k)*m(:,k)/avo*wso4 &              ! xform mixing ratio to g/cm3
    2003             :                         / amas &                                    ! xform g/cm3 to num particels/cm3
    2004             :                         * fare &                                    ! xform num particels/cm3 to cm2/cm3
    2005           0 :                         * xr(:)*xr(:)                               ! humidity factor
    2006             :             endif
    2007             : !-----------------------------------------------------------------
    2008             : !       ... compute the "aerosol" reaction rates
    2009             : !-----------------------------------------------------------------
    2010             : !             k = gam * A * velo/4
    2011             : !
    2012             : !       where velo = sqrt[ 8*bk*T/pi/(w/av) ]
    2013             : !             bk = 1.381e-16
    2014             : !             av = 6.02e23
    2015             : !             w  = 108 (n2o5)  HO2(33)  CH2O (30)  NH3(15)
    2016             : !
    2017             : !       so that velo = 1.40e3*sqrt(T)  (n2o5)   gama=0.1
    2018             : !       so that velo = 2.53e3*sqrt(T)  (HO2)    gama>0.2
    2019             : !       so that velo = 2.65e3*sqrt(T)  (CH2O)   gama>0.022
    2020             : !       so that velo = 3.75e3*sqrt(T)  (NH3)    gama=0.4
    2021             : !--------------------------------------------------------
    2022             : !-----------------------------------------------------------------
    2023             : !       ... use this n2o5 -> 2*hno3 only in tropopause
    2024             : !-----------------------------------------------------------------
    2025           0 :             rxt(:,k,het1_ndx) = rxt(:,k,het1_ndx) &
    2026           0 :                                 +.25_r8 * gam1 * sur(:) * 1.40e3_r8 * sqrt( temp(:ncol,k) )
    2027             :          end do
    2028             :       end if
    2029             : 
    2030             : !lke++
    2031             : !-----------------------------------------------------------------
    2032             : !      ... CO tags
    2033             : !-----------------------------------------------------------------
    2034           0 :       if( usr_CO_OH_b_ndx > 0 .and. usr_CO_OH_ndx < 0 ) then
    2035           0 :          usr_CO_OH_ndx = usr_CO_OH_b_ndx
    2036             :       end if 
    2037           0 :       if( usr_CO_OH_ndx > 0 ) then
    2038           0 :          if( usr_COhc_OH_ndx > 0 ) then
    2039           0 :             rxt(:ncol,:,usr_COhc_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2040             :          end if
    2041           0 :          if( usr_COme_OH_ndx > 0 ) then
    2042           0 :             rxt(:ncol,:,usr_COme_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2043             :          end if
    2044           0 :          if( usr_CO01_OH_ndx > 0 ) then
    2045           0 :             rxt(:ncol,:,usr_CO01_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2046             :          end if
    2047           0 :          if( usr_CO02_OH_ndx > 0 ) then
    2048           0 :             rxt(:ncol,:,usr_CO02_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2049             :          end if
    2050           0 :          if( usr_CO03_OH_ndx > 0 ) then
    2051           0 :             rxt(:ncol,:,usr_CO03_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2052             :          end if
    2053           0 :          if( usr_CO04_OH_ndx > 0 ) then
    2054           0 :             rxt(:ncol,:,usr_CO04_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2055             :          end if
    2056           0 :          if( usr_CO05_OH_ndx > 0 ) then
    2057           0 :             rxt(:ncol,:,usr_CO05_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2058             :          end if
    2059           0 :          if( usr_CO06_OH_ndx > 0 ) then
    2060           0 :             rxt(:ncol,:,usr_CO06_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2061             :          end if
    2062           0 :          if( usr_CO07_OH_ndx > 0 ) then
    2063           0 :             rxt(:ncol,:,usr_CO07_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2064             :          end if
    2065           0 :          if( usr_CO08_OH_ndx > 0 ) then
    2066           0 :             rxt(:ncol,:,usr_CO08_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2067             :          end if
    2068           0 :          if( usr_CO09_OH_ndx > 0 ) then
    2069           0 :             rxt(:ncol,:,usr_CO09_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2070             :          end if
    2071           0 :          if( usr_CO10_OH_ndx > 0 ) then
    2072           0 :             rxt(:ncol,:,usr_CO10_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2073             :          end if
    2074           0 :          if( usr_CO11_OH_ndx > 0 ) then
    2075           0 :             rxt(:ncol,:,usr_CO11_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2076             :          end if
    2077           0 :          if( usr_CO12_OH_ndx > 0 ) then
    2078           0 :             rxt(:ncol,:,usr_CO12_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2079             :          end if
    2080           0 :          if( usr_CO13_OH_ndx > 0 ) then
    2081           0 :             rxt(:ncol,:,usr_CO13_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2082             :          end if
    2083           0 :          if( usr_CO14_OH_ndx > 0 ) then
    2084           0 :             rxt(:ncol,:,usr_CO14_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2085             :          end if
    2086           0 :          if( usr_CO15_OH_ndx > 0 ) then
    2087           0 :             rxt(:ncol,:,usr_CO15_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2088             :          end if
    2089           0 :          if( usr_CO16_OH_ndx > 0 ) then
    2090           0 :             rxt(:ncol,:,usr_CO16_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2091             :          end if
    2092           0 :          if( usr_CO17_OH_ndx > 0 ) then
    2093           0 :             rxt(:ncol,:,usr_CO17_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2094             :          end if
    2095           0 :          if( usr_CO18_OH_ndx > 0 ) then
    2096           0 :             rxt(:ncol,:,usr_CO18_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2097             :          end if
    2098           0 :          if( usr_CO19_OH_ndx > 0 ) then
    2099           0 :             rxt(:ncol,:,usr_CO19_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2100             :          end if
    2101           0 :          if( usr_CO20_OH_ndx > 0 ) then
    2102           0 :             rxt(:ncol,:,usr_CO20_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2103             :          end if
    2104           0 :          if( usr_CO21_OH_ndx > 0 ) then
    2105           0 :             rxt(:ncol,:,usr_CO21_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2106             :          end if
    2107           0 :          if( usr_CO22_OH_ndx > 0 ) then
    2108           0 :             rxt(:ncol,:,usr_CO22_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2109             :          end if
    2110           0 :          if( usr_CO23_OH_ndx > 0 ) then
    2111           0 :             rxt(:ncol,:,usr_CO23_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2112             :          end if
    2113           0 :          if( usr_CO24_OH_ndx > 0 ) then
    2114           0 :             rxt(:ncol,:,usr_CO24_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2115             :          end if
    2116           0 :          if( usr_CO25_OH_ndx > 0 ) then
    2117           0 :             rxt(:ncol,:,usr_CO25_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2118             :          end if
    2119           0 :          if( usr_CO26_OH_ndx > 0 ) then
    2120           0 :             rxt(:ncol,:,usr_CO26_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2121             :          end if
    2122           0 :          if( usr_CO27_OH_ndx > 0 ) then
    2123           0 :             rxt(:ncol,:,usr_CO27_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2124             :          end if
    2125           0 :          if( usr_CO28_OH_ndx > 0 ) then
    2126           0 :             rxt(:ncol,:,usr_CO28_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2127             :          end if
    2128           0 :          if( usr_CO29_OH_ndx > 0 ) then
    2129           0 :             rxt(:ncol,:,usr_CO29_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2130             :          end if
    2131           0 :          if( usr_CO30_OH_ndx > 0 ) then
    2132           0 :             rxt(:ncol,:,usr_CO30_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2133             :          end if
    2134           0 :          if( usr_CO31_OH_ndx > 0 ) then
    2135           0 :             rxt(:ncol,:,usr_CO31_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2136             :          end if
    2137           0 :          if( usr_CO32_OH_ndx > 0 ) then
    2138           0 :             rxt(:ncol,:,usr_CO32_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2139             :          end if
    2140           0 :          if( usr_CO33_OH_ndx > 0 ) then
    2141           0 :             rxt(:ncol,:,usr_CO33_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2142             :          end if
    2143           0 :          if( usr_CO34_OH_ndx > 0 ) then
    2144           0 :             rxt(:ncol,:,usr_CO34_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2145             :          end if
    2146           0 :          if( usr_CO35_OH_ndx > 0 ) then
    2147           0 :             rxt(:ncol,:,usr_CO35_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2148             :          end if
    2149           0 :          if( usr_CO36_OH_ndx > 0 ) then
    2150           0 :             rxt(:ncol,:,usr_CO36_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2151             :          end if
    2152           0 :          if( usr_CO37_OH_ndx > 0 ) then
    2153           0 :             rxt(:ncol,:,usr_CO37_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2154             :          end if
    2155           0 :          if( usr_CO38_OH_ndx > 0 ) then
    2156           0 :             rxt(:ncol,:,usr_CO38_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2157             :          end if
    2158           0 :          if( usr_CO39_OH_ndx > 0 ) then
    2159           0 :             rxt(:ncol,:,usr_CO39_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2160             :          end if
    2161           0 :          if( usr_CO40_OH_ndx > 0 ) then
    2162           0 :             rxt(:ncol,:,usr_CO40_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2163             :          end if
    2164           0 :          if( usr_CO41_OH_ndx > 0 ) then
    2165           0 :             rxt(:ncol,:,usr_CO41_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2166             :          end if
    2167           0 :          if( usr_CO42_OH_ndx > 0 ) then
    2168           0 :             rxt(:ncol,:,usr_CO42_OH_ndx) = rxt(:ncol,:,usr_CO_OH_ndx)
    2169             :          end if
    2170             :       end if
    2171             : !lke--
    2172             : !
    2173             : ! jfl : additional BAM removal reactions.  Zero out below the tropopause
    2174             : !
    2175           0 :       do l=1,num_strat_tau
    2176             : !
    2177           0 :          if ( usr_strat_tau_ndx(l) > 0 ) then
    2178           0 :             do i=1,ncol
    2179           0 :                rxt(i,tropchemlev(i)+1:pver,usr_strat_tau_ndx(l)) = 0._r8
    2180             :             end do
    2181             :          end if
    2182             : !
    2183             :       end do
    2184             : !
    2185             : 
    2186           0 :       deallocate( sfc_array, dm_array )
    2187             : 
    2188           0 :   end subroutine usrrxt
    2189             : 
    2190           0 :       subroutine usrrxt_hrates( rxt, tempn, tempi, tempe, &
    2191           0 :                                 h2ovmr, m, ncol, kbot )
    2192             : !-----------------------------------------------------------------
    2193             : !        ... set the user specified reaction rates for heating
    2194             : !-----------------------------------------------------------------
    2195             : 
    2196           0 :       use shr_kind_mod,  only : r8 => shr_kind_r8
    2197             :       use chem_mods,     only : rxntot
    2198             :       use ppgrid,        only : pver, pcols
    2199             : 
    2200             :       implicit none
    2201             : 
    2202             : !-----------------------------------------------------------------
    2203             : !        ... dummy arguments
    2204             : !-----------------------------------------------------------------
    2205             :       integer, intent(in)     :: ncol                         ! number columns in chunk
    2206             :       integer, intent(in)     :: kbot                         ! heating levels
    2207             :       real(r8), intent(in)    :: tempn(pcols,pver)            ! neutral temperature (K)
    2208             :       real(r8), intent(in)    :: tempi(pcols,pver)            ! ion temperature (K)
    2209             :       real(r8), intent(in)    :: tempe(pcols,pver)            ! electron temperature (K)
    2210             :       real(r8), intent(in)    :: m(ncol,pver)                 ! total atm density (1/cm^3)
    2211             :       real(r8), intent(in)    :: h2ovmr(ncol,pver)            ! water vapor (vmr)
    2212             :       real(r8), intent(inout) :: rxt(ncol,pver,rxntot)        ! gas phase rates
    2213             : 
    2214             : !-----------------------------------------------------------------
    2215             : !        ... local variables
    2216             : !-----------------------------------------------------------------
    2217             : 
    2218             :       integer  ::  k
    2219             :       real(r8), dimension(ncol) :: &
    2220           0 :                    tp, &
    2221           0 :                    tinv, &
    2222           0 :                    ko, &
    2223           0 :                    kinf, &
    2224           0 :                    fc
    2225             : 
    2226             : !-----------------------------------------------------------------
    2227             : !       ... o + o2 + m --> o3 + m
    2228             : !-----------------------------------------------------------------
    2229           0 :       do k = 1,kbot
    2230           0 :          tinv(:ncol)       = 1._r8 / tempn(:ncol,k)
    2231           0 :          tp(:)             = 300._r8 * tinv(:)
    2232           0 :          rxt(:,k,usr_O_O2_ndx) = 6.e-34_r8 * tp(:)**2.4_r8
    2233             : 
    2234             : !-----------------------------------------------------------------
    2235             : !       ... o + o + m -> o2 + m
    2236             : !-----------------------------------------------------------------
    2237             :          rxt(:,k,usr_O_O_ndx) = 2.76e-34_r8 * exp( 720.0_r8*tinv(:) )
    2238             : 
    2239             : !-----------------------------------------------------------------
    2240             : !       ... ho2 + ho2 --> h2o2
    2241             : !       Note: this rate involves the water vapor number density
    2242             : !-----------------------------------------------------------------
    2243             :          ko(:)   = 3.0e-13_r8  * exp( 460._r8*tinv(:) )
    2244             :          kinf(:) = 2.1e-33_r8 * m(:,k) * exp( 920._r8*tinv(:) )
    2245             :          fc(:)   = 1._r8 + 1.4e-21_r8 * m(:,k) * h2ovmr(:,k) * exp( 2200._r8*tinv(:) )
    2246           0 :          rxt(:,k,usr_HO2_HO2_ndx) = (ko(:) + kinf(:)) * fc(:)
    2247             : 
    2248             :       end do
    2249             : 
    2250             : !-----------------------------------------------------------------
    2251             : !       ... the ionic rates
    2252             : !-----------------------------------------------------------------
    2253             :       if ( has_ion_rxts ) then
    2254             :          level_loop2 :  do k = 1,kbot
    2255             :             tp(:ncol)         = (2._r8*tempi(:ncol,k) + tempn(:ncol,k)) / ( 3._r8 * t0 )
    2256             :             tp(:)             = max( min( tp(:),20._r8 ),1._r8 )
    2257             :             rxt(:,k,ion1_ndx) = 2.82e-11_r8 + tp(:)*(-7.74e-12_r8 + tp(:)*(1.073e-12_r8  &
    2258             :                  + tp(:)*(-5.17e-14_r8 + 9.65e-16_r8*tp(:))))
    2259             :             tp(:ncol)         = (.6363_r8*tempi(:ncol,k) + .3637_r8*tempn(:ncol,k)) / t0
    2260             :             tp(:)             = max( min( tp(:),trlim2 ),1._r8 )
    2261             :             rxt(:,k,ion2_ndx) = 1.533e-12_r8 + tp(:)*(-5.92e-13_r8 + tp(:)*8.6e-14_r8)
    2262             :             tp(:ncol)         = 2._r8 * t0 /(tempi(:ncol,k) + tempn(:ncol,k))
    2263             :             where( tp(:ncol) < trlim3 )
    2264             :                rxt(:,k,ion3_ndx)  = 1.4e-10_r8 * tp(:)**.44_r8
    2265             :             elsewhere
    2266             :                rxt(:,k,ion3_ndx)  = 5.2e-11_r8 / tp(:)**.2_r8
    2267             :             endwhere
    2268             :             tp(:ncol)          = t0 / tempe(:ncol,k)
    2269             :             rxt(:,k,elec1_ndx) = 4.e-7_r8 * tp(:)**.85_r8
    2270             :             rxt(:,k,elec3_ndx) = 1.8e-7_r8 * tp(:)**.39_r8
    2271             :             where( tp(:ncol) < 4._r8 )
    2272             :                rxt(:,k,elec2_ndx) = 2.7e-7_r8 * tp(:)**.7_r8
    2273             :             elsewhere
    2274             :                rxt(:,k,elec2_ndx) = 1.6e-7_r8 * tp(:)**.55_r8
    2275             :             endwhere
    2276             :          end do level_loop2
    2277             :       endif
    2278           0 :       end subroutine usrrxt_hrates
    2279             : 
    2280             : !-------------------------------------------------------------------------
    2281             : !-------------------------------------------------------------------------
    2282           0 :   subroutine comp_exp( x, y, n )
    2283             : 
    2284             :     implicit none
    2285             : 
    2286             :     real(r8), intent(out) :: x(:)
    2287             :     real(r8), intent(in)  :: y(:)
    2288             :     integer,  intent(in)  :: n
    2289             : 
    2290             : #ifdef IBM
    2291             :     call vexp( x, y, n )
    2292             : #else
    2293           0 :     x(:n) = exp( y(:n) )
    2294             : #endif
    2295             : 
    2296           0 :   end subroutine comp_exp
    2297             : 
    2298             :   !-------------------------------------------------------------------------
    2299             :   !  Heterogeneous reaction rates for uptake of a gas on an aerosol:
    2300             :   !-------------------------------------------------------------------------
    2301             :   function hetrxtrate( sfc, dm_aer, dg_gas, c_gas, gamma_gas ) result(rate)
    2302             : 
    2303             :     real(r8), intent(in) :: sfc(:)
    2304             :     real(r8), intent(in) :: dm_aer(:)
    2305             :     real(r8), intent(in) :: dg_gas
    2306             :     real(r8), intent(in) :: c_gas
    2307             :     real(r8), intent(in) :: gamma_gas
    2308             :     real(r8) :: rate
    2309             : 
    2310             :     real(r8),allocatable :: rxt(:)
    2311             :     integer :: n, i
    2312             : 
    2313             :     n = size(sfc)
    2314             : 
    2315             :     allocate(rxt(n))
    2316             :     do i=1,n
    2317             :        rxt(i) = sfc(i) / (0.5_r8*dm_aer(i)/dg_gas + (4._r8/(c_gas*gamma_gas)))
    2318             :     enddo
    2319             : 
    2320             :     rate = sum(rxt)
    2321             : 
    2322             :     deallocate(rxt)
    2323             : 
    2324             :   endfunction hetrxtrate
    2325             : 
    2326             :   !-------------------------------------------------------------------------
    2327             :   !  Heterogeneous reaction rates for uptake of a glyoxal gas on an aerosol:
    2328             :   !-------------------------------------------------------------------------
    2329             :   function hetrxtrate_gly( sfc, c_gas, gamma_gas ) result(rate)
    2330             : 
    2331             :     real(r8), intent(in) :: sfc(:)
    2332             :     real(r8), intent(in) :: c_gas
    2333             :     real(r8), intent(in) :: gamma_gas
    2334             :     real(r8) :: rate
    2335             : 
    2336             :     real(r8),allocatable :: rxt(:)
    2337             :     integer :: n, i
    2338             : 
    2339             :     n = size(sfc)
    2340             : 
    2341             :     allocate(rxt(n))
    2342             :     do i=1,n
    2343             :        rxt(i) =  0.25_r8 * c_gas * sfc(i) * gamma_gas
    2344             :     enddo
    2345             : 
    2346             :     rate = sum(rxt)
    2347             : 
    2348             :     deallocate(rxt)
    2349             : 
    2350             :   endfunction hetrxtrate_gly
    2351             : 
    2352             : 
    2353             : end module mo_usrrxt

Generated by: LCOV version 1.14