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

Commit

Permalink
Fixed initial setting of MTINY flags
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Oct 5, 2021
1 parent 7c63d7b commit bfc7ffd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/encounter/encounter.f90
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ module pure subroutine encounter_check_one(xr, yr, zr, vxr, vyr, vzr, renc, dt,
logical, intent(out) :: lencounter !! Flag indicating that an encounter has occurred
logical, intent(out) :: lvdotr !! Logical flag indicating the direction of the v .dot. r vector
! Internals
real(DP) :: r2crit, r2min, r2, v2, vdotr
real(DP) :: r2crit, r2min, r2, v2, vdotr, tmin

r2 = xr**2 + yr**2 + zr**2
r2crit = renc**2
Expand All @@ -229,8 +229,9 @@ module pure subroutine encounter_check_one(xr, yr, zr, vxr, vyr, vzr, renc, dt,
if (.not.lvdotr) return

v2 = vxr**2 + vyr**2 + vzr**2
tmin = -vdotr / v2

if (-vdotr < v2 * dt) then
if (tmin < dt) then
r2min = r2 - vdotr**2 / v2
else
r2min = r2 + 2 * vdotr * dt + v2 * dt**2
Expand All @@ -240,4 +241,5 @@ module pure subroutine encounter_check_one(xr, yr, zr, vxr, vyr, vzr, renc, dt,
return
end subroutine encounter_check_one


end submodule s_encounter
4 changes: 4 additions & 0 deletions src/symba/symba_util.f90
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,10 @@ module subroutine symba_util_flatten_eucl_plpl(self, param)

associate(pl => self, nplpl => self%nplpl, nplplm => self%nplplm)
npl = int(self%nbody, kind=I8B)
select type(param)
class is (symba_parameters)
pl%lmtiny(1:npl) = pl%Gmass(1:npl) < param%GMTINY
end select
nplm = count(.not. pl%lmtiny(1:npl))
pl%nplm = int(nplm, kind=I4B)
nplpl = (npl * (npl - 1) / 2) ! number of entries in a strict lower triangle, npl x npl, minus first column
Expand Down

0 comments on commit bfc7ffd

Please sign in to comment.