CAMP 1.0.0
Chemistry Across Multiple Phases
|
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. | |
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.
|
final |
Finalize the solver data.
[in,out] | this | Solver data |
Definition at line 404 of file camp_solver_data.F90.
|
private |
Get the solver statistics from the last run.
[in,out] | this | Solver data |
[in,out] | solver_stats | Solver statistics |
Definition at line 398 of file camp_solver_data.F90.
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.
[in,out] | this | Solver data |
[in] | var_type | Variable type for each species in the state array. This array must be of the same length as the state array. |
[in] | abs_tol | Absolute 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] | mechanisms | Mechanisms to include in solver |
[in] | aero_phases | Aerosol phases to include |
[in] | aero_reps | Aerosol representations to include |
[in] | sub_models | Sub models to include |
[in] | rxn_phase | Reactions 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_cells | Number of cells to compute |
Definition at line 386 of file camp_solver_data.F90.
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.
[in] | this | Solver data |
Definition at line 400 of file camp_solver_data.F90.
procedure camp_camp_solver_data::camp_solver_data_t::print | ( | class(camp_solver_data_t), intent(in) | this | ) |
Print the solver data.
[in] | this | Solver data |
Definition at line 402 of file camp_solver_data.F90.
|
private |
Reset the solver function timers.
[in,out] | this | Solver data |
Definition at line 396 of file camp_solver_data.F90.
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.
[in,out] | this | Solver data |
[in,out] | camp_state | Model state |
[in] | t_initial | Start time (s) |
[in] | t_final | End time (s) |
[in,out] | solver_stats | Solver statistics |
Definition at line 394 of file camp_solver_data.F90.
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.
[in,out] | this | Solver data |
[in] | update_data | Update data |
Definition at line 392 of file camp_solver_data.F90.
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.
[in,out] | this | Solver data |
[in] | update_data | Update data |
Definition at line 390 of file camp_solver_data.F90.
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.
[in,out] | this | Solver data |
[in] | update_data | Update data |
Definition at line 388 of file camp_solver_data.F90.
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.
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.
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.
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.
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.