From fc6b94a574f4c57ab481896b2aac71cc63180db5 Mon Sep 17 00:00:00 2001 From: David A Minton Date: Fri, 11 Jun 2021 13:38:49 -0400 Subject: [PATCH] Moved impactor rotation calculation into the set_scale_factors instead of the restore_scale_factors where it was by mistake --- src/symba/symba_frag_pos.f90 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/symba/symba_frag_pos.f90 b/src/symba/symba_frag_pos.f90 index 7d6ceee4b..a1e691091 100644 --- a/src/symba/symba_frag_pos.f90 +++ b/src/symba/symba_frag_pos.f90 @@ -161,6 +161,7 @@ subroutine set_scale_factors() !! Scales dimenional quantities to ~O(1) with respect to the collisional system. This scaling makes it easier for the non-linear minimization !! to converge on a solution implicit none + integer(I4B) :: i ! Find the center of mass of the collisional system mtot = sum(mass(:)) @@ -185,6 +186,9 @@ subroutine set_scale_factors() x = x / rscale v = v / vscale L_spin = L_spin / Lscale + do i = 1, 2 + rot(:,i) = L_spin(:,i) / (mass(i) * radius(i)**2 * Ip(3, i)) + end do m_frag = m_frag / mscale rad_frag = rad_frag / rscale @@ -208,9 +212,7 @@ subroutine restore_scale_factors() x = x * rscale v = v * vscale L_spin = L_spin * Lscale - do i = 1, 2 - rot(:,i) = L_spin(:,i) / (mass(i) * radius(i)**2 * Ip(3, i)) - end do + rot = rot / tscale ! Avoid FP exceptions x_frag(:,1:nfrag) = x_frag(:,1:nfrag) * rscale