CAMP 1.0.0
Chemistry Across Multiple Phases
Data Types | Functions/Subroutines | Variables
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...
 
interface  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_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.
 
elemental subroutine finalize (this)
 Finalize the mechanism.
 
elemental subroutine dereference (this)
 Dereference a pointer to a mechanism.
 
elemental subroutine ptr_finalize (this)
 Finalize a pointer to mechanism data.
 

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 339 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 370 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 118 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 440 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 401 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 146 of file mechanism_data.F90.

◆ finalize()

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

Finalize the mechanism.

Parameters
[in,out]thisMechanism data

Definition at line 426 of file mechanism_data.F90.

◆ 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 304 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 284 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 272 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_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_rep_dataAerosol representation data
[in]n_cellsNumber of grid cells to solve simultaneously

Definition at line 248 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 193 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 318 of file mechanism_data.F90.

Here is the call graph for this function:

◆ ptr_finalize()

elemental 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 452 of file mechanism_data.F90.

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 53 of file mechanism_data.F90.

◆ realloc_inc

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

Reallocation increment.

Definition at line 51 of file mechanism_data.F90.