--- trunk/OOPSE/libmdtools/neighborLists.F90 2003/04/04 19:57:01 459 +++ trunk/OOPSE/libmdtools/neighborLists.F90 2003/07/16 21:30:56 626 @@ -6,7 +6,7 @@ !! @author Charles F. Vardeman II !! @author Matthew Meineke !! @author J. Daniel Gezelter -!! @version $Id: neighborLists.F90,v 1.2 2003-04-04 19:57:01 mmeineke Exp $, +!! @version $Id: neighborLists.F90,v 1.4 2003-07-16 21:30:56 mmeineke Exp $, module neighborLists @@ -64,11 +64,15 @@ contains .not. associated(list) ) then allocate(point(natoms),stat=alloc_error) if (alloc_error /= 0) then + write(default_error,*) & + "ExpandNeighborLists: Error in allocating point" error = -1 return end if allocate(list(listMultiplier * natoms),stat=alloc_error) if (alloc_error /= 0) then + write(default_error,*) & + "ExpandNeighborLists: Error in allocating list" error = -1 return end if @@ -81,11 +85,15 @@ contains .not. associated(list) ) then allocate(point(getNRow(plan_row)),stat=alloc_error) if (alloc_error /= 0) then - error = -1 + write(default_error,*) & + "ExpandNeighborLists: Error in allocating MPI point" + error = -1 return end if allocate(list(listMultiplier * getNCol(plan_col)),stat=alloc_error) if (alloc_error /= 0) then + write(default_error,*) & + "ExpandNeighborLists: Error in allocating MPI list" error = -1 return end if @@ -99,11 +107,14 @@ contains ! Check to see if we have exceeded the maximum number of allocations. if (nAllocations > maxAllocations) then + write(default_error,*) & + "ExpandNeighborList: exceeded maximum number of re-allocations" error = -1 return else !! Expand the list. oldSize = size(list) + #ifdef IS_MPI !! MPI newSize = listMultiplier * getNCol(plan_col) + oldSize #else @@ -141,19 +152,18 @@ contains !! checks to see if any long range particle has moved !! through the neighbor list skin thickness. - subroutine checkNeighborList(natoms, q, rcut, rlist, update_nlist) + subroutine checkNeighborList(natoms, q, listSkin, update_nlist) integer :: natoms - real(kind = dp), intent(in) :: rcut, rlist + real(kind = dp), intent(in) :: listSkin real( kind = dp ), dimension(:,:) :: q integer :: i real( kind = DP ) :: dispmx logical, intent(out) :: update_nlist real( kind = DP ) :: dispmx_tmp - real( kind = dp ) :: skin_thickness integer :: nlocal - + + nlocal = natoms - skin_thickness = rlist - rcut dispmx = 0.0E0_DP !! calculate the largest displacement of any atom in any direction @@ -162,7 +172,8 @@ contains update_nlist = .true. return end if - + + #ifdef MPI dispmx_tmp = 0.0E0_DP @@ -188,7 +199,7 @@ contains !! a conservative test of list skin crossings dispmx = 2.0E0_DP * sqrt (3.0E0_DP * dispmx * dispmx) - update_nlist = (dispmx.gt.(skin_thickness)) + update_nlist = (dispmx.gt.listSkin) end subroutine checkNeighborList