PartMC  2.2.1
Data Types | Public Member Functions | Public Attributes
pmc_condense Module Reference

Water condensation onto aerosol particles. More...

List of all members.

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...

Public Member Functions

subroutine condense_particles (env_state, env_data, aero_data, 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 (env_state, aero_data, aero_state)
 Call condense_equilib_particle() on each particle in the aerosol to ensure that every particle has its water content in equilibrium.

Public Attributes

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_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_num_conc
 Internal-use variable for storing the per-particle number concentrations 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.

Detailed Description

Water condensation onto aerosol particles.

The model here assumes that the temperature $ T $ and pressure $ p $ 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 $ D_i $ and the relative humidity $ H $. The state vector stores these in the order $ (D_1,\ldots,D_n,H) $. 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.

Definition at line 29 of file condense.F90.


Member Function/Subroutine Documentation

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.

Parameters:
[in]n_eqnLength of state vector.
[in]timeCurrent time (s).
[in]stateCurrent state vector.
[in,out]env_stateCurrent environment state.

Definition at line 375 of file condense.F90.

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.

Parameters:
[in]env_stateEnvironment state.
[in]aero_dataAerosol data.
[in,out]aero_particleParticle.

Definition at line 731 of file condense.F90.

subroutine pmc_condense::condense_equilib_particles ( type(env_state_t), intent(inout)  env_state,
type(aero_data_t), intent(in)  aero_data,
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.

Parameters:
[in,out]env_stateEnvironment state.
[in]aero_dataAerosol data.
[in,out]aero_stateAerosol state.

Definition at line 773 of file condense.F90.

subroutine pmc_condense::condense_particles ( 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_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.

Parameters:
[in,out]env_stateEnvironment state.
[in]env_dataEnvironment data.
[in]aero_dataAerosol data.
[in,out]aero_stateAerosol state.
[in]del_tTotal time to integrate.

Definition at line 146 of file condense.F90.

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.

Parameters:
[in]inputsInputs to rates.
[out]outputsOutputs rates.

Definition at line 399 of file condense.F90.


Member Data Documentation

Internal-use variable for counting calls to the Jacobian-solving subroutine.

Definition at line 137 of file condense.F90.

Internal-use variable for counting calls to the vector field subroutine.

Definition at line 134 of file condense.F90.

logical, parameter pmc_condense::CONDENSE_DO_TEST_COUNTS = .false.

Whether to print call-counts for helper routines during execution (for debugging only).

Definition at line 47 of file condense.F90.

logical, parameter pmc_condense::CONDENSE_DO_TEST_JAC_SOLVE = .false.

Whether to numerically test the Jacobian-solve function during execution (for debugging only).

Definition at line 44 of file condense.F90.

Internal-use variable for storing the aerosol data during calls to the ODE solver.

Definition at line 112 of file condense.F90.

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.

Definition at line 127 of file condense.F90.

Internal-use variable for storing the environment data during calls to the ODE solver.

Definition at line 115 of file condense.F90.

Internal-use variable for storing the initial environment state during calls to the ODE solver.

Definition at line 118 of file condense.F90.

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.

Definition at line 124 of file condense.F90.

real(kind=dp), dimension(:), allocatable pmc_condense::condense_saved_num_conc

Internal-use variable for storing the per-particle number concentrations during calls to the ODE solver.

Definition at line 130 of file condense.F90.

Internal-use variable for storing the rate of change of the temperature during calls to the ODE solver.

Definition at line 121 of file condense.F90.

Result code indicating failure of the solver.

Definition at line 64 of file condense.F90.

Result code indicating failure to allocate abstol vector.

Definition at line 54 of file condense.F90.

Result code indicating failure to initialize the solver.

Definition at line 58 of file condense.F90.

Result code indicating failure to create the solver.

Definition at line 56 of file condense.F90.

Result code indicating failure to allocate y vector.

Definition at line 52 of file condense.F90.

Result code indicating failure to set maximum steps.

Definition at line 62 of file condense.F90.

Result code indicating successful completion.

Definition at line 50 of file condense.F90.

Result code indicating failure to set tolerances.

Definition at line 60 of file condense.F90.


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