PartMC  2.6.1
Functions/Subroutines | Variables
pmc_coagulation Module Reference

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

Detailed Description

Aerosol particle coagulation.

Function/Subroutine Documentation

◆ coag_target_with_source()

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.

Parameters
[in,out]aero_stateAerosol state.
[in]aero_dataAerosol data.
[in]btBin of coagulating particle.
[in]ctWeight class of coagulating particle.
[in]target_unif_entryEntry-in-bin of coagulating particle.
[in]source_particleSampled particle to coagulate with.
[in]ccWeight class for coagulated particle.

Definition at line 472 of file coagulation.F90.

◆ coagulate()

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.

Parameters
[in]aero_dataAerosol data.
[in,out]aero_stateAerosol state.
[in]p1First particle index.
[in]p2Second particle index.
[in]c1First weight class.
[in]c2Second weight class.
[in]ccCoagulated weight class.

Definition at line 876 of file coagulation.F90.

◆ coagulate_weighting()

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.

Parameters
[in]pt1First coagulating aerosol particle.
[in]pt2Second coagulating aerosol particle.
[in,out]ptcCombined aerosol particle resulting from coagulation of pt1 and pt2.
[in]c1First weight class.
[in]c2Second weight class.
[in]ccCoagulated weight class.
[in]aero_dataAerosol data.
[in]aero_weight_arrayAerosol weight array.
[out]remove_1Whether to remove pt1.
[out]remove_2Whether to remove pt2.
[out]create_newWhether to create ptc.
[out]id_1_lostWhether the ID of pt1 will be lost due to coagulation.
[out]id_2_lostWhether the ID of pt2 will be lost due to coagulation.
[in,out]aero_info_1The removal information associated with pt1.
[in,out]aero_info_2The removal information associated with pt2.

Definition at line 759 of file coagulation.F90.

◆ compute_n_samp()

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.

Parameters
[in]niNumber particles in first bin.
[in]njNumber particles in second bin.
[in]same_binWhether first bin is second bin.
[in]k_maxMaximum kernel value (s^{-1} m^3).
[in]del_tTimestep (s).
[out]n_samp_meanMean number of samples per timestep.
[out]n_sampNumber of samples per timestep.
[out]accept_factorScale factor for accept probability (1).

Definition at line 597 of file coagulation.F90.

◆ compute_n_source()

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 
)
Parameters
[in]n_partNumber of particles available as partners.
[in]k_maxMaximum coagulation kernel (s^{-1} m^3).
[in]del_tTimestep (s).
[out]n_source_per_targetMean number of source particles per target particle.
[out]accept_factorAccept factor for samples.

Definition at line 311 of file coagulation.F90.

◆ determine_target_and_source()

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.

Parameters
[in]aero_weight_arrayAero weight array.
[in]bin_gridBin grid.
[in]b1First bin number.
[in]b2Second bin number.
[in]c1First weight class.
[in]c2Second weight class.
[in]ccCoagulated weight class.
[out]btTarget bin number.
[out]bsSource bin number.
[out]ctTarget weight class.
[out]csSource weight class.
[out]correct_weight_orderingWhether the weight ordering is correct for per-particle coagulation.

Definition at line 247 of file coagulation.F90.

◆ find_rand_pair()

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.

Parameters
[in]aero_sortedAerosol sorted data.
[in]b1Bin number of first particle.
[in]b2Bin number of second particle.
[in]c1Weight class of first particle.
[in]c2Weight class of second particle.
[out]i1First rand particle.
[out]i2Second rand particle.

Definition at line 715 of file coagulation.F90.

◆ maybe_coag_pair()

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

Parameters
[in]env_stateEnvironment state.
[in]aero_dataAerosol data.
[in,out]aero_stateAerosol state.
[in]b1Bin of first particle.
[in]b2Bin of second particle.
[in]c1First weight class.
[in]c2Second weight class.
[in]ccCoagulated weight class.
[in]coag_kernel_typeCoagulation kernel type.
[in]accept_factorScale factor for accept probability (1).
[out]did_coagWhether a coagulation occured.

Definition at line 661 of file coagulation.F90.

◆ mc_coag()

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.

Parameters
[in]coag_kernel_typeCoagulation kernel type.
[in]env_stateEnvironment state.
[in]aero_dataAerosol data.
[in,out]aero_stateAerosol state.
del_tTimestep for coagulation.
[out]tot_n_sampTotal number of samples tested.
[out]tot_n_coagNumber of coagulation events.

Definition at line 43 of file coagulation.F90.

◆ mc_coag_for_bin()

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.

Parameters
[in]coag_kernel_typeCoagulation kernel type.
[in]env_stateEnvironment state.
[in]aero_dataAerosol data.
[in,out]aero_stateAerosol state.
del_tTimestep for coagulation.
[in,out]tot_n_sampTotal number of samples tested.
[in,out]tot_n_coagNumber of coagulation events.
[in]b1First bin number.
[in]b2Second bin number.
[in]c1First weight class.
[in]c2Second weight class.

Definition at line 101 of file coagulation.F90.

◆ per_set_coag()

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.

Parameters
[in]coag_kernel_typeCoagulation kernel type.
[in]k_maxMaximum coagulation kernel (s^{-1} m^3).
[in]env_stateEnvironment state.
[in]aero_dataAerosol data.
[in,out]aero_stateAerosol state.
del_tTimestep for coagulation.
[in,out]tot_n_sampTotal number of samples tested.
[in,out]tot_n_coagNumber of coagulation events.
[in]b1First bin number.
[in]b2Second bin number.
[in]c1First weight class.
[in]c2Second weight class.
[in]ccCoagulated weight class.

Definition at line 536 of file coagulation.F90.

◆ sample_source_particle()

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.

Parameters
[in,out]aero_stateAerosol state.
[in]aero_dataAerosol data.
[in]env_stateEnvironment state.
[in]coag_kernel_typeCoagulation kernel type.
[in]bsBin to sample particles from.
[in]csWeight class to sample particles from.
[in]coag_particleAerosol particle that coagulation will be with.
[in]n_samp_meanMean number of samples to use.
[in]accept_factorProbability factor of accepting samples.
[out]n_sampNumber of samples used.
[out]n_coagNumber of coagulations performed.
[out]n_removeNumber of particles removed.
[in,out]source_particleSampled average coagulation partner particle.

Definition at line 333 of file coagulation.F90.

◆ try_per_particle_coag()

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.

Parameters
[in]coag_kernel_typeCoagulation kernel type.
[in]k_maxMaximum coagulation kernel (s^{-1} m^3).
[in]env_stateEnvironment state.
[in]aero_dataAerosol data.
[in,out]aero_stateAerosol state.
del_tTimestep for coagulation.
[in,out]tot_n_sampTotal number of samples tested.
[in,out]tot_n_coagNumber of coagulation events.
[in]b1First bin number.
[in]b2Second bin number.
[in]c1First weight class.
[in]c2Second weight class.
[in]ccCoagulated weight class.
[in,out]per_particle_coag_succeededWhether we succeeded in doing per-particle coag.

Definition at line 150 of file coagulation.F90.

Variable Documentation

◆ coag_accel_max_cv

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.

◆ coag_accel_n_event

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.

◆ max_allowable_growth_factor

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.