Go to the documentation of this file.
58 if (
allocated(aero_particle_array%particle))
then
74 aero_particle_array%n_part = 0
75 if (
allocated(aero_particle_array%particle))
then
76 deallocate(aero_particle_array%particle)
93 integer,
intent(in) :: new_length
98 if (.not.
allocated(aero_particle_array%particle))
then
99 allocate(aero_particle_array%particle(new_length))
100 aero_particle_array%n_part = 0
104 call assert(867444847, new_length >= aero_particle_array%n_part)
105 allocate(new_particles(new_length))
106 do i = 1,aero_particle_array%n_part
110 call move_alloc(new_particles, aero_particle_array%particle)
122 integer,
intent(in) :: n
124 if (.not.
allocated(aero_particle_array%particle))
then
129 if (n <=
size(aero_particle_array%particle))
return
144 integer :: new_length
146 if (.not.
allocated(aero_particle_array%particle))
return
148 new_length =
pow2_above(aero_particle_array%n_part)
149 if (new_length <
size(aero_particle_array%particle))
then
170 aero_particle_array%particle(n) = aero_particle
171 aero_particle_array%n_part = n
184 integer,
intent(in) :: index
186 call assert(883639923,
allocated(aero_particle_array%particle))
187 call assert(992946227, index >= 1)
188 call assert(711246139, index <= aero_particle_array%n_part)
189 if (index < aero_particle_array%n_part)
then
192 aero_particle_array%particle(aero_particle_array%n_part), &
193 aero_particle_array%particle(index))
195 aero_particle_array%n_part = aero_particle_array%n_part - 1
208 integer :: i, total_size
211 total_size = total_size &
214 total_size = total_size &
227 character,
intent(inout) :: buffer(:)
229 integer,
intent(inout) :: position
234 integer :: prev_position, i
236 prev_position = position
254 character,
intent(inout) :: buffer(:)
256 integer,
intent(inout) :: position
261 integer :: prev_position, i, n
263 prev_position = position
287 logical,
intent(in) :: continue_on_error
291 if (.not.
allocated(aero_particle_array%particle))
return
293 if (aero_particle_array%n_part < 0)
then
294 write(0, *)
'ERROR aero_particle_array A:'
295 write(0, *)
'aero_particle_array%n_part', aero_particle_array%n_part
296 call assert(250011397, continue_on_error)
299 do i_part = 1,aero_particle_array%n_part
301 aero_data, continue_on_error)
Single aerosol particle data structure.
1-D array of particles, used by aero_state to store the particles.
Wrapper functions for MPI.
subroutine pmc_mpi_pack_aero_particle_array(buffer, position, val)
Packs the given value into the buffer, advancing position.
The aero_particle_t structure and associated subroutines.
subroutine aero_particle_array_enlarge(aero_particle_array, n)
Possibly enlarges the given array, ensuring that it is at least of size n.
integer function pmc_mpi_pack_size_apa(val)
Determines the number of bytes required to pack the given value.
Reading formatted text input.
integer function pow2_above(n)
Return the least power-of-2 that is at least equal to n.
subroutine assert(code, condition_ok)
Errors unless condition_ok is true.
subroutine aero_particle_array_add_particle(aero_particle_array, aero_particle)
Adds the given particle to the end of the array.
subroutine aero_particle_shift(aero_particle_from, aero_particle_to)
Shift data from one aero_particle_t to another and free the first one.
elemental integer function aero_particle_array_n_part(aero_particle_array)
Return the current number of particles.
subroutine aero_particle_array_realloc(aero_particle_array, new_length)
Changes the given aero_particle_array to exactly the given new_length.
subroutine pmc_mpi_unpack_aero_particle(buffer, position, val)
Unpacks the given value from the buffer, advancing position.
Aerosol material properties and associated data.
subroutine pmc_mpi_unpack_integer(buffer, position, val)
Unpacks the given value from the buffer, advancing position.
integer function pmc_mpi_pack_size_aero_particle(val)
Determines the number of bytes required to pack the given value.
subroutine aero_particle_array_shrink(aero_particle_array)
Possibly shrinks the storage of the given array, ensuring that it can still store the allocated parti...
subroutine aero_particle_check(aero_particle, aero_data, continue_on_error)
Check that the particle data is consistent.
Common utility subroutines.
subroutine aero_particle_array_check(aero_particle_array, aero_data, continue_on_error)
Check that the particle array data is consistent.
subroutine pmc_mpi_unpack_aero_particle_array(buffer, position, val)
Unpacks the given value from the buffer, advancing position.
integer function pmc_mpi_pack_size_integer(val)
Determines the number of bytes required to pack the given value.
subroutine pmc_mpi_pack_integer(buffer, position, val)
Packs the given value into the buffer, advancing position.
The aero_particle_array_t structure and assoicated subroutines.
subroutine aero_particle_array_zero(aero_particle_array)
Resets an aero_particle_array to contain zero particles.
subroutine pmc_mpi_pack_aero_particle(buffer, position, val)
Packs the given value into the buffer, advancing position.
subroutine aero_particle_array_remove_particle(aero_particle_array, index)
Removes the particle at the given index.