pwdft
0.1
PW-DFT code for education
|
Go to the documentation of this file.
38 integer :: iat, jtyp, ii, jj, lwork = 3, ipiv(3), &
39 & info, i1, i2, i3, nn, ik
40 real(8) :: work(3), ecutrho, ecutwfc
55 write(*,*)
" Number of atoms : ",
nat
56 write(*,*)
" Number of species : ",
ntyp
57 write(*,*)
" Plane-wave cutoff (wfc) [Ry] : ", ecutwfc
58 write(*,*)
" Plane-wave cutoff (rho,V) [Ry] : ", ecutrho
69 write(*,*)
" Convergence threshold : ",
conv_thr
78 if(key ==
"ATOMIC_SPECIES")
then
80 write(*,*)
" Atomic species :"
83 read(*,*)
spec(jtyp)%elem,
spec(jtyp)%ps_file
84 write(*,*) jtyp, trim(
spec(jtyp)%elem),
" ", trim(
spec(jtyp)%ps_file)
87 else if(key ==
"ATOMIC_POSITIONS")
then
90 read(*,*)
atm(iat)%elem,
atm(iat)%pos(1:3)
93 else if(key ==
"K_POINTS")
then
101 read(*,*)
kvec(1:3,10*ii+1)
103 kvec(1:3,10*(ii-1)+ik) &
104 & =
kvec(1:3,10*(ii-1)+1) * dble(11-ik)/10.0d0 &
105 & +
kvec(1:3,10* ii +1) * dble(ik-1)/10.0d0
117 do i3 = 0,
kgrd(3) - 1
118 do i2 = 0,
kgrd(2) - 1
119 do i1 = 0,
kgrd(1) - 1
129 write(*,*)
" Number of k : ",
nk
131 else if(key ==
"CELL_PARAMETERS")
then
133 read(*,*)
avec(1:3,1:3)
135 write(*,*)
" Cell parameters [Bohr] :"
138 write(*,*)
" ",
avec(1:3,ii)
144 write(*,*)
" Cell volume [Bohr^3] :",
vcell
148 bvec(1:3,1:3) = transpose(
avec(1:3,1:3))
149 call dgetrf(3, 3,
bvec, 3, ipiv, info)
150 call dgetri(3,
bvec, 3, ipiv, work, lwork, info)
151 if(info /= 0) stop
'read_stdin : inverce of avec.'
153 write(*,*)
" Reciplocal lattice vector [Bohr^-1] :"
155 write(*,*)
" ",
bvec(1:3,ii)
163 write(*,*)
" Atomic position"
168 if(trim(
spec(jtyp)%elem) == trim(
atm(iat)%elem))
then
174 write(*,*) iat, trim(
atm(iat)%elem),
atm(iat)%ityp,
atm(iat)%pos(1:3)
178 write(*,*)
" FFT and G-vector for wfc"
180 write(*,*)
" FFT and G-vector for rho and V"
type(spec_t), dimension(:), allocatable, save spec
(ntyp) Species
real(8), save vcell
Unit cell volume [Bohr^3].
real(8), dimension(3, 3), save avec
Unit lattice vector [Bohr].
character(256), save calculation
Calculation mode.
integer, save ntyp
Number of species (elements)
type(atm_t), dimension(:), allocatable, save atm
(nat) Atom
real(8), save mixing_beta
Mixing for SCF.
integer, save nbnd
Number of bands.
integer, dimension(3), save kgrd
subroutine setup_gvec(xfft, g2cut)
integer, save nat
Number of atoms.
integer, save electron_maxstep
Max number of iteration.
real(8), parameter htr2ev
real(8), dimension(3, 3), save bvec
Unit reciplocal lattice vector [Bohr^-1].
real(8), save conv_thr
Convergence threshold [Htr].
real(8), dimension(:,:), allocatable, save kvec
real(8), parameter bohr2ang