--- trunk/OOPSE/libmdtools/neighborLists.F90 2003/07/16 21:30:56 626 +++ trunk/OOPSE/libmdtools/neighborLists.F90 2003/08/08 21:22:37 673 @@ -6,7 +6,7 @@ !! @author Charles F. Vardeman II !! @author Matthew Meineke !! @author J. Daniel Gezelter -!! @version $Id: neighborLists.F90,v 1.4 2003-07-16 21:30:56 mmeineke Exp $, +!! @version $Id: neighborLists.F90,v 1.5 2003-08-08 21:22:37 chuckv Exp $, module neighborLists @@ -168,7 +168,7 @@ contains !! calculate the largest displacement of any atom in any direction !! If we have changed the particle idents, then we need to update - if (.not. allocated(q0) .or. size(q0) /= nlocal) then + if (.not. allocated(q0) .or. size(q0,2) /= nlocal) then update_nlist = .true. return end if @@ -196,12 +196,13 @@ contains #endif + !! a conservative test of list skin crossings dispmx = 2.0E0_DP * sqrt (3.0E0_DP * dispmx * dispmx) update_nlist = (dispmx.gt.listSkin) - end subroutine checkNeighborList + end subroutine checkNeighborList !! Saves neighbor list for comparison in check. @@ -213,13 +214,14 @@ contains real(kind = dp ), dimension(3,natoms), intent(in) :: q integer :: list_size + !! get size of list list_size = natoms if (.not. allocated(q0)) then allocate(q0(3,list_size)) - else if( list_size > size(q0)) then + else if( list_size > size(q0,2)) then deallocate(q0) allocate(q0(3,list_size)) endif