Reverting by hand as the previous commit did not work as expected

git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@12316 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
paulatto 2016-04-19 09:08:48 +00:00
parent 0304effd50
commit 3f8cc686ce
1 changed files with 19 additions and 37 deletions

View File

@ -1,54 +1,35 @@
!
! Copyright (C) 2001-2016 Quantum ESPRESSO group
! Copyright (C) 2001-2007 Quantum ESPRESSO group
! This file is distributed under the terms of the
! GNU General Public License. See the file `License'
! in the root directory of the present distribution,
! or http://www.gnu.org/copyleft/gpl.txt .
!
subroutine addcore(mode, drhoc)
use kinds, only: DP
use modes, only: u
use qpoint, only: xq
use nlcc_ph, only: drc
use fft_base, only: dfftp
use gvect, only: ngm
use ions_base, only: ntyp => nsp
implicit none
integer, intent (IN) :: mode
! input: the mode
complex(DP), intent(OUT) :: drhoc (dfftp%nnr)
! output: the change of the core charge
CALL addcore_ofq (xq, mode, u, drc, drhoc, +1._dp)
end subroutine
!
subroutine addcore_ofq (xq, mode, u, drc, drhoc, csign)
subroutine addcore (mode, drhoc)
!
! This routine computes the change of the core charge
! when the atoms moves along the given mode
!
!
USE kinds, only : DP
use uspp_param, only : upf
use ions_base, only : nat, ityp
use cell_base, only : tpiba
use fft_base, only : dfftp
use fft_interfaces, only : invfft
use gvect, only : ngm, nl, mill, eigts1, eigts2, eigts3, g
use modes, only : u
use qpoint, only : eigqts, xq
use uspp, only : nlcc_any
use nlcc_ph, only : drc
USE kinds, only : DP
use uspp_param, only : upf
use ions_base, only : nat, ityp
use cell_base, only : tpiba
use fft_base, only : dfftp
use fft_interfaces, only: invfft
use gvect, only : ngm, nl, mill, eigts1, eigts2, eigts3, g
use modes, only : u
use qpoint, only : eigqts, xq
use nlcc_ph, only : drc
use uspp, only : nlcc_any
implicit none
!
! The dummy variables
!
integer, intent (IN) :: mode ! the mode
REAL(DP),INTENT(in) :: xq(3) ! the q vector
COMPLEX(DP),INTENT(in) :: u(3*nat, 3*nat) ! dispalcement patterns
COMPLEX(DP),INTENT(in) :: drc(ngm, ntyp) ! core rho without atomic factor
REAL(DP),INTENT(in) :: csign ! add core with +1, subtract with -1, or anything in between
!
integer, intent (IN) :: mode
! input: the mode
complex(DP), intent(OUT) :: drhoc (dfftp%nnr)
! output: the change of the core charge
!
@ -66,7 +47,7 @@ subroutine addcore_ofq (xq, mode, u, drc, drhoc, csign)
do na = 1, nat
nt = ityp (na)
if (upf(nt)%nlcc) then
fact = csign*tpiba * (0.d0, -1.d0) * eigqts (na)
fact = tpiba * (0.d0, -1.d0) * eigqts (na)
mu = 3 * (na - 1)
if ( abs (u (mu + 1, mode) ) + &
abs (u (mu + 2, mode) ) + &
@ -93,4 +74,5 @@ subroutine addcore_ofq (xq, mode, u, drc, drhoc, csign)
!
return
end subroutine addcore_ofq
end subroutine addcore