xref: /phasta/phSolver/common/perprep.f (revision ae8d68e4d684c42aa0a2054f5c5447188f991748)
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 clearper
17         use periodicity
18         if( allocated(rcount) ) then
19           deallocate(rcount)
20         endif
21       end
22
23       subroutine perprep (iBC, iper,nshg)
24
25       use periodicity
26
27       dimension iBC(nshg),
28     &           iper(nshg)
29
30c
31c..... calculate the inverse of the number of slaves + 1
32c
33       one=1.00000000000
34       rcount=one
35       do j = 1,nshg
36          if (btest(iBC(j),10)) then
37             i = iper(j)
38             rcount(i) = rcount(i) + one
39          endif
40       enddo
41       do k=1,nshg
42          if(rcount(k).ne.one) then
43             rcount(k)=one/rcount(k)
44          endif
45       enddo
46
47c
48c.... return
49c
50       return
51       end
52