122 subroutine initialize(this, chem_spec_data, aero_rep, n_cells)
131 integer(kind=i_kind),
intent(in) :: n_cells
133 type(
property_t),
pointer :: spec_props, reactants, products
134 character(len=:),
allocatable :: key_name, spec_name, string_val
135 integer(kind=i_kind) :: i_spec, i_qty
137 integer(kind=i_kind) :: temp_int
138 real(kind=
dp) :: temp_real
141 if (.not.
associated(this%property_set))
call die_msg(255324828, &
142 "Missing property set needed to initialize reaction")
143 key_name =
"reactants"
145 this%property_set%get_property_t(key_name, reactants), &
146 "Wennberg tunneling reaction is missing reactants")
147 key_name =
"products"
149 this%property_set%get_property_t(key_name, products), &
150 "Wennberg tunneling reaction is missing products")
153 call reactants%iter_reset()
157 call assert(463909147, reactants%get_property_t(val=spec_props))
159 if (spec_props%get_int(key_name, temp_int)) i_spec = i_spec+temp_int-1
160 call reactants%iter_next()
165 allocate(this%condensed_data_int(num_int_prop_ + &
166 (i_spec + 2) * (i_spec + products%size())))
167 allocate(this%condensed_data_real(num_real_prop_ + products%size()))
168 this%condensed_data_int(:) = int(0, kind=
i_kind)
169 this%condensed_data_real(:) = real(0.0, kind=
dp)
172 this%num_env_params = num_env_param_
177 num_prod_ = products%size()
180 conv_ =
const%avagadro /
const%univ_gas_const * 10.0d0**(-12.0d0)
186 if (.not. this%property_set%get_real(key_name, a_))
then
189 key_name =
"time unit"
190 if (this%property_set%get_string(key_name, string_val))
then
191 if (trim(string_val).eq.
"MIN")
then
196 if (.not. this%property_set%get_real(key_name, b_))
then
200 if (.not. this%property_set%get_real(key_name, c_))
then
205 call reactants%iter_reset()
210 react_(i_spec) = chem_spec_data%gas_state_id(
spec_name)
213 call assert_msg(292299004, react_(i_spec).gt.0, &
214 "Missing Wennberg tunneling reactant: "//
spec_name)
217 call assert(687092598, reactants%get_property_t(val=spec_props))
219 if (spec_props%get_int(key_name, temp_int))
then
220 do i_qty = 1, temp_int - 1
221 react_(i_spec + i_qty) = react_(i_spec)
223 i_spec = i_spec + temp_int - 1
226 call reactants%iter_next()
231 call products%iter_reset()
236 prod_(i_spec) = chem_spec_data%gas_state_id(
spec_name)
239 call assert_msg(681828291, prod_(i_spec).gt.0, &
240 "Missing Wennberg tunneling product: "//
spec_name)
243 call assert(794146636, products%get_property_t(val=spec_props))
245 if (spec_props%get_real(key_name, temp_real))
then
246 yield_(i_spec) = temp_real
251 call products%iter_next()