Skip to content

Commit

Permalink
Added some conditions to check for invalid landing distances and dege…
Browse files Browse the repository at this point in the history
…neracies that can occur in the ejecta distortion code on a flat surface
  • Loading branch information
daminton committed Feb 9, 2022
1 parent 69613dc commit 584649c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ejecta/ejecta_emplace.f90
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ subroutine ejecta_emplace(user,surf,crater,domain,ejb,ejtble,deltaMtot,age,age_r

lradsq = (crater%xl - xp)**2 + (crater%yl - yp)**2
lrad = sqrt(lradsq)
if (lrad < crater%ejrad) cycle

! Estimate ejecta pattern distortion due to target surface angle and topography
! This must be done iteratively because the ejection distance and ejection angle vary
Expand All @@ -222,6 +223,7 @@ subroutine ejecta_emplace(user,surf,crater,domain,ejb,ejtble,deltaMtot,age,age_r

baseline = ((i * crater%xslp) + (j * crater%yslp)) * user%pix
craterslope = atan(baseline / lrad)
if ((n == 1) .and. abs(craterslope) < epsilon(1._DP)) exit
if (craterslope > maxslp) maxslp = craterslope

ejheight = erad * sin(craterslope) + crater%melev
Expand Down

0 comments on commit 584649c

Please sign in to comment.