diff --git a/src/collision/collision_util.f90 b/src/collision/collision_util.f90 index 35d4e10f2..fb0cbee06 100644 --- a/src/collision/collision_util.f90 +++ b/src/collision/collision_util.f90 @@ -88,6 +88,10 @@ module subroutine collision_util_construct_temporary_system(self, nbody_system, if (allocated(tmpparam)) deallocate(tmpparam) if (allocated(tmpsys)) deallocate(tmpsys) allocate(tmpparam_local, source=param) + select type(tmpparam_local) + class is (swiftest_parameters) + tmpparam_local%system_history%nc%lfile_is_open = .false. + end select call swiftest_util_setup_construct_system(tmpsys_local, tmpparam_local) ! No test particles necessary for energy/momentum calcs diff --git a/src/encounter/encounter_check.f90 b/src/encounter/encounter_check.f90 index de81b75bc..276024b3f 100644 --- a/src/encounter/encounter_check.f90 +++ b/src/encounter/encounter_check.f90 @@ -125,6 +125,10 @@ module subroutine encounter_check_all_plplm(param, nplm, nplt, xplm, vplm, xplt, ! end if allocate(tmp_param, source=param) + select type(tmp_param) + class is (swiftest_parameters) + tmp_param%system_history%nc%lfile_is_open = .false. + end select ! Turn off adaptive encounter checks for the pl-pl group tmp_param%ladaptive_encounters_plpl = .false.