123 subroutine initialize(this, chem_spec_data, aero_phase, aero_rep, n_cells)
134 integer(kind=i_kind),
intent(in) :: n_cells
136 type(
property_t),
pointer :: spec_props, reactants, products
137 character(len=:),
allocatable :: key_name, spec_name, string_val
138 integer(kind=i_kind) :: i_spec, i_qty
140 integer(kind=i_kind) :: temp_int
141 real(kind=
dp) :: temp_real
144 if (.not.
associated(this%property_set))
call die_msg(255324828, &
145 "Missing property set needed to initialize reaction")
146 key_name =
"reactants"
148 this%property_set%get_property_t(key_name, reactants), &
149 "Wennberg tunneling reaction is missing reactants")
150 key_name =
"products"
152 this%property_set%get_property_t(key_name, products), &
153 "Wennberg tunneling reaction is missing products")
156 call reactants%iter_reset()
160 call assert(463909147, reactants%get_property_t(val=spec_props))
162 if (spec_props%get_int(key_name, temp_int)) i_spec = i_spec+temp_int-1
163 call reactants%iter_next()
168 allocate(this%condensed_data_int(num_int_prop_ + &
169 (i_spec + 2) * (i_spec + products%size())))
170 allocate(this%condensed_data_real(num_real_prop_ + products%size()))
171 this%condensed_data_int(:) = int(0, kind=
i_kind)
172 this%condensed_data_real(:) = real(0.0, kind=
dp)
175 this%num_env_params = num_env_param_
180 num_prod_ = products%size()
183 conv_ =
const%avagadro /
const%univ_gas_const * 10.0d0**(-12.0d0)
189 if (.not. this%property_set%get_real(key_name, a_))
then
192 key_name =
"time unit"
193 if (this%property_set%get_string(key_name, string_val))
then
194 if (trim(string_val).eq.
"MIN")
then
199 if (.not. this%property_set%get_real(key_name, b_))
then
203 if (.not. this%property_set%get_real(key_name, c_))
then
208 call reactants%iter_reset()
213 react_(i_spec) = chem_spec_data%gas_state_id(
spec_name)
216 call assert_msg(292299004, react_(i_spec).gt.0, &
217 "Missing Wennberg tunneling reactant: "//
spec_name)
220 call assert(687092598, reactants%get_property_t(val=spec_props))
222 if (spec_props%get_int(key_name, temp_int))
then
223 do i_qty = 1, temp_int - 1
224 react_(i_spec + i_qty) = react_(i_spec)
226 i_spec = i_spec + temp_int - 1
229 call reactants%iter_next()
234 call products%iter_reset()
239 prod_(i_spec) = chem_spec_data%gas_state_id(
spec_name)
242 call assert_msg(681828291, prod_(i_spec).gt.0, &
243 "Missing Wennberg tunneling product: "//
spec_name)
246 call assert(794146636, products%get_property_t(val=spec_props))
248 if (spec_props%get_real(key_name, temp_real))
then
249 yield_(i_spec) = temp_real
254 call products%iter_next()