PartMC
2.2.1
|
The aero_state_t structure and assocated subroutines. More...
Data Types | |
type | aero_state_t |
The current collection of aerosol particles. More... | |
Public Member Functions | |
subroutine | aero_state_allocate (aero_state) |
Allocates aerosol arrays. | |
subroutine | aero_state_deallocate (aero_state) |
Deallocates a previously allocated aerosol. | |
subroutine | aero_state_reset (aero_state) |
Resets an aero_state to an empty state. | |
subroutine | aero_state_copy (aero_state_from, aero_state_to) |
Copies aerosol to a destination that has already had aero_state_allocate() called on it. | |
subroutine | aero_state_copy_weight (aero_state_from, aero_state_to) |
Copies weighting information for an aero_state . | |
subroutine | aero_state_set_weight (aero_state, weight_type, exponent) |
Sets the weighting functions for an aero_state . | |
integer function | aero_state_total_particles (aero_state, i_group) |
Returns the total number of particles in an aerosol distribution. | |
integer function | aero_state_total_particles_all_procs (aero_state, i_group) |
Returns the total number of particles across all processes. | |
subroutine | aero_state_zero (aero_state) |
Resets an aero_state to have zero particles per bin. This must already have had aero_state_allocate() called on it. This function can be called more than once on the same state. | |
subroutine | aero_state_add_particle (aero_state, aero_particle, allow_resort) |
Add the given particle. | |
subroutine | aero_state_remove_particle_no_info (aero_state, i_part) |
Remove the given particle without recording it. | |
subroutine | aero_state_remove_particle_with_info (aero_state, i_part, aero_info) |
Remove the given particle and record the removal. | |
subroutine | aero_state_remove_particle (aero_state, i_part, record_removal, aero_info) |
Remove the given particle and possibly record the removal. | |
subroutine | aero_state_remove_rand_particle_from_bin (aero_state, i_bin, aero_particle) |
Remove a randomly chosen particle from the given bin and return it. | |
subroutine | aero_state_dup_particle (aero_state, i_part, n_part_mean, random_weight_group) |
Add copies or remove a particle, with a given mean number of resulting particles. | |
real(kind=dp) function | aero_state_particle_num_conc (aero_state, aero_particle) |
The number concentration of a single particle (m^{-3}). | |
subroutine | aero_state_num_conc_for_reweight (aero_state, reweight_num_conc) |
Save the correct number concentrations for later use by aero_state_reweight(). | |
subroutine | aero_state_reweight (aero_state, reweight_num_conc) |
Reweight all particles after their constituent volumes have been altered. | |
subroutine | aero_state_add (aero_state, aero_state_delta) |
aero_state += aero_state_delta , with adding the computational volumes, so the new concentration is the (volume-weighted) average of the two concentration. | |
subroutine | aero_state_add_particles (aero_state, aero_state_delta) |
aero_state += aero_state_delta , with the computational volume of aero_state left unchanged, so the new concentration is the sum of the two concentrations, computed with aero_statecomp_vol . | |
subroutine | aero_state_add_aero_dist_sample (aero_state, aero_data, aero_dist, sample_prop, create_time, n_part_add) |
Generates a Poisson sample of an aero_dist , adding to aero_state . The sampled amount is sample_prop * aero_statecomp_vol . | |
subroutine | aero_state_rand_particle (aero_state, i_part) |
Choose a random particle from the aero_state. | |
subroutine | aero_state_sample_particles (aero_state_from, aero_state_to, 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 comp_vol set). | |
subroutine | aero_state_sample (aero_state_from, aero_state_to, sample_prob, removal_action) |
Generates a random sample by removing particles from aero_state_from and adding them to aero_state_to, transfering computational volume as well. This is the equivalent of aero_state_add(). | |
subroutine | aero_state_to_binned (bin_grid, aero_data, aero_state, aero_binned) |
Create the bin number and mass arrays from aero_statev. | |
subroutine | aero_state_diameters (aero_state, diameters) |
Returns the diameters of all particles. The diameters array will be reallocated if necessary. | |
subroutine | aero_state_masses (aero_state, aero_data, masses, include, exclude) |
Returns the masses of all particles. The masses array will be reallocated if necessary. | |
subroutine | aero_state_num_concs (aero_state, num_concs) |
Returns the number concentrations of all particles. The num_concs array will be reallocated if necessary. | |
real(kind=dp) function | aero_state_total_num_conc (aero_state) |
Returns the total number concentration. | |
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. | |
subroutine | aero_state_double (aero_state, i_group) |
Doubles number of particles in the given weight group. | |
subroutine | aero_state_halve (aero_state, i_group) |
Remove approximately half of the particles in the given weight group. | |
subroutine | aero_state_rebalance (aero_state, 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. | |
subroutine | aero_state_scale_comp_vol (aero_state, i_group, comp_vol_ratio) |
Scale the computational volume of the given group by the given ratio, altering particle number as necessary to preserve the number concentration. | |
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. | |
subroutine | aero_state_mpi_alltoall (send, recv) |
Do an MPI all-to-all transfer of aerosol states. | |
subroutine | aero_state_bin_average_comp (aero_state, bin_grid, aero_data, dry_volume) |
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. | |
subroutine | aero_state_bin_average_size (aero_state, bin_grid, aero_data, dry_volume, 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. | |
subroutine | aero_state_make_dry (aero_state, aero_data) |
Make all particles dry (water set to zero). | |
integer function | pmc_mpi_pack_size_aero_state (val) |
Determines the number of bytes required to pack the given value. | |
subroutine | pmc_mpi_pack_aero_state (buffer, position, val) |
Packs the given value into the buffer, advancing position. | |
subroutine | pmc_mpi_unpack_aero_state (buffer, position, val) |
Unpacks the given value from the buffer, advancing position. | |
subroutine | aero_state_mpi_gather (aero_state, aero_state_total) |
Gathers data from all processes into one aero_state on process 0. | |
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. | |
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. | |
subroutine | aero_state_output_netcdf (aero_state, ncid, aero_data, record_removals, record_optical) |
Write full state. | |
subroutine | aero_state_input_netcdf (aero_state, ncid, aero_data) |
Read full state. | |
subroutine | aero_state_sort (aero_state, bin_grid, all_procs_same) |
Sorts the particles if necessary. | |
subroutine | aero_state_check_sort (aero_state) |
Check that the sorted data is consistent. | |
Public Attributes | |
integer, parameter | AERO_STATE_TAG_MIX = 4987 |
MPI tag for mixing particles between processes. | |
integer, parameter | AERO_STATE_TAG_GATHER = 4988 |
MPI tag for gathering between processes. | |
integer, parameter | AERO_STATE_TAG_SCATTER = 4989 |
MPI tag for scattering between processes. | |
integer, parameter | AERO_STATE_WEIGHT_NONE = 1 |
Single flat weighting scheme. | |
integer, parameter | AERO_STATE_WEIGHT_FLAT = 2 |
Single flat weighting scheme. | |
integer, parameter | AERO_STATE_WEIGHT_POWER = 3 |
Power-law weighting scheme. | |
integer, parameter | AERO_STATE_WEIGHT_NUMMASS = 4 |
Coupled number/mass weighting scheme. |
The aero_state_t structure and assocated subroutines.
Definition at line 9 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_add | ( | type(aero_state_t), intent(inout) | aero_state, |
type(aero_state_t), intent(in) | aero_state_delta | ||
) |
aero_state += aero_state_delta
, with adding the computational volumes, so the new concentration is the (volume-weighted) average of the two concentration.
[in,out] | aero_state | Aerosol state. |
[in] | aero_state_delta | Increment. |
Definition at line 543 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, | ||
integer, intent(out), optional | n_part_add | ||
) |
Generates a Poisson sample of an aero_dist
, adding to aero_state
. The sampled amount is sample_prop * aero_statecomp_vol
.
[in,out] | aero_state | Aero state to add to. |
[in] | aero_data | Aero data values. |
[in] | aero_dist | Distribution to sample. |
[in] | sample_prop | Volume fraction to sample (1). |
[in] | create_time | Creation time for new particles (s). |
[out] | n_part_add | Number of particles added. |
Definition at line 584 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, | ||
logical, intent(in), optional | allow_resort | ||
) |
Add the given particle.
[in,out] | aero_state | Aerosol state. |
[in] | aero_particle | Particle to add. |
[in] | allow_resort | Whether to allow a resort due to the add. |
Definition at line 268 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 | ||
) |
aero_state += aero_state_delta
, with the computational volume of aero_state
left unchanged, so the new concentration is the sum of the two concentrations, computed with aero_statecomp_vol
.
[in,out] | aero_state | Aerosol state. |
[in] | aero_state_delta | Increment. |
Definition at line 561 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_allocate | ( | type(aero_state_t), intent(out) | aero_state | ) |
Allocates aerosol arrays.
[out] | aero_state | Aerosol to initialize. |
Definition at line 72 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, | ||
logical, intent(in) | dry_volume | ||
) |
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. |
[in] | dry_volume | Whether to use dry volume (rather than wet). |
Definition at line 1340 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) | dry_volume, | ||
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] | dry_volume | Whether to use dry volume (rather than wet). |
[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 1405 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_check_sort | ( | type(aero_state_t), intent(in) | aero_state | ) |
Check that the sorted data is consistent.
[in] | aero_state | Aerosol state to check. |
Definition at line 2412 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_copy | ( | type(aero_state_t), intent(in) | aero_state_from, |
type(aero_state_t), intent(inout) | aero_state_to | ||
) |
Copies aerosol to a destination that has already had aero_state_allocate() called on it.
[in] | aero_state_from | Reference aerosol. |
[in,out] | aero_state_to | Already allocated. |
Definition at line 120 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 139 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_deallocate | ( | type(aero_state_t), intent(inout) | aero_state | ) |
Deallocates a previously allocated aerosol.
[in,out] | aero_state | Aerosol to deallocate. |
Definition at line 89 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_diameters | ( | type(aero_state_t), intent(in) | aero_state, |
real(kind=dp), dimension(:), intent(inout), allocatable | diameters | ||
) |
Returns the diameters of all particles. The diameters
array will be reallocated if necessary.
[in] | aero_state | Aerosol state. |
[in,out] | diameters | Diameters array (m). |
Definition at line 854 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_double | ( | type(aero_state_t), intent(inout) | aero_state, |
integer, intent(in) | i_group | ||
) |
Doubles number of particles in the given weight group.
[in,out] | aero_state | Aerosol state. |
[in] | i_group | Weight group to double. |
Definition at line 1013 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_dup_particle | ( | type(aero_state_t), intent(inout) | aero_state, |
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] | 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 384 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 | ||
) |
Remove approximately half of the particles in the given weight group.
[in,out] | aero_state | Aerosol state. |
[in] | i_group | Weight group to halve. |
Definition at line 1040 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 2204 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 1598 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_masses | ( | type(aero_state_t), intent(in) | aero_state, |
type(aero_data_t), intent(in) | aero_data, | ||
real(kind=dp), dimension(:), intent(inout), allocatable | masses, | ||
character(len=*), dimension(:), optional | include, | ||
character(len=*), dimension(:), optional | exclude | ||
) |
Returns the masses of all particles. The masses
array will be reallocated if necessary.
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,out] | masses | Masses array (kg). |
include | Species names to include in the mass. | |
exclude | Species names to exclude in the mass. |
Definition at line 877 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 1179 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 1271 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 | ||
) |
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). |
Definition at line 1707 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 1780 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 1821 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_num_conc_for_reweight | ( | type(aero_state_t), intent(in) | aero_state, |
real(kind=dp), dimension(aero_state%apa%n_part), intent(out) | reweight_num_conc | ||
) |
Save the correct number concentrations for later use by aero_state_reweight().
[in] | aero_state | Aerosol state. |
[out] | reweight_num_conc | Number concentrations for later use by aero_state_reweight(). |
Definition at line 455 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_num_concs | ( | type(aero_state_t), intent(in) | aero_state, |
real(kind=dp), dimension(:), intent(inout), allocatable | num_concs | ||
) |
Returns the number concentrations of all particles. The num_concs
array will be reallocated if necessary.
[in] | aero_state | Aerosol state. |
[in,out] | num_concs | Number concentrations array (m^{-3}). |
Definition at line 933 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_output_netcdf | ( | type(aero_state_t), intent(in) | aero_state, |
integer, intent(in) | ncid, | ||
type(aero_data_t), intent(in) | aero_data, | ||
logical, intent(in) | record_removals, | ||
logical, intent(in) | record_optical | ||
) |
Write full state.
[in] | aero_state | aero_state to write. |
[in] | ncid | NetCDF file ID, in data mode. |
[in] | aero_data | aero_data structure. |
[in] | record_removals | Whether to output particle removal info. |
[in] | record_optical | Whether to output aerosol optical properties. |
Definition at line 1861 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 | ||
) |
The number concentration of a single particle (m^{-3}).
[in] | aero_state | Aerosol state containing the particle. |
[in] | aero_particle | Aerosol particle. |
Definition at line 438 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 664 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_rebalance | ( | type(aero_state_t), intent(inout) | aero_state, |
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] | 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 1071 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 327 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 289 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 308 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, | ||
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,out] | aero_particle | Removed particle. |
Definition at line 352 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_reset | ( | type(aero_state_t), intent(inout) | aero_state | ) |
Resets an aero_state
to an empty state.
[in,out] | aero_state | Aerosol to reset. |
Definition at line 106 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_reweight | ( | type(aero_state_t), intent(inout) | aero_state, |
real(kind=dp), dimension(aero_state%apa%n_part), 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, reweight_num_conc) ... alter particle species volumes in aero_state ... call aero_state_reweight(aero_state, reweight_num_conc)
[in,out] | aero_state | Aerosol state. |
[in] | reweight_num_conc | Number concentrations previously computed by aero_state_num_conc_for_reweight(). |
Definition at line 483 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, | ||
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 computational volume 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] | 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 762 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, | ||
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 comp_vol set).
None of the computational volumes 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] | 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 684 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_scale_comp_vol | ( | type(aero_state_t), intent(inout) | aero_state, |
integer, intent(in) | i_group, | ||
real(kind=dp), intent(in) | comp_vol_ratio | ||
) |
Scale the computational volume of the given group by the given ratio, altering particle number as necessary to preserve the number concentration.
[in,out] | aero_state | Aerosol state. |
[in] | i_group | Group number. |
[in] | comp_vol_ratio | Ratio of new_comp_vol / old_comp_vol . |
Definition at line 1129 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_set_weight | ( | type(aero_state_t), intent(inout) | aero_state, |
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] | 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 154 of file aero_state.F90.
subroutine pmc_aero_state::aero_state_sort | ( | type(aero_state_t), intent(inout) | aero_state, |
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] | bin_grid | Bin grid. |
[in] | all_procs_same | Whether all processors should use the same bin grid. |
Definition at line 2393 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 the bin number and mass arrays from aero_statev.
[in] | bin_grid | Bin grid. |
[in] | aero_data | Aerosol data. |
[in] | aero_state | Aerosol state. |
[in,out] | aero_binned | Binned distributions. |
Definition at line 812 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 972 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 | ) |
Returns the total number concentration.
[in] | aero_state | Aerosol state. |
Definition at line 953 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 | ||
) |
Returns the total number of particles in an aerosol distribution.
[in] | aero_state | Aerosol state. |
[in] | i_group | Weight group. |
Definition at line 203 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 | ||
) |
Returns the total number of particles across all processes.
[in] | aero_state | Aerosol state. |
[in] | i_group | Weight group. |
Definition at line 234 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. This must already have had aero_state_allocate() called on it. This function can be called more than once on the same state.
[in,out] | aero_state | State to zero. |
Definition at line 252 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 1642 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 1619 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 1672 of file aero_state.F90.
integer, parameter pmc_aero_state::AERO_STATE_TAG_GATHER = 4988 |
MPI tag for gathering between processes.
Definition at line 33 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 31 of file aero_state.F90.
integer, parameter pmc_aero_state::AERO_STATE_TAG_SCATTER = 4989 |
MPI tag for scattering between processes.
Definition at line 35 of file aero_state.F90.
integer, parameter pmc_aero_state::AERO_STATE_WEIGHT_FLAT = 2 |
Single flat weighting scheme.
Definition at line 40 of file aero_state.F90.
integer, parameter pmc_aero_state::AERO_STATE_WEIGHT_NONE = 1 |
Single flat weighting scheme.
Definition at line 38 of file aero_state.F90.
integer, parameter pmc_aero_state::AERO_STATE_WEIGHT_NUMMASS = 4 |
Coupled number/mass weighting scheme.
Definition at line 44 of file aero_state.F90.
integer, parameter pmc_aero_state::AERO_STATE_WEIGHT_POWER = 3 |
Power-law weighting scheme.
Definition at line 42 of file aero_state.F90.