diff --git a/src/main/linklist_kdtree.F90 b/src/main/linklist_kdtree.F90 index 4801d9cfe..03c5f535e 100644 --- a/src/main/linklist_kdtree.F90 +++ b/src/main/linklist_kdtree.F90 @@ -34,6 +34,7 @@ module linklist type(kdnode), public, allocatable :: node(:) integer, allocatable :: nodemap(:) integer, public , allocatable :: listneigh(:) + integer, public , allocatable :: listneigh_global(:) !$omp threadprivate(listneigh) integer(kind=8), public :: ncells real, public :: dxcell @@ -66,6 +67,7 @@ subroutine allocate_linklist !$omp parallel call allocate_array('listneigh',listneigh,maxp) !$omp end parallel + call allocate_array('listneigh_global',listneigh_global,maxp) end subroutine allocate_linklist @@ -80,6 +82,7 @@ subroutine deallocate_linklist !$omp parallel if (allocated(listneigh)) deallocate(listneigh) !$omp end parallel + if (allocated(listneigh_global)) deallocate(listneigh_global) call deallocate_kdtree() end subroutine deallocate_linklist diff --git a/src/main/ptmass.F90 b/src/main/ptmass.F90 index e5ad44604..5bab2e25c 100644 --- a/src/main/ptmass.F90 +++ b/src/main/ptmass.F90 @@ -826,7 +826,7 @@ subroutine ptmass_create(nptmass,npart,itest,xyzh,vxyzu,fxyzu,fext,divcurlv,pote #ifdef IND_TIMESTEPS use part, only:ibin,ibin_wake #endif - use linklist, only:getneigh_pos,ifirstincell + use linklist, only:getneigh_pos,ifirstincell,listneigh=>listneigh_global use eos, only:equationofstate,gamma,gamma_pwp,utherm use options, only:ieos use units, only:unit_density @@ -844,7 +844,6 @@ subroutine ptmass_create(nptmass,npart,itest,xyzh,vxyzu,fxyzu,fext,divcurlv,pote real, intent(in) :: time integer(kind=1) :: iphasei,ibin_wakei integer :: nneigh - integer :: listneigh(maxneigh) integer, parameter :: maxcache = 12000 integer, parameter :: nneigh_thresh = 1024 ! approximate epot if neigh>neigh_thresh; (-ve for off) #ifdef IND_TIMESTEPS