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

Commit

Permalink
Fixed status variable output
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Jan 5, 2023
1 parent 825c2d9 commit 64fbf6d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion python/swiftest/swiftest/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
# handles strings differently than Python's Xarray.
string_varnames = ["name", "particle_type", "status", "origin_type", "stage", "regime"]
char_varnames = ["space"]
int_varnames = ["id", "ntp", "npl", "nplm", "discard_body_id", "collision_id", "loopnum"]
int_varnames = ["id", "ntp", "npl", "nplm", "discard_body_id", "collision_id", "status"]

def bool2yesno(boolval):
"""
Expand Down
2 changes: 1 addition & 1 deletion src/swiftest/swiftest_io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1557,7 +1557,7 @@ module subroutine swiftest_io_netcdf_write_frame_cb(self, nc, param)

idslot = self%id + 1
call netcdf_io_check( nf90_put_var(nc%id, nc%id_varid, self%id, start=[idslot]), "netcdf_io_write_frame_cb nf90_put_var cb id_varid" )
call netcdf_io_check( nf90_put_var(nc%id, nc%status_varid, ACTIVE, start=[idslot]), "netcdf_io_write_frame_cb nf90_put_var cb id_varid" )
call netcdf_io_check( nf90_put_var(nc%id, nc%status_varid, ACTIVE, start=[idslot, tslot]), "netcdf_io_write_frame_cb nf90_put_var cb id_varid" )

call netcdf_io_check( nf90_put_var(nc%id, nc%Gmass_varid, self%Gmass, start=[idslot, tslot]), "netcdf_io_write_frame_cb nf90_put_var cb Gmass_varid" )
if (param%lclose) call netcdf_io_check( nf90_put_var(nc%id, nc%radius_varid, self%radius, start=[idslot, tslot]), "netcdf_io_write_frame_cb nf90_put_var cb radius_varid" )
Expand Down
4 changes: 0 additions & 4 deletions src/swiftest/swiftest_util.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1717,10 +1717,6 @@ module subroutine swiftest_util_rearray_pl(self, nbody_system, param)
end where
end if

call nc%open(param)
call pl%write_info(nc, param)
call nc%close()

! Reindex the new list of bodies
call pl%sort("mass", ascending=.false.)
call pl%flatten(param)
Expand Down

0 comments on commit 64fbf6d

Please sign in to comment.