1 module periodicity 2 3 real*8, allocatable :: rcount(:) 4 end module 5 6 7 subroutine setper (nshg) 8 9 use periodicity 10 11 allocate (rcount(nshg)) 12 13 return 14 end 15 16 subroutine perprep (iBC, iper,nshg) 17 18 use periodicity 19 20 dimension iBC(nshg), 21 & iper(nshg) 22 23c 24c..... calculate the inverse of the number of slaves + 1 25c 26 one=1.00000000000 27 rcount=one 28 do j = 1,nshg 29 if (btest(iBC(j),10)) then 30 i = iper(j) 31 rcount(i) = rcount(i) + one 32 endif 33 enddo 34 do k=1,nshg 35 if(rcount(k).ne.one) then 36 rcount(k)=one/rcount(k) 37 endif 38 enddo 39 40c 41c.... return 42c 43 return 44 end 45