minor fixes on rho signs

This commit is contained in:
fabrizio22 2019-06-17 16:23:21 +02:00
parent 532e42282b
commit 5a51ead3db
2 changed files with 5 additions and 7 deletions

View File

@ -477,7 +477,7 @@ subroutine exch_corr_cp(nnr,nspin,grhor,rhor,etxc)
v(k,1) = v(k,1) + e2 * (v1x(k,1) + v1c(k,1))
! HERE h contains D(rho*Exc)/D(|grad rho|) / |grad rho|
h(k, 1, 1) = e2 * (v2x(k,1) + v2c(k,1))
etxc = etxc + e2 * (sx(k) + sc(k)) * SIGN( 1.d0, rhor(k,1) )
etxc = etxc + e2 * (sx(k) + sc(k))
enddo
!
else

View File

@ -90,7 +90,7 @@ subroutine vxcgc( ndm, mesh, nspin, r, r2, rho, rhoc, vgc, egc, &
integer :: i, is, ierr
real(DP) :: sx, sc, v2c, v1x, v2x, v1c
!
REAL(DP) :: grho_v(3,mesh,nspin), sign_v(mesh)
REAL(DP) :: grho_v(3,mesh,nspin)
REAL(DP), ALLOCATABLE, DIMENSION(:) :: sx_v, sc_v, v2c_ud
REAL(DP), ALLOCATABLE, DIMENSION(:,:) :: v1x_v, v2x_v, v1c_v, v2c_v
!
@ -172,13 +172,11 @@ subroutine vxcgc( ndm, mesh, nspin, r, r2, rho, rhoc, vgc, egc, &
!
! GGA case
!
sign_v = SIGN( 1.0_DP, rhoaux(:,1) )
!
CALL xc_gcx( mesh, nspin, rhoaux, grho_v, sx_v, sc_v, v1x_v, v2x_v, v1c_v, v2c_v )
!
egc(1:mesh) = ( sx_v + sc_v ) * sign_v
vgc(:,1) = ( v1x_v(:,1) + v1c_v(:,1) ) !* ABS(sign_v)
h(:,1) = ( v2x_v(:,1) + v2c_v(:,1) ) * grho(:,1)*r2(:) !*ABS(sign_v(:))
egc(1:mesh) = sx_v + sc_v
vgc(:,1) = v1x_v(:,1) + v1c_v(:,1)
h(:,1) = ( v2x_v(:,1) + v2c_v(:,1) ) * grho(:,1)*r2(:)
!
END IF
!