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

Commit

Permalink
Fixed code that allows the central body to have its own id passed to …
Browse files Browse the repository at this point in the history
…the Python swiftest package
  • Loading branch information
daminton committed Jul 12, 2021
1 parent b78c887 commit 47c57d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion python/swiftest/swiftest/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ def swiftest_stream(f, param):
npl = f.read_ints()
ntp = f.read_ints()
iout_form = f.read_reals('c')
cbid = f.read_ints()
Mcb = f.read_reals(np.float64)
Rcb = f.read_reals(np.float64)
J2cb = f.read_reals(np.float64)
Expand Down Expand Up @@ -508,7 +509,6 @@ def swiftest_stream(f, param):
t4 = f.read_reals(np.float64)
t5 = f.read_reals(np.float64)
t6 = f.read_reals(np.float64)
cbid = np.array([0])

clab, plab, tlab = make_swiftest_labels(param)

Expand Down
8 changes: 4 additions & 4 deletions src/io/io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ module subroutine io_read_frame_body(self, iu, param, form, ierr)

associate(n => self%nbody)
read(iu, iostat = ierr) self%id(1:n)
read(iu, iostat = ierr) self%name(1:n)
!read(iu, iostat = ierr) self%name(1:n)
select case (form)
case (EL)
read(iu, iostat = ierr) self%a(1:n)
Expand Down Expand Up @@ -830,7 +830,7 @@ module subroutine io_read_frame_cb(self, iu, param, form, ierr)
integer(I4B), intent(out) :: ierr !! Error cod

read(iu, iostat = ierr) self%id
read(iu, iostat = ierr) self%name
!read(iu, iostat = ierr) self%name
read(iu, iostat = ierr) self%Gmass
self%mass = self%Gmass / param%GU
read(iu, iostat = ierr) self%radius
Expand Down Expand Up @@ -1085,7 +1085,7 @@ module subroutine io_write_frame_body(self, iu, param)
associate(n => self%nbody)
if (n == 0) return
write(iu) self%id(1:n)
write(iu) self%name(1:n)
!write(iu) self%name(1:n)
select case (param%out_form)
case (EL)
write(iu) self%a(1:n)
Expand Down Expand Up @@ -1126,7 +1126,7 @@ module subroutine io_write_frame_cb(self, iu, param)
class(swiftest_parameters), intent(in) :: param !! Current run configuration parameters

write(iu) self%id
write(iu) self%name
!write(iu) self%name
write(iu) self%Gmass
write(iu) self%radius
write(iu) self%j2rp2
Expand Down

0 comments on commit 47c57d0

Please sign in to comment.