6 |
|
!! @author Charles F. Vardeman II |
7 |
|
!! @author Matthew Meineke |
8 |
|
!! @author J. Daniel Gezelter |
9 |
< |
!! @version $Id: neighborLists.F90,v 1.6 2003-09-05 21:28:19 gezelter Exp $, |
9 |
> |
!! @version $Id: neighborLists.F90,v 1.9 2003-11-21 19:31:05 chrisfen Exp $, |
10 |
|
|
11 |
|
module neighborLists |
12 |
|
|
52 |
|
integer :: newSize = 0 |
53 |
|
integer :: i |
54 |
|
integer, dimension(:), pointer :: newList => null() |
55 |
< |
error = 0 |
56 |
< |
|
55 |
> |
error = 0 |
56 |
|
|
57 |
|
!! First time through we should allocate point and list. |
58 |
|
!! If one is associated and one is not, something is wrong |
161 |
|
real( kind = DP ) :: dispmx_tmp |
162 |
|
integer :: nlocal |
163 |
|
|
165 |
– |
|
164 |
|
nlocal = natoms |
165 |
|
dispmx = 0.0E0_DP |
166 |
|
!! calculate the largest displacement of any atom in any direction |
167 |
|
|
168 |
|
!! If we have changed the particle idents, then we need to update |
169 |
< |
if (.not. allocated(q0) .or. size(q0,2) /= nlocal) then |
169 |
> |
if (.not. allocated(q0)) then |
170 |
|
update_nlist = .true. |
171 |
|
return |
172 |
|
end if |
173 |
|
|
174 |
+ |
if (size(q0,2) /= nlocal) then |
175 |
+ |
update_nlist = .true. |
176 |
+ |
return |
177 |
+ |
end if |
178 |
|
|
179 |
+ |
|
180 |
|
#ifdef MPI |
181 |
|
|
182 |
|
dispmx_tmp = 0.0E0_DP |
197 |
|
dispmx = max( abs ( q(3,i) - q0(3,i) ), dispmx ) |
198 |
|
end do |
199 |
|
|
200 |
< |
#endif |
198 |
< |
|
200 |
> |
#endif |
201 |
|
|
202 |
|
!! a conservative test of list skin crossings |
203 |
< |
dispmx = 2.0E0_DP * sqrt (3.0E0_DP * dispmx * dispmx) |
204 |
< |
|
203 |
> |
dispmx = 2.0E0_DP * sqrt (3.0E0_DP * dispmx * dispmx) |
204 |
> |
|
205 |
|
update_nlist = (dispmx.gt.listSkin) |
206 |
< |
|
206 |
> |
|
207 |
|
end subroutine checkNeighborList |
208 |
|
|
209 |
|
|
215 |
|
integer :: natoms |
216 |
|
real(kind = dp ), dimension(3,natoms), intent(in) :: q |
217 |
|
integer :: list_size |
216 |
– |
|
217 |
– |
|
218 |
|
|
219 |
|
!! get size of list |
220 |
|
list_size = natoms |