From 584649c2fb656d4ca0e15935687e5f976c0c3b9c Mon Sep 17 00:00:00 2001 From: David A Minton Date: Wed, 9 Feb 2022 13:24:55 -0500 Subject: [PATCH] Added some conditions to check for invalid landing distances and degeneracies that can occur in the ejecta distortion code on a flat surface --- src/ejecta/ejecta_emplace.f90 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ejecta/ejecta_emplace.f90 b/src/ejecta/ejecta_emplace.f90 index 68dfd2bd..b9c40d63 100644 --- a/src/ejecta/ejecta_emplace.f90 +++ b/src/ejecta/ejecta_emplace.f90 @@ -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 @@ -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