diff --git a/src/modules/swiftest_globals.f90 b/src/modules/swiftest_globals.f90 index bf070e162..cbe626e43 100644 --- a/src/modules/swiftest_globals.f90 +++ b/src/modules/swiftest_globals.f90 @@ -41,7 +41,7 @@ module swiftest_globals integer(I4B), parameter :: SYMBA = 8 integer(I4B), parameter :: RINGMOONS = 9 - integer(I4B), parameter :: STRMAX = 128 !! Maximum size of character strings + integer(I4B), parameter :: STRMAX = 512 !! Maximum size of character strings character(*), parameter :: ASCII_TYPE = 'ASCII' !! Symbolic name for ASCII file type character(*), parameter :: REAL4_TYPE = 'REAL4' !! Symbolic name for binary file type REAL4 diff --git a/src/symba/symba_collision.f90 b/src/symba/symba_collision.f90 index 24c0e3a0c..2fb99ccee 100644 --- a/src/symba/symba_collision.f90 +++ b/src/symba/symba_collision.f90 @@ -830,11 +830,10 @@ subroutine symba_collision_mergeaddsub(system, param, family, id_frag, Ip_frag, allocate(plnew, mold=pl) call plnew%setup(nfrag, param) ibiggest = maxloc(pl%Gmass(family(:)), dim=1) - + + ! Copy over identification, information, and physical properties of the new bodies from the fragment list plnew%id(:) = id_frag(:) system%maxid = system%maxid + nfrag - plnew%lcollision(:) = .false. - plnew%ldiscard(:) = .false. plnew%xb(:,:) = xb_frag(:, :) plnew%vb(:,:) = vb_frag(:, :) do i = 1, nfrag @@ -888,9 +887,14 @@ subroutine symba_collision_mergeaddsub(system, param, family, id_frag, Ip_frag, plnew%k2 = pl%k2(ibiggest) plnew%tlag = pl%tlag(ibiggest) end if - + call plnew%set_mu(cb) - pl%lmtiny(:) = pl%Gmass(:) > param%GMTINY + !Copy over or set integration parameters for new bodies + plnew%lcollision(:) = .false. + plnew%ldiscard(:) = .false. + plnew%lmtiny(:) = plnew%Gmass(:) > param%GMTINY + plnew%levelg(:) = pl%levelg(ibiggest) + plnew%levelm(:) = pl%levelm(ibiggest) ! Append the new merged body to the list and record how many we made nstart = pl_adds%nbody + 1 diff --git a/src/symba/symba_discard.f90 b/src/symba/symba_discard.f90 index 486efcc2c..c35a1565c 100644 --- a/src/symba/symba_discard.f90 +++ b/src/symba/symba_discard.f90 @@ -307,6 +307,8 @@ module subroutine symba_discard_pl(self, system, param) else call plplcollision_list%resolve_mergers(system, param) end if + ! Destroy the collision list now that the collisions are resolved + call plplcollision_list%setup(0) end if if (any(pl%ldiscard(:))) then diff --git a/src/symba/symba_step.f90 b/src/symba/symba_step.f90 index 2e43946cb..69d7e2cbd 100644 --- a/src/symba/symba_step.f90 +++ b/src/symba/symba_step.f90 @@ -212,8 +212,8 @@ module recursive subroutine symba_step_recur_system(self, param, t, ireci) lplpl_collision = plplenc_list%collision_check(system, param, t+dtl, dtl, ireci) lpltp_collision = pltpenc_list%collision_check(system, param, t+dtl, dtl, ireci) - ! if (lplpl_collision) call pl%discard(system, param) - ! if (lpltp_collision) call tp%discard(system, param) + if (lplpl_collision) call pl%discard(system, param) + if (lpltp_collision) call tp%discard(system, param) end if call self%set_recur_levels(ireci)