diff --git a/src/modules/symba_classes.f90 b/src/modules/symba_classes.f90 index 4c1b6b673..cf6872846 100644 --- a/src/modules/symba_classes.f90 +++ b/src/modules/symba_classes.f90 @@ -183,7 +183,7 @@ module symba_classes !! NetCDF dimension and variable names for the enounter save object type, extends(netcdf_parameters) :: symba_io_encounter_parameters integer(I4B) :: ienc_frame = 1 !! Current frame number for the encounter history - character(STRMAX) :: enc_file = "encounter.nc" !! Encounter output file name + character(STRMAX) :: enc_file !! Encounter output file name character(NAMELEN) :: level_varname = "level" !! Recursion depth integer(I4B) :: level_varid !! ID for the recursion level variable integer(I4B) :: time_dimsize = 0 !! Number of time values in snapshot @@ -202,6 +202,20 @@ module symba_classes end type symba_encounter_storage + type :: symba_encounter_snapshot + !! A simplified version of a SyMBA nbody system object for storing minimal snapshots of the system state during encounters + type(symba_pl) :: pl !! Massive body data structure + type(symba_tp) :: tp !! Test particle data structure + real(DP) :: t = 0.0_DP !! Time at the snapshot + integer(I4B) :: tslot = 0 !! The index for the time array in the final NetCDF file + contains + procedure :: write_encounter_frame => symba_io_encounter_write_frame !! Writes a frame of encounter data to file + procedure :: dealloc => symba_util_dealloc_snapshot !! Deallocates all allocatable arrays + generic :: write_frame => write_encounter_frame !! Writes a snaphot frame to file + final :: symba_util_final_encounter_snapshot + end type symba_encounter_snapshot + + !******************************************************************************************************************************** ! symba_nbody_system class definitions and method interfaces !******************************************************************************************************************************** @@ -229,18 +243,6 @@ module symba_classes end type symba_nbody_system - type :: symba_encounter_snapshot - type(symba_pl) :: pl !! Massive body data structure - type(symba_tp) :: tp !! Test particle data structure - real(DP) :: t = 0.0_DP !! Time at the snapshot - integer(I4B) :: tslot = 0 !! The index for the time array in the final NetCDF file - contains - procedure :: write_encounter_frame => symba_io_encounter_write_frame !! Writes a frame of encounter data to file - procedure :: dealloc => symba_util_dealloc_snapshot !! Deallocates all allocatable arrays - generic :: write_frame => write_encounter_frame !! Writes a snaphot frame to file - final :: symba_util_final_encounter_snapshot - end type symba_encounter_snapshot - interface module function symba_collision_check_encounter(self, system, param, t, dt, irec) result(lany_collision)