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

Commit

Permalink
Rearranged budget checks so that the L and ke budgets are not alteree…
Browse files Browse the repository at this point in the history
…d during computation
  • Loading branch information
daminton committed Aug 16, 2021
1 parent 03a1e1f commit 282a85a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/fragmentation/fragmentation.f90
Original file line number Diff line number Diff line change
Expand Up @@ -748,14 +748,13 @@ subroutine set_fragment_tan_vel(lerr)
end do
ke_frag_orbit = 0.5_DP * sum(kefrag(:))
ke_radial = ke_frag_budget - ke_frag_spin - ke_frag_orbit
call calculate_fragment_ang_mtm()
L_frag_budget(:) = L_frag_budget(:) - L_frag_orb(:)

! If we are over the energy budget, flag this as a failure so we can try again
lerr = (ke_radial < 0.0_DP)
write(*,*) 'Tangential'
write(*,*) 'Failure? ',lerr
write(*,*) '|L_remainder| : ',.mag.L_frag_budget(:) / Lmag_before
call calculate_fragment_ang_mtm()
write(*,*) '|L_remainder| : ',.mag.(L_frag_budget(:) - L_frag_tot(:)) / Lmag_before
write(*,*) 'ke_frag_budget: ',ke_frag_budget
write(*,*) 'ke_frag_spin : ',ke_frag_spin
write(*,*) 'ke_tangential : ',ke_frag_orbit
Expand Down

0 comments on commit 282a85a

Please sign in to comment.