2003-01-20 05:58:50 +08:00
|
|
|
!
|
2004-07-09 23:50:50 +08:00
|
|
|
! Copyright (C) 2001-2004 PWSCF group
|
2003-01-20 05:58:50 +08:00
|
|
|
! This file is distributed under the terms of the
|
|
|
|
! GNU General Public License. See the file `License'
|
|
|
|
! in the root directory of the present distribution,
|
|
|
|
! or http://www.gnu.org/copyleft/gpl.txt .
|
|
|
|
!
|
2003-10-17 20:03:47 +08:00
|
|
|
!--------------------------------------------------------------------------
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
MODULE basis
|
|
|
|
!
|
|
|
|
! ... The variables needed to describe the atoms in the unit cell
|
|
|
|
!
|
2003-10-17 20:03:47 +08:00
|
|
|
SAVE
|
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
INTEGER :: &
|
|
|
|
natomwfc ! number of starting wavefunctions
|
|
|
|
CHARACTER(LEN=30) :: & ! 'alat', 'crystal', 'angstrom', 'bohr'
|
|
|
|
atomic_positions ! specifies how input coordinates are given
|
|
|
|
CHARACTER(LEN=6) :: &
|
|
|
|
startingwfc , &! 'random' or 'atomic' or 'file'
|
|
|
|
startingpot , &! 'atomic' or 'file'
|
|
|
|
startingconfig ! 'input' or 'file'
|
|
|
|
!
|
|
|
|
END MODULE basis
|
|
|
|
!
|
|
|
|
!
|
|
|
|
MODULE dynam
|
|
|
|
!
|
|
|
|
! ... Variables needed for the dynamics
|
|
|
|
!
|
2004-04-02 21:01:15 +08:00
|
|
|
USE kinds, ONLY : DP
|
|
|
|
USE ions_base, ONLY : amass
|
|
|
|
!
|
2003-10-17 20:03:47 +08:00
|
|
|
SAVE
|
|
|
|
!
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(DP) :: &
|
2003-10-17 00:30:12 +08:00
|
|
|
dt, &! time step
|
|
|
|
temperature, &! starting temperature
|
|
|
|
delta_T ! rate of thermalization
|
|
|
|
INTEGER :: &
|
|
|
|
nraise ! the frequency of temperature raising
|
|
|
|
!
|
|
|
|
END MODULE dynam
|
|
|
|
!
|
|
|
|
!
|
|
|
|
MODULE gvect
|
|
|
|
!
|
|
|
|
! ...The variables describing the reciprocal lattice vectors
|
|
|
|
!
|
2004-04-02 21:01:15 +08:00
|
|
|
USE kinds, ONLY : DP
|
|
|
|
USE reciprocal_vectors, ONLY : ig_l2g, sortedig_l2g
|
|
|
|
!
|
2003-10-17 20:03:47 +08:00
|
|
|
SAVE
|
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
INTEGER :: &
|
|
|
|
ngm, &! number of g vectors
|
|
|
|
ngm_g, &! global number of g vectors (sum over all processors)
|
|
|
|
ngm_l, &! the local number of g vectors (only present processor)
|
|
|
|
gstart, &! first nonzero g vector
|
|
|
|
nr1, &! fft dimension along x
|
|
|
|
nr2, &! fft dimension along y
|
|
|
|
nr3, &! fft dimension along z
|
|
|
|
nrx1, &! maximum fft dimension along x
|
|
|
|
nrx2, &! maximum fft dimension along y
|
|
|
|
nrx3, &! maximum fft dimension along z
|
|
|
|
nrxx, &! maximum total fft
|
|
|
|
ngl ! number of |g| shells
|
|
|
|
!INTEGER, ALLOCATABLE :: &
|
|
|
|
! ig_l2g(:) !"l2g" means local to global, this array convert a local
|
|
|
|
! ! G-vector index into the global index, in other words
|
|
|
|
! ! the index of the G-v. in the overall array of G-vectors
|
|
|
|
INTEGER, ALLOCATABLE, TARGET :: &
|
|
|
|
nl(:), &! correspondence fft <-> array of G vectors
|
|
|
|
nlm(:), &! same for gamma point calculation
|
|
|
|
igtongl(:) ! correspondence shells of G <-> G
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(DP), ALLOCATABLE, TARGET :: &
|
2003-10-17 00:30:12 +08:00
|
|
|
g(:,:), &! coordinates of G vectors
|
|
|
|
gg(:) ! modulus G^2 of G vectors
|
|
|
|
! G vectors are in order of increasing |G|
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(DP) :: &
|
2003-10-17 00:30:12 +08:00
|
|
|
ecutwfc ! energy cut-off
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(DP), POINTER :: &
|
2003-10-17 00:30:12 +08:00
|
|
|
gl(:) ! the modulus of g in each shell
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL (DP) :: &
|
2003-10-17 00:30:12 +08:00
|
|
|
gcutm, &! cut-off for G vectors
|
|
|
|
dual, &! link between G of wavefunctions and charge
|
|
|
|
ecfixed, &!
|
|
|
|
qcutz, &! For the modified Ekin functional
|
|
|
|
q2sigma !
|
2005-08-28 22:09:42 +08:00
|
|
|
complex(DP), ALLOCATABLE :: &
|
2003-10-17 00:30:12 +08:00
|
|
|
eigts1(:,:), &!
|
|
|
|
eigts2(:,:), &! the phases e^{-iG*tau_s}
|
|
|
|
eigts3(:,:) !
|
|
|
|
INTEGER, ALLOCATABLE :: &
|
|
|
|
ig1(:), &!
|
|
|
|
ig2(:), &! the indices of G components
|
|
|
|
ig3(:) !
|
|
|
|
!
|
|
|
|
END MODULE gvect
|
|
|
|
!
|
|
|
|
!
|
|
|
|
MODULE gsmooth
|
|
|
|
!
|
|
|
|
! ... the variables for the smooth mesh of the wavefunction. It can
|
|
|
|
! ... be different from the large mesh if dual > 4
|
|
|
|
!
|
2004-04-02 21:01:15 +08:00
|
|
|
USE kinds, ONLY : DP
|
|
|
|
!
|
2003-10-17 20:03:47 +08:00
|
|
|
SAVE
|
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
INTEGER :: &
|
|
|
|
ngms, &! the number of smooth G vectors
|
|
|
|
ngms_g, &! the global number of smooth G vectors
|
|
|
|
! (sum over all processors)
|
|
|
|
ngms_l, &! the local number of smooth G vectors
|
|
|
|
! (only present processor)
|
|
|
|
nr1s, &!
|
|
|
|
nr2s, &! the dimension of the smooth grid
|
|
|
|
nr3s, &!
|
|
|
|
nrx1s, &! maximum dimension of the smooth grid
|
|
|
|
nrx2s, &! maximum dimension of the smooth grid
|
|
|
|
nrx3s, &! maximum dimension of the smooth grid
|
|
|
|
nrxxs ! the total dimension of the smooth grid
|
|
|
|
INTEGER, POINTER :: &
|
|
|
|
nls(:), &! the correspondence G <-> smooth mesh
|
|
|
|
nlsm(:) ! the same for gamma point calculation
|
|
|
|
LOGICAL :: &
|
|
|
|
doublegrid ! .TRUE. if we use a double grid
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(DP) :: &
|
2003-10-17 00:30:12 +08:00
|
|
|
gcutms ! the cut-off of the smooth mesh
|
|
|
|
!
|
|
|
|
END MODULE gsmooth
|
|
|
|
!
|
|
|
|
!
|
|
|
|
MODULE klist
|
|
|
|
!
|
|
|
|
! ... The variables for the k-points
|
2004-04-02 21:01:15 +08:00
|
|
|
!
|
|
|
|
USE kinds, ONLY : DP
|
|
|
|
USE parameters, ONLY : npk
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2003-10-17 20:03:47 +08:00
|
|
|
SAVE
|
|
|
|
!
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(DP) :: &
|
2006-01-01 17:17:24 +08:00
|
|
|
xk(3,npk), &! coordinates of k points
|
|
|
|
wk(npk), &! weight of k points
|
|
|
|
xqq(3), &! coordinates of q point (used with iswitch=-2)
|
|
|
|
degauss, &! smearing parameter
|
|
|
|
nelec, &! number of electrons
|
|
|
|
nelup, &! number of spin-up electrons (if two_fermi_energies=t)
|
|
|
|
neldw, &! number of spin-dw electrons (if two_fermi_energies=t)
|
|
|
|
tot_charge, &! total charge
|
|
|
|
b_length ! length of the b vectors
|
2003-10-17 00:30:12 +08:00
|
|
|
INTEGER :: &
|
2006-01-01 17:17:24 +08:00
|
|
|
ngk(npk), &! number of plane waves for each k point
|
|
|
|
nks, &! number of k points in this pool
|
|
|
|
nkstot, &! total number of k points
|
|
|
|
ngauss, &! type of smearing technique
|
|
|
|
tot_magnetization, &! nelup-neldw >= 0 (negative value means unspecified)
|
|
|
|
multiplicity ! spin multiplicity
|
2003-10-17 00:30:12 +08:00
|
|
|
LOGICAL :: &
|
|
|
|
lgauss, &! if .TRUE.: use gaussian broadening
|
2004-05-25 22:22:43 +08:00
|
|
|
lxkcry, &! if .TRUE.:k-pnts in cryst. basis accepted in input
|
2005-03-17 22:47:46 +08:00
|
|
|
lcart, &! if .TRUE.: b vectors in cartesian coordinates
|
|
|
|
two_fermi_energies ! if .TRUE.: nelup and neldw set ef_up and ef_dw
|
|
|
|
! separately
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
END MODULE klist
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
MODULE lsda_mod
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
! ... The variables needed for the lsda calculation
|
2004-04-02 21:01:15 +08:00
|
|
|
!
|
|
|
|
USE kinds, ONLY : DP
|
|
|
|
USE parameters, ONLY : ntypx, npk
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 20:03:47 +08:00
|
|
|
SAVE
|
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
LOGICAL :: &
|
|
|
|
lsda
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(DP) :: &
|
2004-05-21 19:15:39 +08:00
|
|
|
magtot, &! total magnetization
|
|
|
|
absmag, &! total absolute magnetization
|
|
|
|
starting_magnetization(ntypx) ! the magnetization used to start with
|
2003-10-17 00:30:12 +08:00
|
|
|
INTEGER :: &
|
2003-01-20 05:58:50 +08:00
|
|
|
nspin, &! number of spin polarization: 2 if lsda, 1 other
|
2003-02-08 00:04:36 +08:00
|
|
|
current_spin, &! spin of the current kpoint
|
2003-01-20 05:58:50 +08:00
|
|
|
isk(npk) ! for each k-point: 1=spin up, 2=spin down
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
END MODULE lsda_mod
|
|
|
|
!
|
|
|
|
!
|
|
|
|
MODULE ktetra
|
|
|
|
!
|
|
|
|
! ... The variables for the tetrahedron method
|
2004-04-02 21:01:15 +08:00
|
|
|
!
|
2003-10-17 20:03:47 +08:00
|
|
|
SAVE
|
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
INTEGER :: &
|
|
|
|
nk1, nk2, nk3, &! the special-point grid
|
|
|
|
k1, k2, k3, &! the offset from the origin
|
|
|
|
ntetra ! number of tetrahedra
|
|
|
|
INTEGER, ALLOCATABLE :: &
|
|
|
|
tetra(:,:) ! index of k-points in a given tetrahedron
|
|
|
|
! shape (4,ntetra)
|
|
|
|
LOGICAL :: &
|
|
|
|
ltetra ! if .TRUE.: use tetrahedron method
|
|
|
|
!
|
|
|
|
END MODULE ktetra
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
MODULE symme
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
! ... The variables needed to describe the symmetry properties
|
2004-04-02 21:01:15 +08:00
|
|
|
!
|
2003-10-17 20:03:47 +08:00
|
|
|
SAVE
|
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
INTEGER :: &
|
2003-02-08 00:04:36 +08:00
|
|
|
s(3,3,48), &! simmetry matrices
|
|
|
|
ftau(3,48), &! fractional translations
|
2003-01-20 05:58:50 +08:00
|
|
|
nsym ! number of symmetries
|
2005-11-11 17:01:08 +08:00
|
|
|
INTEGER :: &
|
2005-11-11 18:57:01 +08:00
|
|
|
t_rev(48) = 0 ! time reversal flag, for noncolinear magnetisation
|
2003-10-17 00:30:12 +08:00
|
|
|
INTEGER, ALLOCATABLE :: &
|
2003-01-20 05:58:50 +08:00
|
|
|
irt(:,:) ! symmetric atom for each atom and sym.op.
|
2003-10-17 00:30:12 +08:00
|
|
|
LOGICAL :: &
|
|
|
|
invsym ! if .TRUE. the system has inversion symmetry
|
|
|
|
!
|
|
|
|
END MODULE symme
|
|
|
|
!
|
|
|
|
!
|
|
|
|
MODULE pseud
|
|
|
|
!
|
2004-04-27 21:44:55 +08:00
|
|
|
! ... The variables describing pseudopotentials in analytical form
|
2004-04-02 21:01:15 +08:00
|
|
|
!
|
|
|
|
USE kinds, ONLY : DP
|
2004-04-27 23:42:14 +08:00
|
|
|
USE parameters, ONLY : npsx
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2003-10-17 20:03:47 +08:00
|
|
|
SAVE
|
|
|
|
!
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(DP) :: &
|
2003-10-17 00:30:12 +08:00
|
|
|
cc(2,npsx), &! the coefficients of the erf functions
|
|
|
|
alpc(2,npsx), &! the alpha of the erf functions
|
|
|
|
zp(npsx), &! the charge of the pseudopotential
|
|
|
|
aps(6,0:3,npsx), &! the a_l coefficient
|
2004-04-22 01:14:38 +08:00
|
|
|
alps(3,0:3,npsx) ! the b_l coefficient
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(DP) :: &
|
2004-04-27 21:44:55 +08:00
|
|
|
a_nlcc(npsx), &! nonlinear core correction coefficients:
|
|
|
|
b_nlcc(npsx), &! rho_c(r) = (a_c + b_c*r^2) exp(-alpha_c*r^2)
|
|
|
|
alpha_nlcc(npsx) !
|
2003-10-17 00:30:12 +08:00
|
|
|
INTEGER :: &
|
|
|
|
nlc(npsx), &! number of erf functions
|
|
|
|
nnl(npsx), &! number of the gaussian functions
|
|
|
|
lmax(npsx), &! maximum angular momentum of the pseudopot
|
|
|
|
lloc(npsx) ! angular momentum of the part taken as local
|
|
|
|
!
|
|
|
|
END MODULE pseud
|
|
|
|
!
|
|
|
|
!
|
|
|
|
MODULE vlocal
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
! ... The variables needed for the local potential in reciprocal space
|
2004-04-02 21:01:15 +08:00
|
|
|
!
|
|
|
|
USE kinds, ONLY : DP
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 20:03:47 +08:00
|
|
|
SAVE
|
|
|
|
!
|
2005-08-28 22:09:42 +08:00
|
|
|
COMPLEX(DP), ALLOCATABLE :: &
|
2003-01-20 05:58:50 +08:00
|
|
|
strf(:,:) ! the structure factor
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(DP), ALLOCATABLE :: &
|
2003-02-08 00:04:36 +08:00
|
|
|
vloc(:,:), &! the local potential for each atom type
|
2003-01-20 05:58:50 +08:00
|
|
|
vnew(:,:) ! V_out - V_in, needed in scf force correction
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
END MODULE vlocal
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
MODULE wvfct
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
! ... The variables needed to compute the band structure
|
2004-04-02 21:01:15 +08:00
|
|
|
!
|
|
|
|
USE kinds, ONLY : DP
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 20:03:47 +08:00
|
|
|
SAVE
|
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
INTEGER :: &
|
2003-02-08 00:04:36 +08:00
|
|
|
npwx, &! maximum number of PW for wavefunctions
|
2003-04-08 15:13:30 +08:00
|
|
|
nbndx, &! max number of bands use in iterative diag
|
2003-02-08 00:04:36 +08:00
|
|
|
nbnd, &! number of bands
|
2005-10-20 15:34:39 +08:00
|
|
|
npw, &! the number of plane waves
|
|
|
|
current_k ! the index of k-point under consideration
|
2003-10-17 00:30:12 +08:00
|
|
|
INTEGER, ALLOCATABLE, TARGET :: &
|
2003-01-20 05:58:50 +08:00
|
|
|
igk(:), &! correspondence k+G <-> G
|
|
|
|
igk_l2g(:,:) ! correspondence local index k+G <-> global G index
|
|
|
|
! see also ig_l2g
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(DP), ALLOCATABLE :: &
|
2003-02-08 00:04:36 +08:00
|
|
|
et(:,:), &! eigenvalues of the hamiltonian
|
|
|
|
wg(:,:), &! the weight of each k point and band
|
2003-01-20 05:58:50 +08:00
|
|
|
g2kin(:) ! kinetic energy
|
2003-10-17 00:30:12 +08:00
|
|
|
LOGICAL :: &
|
|
|
|
gamma_only ! if .TRUE. only half G vectors are used
|
|
|
|
!
|
|
|
|
END MODULE wvfct
|
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
MODULE ener
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
! ... The variables needed to compute the energies
|
2004-04-02 21:01:15 +08:00
|
|
|
!
|
|
|
|
USE kinds, ONLY : DP
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 20:03:47 +08:00
|
|
|
SAVE
|
|
|
|
!
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(DP) :: &
|
2005-06-01 04:58:48 +08:00
|
|
|
etot, &! the total energy of the solid
|
|
|
|
eband, &! the band energy
|
|
|
|
deband, &! correction for variational energy
|
|
|
|
ehart, &! the hartree energy
|
|
|
|
etxc, &! the exchange and correlation energy
|
|
|
|
vtxc, &! another exchange-correlation energy
|
|
|
|
etxcc, &! the nlcc exchange and correlation
|
|
|
|
ewld, &! the ewald energy
|
|
|
|
demet, &! correction for metals
|
2005-03-17 22:47:46 +08:00
|
|
|
ef, ef_up, ef_dw ! the fermi energy (up and dw if two_fermi_energies=.T.)
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
END MODULE ener
|
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
MODULE force_mod
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
! ... The variables for the first derivative of the energy
|
2004-04-02 21:01:15 +08:00
|
|
|
!
|
|
|
|
USE kinds, ONLY : DP
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 20:03:47 +08:00
|
|
|
SAVE
|
|
|
|
!
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(DP), ALLOCATABLE :: &
|
2003-02-08 00:04:36 +08:00
|
|
|
force(:,:) ! the force on each atom
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(DP) :: &
|
2003-01-20 05:58:50 +08:00
|
|
|
sigma(3,3) ! the stress acting on the system
|
2003-10-17 00:30:12 +08:00
|
|
|
LOGICAL :: &
|
|
|
|
lforce, &! if .TRUE. compute the forces
|
|
|
|
lstres ! if .TRUE. compute the stress
|
|
|
|
!
|
|
|
|
END MODULE force_mod
|
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
MODULE scf
|
|
|
|
!
|
|
|
|
! ... The variables needed to define the self-consistent cycle
|
2004-04-02 21:01:15 +08:00
|
|
|
!
|
|
|
|
USE kinds, ONLY : DP
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 20:03:47 +08:00
|
|
|
SAVE
|
|
|
|
!
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(DP), ALLOCATABLE :: &
|
2003-10-17 00:30:12 +08:00
|
|
|
rho(:,:), &! the charge density in real space
|
|
|
|
vr(:,:), &! the Hartree + xc potential in real space
|
|
|
|
vltot(:), &! the local potential in real space
|
|
|
|
vrs(:,:), &! the total pot. in real space (smooth grig)
|
|
|
|
rho_core(:) ! the core charge in real space
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
END MODULE scf
|
|
|
|
!
|
|
|
|
!
|
|
|
|
MODULE relax
|
|
|
|
!
|
|
|
|
! ... The variables used to control ionic relaxations
|
2004-04-02 21:01:15 +08:00
|
|
|
!
|
2004-06-12 00:53:16 +08:00
|
|
|
USE kinds, ONLY : DP
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2003-10-17 20:03:47 +08:00
|
|
|
SAVE
|
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
LOGICAL :: & ! if .TRUE. start the structural optimization
|
|
|
|
restart_bfgs ! from the results of a previous run
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(DP) :: &
|
2003-10-17 00:30:12 +08:00
|
|
|
epse, &! threshold on total energy
|
|
|
|
epsf, &! threshold on forces
|
2003-02-08 00:04:36 +08:00
|
|
|
starting_diag_threshold, &! self-explanatory
|
2003-10-17 00:30:12 +08:00
|
|
|
starting_scf_threshold ! as above
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
END MODULE relax
|
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
MODULE cellmd
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
! ... The variables used to control cell relaxation
|
2004-04-02 21:01:15 +08:00
|
|
|
!
|
|
|
|
USE kinds, ONLY : DP
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 20:03:47 +08:00
|
|
|
SAVE
|
|
|
|
!
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(DP) :: &
|
2003-02-08 00:04:36 +08:00
|
|
|
press, cmass, &! target pressure and cell mass,
|
2003-01-20 05:58:50 +08:00
|
|
|
at_old(3,3), &! the lattice vectors at the previous ste
|
2003-02-08 00:04:36 +08:00
|
|
|
omega_old, &! the cell volume at the previous step
|
2003-01-20 05:58:50 +08:00
|
|
|
cell_factor ! maximum expected (linear) cell contraction
|
2003-10-17 00:30:12 +08:00
|
|
|
! during relaxation/MD
|
|
|
|
INTEGER :: &
|
2003-02-08 00:04:36 +08:00
|
|
|
nzero, &! iteration # of last thermalization
|
2003-01-20 05:58:50 +08:00
|
|
|
ntimes, &! number of thermalization steps to be performed
|
|
|
|
ntcheck ! # of steps between thermalizations
|
2003-10-17 00:30:12 +08:00
|
|
|
LOGICAL :: lmovecell ! used in cell relaxation
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
CHARACTER(LEN=2) :: &
|
2003-01-20 05:58:50 +08:00
|
|
|
calc ! main switch for variable cell shape MD
|
2003-10-17 00:30:12 +08:00
|
|
|
! see readin, vcsmd and/or INPUT files
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
END MODULE cellmd
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
MODULE char
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2004-04-28 18:25:36 +08:00
|
|
|
! ... The names of the system and of the symmetries
|
2004-04-02 21:01:15 +08:00
|
|
|
!
|
2004-11-15 20:13:22 +08:00
|
|
|
USE printout_base, ONLY: title ! title of the run
|
|
|
|
!
|
2003-10-17 20:03:47 +08:00
|
|
|
SAVE
|
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
CHARACTER(LEN=20) :: crystal ! type of the solid
|
|
|
|
CHARACTER(LEN=45) :: sname(48) ! name of the symmetries
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
END MODULE char
|
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
MODULE us
|
|
|
|
!
|
|
|
|
! ... These parameters are needed with the US pseudopotentials
|
2004-04-02 21:01:15 +08:00
|
|
|
!
|
|
|
|
USE kinds, ONLY : DP
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2003-10-17 20:03:47 +08:00
|
|
|
SAVE
|
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
INTEGER :: &
|
2003-02-08 00:04:36 +08:00
|
|
|
nqxq, &! size of interpolation table
|
2003-01-20 05:58:50 +08:00
|
|
|
nqx ! number of interpolation points
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(DP), PARAMETER:: &
|
2004-04-28 18:25:36 +08:00
|
|
|
dq = 0.01D0 ! space between points in the pseudopotential tab.
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(DP), ALLOCATABLE :: &
|
2003-10-17 00:30:12 +08:00
|
|
|
qrad(:,:,:,:), &! radial FT of Q functions
|
2004-01-24 22:44:20 +08:00
|
|
|
tab(:,:,:), &! interpolation table for PPs
|
|
|
|
tab_at(:,:,:) ! interpolation table for atomic wfc
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
END MODULE us
|
|
|
|
!
|
|
|
|
!
|
|
|
|
MODULE ldaU
|
|
|
|
!
|
|
|
|
! ... The quantities needed in lda+U calculations
|
2004-04-02 21:01:15 +08:00
|
|
|
!
|
|
|
|
USE kinds, ONLY : DP
|
|
|
|
USE parameters, ONLY : lqmax, nspinx, ntypx
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2003-10-17 20:03:47 +08:00
|
|
|
SAVE
|
|
|
|
!
|
2005-08-28 22:09:42 +08:00
|
|
|
COMPLEX(DP), ALLOCATABLE :: &
|
2005-01-06 00:43:26 +08:00
|
|
|
swfcatom(:,:), & ! orthogonalized atomic wfcs
|
|
|
|
swfcatom_nc(:,:,:) ! orthogonalized atomic wfcs noncollinear case
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(DP), ALLOCATABLE :: &
|
2003-10-17 00:30:12 +08:00
|
|
|
ns(:,:,:,:), &! the occupation matrix used in h_psi
|
|
|
|
nsnew(:,:,:,:) ! the occupation matrix computed by at
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(DP) :: &
|
2003-10-17 00:30:12 +08:00
|
|
|
d1(3,3,48), &! matrices for rotating spherical
|
|
|
|
d2(5,5,48), &! harmonics
|
|
|
|
d3(7,7,48), &!
|
|
|
|
eth, &! the (corrected) Hubbard contribution
|
|
|
|
Hubbard_U(ntypx), &! the Hubbard U
|
2004-02-14 16:39:34 +08:00
|
|
|
Hubbard_alpha(ntypx), &! the Hubbard alpha (used to calculate U)
|
|
|
|
starting_ns(lqmax,nspinx,ntypx) !
|
2003-10-17 00:30:12 +08:00
|
|
|
INTEGER :: &
|
|
|
|
niter_with_fixed_ns, &! no. of iterations with fixed ns
|
|
|
|
Hubbard_l(ntypx), &! the agular momentum of Hubbard states
|
|
|
|
Hubbard_lmax ! maximum agular momentum of Hubbard states
|
|
|
|
LOGICAL :: &
|
|
|
|
lda_plus_u, &! .TRUE. if lda+u calculation is performed
|
|
|
|
conv_ns ! .TRUE. if ns are converged
|
2004-04-03 00:05:17 +08:00
|
|
|
CHARACTER(LEN=30) :: & ! 'atomic', 'ortho-atomic', 'file'
|
|
|
|
U_projection ! specifies how input coordinates are given
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
END MODULE ldaU
|
|
|
|
!
|
|
|
|
!
|
|
|
|
MODULE extfield
|
|
|
|
!
|
2004-04-02 21:01:15 +08:00
|
|
|
! ... The quantities needed in calculations with external field
|
|
|
|
!
|
|
|
|
USE kinds, ONLY : DP
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2003-10-17 20:03:47 +08:00
|
|
|
SAVE
|
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
LOGICAL :: &
|
|
|
|
tefield, &! if .TRUE. a finite electric field is added to the
|
|
|
|
! local potential
|
|
|
|
dipfield ! if .TRUE. the dipole field is subtracted
|
|
|
|
INTEGER :: &
|
|
|
|
edir ! direction of the field
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(DP) :: &
|
2003-10-17 00:30:12 +08:00
|
|
|
emaxpos, &! position of the maximum of the field (0<emaxpos<1)
|
|
|
|
eopreg, &! amplitude of the inverse region (0<eopreg<1)
|
|
|
|
eamp, &! field amplitude (in a.u.) (1 a.u. = 51.44 10^11 V/m)
|
|
|
|
etotefield ! energy correction due to the field
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(DP), ALLOCATABLE :: &
|
2003-10-17 00:30:12 +08:00
|
|
|
forcefield(:,:)
|
|
|
|
!
|
|
|
|
END MODULE extfield
|
|
|
|
!
|
|
|
|
!
|
|
|
|
MODULE sticks
|
2004-04-02 21:01:15 +08:00
|
|
|
!
|
|
|
|
! ... data structure containing all information
|
|
|
|
! ... about fft data distribution for a given
|
|
|
|
! ... potential grid, and its wave functions sub-grid.
|
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
USE fft_types, ONLY : fft_dlay_descriptor
|
|
|
|
!
|
2003-10-17 20:03:47 +08:00
|
|
|
SAVE
|
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
TYPE ( fft_dlay_descriptor ) :: dfftp ! dense grid
|
|
|
|
TYPE ( fft_dlay_descriptor ) :: dffts ! smooth grid
|
|
|
|
!
|
2005-05-18 22:24:56 +08:00
|
|
|
END MODULE sticks
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
!
|
|
|
|
!
|
|
|
|
MODULE fixed_occ
|
|
|
|
!
|
2004-04-02 21:01:15 +08:00
|
|
|
! ... The quantities needed in calculations with fixed occupations
|
|
|
|
!
|
|
|
|
USE kinds, ONLY : DP
|
|
|
|
USE parameters, ONLY : nbndxx, nspinx
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2003-10-17 20:03:47 +08:00
|
|
|
SAVE
|
|
|
|
!
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(DP) :: &
|
2003-10-17 00:30:12 +08:00
|
|
|
f_inp(nbndxx,nspinx) ! the occupations for each spin
|
|
|
|
LOGICAL :: &
|
|
|
|
tfixed_occ ! if .TRUE. the occupations are fixed.
|
|
|
|
!
|
|
|
|
END MODULE fixed_occ
|
2004-04-30 16:51:31 +08:00
|
|
|
|
|
|
|
MODULE spin_orb
|
|
|
|
|
|
|
|
USE kinds, ONLY: DP
|
2005-12-22 00:30:00 +08:00
|
|
|
USE parameters, ONLY : lmaxx, npsx
|
2004-04-30 16:51:31 +08:00
|
|
|
|
|
|
|
SAVE
|
|
|
|
|
|
|
|
LOGICAL :: &
|
2005-12-22 00:30:00 +08:00
|
|
|
lspinorb, & ! if .TRUE. this is a spin-orbit calculation
|
|
|
|
domag, & ! if .TRUE. magnetization is computed
|
|
|
|
so(npsx) ! for each pseudo tells if it is spin-orbit
|
|
|
|
|
2004-04-30 16:51:31 +08:00
|
|
|
|
2005-08-28 22:09:42 +08:00
|
|
|
COMPLEX (DP) :: rot_ylm(2*lmaxx+1,2*lmaxx+1) ! transform real
|
2004-04-30 16:51:31 +08:00
|
|
|
! spherical harmonics into complex ones
|
2005-08-28 22:09:42 +08:00
|
|
|
COMPLEX (DP), ALLOCATABLE :: fcoef(:,:,:,:,:) ! function needed to
|
2004-04-30 16:51:31 +08:00
|
|
|
! account for spinors.
|
|
|
|
END MODULE spin_orb
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2005-08-16 20:04:34 +08:00
|
|
|
!
|
|
|
|
MODULE bp
|
|
|
|
USE kinds, ONLY: DP
|
|
|
|
!
|
|
|
|
! ... The variables needed for the Berry phase polarization calculation
|
|
|
|
!
|
|
|
|
SAVE
|
|
|
|
!
|
|
|
|
LOGICAL :: &
|
|
|
|
lberry, & ! if .TRUE., calculate polarization
|
|
|
|
lelfield ! if .TRUE. static homogeneous electric field
|
|
|
|
INTEGER :: &
|
|
|
|
gdir, &! G-vector for polarization calculation
|
|
|
|
nppstr, &! number of k-points (parallel vector)
|
2005-10-26 07:17:05 +08:00
|
|
|
nberrycyc !numer of cycles for cobergence in electric field without changing the selfconsistent charge
|
|
|
|
REAL(DP) :: efield ! electric field intensity in a.u.
|
2005-08-28 22:09:42 +08:00
|
|
|
COMPLEX(DP), ALLOCATABLE , TARGET :: evcel(:,:) ! wave function for calculating the electric field operator
|
2005-08-16 20:04:34 +08:00
|
|
|
|
|
|
|
!
|
|
|
|
END MODULE bp
|
|
|
|
!
|
|
|
|
|
2004-06-09 00:20:41 +08:00
|
|
|
|
2003-10-17 00:30:12 +08:00
|
|
|
MODULE pwcom
|
2004-04-02 21:01:15 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
USE constants, ONLY : e2, rytoev, amconv, uakbar, pi, tpi, fpi
|
2004-04-02 18:30:15 +08:00
|
|
|
USE cell_base, ONLY : celldm, at, bg, alat, omega, tpiba, tpiba2, &
|
|
|
|
ibrav, symm_type
|
2004-06-01 01:55:33 +08:00
|
|
|
! TEMP
|
|
|
|
USE uspp
|
|
|
|
! TEMP
|
2003-10-17 00:30:12 +08:00
|
|
|
USE basis
|
|
|
|
USE dynam
|
|
|
|
USE gvect
|
|
|
|
USE gsmooth
|
|
|
|
USE klist
|
|
|
|
USE lsda_mod
|
|
|
|
USE ktetra
|
|
|
|
USE symme
|
|
|
|
USE pseud
|
|
|
|
USE vlocal
|
|
|
|
USE wvfct
|
|
|
|
USE ener
|
|
|
|
USE force_mod
|
|
|
|
USE scf
|
|
|
|
USE relax
|
|
|
|
USE cellmd
|
|
|
|
USE char
|
|
|
|
USE us
|
|
|
|
USE ldaU
|
|
|
|
USE extfield
|
|
|
|
USE sticks
|
|
|
|
USE bp
|
|
|
|
USE fixed_occ
|
2004-04-30 16:51:31 +08:00
|
|
|
USE spin_orb
|
2005-08-16 20:04:34 +08:00
|
|
|
USE bp
|
2004-04-02 21:01:15 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
END MODULE pwcom
|