84 integer(kind=i_kind),
parameter,
public ::
gas_rxn = 1
88 integer(kind=i_kind),
parameter,
public ::
aero_rxn = 3
101 integer(kind=i_kind),
public :: rxn_phase
111 real(kind=
dp),
allocatable,
public :: condensed_data_real(:)
116 integer(kind=i_kind),
allocatable,
public :: condensed_data_int(:)
120 integer(kind=i_kind),
public :: num_env_params = 0
161 integer(kind=c_int) :: rxn_type
163 integer(kind=c_int) :: rxn_solver_id = 0
165 integer(kind=c_int) :: cell_id = 1
167 type(c_ptr) :: update_data
202 subroutine initialize(this, chem_spec_data, aero_rep, n_cells)
213 integer(kind=i_kind),
intent(in) :: n_cells
227 integer,
intent(in) :: comm
240 character,
intent(inout) :: buffer(:)
242 integer,
intent(inout) :: pos
244 integer,
intent(in) :: comm
257 character,
intent(inout) :: buffer(:)
259 integer,
intent(inout) :: pos
261 integer,
intent(in) :: comm
343 subroutine load(this, json, j_obj)
348 type(json_core),
pointer,
intent(in) :: json
350 type(json_value),
pointer,
intent(in) :: j_obj
352 type(json_value),
pointer :: child, next
353 character(kind=json_ck, len=:),
allocatable :: key
354 character(len=:),
allocatable :: owner_name
360 owner_name =
"reaction"
365 call json%get_child(j_obj, child)
366 do while (
associated(child))
367 call json%info(child, name=key)
368 if (key.ne.
"rxn type")
call this%property_set%load(json, child, &
371 call json%get_next(child, next)
375 subroutine load(this)
380 call warn_msg(332862889,
"No support for input files")
397 integer(kind=i_kind),
intent(in) :: rxn_phase
400 rxn_phase.eq.this%rxn_phase .or. &
417 integer,
intent(in) :: comm
435 character,
intent(inout) :: buffer(:)
437 integer,
intent(inout) :: pos
439 integer,
intent(in) :: comm
442 integer :: prev_position
449 call assert(149359274, &
450 pos - prev_position <= this%pack_size(comm))
463 character,
intent(inout) :: buffer(:)
465 integer,
intent(inout) :: pos
467 integer,
intent(in) :: comm
470 integer :: prev_position
478 call assert(168345796, &
479 pos - prev_position <= this%pack_size(comm))
492 integer(kind=i_kind),
optional :: file_unit
494 integer(kind=i_kind) :: f_unit
498 if (
present(file_unit)) f_unit = file_unit
499 write(f_unit,*)
"*** Rxn ***"
500 if (
associated(this%property_set))
call this%property_set%print(f_unit)
501 if (
allocated(this%condensed_data_int)) &
502 write (f_unit,*)
" *** condensed data int: ", &
503 this%condensed_data_int(:)
504 if (
allocated(this%condensed_data_real)) &
505 write (f_unit,*)
" *** condensed data real: ", &
506 this%condensed_data_real(:)
529 if (
associated(this%val))
deallocate(this%val)
539 integer(kind=c_int) :: rxn_type
543 rxn_type = this%rxn_type
553 integer(kind=c_int) :: cell_id
557 cell_id = this%cell_id
567 type(c_ptr) :: update_data
571 update_data = this%update_data
584 integer,
intent(in),
optional :: comm
589 if (
present(comm))
then
592 l_comm = mpi_comm_world
599 this%internal_pack_size(l_comm)
614 character,
intent(inout) :: buffer(:)
616 integer,
intent(inout) :: pos
618 integer,
intent(in),
optional :: comm
621 integer :: prev_position, l_comm
623 if (
present(comm))
then
626 l_comm = mpi_comm_world
631 int(this%rxn_type, kind=
i_kind), l_comm)
633 int(this%rxn_solver_id, kind=
i_kind), l_comm)
634 call this%internal_bin_pack(buffer, pos, l_comm)
635 call assert(713360087, &
636 pos - prev_position <= this%pack_size(l_comm))
649 character,
intent(inout) :: buffer(:)
651 integer,
intent(inout) :: pos
653 integer,
intent(in),
optional :: comm
656 integer :: prev_position, l_comm
657 integer(kind=i_kind) :: temp_int
659 if (
present(comm))
then
662 l_comm = mpi_comm_world
667 this%rxn_type = int(temp_int, kind=c_int)
669 this%rxn_solver_id = int(temp_int, kind=c_int)
670 call this%internal_bin_unpack(buffer, pos, l_comm)
671 call assert(107364895, &
672 pos - prev_position <= this%pack_size(l_comm))
685 integer(kind=i_kind),
optional :: file_unit
687 integer(kind=i_kind) :: f_unit
691 if (
present(file_unit)) f_unit = file_unit
693 write(f_unit,*)
"*** Reaction update data ***"
694 write(f_unit,*)
"Rxn type", this%rxn_type
695 write(f_unit,*)
"Rxn solver id", this%rxn_solver_id
Reaction initialization. Takes species, phase and reaction parameters and packs required information ...
Extending-type binary pack function (Internal use only)
Extending-type binary unpack function (Internal use only)
Extending-type binary pack size (internal use only)
The abstract aero_rep_data_t structure and associated subroutines.
subroutine do_print(this, file_unit)
Print the aerosol representation data.
integer(kind=i_kind) function pack_size(this, comm)
Determine the size of a binary required to pack the aerosol representation data.
subroutine load(this, json, j_obj)
Load an aerosol representation from an input file.
subroutine bin_unpack(this, buffer, pos, comm)
Unpack the given value from the buffer, advancing position.
elemental subroutine dereference(this)
Deference a pointer to an aerosol representation.
subroutine bin_pack(this, buffer, pos, comm)
Pack the given value to the buffer, advancing position.
elemental subroutine ptr_finalize(this)
Finalize a pointer to an aerosol representation.
The camp_state_t structure and associated subroutines.
The chem_spec_data_t structure and associated subroutines.
logical function get_type(this, spec_name, spec_type)
Get a species type by species name. Returns true if the species is found or false otherwise.
integer, parameter dp
Kind of a double precision real number.
integer, parameter i_kind
Kind of an integer.
Wrapper functions for MPI.
subroutine camp_mpi_pack_integer_array(buffer, position, val, comm)
Packs the given value into the buffer, advancing position.
subroutine camp_mpi_pack_real_array(buffer, position, val, comm)
Packs the given value into the buffer, advancing position.
subroutine camp_mpi_unpack_integer_array(buffer, position, val, comm)
Unpacks the given value from the buffer, advancing position.
subroutine camp_mpi_unpack_integer(buffer, position, val, comm)
Unpacks the given value from the buffer, advancing position.
integer function camp_mpi_pack_size_real_array(val, comm)
Determines the number of bytes required to pack the given value.
integer function camp_mpi_pack_size_integer_array(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.
subroutine camp_mpi_unpack_real_array(buffer, position, val, comm)
Unpacks the given value from the buffer, advancing position.
The property_t structure and associated subroutines.
The rxn_data_t structure and associated subroutines.
subroutine do_rxn_update_data_print(this, file_unit)
Print the update data.
integer(kind=c_int) function rxn_update_data_get_cell_id(this)
Get the grid cell id to update.
integer(kind=i_kind), parameter, public gas_rxn
Gas-phase reaction.
integer(kind=i_kind), parameter, public gas_aero_rxn
Mixed-phase (gas and aerosol) reaction.
integer(kind=i_kind), parameter, public aero_rxn
Aerosol-phase reaction.
subroutine rxn_update_data_bin_pack(this, buffer, pos, comm)
Pack the given value to the buffer, advancing position.
subroutine rxn_update_data_bin_unpack(this, buffer, pos, comm)
Unpack the given value from the buffer, advancing position.
integer(kind=c_int) function rxn_update_data_get_type(this)
Get the update data reaction type.
type(c_ptr) function rxn_update_data_get_data(this)
Get the update data.
logical function check_phase(this, rxn_phase)
Check the phase of the reaction against the phase being solved for. During GAS_RXN integrations,...
integer(kind=i_kind) function rxn_update_data_pack_size(this, comm)
Determine the size of a binary required to pack the reaction data.
Common utility subroutines.
subroutine die_msg(code, error_msg)
Error immediately.
Pointer to aero_rep_data_t extending types.
Pointer type for building arrays of mixed reactions.
Abstract reaction data type.
String type for building arrays of string of various size.