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 483 by gezelter, Wed Apr 9 04:06:43 2003 UTC vs.
Revision 491 by mmeineke, Fri Apr 11 18:46:37 2003 UTC

# Line 20 | Line 20 | module simulation
20  
21    logical, save :: simulation_setup_complete = .false.
22  
23 <  integer, public, save :: natoms
23 >  integer, public, save :: nLocal, nGlobal
24    integer, public, save :: nExcludes_Global = 0
25    integer, public, save :: nExcludes_Local = 0
26    integer, allocatable, dimension(:,:), public :: excludesLocal
# Line 67 | Line 67 | contains
67    
68   contains
69    
70 <  subroutine SimulationSetup(setThisSim, nComponents, c_idents, &
70 >  subroutine SimulationSetup(setThisSim, CnGlobal, CnLocal, c_idents, &
71         CnLocalExcludes, CexcludesLocal, CnGlobalExcludes, CexcludesGlobal, &
72         CmolMembership, &
73         status)    
74  
75      type (simtype) :: setThisSim
76 <    integer, intent(inout) :: nComponents
77 <    integer, dimension(nComponents),intent(inout) :: c_idents
76 >    integer, intent(inout) :: CnGlobal, CnLocal
77 >    integer, dimension(CnLocal),intent(inout) :: c_idents
78  
79      integer :: CnLocalExcludes
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
83 >    integer, dimension(CnGlobal),intent(in) :: CmolMembership
84      !!  Result status, success = 0, status = -1
85      integer, intent(out) :: status
86      integer :: i, me, thisStat, alloc_stat, myNode
# Line 95 | Line 95 | contains
95      status = 0
96  
97      ! copy C struct into fortran type
98 +
99 +    nLocal = CnLocal
100 +    nGlobal = CnGlobal
101 +
102      thisSim = setThisSim
99    natoms = nComponents
103      rcut2 = thisSim%rcut * thisSim%rcut
104      rcut6 = rcut2 * rcut2 * rcut2
105      rlist2 = thisSim%rlist * thisSim%rlist
# Line 105 | Line 108 | contains
108      nExcludes_Global = CnGlobalExcludes
109      nExcludes_Local = CnLocalExcludes
110  
111 <    call InitializeForceGlobals(natoms, thisStat)
111 >    call InitializeForceGlobals(nLocal, thisStat)
112      if (thisStat /= 0) then
113         write(default_error,*) "SimSetup: InitializeForceGlobals error"
114         status = -1
# Line 164 | Line 167 | contains
167      endif
168      
169   #else
170 <    do i = 1, nComponents
170 >    do i = 1, nLocal
171        
172         me = getFirstMatchingElement(atypes, "c_ident", c_idents(i))
173         atid(i) = me
# Line 183 | Line 186 | contains
186         excludesGlobal(i) = CexcludesGlobal(i)
187      enddo
188  
189 <    do i = 1, nComponents
189 >    do i = 1, nGlobal
190         molMemberShipList(i) = CmolMembership(i)
191 <       ! write(0,*) 'molMembershipList(',i,') = ', molMemberShipList(i)
189 <    enddo
191 >     enddo
192  
193      if (status == 0) simulation_setup_complete = .true.
194      
# Line 353 | Line 355 | contains
355         return
356      endif
357  
358 <    allocate(molMembershipList(getNlocal()), stat=alloc_stat)
358 >    allocate(molMembershipList(nGlobal), stat=alloc_stat)
359      if (alloc_stat /= 0 ) then
360         thisStat = -1
361         return
# Line 371 | Line 373 | contains
373  
374    end subroutine FreeSimGlobals
375  
376 <  pure function getNlocal() result(nlocal)
377 <    integer :: nlocal
378 <    nlocal = natoms
376 >  pure function getNlocal() result(n)
377 >    integer :: n
378 >    n = nLocal
379    end function getNlocal
380  
381    

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines