Statistics
| Revision:

root / src / Path_module.f90 @ 7

History | View | Annotate | Download (12.8 kB)

1 1 pfleura2
MODULE Path_module
2 1 pfleura2
! This module contains most of the variables needed for the path
3 1 pfleura2
4 1 pfleura2
  use VarTypes
5 1 pfleura2
6 1 pfleura2
  IMPLICIT NONE
7 1 pfleura2
8 1 pfleura2
  SAVE
9 1 pfleura2
10 1 pfleura2
  INTEGER(KINT), PARAMETER :: NMaxL=21
11 1 pfleura2
  INTEGER(KINT), PARAMETER :: Max_Z=86
12 1 pfleura2
  INTEGER(KINT), PARAMETER :: MaxFroz=100
13 1 pfleura2
  REAL(KREAL), PARAMETER :: a0=0.529177249d0
14 1 pfleura2
  REAL(KREAL), PARAMETER :: Unit=1.d0/a0
15 1 pfleura2
  REAL(KREAL), PARAMETER :: au2kcal=627.509608d0
16 1 pfleura2
  REAL(KREAL) :: Pi
17 1 pfleura2
18 1 pfleura2
 ! Frozen contains the indices of frozen atoms
19 1 pfleura2
  INTEGER(KINT),ALLOCATABLE :: Frozen(:) !Nat
20 1 pfleura2
 ! Cart contains the indices of atoms described in cartesian coords
21 1 pfleura2
  INTEGER(KINT),ALLOCATABLE :: Cart(:) !Nat
22 1 pfleura2
! intFroz is the number of internal coord frozen
23 1 pfleura2
! NFroz the number of frozen atoms
24 1 pfleura2
! Ncart the number of  atoms described in cartesian coords
25 1 pfleura2
  INTEGER(KINT) :: IntFroz, NFroz, NCart
26 1 pfleura2
! FrozAtoms is true for a frozen atom, false else.
27 1 pfleura2
  LOGICAL, ALLOCATABLE :: FrozAtoms(:)  !! Nat
28 1 pfleura2
! Number of Primitives (mainly for Baker coordinates)
29 1 pfleura2
  INTEGER(KINT) :: NPrim
30 1 pfleura2
! Nat number of atoms
31 1 pfleura2
  INTEGER(KINT) :: Nat
32 1 pfleura2
! NGeomI number of initial geometries
33 1 pfleura2
! NgeomF number of final geometries
34 1 pfleura2
  INTEGER(KINT) :: NGeomI, NGeomF
35 1 pfleura2
! NCoord=3*Nat or NFree depending on the coordinate choice
36 1 pfleura2
  INTEGER(KINT) :: NCoord
37 1 pfleura2
  INTEGER(KINT) :: NMaxPtPath=1000
38 1 pfleura2
! IReparam is the period of reparameterization of the Path
39 1 pfleura2
  INTEGER(KINT) :: IReparam=1
40 1 pfleura2
! IReparamT is the period of reparameterization of the tangents along the path
41 1 pfleura2
! Be default IReparamT=IReparam
42 1 pfleura2
  INTEGER(KINT) :: IReparamT
43 1 pfleura2
! ISpline is the iteration number where spline interpolation starts to be used
44 1 pfleura2
! instead of linear interpolation
45 1 pfleura2
  INTEGER(KINT) :: ISpline=1
46 1 pfleura2
! Linear: if TRUE, then we perform linear interpolation and not spline
47 1 pfleura2
  LOGICAL :: Linear
48 1 pfleura2
49 1 pfleura2
! FrozTol is the criterion to decide wether a frozen atom has moved between
50 1 pfleura2
! two initial geometries
51 1 pfleura2
  REAL(KREAL) :: FrozTol=1e-4
52 1 pfleura2
53 1 pfleura2
! BoxTol is the criterion to decide wether an atom has crossed the box between
54 1 pfleura2
! two initial geometries
55 1 pfleura2
  REAL(KREAL) :: BoxTol=0.5
56 1 pfleura2
57 1 pfleura2
  LOGICAL :: Freq, MW, Bohr, Renum, Hinv
58 1 pfleura2
! OptReac: if TRUE the reactants will be optimized. Default is FALSE
59 1 pfleura2
  LOGICAL :: OptReac
60 1 pfleura2
! OptProd: if TRUE the products will be optimized. Default is FALSE
61 1 pfleura2
  LOGICAL :: OptProd
62 1 pfleura2
! PathOnly: if TRUE, only the initial path will be constructed.
63 1 pfleura2
! Default is FALSE, that is OpenPath construct the path and optimize it
64 1 pfleura2
  LOGICAL :: PathOnly
65 1 pfleura2
! CalcEReac: if TRUE the reactants energy will be computed. Default is FALSE
66 1 pfleura2
! Not compatible with RunMode=Para
67 1 pfleura2
  LOGICAL :: CalcEReac
68 1 pfleura2
! CalEProd: if TRUE the products energy will be computed. Default is FALSE
69 1 pfleura2
! Not compatible with RunMode=Para
70 1 pfleura2
  LOGICAL :: CalcEProd
71 7 pfleura2
! AnaGeom: if TRUE the geometries are analyzed
72 7 pfleura2
  LOGICAL :: AnaGeom
73 7 pfleura2
! Name of the file to analyse geometries
74 7 pfleura2
  CHARACTER(LCHARS) :: AnaFile
75 7 pfleura2
! Nb: number of variables to monitor, including Centers of Mass
76 7 pfleura2
  INTEGER(KINT) :: Nb
77 7 pfleura2
! NbVar: number of geometrical variables to monitor
78 7 pfleura2
  INTEGER(KINT) :: NbVar
79 7 pfleura2
! NbCom: number of center of mass to create
80 7 pfleura2
  INTEGER(KINT) :: NbCom
81 7 pfleura2
  TYPE(ListCoord), POINTER :: GeomList,CurVar
82 7 pfleura2
  TYPE(Barycenter), POINTER :: Bary,CurBary
83 7 pfleura2
! Format to print the values
84 7 pfleura2
  CHARACTER(VLCHARS) :: FormAna
85 7 pfleura2
! Factor to use to print the values
86 7 pfleura2
  REAL(KREAL), ALLOCATABLE :: PrintGeomFactor(:) ! NbVar
87 7 pfleura2
! How to update the Hessian
88 1 pfleura2
  LOGICAL :: IniHup,HupNeighbour
89 1 pfleura2
90 1 pfleura2
  REAL(KREAL) :: Fact,FTan
91 1 pfleura2
! IGeomRef is the index of the reference geometry, used to calculate the Zmat
92 1 pfleura2
! or the Baker coordinates.
93 1 pfleura2
  INTEGER(KINT) :: IGeomRef=-1
94 1 pfleura2
! For geometry optimization , OptGeom is the index of the starting geometry
95 1 pfleura2
  INTEGER(KINT) :: OptGeom=-1
96 1 pfleura2
97 1 pfleura2
! Optimization parameter
98 1 pfleura2
  INTEGER(KINT) :: MaxCyc
99 1 pfleura2
  REAL(KREAL) :: SThresh, Smax, SthreshRms
100 1 pfleura2
  REAL(KREAL) :: GThresh, GThreshRMS
101 5 pfleura2
! Name of the file to print geometries and their energies
102 5 pfleura2
  CHARACTER(LCHARS) :: GeomFile
103 5 pfleura2
! Flag to decide if we print something in GeomFile
104 5 pfleura2
  LOGICAL :: FPrintGeom
105 1 pfleura2
106 1 pfleura2
! Number of steps in memory for Step_RFO_all
107 1 pfleura2
  INTEGER(KINT) :: NGintMax = 10
108 1 pfleura2
109 1 pfleura2
  CHARACTER(SCHARS) :: Coord='HYBRID'
110 1 pfleura2
  CHARACTER(SCHARS) :: Step_method='RFO'
111 1 pfleura2
  CHARACTER(SCHARS) :: Prog="GAUSSIAN"
112 1 pfleura2
  CHARACTER(VLCHARS) :: ProgExe="g03"
113 5 pfleura2
! Input: format of the geometry input
114 5 pfleura2
! PFL 2013/02: This name is dumb ! I should have used GeomFormat ! => To DO!!
115 5 pfleura2
  CHARACTER(SCHARS) :: Input
116 5 pfleura2
! Poscar: is the name to use for POSCAR files for VASP
117 5 pfleura2
  CHARACTER(SCHARS) :: Poscar
118 1 pfleura2
119 1 pfleura2
! PFL 06/2011: HesUpd is deprecated
120 1 pfleura2
! I replace it by HUpdate that is more intuitive to me
121 1 pfleura2
  CHARACTER(SCHARS) :: hesupd="BFGS"
122 1 pfleura2
! HUpdate indicates which method to use for updating the Hessian or its inverse
123 1 pfleura2
  CHARACTER(SCHARS) :: HUpdate="BFGS"
124 1 pfleura2
125 1 pfleura2
  REAL(KREAL), ALLOCATABLE, TARGET :: XyzGeomI(:,:,:) ! (NGeomI,3,Nat)
126 1 pfleura2
  REAL(KREAL), ALLOCATABLE :: XyzGeomF(:,:,:) ! (NGeomF,3,Nat)
127 1 pfleura2
  REAL(KREAL), ALLOCATABLE :: XyzTangent(:,:)   ! (NGeomF,3*Nat)
128 1 pfleura2
  REAL(KREAL), ALLOCATABLE :: IntTangent(:,:)   ! (NGeomF,Nfree=3Nat-6)
129 1 pfleura2
  REAL(KREAL), ALLOCATABLE :: IntCoordI(:,:) ! (NGeomI,3*Nat-6)
130 1 pfleura2
  ! IntCoordF: Final Internal coordinates for number of final geometries.
131 1 pfleura2
  ! 3*Nat-6 is the number of coordinates (NCoord) of each geometry.
132 1 pfleura2
  REAL(KREAL), ALLOCATABLE :: IntCoordF(:,:) ! (NGeomF,3*Nat-6)
133 1 pfleura2
  REAL(KREAL), ALLOCATABLE :: Vfree(:,:) ! (Ncoord,Ncoord)
134 1 pfleura2
  REAL(KREAL), ALLOCATABLE :: SGeom(:) ! (NGeomF)
135 1 pfleura2
  REAL(KREAL), ALLOCATABLE :: Energies(:) ! NGeomF
136 1 pfleura2
! NCoord=3*Nat or NFree depending on the coordinate choice
137 1 pfleura2
  REAL(KREAL), ALLOCATABLE :: Grad(:,:) ! (NGeomF,NCoord)
138 1 pfleura2
  REAL(KREAL), ALLOCATABLE :: Hess(:,:,:)  !(NgeomF, N,N)
139 1 pfleura2
  REAL(KREAL), ALLOCATABLE :: DzDc(:,:,:,:) ! (3,Nat,3,Nat)
140 1 pfleura2
  REAL(KREAL), ALLOCATABLE :: BMat_BakerT(:,:) ! (3*Nat,NCoord)
141 1 pfleura2
  INTEGER(KINT), ALLOCATABLE :: IndZmat(:,:)   ! (Nat,5)
142 1 pfleura2
  INTEGER(KINT), ALLOCATABLE :: Order(:),OrderInv(:) ! Nat
143 1 pfleura2
  CHARACTER(10), ALLOCATABLE :: AtName(:) ! Nat
144 1 pfleura2
  INTEGER(KINT), ALLOCATABLE :: Atome(:) ! Nat
145 1 pfleura2
  REAL(KREAL), ALLOCATABLE :: MassAt(:)   ! Nat
146 1 pfleura2
  REAL(KREAL), ALLOCATABLE :: BTransInv(:,:) ! BTransInv (3*Nat-6,3*Nat), used for Baker case.
147 1 pfleura2
  REAL(KREAL), ALLOCATABLE :: BTransInvF(:,:,:) ! BTransInvF (NGeomF,3*Nat-6,3*Nat)
148 1 pfleura2
  ! BTransInv_local (3*Nat-6,3*Nat), used for Baker case in Opt_Geom.f90
149 1 pfleura2
  REAL(KREAL), ALLOCATABLE :: BTransInv_local(:,:)
150 1 pfleura2
  REAL(KREAL), ALLOCATABLE :: UMat(:,:) !(NPrim,3*Nat-6)
151 1 pfleura2
  REAL(KREAL), ALLOCATABLE :: UMat_local(:,:) !(NPrim,3*Nat-6)
152 1 pfleura2
  REAL(KREAL), ALLOCATABLE :: UMatF(:,:,:) !(NGeomF,NPrim,3*Nat-6)
153 1 pfleura2
  !REAL(KREAL), ALLOCATABLE :: IntCoordIBaker(:,:) ! (NGeomI,NCoord=3*Nat-6)
154 1 pfleura2
  ! IntCoordIBaker allocated in PathCreate.f90
155 1 pfleura2
  REAL(KREAL), ALLOCATABLE :: Xprimitive(:,:) ! Xprimitive(NgeomI,NPrim)
156 1 pfleura2
  REAL(KREAL), ALLOCATABLE :: Xprimitive_t(:) ! used in ConvertBakerInternal_cart.f as a temporary variable.
157 1 pfleura2
  REAL(KREAL), ALLOCATABLE :: XprimitiveF(:,:) ! Xprimitive(NgeomF,NPrim)
158 1 pfleura2
  REAL(KREAL), ALLOCATABLE :: GeomOld_all(:,:)
159 1 pfleura2
  REAL(KREAL), ALLOCATABLE :: GeomOld(:) ! Used in DIIS step method.
160 1 pfleura2
161 1 pfleura2
  LOGICAL, PARAMETER :: FRot=.TRUE., FAlign=.TRUE.
162 1 pfleura2
  REAL(KREAL), ALLOCATABLE :: BprimT(:,:) !(3*Nat,NPrim). This is B^prim.
163 1 pfleura2
  REAL(KREAL), ALLOCATABLE :: BBT(:,:) ! BBT (3*Nat-6,3*Nat-6), used for Baker case
164 1 pfleura2
  REAL(KREAL), ALLOCATABLE :: BBT_inv(:,:) ! BBT_inv (3*Nat-6,3*Nat-6), used for Baker case
165 1 pfleura2
  INTEGER(KINT) :: Symmetry_elimination
166 1 pfleura2
  LOGICAL :: FirstTimePathCreate
167 1 pfleura2
168 1 pfleura2
  Type (ListCoord), POINTER :: Coordinate, CurrentCoord
169 1 pfleura2
  Type (ListCoord), POINTER :: ScanCoord
170 1 pfleura2
171 1 pfleura2
! Triggers the dynamical update of the maximum step
172 1 pfleura2
  LOGICAL :: DynMaxStep
173 1 pfleura2
174 1 pfleura2
! Triggers the alignment of not
175 1 pfleura2
  LOGICAL :: Align
176 1 pfleura2
177 1 pfleura2
178 1 pfleura2
179 1 pfleura2
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
180 1 pfleura2
!
181 1 pfleura2
! Flags for printing
182 1 pfleura2
!
183 1 pfleura2
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
184 1 pfleura2
185 1 pfleura2
! Vmd is set to TRUE if user wants to use VMD to look
186 1 pfleura2
! at the Path.
187 1 pfleura2
! For now, used only for VASP
188 1 pfleura2
189 1 pfleura2
  LOGICAL :: Vmd
190 1 pfleura2
191 1 pfleura2
192 1 pfleura2
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
193 1 pfleura2
!
194 1 pfleura2
! Variables for VASP input/output
195 1 pfleura2
!
196 1 pfleura2
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
197 1 pfleura2
198 1 pfleura2
  REAL(KREAL) :: lat_a(3), lat_b(3), lat_c(3)
199 1 pfleura2
  REAL(KREAL), ALLOCATABLE :: X0_vasp(:),Y0_vasp(:), Z0_vasp(:) ! nat
200 1 pfleura2
  REAL(KREAL) :: Latr(3,3)
201 1 pfleura2
  CHARACTER(LCHARS) :: V_direct
202 1 pfleura2
! AutoCart : true if user let PATH determines which atoms should be
203 1 pfleura2
! described in cartesian when COORD=MIXED
204 1 pfleura2
  LOGICAL :: AutoCart
205 1 pfleura2
206 1 pfleura2
207 1 pfleura2
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
208 1 pfleura2
!
209 1 pfleura2
! General
210 1 pfleura2
!
211 1 pfleura2
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
212 1 pfleura2
213 1 pfleura2
  CHARACTER(2) :: Nom(0:max_Z)=(/ ' X',' H',                   'HE',  &
214 1 pfleura2
                'LI','BE',            ' B',' C',' N',' O',' F','NE',  &
215 1 pfleura2
                'NA','MG',            'AL','SI',' P',' S','CL','AR',  &
216 1 pfleura2
                ' K','CA',                                            &
217 1 pfleura2
            'SC','TI',' V','CR','MN','FE','CO','NI','CU','ZN',        &
218 1 pfleura2
                                      'GA','GE','AS','SE','BR','KR',  &
219 1 pfleura2
                'RB','SR',                                            &
220 1 pfleura2
            ' Y','ZR','NB','MO','TC','RU','RH','PD','AG','CD',        &
221 1 pfleura2
                                      'IN','SN','SB','TE',' I','XE',  &
222 1 pfleura2
                'CS','BA',                                            &
223 1 pfleura2
            'LA',                                                     &
224 1 pfleura2
              'CE','PR','ND','PM','SM','EU','GD','TB','DY','HO',      &
225 1 pfleura2
              'ER','TM','YB','LU',                                    &
226 1 pfleura2
                     'HF','TA',' W','RE','OS','IR','PT','AU','HG',    &
227 1 pfleura2
                                      'TL','PB','BI','PO','AT','RN'/)
228 1 pfleura2
229 1 pfleura2
! This is the new table, more complete, taken from a periodic table
230 1 pfleura2
! some value have been changed to be consistent
231 1 pfleura2
  REAL(KREAL) ::  r_cov(0:max_Z)=(/ 1e-13, 37.,                93.,     &
232 1 pfleura2
!     2           'LI','BE',          ' B',' C',' N',' O',' F','NE',
233 1 pfleura2
                  123.,90.,            82., 77., 75., 73., 71., 69.,     &
234 1 pfleura2
!     3           'NA','MG',          'AL','SI',' P',' S','CL','AR',
235 1 pfleura2
                  154.,136.,          118.,111.,106.,102., 99., 97.,     &
236 1 pfleura2
!     4           ' K','CA',
237 1 pfleura2
                  203.,  174.,                                           &
238 1 pfleura2
!     4       'SC','TI',' V','CR','MN','FE','CO','NI','CU','ZN',
239 1 pfleura2
             144.,132.,122.,118.,117.,117.,116.,115.,117.,125.,          &
240 1 pfleura2
!     4                               'GA','GE','AS','SE','BR','KR',
241 1 pfleura2
                                     120.,122.,122.,117.,114.,110.,      &
242 1 pfleura2
!     5           'RB','SR',
243 1 pfleura2
                 216.,191.,                                              &
244 1 pfleura2
!     5       ' Y','ZR','NB','MO','TC','RU','RH','PD','AG','CD',
245 1 pfleura2
              162.,145.,134.,130.,127.,125.,125.,128.,134.,148.,         &
246 1 pfleura2
!     5                               'IN','SN','SB','TE',' I','XE',
247 1 pfleura2
                                     144.,140.,143.,135.,133.,130.,      &
248 1 pfleura2
!     6           'CS','BA',
249 1 pfleura2
                 235., 198.,                                             &
250 1 pfleura2
!     6       'LA',
251 1 pfleura2
!               'CE','PR','ND','PM','SM','EU','GD','TB','DY','HO',      &
252 1 pfleura2
!               'ER','TM','YB','LU',                                    &
253 1 pfleura2
             169.,                                                       &
254 1 pfleura2
             165., 165., 164., 163., 162., 185., 161., 159., 159., 158., &
255 1 pfleura2
             157., 156., 184.,156.,                                      &
256 1 pfleura2
!     6                'HF','TA',' W','RE','OS','IR','PT','AU','HG',
257 1 pfleura2
!     6                                 'TL','PB','BI','PO','AT','RN'/
258 1 pfleura2
             144., 134., 130., 126., 126., 127., 120., 134., 149.,       &
259 1 pfleura2
                        148., 147., 146., 146., 148., 151. /)
260 1 pfleura2
261 1 pfleura2
  REAL(KREAL) :: Mass(0:Max_Z)=(/0.0D0,1.0078D0,          4.0026D0,      &
262 1 pfleura2
                  7.0160D0, 9.0122D0,11.0093D0,                          &
263 1 pfleura2
                 12.0000D0,14.0031D0,15.9949D0,18.9984D0,19.9924D0,      &
264 1 pfleura2
                 22.9898D0,23.9850D0,26.9815D0,                          &
265 1 pfleura2
                 27.9769D0,30.9738D0,31.9721D0,34.9688D0,39.9624D0,      &
266 1 pfleura2
                 39.0983D0,40.08D0,                                      &
267 1 pfleura2
                   44.9559D0, 47.88D0, 50.9415D0, 51.996D0, 54.9380D0,   &
268 1 pfleura2
                   55.847D0, 58.9332D0, 58.69D0, 63.546D0, 65.39D0,      &
269 1 pfleura2
                 69.72D0,72.59D0,74.9216D0,78.96D0,79.904D0,83.80D0,     &
270 1 pfleura2
                 85.4678D0,87.62D0,88.9059D0,91.224D0,92.9064D0,         &
271 1 pfleura2
         95.94D0,98D0,101.07D0,102.906D0,106.42D0,107.868D0,112.41D0,    &
272 1 pfleura2
         114.82D0,118.71D0,121.75D0,127.60D0,126.905D0,131.29D0,         &
273 1 pfleura2
!     6           'CS','BA',
274 1 pfleura2
                 132.905D0,137.34D0,                                      &
275 1 pfleura2
!     6       'LA',
276 1 pfleura2
!               'CE','PR','ND','PM','SM','EU','GD',
277 1 pfleura2
!               'TB','DY','HO', 'ER','TM','YB','LU',
278 1 pfleura2
            138.91D0,                                                      &
279 1 pfleura2
            140.12D0, 130.91D0, 144.24D0,147.D0,150.35D0, 151.96D0,157.25D0,  &
280 1 pfleura2
          158.924D0, 162.50D0, 164.93D0, 167.26D0,168.93D0,173.04D0,174.97D0, &
281 1 pfleura2
!     6                'HF','TA',' W','RE','OS','IR','PT',
282 1 pfleura2
!                      'AU','HG',
283 1 pfleura2
!     6                                 'TL','PB','BI','PO','AT','RN'/
284 1 pfleura2
         178.49D0, 180.95D0, 183.85D0, 186.2D0, 190.2D0, 192.2D0, 195.09D0,  &
285 1 pfleura2
             196.97D0, 200.59D0,                                             &
286 1 pfleura2
             204.37D0, 207.19D0,208.98D0,210.D0,210.D0,222.D0 /)
287 1 pfleura2
288 1 pfleura2
      END MODULE Path_module