diff --git a/src/Makefile.am b/src/Makefile.am index 59c00bce..52a0bbbc 100755 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -7,7 +7,7 @@ OPTREPORT = -qopt-report=5 IPRODUCTION = -g -traceback -no-wrap-margin -assume byterecl -O3 -qopt-prefetch=0 -sox $(PAR) $(SIMDVEC) $(HEAPARR) #IDEBUG = -O0 -g -traceback -debug all -nogen-interfaces -assume byterecl -m64 -heap-arrays -FR -no-pie -no-ftz -fpe-all=0 -mp1 -fp-model strict -fpe0 -align all -pad -ip -prec-div -prec-sqrt -assume protect-parens -CB -no-wrap-margin -init=snan,arrays IDEBUG = -O0 -g -traceback -debug all -nogen-interfaces -assume byterecl -m64 -heap-arrays -FR -no-pie -no-ftz -fpe-all=0 -mp1 -fp-model strict -fpe0 -align all -pad -ip -prec-sqrt -assume protect-parens -CB -no-wrap-margin -init=snan,arrays -AM_FCFLAGS = $(IDEBUG) +AM_FCFLAGS = $(IPRODUCTION) #ifort debug flags #gfortran optimized flags diff --git a/src/regolith/regolith_melt_glass.f90 b/src/regolith/regolith_melt_glass.f90 index 61ed7b2e..375d58e6 100644 --- a/src/regolith/regolith_melt_glass.f90 +++ b/src/regolith/regolith_melt_glass.f90 @@ -166,6 +166,7 @@ subroutine regolith_melt_glass(user,crater,domain,age,age_resolution,ebh,rm,erad 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 diff --git a/src/regolith/regolith_mix.f90 b/src/regolith/regolith_mix.f90 index accf7885..18eabef8 100644 --- a/src/regolith/regolith_mix.f90 +++ b/src/regolith/regolith_mix.f90 @@ -31,7 +31,7 @@ subroutine regolith_mix(surfi,mixing_depth,domain) type(regodatatype) :: newlayer !type(regolisttype),pointer :: poppedlist,poppedlist_top type(regodatatype),dimension(:),allocatable :: poppedarray - integer(I4B) :: i, N + integer(I4B) :: i, j, N !=============================================== ! Add up all layers' info until a desired depth @@ -43,6 +43,7 @@ subroutine regolith_mix(surfi,mixing_depth,domain) newlayer%meltfrac = 0.0_DP newlayer%age(:) = 0.0_DP allocate(newlayer%meltdist(domain%rcnum)) + newlayer%meltdist(:) = 0.0_SP !poppedlist => poppedlist_top !do while(associated(poppedlist%next)) @@ -53,7 +54,10 @@ 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(:) - !poppedlist => poppedlist%next + ! 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 end do ! Get average values of composition and melt fraction