Skip to content

Commit

Permalink
Changed crater emplace algorithm to better conserve mass
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Jan 21, 2017
1 parent 22a7962 commit 1ce5824
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/crater/crater_form_exterior_rootfind.f90
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ subroutine crater_form_exterior_rootfind(user,surf,crater,domain,deltaMtot)

! Executable code
if (abs(deltaMtot) < VSMALL) return
if (deltaMtot > 0._DP) return
if (deltaMtot > 0._DP) then
write(*,*) 'Too much mass already! Skipping exterior raised rim.',crater%fcratpx
return
end if
lastloop = .false.
factor = FIRSTFACTOR
startrd = RIMDROP
Expand Down Expand Up @@ -108,7 +111,7 @@ subroutine crater_form_exterior_rootfind(user,surf,crater,domain,deltaMtot)
end if
Tol1 = 2 * FPP * abs(BB) + 0.5_DP * Tolerance
xm = 0.5_DP * (CC-BB)
if ((abs(xm) <= Tol1).or.(abs(FA) < nearzero)) then
if ((abs(xm) <= Tol1).or.(abs(FB) < nearzero)) then
! A root has been found
rd = BB
lastloop = .true.
Expand Down Expand Up @@ -155,7 +158,7 @@ subroutine crater_form_exterior_rootfind(user,surf,crater,domain,deltaMtot)
end do
if (i >= maxIterations) error = -2
end if
!write(*,'(I4,4F19.12)') niter,rd,RIMDROP
!write(*,'(I4,4F19.12)') niter,rd,RIMDROP,deltaMp
!read(*,*)
return

Expand Down

0 comments on commit 1ce5824

Please sign in to comment.