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

Commit

Permalink
Merge branch 'debug'
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Dec 13, 2021
2 parents 3633745 + 2ced8fd commit 3f5da64
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
14 changes: 8 additions & 6 deletions src/modules/swiftest_classes.f90
Original file line number Diff line number Diff line change
Expand Up @@ -476,12 +476,6 @@ module swiftest_classes
end type swiftest_nbody_system

abstract interface
subroutine abstract_discard_body(self, system, param)
import swiftest_body, swiftest_nbody_system, swiftest_parameters
class(swiftest_body), intent(inout) :: self !! Swiftest body object
class(swiftest_nbody_system), intent(inout) :: system !! Swiftest nbody system object
class(swiftest_parameters), intent(inout) :: param !! Current run configuration parameters
end subroutine abstract_discard_body

subroutine abstract_accel(self, system, param, t, lbeg)
import swiftest_body, swiftest_nbody_system, swiftest_parameters, DP
Expand All @@ -492,6 +486,14 @@ subroutine abstract_accel(self, system, param, t, lbeg)
logical, intent(in) :: lbeg !! Optional argument that determines whether or not this is the beginning or end of the step
end subroutine abstract_accel

subroutine abstract_discard_body(self, system, param)
import swiftest_body, swiftest_nbody_system, swiftest_parameters
class(swiftest_body), intent(inout) :: self !! Swiftest body object
class(swiftest_nbody_system), intent(inout) :: system !! Swiftest nbody system object
class(swiftest_parameters), intent(inout) :: param !! Current run configuration parameters
end subroutine abstract_discard_body


subroutine abstract_kick_body(self, system, param, t, dt, lbeg)
import swiftest_body, swiftest_nbody_system, swiftest_parameters, DP
implicit none
Expand Down
14 changes: 6 additions & 8 deletions src/symba/symba_gr.f90
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,15 @@ module pure subroutine symba_gr_p4_pl(self, system, param, dt)
class(swiftest_nbody_system), intent(inout) :: system !! Swiftest nbody system object
class(swiftest_parameters), intent(in) :: param !! Current run configuration parameters
real(DP), intent(in) :: dt !! Step size
! Internals
integer(I4B) :: i

if (self%nbody == 0) return

associate(pl => self, npl => self%nbody)
select type(system)
class is (symba_nbody_system)
do concurrent(i = 1:npl, pl%lmask(i) .and. (pl%levelg(i) == system%irec) )
call gr_p4_pos_kick(param, pl%xh(:, i), pl%vb(:, i), dt)
end do
pl%lmask(1:npl) = pl%status(1:npl) /= INACTIVE .and. pl%levelg(1:npl) == system%irec
call helio_gr_p4_pl(pl, system, param, dt)
pl%lmask(1:npl) = pl%status(1:npl) /= INACTIVE
end select
end associate

Expand Down Expand Up @@ -54,9 +52,9 @@ module pure subroutine symba_gr_p4_tp(self, system, param, dt)
associate(tp => self, ntp => self%nbody)
select type(system)
class is (symba_nbody_system)
do concurrent(i = 1:ntp, tp%lmask(i) .and. (tp%levelg(i) == system%irec))
call gr_p4_pos_kick(param, tp%xh(:, i), tp%vb(:, i), dt)
end do
tp%lmask(1:ntp) = tp%status(1:ntp) /= INACTIVE .and. tp%levelg(1:ntp) == system%irec
call helio_gr_p4_tp(tp, system, param, dt)
tp%lmask(1:ntp) = tp%status(1:ntp) /= INACTIVE
end select
end associate

Expand Down
1 change: 1 addition & 0 deletions src/symba/symba_step.f90
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ module subroutine symba_step_interp_system(self, param, t, dt)
call tp%drift(system, param, dt)

call system%recursive_step(param, t, 0)
system%irec = -1

if (param%lgr) call pl%gr_pos_kick(system, param, dth)
call pl%kick(system, param, t, dth, lbeg=.false.)
Expand Down

0 comments on commit 3f5da64

Please sign in to comment.