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

Commit

Permalink
Corrected position vector for massive bodies from xb to xh
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Jul 23, 2021
1 parent 4efd05b commit f6cf54d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/helio/helio_drift.f90
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module subroutine helio_drift_pl(self, system, param, dt, mask)

if (param%lgr) then
do concurrent(i = 1:npl, mask(i))
rmag = norm2(pl%xb(:, i))
rmag = norm2(pl%xh(:, i))
vmag2 = dot_product(pl%vb(:, i), pl%vb(:, i))
energy = 0.5_DP * vmag2 - mu(i) / rmag
dtp(i) = dt * (1.0_DP + 3 * param%inv_c2 * energy)
Expand All @@ -44,15 +44,15 @@ module subroutine helio_drift_pl(self, system, param, dt, mask)
end if

do concurrent(i = 1:npl, mask(i))
call drift_one(mu(i), pl%xb(1,i), pl%xb(2,i), pl%xb(3,i), &
call drift_one(mu(i), pl%xh(1,i), pl%xh(2,i), pl%xh(3,i), &
pl%vb(1,i), pl%vb(2,i), pl%vb(3,i), &
dtp(i), iflag(i))
end do
if (any(iflag(1:npl) /= 0)) then
do i = 1, npl
if (iflag(i) /= 0) then
write(*, *) " Planet ", self%id(i), " is lost!!!!!!!!!!"
write(*, *) pl%xb(:,i)
write(*, *) pl%xh(:,i)
write(*, *) pl%vb(:,i)
write(*, *) " stopping "
call util_exit(FAILURE)
Expand Down

0 comments on commit f6cf54d

Please sign in to comment.