66#define RXN_ID_ this%condensed_data_int(1)
67#define SPECIES_ this%condensed_data_int(2)
68#define DERIV_ID_ this%condensed_data_int(3)
69#define SCALING_ this%condensed_data_real(1)
70#define NUM_INT_PROP_ 3
71#define NUM_REAL_PROP_ 1
72#define NUM_ENV_PARAM_ 2
98 logical :: is_malloced = .false.
100 integer(kind=i_kind) :: rxn_unique_id = 0
119 result(update_data)
bind (c)
122 type(c_ptr) :: update_data
127 rxn_unique_id, base_rate)
bind (c)
130 type(c_ptr),
value :: update_data
132 integer(kind=c_int),
value :: rxn_unique_id
134 real(kind=c_double),
value :: base_rate
141 type(c_ptr),
value,
intent(in) :: update_data
166 subroutine initialize(this, chem_spec_data, aero_rep, n_cells)
175 integer(kind=i_kind),
intent(in) :: n_cells
178 character(len=:),
allocatable :: key_name, spec_name
179 integer(kind=i_kind) :: i_spec, i_qty
181 integer(kind=i_kind) :: temp_int
182 real(kind=
dp) :: temp_real
185 call assert_msg(135066145,
associated(this%property_set), &
186 "Missing property set needed to initialize reaction")
189 this%property_set%get_string(key_name,
spec_name), &
190 "Emission reaction is missing species name")
193 allocate(this%condensed_data_int(num_int_prop_))
194 allocate(this%condensed_data_real(num_real_prop_))
195 this%condensed_data_int(:) = int(0, kind=
i_kind)
196 this%condensed_data_real(:) = real(0.0, kind=
dp)
199 this%num_env_params = num_env_param_
202 key_name =
"scaling factor"
203 if (.not. this%property_set%get_real(key_name, scaling_))
then
204 scaling_ = real(1.0, kind=
dp)
208 species_ = chem_spec_data%gas_state_id(
spec_name)
229 prop_set => this%property_set
241 if (
associated(this%property_set)) &
242 deallocate(this%property_set)
243 if (
allocated(this%condensed_data_real)) &
244 deallocate(this%condensed_data_real)
245 if (
allocated(this%condensed_data_int)) &
246 deallocate(this%condensed_data_int)
258 real(kind=
dp),
intent(in) :: base_rate
261 this%rxn_unique_id, base_rate)
277 integer(kind=i_kind),
intent(in) :: rxn_type
280 if (rxn_id_.eq.-1)
then
284 update_data%rxn_unique_id = rxn_id_
285 update_data%rxn_type = int(rxn_type, kind=c_int)
287 update_data%is_malloced = .true.
300 integer,
intent(in) :: comm
316 character,
intent(inout) :: buffer(:)
318 integer,
intent(inout) :: pos
320 integer,
intent(in) :: comm
323 integer :: prev_position
329 pos - prev_position <= this%pack_size(comm))
342 character,
intent(inout) :: buffer(:)
344 integer,
intent(inout) :: pos
346 integer,
intent(in) :: comm
349 integer :: prev_position
355 pos - prev_position <= this%pack_size(comm))
Initialize the aerosol representation data, validating component data and loading any required inform...
Extending-type binary pack function (Internal use only)
Extending-type binary unpack function (Internal use only)
Extending-type binary pack size (internal use only)
Get the non-unique name of a chemical species by its unique name.
Interface to c reaction functions.
Free an update rate data object.
Interface for to_string functions.
The abstract aero_rep_data_t structure and associated subroutines.
integer(kind=i_kind) function pack_size(this, comm)
Determine the size of a binary required to pack the aerosol representation data.
The camp_state_t structure and associated subroutines.
elemental subroutine finalize(this)
Finalize the state.
The chem_spec_data_t structure and associated subroutines.
type(chem_spec_data_t) function, pointer constructor(init_size)
Constructor for chem_spec_data_t.
logical function get_property_set(this, spec_name, property_set)
Get a species property set. Returns true if the species is found, or false otherwise.
integer, parameter dp
Kind of a double precision real number.
type(const_t), save const
Fixed variable for accessing the constant's values.
integer, parameter i_kind
Kind of an integer.
Wrapper functions for MPI.
subroutine camp_mpi_pack_logical(buffer, position, val, comm)
Packs the given value into the buffer, advancing position.
subroutine camp_mpi_unpack_integer(buffer, position, val, comm)
Unpacks the given value from the buffer, advancing position.
subroutine camp_mpi_unpack_logical(buffer, position, val, comm)
Unpacks the given value from the buffer, advancing position.
integer function camp_mpi_pack_size_logical(val, comm)
Determines the number of bytes required to pack the given value.
subroutine camp_mpi_pack_integer(buffer, position, val, comm)
Packs the given value into the buffer, advancing position.
integer function camp_mpi_pack_size_integer(val, comm)
Determines the number of bytes required to pack the given value.
The property_t structure and associated subroutines.
Random number generators.
integer(kind=i_kind) function generate_int_id()
Generate an integer id Ids will be sequential, and can only be generated by the primary process.
The rxn_data_t structure and associated subroutines.
integer(kind=i_kind), parameter, public gas_rxn
Gas-phase reaction.
The rxn_emission_t type and associated functions.
subroutine update_data_rate_set(this, base_rate)
Set packed update data for emission rate constants.
elemental subroutine update_data_finalize(this)
Finalize an update data object.
subroutine update_data_initialize(this, update_data, rxn_type)
Initialize update data.
Common utility subroutines.
subroutine assert(code, condition_ok)
Errors unless condition_ok is true.
subroutine assert_msg(code, condition_ok, error_msg)
Errors unless condition_ok is true.
Pointer to aero_rep_data_t extending types.
Abstract reaction data type.
Generic test reaction data type.
Emission rate update object.