diff --git a/src/discard/discard.f90 b/src/discard/discard.f90 index f6e5dcf57..5c6f704e1 100644 --- a/src/discard/discard.f90 +++ b/src/discard/discard.f90 @@ -112,9 +112,9 @@ subroutine discard_cb_tp(tp, system, param) ! Internals integer(I4B) :: i real(DP) :: energy, vb2, rb2, rh2, rmin2, rmax2, rmaxu2 - character(len=STRMAX) :: idstr + character(len=STRMAX) :: idstr, timestr - associate(ntp => tp%nbody, cb => system%cb, t => param%t, Gmtot => system%Gmtot) + associate(ntp => tp%nbody, cb => system%cb, Gmtot => system%Gmtot) rmin2 = max(param%rmin * param%rmin, cb%radius * cb%radius) rmax2 = param%rmax**2 rmaxu2 = param%rmaxu**2 @@ -124,13 +124,15 @@ subroutine discard_cb_tp(tp, system, param) if ((param%rmax >= 0.0_DP) .and. (rh2 > rmax2)) then tp%status(i) = DISCARDED_RMAX write(idstr, *) tp%id(i) - write(*, *) "Particle " // trim(adjustl(idstr)) // " too far from the central body at t = ", t + write(timestr, *) param%t + write(*, *) "Particle " // trim(adjustl(idstr)) // " too far from the central body at t = " // trim(adjustl(timestr)) tp%ldiscard(i) = .true. tp%lmask(i) = .false. else if ((param%rmin >= 0.0_DP) .and. (rh2 < rmin2)) then tp%status(i) = DISCARDED_RMIN write(idstr, *) tp%id(i) - write(*, *) "Particle " // trim(adjustl(idstr)) // " too close to the central body at t = ", t + write(timestr, *) param%t + write(*, *) "Particle " // trim(adjustl(idstr)) // " too close to the central body at t = " // trim(adjustl(timestr)) tp%ldiscard(i) = .true. tp%lmask(i) = .false. else if (param%rmaxu >= 0.0_DP) then @@ -140,7 +142,8 @@ subroutine discard_cb_tp(tp, system, param) if ((energy > 0.0_DP) .and. (rb2 > rmaxu2)) then tp%status(i) = DISCARDED_RMAXU write(idstr, *) tp%id(i) - write(*, *) "Particle " // trim(adjustl(idstr)) // " is unbound and too far from barycenter at t = ", t + write(timestr, *) param%t + write(*, *) "Particle " // trim(adjustl(idstr)) // " is unbound and too far from barycenter at t = " // trim(adjustl(timestr)) tp%ldiscard(i) = .true. tp%lmask(i) = .false. end if diff --git a/src/symba/symba_discard.f90 b/src/symba/symba_discard.f90 index dfc8c615f..7f3ed3b21 100644 --- a/src/symba/symba_discard.f90 +++ b/src/symba/symba_discard.f90 @@ -20,7 +20,7 @@ subroutine symba_discard_cb_pl(pl, system, param) ! Internals integer(I4B) :: i, j real(DP) :: energy, vb2, rb2, rh2, rmin2, rmax2, rmaxu2 - character(len=STRMAX) :: idstr + character(len=STRMAX) :: idstr, timestr associate(npl => pl%nbody, cb => system%cb) call system%set_msys() @@ -35,13 +35,15 @@ subroutine symba_discard_cb_pl(pl, system, param) pl%lcollision(i) = .false. pl%status(i) = DISCARDED_RMAX write(idstr, *) pl%id(i) - write(*, *) "Massive body " // trim(adjustl(idstr)) // " too far from the central body at t = ", param%t + write(timestr, *) param%t + write(*, *) "Massive body " // trim(adjustl(idstr)) // " too far from the central body at t = " // trim(adjustl(timestr)) else if ((param%rmin >= 0.0_DP) .and. (rh2 < rmin2)) then pl%ldiscard(i) = .true. pl%lcollision(i) = .false. pl%status(i) = DISCARDED_RMIN write(idstr, *) pl%id(i) - write(*, *) "Massive body " // trim(adjustl(idstr)) // " too close to the central body at t = ", param%t + write(timestr, *) param%t + write(*, *) "Massive body " // trim(adjustl(idstr)) // " too close to the central body at t = " // trim(adjustl(timestr)) else if (param%rmaxu >= 0.0_DP) then rb2 = dot_product(pl%xb(:,i), pl%xb(:,i)) vb2 = dot_product(pl%vb(:,i), pl%vb(:,i)) @@ -51,7 +53,8 @@ subroutine symba_discard_cb_pl(pl, system, param) pl%lcollision(i) = .false. pl%status(i) = DISCARDED_RMAXU write(idstr, *) pl%id(i) - write(*, *) "Massive body " // trim(adjustl(idstr)) // " is unbound and too far from barycenter at t = ", param%t + write(timestr, *) param%t + write(*, *) "Massive body " // trim(adjustl(idstr)) // " is unbound and too far from barycenter at t = " // trim(adjustl(timestr)) end if end if end if