diff --git a/src/util/util_resize.f90 b/src/util/util_resize.f90 index e76d53a8d..7ba7e19df 100644 --- a/src/util/util_resize.f90 +++ b/src/util/util_resize.f90 @@ -150,9 +150,16 @@ module subroutine util_resize_arr_info(arr, nnew) ! Internals class(swiftest_particle_info), dimension(:), allocatable :: tmp !! Temporary storage array in case the input array is already allocated integer(I4B) :: nold !! Old size + logical :: is_symba if (.not. allocated(arr) .or. nnew < 0) return + select type(arr) + class is (symba_particle_info) + is_symba = .true. + class default + is_symba = .false. + end select nold = size(arr) if (nnew == nold) return @@ -160,8 +167,12 @@ module subroutine util_resize_arr_info(arr, nnew) deallocate(arr) return end if - - allocate(tmp(nnew)) + + if (is_symba) then + allocate(symba_particle_info :: tmp(nnew)) + else + allocate(swiftest_particle_info :: tmp(nnew)) + end if if (nnew > nold) then tmp(1:nold) = arr(1:nold) else