Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Removed redundant target attributes and moved it to the main one. Fixed some mismatches due to refactored variable name
  • Loading branch information
daminton committed Jul 23, 2021
1 parent 5abbc6b commit dc4dcce
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
4 changes: 1 addition & 3 deletions src/crater/crater_populate.f90
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ subroutine crater_populate(user,surf,crater,domain,prod,production_list,vdist,nt

! Arguments
type(usertype),intent(inout) :: user
type(surftype),dimension(:,:),intent(inout) :: surf
type(surftype),dimension(:,:),target,intent(inout) :: surf
type(cratertype),intent(inout) :: crater
type(domaintype),intent(inout) :: domain
real(DP),dimension(:,:),intent(in) :: prod,vdist
Expand All @@ -46,7 +46,6 @@ subroutine crater_populate(user,surf,crater,domain,prod,production_list,vdist,nt
integer(I8B),intent(in) :: ntotcrat ! Total number of attempted impacts
real(DP),intent(in) :: curyear
real(DP),dimension(:,:), intent(in) :: rclist !array of 'real' craters for quasiMC
target :: surf

! Internal variables
real(DP) :: cmin ! Minimum crater diameter (m)
Expand Down Expand Up @@ -76,7 +75,6 @@ subroutine crater_populate(user,surf,crater,domain,prod,production_list,vdist,nt
real(DP) :: ejbmass
logical :: makecrater
real(DP),dimension(user%gridsize,user%gridsize) :: kdiff
TARGET :: surf
integer(I4B) :: oldpbarpos

! ejecta blanket array
Expand Down
15 changes: 8 additions & 7 deletions src/crater/crater_superdomain.f90
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ subroutine crater_superdomain(user,surf,age,age_resolution,prod,nflux,domain,fin
real(DP),dimension(2) :: rn
real(DP) :: superlen,rayfrac
type(cratertype) :: crater
real(DP),dimension(:,:),allocatable :: ejdistribution
real(DP),dimension(:,:),allocatable :: ejdistribution, diffdistribution
integer(I4B),dimension(:,:),allocatable :: ejisray

! Melt or glassy ray test
Expand Down Expand Up @@ -73,8 +73,8 @@ subroutine crater_superdomain(user,surf,age,age_resolution,prod,nflux,domain,fin
avgejc = sum(surf%ejcov) / user%gridsize**2
maxgcrat = 0.0_DP
do l = 1,domain%pnum
if ((PI * (user%soften_size * nflux(1,l) * 0.5_DP)**2 <= (user%gridsize)**2 ).and.&
(PI * (user%soften_size * nflux(2,l) * 0.5_DP)**2 <= (user%gridsize)**2 )) cycle
if ((PI * (user%fe * nflux(1,l) * 0.5_DP)**2 <= (user%gridsize)**2 ).and.&
(PI * (user%fe * nflux(2,l) * 0.5_DP)**2 <= (user%gridsize)**2 )) cycle

dburial = EXFAC * 0.5_DP * nflux(1,n)
if (avgejc > dburial) then
Expand All @@ -84,7 +84,7 @@ subroutine crater_superdomain(user,surf,age,age_resolution,prod,nflux,domain,fin
end if

dN(l) = nflux(3,l) * user%interval * finterval
Area = min(PI * (user%soften_size * radius)**2 , 4 * PI * user%trad**2)
Area = min(PI * (user%fe * radius)**2 , 4 * PI * user%trad**2)
Area = max(Area - (user%pix * user%gridsize)**2,0.0_DP)
if (Area == 0.0_DP) cycle
! Center at the local domain, and calculate the maximum distance from the super
Expand All @@ -109,7 +109,7 @@ subroutine crater_superdomain(user,surf,age,age_resolution,prod,nflux,domain,fin
! find the x and y position of the crater
! When a superdomain crater's center is at the edge of a space that
! superlen defines, it has least ejecta delivering to the local domain.
! Soften_size should be the maximum ray extennt (beyond visible rays)
! fe should be the maximum ray extennt (beyond visible rays)
! to account for cold and hot ejecta.
! Note for age data: new stream lines overlapped with melts needs to
! calculate here, and one can check out regolith_streamtube: lines 251 - 292.
Expand Down Expand Up @@ -147,9 +147,10 @@ subroutine crater_superdomain(user,surf,age,age_resolution,prod,nflux,domain,fin
if (lrad > crater%ejdis) cycle

allocate(ejdistribution(xi:xf,yi:yf))
allocate(diffdistribution(xi:xf,yi:yf))
allocate(ejisray(xi:xf,yi:yf))
! Now generate ray pattern
call ejecta_ray_pattern(user,surf,crater,inc,xi,xf,yi,yf,ejdistribution)
call ejecta_ray_pattern(user,surf,crater,inc,xi,xf,yi,yf,diffdistribution,ejdistribution)
! Now if doregotrack is on, do melt zone calculation
if (user%doregotrack) call regolith_melt_zone_superdomain(user,crater,domain,rm,depthb)

Expand Down Expand Up @@ -178,7 +179,7 @@ subroutine crater_superdomain(user,surf,age,age_resolution,prod,nflux,domain,fin

end if

deallocate(ejdistribution,ejisray)
deallocate(ejdistribution,diffdistribution,ejisray)

end do

Expand Down
3 changes: 1 addition & 2 deletions src/crater/module_crater.f90
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ subroutine crater_populate(user,surf,crater,domain,prod,production_list,vdist,nt
use module_globals
implicit none
type(usertype),intent(inout) :: user
type(surftype),dimension(:,:),intent(inout) :: surf
type(surftype),dimension(:,:),intent(inout),target :: surf
type(cratertype),intent(inout) :: crater
type(domaintype),intent(inout) :: domain
real(DP),dimension(:,:),intent(in) :: prod,vdist
Expand All @@ -49,7 +49,6 @@ subroutine crater_populate(user,surf,crater,domain,prod,production_list,vdist,nt
integer(I8B),intent(in) :: ntotcrat ! Total number of attempted impacts
real(DP),intent(in) :: curyear
real(DP),dimension(:,:), intent(in) :: rclist !array of 'real' craters for quasiMC
target :: surf
end subroutine crater_populate
end interface

Expand Down

0 comments on commit dc4dcce

Please sign in to comment.