138 subroutine initialize(this, chem_spec_data, aero_rep, n_cells)
147 integer(kind=i_kind),
intent(in) :: n_cells
149 type(
property_t),
pointer :: spec_props, reactants, products
150 character(len=:),
allocatable :: key_name, spec_name, string_val
151 integer(kind=i_kind) :: i_spec, i_qty
153 integer(kind=i_kind) :: temp_int
154 real(kind=
dp) :: temp_real
157 if (.not.
associated(this%property_set))
call die_msg(255324828, &
158 "Missing property set needed to initialize reaction")
159 key_name =
"reactants"
161 this%property_set%get_property_t(key_name, reactants), &
162 "CMAQ H2O2 reaction is missing reactants")
163 key_name =
"products"
165 this%property_set%get_property_t(key_name, products), &
166 "CMAQ H2O2 reaction is missing products")
169 call reactants%iter_reset()
173 call assert(952475195, reactants%get_property_t(val=spec_props))
175 if (spec_props%get_int(key_name, temp_int)) i_spec = i_spec+temp_int-1
176 call reactants%iter_next()
184 allocate(this%condensed_data_int(num_int_prop_ + &
185 (i_spec + 2) * (i_spec + products%size())))
186 allocate(this%condensed_data_real(num_real_prop_ + products%size()))
187 this%condensed_data_int(:) = int(0, kind=
i_kind)
188 this%condensed_data_real(:) = real(0.0, kind=
dp)
191 this%num_env_params = num_env_param_
196 num_prod_ = products%size()
199 conv_ =
const%avagadro /
const%univ_gas_const * 10.0d0**(-12.0d0)
205 if (.not. this%property_set%get_real(key_name, k1_a_))
then
209 if (.not. this%property_set%get_real(key_name, k1_b_))
then
213 if (.not. this%property_set%get_real(key_name, k1_c_))
then
217 if (.not. this%property_set%get_real(key_name, k2_a_))
then
221 if (.not. this%property_set%get_real(key_name, k2_b_))
then
225 if (.not. this%property_set%get_real(key_name, k2_c_))
then
228 key_name =
"time unit"
229 if (this%property_set%get_string(key_name, string_val))
then
230 if (trim(string_val).eq.
"MIN")
then
237 k2_a_ = k2_a_ * real(1.0d6, kind=
dp)
240 call reactants%iter_reset()
245 react_(i_spec) = chem_spec_data%gas_state_id(
spec_name)
248 call assert_msg(345360993, react_(i_spec).gt.0, &
249 "Missing CMAQ H2O2 reactant: "//
spec_name)
252 call assert(796763915, reactants%get_property_t(val=spec_props))
254 if (spec_props%get_int(key_name, temp_int))
then
255 do i_qty = 1, temp_int - 1
256 react_(i_spec + i_qty) = react_(i_spec)
258 i_spec = i_spec + temp_int - 1
261 call reactants%iter_next()
266 call products%iter_reset()
271 prod_(i_spec) = chem_spec_data%gas_state_id(
spec_name)
274 call assert_msg(234948182, prod_(i_spec).gt.0, &
275 "Missing CMAQ H2O2 product: "//
spec_name)
278 call assert(267035567, products%get_property_t(val=spec_props))
280 if (spec_props%get_real(key_name, temp_real))
then
281 yield_(i_spec) = temp_real
286 call products%iter_next()