Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
melt distribution file generated but with wrong numbers
  • Loading branch information
Austin Blevins committed Dec 13, 2022
1 parent 593a20c commit 9830f7d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/regolith/module_regolith.f90
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,11 @@ end subroutine regolith_subcrater_mix
end interface

interface
subroutine regolith_mix(surf,d)
subroutine regolith_mix(surfi,mixing_depth,domain)
use module_globals
type(surftype),intent(inout) :: surf
real(DP),intent(in) :: d
type(surftype),intent(inout) :: surfi
real(DP),intent(in) :: mixing_depth
type(domaintype),intent(in) :: domain
end subroutine regolith_mix
end interface

Expand Down
6 changes: 5 additions & 1 deletion src/regolith/regolith_mix.f90
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
! Notes :
!
!**********************************************************************************************************************************
subroutine regolith_mix(surfi,mixing_depth)
subroutine regolith_mix(surfi,mixing_depth,domain)
use module_globals
use module_util
use module_regolith, EXCEPT_THIS_ONE => regolith_mix
Expand All @@ -25,6 +25,7 @@ subroutine regolith_mix(surfi,mixing_depth)
! Arguments
type(surftype),intent(inout) :: surfi
real(DP), intent(in) :: mixing_depth
type(domaintype),intent(in) :: domain

! Internal variables
type(regodatatype) :: newlayer
Expand All @@ -41,6 +42,7 @@ subroutine regolith_mix(surfi,mixing_depth)
newlayer%comp = 0.0_DP
newlayer%meltfrac = 0.0_DP
newlayer%age(:) = 0.0_DP
allocate(newlayer%meltdist(domain%rcnum))

!poppedlist => poppedlist_top
!do while(associated(poppedlist%next))
Expand All @@ -50,12 +52,14 @@ subroutine regolith_mix(surfi,mixing_depth)
newlayer%comp = newlayer%comp + poppedarray(i)%thickness * poppedarray(i)%comp
newlayer%meltfrac = newlayer%meltfrac + poppedarray(i)%thickness * poppedarray(i)%meltfrac
newlayer%age(:) = newlayer%age(:) + poppedarray(i)%age(:)
newlayer%meltdist(:) = newlayer%meltdist(:) + poppedarray(i)%thickness * poppedarray(i)%meltdist(:)
!poppedlist => poppedlist%next
end do

! Get average values of composition and melt fraction
newlayer%comp = newlayer%comp / newlayer%thickness
newlayer%meltfrac = newlayer%meltfrac / newlayer%thickness
newlayer%meltdist(:) = newlayer%meltdist(:) / newlayer%thickness

call util_push_array(surfi%regolayer, newlayer)
!call util_destroy_list(poppedlist_top)
Expand Down
2 changes: 1 addition & 1 deletion src/regolith/regolith_subcrater_mix.f90
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ subroutine regolith_subcrater_mix(user,surf,domain,nflux,finterval,p)
N = size(surf(i,j)%regolayer)

if (surf(i,j)%regolayer(N)%thickness < dd) then
call regolith_mix(surf(i,j),dd)
call regolith_mix(surf(i,j),dd,domain)
end if

end do
Expand Down

0 comments on commit 9830f7d

Please sign in to comment.