Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
modify regolith_streamtube
  • Loading branch information
Austin Blevins committed Jun 30, 2023
1 parent ec2b5fd commit 363f84f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/regolith/regolith_streamtube.f90
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ subroutine regolith_streamtube(user,surf,crater,domain,ejb,ejtble,xp,yp,xpi,ypi,
newlayer%distvol(:) = newlayer%distvol(:) + distvol(:)

newlayer%distvol(1+domain%rcnum) = newlayer%meltvolume - sum(newlayer%distvol(1:domain%rcnum))
if (newlayer%distvol(1+domain%rcnum) < 0.0_DP) then !pixel consists entirely of QMC melt
if (newlayer%distvol(1+domain%rcnum) < 0.0) then !pixel consists entirely of QMC melt
newlayer%distvol(1+domain%rcnum) = 0.0_SP
newlayer%age(:) = 0.0_SP
end if
Expand All @@ -358,11 +358,11 @@ subroutine regolith_streamtube(user,surf,crater,domain,ejb,ejtble,xp,yp,xpi,ypi,
end if

!conserve volume in the age array
if (sum(newlayer%age(:)) > 0.0_DP) then
if (sum(newlayer%age(:)) > 0.0) then
agefactor = newlayer%distvol(1+domain%rcnum) / sum(newlayer%age(:))
newlayer%age(:) = newlayer%age(:) * agefactor
else
newlayer%age(:) = 0.0_DP
newlayer%age(:) = 0.0_SP
end if

call util_push_array(surf(xpi,ypi)%regolayer,newlayer)
Expand Down

0 comments on commit 363f84f

Please sign in to comment.