diff --git a/src/modules/swiftest_classes.f90 b/src/modules/swiftest_classes.f90 index 987375461..31b45a7df 100644 --- a/src/modules/swiftest_classes.f90 +++ b/src/modules/swiftest_classes.f90 @@ -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 @@ -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 diff --git a/src/symba/symba_gr.f90 b/src/symba/symba_gr.f90 index 5f8b9c5c1..f743b124a 100644 --- a/src/symba/symba_gr.f90 +++ b/src/symba/symba_gr.f90 @@ -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 @@ -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 diff --git a/src/symba/symba_step.f90 b/src/symba/symba_step.f90 index 097bc1f1a..087552f47 100644 --- a/src/symba/symba_step.f90 +++ b/src/symba/symba_step.f90 @@ -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.)