67#define RXN_ID_ this%condensed_data_int(1)
68#define SPECIES_ this%condensed_data_int(2)
69#define DERIV_ID_ this%condensed_data_int(3)
70#define SCALING_ this%condensed_data_real(1)
71#define NUM_INT_PROP_ 3
72#define NUM_REAL_PROP_ 1
73#define NUM_ENV_PARAM_ 2
92 procedure :: constructor
99 logical :: is_malloced = .false.
101 integer(kind=i_kind) :: rxn_unique_id = 0
120 result(update_data)
bind (c)
123 type(c_ptr) :: update_data
128 rxn_unique_id, base_rate)
bind (c)
131 type(c_ptr),
value :: update_data
133 integer(kind=c_int),
value :: rxn_unique_id
135 real(kind=c_double),
value :: base_rate
142 type(c_ptr),
value,
intent(in) :: update_data
167 subroutine initialize(this, chem_spec_data, aero_phase, aero_rep, n_cells)
178 integer(kind=i_kind),
intent(in) :: n_cells
181 character(len=:),
allocatable :: key_name, spec_name
182 integer(kind=i_kind) :: i_spec, i_qty
184 integer(kind=i_kind) :: temp_int
185 real(kind=
dp) :: temp_real
188 call assert_msg(135066145,
associated(this%property_set), &
189 "Missing property set needed to initialize reaction")
192 this%property_set%get_string(key_name,
spec_name), &
193 "Emission reaction is missing species name")
196 allocate(this%condensed_data_int(num_int_prop_))
197 allocate(this%condensed_data_real(num_real_prop_))
198 this%condensed_data_int(:) = int(0, kind=
i_kind)
199 this%condensed_data_real(:) = real(0.0, kind=
dp)
202 this%num_env_params = num_env_param_
205 key_name =
"scaling factor"
206 if (.not. this%property_set%get_real(key_name, scaling_))
then
207 scaling_ = real(1.0, kind=
dp)
211 species_ = chem_spec_data%gas_state_id(
spec_name)
232 prop_set => this%property_set
244 if (
associated(this%property_set)) &
245 deallocate(this%property_set)
246 if (
allocated(this%condensed_data_real)) &
247 deallocate(this%condensed_data_real)
248 if (
allocated(this%condensed_data_int)) &
249 deallocate(this%condensed_data_int)
261 integer(kind=i_kind) :: i
277 real(kind=
dp),
intent(in) :: base_rate
280 this%rxn_unique_id, base_rate)
296 integer(kind=i_kind),
intent(in) :: rxn_type
299 if (rxn_id_.eq.-1)
then
303 update_data%rxn_unique_id = rxn_id_
304 update_data%rxn_type = int(rxn_type, kind=c_int)
306 update_data%is_malloced = .true.
319 integer,
intent(in) :: comm
335 character,
intent(inout) :: buffer(:)
337 integer,
intent(inout) :: pos
339 integer,
intent(in) :: comm
342 integer :: prev_position
348 pos - prev_position <= this%pack_size(comm))
361 character,
intent(inout) :: buffer(:)
363 integer,
intent(inout) :: pos
365 integer,
intent(in) :: comm
368 integer :: prev_position
374 pos - prev_position <= this%pack_size(comm))
400 integer(kind=i_kind) :: i
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_phase_data_t structure and associated subroutines.
subroutine finalize_array(this)
Finalize the aerosol phase data.
class(property_t) function, pointer get_property_set(this)
Get the aerosol phase property set.
type(aero_phase_data_t) function, pointer constructor(phase_name, init_size)
Constructor for aero_phase_data_t.
subroutine finalize(this)
Finalize the aerosol phase data.
integer(kind=i_kind) function pack_size(this, comm)
Determine the size of a binary required to pack the aerosol representation data.
The abstract aero_rep_data_t structure and associated subroutines.
The camp_state_t structure and associated subroutines.
The chem_spec_data_t structure and associated subroutines.
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.
subroutine update_data_finalize(this)
Finalize an update data object.
subroutine update_data_finalize_array(this)
Finalize an array of update data objects.
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 type for building arrays.
Pointer to aero_rep_data_t extending types.
Abstract reaction data type.
Generic test reaction data type.
Emission rate update object.