85 integer(kind=i_kind),
parameter,
public ::
gas_rxn = 1
89 integer(kind=i_kind),
parameter,
public ::
aero_rxn = 3
102 integer(kind=i_kind),
public :: rxn_phase
112 real(kind=
dp),
allocatable,
public :: condensed_data_real(:)
117 integer(kind=i_kind),
allocatable,
public :: condensed_data_int(:)
121 integer(kind=i_kind),
public :: num_env_params = 0
162 integer(kind=c_int) :: rxn_type
164 integer(kind=c_int) :: rxn_solver_id = 0
166 integer(kind=c_int) :: cell_id = 1
168 type(c_ptr) :: update_data
203 subroutine initialize(this, chem_spec_data, aero_phase, aero_rep, n_cells)
217 integer(kind=i_kind),
intent(in) :: n_cells
231 integer,
intent(in) :: comm
244 character,
intent(inout) :: buffer(:)
246 integer,
intent(inout) :: pos
248 integer,
intent(in) :: comm
261 character,
intent(inout) :: buffer(:)
263 integer,
intent(inout) :: pos
265 integer,
intent(in) :: comm
347 subroutine load(this, json, j_obj)
352 type(json_core),
pointer,
intent(in) :: json
354 type(json_value),
pointer,
intent(in) :: j_obj
356 type(json_value),
pointer :: child, next
357 character(kind=json_ck, len=:),
allocatable :: key
358 character(len=:),
allocatable :: owner_name
364 owner_name =
"reaction"
369 call json%get_child(j_obj, child)
370 do while (
associated(child))
371 call json%info(child, name=key)
372 if (key.ne.
"rxn type")
call this%property_set%load(json, child, &
375 call json%get_next(child, next)
379 subroutine load(this)
384 call warn_msg(332862889,
"No support for input files")
401 integer(kind=i_kind),
intent(in) :: rxn_phase
404 rxn_phase.eq.this%rxn_phase .or. &
421 integer,
intent(in) :: comm
439 character,
intent(inout) :: buffer(:)
441 integer,
intent(inout) :: pos
443 integer,
intent(in) :: comm
446 integer :: prev_position
453 call assert(149359274, &
454 pos - prev_position <= this%pack_size(comm))
467 character,
intent(inout) :: buffer(:)
469 integer,
intent(inout) :: pos
471 integer,
intent(in) :: comm
474 integer :: prev_position
482 call assert(168345796, &
483 pos - prev_position <= this%pack_size(comm))
496 integer(kind=i_kind),
optional :: file_unit
498 integer(kind=i_kind) :: f_unit
502 if (
present(file_unit)) f_unit = file_unit
503 write(f_unit,*)
"*** Rxn ***"
504 if (
associated(this%property_set))
call this%property_set%print(f_unit)
505 if (
allocated(this%condensed_data_int)) &
506 write (f_unit,*)
" *** condensed data int: ", &
507 this%condensed_data_int(:)
508 if (
allocated(this%condensed_data_real)) &
509 write (f_unit,*)
" *** condensed data real: ", &
510 this%condensed_data_real(:)
533 if (
associated(this%val))
deallocate(this%val)
559 integer(kind=c_int) :: rxn_type
563 rxn_type = this%rxn_type
573 integer(kind=c_int) :: cell_id
577 cell_id = this%cell_id
587 type(c_ptr) :: update_data
591 update_data = this%update_data
604 integer,
intent(in),
optional :: comm
609 if (
present(comm))
then
612 l_comm = mpi_comm_world
619 this%internal_pack_size(l_comm)
634 character,
intent(inout) :: buffer(:)
636 integer,
intent(inout) :: pos
638 integer,
intent(in),
optional :: comm
641 integer :: prev_position, l_comm
643 if (
present(comm))
then
646 l_comm = mpi_comm_world
651 int(this%rxn_type, kind=
i_kind), l_comm)
653 int(this%rxn_solver_id, kind=
i_kind), l_comm)
654 call this%internal_bin_pack(buffer, pos, l_comm)
655 call assert(713360087, &
656 pos - prev_position <= this%pack_size(l_comm))
669 character,
intent(inout) :: buffer(:)
671 integer,
intent(inout) :: pos
673 integer,
intent(in),
optional :: comm
676 integer :: prev_position, l_comm
677 integer(kind=i_kind) :: temp_int
679 if (
present(comm))
then
682 l_comm = mpi_comm_world
687 this%rxn_type = int(temp_int, kind=c_int)
689 this%rxn_solver_id = int(temp_int, kind=c_int)
690 call this%internal_bin_unpack(buffer, pos, l_comm)
691 call assert(107364895, &
692 pos - prev_position <= this%pack_size(l_comm))
705 integer(kind=i_kind),
optional :: file_unit
707 integer(kind=i_kind) :: f_unit
711 if (
present(file_unit)) f_unit = file_unit
713 write(f_unit,*)
"*** Reaction update data ***"
714 write(f_unit,*)
"Rxn type", this%rxn_type
715 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.