Public Attributes | |
type(aero_particle_array_t) | bin |
Bin arrays. | |
real *8 | comp_vol |
Computational volume (m^3). | |
integer | n_part |
Total number of particles. |
The particles in aero_state_t are stored sorted per-bin, to improve efficiency of access and sampling. If a particle has total volume v
then calling i_bin = bin_grid_particle_in_bin(bin_grid, v)
finds the bin number i_bin where that particle should go. That particle is then stored as aero_state%bin
(i_bin)%particle(i_part), where i_part
is the index within the bin. aero_state%v
(i_bin)%p(i_part)%vol(i_spec) is thus the volume of the i_spec-th
species in the i_part-th
particle in the i_bin-th
bin.
Typically most of the bins have only a few particles, while a small number of bins have many particles. To avoid having too much storage allocated for the bins with only a few particles, we do dynamic allocation and deallocation of the storage per-bin. With Fortran 90 we can't have arrays of arrays, so we have to use an array of pointers, and then allocate each pointer.
To avoid doing allocation and deallocation every time we add or remove a particle to a bin, we always double or halve the bin storage as necessary. The actual number of particles stored in a bin will generally be less than the actual memory allocated for that bin, so we store the current number of particles in a bin in aero_state%bin
(i_bin)%n_part. The allocated size of bin storage in aero_state%bin
(i_bin)%particle is not stored explicitly, but can be obtained with the Fortran 90 SIZE() intrinsic function.
Bin arrays.
Computational volume (m^3).
Total number of particles.