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

The aero_state_t structure and assocated subroutines. More...

List of all members.

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.

Detailed Description

The aero_state_t structure and assocated subroutines.

Definition at line 9 of file aero_state.F90.


Member Function/Subroutine Documentation

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.

Parameters:
[in,out]aero_stateAerosol state.
[in]aero_state_deltaIncrement.

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.

Parameters:
[in,out]aero_stateAero state to add to.
[in]aero_dataAero data values.
[in]aero_distDistribution to sample.
[in]sample_propVolume fraction to sample (1).
[in]create_timeCreation time for new particles (s).
[out]n_part_addNumber 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.

Parameters:
[in,out]aero_stateAerosol state.
[in]aero_particleParticle to add.
[in]allow_resortWhether 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.

Parameters:
[in,out]aero_stateAerosol state.
[in]aero_state_deltaIncrement.

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.

Parameters:
[out]aero_stateAerosol 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.

Parameters:
[in,out]aero_stateAerosol state to average.
[in]bin_gridBin grid to average within.
[in]aero_dataAerosol data.
[in]dry_volumeWhether 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.

Parameters:
[in,out]aero_stateAerosol state to average.
[in]bin_gridBin grid to average within.
[in]aero_dataAerosol data.
[in]dry_volumeWhether to use dry volume (rather than wet).
[in]bin_centerWhether to assign the bin center volume (rather than the average volume).
[in]preserve_numberWhether 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.

Parameters:
[in]aero_stateAerosol 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.

Parameters:
[in]aero_state_fromReference aerosol.
[in,out]aero_state_toAlready 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.

Parameters:
[in]aero_state_fromReference aerosol.
[in,out]aero_state_toAlready 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.

Parameters:
[in,out]aero_stateAerosol 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.

Parameters:
[in]aero_stateAerosol state.
[in,out]diametersDiameters 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.

Parameters:
[in,out]aero_stateAerosol state.
[in]i_groupWeight 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.

Parameters:
[in,out]aero_stateAerosol state.
[in]i_partParticle number.
[in]n_part_meanMean number of resulting particles.
[in]random_weight_groupWhether 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.

Parameters:
[in,out]aero_stateAerosol state.
[in]i_groupWeight 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.

Parameters:
[in,out]aero_stateaero_state to read.
[in]ncidNetCDF file ID, in data mode.
[in]aero_dataaero_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).

Parameters:
[in,out]aero_stateAerosol state to make dry.
[in]aero_dataAerosol 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.

Parameters:
[in]aero_stateAerosol state.
[in]aero_dataAerosol data.
[in,out]massesMasses array (kg).
includeSpecies names to include in the mass.
excludeSpecies 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.

Parameters:
[in,out]aero_stateAerosol state.
[in]del_tTimestep (s).
[in]mix_timescaleMixing timescale (s).
[in]aero_dataAero data values.
[in]specify_prob_transferTransfer 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.

Parameters:
[in]sendArray of aero_states to send (one per process).
[in,out]recvArray 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.

Parameters:
[in]aero_stateLocal aero_state.
[in,out]aero_state_totalCentralized 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.

Parameters:
[in]aero_stateaero_state structure.
[in]ncidNetCDF file ID, in data mode.
[out]dimid_aero_particleDimid 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.

Parameters:
[in]aero_stateaero_state structure.
[in]ncidNetCDF file ID, in data mode.
[out]dimid_aero_removedDimid 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().

Parameters:
[in]aero_stateAerosol state.
[out]reweight_num_concNumber 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.

Parameters:
[in]aero_stateAerosol state.
[in,out]num_concsNumber 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.

Parameters:
[in]aero_stateaero_state to write.
[in]ncidNetCDF file ID, in data mode.
[in]aero_dataaero_data structure.
[in]record_removalsWhether to output particle removal info.
[in]record_opticalWhether 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}).

Parameters:
[in]aero_stateAerosol state containing the particle.
[in]aero_particleAerosol 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.

Parameters:
[in]aero_stateOriginal state.
[out]i_partChosen 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.

Parameters:
[in,out]aero_stateAerosol state.
[in]allow_doublingWhether to allow doubling of the population.
[in]allow_halvingWhether to allow halving of the population.
[in]initial_state_warningWhether 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.

Parameters:
[in,out]aero_stateAerosol state.
[in]i_partIndex of particle to remove.
[in]record_removalWhether to record the removal in the aero_info_array.
[in]aero_infoRemoval 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.

Parameters:
[in,out]aero_stateAerosol state.
[in]i_partIndex 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.

Parameters:
[in,out]aero_stateAerosol state.
[in]i_partIndex of particle to remove.
[in]aero_infoRemoval 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.

Parameters:
[in,out]aero_stateAerosol state.
[in]i_binBin number to remove particle from.
[in,out]aero_particleRemoved 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.

Parameters:
[in,out]aero_stateAerosol 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)
 
Parameters:
[in,out]aero_stateAerosol state.
[in]reweight_num_concNumber 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().

Parameters:
[in,out]aero_state_fromOriginal state.
[in,out]aero_state_toDestination state (previous contents will be lost).
[in]sample_probProbability of sampling each particle.
[in]removal_actionAction 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().

Parameters:
[in,out]aero_state_fromOriginal state.
[in,out]aero_state_toDestination state.
[in]sample_probProbability of sampling each particle.
[in]removal_actionAction 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.

Parameters:
[in,out]aero_stateAerosol state.
[in]i_groupGroup number.
[in]comp_vol_ratioRatio 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.

Parameters:
[in,out]aero_stateAerosol to set the weights on.
[in]weight_typeType of weighting scheme to use.
[in]exponentExponent 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.

Parameters:
[in,out]aero_stateAerosol state to sort.
[in]bin_gridBin grid.
[in]all_procs_sameWhether 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.

Parameters:
[in]bin_gridBin grid.
[in]aero_dataAerosol data.
[in]aero_stateAerosol state.
[in,out]aero_binnedBinned 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.

Parameters:
[in]bin_gridBin grid.
[in]aero_dataAerosol data.
[in]aero_stateAerosol state.
[in,out]aero_binnedBinned 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.

Parameters:
[in]aero_stateAerosol 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.

Parameters:
[in]aero_stateAerosol state.
[in]i_groupWeight 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.

Parameters:
[in]aero_stateAerosol state.
[in]i_groupWeight 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.

Parameters:
[in,out]aero_stateState 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.

Parameters:
[in,out]bufferMemory buffer.
[in,out]positionCurrent buffer position.
[in]valValue 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.

Parameters:
[in]valValue 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.

Parameters:
[in,out]bufferMemory buffer.
[in,out]positionCurrent buffer position.
[in,out]valValue to pack.

Definition at line 1672 of file aero_state.F90.


Member Data Documentation

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.

Single flat weighting scheme.

Definition at line 40 of file aero_state.F90.

Single flat weighting scheme.

Definition at line 38 of file aero_state.F90.

Coupled number/mass weighting scheme.

Definition at line 44 of file aero_state.F90.

Power-law weighting scheme.

Definition at line 42 of file aero_state.F90.


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