From a86b33e6ac6a40bb65fdbb9d502c0aea39fb2a36 Mon Sep 17 00:00:00 2001 From: David A Minton Date: Fri, 27 Aug 2021 20:11:56 -0400 Subject: [PATCH] Trying to get Symba info into the NetCDF --- src/util/util_resize.f90 | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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