Tetrahedra + nscf: always use the correct sysmmetry, or otherwise

the calculation of Efermi (performed at the beginning) will fail.
Same for smearing + nscf: needed for DOS calculations. Since Efermi
is calculated anyway in nscf, calculate and print a good value.
Beware: this may change once again the number of k-points used in a
nscf calculation if not all the symmetry is present ...


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@1640 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
giannozz 2005-02-11 15:47:00 +00:00
parent 059ffd302b
commit e922f580fe
2 changed files with 21 additions and 6 deletions

View File

@ -38,10 +38,10 @@ SUBROUTINE electrons()
USE gvect, ONLY : ngm, gstart, nr1, nr2, nr3, nrx1, nrx2, &
nrx3, nrxx, nl, g, gg, ecutwfc, gcutm
USE gsmooth, ONLY : doublegrid
USE klist, ONLY : xk, degauss, nelec, ngk, nks, nkstot, &
lgauss
USE klist, ONLY : xk, wk, degauss, nelec, ngk, nks, nkstot, &
lgauss, ngauss, degauss
USE lsda_mod, ONLY : lsda, nspin, magtot, absmag
USE ktetra, ONLY : ltetra
USE ktetra, ONLY : ltetra, ntetra, tetra
USE vlocal, ONLY : strf, vnew
USE wvfct, ONLY : nbnd, et, gamma_only
USE ener, ONLY : etot, eband, deband, ehart, vtxc, etxc, &
@ -179,6 +179,18 @@ SUBROUTINE electrons()
!
END DO
!
IF ( lgauss ) THEN
!
call efermig (et, nbnd, nks, nelec, wk, degauss, ngauss, ef)
WRITE( stdout, 9040 ) ef * rytoev
!
ELSE IF ( ltetra ) THEN
!
CALL efermit (et, nbnd, nks, nelec, nspin, ntetra, tetra, ef)
WRITE( stdout, 9040 ) ef * rytoev
!
END IF
!
#if defined (FLUSH)
CALL flush( stdout )
#endif

View File

@ -721,10 +721,13 @@ SUBROUTINE setup()
END IF
!
! ... non scf calculation: do not change the number of k-points
! ... to account for reduced symmetry, unless you need to
! ... (as in phonon or raman or DOS calculations, or whenever the
! ... Fermi energy has to be calculated)
!
ltest = ( nks /= input_nks ) .AND. &
( .NOT. lscf ) .AND. ( .NOT. ( lphonon .OR. lraman ) )
!
ltest = ( nks /= input_nks ) .AND. &
( .NOT. ( ltetra .OR. lgauss ) ) .AND. &
( .NOT. lscf ) .AND. ( .NOT. ( lphonon .OR. lraman ) )
IF ( ltest ) THEN
!
WRITE( stdout, '(/,5X,"Only input k-points are used ", &