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

Commit

Permalink
Finished restructring the encounter output parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Dec 6, 2022
1 parent 155dc89 commit 8980de8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/io/io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,8 @@ module subroutine io_param_reader(self, unit, iotype, v_list, iostat, iomsg)
else if (param_value == "YES" .or. param_value == 'T') then
param%lrestart = .true.
end if
case ("NPLMAX", "NTPMAX", "GMTINY", "MIN_GMFRAG", "FRAGMENTATION", "SEED", "YARKOVSKY", "YORP") ! Ignore SyMBA-specific, not-yet-implemented, or obsolete input parameters
! Ignore SyMBA-specific, not-yet-implemented, or obsolete input parameters
case ("NPLMAX", "NTPMAX", "GMTINY", "MIN_GMFRAG", "FRAGMENTATION", "SEED", "YARKOVSKY", "YORP", "ENCOUNTER_SAVE", "FRAGMENTATION_SAVE")
case default
write(*,*) "Ignoring unknown parameter -> ",param_name
end select
Expand Down
1 change: 1 addition & 0 deletions src/setup/setup.f90
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ module subroutine setup_construct_system(system, param)
allocate(symba_pltpenc :: system%pltpenc_list)
allocate(symba_plplenc :: system%plplenc_list)
allocate(symba_plplenc :: system%plplcollision_list)
allocate(symba_encounter_storage :: system%encounter_history)
end select
case (RINGMOONS)
write(*,*) 'RINGMOONS-SyMBA integrator not yet enabled'
Expand Down
9 changes: 4 additions & 5 deletions src/symba/symba_io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ module subroutine symba_io_param_reader(self, unit, iotype, v_list, iostat, ioms
iostat = -1
return
end if
param%lencounter_save = (param%encounter_save /= "TRAJECTORY") .or. (param%encounter_save /= "CLOSEST") .or. &
(param%fragmentation_save /= "TRAJECTORY") .or. (param%fragmentation_save /= "CLOSEST")
param%lencounter_save = (param%encounter_save == "TRAJECTORY") .or. (param%encounter_save == "CLOSEST") .or. &
(param%fragmentation_save == "TRAJECTORY") .or. (param%fragmentation_save == "CLOSEST")

! Call the base method (which also prints the contents to screen)
call io_param_reader(param, unit, iotype, v_list, iostat, iomsg)
Expand Down Expand Up @@ -367,8 +367,8 @@ module subroutine symba_io_start_encounter(self, param, t)
class(symba_parameters), intent(inout) :: param !! Current run configuration parameters
real(DP), intent(in) :: t !! Current simulation time

if (allocated(self%encounter_history)) deallocate(self%encounter_history)
allocate(symba_encounter_storage :: self%encounter_history)
if (.not. allocated(self%encounter_history)) allocate(symba_encounter_storage :: self%encounter_history)
call self%encounter_history%reset()

! Take the snapshot at the start of the encounter
call self%snapshot(param, t)
Expand All @@ -390,7 +390,6 @@ module subroutine symba_io_stop_encounter(self, param, t)
! Take the final snapshot
call self%snapshot(param, t)
call self%encounter_history%dump(param)
deallocate(self%encounter_history)

return
end subroutine symba_io_stop_encounter
Expand Down
2 changes: 0 additions & 2 deletions src/symba/symba_step.f90
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,6 @@ module subroutine symba_step_reset_system(self, param)
tp%lfirst = param%lfirstkick
pl%lfirst = param%lfirstkick

call system%encounter_history%reset()

end associate
end select
end select
Expand Down

0 comments on commit 8980de8

Please sign in to comment.