diff --git a/Makefile.Defines b/Makefile.Defines index cc15ec89a..75c4e0ad2 100644 --- a/Makefile.Defines +++ b/Makefile.Defines @@ -72,8 +72,8 @@ GMEM = -fsanitize=undefined -fsanitize=address -fsanitize=leak GWARNINGS = -Wall -Warray-bounds -Wimplicit-interface -Wextra -Warray-temporaries -#FORTRAN = gfortran -#FFLAGS = -ffree-line-length-none $(GDEBUG) +FORTRAN = gfortran +FFLAGS = -ffree-line-length-none $(GDEBUG) $(GMEM) AR = ar # DO NOT include in CFLAGS the "-c" option to compile object only diff --git a/src/rmvs/rmvs_step.f90 b/src/rmvs/rmvs_step.f90 index b665ece45..b406afe9a 100644 --- a/src/rmvs/rmvs_step.f90 +++ b/src/rmvs/rmvs_step.f90 @@ -226,14 +226,14 @@ module subroutine rmvs_step_make_planetocentric(self, cb, tp, config) integer(I4B) :: i, j logical, dimension(:), allocatable :: encmask - associate(pl => self, npl => self%nbody, nenc => self%nenc, tpenc => self%tpenc, cbenc => self%cbenc, & + associate(pl => self, npl => self%nbody, ntp => tp%nbody, nenc => self%nenc, tpenc => self%tpenc, cbenc => self%cbenc, & plenc => self%plenc, GMpl => self%Gmass) do i = 1, npl if (nenc(i) == 0) cycle ! There are inner encounters with this planet if (allocated(encmask)) deallocate(encmask) - allocate(encmask(nenc(i))) + allocate(encmask(ntp)) encmask(:) = tp%plencP(:) == i ! Save the index value of the planet corresponding to this encounter @@ -303,7 +303,7 @@ module subroutine rmvs_step_end_planetocentric(self, cb, tp) allocate(tpind(nenc(i))) ! Index array of encountering test particles if (allocated(encmask)) deallocate(encmask) - allocate(encmask(nenc(i))) + allocate(encmask(ntp)) encmask(:) = tp%plencP(:) == i tpind(:) = pack([(j,j=1,ntp)], encmask(:)) @@ -331,4 +331,4 @@ module subroutine rmvs_step_end_planetocentric(self, cb, tp) return end subroutine rmvs_step_end_planetocentric -end submodule s_rmvs_step \ No newline at end of file +end submodule s_rmvs_step