CAMP 1.0.0
Chemistry Across Multiple Phases
Public Member Functions | Public Attributes | List of all members
camp_sub_model_data::sub_model_data_t Type Referenceabstract

Abstract sub-model data type. More...

Inheritance diagram for camp_sub_model_data::sub_model_data_t:
Inheritance graph
[legend]
Collaboration diagram for camp_sub_model_data::sub_model_data_t:
Collaboration graph
[legend]

Public Member Functions

procedure(initialize), deferred initialize initialize
 Initialize the sub-model data, validating input parameters and loading any required information form the sub_model_data_t::property_set. This routine should be called once for each sub-model at the beginning of the 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.
 
procedure(priority), deferred priority priority
 Return a real number representing the priority of the sub-model calculations. Low priority sub models may depend on the results of higher priority sub models. Lower numbers indicate higher priority.
 
procedure name (this)
 Get the name of the sub-model.
 
procedure pack_size (this, comm)
 Determine the number of bytes required to pack the sub-model data.
 
procedure bin_pack (this, buffer, pos, comm)
 Packs the sub-model into the buffer, advancing position.
 
procedure bin_unpack (this, buffer, pos, comm)
 Unpacks the sub-model from the buffer, advancing position.
 
procedure load (this, json, j_obj)
 Load data from an input file.
 
procedure print (this, file_unit)
 Print the sub-model data.
 

Public Attributes

character(len=:), allocatable, public model_name
 Name of the sub-model.
 
type(property_t), pointer, public property_set => null()
 Sub model parameters. These will be available during initialization, but not during integration. All information required by the sub model during solving must be saved by the extending type to the condensed data arrays.
 
real(kind=dp), dimension(:), allocatable, public condensed_data_real
 Condensed sub-model data. These arrays will be available during integration, and should contain any information required by the sub-model that cannot be obtained from the camp_camp_state::camp_state_t object. (floating point)
 
integer(kind=i_kind), dimension(:), allocatable, public condensed_data_int
 Condensed sub-model data. These arrays will be available during integration, and should contain any information required by the sub-model that cannot be obtained from the camp_camp_state::camp_state_t object. (integer)
 
integer(kind=i_kind), public num_env_params = 0
 Number of environment-dependent parameters These are parameters that need updated when environmental conditions change.
 

Detailed Description

Abstract sub-model data type.

Time-invariant data required by a sub-model to perform calculations during solving. Derived types extending sub_model_data_t should be related to specific models or parameterizations. Sub models will have access to the current model state during solving, but will not be able to modify state variables or contribute to derivative arrays directly (this must be done by reactions).

See Sub Models for details.

Definition at line 52 of file sub_model_data.F90.

Member Function/Subroutine Documentation

◆ bin_pack()

procedure camp_sub_model_data::sub_model_data_t::bin_pack ( class(sub_model_data_t), intent(in)  this,
character, dimension(:), intent(inout)  buffer,
integer, intent(inout)  pos,
integer, intent(in)  comm 
)

Packs the sub-model into the buffer, advancing position.

Parameters
[in]thisSub model data
[in,out]bufferMemory buffer
[in,out]posCurrent buffer position
[in]commMPI communicator

Definition at line 92 of file sub_model_data.F90.

◆ bin_unpack()

procedure camp_sub_model_data::sub_model_data_t::bin_unpack ( class(sub_model_data_t), intent(out)  this,
character, dimension(:), intent(inout)  buffer,
integer, intent(inout)  pos,
integer, intent(in)  comm 
)

Unpacks the sub-model from the buffer, advancing position.

Parameters
[out]thisSub model data
[in,out]bufferMemory buffer
[in,out]posCurrent buffer position
[in]commMPI communicator

Definition at line 94 of file sub_model_data.F90.

◆ initialize()

procedure(initialize), deferred camp_sub_model_data::sub_model_data_t::initialize
pure virtual

Initialize the sub-model data, validating input parameters and loading any required information form the sub_model_data_t::property_set. This routine should be called once for each sub-model at the beginning of the 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.

Definition at line 82 of file sub_model_data.F90.

◆ load()

procedure camp_sub_model_data::sub_model_data_t::load ( class(sub_model_data_t), intent(inout)  this,
type(json_core), intent(in), pointer  json,
type(json_value), intent(in), pointer  j_obj 
)

Load data from an input file.

Parameters
[in,out]thisSub model data
[in]jsonJSON core
[in]j_objJSON object

Definition at line 96 of file sub_model_data.F90.

◆ name()

procedure camp_sub_model_data::sub_model_data_t::name ( class(sub_model_data_t), intent(in)  this)

Get the name of the sub-model.

Returns
Sub model name
Parameters
[in]thisSub model data

Definition at line 88 of file sub_model_data.F90.

◆ pack_size()

procedure camp_sub_model_data::sub_model_data_t::pack_size ( class(sub_model_data_t), intent(in)  this,
integer, intent(in)  comm 
)

Determine the number of bytes required to pack the sub-model data.

Parameters
[in]thisSub model data
[in]commMPI communicator

Definition at line 90 of file sub_model_data.F90.

◆ print()

procedure camp_sub_model_data::sub_model_data_t::print ( class(sub_model_data_t), intent(in)  this,
integer(kind=i_kind), optional  file_unit 
)

Print the sub-model data.

Parameters
[in]thisSub model data
file_unitFile unit for output

Definition at line 98 of file sub_model_data.F90.

◆ priority()

procedure(priority), deferred camp_sub_model_data::sub_model_data_t::priority
pure virtual

Return a real number representing the priority of the sub-model calculations. Low priority sub models may depend on the results of higher priority sub models. Lower numbers indicate higher priority.

Definition at line 86 of file sub_model_data.F90.

Member Data Documentation

◆ condensed_data_int

integer(kind=i_kind), dimension(:), allocatable, public camp_sub_model_data::sub_model_data_t::condensed_data_int

Condensed sub-model data. These arrays will be available during integration, and should contain any information required by the sub-model that cannot be obtained from the camp_camp_state::camp_state_t object. (integer)

Definition at line 70 of file sub_model_data.F90.

◆ condensed_data_real

real(kind=dp), dimension(:), allocatable, public camp_sub_model_data::sub_model_data_t::condensed_data_real

Condensed sub-model data. These arrays will be available during integration, and should contain any information required by the sub-model that cannot be obtained from the camp_camp_state::camp_state_t object. (floating point)

Definition at line 65 of file sub_model_data.F90.

◆ model_name

character(len=:), allocatable, public camp_sub_model_data::sub_model_data_t::model_name

Name of the sub-model.

Definition at line 55 of file sub_model_data.F90.

◆ num_env_params

integer(kind=i_kind), public camp_sub_model_data::sub_model_data_t::num_env_params = 0

Number of environment-dependent parameters These are parameters that need updated when environmental conditions change.

Definition at line 74 of file sub_model_data.F90.

◆ property_set

type(property_t), pointer, public camp_sub_model_data::sub_model_data_t::property_set => null()

Sub model parameters. These will be available during initialization, but not during integration. All information required by the sub model during solving must be saved by the extending type to the condensed data arrays.

Definition at line 60 of file sub_model_data.F90.


The documentation for this type was generated from the following file: