Statistiques
| Révision :

root / src / Path_module.f90 @ 7

Historique | Voir | Annoter | Télécharger (12,85 ko)

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
  LOGICAL :: Freq, MW, Bohr, Renum, Hinv
58
! OptReac: if TRUE the reactants will be optimized. Default is FALSE
59
  LOGICAL :: OptReac
60
! OptProd: if TRUE the products will be optimized. Default is FALSE
61
  LOGICAL :: OptProd
62
! PathOnly: if TRUE, only the initial path will be constructed.
63
! Default is FALSE, that is OpenPath construct the path and optimize it
64
  LOGICAL :: PathOnly
65
! CalcEReac: if TRUE the reactants energy will be computed. Default is FALSE
66
! Not compatible with RunMode=Para
67
  LOGICAL :: CalcEReac
68
! CalEProd: if TRUE the products energy will be computed. Default is FALSE
69
! Not compatible with RunMode=Para
70
  LOGICAL :: CalcEProd
71
! AnaGeom: if TRUE the geometries are analyzed
72
  LOGICAL :: AnaGeom
73
! Name of the file to analyse geometries
74
  CHARACTER(LCHARS) :: AnaFile
75
! Nb: number of variables to monitor, including Centers of Mass
76
  INTEGER(KINT) :: Nb
77
! NbVar: number of geometrical variables to monitor
78
  INTEGER(KINT) :: NbVar
79
! NbCom: number of center of mass to create
80
  INTEGER(KINT) :: NbCom
81
  TYPE(ListCoord), POINTER :: GeomList,CurVar
82
  TYPE(Barycenter), POINTER :: Bary,CurBary
83
! Format to print the values
84
  CHARACTER(VLCHARS) :: FormAna
85
! Factor to use to print the values
86
  REAL(KREAL), ALLOCATABLE :: PrintGeomFactor(:) ! NbVar
87
! How to update the Hessian
88
  LOGICAL :: IniHup,HupNeighbour
89

    
90
  REAL(KREAL) :: Fact,FTan
91
! IGeomRef is the index of the reference geometry, used to calculate the Zmat
92
! or the Baker coordinates.
93
  INTEGER(KINT) :: IGeomRef=-1
94
! For geometry optimization , OptGeom is the index of the starting geometry
95
  INTEGER(KINT) :: OptGeom=-1
96

    
97
! Optimization parameter
98
  INTEGER(KINT) :: MaxCyc
99
  REAL(KREAL) :: SThresh, Smax, SthreshRms
100
  REAL(KREAL) :: GThresh, GThreshRMS
101
! Name of the file to print geometries and their energies
102
  CHARACTER(LCHARS) :: GeomFile
103
! Flag to decide if we print something in GeomFile
104
  LOGICAL :: FPrintGeom
105

    
106
! Number of steps in memory for Step_RFO_all
107
  INTEGER(KINT) :: NGintMax = 10
108

    
109
  CHARACTER(SCHARS) :: Coord='HYBRID'
110
  CHARACTER(SCHARS) :: Step_method='RFO'
111
  CHARACTER(SCHARS) :: Prog="GAUSSIAN"
112
  CHARACTER(VLCHARS) :: ProgExe="g03"
113
! Input: format of the geometry input 
114
! PFL 2013/02: This name is dumb ! I should have used GeomFormat ! => To DO!!
115
  CHARACTER(SCHARS) :: Input
116
! Poscar: is the name to use for POSCAR files for VASP
117
  CHARACTER(SCHARS) :: Poscar
118

    
119
! PFL 06/2011: HesUpd is deprecated
120
! I replace it by HUpdate that is more intuitive to me
121
  CHARACTER(SCHARS) :: hesupd="BFGS"
122
! HUpdate indicates which method to use for updating the Hessian or its inverse
123
  CHARACTER(SCHARS) :: HUpdate="BFGS"
124

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

    
171
! Triggers the dynamical update of the maximum step
172
  LOGICAL :: DynMaxStep
173

    
174
! Triggers the alignment of not
175
  LOGICAL :: Align
176

    
177

    
178

    
179
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
180
!
181
! Flags for printing
182
!
183
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
184

    
185
! Vmd is set to TRUE if user wants to use VMD to look
186
! at the Path.
187
! For now, used only for VASP
188

    
189
  LOGICAL :: Vmd
190

    
191

    
192
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
193
!
194
! Variables for VASP input/output
195
!
196
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
197
  
198
  REAL(KREAL) :: lat_a(3), lat_b(3), lat_c(3)
199
  REAL(KREAL), ALLOCATABLE :: X0_vasp(:),Y0_vasp(:), Z0_vasp(:) ! nat
200
  REAL(KREAL) :: Latr(3,3)
201
  CHARACTER(LCHARS) :: V_direct
202
! AutoCart : true if user let PATH determines which atoms should be
203
! described in cartesian when COORD=MIXED
204
  LOGICAL :: AutoCart
205

    
206

    
207
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
208
!
209
! General
210
!
211
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
212

    
213
  CHARACTER(2) :: Nom(0:max_Z)=(/ ' X',' H',                   'HE',  &
214
                'LI','BE',            ' B',' C',' N',' O',' F','NE',  &
215
                'NA','MG',            'AL','SI',' P',' S','CL','AR',  &
216
                ' K','CA',                                            &
217
            'SC','TI',' V','CR','MN','FE','CO','NI','CU','ZN',        &
218
                                      'GA','GE','AS','SE','BR','KR',  &
219
                'RB','SR',                                            &
220
            ' Y','ZR','NB','MO','TC','RU','RH','PD','AG','CD',        &
221
                                      'IN','SN','SB','TE',' I','XE',  &
222
                'CS','BA',                                            &
223
            'LA',                                                     &
224
              'CE','PR','ND','PM','SM','EU','GD','TB','DY','HO',      &
225
              'ER','TM','YB','LU',                                    &
226
                     'HF','TA',' W','RE','OS','IR','PT','AU','HG',    &
227
                                      'TL','PB','BI','PO','AT','RN'/)
228

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

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

    
288
      END MODULE Path_module