-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbond_matrix.f90
61 lines (48 loc) · 1016 Bytes
/
bond_matrix.f90
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
! ASSUMES ANGSTROM!
subroutine bondmatrix(xyz,iat,bond)
use parm, only: nat,i,j
use logic, only: bondf
use atomdata, only: rcov,rcov3
use constant, only: au2ang
implicit none
integer bond(nat,nat)
real(8) r1,r2,rab,fac_bond
real(8), intent(in) :: xyz(3,nat)
integer, intent(in) :: iat(nat)
! full symmetric bond matrix
!bond=0
!do i=1,nat
! do j=1,nat
! if(i==j) cycle
! r1=rcov(iat(i))+rcov(iat(j))*0.5
! r2=rab(xyz(1,i),xyz(1,j))
! if(abs(r1-r2) < 0.5) bond(i,j)=1
! enddo
!enddo
fac_bond=bondf
! full symmetric bond matrix
bond=0
do i=1,nat
do j=1,nat
if(i==j) cycle
! r1=(rcov(iat(i))+rcov(iat(j))) ! in A
r1=(rcov3(iat(i))+rcov3(iat(j))) ! in A
r2=rab(xyz(1,i),xyz(1,j))
if(r2 <= r1*fac_bond) bond(i,j)=1
enddo
enddo
! call prmati(6,bond,nat,nat,'bond matrix')
end
subroutine count_fragments(xyz,nat,bond)
implicit none
real(8) xyz(3,nat)
integer bond(nat,nat)
integer i,j,nfrag,nat
nfrag=1
do i=1,nat
do j=1,nat
if(bond(i,j)==1) then
endif
enddo
enddo
end subroutine