diff --git a/src/fraggle/fraggle_generate.f90 b/src/fraggle/fraggle_generate.f90 index 47e55e51a..ddb14c261 100644 --- a/src/fraggle/fraggle_generate.f90 +++ b/src/fraggle/fraggle_generate.f90 @@ -589,7 +589,7 @@ module subroutine fraggle_generate_vel_vec(collider, nbody_system, param, lfailu ! We didn't converge. Reset the fragment positions and velocities and try a new configuration with some slightly different parameters ! Reduce the number of fragments by one nlast = fragments%nbody - fragments%Ip(:,1) = fragments%mass(1) * impactors%Ip(:,1) + fragments%mass(nlast) * impactors%Ip(:,nlast) + fragments%Ip(:,1) = fragments%mass(1) * fragments%Ip(:,1) + fragments%mass(nlast) * fragments%Ip(:,nlast) fragments%mass(1) = fragments%mass(1) + fragments%mass(nlast) fragments%Ip(:,1) = fragments%Ip(:,1) / fragments%mass(1) fragments%Gmass(1) = fragments%Gmass(1) + fragments%mass(nlast) diff --git a/src/swiftest/swiftest_discard.f90 b/src/swiftest/swiftest_discard.f90 index 2b69012b7..01a83f5db 100644 --- a/src/swiftest/swiftest_discard.f90 +++ b/src/swiftest/swiftest_discard.f90 @@ -92,6 +92,8 @@ module subroutine swiftest_discard_tp(self, nbody_system, param) logical, dimension(:), allocatable :: ldiscard integer(I4B) :: npl, ntp + if (self%nbody == 0) return + associate(tp => self, cb => nbody_system%cb, pl => nbody_system%pl) ntp = tp%nbody npl = pl%nbody