86 integer(kind=i_kind),
parameter,
public ::
gas_rxn = 1
90 integer(kind=i_kind),
parameter,
public ::
aero_rxn = 3
103 integer(kind=i_kind),
public :: rxn_phase
113 real(kind=
dp),
allocatable,
public :: condensed_data_real(:)
118 integer(kind=i_kind),
allocatable,
public :: condensed_data_int(:)
122 integer(kind=i_kind),
public :: num_env_params = 0
163 integer(kind=c_int) :: rxn_type
165 integer(kind=c_int) :: rxn_solver_id = 0
167 integer(kind=c_int) :: cell_id = 1
169 type(c_ptr) :: update_data
204 subroutine initialize(this, chem_spec_data, aero_phase, aero_rep, n_cells)
218 integer(kind=i_kind),
intent(in) :: n_cells
232 integer,
intent(in) :: comm
245 character,
intent(inout) :: buffer(:)
247 integer,
intent(inout) :: pos
249 integer,
intent(in) :: comm
262 character,
intent(inout) :: buffer(:)
264 integer,
intent(inout) :: pos
266 integer,
intent(in) :: comm
349 subroutine load(this, json, j_obj)
354 type(json_core),
pointer,
intent(in) :: json
356 type(json_value),
pointer,
intent(in) :: j_obj
358 type(json_value),
pointer :: child, next
359 character(kind=json_ck, len=:),
allocatable :: key
360 character(len=:),
allocatable :: owner_name
366 owner_name =
"reaction"
371 call json%get_child(j_obj, child)
372 do while (
associated(child))
373 call json%info(child, name=key)
374 if (key.ne.
"rxn type")
call this%property_set%load(json, child, &
377 call json%get_next(child, next)
381 subroutine load(this)
386 call warn_msg(332862889,
"No support for input files")
403 integer(kind=i_kind),
intent(in) :: rxn_phase
406 rxn_phase.eq.this%rxn_phase .or. &
423 integer,
intent(in) :: comm
441 character,
intent(inout) :: buffer(:)
443 integer,
intent(inout) :: pos
445 integer,
intent(in) :: comm
448 integer :: prev_position
455 call assert(149359274, &
456 pos - prev_position <= this%pack_size(comm))
469 character,
intent(inout) :: buffer(:)
471 integer,
intent(inout) :: pos
473 integer,
intent(in) :: comm
476 integer :: prev_position
484 call assert(168345796, &
485 pos - prev_position <= this%pack_size(comm))
498 integer(kind=i_kind),
optional :: file_unit
500 integer(kind=i_kind) :: f_unit
504 if (
present(file_unit)) f_unit = file_unit
505 write(f_unit,*)
"*** Rxn ***"
506 if (
associated(this%property_set))
call this%property_set%print(f_unit)
507 if (
allocated(this%condensed_data_int)) &
508 write (f_unit,*)
" *** condensed data int: ", &
509 this%condensed_data_int(:)
510 if (
allocated(this%condensed_data_real)) &
511 write (f_unit,*)
" *** condensed data real: ", &
512 this%condensed_data_real(:)
535 if (
associated(this%val))
deallocate(this%val)
561 integer(kind=c_int) :: rxn_type
565 rxn_type = this%rxn_type
575 integer(kind=c_int) :: cell_id
579 cell_id = this%cell_id
589 type(c_ptr) :: update_data
593 update_data = this%update_data
606 integer,
intent(in),
optional :: comm
611 if (
present(comm))
then
614 l_comm = mpi_comm_world
621 this%internal_pack_size(l_comm)
636 character,
intent(inout) :: buffer(:)
638 integer,
intent(inout) :: pos
640 integer,
intent(in),
optional :: comm
643 integer :: prev_position, l_comm
645 if (
present(comm))
then
648 l_comm = mpi_comm_world
653 int(this%rxn_type, kind=
i_kind), l_comm)
655 int(this%rxn_solver_id, kind=
i_kind), l_comm)
656 call this%internal_bin_pack(buffer, pos, l_comm)
657 call assert(713360087, &
658 pos - prev_position <= this%pack_size(l_comm))
671 character,
intent(inout) :: buffer(:)
673 integer,
intent(inout) :: pos
675 integer,
intent(in),
optional :: comm
678 integer :: prev_position, l_comm
679 integer(kind=i_kind) :: temp_int
681 if (
present(comm))
then
684 l_comm = mpi_comm_world
689 this%rxn_type = int(temp_int, kind=c_int)
691 this%rxn_solver_id = int(temp_int, kind=c_int)
692 call this%internal_bin_unpack(buffer, pos, l_comm)
693 call assert(107364895, &
694 pos - prev_position <= this%pack_size(l_comm))
707 integer(kind=i_kind),
optional :: file_unit
709 integer(kind=i_kind) :: f_unit
713 if (
present(file_unit)) f_unit = file_unit
715 write(f_unit,*)
"*** Reaction update data ***"
716 write(f_unit,*)
"Rxn type", this%rxn_type
717 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_phase_data_t structure and associated subroutines.
subroutine bin_unpack(this, buffer, pos, comm)
Unpack the given value from the buffer, advancing position.
subroutine ptr_finalize_array(this)
Finalize an array of pointers to aerosol phase data.
subroutine bin_pack(this, buffer, pos, comm)
Pack the given value to the buffer, advancing position.
subroutine load(this, json, j_obj)
Load species from an input file.
integer(kind=i_kind) function pack_size(this, comm)
Determine the size of a binary required to pack the aerosol representation data.
subroutine ptr_finalize(this)
Finalize a pointer to aerosol phase data.
subroutine do_print(this, file_unit)
Print out the aerosol phase data.
elemental subroutine dereference(this)
Dereference a pointer to aerosol phase 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.
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 type for building arrays.
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.