From 8b8be4faedf3ee4f208aacc1c0930798cb50ca5f Mon Sep 17 00:00:00 2001 From: David A Minton Date: Fri, 13 Jan 2023 09:10:32 -0500 Subject: [PATCH] More fixes to calls to unallocateds. Also work on a scheme to reduce the number of fragments when the Fraggle velocity function fails to converge. --- src/fraggle/fraggle_generate.f90 | 2 +- src/swiftest/swiftest_discard.f90 | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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