Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Prevented netcdf files from being closed prematurely.
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Dec 23, 2022
1 parent af8afde commit 10b8f2d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/collision/collision_util.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/encounter/encounter_check.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 10b8f2d

Please sign in to comment.