--- trunk/OOPSE/libmdtools/simulation_module.F90 2003/04/08 17:16:22 480 +++ trunk/OOPSE/libmdtools/simulation_module.F90 2003/04/08 22:38:43 482 @@ -25,6 +25,7 @@ module simulation integer, public, save :: nExcludes_Local = 0 integer, allocatable, dimension(:,:), public :: excludesLocal integer, allocatable, dimension(:), public :: excludesGlobal + integer, allocatable, dimension(:), public :: molMembershipList real(kind=dp), save :: rcut2 = 0.0_DP real(kind=dp), save :: rcut6 = 0.0_DP @@ -67,7 +68,7 @@ contains contains subroutine SimulationSetup(setThisSim, nComponents, c_idents, & - CnLocalExcludes, CexcludesLocal, CnGlobalExcludes, CexcludesGlobal, & + CnLocalExcludes, CexcludesLocal, CnGlobalExcludes, CexcludesGlobal, CmolMembership, & status) type (simtype) :: setThisSim @@ -78,6 +79,7 @@ contains integer, dimension(2,CnLocalExcludes), intent(in) :: CexcludesLocal integer :: CnGlobalExcludes integer, dimension(CnGlobalExcludes), intent(in) :: CexcludesGlobal + integer, dimension(nComponents),intent(in) :: CmolMembership !! Result status, success = 0, status = -1 integer, intent(out) :: status integer :: i, me, thisStat, alloc_stat, myNode @@ -180,6 +182,8 @@ contains excludesGlobal(i) = CexcludesGlobal(i) enddo + molMemberShipList = CmolMembership + if (status == 0) simulation_setup_complete = .true. end subroutine SimulationSetup @@ -340,6 +344,12 @@ contains endif allocate(excludesGlobal(nExcludes_Global), stat=alloc_stat) + if (alloc_stat /= 0 ) then + thisStat = -1 + return + endif + + allocate(molMembershipList(getNlocal()), stat=alloc_stat) if (alloc_stat /= 0 ) then thisStat = -1 return @@ -353,7 +363,7 @@ contains if (allocated(excludesGlobal)) deallocate(excludesGlobal) if (allocated(excludesLocal)) deallocate(excludesLocal) - + if (allocated(molMembershipList)) deallocate(molMembershipList) end subroutine FreeSimGlobals pure function getNlocal() result(nlocal)