Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Trying to get Symba info into the NetCDF
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Aug 28, 2021
1 parent d008ac3 commit a86b33e
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/util/util_resize.f90
Original file line number Diff line number Diff line change
Expand Up @@ -150,18 +150,29 @@ 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

if (nnew == 0) then
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
Expand Down

0 comments on commit a86b33e

Please sign in to comment.