68#define RXN_ID_ this%condensed_data_int(1)
69#define REACT_ this%condensed_data_int(2)
70#define DERIV_ID_ this%condensed_data_int(3)
71#define JAC_ID_ this%condensed_data_int(4)
72#define SCALING_ this%condensed_data_real(1)
73#define NUM_INT_PROP_ 4
74#define NUM_REAL_PROP_ 1
75#define NUM_ENV_PARAM_ 2
101 logical :: is_malloced = .false.
103 integer(kind=i_kind) :: rxn_unique_id = 0
122 result(update_data)
bind (c)
125 type(c_ptr) :: update_data
130 rxn_unique_id, base_rate)
bind (c)
133 type(c_ptr),
value :: update_data
135 integer(kind=c_int),
value :: rxn_unique_id
137 real(kind=c_double),
value :: base_rate
144 type(c_ptr),
value,
intent(in) :: update_data
169 subroutine initialize(this, chem_spec_data, 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(128411383,
associated(this%property_set), &
189 "Missing property set needed to initialize reaction")
192 this%property_set%get_string(key_name,
spec_name), &
193 "First-Order Loss 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 react_ = chem_spec_data%gas_state_id(
spec_name)
215 "Missing first-order loss species: "//
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 real(kind=
dp),
intent(in) :: base_rate
264 this%rxn_unique_id, base_rate)
280 integer(kind=i_kind),
intent(in) :: rxn_type
283 if (rxn_id_.eq.-1)
then
287 update_data%rxn_unique_id = rxn_id_
288 update_data%rxn_type = int(rxn_type, kind=c_int)
290 update_data%is_malloced = .true.
303 integer,
intent(in) :: comm
319 character,
intent(inout) :: buffer(:)
321 integer,
intent(inout) :: pos
323 integer,
intent(in) :: comm
326 integer :: prev_position
332 pos - prev_position <= this%pack_size(comm))
345 character,
intent(inout) :: buffer(:)
347 integer,
intent(inout) :: pos
349 integer,
intent(in) :: comm
352 integer :: prev_position
358 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.
Set a new first_order_loss rate.
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_first_order_loss_t type and associated functions.
subroutine update_data_initialize(this, update_data, rxn_type)
Initialize update data.
subroutine update_data_rate_set(this, base_rate)
Set packed update data for first_order_loss rate constants.
elemental subroutine update_data_finalize(this)
Finalize an update data object.
Common utility subroutines.
subroutine assert(code, condition_ok)
Errors unless condition_ok is true.
subroutine die_msg(code, error_msg)
Error immediately.
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.
First-Order Loss rate update object.