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

Commit

Permalink
Fixed issues that were causing fragmentation velocities to go haywire…
Browse files Browse the repository at this point in the history
… when compiler optimizations were turned on
  • Loading branch information
daminton committed Jan 3, 2023
1 parent af54785 commit 95868fb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,18 @@ SET(STRICT_MATH_FILES
${SRC}/symba/symba_kick.f90
${SRC}/whm/whm_kick.f90
${SRC}/swiftest/swiftest_user.f90
${SRC}/fraggle/fraggle_generate.f90
${SRC}/fraggle/fraggle_util.f90
${SRC}/fraggle/fraggle_module.f90
${SRC}/misc/lambda_function_module.f90
${SRC}/misc/solver_module.f90
)

SET(FAST_MATH_FILES
${SRC}/globals/globals_module.f90
${SRC}/base/base_module.f90
${SRC}/netcdf_io/netcdf_io_module.f90
${SRC}/misc/lambda_function_module.f90
${SRC}/misc/io_progress_bar_module.f90
${SRC}/misc/solver_module.f90
${SRC}/encounter/encounter_module.f90
${SRC}/collision/collision_module.f90
${SRC}/operator/operator_module.f90
Expand All @@ -37,7 +40,6 @@ SET(FAST_MATH_FILES
${SRC}/rmvs/rmvs_module.f90
${SRC}/helio/helio_module.f90
${SRC}/symba/symba_module.f90
${SRC}/fraggle/fraggle_module.f90
${SRC}/collision/collision_check.f90
${SRC}/collision/collision_generate.f90
${SRC}/collision/collision_io.f90
Expand All @@ -47,8 +49,6 @@ SET(FAST_MATH_FILES
${SRC}/encounter/encounter_check.f90
${SRC}/encounter/encounter_io.f90
${SRC}/encounter/encounter_util.f90
${SRC}/fraggle/fraggle_generate.f90
${SRC}/fraggle/fraggle_util.f90
${SRC}/helio/helio_drift.f90
${SRC}/helio/helio_gr.f90
${SRC}/helio/helio_step.f90
Expand Down
3 changes: 2 additions & 1 deletion src/fraggle/fraggle_generate.f90
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ module subroutine fraggle_generate(self, nbody_system, param, t)
call self%set_mass_dist(param)
call self%disrupt(nbody_system, param, t)


associate (fragments => self%fragments)
! Populate the list of new bodies
nfrag = fragments%nbody
Expand Down Expand Up @@ -96,6 +95,7 @@ module subroutine fraggle_generate_disrupt(self, nbody_system, param, t, lfailur
logical :: lk_plpl, lfailure_local
logical, dimension(size(IEEE_ALL)) :: fpe_halting_modes, fpe_quiet_modes
real(DP) :: dE, dL
integer(I4B) :: i
character(len=STRMAX) :: message
real(DP), parameter :: fail_scale_initial = 1.001_DP

Expand Down Expand Up @@ -135,6 +135,7 @@ module subroutine fraggle_generate_disrupt(self, nbody_system, param, t, lfailur
call fraggle_generate_vel_vec(self,lfailure_local)
call self%get_energy_and_momentum(nbody_system, param, lbefore=.false.)
call self%set_original_scale()

dE = self%Etot(2) - self%Etot(1)
dL = .mag.(self%Ltot(:,2) - self%Ltot(:,1))

Expand Down
7 changes: 2 additions & 5 deletions src/fraggle/fraggle_util.f90
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,8 @@ module subroutine fraggle_util_set_original_scale_factors(self)
fragments%rot(:,:) = fragments%rot(:,:) / collider%tscale
fragments%rc(:,:) = fragments%rc(:,:) * collider%dscale
fragments%vc(:,:) = fragments%vc(:,:) * collider%vscale

do i = 1, fragments%nbody
fragments%rb(:, i) = fragments%rc(:, i) + impactors%rbcom(:)
fragments%vb(:, i) = fragments%vc(:, i) + impactors%vbcom(:)
end do
fragments%rb(:,:) = fragments%rb(:,:) * collider%dscale
fragments%vc(:,:) = fragments%vb(:,:) * collider%vscale

impactors%Qloss = impactors%Qloss * collider%Escale

Expand Down

0 comments on commit 95868fb

Please sign in to comment.