root / src / Path_module.f90 @ 8
History  View  Annotate  Download (12.9 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) :: Pi 
16  
17 
! Frozen contains the indices of frozen atoms 
18 
INTEGER(KINT),ALLOCATABLE :: Frozen(:) !Nat 
19 
! Cart contains the indices of atoms described in cartesian coords 
20 
INTEGER(KINT),ALLOCATABLE :: Cart(:) !Nat 
21 
! intFroz is the number of internal coord frozen 
22 
! NFroz the number of frozen atoms 
23 
! Ncart the number of atoms described in cartesian coords 
24 
INTEGER(KINT) :: IntFroz, NFroz, NCart 
25 
! FrozAtoms is true for a frozen atom, false else. 
26 
LOGICAL, ALLOCATABLE :: FrozAtoms(:) !! Nat 
27 
! Number of Primitives (mainly for Baker coordinates) 
28 
INTEGER(KINT) :: NPrim 
29 
! Nat number of atoms 
30 
INTEGER(KINT) :: Nat 
31 
! NGeomI number of initial geometries 
32 
! NgeomF number of final geometries 
33 
INTEGER(KINT) :: NGeomI, NGeomF 
34 
! NCoord=3*Nat or NFree depending on the coordinate choice 
35 
INTEGER(KINT) :: NCoord 
36 
INTEGER(KINT) :: NMaxPtPath=1000 
37 
! IReparam is the period of reparameterization of the Path 
38 
INTEGER(KINT) :: IReparam=1 
39 
! IReparamT is the period of reparameterization of the tangents along the path 
40 
! Be default IReparamT=IReparam 
41 
INTEGER(KINT) :: IReparamT 
42 
! ISpline is the iteration number where spline interpolation starts to be used 
43 
! instead of linear interpolation 
44 
INTEGER(KINT) :: ISpline=1 
45 
! Linear: if TRUE, then we perform linear interpolation and not spline 
46 
LOGICAL :: Linear 
47  
48 
! FrozTol is the criterion to decide wether a frozen atom has moved between 
49 
! two initial geometries 
50 
REAL(KREAL) :: FrozTol=1e4 
51  
52 
! BoxTol is the criterion to decide wether an atom has crossed the box between 
53 
! two initial geometries 
54 
REAL(KREAL) :: BoxTol=0.5 
55  
56 
LOGICAL :: Freq, MW, Bohr, Renum, Hinv 
57 
! OptReac: if TRUE the reactants will be optimized. Default is FALSE 
58 
LOGICAL :: OptReac 
59 
! OptProd: if TRUE the products will be optimized. Default is FALSE 
60 
LOGICAL :: OptProd 
61 
! PathOnly: if TRUE, only the initial path will be constructed. 
62 
! Default is FALSE, that is OpenPath construct the path and optimize it 
63 
LOGICAL :: PathOnly 
64 
! CalcEReac: if TRUE the reactants energy will be computed. Default is FALSE 
65 
! Not compatible with RunMode=Para 
66 
LOGICAL :: CalcEReac 
67 
! CalEProd: if TRUE the products energy will be computed. Default is FALSE 
68 
! Not compatible with RunMode=Para 
69 
LOGICAL :: CalcEProd 
70 
! AnaGeom: if TRUE the geometries are analyzed 
71 
LOGICAL :: AnaGeom 
72 
! Name of the file to analyse geometries 
73 
CHARACTER(LCHARS) :: AnaFile 
74 
! Name of the Gplot file to see the path evolution 
75 
CHARACTER(LCHARS) :: GplotFile 
76 
! Nb: number of variables to monitor, including Centers of Mass 
77 
INTEGER(KINT) :: Nb 
78 
! NbVar: number of geometrical variables to monitor 
79 
INTEGER(KINT) :: NbVar 
80 
! NbCom: number of center of mass to create 
81 
INTEGER(KINT) :: NbCom 
82 
TYPE(ListCoord), POINTER :: GeomList,CurVar 
83 
TYPE(Barycenter), POINTER :: Bary,CurBary 
84 
! Format to print the values 
85 
CHARACTER(VLCHARS) :: FormAna 
86 
! Factor to use to print the values 
87 
REAL(KREAL), ALLOCATABLE :: PrintGeomFactor(:) ! NbVar 
88 
! How to update the Hessian 
89 
LOGICAL :: IniHup,HupNeighbour 
90  
91 
REAL(KREAL) :: Fact,FTan 
92 
! IGeomRef is the index of the reference geometry, used to calculate the Zmat 
93 
! or the Baker coordinates. 
94 
INTEGER(KINT) :: IGeomRef=1 
95 
! For geometry optimization , OptGeom is the index of the starting geometry 
96 
INTEGER(KINT) :: OptGeom=1 
97  
98 
! Optimization parameter 
99 
INTEGER(KINT) :: MaxCyc 
100 
REAL(KREAL) :: SThresh, Smax, SthreshRms 
101 
REAL(KREAL) :: GThresh, GThreshRMS 
102 
! Name of the file to print geometries and their energies 
103 
CHARACTER(LCHARS) :: GeomFile 
104 
! Flag to decide if we print something in GeomFile 
105 
LOGICAL :: FPrintGeom 
106  
107 
! Number of steps in memory for Step_RFO_all 
108 
INTEGER(KINT) :: NGintMax = 10 
109  
110 
CHARACTER(SCHARS) :: Coord='HYBRID' 
111 
CHARACTER(SCHARS) :: Step_method='RFO' 
112 
CHARACTER(SCHARS) :: Prog="GAUSSIAN" 
113 
CHARACTER(VLCHARS) :: ProgExe="g03" 
114 
! Input: format of the geometry input 
115 
! PFL 2013/02: This name is dumb ! I should have used GeomFormat ! => To DO!! 
116 
CHARACTER(SCHARS) :: Input 
117 
! Poscar: is the name to use for POSCAR files for VASP 
118 
CHARACTER(SCHARS) :: Poscar 
119  
120 
! PFL 06/2011: HesUpd is deprecated 
121 
! I replace it by HUpdate that is more intuitive to me 
122 
CHARACTER(SCHARS) :: hesupd="BFGS" 
123 
! HUpdate indicates which method to use for updating the Hessian or its inverse 
124 
CHARACTER(SCHARS) :: HUpdate="BFGS" 
125  
126 
REAL(KREAL), ALLOCATABLE, TARGET :: XyzGeomI(:,:,:) ! (NGeomI,3,Nat) 
127 
REAL(KREAL), ALLOCATABLE :: XyzGeomF(:,:,:) ! (NGeomF,3,Nat) 
128 
REAL(KREAL), ALLOCATABLE :: XyzTangent(:,:) ! (NGeomF,3*Nat) 
129 
REAL(KREAL), ALLOCATABLE :: IntTangent(:,:) ! (NGeomF,Nfree=3Nat6) 
130 
REAL(KREAL), ALLOCATABLE :: IntCoordI(:,:) ! (NGeomI,3*Nat6) 
131 
! IntCoordF: Final Internal coordinates for number of final geometries. 
132 
! 3*Nat6 is the number of coordinates (NCoord) of each geometry. 
133 
REAL(KREAL), ALLOCATABLE :: IntCoordF(:,:) ! (NGeomF,3*Nat6) 
134 
REAL(KREAL), ALLOCATABLE :: Vfree(:,:) ! (Ncoord,Ncoord) 
135 
REAL(KREAL), ALLOCATABLE :: SGeom(:) ! (NGeomF) 
136 
REAL(KREAL), ALLOCATABLE :: Energies(:) ! NGeomF 
137 
! NCoord=3*Nat or NFree depending on the coordinate choice 
138 
REAL(KREAL), ALLOCATABLE :: Grad(:,:) ! (NGeomF,NCoord) 
139 
REAL(KREAL), ALLOCATABLE :: Hess(:,:,:) !(NgeomF, N,N) 
140 
REAL(KREAL), ALLOCATABLE :: DzDc(:,:,:,:) ! (3,Nat,3,Nat) 
141 
REAL(KREAL), ALLOCATABLE :: BMat_BakerT(:,:) ! (3*Nat,NCoord) 
142 
INTEGER(KINT), ALLOCATABLE :: IndZmat(:,:) ! (Nat,5) 
143 
INTEGER(KINT), ALLOCATABLE :: Order(:),OrderInv(:) ! Nat 
144 
CHARACTER(10), ALLOCATABLE :: AtName(:) ! Nat 
145 
INTEGER(KINT), ALLOCATABLE :: Atome(:) ! Nat 
146 
REAL(KREAL), ALLOCATABLE :: MassAt(:) ! Nat 
147 
REAL(KREAL), ALLOCATABLE :: BTransInv(:,:) ! BTransInv (3*Nat6,3*Nat), used for Baker case. 
148 
REAL(KREAL), ALLOCATABLE :: BTransInvF(:,:,:) ! BTransInvF (NGeomF,3*Nat6,3*Nat) 
149 
! BTransInv_local (3*Nat6,3*Nat), used for Baker case in Opt_Geom.f90 
150 
REAL(KREAL), ALLOCATABLE :: BTransInv_local(:,:) 
151 
REAL(KREAL), ALLOCATABLE :: UMat(:,:) !(NPrim,3*Nat6) 
152 
REAL(KREAL), ALLOCATABLE :: UMat_local(:,:) !(NPrim,3*Nat6) 
153 
REAL(KREAL), ALLOCATABLE :: UMatF(:,:,:) !(NGeomF,NPrim,3*Nat6) 
154 
!REAL(KREAL), ALLOCATABLE :: IntCoordIBaker(:,:) ! (NGeomI,NCoord=3*Nat6) 
155 
! IntCoordIBaker allocated in PathCreate.f90 
156 
REAL(KREAL), ALLOCATABLE :: Xprimitive(:,:) ! Xprimitive(NgeomI,NPrim) 
157 
REAL(KREAL), ALLOCATABLE :: Xprimitive_t(:) ! used in ConvertBakerInternal_cart.f as a temporary variable. 
158 
REAL(KREAL), ALLOCATABLE :: XprimitiveF(:,:) ! Xprimitive(NgeomF,NPrim) 
159 
REAL(KREAL), ALLOCATABLE :: GeomOld_all(:,:) 
160 
REAL(KREAL), ALLOCATABLE :: GeomOld(:) ! Used in DIIS step method. 
161 

162 
LOGICAL, PARAMETER :: FRot=.TRUE., FAlign=.TRUE. 
163 
REAL(KREAL), ALLOCATABLE :: BprimT(:,:) !(3*Nat,NPrim). This is B^prim. 
164 
REAL(KREAL), ALLOCATABLE :: BBT(:,:) ! BBT (3*Nat6,3*Nat6), used for Baker case 
165 
REAL(KREAL), ALLOCATABLE :: BBT_inv(:,:) ! BBT_inv (3*Nat6,3*Nat6), used for Baker case 
166 
INTEGER(KINT) :: Symmetry_elimination 
167 
LOGICAL :: FirstTimePathCreate 
168 

169 
Type (ListCoord), POINTER :: Coordinate, CurrentCoord 
170 
Type (ListCoord), POINTER :: ScanCoord 
171  
172 
! Triggers the dynamical update of the maximum step 
173 
LOGICAL :: DynMaxStep 
174  
175 
! Triggers the alignment of not 
176 
LOGICAL :: Align 
177  
178  
179  
180 
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
181 
! 
182 
! Flags for printing 
183 
! 
184 
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
185  
186 
! Vmd is set to TRUE if user wants to use VMD to look 
187 
! at the Path. 
188 
! For now, used only for VASP 
189  
190 
LOGICAL :: Vmd 
191  
192  
193 
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
194 
! 
195 
! Variables for VASP input/output 
196 
! 
197 
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
198 

199 
REAL(KREAL) :: lat_a(3), lat_b(3), lat_c(3) 
200 
REAL(KREAL), ALLOCATABLE :: X0_vasp(:),Y0_vasp(:), Z0_vasp(:) ! nat 
201 
REAL(KREAL) :: Latr(3,3) 
202 
CHARACTER(LCHARS) :: V_direct 
203 
! AutoCart : true if user let PATH determines which atoms should be 
204 
! described in cartesian when COORD=MIXED 
205 
LOGICAL :: AutoCart 
206  
207  
208 
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
209 
! 
210 
! General 
211 
! 
212 
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
213  
214 
CHARACTER(2) :: Nom(0:max_Z)=(/ ' X',' H', 'HE', & 
215 
'LI','BE', ' B',' C',' N',' O',' F','NE', & 
216 
'NA','MG', 'AL','SI',' P',' S','CL','AR', & 
217 
' K','CA', & 
218 
'SC','TI',' V','CR','MN','FE','CO','NI','CU','ZN', & 
219 
'GA','GE','AS','SE','BR','KR', & 
220 
'RB','SR', & 
221 
' Y','ZR','NB','MO','TC','RU','RH','PD','AG','CD', & 
222 
'IN','SN','SB','TE',' I','XE', & 
223 
'CS','BA', & 
224 
'LA', & 
225 
'CE','PR','ND','PM','SM','EU','GD','TB','DY','HO', & 
226 
'ER','TM','YB','LU', & 
227 
'HF','TA',' W','RE','OS','IR','PT','AU','HG', & 
228 
'TL','PB','BI','PO','AT','RN'/) 
229  
230 
! This is the new table, more complete, taken from a periodic table 
231 
! some value have been changed to be consistent 
232 
REAL(KREAL) :: r_cov(0:max_Z)=(/ 1e13, 37., 93., & 
233 
! 2 'LI','BE', ' B',' C',' N',' O',' F','NE', 
234 
123.,90., 82., 77., 75., 73., 71., 69., & 
235 
! 3 'NA','MG', 'AL','SI',' P',' S','CL','AR', 
236 
154.,136., 118.,111.,106.,102., 99., 97., & 
237 
! 4 ' K','CA', 
238 
203., 174., & 
239 
! 4 'SC','TI',' V','CR','MN','FE','CO','NI','CU','ZN', 
240 
144.,132.,122.,118.,117.,117.,116.,115.,117.,125., & 
241 
! 4 'GA','GE','AS','SE','BR','KR', 
242 
120.,122.,122.,117.,114.,110., & 
243 
! 5 'RB','SR', 
244 
216.,191., & 
245 
! 5 ' Y','ZR','NB','MO','TC','RU','RH','PD','AG','CD', 
246 
162.,145.,134.,130.,127.,125.,125.,128.,134.,148., & 
247 
! 5 'IN','SN','SB','TE',' I','XE', 
248 
144.,140.,143.,135.,133.,130., & 
249 
! 6 'CS','BA', 
250 
235., 198., & 
251 
! 6 'LA', 
252 
! 'CE','PR','ND','PM','SM','EU','GD','TB','DY','HO', & 
253 
! 'ER','TM','YB','LU', & 
254 
169., & 
255 
165., 165., 164., 163., 162., 185., 161., 159., 159., 158., & 
256 
157., 156., 184.,156., & 
257 
! 6 'HF','TA',' W','RE','OS','IR','PT','AU','HG', 
258 
! 6 'TL','PB','BI','PO','AT','RN'/ 
259 
144., 134., 130., 126., 126., 127., 120., 134., 149., & 
260 
148., 147., 146., 146., 148., 151. /) 
261  
262 
REAL(KREAL) :: Mass(0:Max_Z)=(/0.0D0,1.0078D0, 4.0026D0, & 
263 
7.0160D0, 9.0122D0,11.0093D0, & 
264 
12.0000D0,14.0031D0,15.9949D0,18.9984D0,19.9924D0, & 
265 
22.9898D0,23.9850D0,26.9815D0, & 
266 
27.9769D0,30.9738D0,31.9721D0,34.9688D0,39.9624D0, & 
267 
39.0983D0,40.08D0, & 
268 
44.9559D0, 47.88D0, 50.9415D0, 51.996D0, 54.9380D0, & 
269 
55.847D0, 58.9332D0, 58.69D0, 63.546D0, 65.39D0, & 
270 
69.72D0,72.59D0,74.9216D0,78.96D0,79.904D0,83.80D0, & 
271 
85.4678D0,87.62D0,88.9059D0,91.224D0,92.9064D0, & 
272 
95.94D0,98D0,101.07D0,102.906D0,106.42D0,107.868D0,112.41D0, & 
273 
114.82D0,118.71D0,121.75D0,127.60D0,126.905D0,131.29D0, & 
274 
! 6 'CS','BA', 
275 
132.905D0,137.34D0, & 
276 
! 6 'LA', 
277 
! 'CE','PR','ND','PM','SM','EU','GD', 
278 
! 'TB','DY','HO', 'ER','TM','YB','LU', 
279 
138.91D0, & 
280 
140.12D0, 130.91D0, 144.24D0,147.D0,150.35D0, 151.96D0,157.25D0, & 
281 
158.924D0, 162.50D0, 164.93D0, 167.26D0,168.93D0,173.04D0,174.97D0, & 
282 
! 6 'HF','TA',' W','RE','OS','IR','PT', 
283 
! 'AU','HG', 
284 
! 6 'TL','PB','BI','PO','AT','RN'/ 
285 
178.49D0, 180.95D0, 183.85D0, 186.2D0, 190.2D0, 192.2D0, 195.09D0, & 
286 
196.97D0, 200.59D0, & 
287 
204.37D0, 207.19D0,208.98D0,210.D0,210.D0,222.D0 /) 
288  
289 
END MODULE Path_module 