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

Commit

Permalink
edited kick to account for no massive bodies
Browse files Browse the repository at this point in the history
  • Loading branch information
anand43 committed Dec 12, 2023
1 parent dea961a commit 9ba8f74
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions src/whm/whm_kick.f90
Original file line number Diff line number Diff line change
Expand Up @@ -92,29 +92,31 @@ module subroutine whm_kick_getacch_tp(self, nbody_system, param, t, lbeg)
associate(tp => self, pl => nbody_system%pl, cb => nbody_system%cb)
npl = nbody_system%pl%nbody
ntp = self%nbody
if (ntp == 0 .and. npl == 0) return
if (ntp == 0) return
nbody_system%lbeg = lbeg

if (lbeg) then
ah0(:) = whm_kick_getacch_ah0(pl%Gmass(1:npl), pl%rbeg(:, 1:npl), npl)
if(npl > 0) then
if (lbeg) then
ah0(:) = whm_kick_getacch_ah0(pl%Gmass(1:npl), pl%rbeg(:, 1:npl), npl)
#ifdef DOCONLOC
do concurrent(i = 1:ntp, tp%lmask(i)) shared(tp,ah0)
do concurrent(i = 1:ntp, tp%lmask(i)) shared(tp,ah0)
#else
do concurrent(i = 1:ntp, tp%lmask(i))
do concurrent(i = 1:ntp, tp%lmask(i))
#endif
tp%ah(:, i) = tp%ah(:, i) + ah0(:)
end do
call tp%accel_int(param, pl%Gmass(1:npl), pl%rbeg(:, 1:npl), npl)
else
ah0(:) = whm_kick_getacch_ah0(pl%Gmass(1:npl), pl%rend(:, 1:npl), npl)
tp%ah(:, i) = tp%ah(:, i) + ah0(:)
end do
call tp%accel_int(param, pl%Gmass(1:npl), pl%rbeg(:, 1:npl), npl)
else
ah0(:) = whm_kick_getacch_ah0(pl%Gmass(1:npl), pl%rend(:, 1:npl), npl)
#ifdef DOCONLOC
do concurrent(i = 1:ntp, tp%lmask(i)) shared(tp,ah0)
do concurrent(i = 1:ntp, tp%lmask(i)) shared(tp,ah0)
#else
do concurrent(i = 1:ntp, tp%lmask(i))
do concurrent(i = 1:ntp, tp%lmask(i))
#endif
tp%ah(:, i) = tp%ah(:, i) + ah0(:)
end do
call tp%accel_int(param, pl%Gmass(1:npl), pl%rend(:, 1:npl), npl)
tp%ah(:, i) = tp%ah(:, i) + ah0(:)
end do
call tp%accel_int(param, pl%Gmass(1:npl), pl%rend(:, 1:npl), npl)
end if
end if

if (param%loblatecb) call tp%accel_obl(nbody_system)
Expand Down

0 comments on commit 9ba8f74

Please sign in to comment.