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

Commit

Permalink
messed around with particle ids, something is still wrong here
Browse files Browse the repository at this point in the history
  • Loading branch information
cwishard committed Sep 29, 2021
1 parent 76b0abf commit 2dc7ec9
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/netcdf/netcdf.f90
Original file line number Diff line number Diff line change
Expand Up @@ -528,13 +528,15 @@ module subroutine netcdf_read_particle_info_base(self, iu)
class is (swiftest_body)
associate(n => self%nbody)
if (n == 0) return
allocate(ind(n))
call util_sort(self%id(1:n), ind)
!allocate(ind(n))
!call util_sort(self%id(1:n), ind)

do i = 1, n
j = ind(i)
idslot = self%id(j) + 1
call check( nf90_get_var(iu%ncid, iu%id_varid, self%id(j), start=[idslot]) )
!self%id(i) = i
!j = ind(i) + 1
idslot = i + 1
!call check( nf90_get_var(iu%ncid, iu%id_varid, self%id(j), start=[idslot]) )
call check( nf90_put_var(iu%ncid, iu%id_varid, i, start=[idslot]))

charstring = trim(adjustl(self%info(j)%name))
strlen = len(charstring)
Expand Down Expand Up @@ -575,8 +577,10 @@ module subroutine netcdf_read_particle_info_base(self, iu)
end associate

class is (swiftest_cb)
self%id = 0
idslot = self%id + 1
call check( nf90_get_var(iu%ncid, iu%id_varid, self%id, start=[idslot]) )
!call check( nf90_get_var(iu%ncid, iu%id_varid, self%id, start=[idslot]) )
call check( nf90_put_var(iu%ncid, iu%id_varid, self%id, start=[idslot]))

charstring = trim(adjustl(self%info%name))
strlen = len(charstring)
Expand Down

0 comments on commit 2dc7ec9

Please sign in to comment.