Skip to content

Commit

Permalink
Fixed error that causes ejecta to be interpolated past the array
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Feb 3, 2017
1 parent 2bce361 commit c6d3e00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ejecta/ejecta_emplace.f90
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ subroutine ejecta_emplace(user,surf,crater,domain,ejb,ejtble,deltaMtot)
! Find out where in the table this new velocity corresponds to
ind = 1
call util_search(ejb%vesq,ind,ejtble,vsq,klo)
klo = min(max(klo,1),ejtble)
klo = min(max(klo,1),ejtble-1)
! Interpolate on the table to find the flat plane equivalent landing distance for this velocity
frac = (vsq - ejb(klo)%vesq) / (ejb(klo+1)%vesq - ejb(klo)%vesq)
distance = exp(ejb(klo)%lrad) + frac * (exp(ejb(klo+1)%lrad) - exp(ejb(klo)%lrad))
Expand Down

0 comments on commit c6d3e00

Please sign in to comment.