PartMC
2.6.1
|
The aero_state_t structure and assocated subroutines. More...
Data Types | |
type | aero_state_t |
The current collection of aerosol particles. More... | |
Functions/Subroutines | |
elemental integer function | aero_state_n_part (aero_state) |
Return the current number of particles. More... | |
subroutine | aero_state_copy_weight (aero_state_from, aero_state_to) |
Copies weighting information for an aero_state . More... | |
subroutine | aero_state_set_weight (aero_state, aero_data, weight_type, exponent) |
Sets the weighting functions for an aero_state . More... | |
subroutine | aero_state_set_n_part_ideal (aero_state, n_part) |
Set the ideal number of particles to the given value. The aero_state%awa must be already set correctly. More... | |
integer function | aero_state_weight_class_for_source (aero_state, source) |
Determine the appropriate weight class for a source. More... | |
integer function | aero_state_total_particles (aero_state, i_group, i_class) |
Returns the total number of particles in an aerosol distribution. More... | |
integer function | aero_state_total_particles_all_procs (aero_state, i_group, i_class) |
Returns the total number of particles across all processes. More... | |
subroutine | aero_state_zero (aero_state) |
Resets an aero_state to have zero particles per bin. More... | |
subroutine | aero_state_add_particle (aero_state, aero_particle, aero_data, allow_resort) |
Add the given particle. More... | |
subroutine | aero_state_remove_particle_no_info (aero_state, i_part) |
Remove the given particle without recording it. More... | |
subroutine | aero_state_remove_particle_with_info (aero_state, i_part, aero_info) |
Remove the given particle and record the removal. More... | |
subroutine | aero_state_remove_particle (aero_state, i_part, record_removal, aero_info) |
Remove the given particle and possibly record the removal. More... | |
subroutine | aero_state_remove_rand_particle_from_bin (aero_state, i_bin, i_class, aero_particle) |
Remove a randomly chosen particle from the given bin and return it. More... | |
subroutine | aero_state_dup_particle (aero_state, aero_data, i_part, n_part_mean, random_weight_group) |
Add copies or remove a particle, with a given mean number of resulting particles. More... | |
real(kind=dp) function | aero_state_particle_num_conc (aero_state, aero_particle, aero_data) |
The number concentration of a single particle (m^{-3}). More... | |
subroutine | aero_state_num_conc_for_reweight (aero_state, aero_data, reweight_num_conc) |
Save the correct number concentrations for later use by aero_state_reweight(). More... | |
subroutine | aero_state_reweight (aero_state, aero_data, reweight_num_conc) |
Reweight all particles after their constituent volumes have been altered. More... | |
subroutine | aero_state_add (aero_state, aero_state_delta, aero_data) |
aero_state += aero_state_delta , including combining the weights, so the new concentration is the weighted average of the two concentrations. More... | |
subroutine | aero_state_add_particles (aero_state, aero_state_delta, aero_data) |
aero_state += aero_state_delta , with the weight of aero_state left unchanged, so the new concentration is the sum of the two concentrations, computed with aero_state%awa . More... | |
subroutine | aero_state_prepare_weight_for_add (aero_state, aero_data, i_group, i_class, n_add, allow_doubling, allow_halving) |
Change the weight if necessary to ensure that the addition of about n_add computational particles will give the correct final particle number. More... | |
subroutine | aero_state_add_aero_dist_sample (aero_state, aero_data, aero_dist, sample_prop, create_time, allow_doubling, allow_halving, n_part_add) |
Generates a Poisson sample of an aero_dist , adding to aero_state , with the given sample proportion. More... | |
subroutine | aero_state_rand_particle (aero_state, i_part) |
Choose a random particle from the aero_state. More... | |
subroutine | aero_state_sample_particles (aero_state_from, aero_state_to, aero_data, sample_prob, removal_action) |
Generates a random sample by removing particles from aero_state_from and adding them to aero_state_to, which must be already allocated (and should have its weight set). More... | |
subroutine | aero_state_sample (aero_state_from, aero_state_to, aero_data, sample_prob, removal_action) |
Generates a random sample by removing particles from aero_state_from and adding them to aero_state_to, transfering weight as well. This is the equivalent of aero_state_add(). More... | |
subroutine | aero_state_to_binned (bin_grid, aero_data, aero_state, aero_binned) |
Create binned number and mass arrays. More... | |
integer function, dimension(aero_state_n_part(aero_state)) | aero_state_ids (aero_state) |
Returns the IDs of all particles. More... | |
real(kind=dp) function, dimension(aero_state_n_part(aero_state)) | aero_state_diameters (aero_state, aero_data, include, exclude) |
Returns the diameters of all particles. More... | |
real(kind=dp) function, dimension(aero_state_n_part(aero_state)) | aero_state_dry_diameters (aero_state, aero_data) |
Returns the dry diameters of all particles. More... | |
real(kind=dp) function, dimension( aero_state_n_part(aero_state)) | aero_state_mobility_diameters (aero_state, aero_data, env_state) |
Returns the mobility diameters of all particles. More... | |
real(kind=dp) function, dimension(aero_state_n_part(aero_state)) | aero_state_volumes (aero_state, aero_data, include, exclude) |
Returns the volumes of all particles. More... | |
real(kind=dp) function, dimension(aero_state_n_part(aero_state)) | aero_state_masses (aero_state, aero_data, include, exclude) |
Returns the masses of all particles. More... | |
real(kind=dp) function, dimension(aero_state_n_part(aero_state)) | aero_state_num_concs (aero_state, aero_data) |
Returns the number concentrations of all particles. More... | |
real(kind=dp) function | aero_state_total_num_conc (aero_state, aero_data) |
Returns the total number concentration. More... | |
real(kind=dp) function, dimension(aero_state_n_part(aero_state)) | aero_state_mass_entropies (aero_state, aero_data, include, exclude, group, groups) |
Returns the mass-entropies of all particles. More... | |
subroutine | aero_state_mixing_state_metrics (aero_state, aero_data, d_alpha, d_gamma, chi, include, exclude, group, groups) |
Returns the mixing state metrics of the population. More... | |
real(kind=dp) function, dimension(aero_state_n_part(aero_state)) | aero_state_approx_crit_rel_humids (aero_state, aero_data, env_state) |
Returns the approximate critical relative humidity for all particles (1). More... | |
real(kind=dp) function, dimension(aero_state_n_part(aero_state)) | aero_state_crit_rel_humids (aero_state, aero_data, env_state) |
Returns the critical relative humidity for all particles (1). More... | |
subroutine | aero_state_to_binned_dry (bin_grid, aero_data, aero_state, aero_binned) |
Does the same thing as aero_state_to_bin() but based on dry radius. More... | |
subroutine | aero_state_double (aero_state, aero_data, i_group, i_class) |
Doubles number of particles in the given weight group. More... | |
subroutine | aero_state_halve (aero_state, i_group, i_class) |
Remove approximately half of the particles in the given weight group. More... | |
subroutine | aero_state_rebalance (aero_state, aero_data, allow_doubling, allow_halving, initial_state_warning) |
Double or halve the particle population in each weight group to maintain close to n_part_ideal particles per process, allocated equally amongst the weight groups. More... | |
subroutine | aero_state_scale_weight (aero_state, aero_data, i_group, i_class, weight_ratio, allow_doubling, allow_halving) |
Scale the weighting of the given group/class by the given ratio, altering particle number as necessary to preserve the number concentration. More... | |
subroutine | aero_state_mix (aero_state, del_t, mix_timescale, aero_data, specify_prob_transfer) |
Mix the aero_states between all processes. Currently uses a simple all-to-all diffusion. More... | |
subroutine | aero_state_mpi_alltoall (send, recv) |
Do an MPI all-to-all transfer of aerosol states. More... | |
subroutine | aero_state_bin_average_comp (aero_state, bin_grid, aero_data) |
Set each aerosol particle to have its original total volume, but species volume ratios given by the total species volume ratio within each bin. This preserves the (weighted) total species volume per bin as well as per-particle total volumes. More... | |
subroutine | aero_state_bin_average_size (aero_state, bin_grid, aero_data, bin_center, preserve_number) |
Set each aerosol particle to have its original species ratios, but total volume given by the average volume of all particles within each bin. More... | |
subroutine | aero_state_make_dry (aero_state, aero_data) |
Make all particles dry (water set to zero). More... | |
integer function | pmc_mpi_pack_size_aero_state (val) |
Determines the number of bytes required to pack the given value. More... | |
subroutine | pmc_mpi_pack_aero_state (buffer, position, val) |
Packs the given value into the buffer, advancing position. More... | |
subroutine | pmc_mpi_unpack_aero_state (buffer, position, val) |
Unpacks the given value from the buffer, advancing position. More... | |
subroutine | aero_state_mpi_gather (aero_state, aero_state_total, aero_data) |
Gathers data from all processes into one aero_state on process 0. More... | |
subroutine | aero_state_netcdf_dim_aero_particle (aero_state, ncid, dimid_aero_particle) |
Write the aero particle dimension to the given NetCDF file if it is not already present and in any case return the associated dimid. More... | |
subroutine | aero_state_netcdf_dim_aero_removed (aero_state, ncid, dimid_aero_removed) |
Write the aero removed dimension to the given NetCDF file if it is not already present and in any case return the associated dimid. More... | |
subroutine | aero_state_input_netcdf (aero_state, ncid, aero_data) |
Read full state. More... | |
subroutine | aero_state_sort (aero_state, aero_data, bin_grid, all_procs_same) |
Sorts the particles if necessary. More... | |
subroutine | aero_state_check (aero_state, aero_data) |
Check that aerosol state data is consistent. More... | |
subroutine | aero_state_initialize (aero_state, aero_data, camp_core) |
Initialize the aero_state_t variable with camp chem data. More... | |
Variables | |
integer, parameter | aero_state_tag_mix = 4987 |
MPI tag for mixing particles between processes. More... | |
integer, parameter | aero_state_tag_gather = 4988 |
MPI tag for gathering between processes. More... | |
integer, parameter | aero_state_tag_scatter = 4989 |
MPI tag for scattering between processes. More... | |
integer, parameter | aero_state_weight_none = 1 |
Single flat weighting scheme. More... | |
integer, parameter | aero_state_weight_flat = 2 |
Single flat weighting scheme. More... | |
integer, parameter | aero_state_weight_power = 3 |
Power-law weighting scheme. More... | |
integer, parameter | aero_state_weight_nummass = 4 |
Coupled number/mass weighting scheme. More... | |
integer, parameter | aero_state_weight_flat_source = 5 |
Flat weighting by source. More... | |
integer, parameter | aero_state_weight_power_source = 6 |
Power-law weighting by source. More... | |
integer, parameter | aero_state_weight_nummass_source = 7 |
Coupled number/mass weighting by source. More... | |
The aero_state_t structure and assocated subroutines.
subroutine pmc_aero_state::aero_state_add | ( | type(aero_state_t), intent(inout) | aero_state, |
type(aero_state_t), intent(in) | aero_state_delta, | ||
type(aero_data_t), intent(in) | aero_data | ||
) |
aero_state += aero_state_delta
, including combining the weights, so the new concentration is the weighted average of the two concentrations.
[in,out] | aero_state | Aerosol state. |
[in] | aero_state_delta | Increment. |
[in] | aero_data | Aerosol data. |
Definition at line 625 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_add_aero_dist_sample | ( | type(aero_state_t), intent(inout) | aero_state, |
type(aero_data_t), intent(in) | aero_data, | ||
type(aero_dist_t), intent(in) | aero_dist, | ||
real(kind=dp), intent(in) | sample_prop, | ||
real(kind=dp), intent(in) | create_time, | ||
logical, intent(in) | allow_doubling, | ||
logical, intent(in) | allow_halving, | ||
integer, intent(out), optional | n_part_add | ||
) |
Generates a Poisson sample of an aero_dist
, adding to aero_state
, with the given sample proportion.
[in,out] | aero_state | Aero state to add to. |
[in] | aero_data | Aero data values. |
[in] | aero_dist | Distribution to sample. |
[in] | sample_prop | Fraction to sample (1). |
[in] | create_time | Creation time for new particles (s). |
[in] | allow_doubling | Whether to allow doubling of the population. |
[in] | allow_halving | Whether to allow halving of the population. |
[out] | n_part_add | Number of particles added. |
Definition at line 714 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_add_particle | ( | type(aero_state_t), intent(inout) | aero_state, |
type(aero_particle_t), intent(in) | aero_particle, | ||
type(aero_data_t), intent(in) | aero_data, | ||
logical, intent(in), optional | allow_resort | ||
) |
Add the given particle.
[in,out] | aero_state | Aerosol state. |
[in] | aero_particle | Particle to add. |
[in] | aero_data | Aerosol data. |
[in] | allow_resort | Whether to allow a resort due to the add. |
Definition at line 336 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_add_particles | ( | type(aero_state_t), intent(inout) | aero_state, |
type(aero_state_t), intent(in) | aero_state_delta, | ||
type(aero_data_t), intent(in) | aero_data | ||
) |
aero_state += aero_state_delta
, with the weight of aero_state
left unchanged, so the new concentration is the sum of the two concentrations, computed with aero_state%awa
.
[in,out] | aero_state | Aerosol state. |
[in] | aero_state_delta | Increment. |
[in] | aero_data | Aerosol data. |
Definition at line 644 of file aero_state.F90.
real(kind=dp) function, dimension(aero_state_n_part(aero_state)) pmc_aero_state::aero_state_approx_crit_rel_humids | ( | type(aero_state_t), intent(in) | aero_state, |
type(aero_data_t), intent(in) | aero_data, | ||
type(env_state_t), intent(in) | env_state | ||
) |
Returns the approximate critical relative humidity for all particles (1).
[in] | aero_state | Aerosol state. |
[in] | aero_data | Aerosol data. |
[in] | env_state | Environment state. |
Definition at line 1456 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_bin_average_comp | ( | type(aero_state_t), intent(inout) | aero_state, |
type(bin_grid_t), intent(in) | bin_grid, | ||
type(aero_data_t), intent(in) | aero_data | ||
) |
Set each aerosol particle to have its original total volume, but species volume ratios given by the total species volume ratio within each bin. This preserves the (weighted) total species volume per bin as well as per-particle total volumes.
[in,out] | aero_state | Aerosol state to average. |
[in] | bin_grid | Bin grid to average within. |
[in] | aero_data | Aerosol data. |
Definition at line 1895 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_bin_average_size | ( | type(aero_state_t), intent(inout) | aero_state, |
type(bin_grid_t), intent(in) | bin_grid, | ||
type(aero_data_t), intent(in) | aero_data, | ||
logical, intent(in) | bin_center, | ||
logical, intent(in) | preserve_number | ||
) |
Set each aerosol particle to have its original species ratios, but total volume given by the average volume of all particles within each bin.
This does not preserve the total species volume per bin. If the bin_center
parameter is .true. then the particles in each bin are set to have the bin center volume, rather than the average volume of the particles in that bin.
If the weighting function is not constant (AERO_WEIGHT_TYPE_NONE) then the averaging can be performed in either a number-preserving way or in a volume-preserving way. The volume-preserving way does not preserve species volume ratios in gernal, but will do so if the particle population has already been composition-averaged.
[in,out] | aero_state | Aerosol state to average. |
[in] | bin_grid | Bin grid to average within. |
[in] | aero_data | Aerosol data. |
[in] | bin_center | Whether to assign the bin center volume (rather than the average volume). |
[in] | preserve_number | Whether to use the number-preserving scheme (otherwise will use the volume-preserving scheme). This parameter has no effect if bin_center is .true. |
Definition at line 1958 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_check | ( | type(aero_state_t), intent(in) | aero_state, |
type(aero_data_t), intent(in) | aero_data | ||
) |
Check that aerosol state data is consistent.
[in] | aero_state | Aerosol state to check. |
[in] | aero_data | Aerosol data. |
Definition at line 2959 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_copy_weight | ( | type(aero_state_t), intent(in) | aero_state_from, |
type(aero_state_t), intent(inout) | aero_state_to | ||
) |
Copies weighting information for an aero_state
.
[in] | aero_state_from | Reference aerosol. |
[in,out] | aero_state_to | Already allocated. |
Definition at line 157 of file aero_state.F90.
real(kind=dp) function, dimension(aero_state_n_part(aero_state)) pmc_aero_state::aero_state_crit_rel_humids | ( | type(aero_state_t), intent(in) | aero_state, |
type(aero_data_t), intent(in) | aero_data, | ||
type(env_state_t), intent(in) | env_state | ||
) |
Returns the critical relative humidity for all particles (1).
[in] | aero_state | Aerosol state. |
[in] | aero_data | Aerosol data. |
[in] | env_state | Environment state. |
Definition at line 1482 of file aero_state.F90.
real(kind=dp) function, dimension(aero_state_n_part(aero_state)) pmc_aero_state::aero_state_diameters | ( | type(aero_state_t), intent(in) | aero_state, |
type(aero_data_t), intent(in) | aero_data, | ||
character(len=*), dimension(:), intent(in), optional | include, | ||
character(len=*), dimension(:), intent(in), optional | exclude | ||
) |
Returns the diameters of all particles.
[in] | aero_state | Aerosol state. |
[in] | aero_data | Aerosol data. |
[in] | include | Species names to include in the diameter. |
[in] | exclude | Species names to exclude in the diameter. |
Per-particle volume of included components
Definition at line 992 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_double | ( | type(aero_state_t), intent(inout) | aero_state, |
type(aero_data_t), intent(in) | aero_data, | ||
integer, intent(in) | i_group, | ||
integer, intent(in) | i_class | ||
) |
Doubles number of particles in the given weight group.
[in,out] | aero_state | Aerosol state. |
[in] | aero_data | Aerosol data. |
[in] | i_group | Weight group to double. |
[in] | i_class | Weight class to double. |
Definition at line 1547 of file aero_state.F90.
real(kind=dp) function, dimension(aero_state_n_part(aero_state)) pmc_aero_state::aero_state_dry_diameters | ( | type(aero_state_t), intent(in) | aero_state, |
type(aero_data_t), intent(in) | aero_data | ||
) |
Returns the dry diameters of all particles.
[in] | aero_state | Aerosol state. |
[in] | aero_data | Aerosol data. |
Definition at line 1017 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_dup_particle | ( | type(aero_state_t), intent(inout) | aero_state, |
type(aero_data_t), intent(in) | aero_data, | ||
integer, intent(in) | i_part, | ||
real(kind=dp), intent(in) | n_part_mean, | ||
logical, intent(in), optional | random_weight_group | ||
) |
Add copies or remove a particle, with a given mean number of resulting particles.
The particle number i_part
is either removed, or zero or more copies are added, with a random number of copies with the given mean n_part_mean
. The final number of particles is either floor(n_part_mean)
or ceiling(n_part_mean)
, chosen randomly so the mean is n_part_mean
.
[in,out] | aero_state | Aerosol state. |
[in] | aero_data | Aerosol data. |
[in] | i_part | Particle number. |
[in] | n_part_mean | Mean number of resulting particles. |
[in] | random_weight_group | Whether particle copies should be placed in a randomly chosen weight group. |
Definition at line 459 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_halve | ( | type(aero_state_t), intent(inout) | aero_state, |
integer, intent(in) | i_group, | ||
integer, intent(in) | i_class | ||
) |
Remove approximately half of the particles in the given weight group.
[in,out] | aero_state | Aerosol state. |
[in] | i_group | Weight group to halve. |
[in] | i_class | Weight class to halve. |
Definition at line 1578 of file aero_state.F90.
integer function, dimension(aero_state_n_part(aero_state)) pmc_aero_state::aero_state_ids | ( | type(aero_state_t), intent(in) | aero_state | ) |
Returns the IDs of all particles.
[in] | aero_state | Aerosol state. |
Definition at line 973 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_initialize | ( | type(aero_state_t), intent(inout) | aero_state, |
class(aero_data_t), intent(in) | aero_data, | ||
type(camp_core_t), intent(in) | camp_core | ||
) |
Initialize the aero_state_t variable with camp chem data.
[in,out] | aero_state | Aerosol state. |
[in] | aero_data | Aerosol data. |
[in] | camp_core | CAMP core. |
Definition at line 2982 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_input_netcdf | ( | type(aero_state_t), intent(inout) | aero_state, |
integer, intent(in) | ncid, | ||
type(aero_data_t), intent(in) | aero_data | ||
) |
Read full state.
[in,out] | aero_state | aero_state to read. |
[in] | ncid | NetCDF file ID, in data mode. |
[in] | aero_data | aero_data structure. |
Definition at line 2782 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_make_dry | ( | type(aero_state_t), intent(inout) | aero_state, |
type(aero_data_t), intent(in) | aero_data | ||
) |
Make all particles dry (water set to zero).
[in,out] | aero_state | Aerosol state to make dry. |
[in] | aero_data | Aerosol data. |
Definition at line 2156 of file aero_state.F90.
real(kind=dp) function, dimension(aero_state_n_part(aero_state)) pmc_aero_state::aero_state_mass_entropies | ( | type(aero_state_t), intent(in) | aero_state, |
type(aero_data_t), intent(in) | aero_data, | ||
character(len=*), dimension(:), optional | include, | ||
character(len=*), dimension(:), optional | exclude, | ||
character(len=*), dimension(:), optional | group, | ||
character(len=*), dimension(:,:), optional | groups | ||
) |
Returns the mass-entropies of all particles.
If include
is specified then only those species are included in computing the entropy. If exclude
is specified then all species except those species are included. If both include
and exclude
arguments are specified then only those species in include
but not in exclude
are included. If group
is specified then the species are divided into two sets, given by those in the group and those not in the group. The entropy is then computed using the total mass of each set. Alternatively groups
can be specified, which lists several groups of species.
[in] | aero_state | Aerosol state. |
[in] | aero_data | Aerosol data. |
include | Species names to include in the mass. | |
exclude | Species names to exclude in the mass. | |
group | Species names to group together. | |
groups | Sets of species names to group together. |
Definition at line 1243 of file aero_state.F90.
real(kind=dp) function, dimension(aero_state_n_part(aero_state)) pmc_aero_state::aero_state_masses | ( | type(aero_state_t), intent(in) | aero_state, |
type(aero_data_t), intent(in) | aero_data, | ||
character(len=*), dimension(:), intent(in), optional | include, | ||
character(len=*), dimension(:), intent(in), optional | exclude | ||
) |
Returns the masses of all particles.
If include
is specified then only those species are included in computing the masses. If exclude
is specified then all species except those species are included. If both include
and exclude
arguments are specified then only those species in include
but not in exclude
are included.
[in] | aero_state | Aerosol state. |
[in] | aero_data | Aerosol data. |
[in] | include | Species names to include in the mass. |
[in] | exclude | Species names to exclude in the mass. |
Definition at line 1132 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_mix | ( | type(aero_state_t), intent(inout) | aero_state, |
real(kind=dp), intent(in) | del_t, | ||
real(kind=dp), intent(in) | mix_timescale, | ||
type(aero_data_t), intent(in) | aero_data, | ||
real(kind=dp), intent(in), optional | specify_prob_transfer | ||
) |
Mix the aero_states between all processes. Currently uses a simple all-to-all diffusion.
[in,out] | aero_state | Aerosol state. |
[in] | del_t | Timestep (s). |
[in] | mix_timescale | Mixing timescale (s). |
[in] | aero_data | Aero data values. |
[in] | specify_prob_transfer | Transfer probability of each particle (0 means no mixing, 1 means total mixing). |
Definition at line 1741 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_mixing_state_metrics | ( | type(aero_state_t), intent(in) | aero_state, |
type(aero_data_t), intent(in) | aero_data, | ||
real(kind=dp), intent(out) | d_alpha, | ||
real(kind=dp), intent(out) | d_gamma, | ||
real(kind=dp), intent(out) | chi, | ||
character(len=*), dimension(:), optional | include, | ||
character(len=*), dimension(:), optional | exclude, | ||
character(len=*), dimension(:), optional | group, | ||
character(len=*), dimension(:,:), optional | groups | ||
) |
Returns the mixing state metrics of the population.
If include
is specified then only those species are included in computing the entropies. If exclude
is specified then all species except those species are included. If both include
and exclude
arguments are specified then only those species in include
but not in exclude
are included. If group
is specified then the species are divided into two sets, given by those in the group and those not in the group. The entropies are then computed using the total mass of each set. Alternatively groups
can be specified, which lists several groups of species. If groups
is provided, only species explicitly listed will be included.
[in] | aero_state | Aerosol state. |
[in] | aero_data | Aerosol data. |
[out] | d_alpha | Average particle diversity. |
[out] | d_gamma | Bulk diversity. |
[out] | chi | Mixing state index. |
include | Species names to include in the mass. | |
exclude | Species names to exclude in the mass. | |
group | Species names to group together. | |
groups | Sets of species names to group together. |
Definition at line 1377 of file aero_state.F90.
real(kind=dp) function, dimension( aero_state_n_part(aero_state)) pmc_aero_state::aero_state_mobility_diameters | ( | type(aero_state_t), intent(in) | aero_state, |
type(aero_data_t), intent(in) | aero_data, | ||
type(env_state_t), intent(in) | env_state | ||
) |
Returns the mobility diameters of all particles.
[in] | aero_state | Aerosol state. |
[in] | aero_data | Aerosol data. |
[in] | env_state | Environment state. |
Definition at line 1035 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_mpi_alltoall | ( | type(aero_state_t), dimension(:), intent(in) | send, |
type(aero_state_t), dimension(size(send)), intent(inout) | recv | ||
) |
Do an MPI all-to-all transfer of aerosol states.
States without particles are not sent.
[in] | send | Array of aero_states to send (one per process). |
[in,out] | recv | Array of aero_states to receives (one per process). |
Definition at line 1826 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_mpi_gather | ( | type(aero_state_t), intent(in) | aero_state, |
type(aero_state_t), intent(inout) | aero_state_total, | ||
type(aero_data_t), intent(in) | aero_data | ||
) |
Gathers data from all processes into one aero_state on process 0.
[in] | aero_state | Local aero_state. |
[in,out] | aero_state_total | Centralized aero_state (only on process 0). |
[in] | aero_data | Aero data values. |
Definition at line 2257 of file aero_state.F90.
elemental integer function pmc_aero_state::aero_state_n_part | ( | type(aero_state_t), intent(in) | aero_state | ) |
Return the current number of particles.
[in] | aero_state | Aerosol state. |
Definition at line 87 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_netcdf_dim_aero_particle | ( | type(aero_state_t), intent(in) | aero_state, |
integer, intent(in) | ncid, | ||
integer, intent(out) | dimid_aero_particle | ||
) |
Write the aero particle dimension to the given NetCDF file if it is not already present and in any case return the associated dimid.
[in] | aero_state | aero_state structure. |
[in] | ncid | NetCDF file ID, in data mode. |
[out] | dimid_aero_particle | Dimid of the aero particle dimension. |
Definition at line 2330 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_netcdf_dim_aero_removed | ( | type(aero_state_t), intent(in) | aero_state, |
integer, intent(in) | ncid, | ||
integer, intent(out) | dimid_aero_removed | ||
) |
Write the aero removed dimension to the given NetCDF file if it is not already present and in any case return the associated dimid.
[in] | aero_state | aero_state structure. |
[in] | ncid | NetCDF file ID, in data mode. |
[out] | dimid_aero_removed | Dimid of the aero removed dimension. |
Definition at line 2371 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_num_conc_for_reweight | ( | type(aero_state_t), intent(in) | aero_state, |
type(aero_data_t), intent(in) | aero_data, | ||
real(kind=dp), dimension(aero_state_n_part(aero_state)), intent(out) | reweight_num_conc | ||
) |
Save the correct number concentrations for later use by aero_state_reweight().
[in] | aero_state | Aerosol state. |
[in] | aero_data | Aerosol data. |
[out] | reweight_num_conc | Number concentrations for later use by aero_state_reweight(). |
Definition at line 529 of file aero_state.F90.
real(kind=dp) function, dimension(aero_state_n_part(aero_state)) pmc_aero_state::aero_state_num_concs | ( | type(aero_state_t), intent(in) | aero_state, |
type(aero_data_t), intent(in) | aero_data | ||
) |
Returns the number concentrations of all particles.
[in] | aero_state | Aerosol state. |
[in] | aero_data | Aerosol data. |
Definition at line 1189 of file aero_state.F90.
real(kind=dp) function pmc_aero_state::aero_state_particle_num_conc | ( | type(aero_state_t), intent(in) | aero_state, |
type(aero_particle_t), intent(in) | aero_particle, | ||
type(aero_data_t), intent(in) | aero_data | ||
) |
The number concentration of a single particle (m^{-3}).
[in] | aero_state | Aerosol state containing the particle. |
[in] | aero_particle | Aerosol particle. |
[in] | aero_data | Aerosol data. |
Definition at line 509 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_prepare_weight_for_add | ( | type(aero_state_t), intent(inout) | aero_state, |
type(aero_data_t), intent(in) | aero_data, | ||
integer, intent(in) | i_group, | ||
integer, intent(in) | i_class, | ||
real(kind=dp), intent(in) | n_add, | ||
logical, intent(in) | allow_doubling, | ||
logical, intent(in) | allow_halving | ||
) |
Change the weight if necessary to ensure that the addition of about n_add
computational particles will give the correct final particle number.
[in,out] | aero_state | Aero state to add to. |
[in] | aero_data | Aerosol data. |
[in] | i_group | Weight group number to add to. |
[in] | i_class | Weight class number to add to. |
[in] | n_add | Approximate number of particles to be added at current weighting. |
[in] | allow_doubling | Whether to allow doubling of the population. |
[in] | allow_halving | Whether to allow halving of the population. |
Definition at line 669 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_rand_particle | ( | type(aero_state_t), intent(in) | aero_state, |
integer, intent(out) | i_part | ||
) |
Choose a random particle from the aero_state.
[in] | aero_state | Original state. |
[out] | i_part | Chosen random particle number. |
Definition at line 787 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_rebalance | ( | type(aero_state_t), intent(inout) | aero_state, |
type(aero_data_t), intent(in) | aero_data, | ||
logical, intent(in) | allow_doubling, | ||
logical, intent(in) | allow_halving, | ||
logical, intent(in) | initial_state_warning | ||
) |
Double or halve the particle population in each weight group to maintain close to n_part_ideal
particles per process, allocated equally amongst the weight groups.
[in,out] | aero_state | Aerosol state. |
[in] | aero_data | Aerosol data. |
[in] | allow_doubling | Whether to allow doubling of the population. |
[in] | allow_halving | Whether to allow halving of the population. |
[in] | initial_state_warning | Whether to warn due to initial state doubling/halving. |
Definition at line 1611 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_remove_particle | ( | type(aero_state_t), intent(inout) | aero_state, |
integer, intent(in) | i_part, | ||
logical, intent(in) | record_removal, | ||
type(aero_info_t), intent(in) | aero_info | ||
) |
Remove the given particle and possibly record the removal.
[in,out] | aero_state | Aerosol state. |
[in] | i_part | Index of particle to remove. |
[in] | record_removal | Whether to record the removal in the aero_info_array. |
[in] | aero_info | Removal info. |
Definition at line 398 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_remove_particle_no_info | ( | type(aero_state_t), intent(inout) | aero_state, |
integer, intent(in) | i_part | ||
) |
Remove the given particle without recording it.
[in,out] | aero_state | Aerosol state. |
[in] | i_part | Index of particle to remove. |
Definition at line 360 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_remove_particle_with_info | ( | type(aero_state_t), intent(inout) | aero_state, |
integer, intent(in) | i_part, | ||
type(aero_info_t), intent(in) | aero_info | ||
) |
Remove the given particle and record the removal.
[in,out] | aero_state | Aerosol state. |
[in] | i_part | Index of particle to remove. |
[in] | aero_info | Removal info. |
Definition at line 379 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_remove_rand_particle_from_bin | ( | type(aero_state_t), intent(inout) | aero_state, |
integer, intent(in) | i_bin, | ||
integer, intent(in) | i_class, | ||
type(aero_particle_t), intent(inout) | aero_particle | ||
) |
Remove a randomly chosen particle from the given bin and return it.
[in,out] | aero_state | Aerosol state. |
[in] | i_bin | Bin number to remove particle from. |
[in] | i_class | Weight class to remove particle from. |
[in,out] | aero_particle | Removed particle. |
Definition at line 423 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_reweight | ( | type(aero_state_t), intent(inout) | aero_state, |
type(aero_data_t), intent(in) | aero_data, | ||
real(kind=dp), dimension(aero_state_n_part(aero_state)), intent(in) | reweight_num_conc | ||
) |
Reweight all particles after their constituent volumes have been altered.
The pattern for use should be like:
call aero_state_num_conc_for_reweight(aero_state, aero_data, reweight_num_conc) ... alter particle species volumes in aero_state ... call aero_state_reweight(aero_state, aero_data, reweight_num_conc)
[in,out] | aero_state | Aerosol state. |
[in] | aero_data | Aerosol data. |
[in] | reweight_num_conc | Number concentrations previously computed by aero_state_num_conc_for_reweight(). |
Definition at line 562 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_sample | ( | type(aero_state_t), intent(inout) | aero_state_from, |
type(aero_state_t), intent(inout) | aero_state_to, | ||
type(aero_data_t), intent(in) | aero_data, | ||
real(kind=dp), intent(in) | sample_prob, | ||
integer, intent(in) | removal_action | ||
) |
Generates a random sample by removing particles from aero_state_from and adding them to aero_state_to, transfering weight as well. This is the equivalent of aero_state_add().
[in,out] | aero_state_from | Original state. |
[in,out] | aero_state_to | Destination state (previous contents will be lost). |
[in] | aero_data | Aerosol data. |
[in] | sample_prob | Probability of sampling each particle. |
[in] | removal_action | Action for removal (see pmc_aero_info module for action parameters). Set to AERO_INFO_NONE to not log removal. |
Definition at line 882 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_sample_particles | ( | type(aero_state_t), intent(inout) | aero_state_from, |
type(aero_state_t), intent(inout) | aero_state_to, | ||
type(aero_data_t), intent(in) | aero_data, | ||
real(kind=dp), intent(in) | sample_prob, | ||
integer, intent(in) | removal_action | ||
) |
Generates a random sample by removing particles from aero_state_from and adding them to aero_state_to, which must be already allocated (and should have its weight set).
None of the weights are altered by this sampling, making this the equivalent of aero_state_add_particles().
[in,out] | aero_state_from | Original state. |
[in,out] | aero_state_to | Destination state. |
[in] | aero_data | Aerosol data. |
[in] | sample_prob | Probability of sampling each particle. |
[in] | removal_action | Action for removal (see pmc_aero_info module for action parameters). Set to AERO_INFO_NONE to not log removal. |
Definition at line 807 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_scale_weight | ( | type(aero_state_t), intent(inout) | aero_state, |
type(aero_data_t), intent(in) | aero_data, | ||
integer, intent(in) | i_group, | ||
integer, intent(in) | i_class, | ||
real(kind=dp), intent(in) | weight_ratio, | ||
logical, intent(in) | allow_doubling, | ||
logical, intent(in) | allow_halving | ||
) |
Scale the weighting of the given group/class by the given ratio, altering particle number as necessary to preserve the number concentration.
[in,out] | aero_state | Aerosol state. |
[in] | aero_data | Aerosol data. |
[in] | i_group | Weight group number. |
[in] | i_class | Weight class number. |
[in] | weight_ratio | Ratio of new_weight / old_weight . |
[in] | allow_doubling | Whether to allow doubling of the population. |
[in] | allow_halving | Whether to allow halving of the population. |
Definition at line 1678 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_set_n_part_ideal | ( | type(aero_state_t), intent(inout) | aero_state, |
real(kind=dp), intent(in) | n_part | ||
) |
Set the ideal number of particles to the given value. The aero_state%awa
must be already set correctly.
[in,out] | aero_state | Aerosol state (with aero_state%awa set). |
[in] | n_part | Ideal total number of particles. |
Definition at line 217 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_set_weight | ( | type(aero_state_t), intent(inout) | aero_state, |
type(aero_data_t), intent(in) | aero_data, | ||
integer, intent(in) | weight_type, | ||
real(kind=dp), intent(in), optional | exponent | ||
) |
Sets the weighting functions for an aero_state
.
[in,out] | aero_state | Aerosol to set the weights on. |
[in] | aero_data | Aerosol data. |
[in] | weight_type | Type of weighting scheme to use. |
[in] | exponent | Exponent for power-law weighting (only used if weight_type is AERO_STATE_WEIGHT_POWER ). |
Definition at line 171 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_sort | ( | type(aero_state_t), intent(inout) | aero_state, |
type(aero_data_t), intent(in) | aero_data, | ||
type(bin_grid_t), intent(in), optional | bin_grid, | ||
logical, intent(in), optional | all_procs_same | ||
) |
Sorts the particles if necessary.
[in,out] | aero_state | Aerosol state to sort. |
[in] | aero_data | Aerosol data. |
[in] | bin_grid | Bin grid. |
[in] | all_procs_same | Whether all processors should use the same bin grid. |
Definition at line 2938 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_to_binned | ( | type(bin_grid_t), intent(in) | bin_grid, |
type(aero_data_t), intent(in) | aero_data, | ||
type(aero_state_t), intent(in) | aero_state, | ||
type(aero_binned_t), intent(inout) | aero_binned | ||
) |
Create binned number and mass arrays.
[in] | bin_grid | Bin grid. |
[in] | aero_data | Aerosol data. |
[in] | aero_state | Aerosol state. |
[in,out] | aero_binned | Binned distributions. |
Definition at line 933 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_to_binned_dry | ( | type(bin_grid_t), intent(in) | bin_grid, |
type(aero_data_t), intent(in) | aero_data, | ||
type(aero_state_t), intent(in) | aero_state, | ||
type(aero_binned_t), intent(inout) | aero_binned | ||
) |
Does the same thing as aero_state_to_bin() but based on dry radius.
[in] | bin_grid | Bin grid. |
[in] | aero_data | Aerosol data. |
[in] | aero_state | Aerosol state. |
[in,out] | aero_binned | Binned distributions. |
Definition at line 1506 of file aero_state.F90.
real(kind=dp) function pmc_aero_state::aero_state_total_num_conc | ( | type(aero_state_t), intent(in) | aero_state, |
type(aero_data_t), intent(in) | aero_data | ||
) |
Returns the total number concentration.
[in] | aero_state | Aerosol state. |
[in] | aero_data | Aerosol data. |
Definition at line 1212 of file aero_state.F90.
integer function pmc_aero_state::aero_state_total_particles | ( | type(aero_state_t), intent(in) | aero_state, |
integer, intent(in), optional | i_group, | ||
integer, intent(in), optional | i_class | ||
) |
Returns the total number of particles in an aerosol distribution.
[in] | aero_state | Aerosol state. |
[in] | i_group | Weight group. |
[in] | i_class | Weight class. |
Definition at line 263 of file aero_state.F90.
integer function pmc_aero_state::aero_state_total_particles_all_procs | ( | type(aero_state_t), intent(in) | aero_state, |
integer, intent(in), optional | i_group, | ||
integer, intent(in), optional | i_class | ||
) |
Returns the total number of particles across all processes.
[in] | aero_state | Aerosol state. |
[in] | i_group | Weight group. |
[in] | i_class | Weight class. |
Definition at line 301 of file aero_state.F90.
real(kind=dp) function, dimension(aero_state_n_part(aero_state)) pmc_aero_state::aero_state_volumes | ( | type(aero_state_t), intent(in) | aero_state, |
type(aero_data_t), intent(in), optional | aero_data, | ||
character(len=*), dimension(:), intent(in), optional | include, | ||
character(len=*), dimension(:), intent(in), optional | exclude | ||
) |
Returns the volumes of all particles.
If include
is specified then only those species are included in computing the volumes. If exclude
is specified then all species except those species are included. If both include
and exclude
arguments are specified then only those species in include
but not in exclude
are included.
[in] | aero_state | Aerosol state. |
[in] | aero_data | Aerosol data. |
[in] | include | Species names to include in the mass. |
[in] | exclude | Species names to exclude in the mass. |
Definition at line 1067 of file aero_state.F90.
integer function pmc_aero_state::aero_state_weight_class_for_source | ( | type(aero_state_t), intent(in) | aero_state, |
integer, intent(in) | source | ||
) |
Determine the appropriate weight class for a source.
[in] | aero_state | Aerosol state. |
[in] | source | Source to find the class for. |
Definition at line 239 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_zero | ( | type(aero_state_t), intent(inout) | aero_state | ) |
Resets an aero_state to have zero particles per bin.
[in,out] | aero_state | State to zero. |
Definition at line 320 of file aero_state.F90.
subroutine pmc_aero_state::pmc_mpi_pack_aero_state | ( | character, dimension(:), intent(inout) | buffer, |
integer, intent(inout) | position, | ||
type(aero_state_t), intent(in) | val | ||
) |
Packs the given value into the buffer, advancing position.
[in,out] | buffer | Memory buffer. |
[in,out] | position | Current buffer position. |
[in] | val | Value to pack. |
Definition at line 2204 of file aero_state.F90.
integer function pmc_aero_state::pmc_mpi_pack_size_aero_state | ( | type(aero_state_t), intent(in) | val | ) |
Determines the number of bytes required to pack the given value.
[in] | val | Value to pack. |
Definition at line 2185 of file aero_state.F90.
subroutine pmc_aero_state::pmc_mpi_unpack_aero_state | ( | character, dimension(:), intent(inout) | buffer, |
integer, intent(inout) | position, | ||
type(aero_state_t), intent(inout) | val | ||
) |
Unpacks the given value from the buffer, advancing position.
[in,out] | buffer | Memory buffer. |
[in,out] | position | Current buffer position. |
[in,out] | val | Value to pack. |
Definition at line 2230 of file aero_state.F90.
integer, parameter pmc_aero_state::aero_state_tag_gather = 4988 |
MPI tag for gathering between processes.
Definition at line 34 of file aero_state.F90.
integer, parameter pmc_aero_state::aero_state_tag_mix = 4987 |
MPI tag for mixing particles between processes.
Definition at line 32 of file aero_state.F90.
integer, parameter pmc_aero_state::aero_state_tag_scatter = 4989 |
MPI tag for scattering between processes.
Definition at line 36 of file aero_state.F90.
integer, parameter pmc_aero_state::aero_state_weight_flat = 2 |
Single flat weighting scheme.
Definition at line 41 of file aero_state.F90.
integer, parameter pmc_aero_state::aero_state_weight_flat_source = 5 |
Flat weighting by source.
Definition at line 47 of file aero_state.F90.
integer, parameter pmc_aero_state::aero_state_weight_none = 1 |
Single flat weighting scheme.
Definition at line 39 of file aero_state.F90.
integer, parameter pmc_aero_state::aero_state_weight_nummass = 4 |
Coupled number/mass weighting scheme.
Definition at line 45 of file aero_state.F90.
integer, parameter pmc_aero_state::aero_state_weight_nummass_source = 7 |
Coupled number/mass weighting by source.
Definition at line 51 of file aero_state.F90.
integer, parameter pmc_aero_state::aero_state_weight_power = 3 |
Power-law weighting scheme.
Definition at line 43 of file aero_state.F90.
integer, parameter pmc_aero_state::aero_state_weight_power_source = 6 |
Power-law weighting by source.
Definition at line 49 of file aero_state.F90.