PartMC  2.6.1
Data Types | Functions/Subroutines | Variables
pmc_aero_sorted Module Reference

The aero_sorted_t structure and assocated subroutines. More...

Data Types

type  aero_sorted_t
 Sorting of particles into bins. More...
 

Functions/Subroutines

integer function aero_sorted_n_bin (aero_sorted)
 Returns the number of size bins. More...
 
integer function aero_sorted_n_group (aero_sorted)
 Returns the number of weight groups. More...
 
integer function aero_sorted_n_class (aero_sorted)
 Returns the number of weight classes. More...
 
subroutine aero_sorted_set_bin_grid (aero_sorted, bin_grid, n_group, n_class)
 Set the bin grid to be used for sorting. More...
 
subroutine aero_sorted_discard_outside_grid (aero_sorted, aero_particle_array, aero_data)
 Discard particles that don't fit the bin grid. More...
 
subroutine aero_sorted_sort_particles (aero_sorted, aero_particle_array, aero_data)
 Sort the particles. More...
 
subroutine aero_sorted_remake_if_needed (aero_sorted, aero_particle_array, aero_data, valid_sort, n_group, n_class, bin_grid, all_procs_same)
 Remake a sorting if particles are getting too close to the edges. More...
 
integer function aero_sorted_particle_in_bin (aero_sorted, aero_particle, aero_data)
 Find the bin number that contains a given particle. More...
 
subroutine aero_sorted_add_particle (aero_sorted, aero_particle_array, aero_particle, aero_data, allow_resort)
 Add a new particle to both an aero_sorted and the corresponding aero_particle_array. More...
 
subroutine aero_sorted_remove_particle (aero_sorted, aero_particle_array, i_part)
 Remove a particle from both an aero_sorted and the corresponding aero_particle_array. More...
 
subroutine aero_sorted_move_particle (aero_sorted, i_part, new_bin, new_group, new_class)
 Move a particle to a different bin and group. More...
 
subroutine aero_sorted_check (aero_sorted, aero_particle_array, aero_data, n_group, n_class, continue_on_error)
 Check sorting. More...
 
integer function pmc_mpi_pack_size_aero_sorted (val)
 Determines the number of bytes required to pack the given value. More...
 
subroutine pmc_mpi_pack_aero_sorted (buffer, position, val)
 Packs the given value into the buffer, advancing position. More...
 
subroutine pmc_mpi_unpack_aero_sorted (buffer, position, val)
 Unpacks the given value from the buffer, advancing position. More...
 

Variables

real(kind=dp), parameter aero_sorted_bins_per_decade = 10d0
 How many size bins to use per decade of particle radius. More...
 
real(kind=dp), parameter aero_sorted_bin_over_factor = 10d0
 Factor to extend size grid beyond largest/smallest particles. More...
 
real(kind=dp), parameter aero_sorted_bin_safety_factor = 3d0
 Size grid extension factor when we should regenerate grid. More...
 

Detailed Description

The aero_sorted_t structure and assocated subroutines.

Function/Subroutine Documentation

◆ aero_sorted_add_particle()

subroutine pmc_aero_sorted::aero_sorted_add_particle ( type(aero_sorted_t), intent(inout)  aero_sorted,
type(aero_particle_array_t), intent(inout)  aero_particle_array,
type(aero_particle_t), intent(in)  aero_particle,
type(aero_data_t), intent(in)  aero_data,
logical, intent(in), optional  allow_resort 
)

Add a new particle to both an aero_sorted and the corresponding aero_particle_array.

Parameters
[in,out]aero_sortedSorted particle structure.
[in,out]aero_particle_arrayAerosol particles.
[in]aero_particleParticle to add.
[in]aero_dataAerosol data.
[in]allow_resortWhether to allow a resort due to the add.

Definition at line 397 of file aero_sorted.F90.

◆ aero_sorted_check()

subroutine pmc_aero_sorted::aero_sorted_check ( type(aero_sorted_t), intent(in)  aero_sorted,
type(aero_particle_array_t), intent(in)  aero_particle_array,
type(aero_data_t), intent(in)  aero_data,
integer, intent(in), optional  n_group,
integer, intent(in), optional  n_class,
logical, intent(in)  continue_on_error 
)

Check sorting.

Parameters
[in]aero_sortedAerosol sorted to check.
[in]aero_particle_arrayAerosol particles.
[in]aero_dataAerosol data.
[in]n_groupNumber of weight groups.
[in]n_classNumber of weight classes.
[in]continue_on_errorWhether to continue despite error.

Definition at line 499 of file aero_sorted.F90.

◆ aero_sorted_discard_outside_grid()

subroutine pmc_aero_sorted::aero_sorted_discard_outside_grid ( type(aero_sorted_t), intent(in)  aero_sorted,
type(aero_particle_array_t), intent(inout)  aero_particle_array,
type(aero_data_t), intent(in)  aero_data 
)

Discard particles that don't fit the bin grid.

Parameters
[in]aero_sortedAerosol sorted.
[in,out]aero_particle_arrayAerosol particles to discard from.
[in]aero_dataAerosol data.

Definition at line 153 of file aero_sorted.F90.

◆ aero_sorted_move_particle()

subroutine pmc_aero_sorted::aero_sorted_move_particle ( type(aero_sorted_t), intent(inout)  aero_sorted,
integer, intent(in)  i_part,
integer, intent(in)  new_bin,
integer, intent(in)  new_group,
integer, intent(in)  new_class 
)

Move a particle to a different bin and group.

Parameters
[in,out]aero_sortedAerosol sorted.
[in]i_partParticle number to move.
[in]new_binNew bin to move particle to.
[in]new_groupNew weight group to move particle to.
[in]new_classNew weight class to move particle to.

Definition at line 475 of file aero_sorted.F90.

◆ aero_sorted_n_bin()

integer function pmc_aero_sorted::aero_sorted_n_bin ( type(aero_sorted_t), intent(in)  aero_sorted)

Returns the number of size bins.

Parameters
[in]aero_sortedAerosol sorting to use.

Definition at line 80 of file aero_sorted.F90.

◆ aero_sorted_n_class()

integer function pmc_aero_sorted::aero_sorted_n_class ( type(aero_sorted_t), intent(in)  aero_sorted)

Returns the number of weight classes.

Parameters
[in]aero_sortedAerosol sorting to use.

Definition at line 104 of file aero_sorted.F90.

◆ aero_sorted_n_group()

integer function pmc_aero_sorted::aero_sorted_n_group ( type(aero_sorted_t), intent(in)  aero_sorted)

Returns the number of weight groups.

Parameters
[in]aero_sortedAerosol sorting to use.

Definition at line 92 of file aero_sorted.F90.

◆ aero_sorted_particle_in_bin()

integer function pmc_aero_sorted::aero_sorted_particle_in_bin ( type(aero_sorted_t), intent(in)  aero_sorted,
type(aero_particle_t), intent(in)  aero_particle,
type(aero_data_t), intent(in)  aero_data 
)

Find the bin number that contains a given particle.

Parameters
[in]aero_sortedAerosol sort.
[in]aero_particleParticle.
[in]aero_dataAerosol data.

Definition at line 378 of file aero_sorted.F90.

◆ aero_sorted_remake_if_needed()

subroutine pmc_aero_sorted::aero_sorted_remake_if_needed ( type(aero_sorted_t), intent(inout)  aero_sorted,
type(aero_particle_array_t), intent(inout)  aero_particle_array,
type(aero_data_t), intent(in)  aero_data,
logical, intent(in)  valid_sort,
integer, intent(in), optional  n_group,
integer, intent(in), optional  n_class,
type(bin_grid_t), intent(in), optional  bin_grid,
logical, intent(in), optional  all_procs_same 
)

Remake a sorting if particles are getting too close to the edges.

Parameters
[in,out]aero_sortedAerosol sorted to (possibly) remake.
[in,out]aero_particle_arrayAerosol particles to sort.
[in]aero_dataAerosol data.
[in]valid_sortWhether the given aero_sorted is valid.
[in]n_groupNumber of weight groups.
[in]n_classNumber of weight classes.
[in]bin_gridAn optional bin_grid to use for the sort.
[in]all_procs_sameWhether all processors should use the same bin grid.

Definition at line 214 of file aero_sorted.F90.

◆ aero_sorted_remove_particle()

subroutine pmc_aero_sorted::aero_sorted_remove_particle ( type(aero_sorted_t), intent(inout)  aero_sorted,
type(aero_particle_array_t), intent(inout)  aero_particle_array,
integer, intent(in)  i_part 
)

Remove a particle from both an aero_sorted and the corresponding aero_particle_array.

Parameters
[in,out]aero_sortedSorted particle structure.
[in,out]aero_particle_arrayAerosol particles.
[in]i_partIndex of particle to remove.

Definition at line 455 of file aero_sorted.F90.

◆ aero_sorted_set_bin_grid()

subroutine pmc_aero_sorted::aero_sorted_set_bin_grid ( type(aero_sorted_t), intent(inout)  aero_sorted,
type(bin_grid_t), intent(in)  bin_grid,
integer, intent(in)  n_group,
integer, intent(in)  n_class 
)

Set the bin grid to be used for sorting.

Parameters
[in,out]aero_sortedAerosol sorted.
[in]bin_gridBin grid.
[in]n_groupNumber of weight groups.
[in]n_classNumber of weight classes.

Definition at line 116 of file aero_sorted.F90.

◆ aero_sorted_sort_particles()

subroutine pmc_aero_sorted::aero_sorted_sort_particles ( type(aero_sorted_t), intent(inout)  aero_sorted,
type(aero_particle_array_t), intent(in)  aero_particle_array,
type(aero_data_t), intent(in)  aero_data 
)

Sort the particles.

Parameters
[in,out]aero_sortedAerosol sorted.
[in]aero_particle_arrayAerosol particles to sort.
[in]aero_dataAerosol data.

Definition at line 185 of file aero_sorted.F90.

◆ pmc_mpi_pack_aero_sorted()

subroutine pmc_aero_sorted::pmc_mpi_pack_aero_sorted ( character, dimension(:), intent(inout)  buffer,
integer, intent(inout)  position,
type(aero_sorted_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 583 of file aero_sorted.F90.

◆ pmc_mpi_pack_size_aero_sorted()

integer function pmc_aero_sorted::pmc_mpi_pack_size_aero_sorted ( type(aero_sorted_t), intent(in)  val)

Determines the number of bytes required to pack the given value.

Parameters
[in]valValue to pack.

Definition at line 565 of file aero_sorted.F90.

◆ pmc_mpi_unpack_aero_sorted()

subroutine pmc_aero_sorted::pmc_mpi_unpack_aero_sorted ( character, dimension(:), intent(inout)  buffer,
integer, intent(inout)  position,
type(aero_sorted_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 608 of file aero_sorted.F90.

Variable Documentation

◆ aero_sorted_bin_over_factor

real(kind=dp), parameter pmc_aero_sorted::aero_sorted_bin_over_factor = 10d0

Factor to extend size grid beyond largest/smallest particles.

Definition at line 71 of file aero_sorted.F90.

◆ aero_sorted_bin_safety_factor

real(kind=dp), parameter pmc_aero_sorted::aero_sorted_bin_safety_factor = 3d0

Size grid extension factor when we should regenerate grid.

Definition at line 73 of file aero_sorted.F90.

◆ aero_sorted_bins_per_decade

real(kind=dp), parameter pmc_aero_sorted::aero_sorted_bins_per_decade = 10d0

How many size bins to use per decade of particle radius.

Definition at line 69 of file aero_sorted.F90.