Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added ejected melt information to regolith_mix subroutine
  • Loading branch information
Austin Blevins committed Feb 9, 2023
1 parent 0988b17 commit 3e37759
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/regolith/regolith_mix.f90
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ subroutine regolith_mix(surfi,mixing_depth,domain)
newlayer%age(:) = 0.0_DP
allocate(newlayer%meltdist(domain%rcnum))
newlayer%meltdist(:) = 0.0_SP
newlayer%ejm = 0.0_DP
newlayer%ejmf = 0.0_DP

!poppedlist => poppedlist_top
!do while(associated(poppedlist%next))
Expand All @@ -58,16 +60,16 @@ subroutine regolith_mix(surfi,mixing_depth,domain)
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(:)
! do j = 1,domain%rcnum !testing a loop here since the array operation resulted in a segfault
! newlayer%meltdist(j) = newlayer%meltdist(j) + poppedarray(i)%thickness * poppedarray(i)%meltdist(j)
! end do
! !poppedlist => poppedlist%next
newlayer%ejm = newlayer%ejm + poppedarray(i)%thickness * poppedarray(i)%ejm
newlayer%ejmf = newlayer%ejmf + poppedarray(i)%thickness * poppedarray(i)%ejmf
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
newlayer%ejm = newlayer%ejm / newlayer%thickness
newlayer%ejmf = newlayer%ejmf / newlayer%thickness

call util_push_array(surfi%regolayer, newlayer)
!call util_destroy_list(poppedlist_top)
Expand Down

0 comments on commit 3e37759

Please sign in to comment.