Skip to content

Commit

Permalink
Fixed array bounds problem in crater_subpixel_diffusion. It wasn't ta…
Browse files Browse the repository at this point in the history
…king care of repeating boundary conditions properly.
  • Loading branch information
daminton committed Feb 28, 2017
1 parent c7ce251 commit c42cdcf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/crater/crater_subpixel_diffusion.f90
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ subroutine crater_subpixel_diffusion(user,surf,prod,nflux,domain,finterval,kdiff

end do

do j = 0,user%gridsize + 1
do i = 0,user%gridsize + 1
do j = 1,user%gridsize
do i = 1,user%gridsize
do n = 1,ntot
dburial = EXFAC * 0.5_DP * nflux(1,n)
if (surf(i,j)%ejcov > dburial) then
Expand All @@ -92,6 +92,12 @@ subroutine crater_subpixel_diffusion(user,surf,prod,nflux,domain,finterval,kdiff
end do
end do
end do
kdiff(0,0) = kdiff(user%gridsize,user%gridsize)
kdiff(user%gridsize + 1,user%gridsize + 1) = kdiff(1,1)
kdiff(0,:) = kdiff(user%gridsize,:)
kdiff(:,0) = kdiff(:,user%gridsize)
kdiff(user%gridsize + 1,:) = kdiff(1,:)
kdiff(:,user%gridsize + 1) = kdiff(:,1)

! Now add the superdomain contribution to crater degradation
!if (user%dosoftening) then
Expand Down

0 comments on commit c42cdcf

Please sign in to comment.