69#define RXN_ID_ this%condensed_data_int(1)
70#define REACT_ this%condensed_data_int(2)
71#define DERIV_ID_ this%condensed_data_int(3)
72#define JAC_ID_ this%condensed_data_int(4)
73#define SCALING_ this%condensed_data_real(1)
74#define NUM_INT_PROP_ 4
75#define NUM_REAL_PROP_ 1
76#define NUM_ENV_PARAM_ 2
95 procedure :: constructor
102 logical :: is_malloced = .false.
104 integer(kind=i_kind) :: rxn_unique_id = 0
123 result(update_data)
bind (c)
126 type(c_ptr) :: update_data
131 rxn_unique_id, base_rate)
bind (c)
134 type(c_ptr),
value :: update_data
136 integer(kind=c_int),
value :: rxn_unique_id
138 real(kind=c_double),
value :: base_rate
145 type(c_ptr),
value,
intent(in) :: update_data
170 subroutine initialize(this, chem_spec_data, aero_phase, aero_rep, n_cells)
181 integer(kind=i_kind),
intent(in) :: n_cells
184 character(len=:),
allocatable :: key_name, spec_name
185 integer(kind=i_kind) :: i_spec, i_qty
187 integer(kind=i_kind) :: temp_int
188 real(kind=
dp) :: temp_real
191 call assert_msg(128411383,
associated(this%property_set), &
192 "Missing property set needed to initialize reaction")
195 this%property_set%get_string(key_name,
spec_name), &
196 "First-Order Loss reaction is missing species name")
199 allocate(this%condensed_data_int(num_int_prop_))
200 allocate(this%condensed_data_real(num_real_prop_))
201 this%condensed_data_int(:) = int(0, kind=
i_kind)
202 this%condensed_data_real(:) = real(0.0, kind=
dp)
205 this%num_env_params = num_env_param_
208 key_name =
"scaling factor"
209 if (.not. this%property_set%get_real(key_name, scaling_))
then
210 scaling_ = real(1.0, kind=
dp)
214 react_ = chem_spec_data%gas_state_id(
spec_name)
218 "Missing first-order loss species: "//
spec_name)
235 prop_set => this%property_set
247 if (
associated(this%property_set)) &
248 deallocate(this%property_set)
249 if (
allocated(this%condensed_data_real)) &
250 deallocate(this%condensed_data_real)
251 if (
allocated(this%condensed_data_int)) &
252 deallocate(this%condensed_data_int)
264 integer(kind=i_kind) :: i
280 real(kind=
dp),
intent(in) :: base_rate
283 this%rxn_unique_id, base_rate)
299 integer(kind=i_kind),
intent(in) :: rxn_type
302 if (rxn_id_.eq.-1)
then
306 update_data%rxn_unique_id = rxn_id_
307 update_data%rxn_type = int(rxn_type, kind=c_int)
309 update_data%is_malloced = .true.
322 integer,
intent(in) :: comm
338 character,
intent(inout) :: buffer(:)
340 integer,
intent(inout) :: pos
342 integer,
intent(in) :: comm
345 integer :: prev_position
351 pos - prev_position <= this%pack_size(comm))
364 character,
intent(inout) :: buffer(:)
366 integer,
intent(inout) :: pos
368 integer,
intent(in) :: comm
371 integer :: prev_position
377 pos - prev_position <= this%pack_size(comm))
403 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.
Set a new first_order_loss rate.
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_first_order_loss_t type and associated functions.
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.
subroutine update_data_finalize(this)
Finalize an update data object.
subroutine update_data_rate_set(this, base_rate)
Set packed update data for first_order_loss rate constants.
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 type for building arrays.
Pointer to aero_rep_data_t extending types.
Abstract reaction data type.
Generic test reaction data type.
First-Order Loss rate update object.