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

Commit

Permalink
Fixed problem where the discard flag was not being reset by bodies so…
Browse files Browse the repository at this point in the history
…metimes after a collision, causing new bodies to get discarded.
  • Loading branch information
daminton committed Aug 31, 2021
1 parent df8b9e2 commit 565ed44
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/io/io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ module subroutine io_param_writer(self, unit, iotype, v_list, iostat, iomsg)
write(param_name, Afmt) "DU2M"; write(param_value, Rfmt) param%DU2M; write(unit, Afmt, err = 667, iomsg = iomsg) adjustl(param_name), adjustl(param_value)
write(param_name, Afmt) "RHILL_PRESENT"; write(param_value, Lfmt) param%lrhill_present; write(unit, Afmt, err = 667, iomsg = iomsg) adjustl(param_name), adjustl(param_value)
write(param_name, Afmt) "EXTRA_FORCE"; write(param_value, Lfmt) param%lextra_force; write(unit, Afmt, err = 667, iomsg = iomsg) adjustl(param_name), adjustl(param_value)
write(param_name, Afmt) "DISCARD_OUT"; write(param_value, Afmt) trim(adjustl(param%discard_out)); write(unit, Afmt, err = 667, iomsg = iomsg) adjustl(param_name), adjustl(param_value)
if (param%discard_out /= "") write(param_name, Afmt) "DISCARD_OUT"; write(param_value, Afmt) trim(adjustl(param%discard_out)); write(unit, Afmt, err = 667, iomsg = iomsg) adjustl(param_name), adjustl(param_value)
if (param%discard_out /= "") write(param_name, Afmt) "BIG_DISCARD"; write(param_value, Lfmt) param%lbig_discard; write(unit, Afmt, err = 667, iomsg = iomsg) adjustl(param_name), adjustl(param_value)
write(param_name, Afmt) "CHK_CLOSE"; write(param_value, Lfmt) param%lclose; write(unit, Afmt, err = 667, iomsg = iomsg) adjustl(param_name), adjustl(param_value)
write(param_name, Afmt) "ENERGY"; write(param_value, Lfmt) param%lenergy; write(unit, Afmt, err = 667, iomsg = iomsg) adjustl(param_name), adjustl(param_value)
Expand Down
15 changes: 5 additions & 10 deletions src/symba/symba_util.f90
Original file line number Diff line number Diff line change
Expand Up @@ -453,16 +453,11 @@ module subroutine symba_util_rearray_pl(self, system, param)
end if

! Reset all of the status flags for this body
where(pl%status(1:npl) /= INACTIVE)
pl%status(1:npl) = ACTIVE
pl%info(1:npl)%status = "ACTIVE"
pl%ldiscard(1:npl) = .false.
pl%lcollision(1:npl) = .false.
pl%lmask(1:npl) = .true.
elsewhere
pl%ldiscard(1:npl) = .true.
pl%lmask(1:npl) = .false.
end where
pl%status(1:npl) = ACTIVE
pl%info(1:npl)%status = "ACTIVE"
pl%ldiscard(1:npl) = .false.
pl%lcollision(1:npl) = .false.
pl%lmask(1:npl) = .true.

select type(param)
class is (symba_parameters)
Expand Down

0 comments on commit 565ed44

Please sign in to comment.