Skip to content

Commit

Permalink
Added condition to ejecta_interpolate to not interpolate if the eject…
Browse files Browse the repository at this point in the history
…a table is only 1 element in size
  • Loading branch information
daminton committed Feb 17, 2022
1 parent e351d77 commit f4ef3e9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ejecta/ejecta_interpolate.f90
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,13 @@ subroutine ejecta_interpolate(crater,domain,lrad,ejb,ejtble,ebh,vsq,theta,erad,m
logtablerad = ejb(k)%lrad

! Interpolate in logspace (this saves on the number of table elements we need)
if (k == ejtble) then
if (ejtble == 1) then
ebh = ejb(k)%thick
if (present(vsq)) vsq = ejb(k)%vesq
if (present(theta)) theta= ejb(k)%angle
if (present(melt)) melt = ejb(k)%meltfrac
if (present(erad)) erad = ejb(k)%erad
else if (k == ejtble) then
logdelta = logtablerad - ejb(k - 1)%lrad
frac = (loglrad - logtablerad) / logdelta
ebh = ejb(k)%thick - ((ejb(k)%thick - LOGVSMALL) * frac)
Expand Down

0 comments on commit f4ef3e9

Please sign in to comment.