From 2b3dd3e41ab58714507cacf027224fba77fcebef Mon Sep 17 00:00:00 2001 From: MintoDA1 <51412913+MintoDA1@users.noreply.github.com> Date: Fri, 1 Sep 2023 17:03:54 -0400 Subject: [PATCH] Fixed bad indices --- src/ejecta/ejecta_emplace.f90 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ejecta/ejecta_emplace.f90 b/src/ejecta/ejecta_emplace.f90 index fdb05563..4d8372f8 100644 --- a/src/ejecta/ejecta_emplace.f90 +++ b/src/ejecta/ejecta_emplace.f90 @@ -276,7 +276,7 @@ subroutine ejecta_emplace(user,surf,crater,domain,ejb,ejtble,deltaMtot,cumulativ if (bigej) then kdiff(xpi,ypi) = kdiff(xpi,ypi) + areafrac * diffi * kdiffmax else - kdiff(xpi,ypi) = areafrac * diffi * kdiffmax + kdiff(i,j) = areafrac * diffi * kdiffmax end if end if @@ -340,8 +340,13 @@ subroutine ejecta_emplace(user,surf,crater,domain,ejb,ejtble,deltaMtot,cumulativ lradsq = (crater%xl - xp)**2 + (crater%yl - yp)**2 lrad = sqrt(lradsq) if (lrad < crater%ejrad) cycle - - ebh = cumulative_elchange(i,j) - crater_profile(user, crater, lrad) + + if (bigej) then + ebh = cumulative_elchange(xpi,ypi) - crater_profile(user, crater, lrad) + else + ebh = cumulative_elchange(i,j) - crater_profile(user, crater, lrad) + end if + if (user%doregotrack .and. ebh>1.0e-8_DP) then call regolith_streamtube(user,surf,crater,domain,ejb,ejtble,xp,yp,xpi,ypi,lrad,ebh,rm,vsq,volm)