diff --git a/src/regolith/regolith_melt_glass.f90 b/src/regolith/regolith_melt_glass.f90 index 375d58e6..f25f389d 100644 --- a/src/regolith/regolith_melt_glass.f90 +++ b/src/regolith/regolith_melt_glass.f90 @@ -165,13 +165,15 @@ subroutine regolith_melt_glass(user,crater,domain,age,age_resolution,ebh,rm,erad volm1 = regolith_streamtube_volume_func(eradi,0.0_DP,xmints,deltar) melt = volm1 - volv1 newlayer%meltfrac = melt/(vst-volv1) - allocate(newlayer%meltdist((domain%rcnum))) - newlayer%meltdist(:) = 0.0_SP - if(domain%currentqmc) then - newlayer%meltdist(domain%nqmc) = newlayer%meltfrac - end if + end if + allocate(newlayer%meltdist((domain%rcnum))) + newlayer%meltdist(:) = 0.0_SP + if(domain%currentqmc) then + newlayer%meltdist(domain%nqmc) = newlayer%meltfrac + end if + n_age = max(ceiling(age / age_resolution), 1) if (lrad >= RAD_GP * crater%rad) then newlayer%age(n_age) = melt / (user%pix * user%pix) diff --git a/src/regolith/regolith_mix.f90 b/src/regolith/regolith_mix.f90 index 18eabef8..8d0322b3 100644 --- a/src/regolith/regolith_mix.f90 +++ b/src/regolith/regolith_mix.f90 @@ -35,7 +35,11 @@ subroutine regolith_mix(surfi,mixing_depth,domain) !=============================================== ! Add up all layers' info until a desired depth - !=============================================== + !=============================================== + ! !test code to create a situation for a breakpoint, since vscode debugger won't recognize the conditional breakpoint + ! if(domain%currentqmc .eqv. .true.) then + ! j = 0 + ! end if call util_traverse_pop_array(surfi%regolayer,mixing_depth,poppedarray) newlayer%thickness = 0.0_DP