| 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 | 
| 67 |  |  | 
| 68 |  | contains | 
| 69 |  |  | 
| 70 | < | subroutine SimulationSetup(setThisSim, nGlobal, nLocal, 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) :: nGlobal, nLocal | 
| 77 | < | integer, dimension(nLocal),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(nGlobal),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 | 
| 95 |  | status = 0 | 
| 96 |  |  | 
| 97 |  | ! copy C struct into fortran type | 
| 98 | + |  | 
| 99 | + | nLocal = CnLocal | 
| 100 | + | nGlobal = CnGlobal | 
| 101 | + |  | 
| 102 |  | thisSim = setThisSim | 
| 99 | – | natoms = nLocal | 
| 103 |  | rcut2 = thisSim%rcut * thisSim%rcut | 
| 104 |  | rcut6 = rcut2 * rcut2 * rcut2 | 
| 105 |  | rlist2 = thisSim%rlist * thisSim%rlist | 
| 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 | 
| 188 |  |  | 
| 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 |  |  | 
| 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 | 
| 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 |  |  |