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

Commit

Permalink
Undid some damage due to previous refactoring as this subroutine actu…
Browse files Browse the repository at this point in the history
…ally wants an mtiny value not Gmtiny. Fixed formatting of fragmentation interfaces
  • Loading branch information
daminton committed Aug 6, 2021
1 parent 8d5455c commit 71d1719
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 29 deletions.
24 changes: 12 additions & 12 deletions src/fragmentation/fragmentation.f90
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ module subroutine fragmentation_initialize(system, param, family, x, v, L_spin,
use, intrinsic :: ieee_exceptions
implicit none
! Arguments
class(swiftest_nbody_system), intent(inout) :: system
class(swiftest_parameters), intent(in) :: param
integer(I4B), dimension(:), intent(in) :: family
real(DP), dimension(:,:), intent(inout) :: x, v, L_spin, Ip
real(DP), dimension(:), intent(inout) :: mass, radius
integer(I4B), intent(inout) :: nfrag
real(DP), dimension(:), allocatable, intent(inout) :: m_frag, rad_frag
real(DP), dimension(:,:), allocatable, intent(inout) :: Ip_frag
real(DP), dimension(:,:), allocatable, intent(inout) :: xb_frag, vb_frag, rot_frag
logical, intent(out) :: lfailure ! Answers the question: Should this have been a merger instead?
real(DP), intent(inout) :: Qloss
class(swiftest_nbody_system), intent(inout) :: system !! Swiftest nbody system object
class(swiftest_parameters), intent(in) :: param !! Current run configuration parameters
integer(I4B), dimension(:), intent(in) :: family !! Index of bodies involved in the collision
real(DP), dimension(:,:), intent(inout) :: x, v, L_spin, Ip !! Two-body equivalent position, vector, spin momentum, and rotational inertia values for the collision
real(DP), dimension(:), intent(inout) :: mass, radius !! Two-body equivalent mass and radii for the bodies in the collision
integer(I4B), intent(inout) :: nfrag !! Number of fragments to generate
real(DP), dimension(:), allocatable, intent(inout) :: m_frag, rad_frag !! Distribution of fragment mass and radii
real(DP), dimension(:,:), allocatable, intent(inout) :: Ip_frag !! Fragment rotational inertia vectors
real(DP), dimension(:,:), allocatable, intent(inout) :: xb_frag, vb_frag, rot_frag !! Fragment barycentric position, barycentric velocity, and rotation vectors
real(DP), intent(inout) :: Qloss !! Energy lost during the collision
logical, intent(out) :: lfailure !! Answers the question: Should this have been a merger instead?
! Internals
real(DP) :: mscale, rscale, vscale, tscale, Lscale, Escale ! Scale factors that reduce quantities to O(~1) in the collisional system
real(DP) :: mtot
Expand Down Expand Up @@ -856,7 +856,7 @@ module subroutine fragmentation_regime(Mcb, m1, m2, rad1, rad2, xh1, xh2, vb1, v
! Arguments
integer(I4B), intent(out) :: regime
real(DP), intent(out) :: Mlr, Mslr
real(DP), intent(in) :: Mcb, m1, m2, rad1, rad2, den1, den2, Gmtiny
real(DP), intent(in) :: Mcb, m1, m2, rad1, rad2, den1, den2, mtiny
real(DP), dimension(:), intent(in) :: xh1, xh2, vb1, vb2
real(DP), intent(out) :: Qloss !! The residual energy after the collision
! Constants
Expand Down
34 changes: 17 additions & 17 deletions src/modules/swiftest_classes.f90
Original file line number Diff line number Diff line change
Expand Up @@ -457,26 +457,26 @@ module subroutine eucl_dist_index_plpl(self)
module subroutine fragmentation_initialize(system, param, family, x, v, L_spin, Ip, mass, radius, &
nfrag, Ip_frag, m_frag, rad_frag, xb_frag, vb_frag, rot_frag, Qloss, lfailure)
implicit none
class(swiftest_nbody_system), intent(inout) :: system
class(swiftest_parameters), intent(in) :: param
integer(I4B), dimension(:), intent(in) :: family
real(DP), dimension(:,:), intent(inout) :: x, v, L_spin, Ip
real(DP), dimension(:), intent(inout) :: mass, radius
integer(I4B), intent(inout) :: nfrag
real(DP), dimension(:), allocatable, intent(inout) :: m_frag, rad_frag
real(DP), dimension(:,:), allocatable, intent(inout) :: Ip_frag
real(DP), dimension(:,:), allocatable, intent(inout) :: xb_frag, vb_frag, rot_frag
logical, intent(out) :: lfailure ! Answers the question: Should this have been a merger instead?
real(DP), intent(inout) :: Qloss
class(swiftest_nbody_system), intent(inout) :: system !! Swiftest nbody system object
class(swiftest_parameters), intent(in) :: param !! Current run configuration parameters
integer(I4B), dimension(:), intent(in) :: family !! Index of bodies involved in the collision
real(DP), dimension(:,:), intent(inout) :: x, v, L_spin, Ip !! Two-body equivalent position, vector, spin momentum, and rotational inertia values for the collision
real(DP), dimension(:), intent(inout) :: mass, radius !! Two-body equivalent mass and radii for the bodies in the collision
integer(I4B), intent(inout) :: nfrag !! Number of fragments to generate
real(DP), dimension(:), allocatable, intent(inout) :: m_frag, rad_frag !! Distribution of fragment mass and radii
real(DP), dimension(:,:), allocatable, intent(inout) :: Ip_frag !! Fragment rotational inertia vectors
real(DP), dimension(:,:), allocatable, intent(inout) :: xb_frag, vb_frag, rot_frag !! Fragment barycentric position, barycentric velocity, and rotation vectors
real(DP), intent(inout) :: Qloss !! Energy lost during the collision
logical, intent(out) :: lfailure !! Answers the question: Should this have been a merger instead?
end subroutine fragmentation_initialize

module subroutine fragmentation_regime(Mcb, m1, m2, rad1, rad2, xh1, xh2, vb1, vb2, den1, den2, regime, Mlr, Mslr, Gmtiny, Qloss)
module subroutine fragmentation_regime(Mcb, m1, m2, rad1, rad2, xh1, xh2, vb1, vb2, den1, den2, regime, Mlr, Mslr, mtiny, Qloss)
implicit none
integer(I4B), intent(out) :: regime
real(DP), intent(out) :: Mlr, Mslr
real(DP), intent(in) :: Mcb, m1, m2, rad1, rad2, den1, den2, Gmtiny
real(DP), dimension(:), intent(in) :: xh1, xh2, vb1, vb2
real(DP), intent(out) :: Qloss !! The residual energy after the collision
integer(I4B), intent(out) :: regime
real(DP), intent(out) :: Mlr, Mslr
real(DP), intent(in) :: Mcb, m1, m2, rad1, rad2, den1, den2, mtiny
real(DP), dimension(:), intent(in) :: xh1, xh2, vb1, vb2
real(DP), intent(out) :: Qloss !! Energy lost during the collision
end subroutine fragmentation_regime

module pure subroutine gr_kick_getaccb_ns_body(self, system, param)
Expand Down

0 comments on commit 71d1719

Please sign in to comment.