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

Commit

Permalink
Fixed problem with 1pl_1pl initial conditions generator dtypes for ids
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Aug 4, 2021
1 parent cf2feb1 commit 31b7c69
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@

plfile = FortranFile(swiftest_pl, 'w')
plfile.write_record(npl)

plfile.write_record(np.array([plid1, plid2]))
plfile.write_record(np.array([plid1, plid2], dtype=np.int32))
plfile.write_record(np.vstack([p_pl1[0],p_pl2[0]]))
plfile.write_record(np.vstack([p_pl1[1],p_pl2[1]]))
plfile.write_record(np.vstack([p_pl1[2],p_pl2[2]]))
Expand Down
Binary file not shown.
40 changes: 20 additions & 20 deletions src/io/io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ module subroutine io_read_frame_body(self, iu, param, form, ierr)
integer(I4B), intent(out) :: ierr !! Error code

associate(n => self%nbody)
read(iu, iostat=ierr, err=100) self%id(1:n)
read(iu, iostat=ierr, err=100) self%id(:)
!read(iu, iostat=ierr, err=100) self%name(1:n)
select case (form)
case (EL)
Expand All @@ -849,33 +849,33 @@ module subroutine io_read_frame_body(self, iu, param, form, ierr)
if (.not.allocated(self%capom)) allocate(self%capom(n))
if (.not.allocated(self%omega)) allocate(self%omega(n))
if (.not.allocated(self%capm)) allocate(self%capm(n))
read(iu, iostat=ierr, err=100) self%a(1:n)
read(iu, iostat=ierr, err=100) self%e(1:n)
read(iu, iostat=ierr, err=100) self%inc(1:n)
read(iu, iostat=ierr, err=100) self%a(:)
read(iu, iostat=ierr, err=100) self%e(:)
read(iu, iostat=ierr, err=100) self%inc(:)
read(iu, iostat=ierr, err=100) self%capom(:)
read(iu, iostat=ierr, err=100) self%omega(:)
read(iu, iostat=ierr, err=100) self%capm(:)
case (XV)
read(iu, iostat=ierr, err=100) self%xh(1, 1:n)
read(iu, iostat=ierr, err=100) self%xh(2, 1:n)
read(iu, iostat=ierr, err=100) self%xh(3, 1:n)
read(iu, iostat=ierr, err=100) self%vh(1, 1:n)
read(iu, iostat=ierr, err=100) self%vh(2, 1:n)
read(iu, iostat=ierr, err=100) self%vh(3, 1:n)
read(iu, iostat=ierr, err=100) self%xh(1, :)
read(iu, iostat=ierr, err=100) self%xh(2, :)
read(iu, iostat=ierr, err=100) self%xh(3, :)
read(iu, iostat=ierr, err=100) self%vh(1, :)
read(iu, iostat=ierr, err=100) self%vh(2, :)
read(iu, iostat=ierr, err=100) self%vh(3, :)
end select
select type(pl => self)
class is (swiftest_pl) ! Additional output if the passed polymorphic object is a massive body
read(iu, iostat=ierr, err=100) pl%Gmass(1:n)
pl%mass(1:n) = pl%Gmass / param%GU
if (param%lrhill_present) read(iu, iostat=ierr, err=100) pl%rhill(1:n)
read(iu, iostat=ierr, err=100) pl%radius(1:n)
read(iu, iostat=ierr, err=100) pl%Gmass(:)
pl%mass(:) = pl%Gmass(:) / param%GU
if (param%lrhill_present) read(iu, iostat=ierr, err=100) pl%rhill(:)
read(iu, iostat=ierr, err=100) pl%radius(:)
if (param%lrotation) then
read(iu, iostat=ierr, err=100) pl%rot(1, 1:n)
read(iu, iostat=ierr, err=100) pl%rot(2, 1:n)
read(iu, iostat=ierr, err=100) pl%rot(3, 1:n)
read(iu, iostat=ierr, err=100) pl%Ip(1, 1:n)
read(iu, iostat=ierr, err=100) pl%Ip(2, 1:n)
read(iu, iostat=ierr, err=100) pl%Ip(3, 1:n)
read(iu, iostat=ierr, err=100) pl%rot(1, :)
read(iu, iostat=ierr, err=100) pl%rot(2, :)
read(iu, iostat=ierr, err=100) pl%rot(3, :)
read(iu, iostat=ierr, err=100) pl%Ip(1, :)
read(iu, iostat=ierr, err=100) pl%Ip(2, :)
read(iu, iostat=ierr, err=100) pl%Ip(3, :)
end if
if (param%ltides) then
read(iu, iostat=ierr, err=100) pl%k2(1:n)
Expand Down

0 comments on commit 31b7c69

Please sign in to comment.