From c659ca1e7b4f17c1742a79abef5e827ea0090ad9 Mon Sep 17 00:00:00 2001 From: David A Minton Date: Sun, 4 Dec 2022 18:12:03 -0500 Subject: [PATCH] Added new symba_system_snapshot object to track the system through encounters --- src/encounter/encounter_io.f90 | 2 +- src/modules/symba_classes.f90 | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/encounter/encounter_io.f90 b/src/encounter/encounter_io.f90 index 62920db7e..f41c25f85 100644 --- a/src/encounter/encounter_io.f90 +++ b/src/encounter/encounter_io.f90 @@ -140,7 +140,7 @@ module subroutine encounter_io_write_frame(self, nciu, param) implicit none ! Arguments class(encounter_list), intent(in) :: self !! Swiftest encounter structure - class(encounter_io_parameters), intent(inout) :: nciu !! Parameters used to identify a particular encounter io NetCDF dataset + class(encounter_io_parameters), intent(inout) :: nciu !! Parameters used to identify a particular encounter io NetCDF dataset class(swiftest_parameters), intent(inout) :: param !! Current run configuration parameters ! Internals integer(I4B) :: tslot,i,old_mode, n diff --git a/src/modules/symba_classes.f90 b/src/modules/symba_classes.f90 index cd97b74bd..d72097834 100644 --- a/src/modules/symba_classes.f90 +++ b/src/modules/symba_classes.f90 @@ -201,7 +201,14 @@ module symba_classes final :: symba_util_final_system !! Finalizes the SyMBA nbody system object - deallocates all allocatables end type symba_nbody_system + type, extends(helio_nbody_system) :: symba_system_snapshot + contains + procedure :: snapshot => symba_util_take_system_snapshot + final :: symba_util_final_snapshot + end type + interface + module function symba_collision_check_encounter(self, system, param, t, dt, irec) result(lany_collision) use swiftest_classes, only : swiftest_parameters implicit none @@ -374,6 +381,15 @@ module subroutine symba_util_set_renc(self, scale) integer(I4B), intent(in) :: scale !! Current recursion depth end subroutine symba_util_set_renc + module subroutine symba_util_take_system_snapshot(self, system, param, t) + use swiftest_classes, only : swiftest_parameters + implicit none + class(symba_system_snapshot), intent(inout) :: self !! SyMBA nbody system snapshot object + class(symba_nbody_system), intent(in) :: system !! SyMBA nbody system object + class(symba_parameters), intent(in) :: param !! Current run configuration parameters + real(DP), intent(in) :: t !! current time + end subroutine symba_util_take_system_snapshot + module subroutine symba_io_param_reader(self, unit, iotype, v_list, iostat, iomsg) implicit none class(symba_parameters), intent(inout) :: self !! Current run configuration parameters with SyMBA additionss @@ -648,6 +664,11 @@ module subroutine symba_util_final_pl(self) type(symba_pl), intent(inout) :: self !! SyMBA massive body object end subroutine symba_util_final_pl + module subroutine symba_util_final_snapshot(self) + implicit none + type(symba_system_snapshot), intent(inout) :: self !! SyMBA nbody system object + end subroutine symba_util_final_snapshot + module subroutine symba_util_final_system(self) implicit none type(symba_nbody_system), intent(inout) :: self !! SyMBA nbody system object