213 integer(kind=i_kind),
parameter,
public ::
rxn_troe = 2
257 function create(this, type_name)
result (new_obj)
264 character(len=*),
intent(in) :: type_name
269 select case (type_name)
276 case (
"CMAQ_OH_HNO3")
280 case (
"HL_PHASE_TRANSFER")
282 case (
"AQUEOUS_EQUILIBRIUM")
284 case (
"SIMPOL_PHASE_TRANSFER")
286 case (
"CONDENSED_PHASE_ARRHENIUS")
288 case (
"CONDENSED_PHASE_PHOTOLYSIS")
290 case (
"FIRST_ORDER_LOSS")
294 case (
"WET_DEPOSITION")
296 case (
"TERNARY_CHEMICAL_ACTIVATION")
298 case (
"WENNBERG_TUNNELING")
300 case (
"WENNBERG_NO_RO2")
305 call die_msg(367114278,
"Unknown chemical reaction type: " &
315 function load(this, json, j_obj)
result (new_obj)
322 type(json_core),
pointer,
intent(in) :: json
324 type(json_value),
pointer,
intent(in) :: j_obj
326 character(kind=json_ck, len=:),
allocatable :: unicode_type_name
327 character(len=:),
allocatable :: type_name
328 logical(kind=json_lk) :: found
333 call json%get(j_obj,
"type", unicode_type_name, found)
334 call assert_msg(137665576, found,
'Missing chemical reaction type.')
335 type_name = unicode_type_name
338 new_obj => this%create(type_name)
341 call new_obj%load(json, j_obj)
345 function load(this)
result (new_obj)
354 call warn_msg(979827016,
"No support for input files.")
361 integer(kind=i_kind) function get_type(this, rxn)
result (rxn_type)
404 call die_msg(343941184,
"Unknown reaction type.")
421 select type (update_data)
427 call die_msg(519416239,
"Update data <-> rxn mismatch")
432 call rxn%update_data_initialize(update_data,
rxn_emission)
434 call die_msg(395116041,
"Update data <-> rxn mismatch")
441 call die_msg(172384885,
"Update data <-> rxn mismatch")
448 call die_msg(284703230,
"Update data <-> rxn mismatch")
455 call die_msg(284703230,
"Update data <-> rxn mismatch")
458 call die_msg(239438576,
"Internal error - update data type missing.")
466 integer(kind=i_kind) function pack_size(this, rxn, comm)
473 integer,
intent(in) :: comm
490 character,
intent(inout) :: buffer(:)
492 integer,
intent(inout) :: pos
494 integer,
intent(in) :: comm
497 integer :: rxn_type, i_rxn, prev_position
536 call die_msg(343941184,
"Trying to pack reaction of unknown type.")
539 call rxn%bin_pack(buffer, pos, comm)
541 pos - prev_position <= this%pack_size(rxn, comm))
556 character,
intent(inout) :: buffer(:)
558 integer,
intent(inout) :: pos
560 integer,
intent(in) :: comm
563 integer :: rxn_type, i_rxn, prev_position
567 select case (rxn_type)
604 "Trying to unpack reaction of unknown type:"// &
607 call rxn%bin_unpack(buffer, pos, comm)
609 pos - prev_position <= this%pack_size(rxn, comm))
Interface for to_string functions.
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_unpack_integer(buffer, position, val, comm)
Unpacks the given value from the buffer, advancing position.
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 rxn_aqueous_equilibrium_t type and associated functions.
The rxn_arrhenius_t type and associated functions.
The rxn_CMAQ_H2O2_t type and associated functions.
The rxn_CMAQ_OH_HNO3_t type and associated functions.
The rxn_condensed_phase_arrhenius_t type and associated functions.
The rxn_condensed_phase_photolysis_t type and associated functions.
The rxn_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 reaction data.
subroutine bin_pack(this, buffer, pos, comm)
Pack the given value to the buffer, advancing position.
subroutine bin_unpack(this, buffer, pos, comm)
Unpack the given value from the buffer, advancing position.
subroutine load(this, json, j_obj)
Load reactions from an input file.
The rxn_emission_t type and associated functions.
The abstract rxn_factory_t structure and associated subroutines.
integer(kind=i_kind), parameter, public rxn_photolysis
integer(kind=i_kind), parameter, public rxn_condensed_phase_arrhenius
integer(kind=i_kind), parameter, public rxn_surface
integer(kind=i_kind), parameter, public rxn_condensed_phase_photolysis
integer(kind=i_kind), parameter, public rxn_cmaq_oh_hno3
class(rxn_data_t) function, pointer create(this, type_name)
Create a new chemical reaction by type name.
integer(kind=i_kind), parameter, public rxn_ternary_chemical_activation
integer(kind=i_kind), parameter, public rxn_first_order_loss
integer(kind=i_kind) function get_type(this, rxn)
Get the reaction type as a RxnType.
integer(kind=i_kind), parameter, public rxn_troe
integer(kind=i_kind), parameter, public rxn_simpol_phase_transfer
integer(kind=i_kind), parameter, public rxn_cmaq_h2o2
integer(kind=i_kind), parameter, public rxn_emission
integer(kind=i_kind), parameter, public rxn_hl_phase_transfer
integer(kind=i_kind), parameter, public rxn_wennberg_tunneling
integer(kind=i_kind), parameter, public rxn_aqueous_equilibrium
integer(kind=i_kind), parameter, public rxn_arrhenius
Identifiers for reaction types - used by binary packing/unpacking functions.
integer(kind=i_kind), parameter, public rxn_wet_deposition
subroutine initialize_update_data(this, rxn, update_data)
Initialize an update data object.
integer(kind=i_kind), parameter, public rxn_wennberg_no_ro2
The rxn_first_order_loss_t type and associated functions.
The rxn_HL_phase_transfer_t type and associated functions.
The rxn_photolysis_t type and associated functions.
The rxn_SIMPOL_phase_transfer_t type and associated functions.
The rxn_surface_t type and associated functions.
The rxn_ternary_chemical_activation_t type and associated functions.
The rxn_troe_t type and associated functions.
The rxn_wennberg_no_ro2_t type and associated functions.
The rxn_wennberg_tunneling_t type and associated functions.
The rxn_wet_deposition_t type and associated functions.
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.
subroutine warn_msg(code, warning_msg, already_warned)
Prints a warning message.
Generic test reaction data type.
Generic test reaction data type.
Generic test reaction data type.
Generic test reaction data type.
Generic test reaction data type.
Generic test reaction data type.
Condensed-phase Photolysis rate update object.
Abstract reaction data type.
Generic test reaction data type.
Emission rate update object.
Factory type for chemical reactions.
Generic test reaction data type.
First-Order Loss rate update object.
Generic test reaction data type.
Generic test reaction data type.
Photolysis rate update object.
Generic test reaction data type.
Generic test reaction data type.
Generic test reaction data type.
Generic test reaction data type.
Generic test reaction data type.
Generic test reaction data type.
Wet Deposition rate update object.
Generic test reaction data type.
String type for building arrays of string of various size.