PartMC
2.6.1
|
Aerosol particle coagulation. More...
Functions/Subroutines | |
subroutine | mc_coag (coag_kernel_type, env_state, aero_data, aero_state, del_t, tot_n_samp, tot_n_coag) |
Do coagulation for time del_t. More... | |
subroutine | mc_coag_for_bin (coag_kernel_type, env_state, aero_data, aero_state, del_t, tot_n_samp, tot_n_coag, b1, b2, c1, c2) |
Do coagulation for time del_t for the given bins. More... | |
subroutine | try_per_particle_coag (coag_kernel_type, k_max, env_state, aero_data, aero_state, del_t, tot_n_samp, tot_n_coag, b1, b2, c1, c2, cc, per_particle_coag_succeeded) |
Attempt per-particle coagulation. More... | |
subroutine | determine_target_and_source (aero_weight_array, bin_grid, b1, b2, c1, c2, cc, bt, bs, ct, cs, correct_weight_ordering) |
Determine the source and target particle bin/group for per-particle coagulation, if possible. More... | |
subroutine | compute_n_source (n_part, k_max, del_t, n_source_per_target, accept_factor) |
subroutine | sample_source_particle (aero_state, aero_data, env_state, coag_kernel_type, bs, cs, coag_particle, n_samp_mean, accept_factor, n_samp, n_coag, n_remove, source_particle) |
Sample coagulation partners for a single coagulation event. More... | |
subroutine | coag_target_with_source (aero_state, aero_data, bt, ct, target_unif_entry, source_particle, cc) |
Coagulate a sampled source particle with a target particle. More... | |
subroutine | per_set_coag (coag_kernel_type, k_max, env_state, aero_data, aero_state, del_t, tot_n_samp, tot_n_coag, b1, b2, c1, c2, cc) |
Do set-wise coagulation. More... | |
subroutine | compute_n_samp (ni, nj, same_bin, k_max, del_t, n_samp_mean, n_samp, accept_factor) |
Compute the number of samples required for the pair of bins. More... | |
subroutine | maybe_coag_pair (env_state, aero_data, aero_state, b1, b2, c1, c2, cc, coag_kernel_type, accept_factor, did_coag) |
Choose a random pair for potential coagulation and test its probability of coagulation. If it happens, do the coagulation and update all structures. More... | |
subroutine | find_rand_pair (aero_sorted, b1, b2, c1, c2, i1, i2) |
Given (b1, c1) and (b2, c2) , find a random pair of particles (b1, c1, i1) and (b2, c2, i2) that are not the same particle particle as each other. More... | |
subroutine | coagulate_weighting (pt1, pt2, ptc, c1, c2, cc, aero_data, aero_weight_array, remove_1, remove_2, create_new, id_1_lost, id_2_lost, aero_info_1, aero_info_2) |
Actually coagulate pt1 and pt2 to form ptc and compute weighting effects, including which particles should be lost and which gained. More... | |
subroutine | coagulate (aero_data, aero_state, p1, p2, c1, c2, cc) |
Join together particles p1 and p2 , updating all particle and bin structures to reflect the change. More... | |
Variables | |
real(kind=dp), parameter | coag_accel_n_event = 1d0 |
Minimum number of coagulation events per large particle for which accelerated coagulation is used. More... | |
real(kind=dp), parameter | coag_accel_max_cv = 0.1d0 |
Maximum allowed coefficient-of-variation due to undersampling in accelerated coagulation. More... | |
real(kind=dp), parameter | max_allowable_growth_factor = 1.5d0 |
Maximum allowable growth factor of a target particle volume within one timestep when using accelerated coagulation. More... | |
Aerosol particle coagulation.
subroutine pmc_coagulation::coag_target_with_source | ( | type(aero_state_t), intent(inout) | aero_state, |
type(aero_data_t), intent(in) | aero_data, | ||
integer, intent(in) | bt, | ||
integer, intent(in) | ct, | ||
integer, intent(in) | target_unif_entry, | ||
type(aero_particle_t), intent(in) | source_particle, | ||
integer, intent(in) | cc | ||
) |
Coagulate a sampled source particle with a target particle.
[in,out] | aero_state | Aerosol state. |
[in] | aero_data | Aerosol data. |
[in] | bt | Bin of coagulating particle. |
[in] | ct | Weight class of coagulating particle. |
[in] | target_unif_entry | Entry-in-bin of coagulating particle. |
[in] | source_particle | Sampled particle to coagulate with. |
[in] | cc | Weight class for coagulated particle. |
Definition at line 472 of file coagulation.F90.
subroutine pmc_coagulation::coagulate | ( | type(aero_data_t), intent(in) | aero_data, |
type(aero_state_t), intent(inout) | aero_state, | ||
integer, intent(in) | p1, | ||
integer, intent(in) | p2, | ||
integer, intent(in) | c1, | ||
integer, intent(in) | c2, | ||
integer, intent(in) | cc | ||
) |
Join together particles p1
and p2
, updating all particle and bin structures to reflect the change.
[in] | aero_data | Aerosol data. |
[in,out] | aero_state | Aerosol state. |
[in] | p1 | First particle index. |
[in] | p2 | Second particle index. |
[in] | c1 | First weight class. |
[in] | c2 | Second weight class. |
[in] | cc | Coagulated weight class. |
Definition at line 876 of file coagulation.F90.
subroutine pmc_coagulation::coagulate_weighting | ( | type(aero_particle_t), intent(in) | pt1, |
type(aero_particle_t), intent(in) | pt2, | ||
type(aero_particle_t), intent(inout) | ptc, | ||
integer, intent(in) | c1, | ||
integer, intent(in) | c2, | ||
integer, intent(in) | cc, | ||
type(aero_data_t), intent(in) | aero_data, | ||
type(aero_weight_array_t), intent(in) | aero_weight_array, | ||
logical, intent(out) | remove_1, | ||
logical, intent(out) | remove_2, | ||
logical, intent(out) | create_new, | ||
logical, intent(out) | id_1_lost, | ||
logical, intent(out) | id_2_lost, | ||
type(aero_info_t), intent(inout) | aero_info_1, | ||
type(aero_info_t), intent(inout) | aero_info_2 | ||
) |
Actually coagulate pt1 and pt2 to form ptc and compute weighting effects, including which particles should be lost and which gained.
[in] | pt1 | First coagulating aerosol particle. |
[in] | pt2 | Second coagulating aerosol particle. |
[in,out] | ptc | Combined aerosol particle resulting from coagulation of pt1 and pt2. |
[in] | c1 | First weight class. |
[in] | c2 | Second weight class. |
[in] | cc | Coagulated weight class. |
[in] | aero_data | Aerosol data. |
[in] | aero_weight_array | Aerosol weight array. |
[out] | remove_1 | Whether to remove pt1. |
[out] | remove_2 | Whether to remove pt2. |
[out] | create_new | Whether to create ptc. |
[out] | id_1_lost | Whether the ID of pt1 will be lost due to coagulation. |
[out] | id_2_lost | Whether the ID of pt2 will be lost due to coagulation. |
[in,out] | aero_info_1 | The removal information associated with pt1. |
[in,out] | aero_info_2 | The removal information associated with pt2. |
Definition at line 759 of file coagulation.F90.
subroutine pmc_coagulation::compute_n_samp | ( | integer, intent(in) | ni, |
integer, intent(in) | nj, | ||
logical, intent(in) | same_bin, | ||
real(kind=dp), intent(in) | k_max, | ||
real(kind=dp), intent(in) | del_t, | ||
real(kind=dp), intent(out) | n_samp_mean, | ||
integer, intent(out) | n_samp, | ||
real(kind=dp), intent(out) | accept_factor | ||
) |
Compute the number of samples required for the pair of bins.
[in] | ni | Number particles in first bin. |
[in] | nj | Number particles in second bin. |
[in] | same_bin | Whether first bin is second bin. |
[in] | k_max | Maximum kernel value (s^{-1} m^3). |
[in] | del_t | Timestep (s). |
[out] | n_samp_mean | Mean number of samples per timestep. |
[out] | n_samp | Number of samples per timestep. |
[out] | accept_factor | Scale factor for accept probability (1). |
Definition at line 597 of file coagulation.F90.
subroutine pmc_coagulation::compute_n_source | ( | integer, intent(in) | n_part, |
real(kind=dp), intent(in) | k_max, | ||
real(kind=dp), intent(in) | del_t, | ||
real(kind=dp), intent(out) | n_source_per_target, | ||
real(kind=dp), intent(out) | accept_factor | ||
) |
[in] | n_part | Number of particles available as partners. |
[in] | k_max | Maximum coagulation kernel (s^{-1} m^3). |
[in] | del_t | Timestep (s). |
[out] | n_source_per_target | Mean number of source particles per target particle. |
[out] | accept_factor | Accept factor for samples. |
Definition at line 311 of file coagulation.F90.
subroutine pmc_coagulation::determine_target_and_source | ( | type(aero_weight_array_t), intent(in) | aero_weight_array, |
type(bin_grid_t), intent(in) | bin_grid, | ||
integer, intent(in) | b1, | ||
integer, intent(in) | b2, | ||
integer, intent(in) | c1, | ||
integer, intent(in) | c2, | ||
integer, intent(in) | cc, | ||
integer, intent(out) | bt, | ||
integer, intent(out) | bs, | ||
integer, intent(out) | ct, | ||
integer, intent(out) | cs, | ||
logical, intent(out) | correct_weight_ordering | ||
) |
Determine the source and target particle bin/group for per-particle coagulation, if possible.
[in] | aero_weight_array | Aero weight array. |
[in] | bin_grid | Bin grid. |
[in] | b1 | First bin number. |
[in] | b2 | Second bin number. |
[in] | c1 | First weight class. |
[in] | c2 | Second weight class. |
[in] | cc | Coagulated weight class. |
[out] | bt | Target bin number. |
[out] | bs | Source bin number. |
[out] | ct | Target weight class. |
[out] | cs | Source weight class. |
[out] | correct_weight_ordering | Whether the weight ordering is correct for per-particle coagulation. |
Definition at line 247 of file coagulation.F90.
subroutine pmc_coagulation::find_rand_pair | ( | type(aero_sorted_t), intent(in) | aero_sorted, |
integer, intent(in) | b1, | ||
integer, intent(in) | b2, | ||
integer, intent(in) | c1, | ||
integer, intent(in) | c2, | ||
integer, intent(out) | i1, | ||
integer, intent(out) | i2 | ||
) |
Given (b1, c1)
and (b2, c2)
, find a random pair of particles (b1, c1, i1)
and (b2, c2, i2)
that are not the same particle particle as each other.
[in] | aero_sorted | Aerosol sorted data. |
[in] | b1 | Bin number of first particle. |
[in] | b2 | Bin number of second particle. |
[in] | c1 | Weight class of first particle. |
[in] | c2 | Weight class of second particle. |
[out] | i1 | First rand particle. |
[out] | i2 | Second rand particle. |
Definition at line 715 of file coagulation.F90.
subroutine pmc_coagulation::maybe_coag_pair | ( | type(env_state_t), intent(in) | env_state, |
type(aero_data_t), intent(in) | aero_data, | ||
type(aero_state_t), intent(inout) | aero_state, | ||
integer, intent(in) | b1, | ||
integer, intent(in) | b2, | ||
integer, intent(in) | c1, | ||
integer, intent(in) | c2, | ||
integer, intent(in) | cc, | ||
integer, intent(in) | coag_kernel_type, | ||
real(kind=dp), intent(in) | accept_factor, | ||
logical, intent(out) | did_coag | ||
) |
Choose a random pair for potential coagulation and test its probability of coagulation. If it happens, do the coagulation and update all structures.
The probability of a coagulation will be taken as (kernel / k_max)
.
[in] | env_state | Environment state. |
[in] | aero_data | Aerosol data. |
[in,out] | aero_state | Aerosol state. |
[in] | b1 | Bin of first particle. |
[in] | b2 | Bin of second particle. |
[in] | c1 | First weight class. |
[in] | c2 | Second weight class. |
[in] | cc | Coagulated weight class. |
[in] | coag_kernel_type | Coagulation kernel type. |
[in] | accept_factor | Scale factor for accept probability (1). |
[out] | did_coag | Whether a coagulation occured. |
Definition at line 661 of file coagulation.F90.
subroutine pmc_coagulation::mc_coag | ( | integer, intent(in) | coag_kernel_type, |
type(env_state_t), intent(in) | env_state, | ||
type(aero_data_t), intent(in) | aero_data, | ||
type(aero_state_t), intent(inout) | aero_state, | ||
real(kind=dp) | del_t, | ||
integer, intent(out) | tot_n_samp, | ||
integer, intent(out) | tot_n_coag | ||
) |
Do coagulation for time del_t.
[in] | coag_kernel_type | Coagulation kernel type. |
[in] | env_state | Environment state. |
[in] | aero_data | Aerosol data. |
[in,out] | aero_state | Aerosol state. |
del_t | Timestep for coagulation. | |
[out] | tot_n_samp | Total number of samples tested. |
[out] | tot_n_coag | Number of coagulation events. |
Definition at line 43 of file coagulation.F90.
subroutine pmc_coagulation::mc_coag_for_bin | ( | integer, intent(in) | coag_kernel_type, |
type(env_state_t), intent(in) | env_state, | ||
type(aero_data_t), intent(in) | aero_data, | ||
type(aero_state_t), intent(inout) | aero_state, | ||
real(kind=dp) | del_t, | ||
integer, intent(inout) | tot_n_samp, | ||
integer, intent(inout) | tot_n_coag, | ||
integer, intent(in) | b1, | ||
integer, intent(in) | b2, | ||
integer, intent(in) | c1, | ||
integer, intent(in) | c2 | ||
) |
Do coagulation for time del_t for the given bins.
[in] | coag_kernel_type | Coagulation kernel type. |
[in] | env_state | Environment state. |
[in] | aero_data | Aerosol data. |
[in,out] | aero_state | Aerosol state. |
del_t | Timestep for coagulation. | |
[in,out] | tot_n_samp | Total number of samples tested. |
[in,out] | tot_n_coag | Number of coagulation events. |
[in] | b1 | First bin number. |
[in] | b2 | Second bin number. |
[in] | c1 | First weight class. |
[in] | c2 | Second weight class. |
Definition at line 101 of file coagulation.F90.
subroutine pmc_coagulation::per_set_coag | ( | integer, intent(in) | coag_kernel_type, |
real(kind=dp), intent(in) | k_max, | ||
type(env_state_t), intent(in) | env_state, | ||
type(aero_data_t), intent(in) | aero_data, | ||
type(aero_state_t), intent(inout) | aero_state, | ||
real(kind=dp) | del_t, | ||
integer, intent(inout) | tot_n_samp, | ||
integer, intent(inout) | tot_n_coag, | ||
integer, intent(in) | b1, | ||
integer, intent(in) | b2, | ||
integer, intent(in) | c1, | ||
integer, intent(in) | c2, | ||
integer, intent(in) | cc | ||
) |
Do set-wise coagulation.
[in] | coag_kernel_type | Coagulation kernel type. |
[in] | k_max | Maximum coagulation kernel (s^{-1} m^3). |
[in] | env_state | Environment state. |
[in] | aero_data | Aerosol data. |
[in,out] | aero_state | Aerosol state. |
del_t | Timestep for coagulation. | |
[in,out] | tot_n_samp | Total number of samples tested. |
[in,out] | tot_n_coag | Number of coagulation events. |
[in] | b1 | First bin number. |
[in] | b2 | Second bin number. |
[in] | c1 | First weight class. |
[in] | c2 | Second weight class. |
[in] | cc | Coagulated weight class. |
Definition at line 536 of file coagulation.F90.
subroutine pmc_coagulation::sample_source_particle | ( | type(aero_state_t), intent(inout) | aero_state, |
type(aero_data_t), intent(in) | aero_data, | ||
type(env_state_t), intent(in) | env_state, | ||
integer, intent(in) | coag_kernel_type, | ||
integer, intent(in) | bs, | ||
integer, intent(in) | cs, | ||
type(aero_particle_t), intent(in) | coag_particle, | ||
real(kind=dp), intent(in) | n_samp_mean, | ||
real(kind=dp), intent(in) | accept_factor, | ||
integer, intent(out) | n_samp, | ||
integer, intent(out) | n_coag, | ||
integer, intent(out) | n_remove, | ||
type(aero_particle_t), intent(inout) | source_particle | ||
) |
Sample coagulation partners for a single coagulation event.
[in,out] | aero_state | Aerosol state. |
[in] | aero_data | Aerosol data. |
[in] | env_state | Environment state. |
[in] | coag_kernel_type | Coagulation kernel type. |
[in] | bs | Bin to sample particles from. |
[in] | cs | Weight class to sample particles from. |
[in] | coag_particle | Aerosol particle that coagulation will be with. |
[in] | n_samp_mean | Mean number of samples to use. |
[in] | accept_factor | Probability factor of accepting samples. |
[out] | n_samp | Number of samples used. |
[out] | n_coag | Number of coagulations performed. |
[out] | n_remove | Number of particles removed. |
[in,out] | source_particle | Sampled average coagulation partner particle. |
Definition at line 333 of file coagulation.F90.
subroutine pmc_coagulation::try_per_particle_coag | ( | integer, intent(in) | coag_kernel_type, |
real(kind=dp), intent(in) | k_max, | ||
type(env_state_t), intent(in) | env_state, | ||
type(aero_data_t), intent(in) | aero_data, | ||
type(aero_state_t), intent(inout) | aero_state, | ||
real(kind=dp) | del_t, | ||
integer, intent(inout) | tot_n_samp, | ||
integer, intent(inout) | tot_n_coag, | ||
integer, intent(in) | b1, | ||
integer, intent(in) | b2, | ||
integer, intent(in) | c1, | ||
integer, intent(in) | c2, | ||
integer, intent(in) | cc, | ||
logical, intent(inout) | per_particle_coag_succeeded | ||
) |
Attempt per-particle coagulation.
[in] | coag_kernel_type | Coagulation kernel type. |
[in] | k_max | Maximum coagulation kernel (s^{-1} m^3). |
[in] | env_state | Environment state. |
[in] | aero_data | Aerosol data. |
[in,out] | aero_state | Aerosol state. |
del_t | Timestep for coagulation. | |
[in,out] | tot_n_samp | Total number of samples tested. |
[in,out] | tot_n_coag | Number of coagulation events. |
[in] | b1 | First bin number. |
[in] | b2 | Second bin number. |
[in] | c1 | First weight class. |
[in] | c2 | Second weight class. |
[in] | cc | Coagulated weight class. |
[in,out] | per_particle_coag_succeeded | Whether we succeeded in doing per-particle coag. |
Definition at line 150 of file coagulation.F90.
real(kind=dp), parameter pmc_coagulation::coag_accel_max_cv = 0.1d0 |
Maximum allowed coefficient-of-variation due to undersampling in accelerated coagulation.
Definition at line 33 of file coagulation.F90.
real(kind=dp), parameter pmc_coagulation::coag_accel_n_event = 1d0 |
Minimum number of coagulation events per large particle for which accelerated coagulation is used.
Definition at line 30 of file coagulation.F90.
real(kind=dp), parameter pmc_coagulation::max_allowable_growth_factor = 1.5d0 |
Maximum allowable growth factor of a target particle volume within one timestep when using accelerated coagulation.
Definition at line 36 of file coagulation.F90.