Statistics
| Revision:

root / src / Path_module.f90 @ 5

History | View | Annotate | Download (12.2 kB)

1
MODULE Path_module
2
! This module contains most of the variables needed for the path
3

    
4
  use VarTypes
5

    
6
  IMPLICIT NONE
7

    
8
  SAVE
9

    
10
  INTEGER(KINT), PARAMETER :: NMaxL=21
11
  INTEGER(KINT), PARAMETER :: Max_Z=86
12
  INTEGER(KINT), PARAMETER :: MaxFroz=100
13
  REAL(KREAL), PARAMETER :: a0=0.529177249d0
14
  REAL(KREAL), PARAMETER :: Unit=1.d0/a0
15
  REAL(KREAL), PARAMETER :: au2kcal=627.509608d0
16
  REAL(KREAL) :: Pi
17

    
18
 ! Frozen contains the indices of frozen atoms
19
  INTEGER(KINT),ALLOCATABLE :: Frozen(:) !Nat
20
 ! Cart contains the indices of atoms described in cartesian coords
21
  INTEGER(KINT),ALLOCATABLE :: Cart(:) !Nat
22
! intFroz is the number of internal coord frozen
23
! NFroz the number of frozen atoms
24
! Ncart the number of  atoms described in cartesian coords
25
  INTEGER(KINT) :: IntFroz, NFroz, NCart
26
! FrozAtoms is true for a frozen atom, false else.
27
  LOGICAL, ALLOCATABLE :: FrozAtoms(:)  !! Nat
28
! Number of Primitives (mainly for Baker coordinates)
29
  INTEGER(KINT) :: NPrim
30
! Nat number of atoms
31
  INTEGER(KINT) :: Nat
32
! NGeomI number of initial geometries
33
! NgeomF number of final geometries
34
  INTEGER(KINT) :: NGeomI, NGeomF
35
! NCoord=3*Nat or NFree depending on the coordinate choice
36
  INTEGER(KINT) :: NCoord
37
  INTEGER(KINT) :: NMaxPtPath=1000
38
! IReparam is the period of reparameterization of the Path
39
  INTEGER(KINT) :: IReparam=1
40
! IReparamT is the period of reparameterization of the tangents along the path
41
! Be default IReparamT=IReparam
42
  INTEGER(KINT) :: IReparamT
43
! ISpline is the iteration number where spline interpolation starts to be used 
44
! instead of linear interpolation
45
  INTEGER(KINT) :: ISpline=1
46
! Linear: if TRUE, then we perform linear interpolation and not spline
47
  LOGICAL :: Linear
48

    
49
! FrozTol is the criterion to decide wether a frozen atom has moved between
50
! two initial geometries
51
  REAL(KREAL) :: FrozTol=1e-4
52

    
53
! BoxTol is the criterion to decide wether an atom has crossed the box between
54
! two initial geometries
55
  REAL(KREAL) :: BoxTol=0.5
56

    
57

    
58
  LOGICAL :: Freq, MW, Bohr, Renum, Hinv
59
! OptReac: if TRUE the reactants will be optimized. Default is FALSE
60
  LOGICAL :: OptReac
61
! OptProd: if TRUE the products will be optimized. Default is FALSE
62
  LOGICAL :: OptProd
63
! PathOnly: if TRUE, only the initial path will be constructed.
64
! Default is FALSE, that is OpenPath construct the path and optimize it
65
  LOGICAL :: PathOnly
66
! CalcEReac: if TRUE the reactants energy will be computed. Default is FALSE
67
! Not compatible with RunMode=Para
68
  LOGICAL :: CalcEReac
69
! CalEProd: if TRUE the products energy will be computed. Default is FALSE
70
! Not compatible with RunMode=Para
71
  LOGICAL :: CalcEProd
72
  LOGICAL :: IniHup,HupNeighbour
73

    
74
  REAL(KREAL) :: Fact,FTan
75
! IGeomRef is the index of the reference geometry, used to calculate the Zmat
76
! or the Baker coordinates.
77
  INTEGER(KINT) :: IGeomRef=-1
78
! For geometry optimization , OptGeom is the index of the starting geometry
79
  INTEGER(KINT) :: OptGeom=-1
80

    
81
! Optimization parameter
82
  INTEGER(KINT) :: MaxCyc
83
  REAL(KREAL) :: SThresh, Smax, SthreshRms
84
  REAL(KREAL) :: GThresh, GThreshRMS
85
! Name of the file to print geometries and their energies
86
  CHARACTER(LCHARS) :: GeomFile
87
! Flag to decide if we print something in GeomFile
88
  LOGICAL :: FPrintGeom
89

    
90
! Number of steps in memory for Step_RFO_all
91
  INTEGER(KINT) :: NGintMax = 10
92

    
93
  CHARACTER(SCHARS) :: Coord='HYBRID'
94
  CHARACTER(SCHARS) :: Step_method='RFO'
95
  CHARACTER(SCHARS) :: Prog="GAUSSIAN"
96
  CHARACTER(VLCHARS) :: ProgExe="g03"
97
! Input: format of the geometry input 
98
! PFL 2013/02: This name is dumb ! I should have used GeomFormat ! => To DO!!
99
  CHARACTER(SCHARS) :: Input
100
! Poscar: is the name to use for POSCAR files for VASP
101
  CHARACTER(SCHARS) :: Poscar
102

    
103
! PFL 06/2011: HesUpd is deprecated
104
! I replace it by HUpdate that is more intuitive to me
105
  CHARACTER(SCHARS) :: hesupd="BFGS"
106
! HUpdate indicates which method to use for updating the Hessian or its inverse
107
  CHARACTER(SCHARS) :: HUpdate="BFGS"
108

    
109
  REAL(KREAL), ALLOCATABLE, TARGET :: XyzGeomI(:,:,:) ! (NGeomI,3,Nat)
110
  REAL(KREAL), ALLOCATABLE :: XyzGeomF(:,:,:) ! (NGeomF,3,Nat)
111
  REAL(KREAL), ALLOCATABLE :: XyzTangent(:,:)   ! (NGeomF,3*Nat)
112
  REAL(KREAL), ALLOCATABLE :: IntTangent(:,:)   ! (NGeomF,Nfree=3Nat-6)
113
  REAL(KREAL), ALLOCATABLE :: IntCoordI(:,:) ! (NGeomI,3*Nat-6)
114
  ! IntCoordF: Final Internal coordinates for number of final geometries.
115
  ! 3*Nat-6 is the number of coordinates (NCoord) of each geometry. 
116
  REAL(KREAL), ALLOCATABLE :: IntCoordF(:,:) ! (NGeomF,3*Nat-6)
117
  REAL(KREAL), ALLOCATABLE :: Vfree(:,:) ! (Ncoord,Ncoord)
118
  REAL(KREAL), ALLOCATABLE :: SGeom(:) ! (NGeomF)
119
  REAL(KREAL), ALLOCATABLE :: Energies(:) ! NGeomF
120
! NCoord=3*Nat or NFree depending on the coordinate choice
121
  REAL(KREAL), ALLOCATABLE :: Grad(:,:) ! (NGeomF,NCoord)
122
  REAL(KREAL), ALLOCATABLE :: Hess(:,:,:)  !(NgeomF, N,N)
123
  REAL(KREAL), ALLOCATABLE :: DzDc(:,:,:,:) ! (3,Nat,3,Nat)
124
  REAL(KREAL), ALLOCATABLE :: BMat_BakerT(:,:) ! (3*Nat,NCoord)
125
  INTEGER(KINT), ALLOCATABLE :: IndZmat(:,:)   ! (Nat,5)
126
  INTEGER(KINT), ALLOCATABLE :: Order(:),OrderInv(:) ! Nat
127
  CHARACTER(10), ALLOCATABLE :: AtName(:) ! Nat
128
  INTEGER(KINT), ALLOCATABLE :: Atome(:) ! Nat
129
  REAL(KREAL), ALLOCATABLE :: MassAt(:)   ! Nat
130
  REAL(KREAL), ALLOCATABLE :: BTransInv(:,:) ! BTransInv (3*Nat-6,3*Nat), used for Baker case.
131
  REAL(KREAL), ALLOCATABLE :: BTransInvF(:,:,:) ! BTransInvF (NGeomF,3*Nat-6,3*Nat)
132
  ! BTransInv_local (3*Nat-6,3*Nat), used for Baker case in Opt_Geom.f90
133
  REAL(KREAL), ALLOCATABLE :: BTransInv_local(:,:)
134
  REAL(KREAL), ALLOCATABLE :: UMat(:,:) !(NPrim,3*Nat-6)
135
  REAL(KREAL), ALLOCATABLE :: UMat_local(:,:) !(NPrim,3*Nat-6)
136
  REAL(KREAL), ALLOCATABLE :: UMatF(:,:,:) !(NGeomF,NPrim,3*Nat-6)
137
  !REAL(KREAL), ALLOCATABLE :: IntCoordIBaker(:,:) ! (NGeomI,NCoord=3*Nat-6)
138
  ! IntCoordIBaker allocated in PathCreate.f90
139
  REAL(KREAL), ALLOCATABLE :: Xprimitive(:,:) ! Xprimitive(NgeomI,NPrim)
140
  REAL(KREAL), ALLOCATABLE :: Xprimitive_t(:) ! used in ConvertBakerInternal_cart.f as a temporary variable.
141
  REAL(KREAL), ALLOCATABLE :: XprimitiveF(:,:) ! Xprimitive(NgeomF,NPrim)
142
  REAL(KREAL), ALLOCATABLE :: GeomOld_all(:,:)
143
  REAL(KREAL), ALLOCATABLE :: GeomOld(:) ! Used in DIIS step method.
144
  
145
  LOGICAL, PARAMETER :: FRot=.TRUE., FAlign=.TRUE.
146
  REAL(KREAL), ALLOCATABLE :: BprimT(:,:) !(3*Nat,NPrim). This is B^prim.
147
  REAL(KREAL), ALLOCATABLE :: BBT(:,:) ! BBT (3*Nat-6,3*Nat-6), used for Baker case
148
  REAL(KREAL), ALLOCATABLE :: BBT_inv(:,:) ! BBT_inv (3*Nat-6,3*Nat-6), used for Baker case
149
  INTEGER(KINT) :: Symmetry_elimination
150
  LOGICAL :: FirstTimePathCreate
151
  
152
  Type (ListCoord), POINTER :: Coordinate, CurrentCoord 
153
  Type (ListCoord), POINTER :: ScanCoord
154

    
155
! Triggers the dynamical update of the maximum step
156
  LOGICAL :: DynMaxStep
157

    
158
! Triggers the alignment of not
159
  LOGICAL :: Align
160

    
161

    
162

    
163
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
164
!
165
! Flags for printing
166
!
167
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
168

    
169
! Vmd is set to TRUE if user wants to use VMD to look
170
! at the Path.
171
! For now, used only for VASP
172

    
173
  LOGICAL :: Vmd
174

    
175

    
176
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
177
!
178
! Variables for VASP input/output
179
!
180
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
181
  
182
  REAL(KREAL) :: lat_a(3), lat_b(3), lat_c(3)
183
  REAL(KREAL), ALLOCATABLE :: X0_vasp(:),Y0_vasp(:), Z0_vasp(:) ! nat
184
  REAL(KREAL) :: Latr(3,3)
185
  CHARACTER(LCHARS) :: V_direct
186
! AutoCart : true if user let PATH determines which atoms should be
187
! described in cartesian when COORD=MIXED
188
  LOGICAL :: AutoCart
189

    
190

    
191
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
192
!
193
! General
194
!
195
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
196

    
197
  CHARACTER(2) :: Nom(0:max_Z)=(/ ' X',' H',                   'HE',  &
198
                'LI','BE',            ' B',' C',' N',' O',' F','NE',  &
199
                'NA','MG',            'AL','SI',' P',' S','CL','AR',  &
200
                ' K','CA',                                            &
201
            'SC','TI',' V','CR','MN','FE','CO','NI','CU','ZN',        &
202
                                      'GA','GE','AS','SE','BR','KR',  &
203
                'RB','SR',                                            &
204
            ' Y','ZR','NB','MO','TC','RU','RH','PD','AG','CD',        &
205
                                      'IN','SN','SB','TE',' I','XE',  &
206
                'CS','BA',                                            &
207
            'LA',                                                     &
208
              'CE','PR','ND','PM','SM','EU','GD','TB','DY','HO',      &
209
              'ER','TM','YB','LU',                                    &
210
                     'HF','TA',' W','RE','OS','IR','PT','AU','HG',    &
211
                                      'TL','PB','BI','PO','AT','RN'/)
212

    
213
! This is the new table, more complete, taken from a periodic table
214
! some value have been changed to be consistent
215
  REAL(KREAL) ::  r_cov(0:max_Z)=(/ 1e-13, 37.,                93.,     &
216
!     2           'LI','BE',          ' B',' C',' N',' O',' F','NE',
217
                  123.,90.,            82., 77., 75., 73., 71., 69.,     &
218
!     3           'NA','MG',          'AL','SI',' P',' S','CL','AR',
219
                  154.,136.,          118.,111.,106.,102., 99., 97.,     &
220
!     4           ' K','CA',
221
                  203.,  174.,                                           &
222
!     4       'SC','TI',' V','CR','MN','FE','CO','NI','CU','ZN',
223
             144.,132.,122.,118.,117.,117.,116.,115.,117.,125.,          &
224
!     4                               'GA','GE','AS','SE','BR','KR',
225
                                     120.,122.,122.,117.,114.,110.,      &
226
!     5           'RB','SR',
227
                 216.,191.,                                              &
228
!     5       ' Y','ZR','NB','MO','TC','RU','RH','PD','AG','CD', 
229
              162.,145.,134.,130.,127.,125.,125.,128.,134.,148.,         &
230
!     5                               'IN','SN','SB','TE',' I','XE',
231
                                     144.,140.,143.,135.,133.,130.,      &
232
!     6           'CS','BA',
233
                 235., 198.,                                             &
234
!     6       'LA',
235
!               'CE','PR','ND','PM','SM','EU','GD','TB','DY','HO',      &
236
!               'ER','TM','YB','LU',                                    &
237
             169.,                                                       &  
238
             165., 165., 164., 163., 162., 185., 161., 159., 159., 158., &
239
             157., 156., 184.,156.,                                      &
240
!     6                'HF','TA',' W','RE','OS','IR','PT','AU','HG',
241
!     6                                 'TL','PB','BI','PO','AT','RN'/
242
             144., 134., 130., 126., 126., 127., 120., 134., 149.,       &
243
                        148., 147., 146., 146., 148., 151. /)
244

    
245
  REAL(KREAL) :: Mass(0:Max_Z)=(/0.0D0,1.0078D0,          4.0026D0,      &
246
                  7.0160D0, 9.0122D0,11.0093D0,                          &
247
                 12.0000D0,14.0031D0,15.9949D0,18.9984D0,19.9924D0,      &
248
                 22.9898D0,23.9850D0,26.9815D0,                          &
249
                 27.9769D0,30.9738D0,31.9721D0,34.9688D0,39.9624D0,      &
250
                 39.0983D0,40.08D0,                                      &
251
                   44.9559D0, 47.88D0, 50.9415D0, 51.996D0, 54.9380D0,   &
252
                   55.847D0, 58.9332D0, 58.69D0, 63.546D0, 65.39D0,      &
253
                 69.72D0,72.59D0,74.9216D0,78.96D0,79.904D0,83.80D0,     &
254
                 85.4678D0,87.62D0,88.9059D0,91.224D0,92.9064D0,         &
255
         95.94D0,98D0,101.07D0,102.906D0,106.42D0,107.868D0,112.41D0,    &
256
         114.82D0,118.71D0,121.75D0,127.60D0,126.905D0,131.29D0,         &
257
!     6           'CS','BA',
258
                 132.905D0,137.34D0,                                      &
259
!     6       'LA',
260
!               'CE','PR','ND','PM','SM','EU','GD',
261
!               'TB','DY','HO', 'ER','TM','YB','LU',   
262
            138.91D0,                                                      &
263
            140.12D0, 130.91D0, 144.24D0,147.D0,150.35D0, 151.96D0,157.25D0,  &
264
          158.924D0, 162.50D0, 164.93D0, 167.26D0,168.93D0,173.04D0,174.97D0, &
265
!     6                'HF','TA',' W','RE','OS','IR','PT',
266
!                      'AU','HG',
267
!     6                                 'TL','PB','BI','PO','AT','RN'/
268
         178.49D0, 180.95D0, 183.85D0, 186.2D0, 190.2D0, 192.2D0, 195.09D0,  &
269
             196.97D0, 200.59D0,                                             &
270
             204.37D0, 207.19D0,208.98D0,210.D0,210.D0,222.D0 /)
271

    
272
      END MODULE Path_module