Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Oct 2, 2019
2 parents 26ecb7e + 3740b60 commit 2d2e7c5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
9 changes: 6 additions & 3 deletions src/crater/crater_emplace.f90
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ subroutine crater_emplace(user,surf,crater,domain,deltaMtot)
real(DP),intent(out) :: deltaMtot

! Internal variables
real(DP) :: lradsq,newelev
real(DP) :: lradsq,newelev, x_relative, y_relative
integer(I4B) :: xpi,ypi,i,j,inc,incsq,iradsq
real(DP) :: xp,yp,fradsq,deltaMi,rimheight
logical :: lastloop
Expand Down Expand Up @@ -94,10 +94,13 @@ subroutine crater_emplace(user,surf,crater,domain,deltaMtot)

! periodic boundary conditions
call util_periodic(xpi,ypi,user%gridsize)
lradsq = (crater%xl - xp)**2 + (crater%yl - yp)**2
x_relative = (crater%xl - xp)
y_relative = (crater%yl - yp)

lradsq = x_relative**2 + y_relative**2

if (lradsq > crater%frad**2) cycle
call crater_form_interior(user,surf(xpi,ypi),crater,lradsq,newelev,deltaMi)
call crater_form_interior(user,surf(xpi,ypi),crater,x_relative, y_relative,newelev,deltaMi)
deltaMtot = deltaMtot + deltaMi

! do porosity computation if (user%doporosity)
Expand Down
6 changes: 3 additions & 3 deletions src/crater/crater_form_interior.f90
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
! Notes :
!
!**********************************************************************************************************************************
subroutine crater_form_interior(user,surfi,crater,lradsq,newelev,deltaMi)
subroutine crater_form_interior(user,surfi,crater,x_relative, y_relative ,newelev,deltaMi)
use module_globals
use module_util
use module_crater, EXCEPT_THIS_ONE => crater_form_interior
Expand All @@ -28,7 +28,7 @@ subroutine crater_form_interior(user,surfi,crater,lradsq,newelev,deltaMi)
type(usertype),intent(in) :: user
type(surftype),intent(inout) :: surfi
type(cratertype),intent(in) :: crater
real(DP),intent(in) :: lradsq
real(DP),intent(in) :: x_relative, y_relative
real(DP),intent(in) :: newelev
real(DP),intent(out) :: deltaMi

Expand All @@ -42,7 +42,7 @@ subroutine crater_form_interior(user,surfi,crater,lradsq,newelev,deltaMi)
! Executable code

!change digital elevation map
r = sqrt(lradsq) / crater%frad
r = sqrt(x_relative**2+y_relative**2) / crater%frad
! Use empirical crater form from Fassett et al. 2014
if (r < 0.2_DP) then
cform = -0.181_DP * crater%fcrat
Expand Down
4 changes: 2 additions & 2 deletions src/crater/module_crater.f90
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ end subroutine crater_emplace
end interface

interface
subroutine crater_form_interior(user,surfi,crater,lradsq,newelev,deltaMi)
subroutine crater_form_interior(user,surfi,crater,x_relative, y_relative, newelev,deltaMi)
use module_globals
implicit none
type(usertype),intent(in) :: user
type(surftype),intent(inout) :: surfi
type(cratertype),intent(in) :: crater
real(DP),intent(in) :: lradsq
real(DP),intent(in) :: x_relative, y_relative
real(DP),intent(in) :: newelev
real(DP),intent(out) :: deltaMi
end subroutine crater_form_interior
Expand Down

0 comments on commit 2d2e7c5

Please sign in to comment.