From d0d9c2236a00a2a487ad4447e722bcc990f2960f Mon Sep 17 00:00:00 2001 From: David A Minton Date: Thu, 12 Jan 2023 16:30:06 -0500 Subject: [PATCH] Get the maxid_collision when initializing the system --- src/symba/symba_util.f90 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/symba/symba_util.f90 b/src/symba/symba_util.f90 index ccda74e01..a8e28c477 100644 --- a/src/symba/symba_util.f90 +++ b/src/symba/symba_util.f90 @@ -313,10 +313,12 @@ module subroutine symba_util_setup_initialize_system(self, param) select type(nc => collision_history%nc) class is (collision_netcdf_parameters) nc%file_name = COLLISION_OUTFILE - if (.not.param%lrestart) then + if (param%lrestart) then + call nc%open(param) ! This will find the nc%max_idslot variable + else call nc%initialize(param) - call nc%close() end if + call nc%close() end select allocate(nbody_system%collision_history, source=collision_history) @@ -329,6 +331,10 @@ module subroutine symba_util_setup_initialize_system(self, param) allocate(collision_fraggle :: nbody_system%collider) end select call nbody_system%collider%setup(nbody_system) + select type(nc => collision_history%nc) + class is (collision_netcdf_parameters) + nbody_system%collider%maxid_collision = nc%max_idslot + end select end associate