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 480 by chuckv, Tue Apr 8 17:16:22 2003 UTC vs.
Revision 483 by gezelter, Wed Apr 9 04:06:43 2003 UTC

# Line 25 | Line 25 | module simulation
25    integer, public, save :: nExcludes_Local = 0
26    integer, allocatable, dimension(:,:), public :: excludesLocal
27    integer, allocatable, dimension(:), public :: excludesGlobal
28 +  integer, allocatable, dimension(:), public :: molMembershipList
29  
30    real(kind=dp), save :: rcut2 = 0.0_DP
31    real(kind=dp), save :: rcut6 = 0.0_DP
# Line 68 | Line 69 | contains
69    
70    subroutine SimulationSetup(setThisSim, nComponents, c_idents, &
71         CnLocalExcludes, CexcludesLocal, CnGlobalExcludes, CexcludesGlobal, &
72 +       CmolMembership, &
73         status)    
74  
75      type (simtype) :: setThisSim
# Line 78 | Line 80 | contains
80      integer, dimension(2,CnLocalExcludes), intent(in) :: CexcludesLocal
81      integer :: CnGlobalExcludes
82      integer, dimension(CnGlobalExcludes), intent(in) :: CexcludesGlobal
83 +    integer, dimension(nComponents),intent(in) :: CmolMembership
84      !!  Result status, success = 0, status = -1
85      integer, intent(out) :: status
86      integer :: i, me, thisStat, alloc_stat, myNode
# Line 178 | Line 181 | contains
181      
182      do i = 1, nExcludes_Global
183         excludesGlobal(i) = CexcludesGlobal(i)
184 +    enddo
185 +
186 +    do i = 1, nComponents
187 +       molMemberShipList(i) = CmolMembership(i)
188 +       ! write(0,*) 'molMembershipList(',i,') = ', molMemberShipList(i)
189      enddo
190  
191      if (status == 0) simulation_setup_complete = .true.
# Line 344 | Line 352 | contains
352         thisStat = -1
353         return
354      endif
355 +
356 +    allocate(molMembershipList(getNlocal()), stat=alloc_stat)
357 +    if (alloc_stat /= 0 ) then
358 +       thisStat = -1
359 +       return
360 +    endif
361      
362    end subroutine InitializeSimGlobals
363    
364    subroutine FreeSimGlobals()
365      
366      !We free in the opposite order in which we allocate in.
367 <    
367 >
368 >    if (allocated(molMembershipList)) deallocate(molMembershipList)    
369      if (allocated(excludesGlobal)) deallocate(excludesGlobal)
370      if (allocated(excludesLocal)) deallocate(excludesLocal)
371  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines