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

Commit

Permalink
Added naming of new bodies and setting of particle types in fragmenta…
Browse files Browse the repository at this point in the history
…tions.
  • Loading branch information
daminton committed Aug 28, 2021
1 parent 00b40c5 commit 179709c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/modules/symba_classes.f90
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module symba_classes
character(*), parameter :: ORIGIN_VHX_VARNAME = "origin_vhx"
character(*), parameter :: ORIGIN_VHY_VARNAME = "origin_vhy"
character(*), parameter :: ORIGIN_VHZ_VARNAME = "origin_vhz"
character(*), parameter :: PL_TINY_TYPE_NAME = "Semi-Interacting Massive Body"

type, extends(netcdf_parameters) :: symba_netcdf_parameters
integer(I4B) :: origin_type_varid !! NetCDF ID for the origin type
Expand Down
4 changes: 4 additions & 0 deletions src/symba/symba_collision.f90
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,7 @@ subroutine symba_collision_mergeaddsub(system, param, family, id_frag, Ip_frag,
integer(I4B) :: i, ibiggest, nstart, nend, nfamily, nfrag
logical, dimension(system%pl%nbody) :: lmask
class(symba_pl), allocatable :: plnew
character(*), parameter :: FRAGFMT = '("Fragment",I0.7)'

select type(pl => system%pl)
class is (symba_pl)
Expand Down Expand Up @@ -884,6 +885,7 @@ subroutine symba_collision_mergeaddsub(system, param, family, id_frag, Ip_frag,
plnew%status(1:nfrag) = NEW_PARTICLE
info(1:nfrag)%origin_time = param%t
do i = 1, nfrag
write(info(i)%name, FRAGFMT) id_frag(i)
info(i)%origin_xh(:) = plnew%xh(:,i)
info(i)%origin_vh(:) = plnew%vh(:,i)
end do
Expand All @@ -892,6 +894,7 @@ subroutine symba_collision_mergeaddsub(system, param, family, id_frag, Ip_frag,
plnew%status(1:nfrag) = NEW_PARTICLE
info(1:nfrag)%origin_time = param%t
do i = 1, nfrag
write(info(i)%name, FRAGFMT) id_frag(i)
info(i)%origin_xh(:) = plnew%xh(:,i)
info(i)%origin_vh(:) = plnew%vh(:,i)
end do
Expand All @@ -907,6 +910,7 @@ subroutine symba_collision_mergeaddsub(system, param, family, id_frag, Ip_frag,
info(2:nfrag)%origin_type = "Hit and run fragment"
info(2:nfrag)%origin_time = param%t
do i = 2, nfrag
write(info(i)%name, FRAGFMT) id_frag(i)
info(i)%origin_xh(:) = plnew%xh(:,i)
info(i)%origin_vh(:) = plnew%vh(:,i)
end do
Expand Down
5 changes: 5 additions & 0 deletions src/symba/symba_util.f90
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,11 @@ module subroutine symba_util_index_eucl_plpl(self, param)
select type(param)
class is (symba_parameters)
pl%lmtiny(1:npl) = pl%Gmass(1:npl) < param%GMTINY
where(pl%lmtiny(1:npl))
pl%info(1:npl)%particle_type = PL_TINY_TYPE_NAME
elsewhere
pl%info(1:npl)%particle_type = PL_TYPE_NAME
end where
end select
nplm = count(.not. pl%lmtiny(1:npl))
pl%nplm = int(nplm, kind=I4B)
Expand Down

0 comments on commit 179709c

Please sign in to comment.