From e0a0d4014e32bc212a143a0b71485ed301da6b3b Mon Sep 17 00:00:00 2001 From: ccavazzoni Date: Fri, 20 Aug 2010 15:18:43 +0000 Subject: [PATCH] - bug fix for LSD simulation, bug introduced with yesterday commit git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@7003 c92efa57-630b-4861-b058-cf58834340f0 --- CPV/chargedensity.f90 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CPV/chargedensity.f90 b/CPV/chargedensity.f90 index e0ffc2804..8a5370cb2 100644 --- a/CPV/chargedensity.f90 +++ b/CPV/chargedensity.f90 @@ -384,7 +384,6 @@ ! add vanderbilt contribution to the charge density ! drhov called before rhov because input rho must be the smooth part ! - ! IF ( ttstress ) & CALL drhov( irb, eigrb, rhovan, drhovan, rhog, rhor, drhog, drhor ) ! @@ -996,7 +995,7 @@ SUBROUTINE drhov(irb,eigrb,rhovan,drhovan,rhog,rhor,drhog,drhor) qv(nmb(ig))= CONJG(eigrb(ig,isa)*dqgbt(ig,1)) & & + ci*CONJG(eigrb(ig,isa)*dqgbt(ig,2)) END DO -! + CALL invfft('Box',qv, dfftb, isa ) ! ! qv is the now the US augmentation charge for atomic species is @@ -1021,6 +1020,7 @@ SUBROUTINE drhov(irb,eigrb,rhovan,drhovan,rhog,rhor,drhog,drhor) ! CALL fwfft('Dense', v, dfftp ) + DO ig=1,ng fp=v(np(ig))+v(nm(ig)) fm=v(np(ig))-v(nm(ig)) @@ -1034,6 +1034,7 @@ SUBROUTINE drhov(irb,eigrb,rhovan,drhovan,rhog,rhor,drhog,drhor) END DO ENDIF + DEALLOCATE( v ) ! RETURN @@ -1279,6 +1280,8 @@ SUBROUTINE rhov(irb,eigrb,rhovan,rhog,rhor) isup=1 isdw=2 + v (:) = (0.d0, 0.d0) + ALLOCATE( qgbt( ngb, 2 ) ) ALLOCATE( qv( nnrb ) )