Go to the documentation of this file.
51 if (
allocated(aero_info_array%aero_info))
then
67 aero_info_array%n_item = 0
68 if (
allocated(aero_info_array%aero_info))
then
69 deallocate(aero_info_array%aero_info)
71 allocate(aero_info_array%aero_info(0))
88 integer,
intent(in) :: new_length
93 if (.not.
allocated(aero_info_array%aero_info))
then
94 allocate(aero_info_array%aero_info(new_length))
95 aero_info_array%n_item = 0
99 call assert(955874877, new_length >= aero_info_array%n_item)
100 allocate(new_items(new_length))
101 do i = 1,aero_info_array%n_item
102 new_items(i) = aero_info_array%aero_info(i)
104 call move_alloc(new_items, aero_info_array%aero_info)
116 integer,
intent(in) :: n
118 if (.not.
allocated(aero_info_array%aero_info))
then
123 if (n <=
size(aero_info_array%aero_info))
return
138 integer :: new_length
140 if (.not.
allocated(aero_info_array%aero_info))
return
142 new_length =
pow2_above(aero_info_array%n_item)
143 if (new_length <
size(aero_info_array%aero_info))
then
164 aero_info_array%aero_info(n) = aero_info
165 aero_info_array%n_item = n
178 integer,
intent(in) :: index
180 call assert(578870706,
allocated(aero_info_array%aero_info))
181 call assert(213892348, index >= 1)
182 call assert(953927392, index <= aero_info_array%n_item)
183 if (index < aero_info_array%n_item)
then
185 aero_info_array%aero_info(index) &
186 = aero_info_array%aero_info(aero_info_array%n_item)
188 aero_info_array%n_item = aero_info_array%n_item - 1
197 aero_info_array_delta)
204 integer :: i, n, n_delta, n_new
206 n = aero_info_array%n_item
207 n_delta = aero_info_array_delta%n_item
211 aero_info_array%aero_info(n + i) = aero_info_array_delta%aero_info(i)
213 aero_info_array%n_item = n_new
225 integer :: i, total_size
228 total_size = total_size &
231 total_size = total_size &
244 character,
intent(inout) :: buffer(:)
246 integer,
intent(inout) :: position
251 integer :: prev_position, i
253 prev_position = position
270 character,
intent(inout) :: buffer(:)
272 integer,
intent(inout) :: position
277 integer :: prev_position, i, n
279 prev_position = position
subroutine pmc_mpi_pack_aero_info_array(buffer, position, val)
Packs the given value into the buffer, advancing position.
Wrapper functions for MPI.
subroutine aero_info_array_enlarge_to(aero_info_array, n)
Possibly enlarges the given array, ensuring that it is at least of size n.
subroutine aero_info_array_add_aero_info(aero_info_array, aero_info)
Adds the given aero_info to the end of the array.
subroutine aero_info_array_realloc(aero_info_array, new_length)
Changes the given aero_info_array to exactly the given new_length.
integer function pmc_mpi_pack_size_aero_info(val)
Determines the number of bytes required to pack the given value.
subroutine pmc_mpi_unpack_aero_info(buffer, position, val)
Unpacks the given value from the buffer, advancing position.
subroutine aero_info_array_shrink(aero_info_array)
Possibly shrinks the storage of the given array, ensuring that it can still store the allocated parti...
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 pmc_mpi_pack_aero_info(buffer, position, val)
Packs the given value into the buffer, advancing position.
integer function pmc_mpi_pack_size_aia(val)
Determines the number of bytes required to pack the given value.
subroutine aero_info_array_add(aero_info_array, aero_info_array_delta)
Adds aero_info_array_delta to the end of aero_info_array.
subroutine aero_info_array_zero(aero_info_array)
Sets an aero_info_array to contain zero data.
The aero_info_array_t structure and assoicated subroutines.
elemental integer function aero_info_array_n_item(aero_info_array)
Return the current number of items.
subroutine pmc_mpi_unpack_integer(buffer, position, val)
Unpacks the given value from the buffer, advancing position.
Information about removed particles describing the sink.
Common utility subroutines.
The aero_info_t structure and associated subroutines.
1-D arrays of aero_info_t structure.
subroutine aero_info_array_remove_aero_info(aero_info_array, index)
Removes the aero_info at the given index.
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.
subroutine pmc_mpi_unpack_aero_info_array(buffer, position, val)
Unpacks the given value from the buffer, advancing position.