ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/simulation_module.F90
(Generate patch)

Comparing trunk/OOPSE/libmdtools/simulation_module.F90 (file contents):
Revision 1214 by gezelter, Tue Jun 1 18:42:58 2004 UTC vs.
Revision 1217 by gezelter, Tue Jun 1 21:45:22 2004 UTC

# Line 321 | Line 321 | contains
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
# Line 381 | Line 392 | contains
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
# Line 487 | Line 498 | contains
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
# Line 519 | Line 524 | contains
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)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines