139 subroutine initialize(this, chem_spec_data, aero_phase, aero_rep, n_cells)
150 integer(kind=i_kind),
intent(in) :: n_cells
152 type(
property_t),
pointer :: spec_props, reactants, products
153 character(len=:),
allocatable :: key_name, spec_name, string_val
154 integer(kind=i_kind) :: i_spec, i_qty
156 integer(kind=i_kind) :: temp_int
157 real(kind=
dp) :: temp_real
160 if (.not.
associated(this%property_set))
call die_msg(255324828, &
161 "Missing property set needed to initialize reaction")
162 key_name =
"reactants"
164 this%property_set%get_property_t(key_name, reactants), &
165 "CMAQ H2O2 reaction is missing reactants")
166 key_name =
"products"
168 this%property_set%get_property_t(key_name, products), &
169 "CMAQ H2O2 reaction is missing products")
172 call reactants%iter_reset()
176 call assert(952475195, reactants%get_property_t(val=spec_props))
178 if (spec_props%get_int(key_name, temp_int)) i_spec = i_spec+temp_int-1
179 call reactants%iter_next()
187 allocate(this%condensed_data_int(num_int_prop_ + &
188 (i_spec + 2) * (i_spec + products%size())))
189 allocate(this%condensed_data_real(num_real_prop_ + products%size()))
190 this%condensed_data_int(:) = int(0, kind=
i_kind)
191 this%condensed_data_real(:) = real(0.0, kind=
dp)
194 this%num_env_params = num_env_param_
199 num_prod_ = products%size()
202 conv_ =
const%avagadro /
const%univ_gas_const * 10.0d0**(-12.0d0)
208 if (.not. this%property_set%get_real(key_name, k1_a_))
then
212 if (.not. this%property_set%get_real(key_name, k1_b_))
then
216 if (.not. this%property_set%get_real(key_name, k1_c_))
then
220 if (.not. this%property_set%get_real(key_name, k2_a_))
then
224 if (.not. this%property_set%get_real(key_name, k2_b_))
then
228 if (.not. this%property_set%get_real(key_name, k2_c_))
then
231 key_name =
"time unit"
232 if (this%property_set%get_string(key_name, string_val))
then
233 if (trim(string_val).eq.
"MIN")
then
240 k2_a_ = k2_a_ * real(1.0d6, kind=
dp)
243 call reactants%iter_reset()
248 react_(i_spec) = chem_spec_data%gas_state_id(
spec_name)
251 call assert_msg(345360993, react_(i_spec).gt.0, &
252 "Missing CMAQ H2O2 reactant: "//
spec_name)
255 call assert(796763915, reactants%get_property_t(val=spec_props))
257 if (spec_props%get_int(key_name, temp_int))
then
258 do i_qty = 1, temp_int - 1
259 react_(i_spec + i_qty) = react_(i_spec)
261 i_spec = i_spec + temp_int - 1
264 call reactants%iter_next()
269 call products%iter_reset()
274 prod_(i_spec) = chem_spec_data%gas_state_id(
spec_name)
277 call assert_msg(234948182, prod_(i_spec).gt.0, &
278 "Missing CMAQ H2O2 product: "//
spec_name)
281 call assert(267035567, products%get_property_t(val=spec_props))
283 if (spec_props%get_real(key_name, temp_real))
then
284 yield_(i_spec) = temp_real
289 call products%iter_next()