From 10b8f2d8116fec70ce389fba13f741ef775411a2 Mon Sep 17 00:00:00 2001 From: David A Minton Date: Fri, 23 Dec 2022 09:10:20 -0500 Subject: [PATCH] Prevented netcdf files from being closed prematurely. --- src/collision/collision_util.f90 | 4 ++++ src/encounter/encounter_check.f90 | 4 ++++ 2 files changed, 8 insertions(+) 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.