From db2061d1b45cb7858bf77b58e26ccadf5714a7ab Mon Sep 17 00:00:00 2001 From: giannozz Date: Mon, 16 Oct 2017 20:41:31 +0000 Subject: [PATCH] Yet another hour wasted thanks to a misleading comment: previously removed variable "qnorm" was actually needed to ensure correct allocation (via allocate_nlpot) of variables used by EXX with USPP and PAW git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13926 c92efa57-630b-4861-b058-cf58834340f0 --- Doc/release-notes | 7 ++++--- PW/src/exx.f90 | 16 ++++++++++++++-- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Doc/release-notes b/Doc/release-notes index 6fb5bfd7e..50bc5534d 100644 --- a/Doc/release-notes +++ b/Doc/release-notes @@ -19,10 +19,11 @@ New in 6.2 version: Fixed in 6.2 version - * Bug in DFPT with a constrained magnetization for insulators + * DFPT with constrained magnetization for insulators wasn't working + (r13915) - * virtual.x was linking a duplicate obsolete "pseudo" module, leading - to an "unrecognized dft" error (fix provided by Stefano Dal Forno) + * virtual.x was linking a duplicate obsolete "pseudo" module, leading to + "unrecognized dft" error (fix provided by Stefano Dal Forno, r13910) * NEB + EXX works again (r13851) diff --git a/PW/src/exx.f90 b/PW/src/exx.f90 index f32af6a1d..9cd854e77 100644 --- a/PW/src/exx.f90 +++ b/PW/src/exx.f90 @@ -243,13 +243,15 @@ MODULE exx gkcut = ecutwfc/tpiba2 exx_fft%gcutmt = ecutfock / tpiba2 ELSE - ! ! gkcut = 0.0_dp DO ik = 1,nks gkcut = MAX ( gkcut, sqrt( sum(xk(:,ik)**2) ) ) ENDDO CALL mp_max( gkcut, inter_pool_comm ) + ! Alternatively, variable "qnorm" earlier computed in "exx_grid_init" + ! could be used as follows: + ! gkcut = ( sqrt(ecutwfc/tpiba2) + qnorm )**2 gkcut = ( sqrt(ecutwfc/tpiba2) + gkcut )**2 ! ! The following instruction may be needed if ecutfock \simeq ecutwfc @@ -430,7 +432,7 @@ MODULE exx USE cell_base, ONLY : bg, at USE spin_orb, ONLY : domag USE noncollin_module, ONLY : nspin_lsda - USE klist, ONLY : xk, wk, nkstot, nks + USE klist, ONLY : xk, wk, nkstot, nks, qnorm USE wvfct, ONLY : nbnd USE start_k, ONLY : nk1,nk2,nk3 USE control_flags, ONLY : iverbosity @@ -640,6 +642,16 @@ MODULE exx CALL exx_grid_check ( xk_collect(:,:) ) DEALLOCATE( xk_collect ) ! + ! qnorm = max |q|, used in allocate_nlpot to compute the maximum size + ! of some arrays (e.g. qrad) - beware: needed for US/PAW+EXX + ! + qnorm = 0.0_dp + DO iq = 1,nkqs + DO ik = 1,nks + qnorm = max(qnorm, sqrt( sum((xk(:,ik)-xkq_collect(:,iq))**2) )) + ENDDO + ENDDO + ! CALL stop_clock ('exx_grid') ! RETURN