Water condensation onto aerosol particles. More...
Data Types | |
type | condense_rates_inputs_t |
Internal-use structure for storing the inputs for the rate-calculation function. More... | |
type | condense_rates_outputs_t |
Internal-use structure for storing the outputs from the rate-calculation function. More... | |
Functions/Subroutines | |
subroutine | condense_particles (bin_grid, env_state, env_data, aero_data, aero_weight, aero_state, del_t) |
Do condensation to all the particles for a given time interval, including updating the environment to account for the lost water vapor. | |
subroutine | condense_current_env_state (n_eqn, time, state, env_state) |
Fills in the env_state with the current environment state, taken from the state vector and from global variables. | |
subroutine | condense_rates (inputs, outputs) |
Compute the rate of change of particle diameter and relative humidity for a single particle, together with the derivatives of the rates with respect to the input variables. | |
subroutine | condense_equilib_particle (env_state, aero_data, aero_particle) |
Determine the water equilibrium state of a single particle. | |
subroutine | condense_equilib_particles (bin_grid, env_state, aero_data, aero_weight, aero_state) |
Call condense_equilib_particle() on each particle in the aerosol to ensure that every particle has its water content in equilibrium. | |
Variables | |
logical, parameter | CONDENSE_DO_TEST_JAC_SOLVE = .false. |
Whether to numerically test the Jacobian-solve function during execution (for debugging only). | |
logical, parameter | CONDENSE_DO_TEST_COUNTS = .false. |
Whether to print call-counts for helper routines during execution (for debugging only). | |
integer, parameter | PMC_CONDENSE_SOLVER_SUCCESS = 0 |
Result code indicating successful completion. | |
integer, parameter | PMC_CONDENSE_SOLVER_INIT_Y = 1 |
Result code indicating failure to allocate y vector. | |
integer, parameter | PMC_CONDENSE_SOLVER_INIT_ABSTOL = 2 |
Result code indicating failure to allocate abstol vector. | |
integer, parameter | PMC_CONDENSE_SOLVER_INIT_CVODE_MEM = 3 |
Result code indicating failure to create the solver. | |
integer, parameter | PMC_CONDENSE_SOLVER_INIT_CVODE = 4 |
Result code indicating failure to initialize the solver. | |
integer, parameter | PMC_CONDENSE_SOLVER_SVTOL = 5 |
Result code indicating failure to set tolerances. | |
integer, parameter | PMC_CONDENSE_SOLVER_SET_MAX_STEPS = 6 |
Result code indicating failure to set maximum steps. | |
integer, parameter | PMC_CONDENSE_SOLVER_FAIL = 7 |
Result code indicating failure of the solver. | |
type(aero_data_t) | condense_saved_aero_data |
Internal-use variable for storing the aerosol data during calls to the ODE solver. | |
type(env_data_t) | condense_saved_env_data |
Internal-use variable for storing the environment data during calls to the ODE solver. | |
type(env_state_t) | condense_saved_env_state_initial |
Internal-use variable for storing the initial environment state during calls to the ODE solver. | |
real(kind=dp) | condense_saved_V_comp_initial |
Internal-use variable for storing the inital computational volume during calls to the ODE solver. | |
real(kind=dp) | condense_saved_Tdot |
Internal-use variable for storing the rate of change of the temperature during calls to the ODE solver. | |
real(kind=dp), dimension(:), allocatable | condense_saved_kappa |
Internal-use variable for storing the per-particle kappa values during calls to the ODE solver. | |
real(kind=dp), allocatable | condense_saved_D_dry |
Internal-use variable for storing the per-particle dry diameters during calls to the ODE solver. | |
real(kind=dp), dimension(:), allocatable | condense_saved_weight |
Internal-use variable for storing the per-particle weights during calls to the ODE solver. | |
integer, save | condense_count_vf |
Internal-use variable for counting calls to the vector field subroutine. | |
integer, save | condense_count_solve |
Internal-use variable for counting calls to the Jacobian-solving subroutine. |
Water condensation onto aerosol particles.
The model here assumes that the temperature and pressure
are prescribed as functions of time, while water content per-particle and relative humidity are to be calculated by integrating their rates of change.
The state of the system is defined by the per-particle wet diameters and the relative humidity
. The state vector stores these in the order
. The time-derivative of the state vector and the Jacobian (derivative of the time-derivative with repsect to the state) all conform to this ordering.
The SUNDIALS ODE solver is used to compute the system evolution using an implicit method. The system Jacobian is explicitly inverveted as its structure is very simple.
All equations used in this file are written in detail in the file doc/condense.tex
.
subroutine pmc_condense::condense_current_env_state | ( | integer,intent(in) | n_eqn, |
real(kind=dp),intent(in) | time, | ||
real(kind=dp),dimension(n_eqn),intent(in) | state, | ||
type(env_state_t),intent(inout) | env_state | ||
) |
Fills in the env_state
with the current environment state, taken from the state
vector and from global variables.
n_eqn | Length of state vector. |
time | Current time (s). |
state | Current state vector. |
env_state | Current environment state. |
subroutine pmc_condense::condense_equilib_particle | ( | type(env_state_t),intent(in) | env_state, |
type(aero_data_t),intent(in) | aero_data, | ||
type(aero_particle_t),intent(inout) | aero_particle | ||
) |
Determine the water equilibrium state of a single particle.
env_state | Environment state. |
aero_data | Aerosol data. |
aero_particle | Particle. |
subroutine pmc_condense::condense_equilib_particles | ( | type(bin_grid_t),intent(in) | bin_grid, |
type(env_state_t),intent(inout) | env_state, | ||
type(aero_data_t),intent(in) | aero_data, | ||
type(aero_weight_t),intent(in) | aero_weight, | ||
type(aero_state_t),intent(inout) | aero_state | ||
) |
Call condense_equilib_particle() on each particle in the aerosol to ensure that every particle has its water content in equilibrium.
bin_grid | Bin grid. |
env_state | Environment state. |
aero_data | Aerosol data. |
aero_weight | Aerosol weight. |
aero_state | Aerosol state. |
subroutine pmc_condense::condense_particles | ( | type(bin_grid_t),intent(in) | bin_grid, |
type(env_state_t),intent(inout) | env_state, | ||
type(env_data_t),intent(in) | env_data, | ||
type(aero_data_t),intent(in) | aero_data, | ||
type(aero_weight_t),intent(in) | aero_weight, | ||
type(aero_state_t),intent(inout) | aero_state, | ||
real(kind=dp),intent(in) | del_t | ||
) |
Do condensation to all the particles for a given time interval, including updating the environment to account for the lost water vapor.
bin_grid | Bin grid. |
env_state | Environment state. |
env_data | Environment data. |
aero_data | Aerosol data. |
aero_weight | Aerosol weight. |
aero_state | Aerosol state. |
del_t | Total time to integrate. |
subroutine pmc_condense::condense_rates | ( | type(condense_rates_inputs_t),intent(in) | inputs, |
type(condense_rates_outputs_t),intent(out) | outputs | ||
) |
Compute the rate of change of particle diameter and relative humidity for a single particle, together with the derivatives of the rates with respect to the input variables.
inputs | Inputs to rates. |
outputs | Outputs rates. |
integer,save pmc_condense::condense_count_solve |
Internal-use variable for counting calls to the Jacobian-solving subroutine.
integer,save pmc_condense::condense_count_vf |
Internal-use variable for counting calls to the vector field subroutine.
logical,parameter pmc_condense::CONDENSE_DO_TEST_COUNTS = .false. |
Whether to print call-counts for helper routines during execution (for debugging only).
logical,parameter pmc_condense::CONDENSE_DO_TEST_JAC_SOLVE = .false. |
Whether to numerically test the Jacobian-solve function during execution (for debugging only).
Internal-use variable for storing the aerosol data during calls to the ODE solver.
real(kind=dp),allocatable pmc_condense::condense_saved_D_dry |
Internal-use variable for storing the per-particle dry diameters during calls to the ODE solver.
Internal-use variable for storing the environment data during calls to the ODE solver.
Internal-use variable for storing the initial environment state during calls to the ODE solver.
real(kind=dp),dimension(:),allocatable pmc_condense::condense_saved_kappa |
Internal-use variable for storing the per-particle kappa values during calls to the ODE solver.
real(kind=dp) pmc_condense::condense_saved_Tdot |
Internal-use variable for storing the rate of change of the temperature during calls to the ODE solver.
real(kind=dp) pmc_condense::condense_saved_V_comp_initial |
Internal-use variable for storing the inital computational volume during calls to the ODE solver.
real(kind=dp),dimension(:),allocatable pmc_condense::condense_saved_weight |
Internal-use variable for storing the per-particle weights during calls to the ODE solver.
integer,parameter pmc_condense::PMC_CONDENSE_SOLVER_FAIL = 7 |
Result code indicating failure of the solver.
integer,parameter pmc_condense::PMC_CONDENSE_SOLVER_INIT_ABSTOL = 2 |
Result code indicating failure to allocate abstol
vector.
integer,parameter pmc_condense::PMC_CONDENSE_SOLVER_INIT_CVODE = 4 |
Result code indicating failure to initialize the solver.
integer,parameter pmc_condense::PMC_CONDENSE_SOLVER_INIT_CVODE_MEM = 3 |
Result code indicating failure to create the solver.
integer,parameter pmc_condense::PMC_CONDENSE_SOLVER_INIT_Y = 1 |
Result code indicating failure to allocate y
vector.
integer,parameter pmc_condense::PMC_CONDENSE_SOLVER_SET_MAX_STEPS = 6 |
Result code indicating failure to set maximum steps.
integer,parameter pmc_condense::PMC_CONDENSE_SOLVER_SUCCESS = 0 |
Result code indicating successful completion.
integer,parameter pmc_condense::PMC_CONDENSE_SOLVER_SVTOL = 5 |
Result code indicating failure to set tolerances.