From c1964db1f70b0f1d86510d76fbedd0e40e0b38b9 Mon Sep 17 00:00:00 2001 From: David A Minton Date: Thu, 22 Dec 2022 20:43:24 -0500 Subject: [PATCH] Fixed allocation bug --- src/swiftest/swiftest_io.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/swiftest/swiftest_io.f90 b/src/swiftest/swiftest_io.f90 index 68e34e33b..343da3be6 100644 --- a/src/swiftest/swiftest_io.f90 +++ b/src/swiftest/swiftest_io.f90 @@ -265,8 +265,8 @@ module subroutine swiftest_io_dump_system(self, param) if (idx > NDUMPFILES) idx = 1 ! Dump the encounter history if necessary - if (param%lenc_save_trajectory .or. param%lenc_save_closest) call self%encounter_history%dump(param) - call self%collision_history%dump(param) + if (param%lenc_save_trajectory .or. param%lenc_save_closest .and. allocated(self%encounter_history)) call self%encounter_history%dump(param) + if (allocated(self%collision_history)) call self%collision_history%dump(param) ! Dump the nbody_system history to file call param%system_history%dump(param)