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 .
|
|
|
|
!
|
|
|
|
!--------------------------------------------------------------------
|
2020-05-22 00:49:41 +08:00
|
|
|
SUBROUTINE dnonloccorr( rho, drho, xq, dvaux )
|
|
|
|
!------------------------------------------------------------------
|
2016-04-11 23:40:37 +08:00
|
|
|
!
|
2020-05-22 00:49:41 +08:00
|
|
|
USE kinds, ONLY : DP
|
2020-01-13 20:25:42 +08:00
|
|
|
USE noncollin_module, ONLY : nspin_mag
|
2020-05-22 00:49:41 +08:00
|
|
|
USE fft_base, ONLY : dfftp
|
2020-10-08 21:48:10 +08:00
|
|
|
USE funct, ONLY : dft_is_nonlocc, get_inlc !, dft_is_gradient
|
2020-05-22 00:49:41 +08:00
|
|
|
USE ph_vdW_DF, ONLY : dv_drho_vdwdf
|
|
|
|
USE ph_rVV10, ONLY : dv_drho_rvv10
|
|
|
|
!
|
2016-04-11 23:40:37 +08:00
|
|
|
implicit none
|
|
|
|
!
|
2020-05-22 00:49:41 +08:00
|
|
|
real(DP), INTENT(IN) :: rho (dfftp%nnr, nspin_mag), xq(3)
|
|
|
|
complex(DP), INTENT(IN) :: drho (dfftp%nnr, nspin_mag)
|
2016-04-11 23:40:37 +08:00
|
|
|
complex(DP), INTENT(INOUT) :: dvaux (dfftp%nnr, nspin_mag)
|
2020-05-22 00:49:41 +08:00
|
|
|
complex(DP), ALLOCATABLE :: dvnonloc(:,:)
|
|
|
|
integer :: inlc
|
|
|
|
|
2016-04-11 23:40:37 +08:00
|
|
|
|
2020-05-22 00:49:41 +08:00
|
|
|
allocate( dvnonloc(dfftp%nnr, nspin_mag) )
|
|
|
|
dvnonloc(:,:) = (0.D0,0.D0)
|
|
|
|
inlc = get_inlc()
|
2016-04-11 23:40:37 +08:00
|
|
|
|
2020-05-22 00:49:41 +08:00
|
|
|
IF ( inlc > 0 .AND. inlc < 26 ) THEN
|
|
|
|
CALL dv_drho_vdwdf(rho, drho, nspin_mag, xq, dvnonloc)
|
|
|
|
ELSEIF ( inlc == 26) THEN
|
|
|
|
CALL dv_drho_rvv10(rho, drho, nspin_mag, xq, dvnonloc)
|
|
|
|
ENDIF
|
2016-04-11 23:40:37 +08:00
|
|
|
|
|
|
|
dvaux = dvaux + dvnonloc
|
2020-05-22 00:49:41 +08:00
|
|
|
|
|
|
|
DEALLOCATE( dvnonloc )
|
2016-04-11 23:40:37 +08:00
|
|
|
|
2020-05-22 00:49:41 +08:00
|
|
|
END SUBROUTINE dnonloccorr
|