Revision 10 src/Egrad.f90

Egrad.f90 (revision 10)
8 8
       prog,NCart,XyzGeomF, XyzGeomI, renum, &
9 9
       GeomOld_all,BTransInvF,BTransInv_local,UMatF,UMat_local &
10 10
       , BprimT,ScanCoord, Coordinate,NPrim,BMat_BakerT,BBT,BBT_inv &
11
      , OrderInv, XPrimitiveF
11
      ,Order, OrderInv, XPrimitiveF,FPBC,XGeomRefPBC,YGeomRefPBC,ZGeomRefPBC
12 12

  
13 13
  ! IntCoordF(NGeomF,NCoord),GeomOld_all(NGeomF,NCoord)
14 14
  ! allocated in Path.f90
......
43 43
  REAL(KREAL), ALLOCATABLE :: GradCart(:)
44 44
  REAL(KREAL), ALLOCATABLE :: x(:), y(:), z(:)
45 45
  REAL(KREAL) ::  Pi
46
  REAL(KREAL) :: MRot(3,3), Rmsd
46 47

  
47 48
  INTEGER(KINT) :: iat, i, j, IBeg,Idx
48 49

  
......
92 93
  CASE ('ZMAT')
93 94
     ! In order to avoid problem with numbering and linear angles/diehedral, we convert the
94 95
     ! zmat into cartesian coordinates
95
     ! A remplacer par Int2Cart :-)
96 96
     Call Int2Cart(nat,indzmat,Geom,GeomCart)
97
! In case of PBC calculations, we have to re-orient the geometry onto the user initial geometry
98
     If (FPBC) THEN
99
! we align this geometry on the initial one
100
        if (debug) THEN
101
           WRITe(*,*) "We are orientating..."
102
           WRITE(*,*) "Geom before orientation"
103
           WRITE(*,*) Nat
104
           WRITE(*,*) ""
105
           DO I=1,Nat
106
              If (renum) Iat=Order(I)
107
              WRITE(*,'(1X,A10,3(1X,F15.8),A)') Trim(AtName(Iat)),GeomCart(I,1),GeomCart(I,2),GeomCart(I,3)
108
           END DO
109
        END IF
110

  
111
        IF (Renum) THEN
112
           DO I=1,Nat
113
              Iat=Order(I)
114
              X(I)=GeomCart(Iat,1)
115
              Y(I)=GeomCart(Iat,2)
116
              Z(I)=GeomCart(Iat,3)
117
           END DO
118
        ELSE
119
           X(1:Nat)=GeomCart(1:Nat,1)
120
           Y(1:Nat)=GeomCart(1:Nat,2)
121
           Z(1:Nat)=GeomCart(1:Nat,3)
122
        END IF
123

  
124
           WRITE(*,*) "Geom before orientation after reorderring"
125
           WRITE(*,*) Nat
126
           WRITE(*,*) ""
127
           DO I=1,Nat
128
!              Iat=I
129
!              If (Renum) Iat=Order(I)
130
              WRITE(*,'(1X,A10,3(1X,F15.8),A)') Trim(AtName(I)),X(I),Y(I),Z(I)
131
           END DO
132
           WRITE(*,*) "Ref Geom"
133
           WRITE(*,*) Nat
134
           WRITE(*,*) ""
135
           DO I=1,Nat
136
              WRITE(*,'(1X,A10,3(1X,F15.8),A)') Trim(AtName(I)),XGeomRefPBC(I),YGeomRefPBC(I),ZGeomRefPBC(I)
137
           END DO
138
        END IF
139

  
140
        Call CalcRmsd(Nat,XGeomRefPBC,YGeomRefPBC,ZGeomRefPBC, &
141
             X,Y,Z, MRot, Rmsd,.TRUE.,.TRUE.) 
142

  
143
        If (DEBUG) THEN
144
           WRITE(*,*) "Geom AFTER orientation"
145
           WRITE(*,*) Nat
146
           WRITE(*,*) ""
147
           DO I=1,Nat
148
              WRITE(*,'(1X,A10,3(1X,F15.8),A)') Trim(AtName(I)),X(I),Y(I),Z(I)
149
           END DO
150
        END IF
151
        
152
        If (Renum)  THEN
153
           Do I=1,Nat
154
              Iat=orderInv(I)
155
              GeomCart(Iat,1)=X(I)
156
              GeomCart(Iat,2)=Y(I)
157
              GeomCart(Iat,3)=Z(I)
158
           END DO
159
        END IF
97 160
  CASE ('BAKER')
98 161
     XPrimRef=XPrimitiveF(IGeom,:)
99 162
     IF (Flag_Opt_Geom) THEN
......
184 247
  !  WRITE(*,'(1X,A,3(1X,F12.8))') AtName(I),GeomCart(I,1:3)
185 248
  !END DO
186 249

  
250

  
251

  
187 252
  SELECT CASE (Prog)
188 253
  CASE ('GAUSSIAN')
189 254
! we call the Gaussian routine.

Also available in: Unified diff