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

Commit

Permalink
Added new SyMBA-only input parameter indicating how to save encounters
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Dec 2, 2022
1 parent 61321de commit 5bcf737
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/encounter/encounter_io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module subroutine encounter_io_dump_storage_list(self, param)
class(swiftest_parameters), intent(inout) :: param !! Current run configuration parameters
end subroutine encounter_io_dump_storage_list


module subroutine encounter_io_initialize_output(self, param)
!! author: David A. Minton
!!
Expand All @@ -33,6 +34,7 @@ module subroutine encounter_io_initialize_output(self, param)
return
end subroutine encounter_io_initialize_output


module subroutine encounter_io_open_file(self, param, readonly)
!! author: David A. Minton
!!
Expand Down
1 change: 1 addition & 0 deletions src/modules/symba_classes.f90
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module symba_classes
real(DP) :: min_GMfrag = -1.0_DP !! Smallest G*mass that can be produced in a fragmentation event
integer(I4B), dimension(:), allocatable :: seed !! Random seeds
logical :: lfragmentation = .false. !! Do fragmentation modeling instead of simple merger.
character(STRMAX) :: encounter_save = "NONE" !! Indicate how encounter and/or fragmentation data should be saved
contains
procedure :: reader => symba_io_param_reader
procedure :: writer => symba_io_param_writer
Expand Down
10 changes: 10 additions & 0 deletions src/symba/symba_io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ module subroutine symba_io_param_reader(self, unit, iotype, v_list, iostat, ioms
read(param_value, *) param%GMTINY
case ("MIN_GMFRAG")
read(param_value, *) param%min_GMfrag
case ("ENCOUNTER_SAVE")
call io_toupper(param_value)
read(param_value, *) param%encounter_save
case("SEED")
read(param_value, *) nseeds_from_file
! Because the number of seeds can vary between compilers/systems, we need to make sure we can handle cases in which the input file has a different
Expand Down Expand Up @@ -113,6 +116,13 @@ module subroutine symba_io_param_reader(self, unit, iotype, v_list, iostat, ioms
! All reporting of collision information in SyMBA (including mergers) is now recorded in the Fraggle logfile
call io_log_start(param, FRAGGLE_LOG_OUT, "Fraggle logfile")

if ((param%encounter_save /= "NONE") .and. (param%encounter_save /= "ALL") .and. (param%encounter_save /= "FRAGMENTATION")) then
write(iomsg,*) 'Invalid encounter_save parameter: ',trim(adjustl(param%out_type))
write(iomsg,*) 'Valid options are NONE, ALL, or FRAGMENTATION'
iostat = -1
return
end if

! Call the base method (which also prints the contents to screen)
call io_param_reader(param, unit, iotype, v_list, iostat, iomsg)
end associate
Expand Down

0 comments on commit 5bcf737

Please sign in to comment.