31 use constant,
only : bohr2ang, pi, htr2ev
34 use k_point,
only : nk, kvec, kgrd
38 integer :: iat, jtyp, ii, jj, lwork = 3, ipiv(3), &
39 & info, i1, i2, i3, nn, ik
40 real(8) :: work(3), ecutrho, ecutwfc
44 namelist/system/ nat,
ntyp, ecutwfc, ecutrho, nbnd
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
111 read(*,*) kvec(1:3,1:nk)
114 nk = product(kgrd(1:3))
117 do i3 = 0, kgrd(3) - 1
118 do i2 = 0, kgrd(2) - 1
119 do i1 = 0, kgrd(1) - 1
121 kvec(1:3,nk) = dble(modulo((/i1,i2,i3/)+kgrd(1:3)/2,kgrd(1:3)) &
129 write(*,*)
" Number of k : ", nk
131 else if(key ==
"CELL_PARAMETERS")
then
133 read(*,*)
avec(1:3,1:3)
134 avec(1:3,1:3) =
avec(1:3,1:3) / bohr2ang
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.'
152 bvec(1:3,1:3) = 2.0d0 * pi * bvec(1:3,1:3)
153 write(*,*)
" Reciplocal lattice vector [Bohr^-1] :"
155 write(*,*)
" ", bvec(1:3,ii)
161 kvec(1:3,1:nk) = matmul(bvec(1:3,1:3), kvec(1:3,1:nk))
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"