2016-04-11 23:40:37 +08:00
|
|
|
!
|
2016-04-12 00:19:09 +08:00
|
|
|
! Copyright (C) 2001-2016 PWSCF group
|
2016-04-11 23:40:37 +08:00
|
|
|
! 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 dnonloccorr(rho, drho, xq, dvaux )
|
|
|
|
! ===================
|
|
|
|
!--------------------------------------------------------------------
|
|
|
|
!
|
|
|
|
USE kinds, ONLY : DP
|
2020-01-13 20:25:42 +08:00
|
|
|
USE noncollin_module, ONLY : nspin_mag
|
2016-04-11 23:40:37 +08:00
|
|
|
USE fft_base, ONLY: dfftp
|
|
|
|
USE funct, ONLY : dft_is_gradient, dft_is_nonlocc, get_inlc
|
|
|
|
USE ph_vdW_DF, ONLY : dv_drho_vdwdf
|
|
|
|
USE ph_rVV10, ONLY : dv_drho_rvv10
|
|
|
|
implicit none
|
|
|
|
!
|
|
|
|
real(DP), INTENT(IN) :: rho (dfftp%nnr, nspin_mag), xq(3)
|
|
|
|
complex(DP), INTENT(IN) :: drho (dfftp%nnr, nspin_mag)
|
|
|
|
complex(DP), INTENT(INOUT) :: dvaux (dfftp%nnr, nspin_mag)
|
|
|
|
|
|
|
|
complex(DP), ALLOCATABLE :: dvnonloc(:,:)
|
|
|
|
|
|
|
|
integer :: inlc
|
|
|
|
|
|
|
|
allocate(dvnonloc(dfftp%nnr,nspin_mag))
|
2017-02-17 21:11:41 +08:00
|
|
|
dvnonloc(:,:)= (0.d0,0.d0)
|
2016-04-11 23:40:37 +08:00
|
|
|
if (get_inlc()==1 .or. get_inlc()==2) CALL dv_drho_vdwdf(rho, drho, nspin_mag, xq, dvnonloc)
|
|
|
|
if (get_inlc()==3) CALL dv_drho_rvv10(rho, drho, nspin_mag, xq, dvnonloc)
|
|
|
|
dvaux = dvaux + dvnonloc
|
|
|
|
deallocate(dvnonloc)
|
|
|
|
|
|
|
|
return
|
|
|
|
end subroutine dnonloccorr
|