Statistiques
| Révision :

root / src / Path_module.f90 @ 3

Historique | Voir | Annoter | Télécharger (11,83 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

    
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

    
86
! Number of steps in memory for Step_RFO_all
87
  INTEGER(KINT) :: NGintMax = 10
88

    
89
  CHARACTER(SCHARS) :: Coord='HYBRID'
90
  CHARACTER(SCHARS) :: Step_method='RFO'
91
  CHARACTER(SCHARS) :: Prog="GAUSSIAN"
92
  CHARACTER(VLCHARS) :: ProgExe="g03"
93

    
94
! PFL 06/2011: HesUpd is deprecated
95
! I replace it by HUpdate that is more intuitive to me
96
  CHARACTER(SCHARS) :: hesupd="BFGS"
97
! HUpdate indicates which method to use for updating the Hessian or its inverse
98
  CHARACTER(SCHARS) :: HUpdate="BFGS"
99

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

    
146
! Triggers the dynamical update of the maximum step
147
  LOGICAL :: DynMaxStep
148

    
149
! Triggers the alignment of not
150
  LOGICAL :: Align
151

    
152

    
153

    
154
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
155
!
156
! Flags for printing
157
!
158
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
159

    
160
! Vmd is set to TRUE if user wants to use VMD to look
161
! at the Path.
162
! For now, used only for VASP
163

    
164
  LOGICAL :: Vmd
165

    
166

    
167
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
168
!
169
! Variables for VASP input/output
170
!
171
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
172
  
173
  REAL(KREAL) :: lat_a(3), lat_b(3), lat_c(3)
174
  REAL(KREAL), ALLOCATABLE :: X0_vasp(:),Y0_vasp(:), Z0_vasp(:) ! nat
175
  REAL(KREAL) :: Latr(3,3)
176
  CHARACTER(LCHARS) :: V_direct
177
! AutoCart : true if user let PATH determines which atoms should be
178
! described in cartesian when COORD=MIXED
179
  LOGICAL :: AutoCart
180

    
181

    
182
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
183
!
184
! General
185
!
186
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
187

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

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

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

    
263
      END MODULE Path_module