Revision 10 src/CalcCnct.f90

CalcCnct.f90 (revision 10)
30 30

  
31 31
SUBROUTINE CalcCnct(na,atome,x,y,z,LIAISONS,r_cov,fact)
32 32

  
33
  use Path_module, only : NMaxL, max_Z,Nom,Prog, KINT, KREAL
33
  use Path_module, only : NMaxL, max_Z,Nom,Prog, KINT, KREAL, FPBC, &
34
       kaBeg,kaEnd,kbBeg,kbEnd,kcBeg,kcEnd
34 35
  
35 36
  IMPLICIT NONE
36 37

  
......
64 65
  END DO
65 66

  
66 67
  if (debug) THEN
67
     WRITE(*,*) 'CalcCnct'
68
     WRITE(*,*) 'CalcCnct : covalent radii used'
68 69
     DO iat=1,na
69 70
        i=atome(iat)
70
        WRITE(*,*) Nom(I),I,r_cov(i),r_cov(i)*fact
71
        WRITE(*,*) Nom(I),I,r_cov(i)*fact
71 72
     END DO
73
     WRITE(*,*) 'Coordinates'
74
     DO iat=1,na
75
        i=atome(iat)
76
        WRITE(*,*) Nom(I),x(iat),y(iat),z(iat)
77
     END DO
72 78
  END IF
73 79

  
74
  IF (PROG/="VASP") THEN
80
  IF (FPBC) THEN
75 81
     DO i=1,na
76 82
        NbLi=LIAISONS(i,0)
77 83
        DO j=i+1,na
78
           CALL vecteur(j,i,x,y,z,vx,vy,vz,dist)
79
           dist=dist/fact
80
           distth=(r_cov(atome(i))+r_cov(atome(j)))/100.
81
!           if (debug) WRITE(*,*) atome(i),atome(j),dist,distth
82
           if (dist.le.distth) THEN
84
           Bound=.FALSE.
85
           DO ka=kaBeg,kaEnd
86
              DO Kb=kbBeg,kbEnd
87
                 DO Kc=kcBeg,kcEnd
88
                    CALL VectorPer(j,i,ka,kb,kc,x,y,z,vx,vy,vz,dist)
89
                    dist=dist/fact
90
                    distth=(r_cov(atome(i))+r_cov(atome(j)))/100.
91
!                    if (debug) WRITE(*,*) atome(i),atome(j),dist,distth
92
                    if (dist.le.distth) Bound=.TRUE.
93
                 END DO
94
              END DO
95
           END DO
96
           IF (Bound) THEN
97
              if (debug) WRITE(*,*) "Adding a bond between:",i,j
83 98
              NbLi=NbLi+1
84 99
              LIAISONS(i,NbLi)=j;
85 100
              NBlj=LIAISONS(j,0)+1
......
93 108
     DO i=1,na
94 109
        NbLi=LIAISONS(i,0)
95 110
        DO j=i+1,na
96
           Bound=.FALSE.
97
           DO ka=-1,1
98
              DO Kb=-1,1
99
                 DO Kc=-1,1
100
                    CALL VectorPer(j,i,ka,kb,kc,x,y,z,vx,vy,vz,dist)
101
                    dist=dist/fact
102
                    distth=(r_cov(atome(i))+r_cov(atome(j)))/100.
103
!                    if (debug) WRITE(*,*) atome(i),atome(j),dist,distth
104
                    if (dist.le.distth) Bound=.TRUE.
105
                 END DO
106
              END DO
107
           END DO
108
           IF (Bound) THEN
109
              if (debug) WRITE(*,*) "Adding a bond between:",i,j
111
           CALL vecteur(j,i,x,y,z,vx,vy,vz,dist)
112
           dist=dist/fact
113
           distth=(r_cov(atome(i))+r_cov(atome(j)))/100.
114
!           if (debug) WRITE(*,*) atome(i),atome(j),dist,distth
115
           if (dist.le.distth) THEN
110 116
              NbLi=NbLi+1
111 117
              LIAISONS(i,NbLi)=j;
112 118
              NBlj=LIAISONS(j,0)+1

Also available in: Unified diff