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

Commit

Permalink
Fixed initial conditions reader for rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Aug 5, 2021
1 parent 0105641 commit f79e61a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
9 changes: 5 additions & 4 deletions examples/symba_energy_momentum/cb.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
0
39.47841760435743
0.4 0.4 0.4 !Ip
0.0 0.0 0.0 !rot !11.2093063 -38.75937204 82.25088158 ! rot (radian / year)
39.47841760435743 ! G*Mass
0.005 ! Radius
0.0 ! J2
0.0 ! J4
0.0 ! J4
0.4 0.4 0.4 !Ip
0.0 0.0 0.0 !rot !11.2093063 -38.75937204 82.25088158 ! rot (radian / year)
12 changes: 7 additions & 5 deletions src/io/io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,13 @@ module subroutine io_read_body_in(self, param)
end if
self%Gmass(i) = real(val, kind=DP)
self%mass(i) = real(val / param%GU, kind=DP)
class is (swiftest_tp)
read(iu, *, iostat=ierr, err=100) self%id(i)
end select
read(iu, *, iostat=ierr, err=100) self%xh(1, i), self%xh(2, i), self%xh(3, i)
read(iu, *, iostat=ierr, err=100) self%vh(1, i), self%vh(2, i), self%vh(3, i)
select type (self)
class is (swiftest_pl)
if (param%lclose) read(iu, *, iostat=ierr, err=100) self%radius(i)
if (param%lrotation) then
read(iu, iostat=ierr, err=100) self%Ip(:, i)
Expand All @@ -803,11 +810,7 @@ module subroutine io_read_body_in(self, param)
read(iu, iostat=ierr, err=100) self%k2(i)
read(iu, iostat=ierr, err=100) self%Q(i)
end if
class is (swiftest_tp)
read(iu, *, iostat=ierr, err=100) self%id(i)
end select
read(iu, *, iostat=ierr, err=100) self%xh(1, i), self%xh(2, i), self%xh(3, i)
read(iu, *, iostat=ierr, err=100) self%vh(1, i), self%vh(2, i), self%vh(3, i)
self%status(i) = ACTIVE
self%lmask(i) = .true.
end do
Expand Down Expand Up @@ -885,7 +888,6 @@ module subroutine io_read_cb_in(self, param)
end subroutine io_read_cb_in



function io_read_encounter(t, name1, name2, mass1, mass2, radius1, radius2, &
xh1, xh2, vh1, vh2, enc_out, out_type) result(ierr)
!! author: David A. Minton
Expand Down

0 comments on commit f79e61a

Please sign in to comment.