diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c9d206d89..09545baf6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -84,7 +84,6 @@ SET(FAST_MATH_FILES ${SRC}/swiftest/swiftest_driver.f90 ) - set(SWIFTEST_src ${FAST_MATH_FILES} ${STRICT_MATH_FILES}) # Define the executable in terms of the source files diff --git a/src/swiftest/swiftest_io.f90 b/src/swiftest/swiftest_io.f90 index 6522f0997..d31be7417 100644 --- a/src/swiftest/swiftest_io.f90 +++ b/src/swiftest/swiftest_io.f90 @@ -2838,12 +2838,14 @@ module subroutine swiftest_io_write_discard(self, param) class(swiftest_parameters), intent(inout) :: param !! Current run configuration parameters ! Internals - associate(pl => self%pl, npl => self%pl%nbody, pl_adds => self%pl_adds) - - if (self%tp_discards%nbody > 0) call self%tp_discards%write_info(param%system_history%nc, param) + associate(pl => self%pl, npl => self%pl%nbody, pl_adds => self%pl_adds, nc => param%system_history%nc) + + call nc%open(param) + if (self%tp_discards%nbody > 0) call self%tp_discards%write_info(nc, param) if (self%pl_discards%nbody == 0) return - call self%pl_discards%write_info(param%system_history%nc, param) + call self%pl_discards%write_info(nc, param) + call nc%close() end associate return diff --git a/src/swiftest/swiftest_util.f90 b/src/swiftest/swiftest_util.f90 index 8fc118479..1bccb6bc7 100644 --- a/src/swiftest/swiftest_util.f90 +++ b/src/swiftest/swiftest_util.f90 @@ -1664,7 +1664,7 @@ module subroutine swiftest_util_rearray_pl(self, nbody_system, param) class(encounter_list), allocatable :: plplenc_old logical :: lencounter - associate(pl => self, tp => nbody_system%tp, pl_adds => nbody_system%pl_adds) + associate(pl => self, tp => nbody_system%tp, pl_adds => nbody_system%pl_adds, nc => param%system_history%nc) npl = pl%nbody nadd = pl_adds%nbody @@ -1724,7 +1724,9 @@ module subroutine swiftest_util_rearray_pl(self, nbody_system, param) end where end if - call pl%write_info(param%system_history%nc, param) + call nc%open(param) + call pl%write_info(nc, param) + call nc%close() deallocate(ldump_mask) ! Reindex the new list of bodies