CAMP 1.0.0
Chemistry Across Multiple Phases
Public Member Functions | Public Attributes | Private Member Functions | List of all members
camp_camp_solver_data::camp_solver_data_t Interface Reference

Solver data. More...

Public Member Functions

procedure initialize (this, var_type, abs_tol, mechanisms, aero_phases, aero_reps, sub_models, rxn_phase, n_cells)
 Initialize the solver.
 
procedure update_sub_model_data (this, update_data)
 Update sub-model data.
 
procedure update_rxn_data (this, update_data)
 Update reactions data.
 
procedure update_aero_rep_data (this, update_data)
 Update aerosol representation data.
 
procedure solve (this, camp_state, t_initial, t_final, solver_stats)
 Integrate over a given time step.
 
procedure is_solver_available (this)
 Checks whether a solver is available.
 
procedure print (this)
 Print the solver data.
 
final finalize (this)
 Finalize the solver data.
 

Public Attributes

type(c_ptr), public solver_c_ptr
 C Solver object.
 
real(kind=dp), public rel_tol = CAMP_SOLVER_DEFAULT_REL_TOL
 Relative tolerance for the integration.
 
integer(kind=i_kind), public max_steps = CAMP_SOLVER_DEFAULT_MAX_STEPS
 Maximum number of timesteps.
 
integer(kind=i_kind), public max_conv_fails = CAMP_SOLVER_DEFAULT_MAX_CONV_FAILS
 Maximum number of convergence failures.
 
logical initialized = .false.
 Flag indicating whether the solver was intialized.
 

Private Member Functions

procedure, private reset_timers (this)
 Reset the solver function timers.
 
procedure, private get_solver_stats (this, solver_stats)
 Get the solver statistics from the last run.
 

Detailed Description

Solver data.

Acts as the interface between the camp-chem module and the solver. Instances of the type hold a pointer to a solver c object and provide functions to initialize the solver with model data and run the solver over a specified time step.

Definition at line 371 of file camp_solver_data.F90.

Constructor & Destructor Documentation

◆ finalize()

final camp_camp_solver_data::camp_solver_data_t::finalize ( type(camp_solver_data_t), intent(inout)  this)
final

Finalize the solver data.

Parameters
[in,out]thisSolver data

Definition at line 404 of file camp_solver_data.F90.

Here is the call graph for this function:

Member Function/Subroutine Documentation

◆ get_solver_stats()

procedure, private camp_camp_solver_data::camp_solver_data_t::get_solver_stats ( class(camp_solver_data_t), intent(inout)  this,
type(solver_stats_t), intent(inout), target  solver_stats 
)
private

Get the solver statistics from the last run.

Parameters
[in,out]thisSolver data
[in,out]solver_statsSolver statistics

Definition at line 398 of file camp_solver_data.F90.

◆ initialize()

procedure camp_camp_solver_data::camp_solver_data_t::initialize ( class(camp_solver_data_t), intent(inout)  this,
integer(kind=i_kind), dimension(:), intent(in), allocatable  var_type,
real(kind=dp), dimension(:), intent(in), allocatable  abs_tol,
type(mechanism_data_ptr), dimension(:), intent(in), pointer  mechanisms,
type(aero_phase_data_ptr), dimension(:), intent(in), pointer  aero_phases,
type(aero_rep_data_ptr), dimension(:), intent(in), pointer  aero_reps,
type(sub_model_data_ptr), dimension(:), intent(in), pointer  sub_models,
integer(kind=i_kind), intent(in)  rxn_phase,
integer(kind=i_kind), optional  n_cells 
)

Initialize the solver.

Parameters
[in,out]thisSolver data
[in]var_typeVariable type for each species in the state array. This array must be of the same length as the state array.
[in]abs_tolAbsolute tolerance for each species in the state array. This array must be of the same length as the state array. Values for CONST and PSSA species will be ignored by the solver.
[in]mechanismsMechanisms to include in solver
[in]aero_phasesAerosol phases to include
[in]aero_repsAerosol representations to include
[in]sub_modelsSub models to include
[in]rxn_phaseReactions phase to solve – gas, aerosol, or both (default) Use parameters in camp_rxn_data to specify phase: GAS_RXN, AERO_RXN, GAS_AERO_RXN
n_cellsNumber of cells to compute

Definition at line 386 of file camp_solver_data.F90.

◆ is_solver_available()

procedure camp_camp_solver_data::camp_solver_data_t::is_solver_available ( class(camp_solver_data_t), intent(in)  this)

Checks whether a solver is available.

Parameters
[in]thisSolver data

Definition at line 400 of file camp_solver_data.F90.

◆ print()

procedure camp_camp_solver_data::camp_solver_data_t::print ( class(camp_solver_data_t), intent(in)  this)

Print the solver data.

Parameters
[in]thisSolver data

Definition at line 402 of file camp_solver_data.F90.

◆ reset_timers()

procedure, private camp_camp_solver_data::camp_solver_data_t::reset_timers ( class(camp_solver_data_t), intent(inout)  this)
private

Reset the solver function timers.

Parameters
[in,out]thisSolver data

Definition at line 396 of file camp_solver_data.F90.

◆ solve()

procedure camp_camp_solver_data::camp_solver_data_t::solve ( class(camp_solver_data_t), intent(inout)  this,
type(camp_state_t), intent(inout), target  camp_state,
real(kind=dp), intent(in)  t_initial,
real(kind=dp), intent(in)  t_final,
type(solver_stats_t), intent(inout), optional, target  solver_stats 
)

Integrate over a given time step.

Parameters
[in,out]thisSolver data
[in,out]camp_stateModel state
[in]t_initialStart time (s)
[in]t_finalEnd time (s)
[in,out]solver_statsSolver statistics

Definition at line 394 of file camp_solver_data.F90.

◆ update_aero_rep_data()

procedure camp_camp_solver_data::camp_solver_data_t::update_aero_rep_data ( class(camp_solver_data_t), intent(inout)  this,
class(aero_rep_update_data_t), intent(in)  update_data 
)

Update aerosol representation data.

Parameters
[in,out]thisSolver data
[in]update_dataUpdate data

Definition at line 392 of file camp_solver_data.F90.

◆ update_rxn_data()

procedure camp_camp_solver_data::camp_solver_data_t::update_rxn_data ( class(camp_solver_data_t), intent(inout)  this,
class(rxn_update_data_t), intent(in)  update_data 
)

Update reactions data.

Parameters
[in,out]thisSolver data
[in]update_dataUpdate data

Definition at line 390 of file camp_solver_data.F90.

◆ update_sub_model_data()

procedure camp_camp_solver_data::camp_solver_data_t::update_sub_model_data ( class(camp_solver_data_t), intent(inout)  this,
class(sub_model_update_data_t), intent(in)  update_data 
)

Update sub-model data.

Parameters
[in,out]thisSolver data
[in]update_dataUpdate data

Definition at line 388 of file camp_solver_data.F90.

Member Data Documentation

◆ initialized

logical camp_camp_solver_data::camp_solver_data_t::initialized = .false.

Flag indicating whether the solver was intialized.

Definition at line 383 of file camp_solver_data.F90.

◆ max_conv_fails

integer(kind=i_kind), public camp_camp_solver_data::camp_solver_data_t::max_conv_fails = CAMP_SOLVER_DEFAULT_MAX_CONV_FAILS

Maximum number of convergence failures.

Definition at line 380 of file camp_solver_data.F90.

◆ max_steps

integer(kind=i_kind), public camp_camp_solver_data::camp_solver_data_t::max_steps = CAMP_SOLVER_DEFAULT_MAX_STEPS

Maximum number of timesteps.

Definition at line 378 of file camp_solver_data.F90.

◆ rel_tol

real(kind=dp), public camp_camp_solver_data::camp_solver_data_t::rel_tol = CAMP_SOLVER_DEFAULT_REL_TOL

Relative tolerance for the integration.

Definition at line 376 of file camp_solver_data.F90.

◆ solver_c_ptr

type(c_ptr), public camp_camp_solver_data::camp_solver_data_t::solver_c_ptr

C Solver object.

Definition at line 374 of file camp_solver_data.F90.


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