mirror of https://gitlab.com/QEF/q-e.git
There is no reason to write to file the number of planewaves per k-point:
it is stored in memory anyway git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@3705 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
parent
d3245f9325
commit
6428be9581
|
@ -21,7 +21,7 @@ SUBROUTINE c_bands( iter, ik_, dr2 )
|
|||
USE io_files, ONLY : iunigk, nwordatwfc, iunsat, iunwfc, &
|
||||
nwordwfc, iunefield,iunefieldp,iunefieldm
|
||||
USE cell_base, ONLY : tpiba2
|
||||
USE klist, ONLY : nkstot, nks, xk
|
||||
USE klist, ONLY : nkstot, nks, xk, ngk
|
||||
USE uspp, ONLY : vkb, nkb
|
||||
USE gvect, ONLY : g, ecfixed, qcutz, q2sigma, nrxx, &
|
||||
nr1, nr2, nr3
|
||||
|
@ -111,9 +111,11 @@ SUBROUTINE c_bands( iter, ik_, dr2 )
|
|||
!
|
||||
IF ( lsda ) current_spin = isk(ik)
|
||||
!
|
||||
! ... Reads the Hamiltonian and the list k+G <-> G of this k point
|
||||
! ... Reads the list of indices k+G <-> G of this k point
|
||||
!
|
||||
IF ( nks > 1 ) READ( iunigk ) npw, igk
|
||||
IF ( nks > 1 ) READ( iunigk ) igk
|
||||
!
|
||||
npw = ngk(ik)
|
||||
!
|
||||
! ... do not recalculate k-points if restored from a previous run
|
||||
!
|
||||
|
|
|
@ -20,7 +20,7 @@ SUBROUTINE cegterg( ndim, ndmx, nvec, nvecx, evc, ethr, &
|
|||
! ... ( H - e S ) * evc = 0
|
||||
!
|
||||
! ... where H is an hermitean operator, e is a real scalar,
|
||||
! ... S is an uspp matrix, evc is a complex vector
|
||||
! ... S is an overlap matrix, evc is a complex vector
|
||||
!
|
||||
USE kinds, ONLY : DP
|
||||
USE io_global, ONLY : stdout
|
||||
|
@ -319,7 +319,7 @@ SUBROUTINE cegterg( ndim, ndmx, nvec, nvecx, evc, ethr, &
|
|||
!
|
||||
! ... update the reduced hamiltonian
|
||||
!
|
||||
CALL start_clock( 'uspp' )
|
||||
CALL start_clock( 'overlap' )
|
||||
!
|
||||
CALL ZGEMM( 'C', 'N', nbase+notcnv, notcnv, kdim, ONE, psi, &
|
||||
kdmx, hpsi(1,1,nb1), kdmx, ZERO, hc(1,nb1), nvecx )
|
||||
|
@ -340,7 +340,7 @@ SUBROUTINE cegterg( ndim, ndmx, nvec, nvecx, evc, ethr, &
|
|||
!
|
||||
CALL reduce( 2*nvecx*notcnv, sc(1,nb1) )
|
||||
!
|
||||
CALL stop_clock( 'uspp' )
|
||||
CALL stop_clock( 'overlap' )
|
||||
!
|
||||
nbase = nbase + notcnv
|
||||
!
|
||||
|
|
|
@ -19,7 +19,7 @@ SUBROUTINE dndepsilon ( dns,ldim,ipol,jpol )
|
|||
USE atom, ONLY : nchi, lchi, oc
|
||||
USE ions_base, ONLY : nat, ityp
|
||||
USE basis, ONLY : natomwfc
|
||||
USE klist, ONLY : nks, xk
|
||||
USE klist, ONLY : nks, xk, ngk
|
||||
USE ldaU, ONLY : swfcatom, Hubbard_l, &
|
||||
Hubbard_U, Hubbard_alpha
|
||||
USE lsda_mod, ONLY : lsda, nspin, current_spin, isk
|
||||
|
@ -75,12 +75,12 @@ SUBROUTINE dndepsilon ( dns,ldim,ipol,jpol )
|
|||
!
|
||||
! we start a loop on k points
|
||||
!
|
||||
IF (nks.GT.1) REWIND (iunigk)
|
||||
IF (nks > 1) REWIND (iunigk)
|
||||
|
||||
DO ik = 1, nks
|
||||
IF (lsda) current_spin = isk(ik)
|
||||
IF (nks.GT.1) READ (iunigk) npw, igk
|
||||
|
||||
IF (nks > 1) READ (iunigk) igk
|
||||
npw = ngk(ik)
|
||||
!
|
||||
! now we need the first derivative of proj with respect to
|
||||
! epsilon(ipol,jpol)
|
||||
|
|
19
PW/exx.f90
19
PW/exx.f90
|
@ -57,7 +57,7 @@ contains
|
|||
USE kinds, ONLY : DP
|
||||
USE constants, ONLY : pi
|
||||
USE io_files, ONLY : iunigk, nwordwfc, iunwfc
|
||||
USE klist, ONLY : xk, nks, wk
|
||||
USE klist, ONLY : xk, nks, wk, ngk
|
||||
USE wvfct, ONLY : nbnd, npw, npwx, igk, g2kin, wg
|
||||
USE gvect, ONLY : g
|
||||
USE cell_base, ONLY : tpiba2, omega
|
||||
|
@ -72,7 +72,8 @@ contains
|
|||
|
||||
IF ( nks > 1 ) REWIND( iunigk )
|
||||
do ik=1,nks
|
||||
IF ( nks > 1 ) READ( iunigk ) npw, igk
|
||||
IF ( nks > 1 ) READ( iunigk ) igk
|
||||
npw=ngk(ik)
|
||||
DO ig = 1, npw
|
||||
!
|
||||
g2kin(ig) = ( xk(1,ik) + g(1,igk(ig)) )**2 + &
|
||||
|
@ -370,7 +371,7 @@ contains
|
|||
USE gsmooth, ONLY : nls, nlsm, nr1s, nr2s, nr3s, &
|
||||
nrx1s, nrx2s, nrx3s, nrxxs, doublegrid
|
||||
USE wvfct, ONLY : nbnd, npwx, npw, igk, wg, et, gamma_only
|
||||
USE klist, ONLY : wk
|
||||
USE klist, ONLY : wk, ngk
|
||||
USE symme, ONLY : nsym, s, ftau
|
||||
|
||||
use mp_global, ONLY : nproc_pool, me_pool
|
||||
|
@ -440,8 +441,9 @@ contains
|
|||
end do
|
||||
|
||||
DO ik = 1, nks
|
||||
npw = ngk (ik)
|
||||
IF ( nks > 1 ) THEN
|
||||
READ( iunigk ) npw, igk
|
||||
READ( iunigk ) igk
|
||||
CALL davcio (tempevc, nwordwfc, iunwfc, ik, -1)
|
||||
ELSE
|
||||
tempevc(1:npwx,1:nbnd) = evc(1:npwx,1:nbnd)
|
||||
|
@ -702,6 +704,7 @@ contains
|
|||
USE gvect, ONLY : gstart
|
||||
USE wavefunctions_module, ONLY : evc
|
||||
USE lsda_mod, ONLY : lsda, current_spin, isk
|
||||
USE klist, ONLY : ngk
|
||||
|
||||
implicit none
|
||||
REAL (DP) :: exxenergy, energy
|
||||
|
@ -716,8 +719,9 @@ contains
|
|||
do ik=1,nks
|
||||
current_k = ik
|
||||
IF ( lsda ) current_spin = isk(ik)
|
||||
npw = ngk (ik)
|
||||
IF ( nks > 1 ) THEN
|
||||
READ( iunigk ) npw, igk
|
||||
READ( iunigk ) igk
|
||||
call davcio (psi, nwordwfc, iunwfc, ik, -1)
|
||||
ELSE
|
||||
psi(1:npwx,1:nbnd) = evc(1:npwx,1:nbnd)
|
||||
|
@ -760,7 +764,7 @@ contains
|
|||
nrx1s, nrx2s, nrx3s, nrxxs, doublegrid
|
||||
USE wvfct, ONLY : nbnd, npwx, npw, igk, wg, current_k, gamma_only
|
||||
USE wavefunctions_module, ONLY : evc
|
||||
USE klist, ONLY : xk
|
||||
USE klist, ONLY : xk, ngk
|
||||
USE lsda_mod, ONLY : lsda, current_spin, isk
|
||||
USE gvect, ONLY : g, nl
|
||||
|
||||
|
@ -789,8 +793,9 @@ contains
|
|||
do ikk=1,nks
|
||||
current_k = ikk
|
||||
IF ( lsda ) current_spin = isk(ikk)
|
||||
npw = ngk (ikk)
|
||||
IF ( nks > 1 ) THEN
|
||||
READ( iunigk ) npw, igk
|
||||
READ( iunigk ) igk
|
||||
call davcio (evc, nwordwfc, iunwfc, ikk, -1)
|
||||
END IF
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ SUBROUTINE force_hub(forceh)
|
|||
USE becmod, ONLY : becp
|
||||
USE uspp, ONLY : nkb, vkb
|
||||
USE wavefunctions_module, ONLY : evc
|
||||
USE klist, ONLY : nks, xk
|
||||
USE klist, ONLY : nks, xk, ngk
|
||||
USE io_files, ONLY : iunigk, nwordwfc, iunwfc, &
|
||||
iunat, iunsat, nwordatwfc
|
||||
USE atom, ONLY : nchi, lchi, oc
|
||||
|
@ -99,8 +99,8 @@ SUBROUTINE force_hub(forceh)
|
|||
!
|
||||
! now we need the first derivative of proj with respect to tau(alpha,ipol)
|
||||
!
|
||||
|
||||
IF (nks.GT.1) READ (iunigk) npw, igk
|
||||
npw = ngk (ik)
|
||||
IF (nks > 1) READ (iunigk) igk
|
||||
|
||||
CALL davcio(evc,nwordwfc,iunwfc,ik,-1)
|
||||
CALL davcio(swfcatom,nwordatwfc,iunsat,ik,-1)
|
||||
|
|
|
@ -18,7 +18,7 @@ SUBROUTINE force_us( forcenl )
|
|||
USE wvfct, ONLY : gamma_only
|
||||
USE cell_base, ONLY : at, bg, tpiba
|
||||
USE ions_base, ONLY : nat, ntyp => nsp, ityp
|
||||
USE klist, ONLY : nks, xk
|
||||
USE klist, ONLY : nks, xk, ngk
|
||||
USE gvect, ONLY : g
|
||||
USE uspp, ONLY : nkb, vkb, qq, deeq, qq_so, deeq_nc
|
||||
USE uspp_param, ONLY : nh, tvanp, newpseudo
|
||||
|
@ -81,8 +81,9 @@ SUBROUTINE force_us( forcenl )
|
|||
DO ik = 1, nks
|
||||
IF ( lsda ) current_spin = isk(ik)
|
||||
!
|
||||
npw = ngk (ik)
|
||||
IF ( nks > 1 ) THEN
|
||||
READ( iunigk ) npw, igk
|
||||
READ( iunigk ) igk
|
||||
CALL davcio( evc, nwordwfc, iunwfc, ik, -1 )
|
||||
IF ( nkb > 0 ) &
|
||||
CALL init_us_2( npw, igk, xk(1,ik), vkb )
|
||||
|
@ -220,8 +221,9 @@ SUBROUTINE force_us( forcenl )
|
|||
DO ik = 1, nks
|
||||
IF ( lsda ) current_spin = isk(ik)
|
||||
!
|
||||
npw = ngk(ik)
|
||||
IF ( nks > 1 ) THEN
|
||||
READ( iunigk ) npw, igk
|
||||
READ( iunigk ) igk
|
||||
CALL davcio( evc, nwordwfc, iunwfc, ik, -1 )
|
||||
IF ( nkb > 0 ) &
|
||||
CALL init_us_2( npw, igk, xk(1,ik), vkb )
|
||||
|
|
|
@ -47,7 +47,7 @@ SUBROUTINE hinit0()
|
|||
!
|
||||
! ... if there is only one k-point npw and igk stay in memory
|
||||
!
|
||||
IF ( nks > 1 ) WRITE( iunigk ) npw, igk
|
||||
IF ( nks > 1 ) WRITE( iunigk ) igk
|
||||
!
|
||||
END DO
|
||||
!
|
||||
|
|
|
@ -21,7 +21,7 @@ SUBROUTINE new_ns()
|
|||
USE atom, ONLY : lchi, nchi, oc
|
||||
USE ions_base, ONLY : nat, ityp
|
||||
USE basis, ONLY : natomwfc
|
||||
USE klist, ONLY : nks
|
||||
USE klist, ONLY : nks, ngk
|
||||
USE ldaU, ONLY : ns, nsnew, Hubbard_lmax, Hubbard_l, &
|
||||
Hubbard_U, Hubbard_alpha, swfcatom, &
|
||||
eth, d1, d2, d3
|
||||
|
@ -82,9 +82,11 @@ SUBROUTINE new_ns()
|
|||
|
||||
DO ik = 1, nks
|
||||
IF (lsda) current_spin = isk(ik)
|
||||
IF (nks.GT.1) READ (iunigk) npw, igk
|
||||
IF (nks.GT.1) CALL davcio (evc, nwordwfc, iunwfc, ik, - 1)
|
||||
|
||||
npw = ngk (ik)
|
||||
IF (nks > 1) THEN
|
||||
READ (iunigk) igk
|
||||
CALL davcio (evc, nwordwfc, iunwfc, ik, - 1)
|
||||
END IF
|
||||
CALL davcio (swfcatom, nwordatwfc, iunsat, ik, - 1)
|
||||
!
|
||||
! make the projection
|
||||
|
|
|
@ -21,7 +21,7 @@ SUBROUTINE orthoatwfc
|
|||
USE io_files, ONLY : iunat, iunsat, nwordatwfc, iunigk
|
||||
USE ions_base, ONLY : nat
|
||||
USE basis, ONLY : natomwfc
|
||||
USE klist, ONLY : nks, xk
|
||||
USE klist, ONLY : nks, xk, ngk
|
||||
USE ldaU, ONLY : swfcatom, U_projection
|
||||
USE wvfct, ONLY : npwx, npw, igk, gamma_only
|
||||
USE uspp, ONLY : nkb, vkb
|
||||
|
@ -91,7 +91,8 @@ SUBROUTINE orthoatwfc
|
|||
|
||||
DO ik = 1, nks
|
||||
|
||||
IF (nks > 1) READ (iunigk) npw, igk
|
||||
npw = ngk (ik)
|
||||
IF (nks > 1) READ (iunigk) igk
|
||||
|
||||
overlap(:,:) = (0.d0,0.d0)
|
||||
work(:,:) = (0.d0,0.d0)
|
||||
|
|
|
@ -221,7 +221,8 @@ MODULE pw_restart
|
|||
!
|
||||
DO ik = 1, nks
|
||||
!
|
||||
IF ( nks > 1 ) READ( iunigk ) npw, igk
|
||||
npw = ngk (ik)
|
||||
IF ( nks > 1 ) READ( iunigk ) igk
|
||||
!
|
||||
CALL gk_l2gmap( ngm, ig_l2g(1), npw, igk(1), igk_l2g(1,ik) )
|
||||
!
|
||||
|
|
|
@ -15,7 +15,7 @@ subroutine stres_knl (sigmanlc, sigmakin)
|
|||
USE constants, ONLY: pi, e2
|
||||
USE cell_base, ONLY: omega, alat, at, bg, tpiba
|
||||
USE gvect, ONLY: qcutz, ecfixed, q2sigma, g
|
||||
USE klist, ONLY: nks, xk
|
||||
USE klist, ONLY: nks, xk, ngk
|
||||
USE io_files, ONLY: iunwfc, nwordwfc, iunigk
|
||||
USE symme, ONLY: s, nsym
|
||||
USE wvfct, ONLY: npw, npwx, nbnd, gamma_only, igk, wg
|
||||
|
@ -25,7 +25,7 @@ subroutine stres_knl (sigmanlc, sigmakin)
|
|||
real(DP) :: sigmanlc (3, 3), sigmakin (3, 3)
|
||||
real(DP), allocatable :: gk (:,:), kfac (:)
|
||||
real(DP) :: twobysqrtpi, gk2, arg
|
||||
integer :: kpoint, l, m, i, ibnd, is
|
||||
integer :: ik, l, m, i, ibnd, is
|
||||
|
||||
allocate (gk( 3, npwx))
|
||||
allocate (kfac( npwx))
|
||||
|
@ -37,15 +37,16 @@ subroutine stres_knl (sigmanlc, sigmakin)
|
|||
kfac(:) = 1.d0
|
||||
|
||||
if (nks.gt.1) rewind (iunigk)
|
||||
do kpoint = 1, nks
|
||||
if (nks.gt.1) then
|
||||
read (iunigk) npw, igk
|
||||
call davcio (evc, nwordwfc, iunwfc, kpoint, - 1)
|
||||
do ik = 1, nks
|
||||
npw = ngk(ik)
|
||||
if (nks > 1) then
|
||||
read (iunigk) igk
|
||||
call davcio (evc, nwordwfc, iunwfc, ik, - 1)
|
||||
endif
|
||||
do i = 1, npw
|
||||
gk (1, i) = (xk (1, kpoint) + g (1, igk (i) ) ) * tpiba
|
||||
gk (2, i) = (xk (2, kpoint) + g (2, igk (i) ) ) * tpiba
|
||||
gk (3, i) = (xk (3, kpoint) + g (3, igk (i) ) ) * tpiba
|
||||
gk (1, i) = (xk (1, ik) + g (1, igk (i) ) ) * tpiba
|
||||
gk (2, i) = (xk (2, ik) + g (2, igk (i) ) ) * tpiba
|
||||
gk (3, i) = (xk (3, ik) + g (3, igk (i) ) ) * tpiba
|
||||
if (qcutz.gt.0.d0) then
|
||||
gk2 = gk (1, i) **2 + gk (2, i) **2 + gk (3, i) **2
|
||||
arg = ( (gk2 - ecfixed) / q2sigma) **2
|
||||
|
@ -60,12 +61,12 @@ subroutine stres_knl (sigmanlc, sigmakin)
|
|||
do ibnd = 1, nbnd
|
||||
do i = 1, npw
|
||||
if (noncolin) then
|
||||
sigmakin (l, m) = sigmakin (l, m) + wg (ibnd, kpoint) * &
|
||||
sigmakin (l, m) = sigmakin (l, m) + wg (ibnd, ik) * &
|
||||
gk (l, i) * gk (m, i) * kfac (i) * &
|
||||
( DBLE (CONJG(evc(i ,ibnd))*evc(i ,ibnd)) + &
|
||||
DBLE (CONJG(evc(i+npwx,ibnd))*evc(i+npwx,ibnd)))
|
||||
else
|
||||
sigmakin (l, m) = sigmakin (l, m) + wg (ibnd, kpoint) * &
|
||||
sigmakin (l, m) = sigmakin (l, m) + wg (ibnd, ik) * &
|
||||
gk (l, i) * gk (m, i) * kfac (i) * &
|
||||
DBLE (CONJG(evc (i, ibnd) ) * evc (i, ibnd) )
|
||||
end if
|
||||
|
@ -77,7 +78,7 @@ subroutine stres_knl (sigmanlc, sigmakin)
|
|||
!
|
||||
! contribution from the nonlocal part
|
||||
!
|
||||
call stres_us (kpoint, gk, sigmanlc)
|
||||
call stres_us (ik, gk, sigmanlc)
|
||||
|
||||
enddo
|
||||
!
|
||||
|
|
|
@ -27,7 +27,7 @@ SUBROUTINE sum_band()
|
|||
nrx1s, nrx2s, nrx3s, nrxxs, doublegrid
|
||||
USE klist, ONLY : lgauss, degauss, ngauss, nks, &
|
||||
nkstot, wk, xk, nelec, nelup, neldw, &
|
||||
two_fermi_energies
|
||||
two_fermi_energies, ngk
|
||||
USE ktetra, ONLY : ltetra, ntetra, tetra
|
||||
USE ldaU, ONLY : lda_plus_U
|
||||
USE lsda_mod, ONLY : lsda, nspin, current_spin, isk
|
||||
|
@ -297,10 +297,11 @@ SUBROUTINE sum_band()
|
|||
k_loop: DO ik = 1, nks
|
||||
!
|
||||
IF ( lsda ) current_spin = isk(ik)
|
||||
npw = ngk(ik)
|
||||
!
|
||||
IF ( nks > 1 ) THEN
|
||||
!
|
||||
READ( iunigk ) npw, igk
|
||||
READ( iunigk ) igk
|
||||
CALL davcio( evc, nwordwfc, iunwfc, ik, -1 )
|
||||
!
|
||||
END IF
|
||||
|
@ -481,10 +482,11 @@ SUBROUTINE sum_band()
|
|||
k_loop: DO ik = 1, nks
|
||||
!
|
||||
IF ( lsda ) current_spin = isk(ik)
|
||||
npw = ngk (ik)
|
||||
!
|
||||
IF ( nks > 1 ) THEN
|
||||
!
|
||||
READ( iunigk ) npw, igk
|
||||
READ( iunigk ) igk
|
||||
CALL davcio( evc, nwordwfc, iunwfc, ik, -1 )
|
||||
!
|
||||
END IF
|
||||
|
|
|
@ -411,7 +411,7 @@ SUBROUTINE extrapolate_wfcs( wfc_extr )
|
|||
!
|
||||
USE io_global, ONLY : stdout
|
||||
USE kinds, ONLY : DP
|
||||
USE klist, ONLY : nks
|
||||
USE klist, ONLY : nks, ngk
|
||||
USE control_flags, ONLY : isolve, alpha0, beta0, wfc_order
|
||||
USE wvfct, ONLY : nbnd, npw, npwx, igk
|
||||
USE io_files, ONLY : nwordwfc, iunigk, iunwfc, iunoldwfc, &
|
||||
|
@ -479,7 +479,8 @@ SUBROUTINE extrapolate_wfcs( wfc_extr )
|
|||
!
|
||||
DO ik = 1, nks
|
||||
!
|
||||
IF ( nks > 1 ) READ( iunigk ) npw, igk
|
||||
npw = ngk (ik)
|
||||
IF ( nks > 1 ) READ( iunigk ) igk
|
||||
!
|
||||
CALL davcio( evcold, nwordwfc, iunoldwfc, ik, - 1 )
|
||||
CALL davcio( evc, nwordwfc, iunwfc, ik, - 1 )
|
||||
|
@ -588,7 +589,8 @@ SUBROUTINE extrapolate_wfcs( wfc_extr )
|
|||
!
|
||||
DO ik = 1, nks
|
||||
!
|
||||
IF ( nks > 1 ) READ( iunigk ) npw, igk
|
||||
npw = ngk (ik)
|
||||
IF ( nks > 1 ) READ( iunigk ) igk
|
||||
!
|
||||
CALL davcio( evcold, nwordwfc, iunoldwfc, ik, - 1 )
|
||||
CALL davcio( evc, nwordwfc, iunwfc, ik, - 1 )
|
||||
|
|
|
@ -103,7 +103,7 @@ SUBROUTINE init_wfc ( ik )
|
|||
USE cell_base, ONLY : tpiba2
|
||||
USE basis, ONLY : natomwfc, startingwfc
|
||||
USE gvect, ONLY : g, ecfixed, qcutz, q2sigma
|
||||
USE klist, ONLY : xk, nks
|
||||
USE klist, ONLY : xk, nks, ngk
|
||||
USE lsda_mod, ONLY : lsda, current_spin, isk
|
||||
USE wvfct, ONLY : nbnd, npw, npwx, igk, g2kin, et,&
|
||||
wg, current_k
|
||||
|
@ -147,7 +147,8 @@ SUBROUTINE init_wfc ( ik )
|
|||
!
|
||||
IF ( lsda ) current_spin = isk(ik)
|
||||
!
|
||||
IF ( nks > 1 ) READ( iunigk ) npw, igk
|
||||
npw = ngk (ik)
|
||||
IF ( nks > 1 ) READ( iunigk ) igk
|
||||
!
|
||||
! ... here we compute the kinetic energy
|
||||
!
|
||||
|
|
Loading…
Reference in New Issue