CAMP 1.0.0
Chemistry Across Multiple Phases
camp_mechanism_data Module Reference

The mechanism_data_t structure and associated subroutines. More...

Data Types

type  mechanism_data_ptr
 Pointer type for building arrays. More...
 
type  mechanism_data_t
 A chemical mechanism. More...
 

Functions/Subroutines

type(mechanism_data_t) function, pointer constructor (mech_name, init_size)
 Constructor for mechanism_data_t.
 
subroutine ensure_size (this, num_rxn)
 Ensure there is enough room in the reaction dataset to add a specified number of reactions.
 
subroutine load (this, json, j_obj)
 Load a chemical mechanism from an input file.
 
subroutine initialize (this, chem_spec_data, aero_phase_data, aero_rep_data, n_cells)
 Initialize the mechanism.
 
integer(kind=i_kind) function get_size (this)
 Get the current size of the chemical mechanism.
 
class(rxn_data_t) function, pointer get_rxn (this, rxn_id)
 Get a reaction by its index.
 
character(len=:) function, allocatable get_name (this)
 Get the name of the mechanism.
 
integer(kind=i_kind) function pack_size (this, comm)
 Determine the size of a binary required to pack the mechanism.
 
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 to the buffer, advancing position.
 
subroutine do_print (this, file_unit)
 Print the mechanism data.
 
subroutine finalize (this)
 Finalize the mechanism.
 
subroutine finalize_array (this)
 Finalize an array of mechanisms.
 
elemental subroutine dereference (this)
 Dereference a pointer to a mechanism.
 
subroutine ptr_finalize (this)
 Finalize a pointer to mechanism data.
 
subroutine ptr_finalize_array (this)
 Finalize an array of mechanism data pointers.
 

Variables

integer(kind=i_kind), parameter realloc_inc = 50
 Reallocation increment.
 
integer(kind=i_kind), parameter mech_file_unit = 16
 Fixed module file unit.
 

Detailed Description

The mechanism_data_t structure and associated subroutines.

Function/Subroutine Documentation

◆ bin_pack()

subroutine camp_mechanism_data::bin_pack ( class(mechanism_data_t), intent(in) this,
character, dimension(:), intent(inout) buffer,
integer, intent(inout) pos,
integer, intent(in) comm )
private

Pack the given value to the buffer, advancing position.

Parameters
[in]thisChemical mechanism
[in,out]bufferMemory buffer
[in,out]posCurrent buffer position
[in]commMPI communicator

Definition at line 343 of file mechanism_data.F90.

Here is the call graph for this function:

◆ bin_unpack()

subroutine camp_mechanism_data::bin_unpack ( class(mechanism_data_t), intent(inout) this,
character, dimension(:), intent(inout) buffer,
integer, intent(inout) pos,
integer, intent(in) comm )
private

Unpack the given value to the buffer, advancing position.

Parameters
[in,out]thisChemical mechanism
[in,out]bufferMemory buffer
[in,out]posCurrent buffer position
[in]commMPI communicator

Definition at line 374 of file mechanism_data.F90.

Here is the call graph for this function:

◆ constructor()

type(mechanism_data_t) function, pointer camp_mechanism_data::constructor ( character(len=*), intent(in), optional mech_name,
integer(i_kind), intent(in), optional init_size )

Constructor for mechanism_data_t.

Returns
Chemical mechanism
Parameters
[in]mech_nameName of the mechanism
[in]init_sizeNumber of reactions to allocate space for initially

Definition at line 119 of file mechanism_data.F90.

◆ dereference()

elemental subroutine camp_mechanism_data::dereference ( class(mechanism_data_ptr), intent(inout) this)
private

Dereference a pointer to a mechanism.

Parameters
[in,out]thisPointer to the mechanism

Definition at line 460 of file mechanism_data.F90.

◆ do_print()

subroutine camp_mechanism_data::do_print ( class(mechanism_data_t), intent(in) this,
integer(kind=i_kind), optional file_unit )
private

Print the mechanism data.

Parameters
[in]thisChemical mechanism
file_unitFile unit for output

Definition at line 405 of file mechanism_data.F90.

◆ ensure_size()

subroutine camp_mechanism_data::ensure_size ( class(mechanism_data_t), intent(inout) this,
integer(i_kind), intent(in) num_rxn )
private

Ensure there is enough room in the reaction dataset to add a specified number of reactions.

Parameters
[in,out]thisChemical mechanism
[in]num_rxnNumber of new reactions to ensure space for

Definition at line 147 of file mechanism_data.F90.

◆ finalize()

subroutine camp_mechanism_data::finalize ( type(mechanism_data_t), intent(inout) this)
private

Finalize the mechanism.

Parameters
[in,out]thisMechanism data

Definition at line 430 of file mechanism_data.F90.

◆ finalize_array()

subroutine camp_mechanism_data::finalize_array ( type(mechanism_data_t), dimension(:), intent(inout) this)
private

Finalize an array of mechanisms.

Parameters
[in,out]thisArray of mechanism data

Definition at line 444 of file mechanism_data.F90.

Here is the call graph for this function:

◆ get_name()

character(len=:) function, allocatable camp_mechanism_data::get_name ( class(mechanism_data_t), intent(in) this)
private

Get the name of the mechanism.

Returns
Name of the mechanism
Parameters
[in]thisChemical mechanism

Definition at line 308 of file mechanism_data.F90.

◆ get_rxn()

class(rxn_data_t) function, pointer camp_mechanism_data::get_rxn ( class(mechanism_data_t), intent(in) this,
integer(kind=i_kind), intent(in) rxn_id )
private

Get a reaction by its index.

Returns
Pointer to the reaction
Parameters
[in]thisMechanism data
[in]rxn_idReaction index

Definition at line 288 of file mechanism_data.F90.

Here is the call graph for this function:

◆ get_size()

integer(kind=i_kind) function camp_mechanism_data::get_size ( class(mechanism_data_t), intent(in) this)
private

Get the current size of the chemical mechanism.

Parameters
[in]thisChemical mechanism

Definition at line 276 of file mechanism_data.F90.

◆ initialize()

subroutine camp_mechanism_data::initialize ( class(mechanism_data_t), intent(inout) this,
type(chem_spec_data_t), intent(in) chem_spec_data,
type(aero_phase_data_ptr), dimension(:), intent(in) aero_phase_data,
type(aero_rep_data_ptr), dimension(:), intent(in), pointer aero_rep_data,
integer(kind=i_kind), intent(in) n_cells )
private

Initialize the mechanism.

Parameters
[in,out]thisChemical mechanism
[in]chem_spec_dataChemical species data
[in]aero_phase_dataAerosol phase data
[in]aero_rep_dataAerosol representation data
[in]n_cellsNumber of grid cells to solve simultaneously

Definition at line 249 of file mechanism_data.F90.

Here is the call graph for this function:

◆ load()

subroutine camp_mechanism_data::load ( class(mechanism_data_t), intent(inout) this,
type(json_core), intent(in), pointer json,
type(json_value), intent(in), pointer j_obj )
private

Load a chemical mechanism from an input file.

Parameters
[in,out]thisChemical mechanism
[in]jsonJSON core
[in]j_objJSON object

Definition at line 194 of file mechanism_data.F90.

Here is the call graph for this function:

◆ pack_size()

integer(kind=i_kind) function camp_mechanism_data::pack_size ( class(mechanism_data_t), intent(in) this,
integer, intent(in) comm )
private

Determine the size of a binary required to pack the mechanism.

Parameters
[in]thisChemical mechanism
[in]commMPI communicator

Definition at line 322 of file mechanism_data.F90.

Here is the call graph for this function:

◆ ptr_finalize()

subroutine camp_mechanism_data::ptr_finalize ( type(mechanism_data_ptr), intent(inout) this)
private

Finalize a pointer to mechanism data.

Parameters
[in,out]thisPointer to mechanism data

Definition at line 472 of file mechanism_data.F90.

◆ ptr_finalize_array()

subroutine camp_mechanism_data::ptr_finalize_array ( type(mechanism_data_ptr), dimension(:), intent(inout) this)
private

Finalize an array of mechanism data pointers.

Parameters
[in,out]thisArray of mechanism data pointers

Definition at line 484 of file mechanism_data.F90.

Here is the call graph for this function:

Variable Documentation

◆ mech_file_unit

integer(kind=i_kind), parameter camp_mechanism_data::mech_file_unit = 16
private

Fixed module file unit.

Definition at line 54 of file mechanism_data.F90.

◆ realloc_inc

integer(kind=i_kind), parameter camp_mechanism_data::realloc_inc = 50
private

Reallocation increment.

Definition at line 52 of file mechanism_data.F90.