From 3e3775996260f9f19ed12a08e40b653fb2410849 Mon Sep 17 00:00:00 2001 From: Austin Blevins Date: Thu, 9 Feb 2023 11:45:01 -0500 Subject: [PATCH] Added ejected melt information to regolith_mix subroutine --- src/regolith/regolith_mix.f90 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/regolith/regolith_mix.f90 b/src/regolith/regolith_mix.f90 index 8d0322b3..c0ab8c72 100644 --- a/src/regolith/regolith_mix.f90 +++ b/src/regolith/regolith_mix.f90 @@ -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)) @@ -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)