Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
commented out 'recyratio' in meltdist calculations; seems to make melt fractions more reasonable
  • Loading branch information
Austin Blevins committed Feb 22, 2023
1 parent 3c04ce4 commit 6387f8d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 23 deletions.
12 changes: 6 additions & 6 deletions src/regolith/regolith_streamtube_head.f90
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ subroutine regolith_streamtube_head(user,surfi,deltar,totmare,tots,age_collector
totmare = totmare + vsgly * current(M)%comp
recyratio = vsgly / (user%pix**2) /current(M)%thickness
age_collector(:) = age_collector(:) + current(M)%age(:) * recyratio
headmeltvol = current(M)%meltfrac * recyratio * vsgly
headmeltvol = current(M)%meltfrac * vsgly ! * recyratio
meltinejecta = meltinejecta + headmeltvol
distvol(:) = distvol + (current(M)%meltdist(:)*recyratio*vsgly)
distvol(:) = distvol + (current(M)%meltdist(:)*vsgly) !*recyratio)
totvol = totvol + vsgly
else ! head is not intersected with layers.

Expand All @@ -81,9 +81,9 @@ subroutine regolith_streamtube_head(user,surfi,deltar,totmare,tots,age_collector
totmarehead = totmarehead + vhead * vratio * current(N)%comp
recyratio = vhead * vratio / (user%pix**2) / current(N)%thickness
age_collector(:) = age_collector(:) + current(N)%age(:) * recyratio
headmeltvol = current(N)%meltfrac * recyratio * tothead
headmeltvol = current(N)%meltfrac * tothead !* recyratio
meltinejecta = meltinejecta + headmeltvol
distvol(:) = distvol + (current(N)%meltdist(:)*recyratio*tothead)
distvol(:) = distvol + (current(N)%meltdist(:)*tothead) !*recyratio)
totvol = totvol + tothead
!current => current%next
!N = N - 1
Expand All @@ -95,9 +95,9 @@ subroutine regolith_streamtube_head(user,surfi,deltar,totmare,tots,age_collector
tothead = vsgly
recyratio = (vsgly - tothead) / (user%pix**2) / current(N)%thickness
age_collector(:) = age_collector(:) + current(N)%age(:) * recyratio
headmeltvol = current(N)%meltfrac * recyratio * tothead
headmeltvol = current(N)%meltfrac * tothead !*recyratio)
meltinejecta = meltinejecta + headmeltvol
distvol(:) = distvol + (current(N)%meltdist(:)*recyratio*tothead)
distvol(:) = distvol + (current(N)%meltdist(:)*tothead) !*recyratio)
totvol = totvol + tothead
exit
end if
Expand Down
20 changes: 10 additions & 10 deletions src/regolith/regolith_streamtube_lineseg.f90
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,19 @@ subroutine regolith_streamtube_lineseg(user,surfi,thetast,ri,rip1,zmin,zmax,erad
recyratio = max(ebh_recyl,0.0_DP) / current(N-1)%thickness
age_collector(:) = age_collector(:) + current(N-1)%age(:) * recyratio
vol = vol + sum(current(N-1)%age(:)) * recyratio
linmelt = current(N-1)%meltfrac * vsgly * recyratio
linmelt = current(N-1)%meltfrac * vsgly! * recyratio
meltinejecta = meltinejecta + linmelt
distvol(:) = distvol(:) + (current(N-1)%meltdist(:)*vsgly*recyratio)
distvol(:) = distvol(:) + (current(N-1)%meltdist(:)*vsgly)!*recyratio)
totvol = totvol + vsgly
else if (ri <= xmints .and. rip1 > xmints) then
vseg = regolith_streamtube_volume_func(eradi,xmints,rip1,deltar)
vsh = regolith_shock_damage(eradi,deltar,xmints,xsfints,ri,rip1)
recyratio = max((vseg-vsh),0.0_DP) / (user%pix**2) / current(N-1)%thickness
age_collector(:) = age_collector(:) + current(N-1)%age(:) * recyratio
vol = vol + sum(current(N-1)%age(:)) * recyratio
linmelt = current(N-1)%meltfrac * vseg * recyratio
linmelt = current(N-1)%meltfrac * vseg! * recyratio
meltinejecta = meltinejecta + linmelt
distvol(:) = distvol(:) + (current(N-1)%meltdist(:)*vseg*recyratio)
distvol(:) = distvol(:) + (current(N-1)%meltdist(:)*vseg)!*recyratio)
totvol = totvol + vseg
end if
exit
Expand Down Expand Up @@ -124,9 +124,9 @@ subroutine regolith_streamtube_lineseg(user,surfi,thetast,ri,rip1,zmin,zmax,erad
recyratio = max((vseg-vsh),0.0_DP) / (user%pix**2) / current(N)%thickness
age_collector(:) = age_collector(:) + current(N)%age(:) * recyratio
vol = vol + sum(current(N)%age(:)) * recyratio
linmelt = current(N)%meltfrac * vseg * recyratio
linmelt = current(N)%meltfrac * vseg! * recyratio
meltinejecta = meltinejecta + linmelt
distvol(:) = distvol(:) + (current(N)%meltdist(:)*vseg*recyratio)
distvol(:) = distvol(:) + (current(N)%meltdist(:)*vseg)!*recyratio)
totvol = totvol + vseg
end if

Expand All @@ -137,9 +137,9 @@ subroutine regolith_streamtube_lineseg(user,surfi,thetast,ri,rip1,zmin,zmax,erad
recyratio = max((vseg-vsh),0.0_DP) / (user%pix**2) / current(N)%thickness
age_collector(:) = age_collector(:) + current(N)%age(:) * recyratio
vol = vol + sum(current(N)%age(:)) * recyratio
linmelt = current(N)%meltfrac * vseg * recyratio
linmelt = current(N)%meltfrac * vseg! * recyratio
meltinejecta = meltinejecta + linmelt
distvol(:) = distvol(:) + (current(N)%meltdist(:)*vseg*recyratio)
distvol(:) = distvol(:) + (current(N)%meltdist(:)*vseg)!*recyratio)
totvol = totvol + vseg
end if
!current => current%next
Expand All @@ -162,9 +162,9 @@ subroutine regolith_streamtube_lineseg(user,surfi,thetast,ri,rip1,zmin,zmax,erad
recyratio = max((vseg-vsh),0.0_DP) / (user%pix**2) / current(N)%thickness
age_collector(:) = age_collector(:) + current(N)%age(:) * recyratio
vol = vol + sum(current(N)%age(:)) * recyratio
linmelt = current(N)%meltfrac * vseg * recyratio
linmelt = current(N)%meltfrac * vseg! * recyratio
meltinejecta = meltinejecta + linmelt
distvol(:) = distvol(:) + (current(N)%meltdist(:)*vseg*recyratio)
distvol(:) = distvol(:) + (current(N)%meltdist(:)*vseg)!*recyratio)
totvol = totvol + vseg
end if

Expand Down
11 changes: 6 additions & 5 deletions src/regolith/regolith_subpixel_streamtube.f90
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ subroutine regolith_subpixel_streamtube(user,surfi,deltar,ri,rip1,eradi,newlayer
vseg = regolith_streamtube_volume_func(eradi,xmints,eradi,deltar)
vsh = regolith_shock_damage(eradi,deltar,xmints,xsfints,0.0_DP,eradi)
recyratio = max(vseg-vsh,0.0 )/ (user%pix**2) / (surfi%regolayer(M)%thickness)
meltinejecta = surfi%regolayer(M)%meltfrac * vseg * recyratio
distvol = distvol + (surfi%regolayer(M)%meltdist(:)*vseg*recyratio)
meltinejecta = surfi%regolayer(M)%meltfrac * vseg! * recyratio
distvol = distvol + (surfi%regolayer(M)%meltdist(:)*vseg)!*recyratio)
totvol = vseg
age_collector(:) = age_collector(:) + surfi%regolayer(M)%age(:) * recyratio
vol = vol + sum(age_collector(:))
Expand Down Expand Up @@ -191,7 +191,7 @@ subroutine regolith_subpixel_streamtube(user,surfi,deltar,ri,rip1,eradi,newlayer
recyratio = max((vsgly2 -vsh),0.0)/ (user%pix**2) / current(N)%thickness
age_collector(:) = age_collector(:) + current(N)%age(:) * recyratio
vol = vol + sum(current(N)%age(:)) * recyratio
mvr = vsgly2 * current(N)%meltfrac * recyratio
mvr = vsgly2 * current(N)%meltfrac! * recyratio
recyratio2 = recyratio
end if

Expand All @@ -200,12 +200,13 @@ subroutine regolith_subpixel_streamtube(user,surfi,deltar,ri,rip1,eradi,newlayer
recyratio = max((vsgly1-vsh),0.0) / (user%pix**2) / current(N)%thickness
age_collector(:) = age_collector(:) + current(N)%age(:) * recyratio
vol = vol + sum(current(N)%age(:)) * recyratio
mvl = vsgly1 * current(N)%meltfrac * recyratio
mvl = vsgly1 * current(N)%meltfrac! * recyratio
end if

!current => current%next
meltinejecta = meltinejecta + mvl + mvr
distvol = distvol + (current(N)%meltdist(:)*((vsgly1*recyratio)+(vsgly2*recyratio2)))
!distvol = distvol + (current(N)%meltdist(:)*((vsgly1*recyratio)+(vsgly2*recyratio2)))
distvol = distvol + (current(N)%meltdist(:)*(vsgly1+vsgly2))
totvol = totvol + vsgly1 + vsgly2
!N = N - 1
z = z + current(N-1)%thickness
Expand Down
4 changes: 2 additions & 2 deletions src/regolith/regolith_traverse_streamtube.f90
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ subroutine regolith_traverse_streamtube(user,surfi,deltar,ri,rip1,eradi,erado,ne
vsh = regolith_shock_damage(eradi,deltar,xmints,xsfints,ri,rip1)
recyratio = max(vseg-vsh,0.0_DP) / (user%pix**2) / surfi%regolayer(N)%thickness
age_collector(:) = age_collector(:) + surfi%regolayer(N)%age(:) * recyratio
meltinejecta = meltinejecta + surfi%regolayer(N)%meltfrac * vseg * recyratio
distvol(:) = distvol(:) + (surfi%regolayer(N)%meltdist(:)*vseg*recyratio)
meltinejecta = meltinejecta + surfi%regolayer(N)%meltfrac * vseg! * recyratio
distvol(:) = distvol(:) + (surfi%regolayer(N)%meltdist(:)*vseg)!*recyratio)
totvol = totvol + vseg
end if

Expand Down

0 comments on commit 6387f8d

Please sign in to comment.