forked from TinkerTools/tinker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbitors.f
69 lines (69 loc) · 2.13 KB
/
bitors.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
c
c
c ###################################################
c ## COPYRIGHT (C) 2003 by Jay William Ponder ##
c ## All Rights Reserved ##
c ###################################################
c
c ##########################################################
c ## ##
c ## subroutine bitors -- locate and store bitorsions ##
c ## ##
c ##########################################################
c
c
c "bitors" finds the total number of bitorsions as pairs
c of adjacent torsional angles, and the numbers of the five
c atoms defining each bitorsion
c
c
subroutine bitors
use angbnd
use atoms
use bitor
use couple
use iounit
implicit none
integer i,j,k
integer ia,ib,ic,id,ie
integer maxbitor
c
c
c perform dynamic allocation of some global arrays
c
maxbitor = 54 * n
if (allocated(ibitor)) deallocate (ibitor)
allocate (ibitor(5,maxbitor))
c
c loop over all angles, storing the atoms in each bitorsion
c
nbitor = 0
do i = 1, nangle
ib = iang(1,i)
ic = iang(2,i)
id = iang(3,i)
do j = 1, n12(ib)
ia = i12(j,ib)
if (ia.ne.ic .and. ia.ne.id) then
do k = 1, n12(id)
ie = i12(k,id)
if (ie.ne.ic .and. ie.ne.ib .and. ie.ne.ia) then
nbitor = nbitor + 1
if (nbitor .gt. maxbitor) then
write (iout,10)
10 format (/,' BITORS -- Too many Adjacent',
& ' Torsions; Increase MAXBITOR')
call fatal
end if
ibitor(1,nbitor) = ia
ibitor(2,nbitor) = ib
ibitor(3,nbitor) = ic
ibitor(4,nbitor) = id
ibitor(5,nbitor) = ie
end if
end do
end if
end do
end do
return
end