321 |
|
excludesLocal(1,i) = CexcludesLocal(1,i) |
322 |
|
excludesLocal(2,i) = CexcludesLocal(2,i) |
323 |
|
enddo |
324 |
+ |
|
325 |
+ |
#ifdef IS_MPI |
326 |
+ |
allocate(nSkipsForAtom(nAtomsInRow), stat=alloc_stat) |
327 |
+ |
#else |
328 |
+ |
allocate(nSkipsForAtom(nLocal), stat=alloc_stat) |
329 |
+ |
#endif |
330 |
+ |
if (alloc_stat /= 0 ) then |
331 |
+ |
thisStat = -1 |
332 |
+ |
write(*,*) 'Could not allocate nSkipsForAtom array' |
333 |
+ |
return |
334 |
+ |
endif |
335 |
|
|
336 |
|
maxSkipsForAtom = 0 |
337 |
|
#ifdef IS_MPI |
392 |
|
id2 = excludesLocal(2,i) |
393 |
|
skipsForAtom(j, nSkipsForAtom(j)) = id2 |
394 |
|
endif |
395 |
< |
if (excludesLocal(2, i) .eq. id2 ) then |
395 |
> |
if (excludesLocal(2, i) .eq. id1 ) then |
396 |
|
nSkipsForAtom(j) = nSkipsForAtom(j) + 1 |
397 |
|
! exclude lists have global ID's so this line is |
398 |
|
! the same in MPI and non-MPI |
498 |
|
thisStat = 0 |
499 |
|
|
500 |
|
call FreeSimGlobals() |
490 |
– |
|
491 |
– |
allocate(nSkipsForAtom(nLocal), stat=alloc_stat) |
492 |
– |
if (alloc_stat /= 0 ) then |
493 |
– |
thisStat = -1 |
494 |
– |
return |
495 |
– |
endif |
501 |
|
|
502 |
|
allocate(excludesLocal(2,nExcludes_Local), stat=alloc_stat) |
503 |
|
if (alloc_stat /= 0 ) then |
524 |
|
!We free in the opposite order in which we allocate in. |
525 |
|
|
526 |
|
if (allocated(skipsForAtom)) deallocate(skipsForAtom) |
527 |
+ |
if (allocated(nSkipsForAtom)) deallocate(nSkipsForAtom) |
528 |
|
if (allocated(mfactLocal)) deallocate(mfactLocal) |
529 |
|
if (allocated(mfactCol)) deallocate(mfactCol) |
530 |
|
if (allocated(mfactRow)) deallocate(mfactRow) |