CAMP 1.0.0
Chemistry Across Multiple Phases
Data Types | Functions/Subroutines | Variables
camp_aero_rep_single_particle Module Reference

The aero_rep_single_particle_t type and associated subroutines. More...

Data Types

interface  aero_rep_free_update_data
 Free an update data object. More...
 
interface  aero_rep_single_particle_create_number_update_data
 Interface to c aerosol representation functions. More...
 
interface  aero_rep_single_particle_set_number_update_data__n_m3
 Set a new particle number concentration. More...
 
interface  aero_rep_single_particle_t
 Single particle aerosol representation. More...
 
type  aero_rep_update_data_single_particle_number_t
 Single particle update number concentration object. More...
 

Functions/Subroutines

type(aero_rep_single_particle_t) function, pointer constructor ()
 Constructor for aero_rep_single_particle_t.
 
subroutine initialize (this, aero_phase_set, spec_state_id)
 Initialize the aerosol representation data, validating component data and loading any required information from the aero_rep_data_t::property_set. This routine should be called once for each aerosol representation at the beginning of a model run after all the input files have been read in. It ensures all data required during the model run are included in the condensed data arrays.
 
integer(kind=i_kind) function maximum_computational_particles (this)
 Returns the maximum nunmber of computational particles.
 
integer(kind=i_kind) function get_size (this)
 Get the size of the section of the camp_camp_state::camp_state_t::state_var array required for this aerosol representation.
 
integer(kind=i_kind) function per_particle_size (this)
 Get the number of state variables per-particle.
 
type(string_t) function, dimension(:), allocatable unique_names (this, phase_name, tracer_type, spec_name)
 Get a list of unique names for each element on the camp_camp_state::camp_state_t::state_var array for this aerosol representation. The list may be restricted to a particular phase and/or aerosol species by including the phase_name and spec_name arguments.
 
integer(kind=i_kind) function spec_state_id (this, unique_name)
 Get a species id on the camp_camp_state::camp_state_t::state_var array by its unique name. These are unique ids for each element on the state array for this aerosol representation and are numbered:
 
character(len=:) function, allocatable spec_name (this, unique_name)
 Get the non-unique name of a species in this aerosol representation by id.
 
integer(kind=i_kind) function num_phase_instances (this, phase_name)
 Get the number of instances of a specified aerosol phase. In the single particle representation with layers, a phase can exist in multiple layers in one particle.

 
integer(kind=i_kind) function num_jac_elem (this, phase_id)
 Get the number of Jacobian elements used in calculations of aerosol mass, volume, number, etc. for a particular phase.
 
integer function num_layers (this)
 Returns the number of layers.
 
integer function num_phases (this, layer)
 Returns the number of phases in a layer or overall.
 
integer function phase_state_size (this, layer, phase)
 Returns the number of state variables for a layer and phase.
 
elemental subroutine finalize (this)
 Finalize the aerosol representation.
 
subroutine update_data_init_number (this, update_data, aero_rep_type)
 Initialize an update data object.
 
integer function, dimension(:), allocatable, public ordered_layer_ids (layer_names_unordered, cover_names_unordered)
 Order layer array from inner most layer to outermost.
 
subroutine update_data_set_number__n_m3 (this, particle_id, number_conc)
 Set packed update data for particle number (#/m3) for a particular computational particle.
 
integer(kind=i_kind) function internal_pack_size_number (this, comm)
 Determine the size of a binary required to pack the reaction data.
 
subroutine internal_bin_pack_number (this, buffer, pos, comm)
 Pack the given value to the buffer, advancing position.
 
subroutine internal_bin_unpack_number (this, buffer, pos, comm)
 Unpack the given value from the buffer, advancing position.
 
elemental subroutine update_data_number_finalize (this)
 Finalize a number update data object.
 

Variables

integer(kind=i_kind), parameter, public update_number_conc = 0
 

Detailed Description

The aero_rep_single_particle_t type and associated subroutines.

Function/Subroutine Documentation

◆ constructor()

type(aero_rep_single_particle_t) function, pointer camp_aero_rep_single_particle::constructor
private

Constructor for aero_rep_single_particle_t.

Returns
New aerosol representation

Definition at line 217 of file aero_rep_single_particle.F90.

◆ finalize()

elemental subroutine camp_aero_rep_single_particle::finalize ( type(aero_rep_single_particle_t), intent(inout)  this)
private

Finalize the aerosol representation.

Parameters
[in,out]thisAerosol representation data

Definition at line 766 of file aero_rep_single_particle.F90.

◆ get_size()

integer(kind=i_kind) function camp_aero_rep_single_particle::get_size ( class(aero_rep_single_particle_t), intent(in)  this)
private

Get the size of the section of the camp_camp_state::camp_state_t::state_var array required for this aerosol representation.

For a single particle representation, the size will correspond to the the sum of the sizes of a single instance of each aerosol phase provided to aero_rep_single_particle::initialize()

Returns
Size on the state array
Parameters
[in]thisAerosol representation data

Definition at line 449 of file aero_rep_single_particle.F90.

◆ initialize()

subroutine camp_aero_rep_single_particle::initialize ( class(aero_rep_single_particle_t), intent(inout)  this,
type(aero_phase_data_ptr), dimension(:), intent(in), pointer  aero_phase_set,
integer(kind=i_kind), intent(in)  spec_state_id 
)
private

Initialize the aerosol representation data, validating component data and loading any required information from the aero_rep_data_t::property_set. This routine should be called once for each aerosol representation at the beginning of a model run after all the input files have been read in. It ensures all data required during the model run are included in the condensed data arrays.

Parameters
[in,out]thisAerosol representation data
[in]aero_phase_setThe set of aerosol phases
[in]spec_state_idBeginning state id for this aerosol representation in the model species state array

Definition at line 234 of file aero_rep_single_particle.F90.

Here is the call graph for this function:

◆ internal_bin_pack_number()

subroutine camp_aero_rep_single_particle::internal_bin_pack_number ( class(aero_rep_update_data_single_particle_number_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]thisAerosol representation update data
[in,out]bufferMemory buffer
[in,out]posCurrent buffer position
[in]commMPI communicator

Definition at line 912 of file aero_rep_single_particle.F90.

Here is the call graph for this function:

◆ internal_bin_unpack_number()

subroutine camp_aero_rep_single_particle::internal_bin_unpack_number ( class(aero_rep_update_data_single_particle_number_t), intent(inout)  this,
character, dimension(:), intent(inout)  buffer,
integer, intent(inout)  pos,
integer, intent(in)  comm 
)
private

Unpack the given value from the buffer, advancing position.

Parameters
[in,out]thisAerosol representation update data
[in,out]bufferMemory buffer
[in,out]posCurrent buffer position
[in]commMPI communicator

Definition at line 940 of file aero_rep_single_particle.F90.

Here is the call graph for this function:

◆ internal_pack_size_number()

integer(kind=i_kind) function camp_aero_rep_single_particle::internal_pack_size_number ( class(aero_rep_update_data_single_particle_number_t), intent(in)  this,
integer, intent(in)  comm 
)
private

Determine the size of a binary required to pack the reaction data.

Parameters
[in]thisAerosol representation update data
[in]commMPI communicator

Definition at line 894 of file aero_rep_single_particle.F90.

Here is the call graph for this function:

◆ maximum_computational_particles()

integer(kind=i_kind) function camp_aero_rep_single_particle::maximum_computational_particles ( class(aero_rep_single_particle_t), intent(in)  this)
private

Returns the maximum nunmber of computational particles.

Parameters
[in]thisAerosol representation data

Definition at line 431 of file aero_rep_single_particle.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ num_jac_elem()

integer(kind=i_kind) function camp_aero_rep_single_particle::num_jac_elem ( class(aero_rep_single_particle_t), intent(in)  this,
integer(kind=i_kind), intent(in)  phase_id 
)
private

Get the number of Jacobian elements used in calculations of aerosol mass, volume, number, etc. for a particular phase.

Returns
Number of Jacobian elements used
Parameters
[in]thisAerosol respresentation data
[in]phase_idAerosol phase id

Definition at line 667 of file aero_rep_single_particle.F90.

◆ num_layers()

integer function camp_aero_rep_single_particle::num_layers ( class(aero_rep_single_particle_t), intent(in)  this)
private

Returns the number of layers.

Parameters
[in]thisAerosol representation data

Definition at line 694 of file aero_rep_single_particle.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ num_phase_instances()

integer(kind=i_kind) function camp_aero_rep_single_particle::num_phase_instances ( class(aero_rep_single_particle_t), intent(in)  this,
character(len=*), intent(in)  phase_name 
)
private

Get the number of instances of a specified aerosol phase. In the single particle representation with layers, a phase can exist in multiple layers in one particle.

Parameters
[in]thisAerosol representation data
[in]phase_nameAerosol phase name

Definition at line 641 of file aero_rep_single_particle.F90.

◆ num_phases()

integer function camp_aero_rep_single_particle::num_phases ( class(aero_rep_single_particle_t), intent(in)  this,
integer, intent(in), optional  layer 
)
private

Returns the number of phases in a layer or overall.

Parameters
[in]thisAerosol representation data
[in]layerLayer id

Definition at line 706 of file aero_rep_single_particle.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ordered_layer_ids()

integer function, dimension(:), allocatable, public camp_aero_rep_single_particle::ordered_layer_ids ( type(string_t), dimension(:), intent(in)  layer_names_unordered,
type(string_t), dimension(:), intent(in)  cover_names_unordered 
)

Order layer array from inner most layer to outermost.

Parameters
[in]layer_names_unorderedLayer names in original order
[in]cover_names_unorderedName of "covered" layer for each layer in layer_name_unordered
Returns
Index of name in layer_name_unordered for each layer after reordering

Definition at line 820 of file aero_rep_single_particle.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ per_particle_size()

integer(kind=i_kind) function camp_aero_rep_single_particle::per_particle_size ( class(aero_rep_single_particle_t), intent(in)  this)
private

Get the number of state variables per-particle.

Calling functions can assume each particle has the same size on the state array, and that individual particle states are contiguous and arranged sequentially

Returns
Size on the state array per particle
Parameters
[in]thisAerosol representation data

Definition at line 467 of file aero_rep_single_particle.F90.

◆ phase_state_size()

integer function camp_aero_rep_single_particle::phase_state_size ( class(aero_rep_single_particle_t), intent(in)  this,
integer, intent(in), optional  layer,
integer, intent(in), optional  phase 
)
private

Returns the number of state variables for a layer and phase.

Parameters
[in]thisAerosol representation data
[in]layerLayer id
[in]phasePhase id

Definition at line 724 of file aero_rep_single_particle.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ spec_name()

character(len=:) function, allocatable camp_aero_rep_single_particle::spec_name ( class(aero_rep_single_particle_t), intent(in)  this,
character(len=*), intent(in)  unique_name 
)
private

Get the non-unique name of a species in this aerosol representation by id.

Returns
Chemical species name
Parameters
[in]thisAerosol representation data
[in]unique_nameUnique name of the species in this aerosol representation

Definition at line 617 of file aero_rep_single_particle.F90.

◆ spec_state_id()

integer(kind=i_kind) function camp_aero_rep_single_particle::spec_state_id ( class(aero_rep_single_particle_t), intent(in)  this,
character(len=*), intent(in)  unique_name 
)
private

Get a species id on the camp_camp_state::camp_state_t::state_var array by its unique name. These are unique ids for each element on the state array for this aerosol representation and are numbered:

\[x_u \in x_f ... (x_f+n-1)\]

where \(x_u\) is the id of the element corresponding to the species with unique name \(u\) on the camp_camp_state::camp_state_t::state_var array, \(x_f\) is the index of the first element for this aerosol representation on the state array and \(n\) is the total number of variables on the state array from this aerosol representation.

Returns
Species state id
Parameters
[in]thisAerosol representation data
[in]unique_nameUnique name

Definition at line 591 of file aero_rep_single_particle.F90.

◆ unique_names()

type(string_t) function, dimension(:), allocatable camp_aero_rep_single_particle::unique_names ( class(aero_rep_single_particle_t), intent(in)  this,
character(len=*), intent(in), optional  phase_name,
integer(kind=i_kind), intent(in), optional  tracer_type,
character(len=*), intent(in), optional  spec_name 
)
private

Get a list of unique names for each element on the camp_camp_state::camp_state_t::state_var array for this aerosol representation. The list may be restricted to a particular phase and/or aerosol species by including the phase_name and spec_name arguments.

For a single particle representation, the unique names will be a 'P' followed by the computational particle number, a '.', the phase name, another '.', and the species name.

Returns
List of unique names
Parameters
[in]thisAerosol representation data
[in]phase_nameAerosol phase name
[in]tracer_typeAerosol-phase species tracer type
[in]spec_nameAerosol-phase species name

Definition at line 488 of file aero_rep_single_particle.F90.

Here is the call graph for this function:

◆ update_data_init_number()

subroutine camp_aero_rep_single_particle::update_data_init_number ( class(aero_rep_single_particle_t), intent(inout)  this,
class(aero_rep_update_data_single_particle_number_t), intent(out)  update_data,
integer(kind=i_kind), intent(in)  aero_rep_type 
)
private

Initialize an update data object.

Parameters
[in,out]thisAerosol representation to update
[out]update_dataUpdate data object
[in]aero_rep_typeAerosol representaiton id

Definition at line 790 of file aero_rep_single_particle.F90.

Here is the call graph for this function:

◆ update_data_number_finalize()

elemental subroutine camp_aero_rep_single_particle::update_data_number_finalize ( type(aero_rep_update_data_single_particle_number_t), intent(inout)  this)
private

Finalize a number update data object.

Parameters
[in,out]thisUpdate data object to free

Definition at line 969 of file aero_rep_single_particle.F90.

Here is the caller graph for this function:

◆ update_data_set_number__n_m3()

subroutine camp_aero_rep_single_particle::update_data_set_number__n_m3 ( class(aero_rep_update_data_single_particle_number_t), intent(inout)  this,
integer(kind=i_kind), intent(in)  particle_id,
real(kind=dp), intent(in)  number_conc 
)
private

Set packed update data for particle number (#/m3) for a particular computational particle.

Parameters
[in,out]thisUpdate data
[in]particle_idComputational particle index
[in]number_concUpdated number

Definition at line 869 of file aero_rep_single_particle.F90.

Variable Documentation

◆ update_number_conc

integer(kind=i_kind), parameter, public camp_aero_rep_single_particle::update_number_conc = 0

Definition at line 67 of file aero_rep_single_particle.F90.