small temporary commit on an environ related part

git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@9256 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
oliviero 2012-08-06 08:00:52 +00:00
parent 5e78329f5e
commit bbbcab0790
2 changed files with 17 additions and 12 deletions

View File

@ -45,17 +45,11 @@ SUBROUTINE compute_dipole( nnr, nspin, rho, r0, dipole, quadrupole )
dipole(:) = 0.D0
quadrupole = 0.D0
!
index0 = 0
!
#if defined (__MPI)
DO i = 1, me_bgrp
index0 = index0 + dfftp%nr1x*dfftp%nr2x*dfftp%npp(i)
END DO
#endif
!
#if defined (__MPI)
index0 = dfftp%nr1x*dfftp%nr2x*SUM(dfftp%npp(1:me_bgrp))
ir_end = MIN(nnr,dfftp%nr1x*dfftp%nr2x*dfftp%npp(me_bgrp+1))
#else
index0 = 0
ir_end = nnr
#endif
!

View File

@ -18,7 +18,7 @@ SUBROUTINE makov_payne( etot )
USE kinds, ONLY : DP
USE io_global, ONLY : stdout
USE ions_base, ONLY : nat, tau, ityp, zv
USE cell_base, ONLY : at, bg
USE cell_base, ONLY : at, bg, alat
USE fft_base, ONLY : dfftp
USE scf, ONLY : rho
USE lsda_mod, ONLY : nspin
@ -30,8 +30,8 @@ SUBROUTINE makov_payne( etot )
!
REAL(DP), INTENT(IN) :: etot
!
INTEGER :: ia
REAL(DP) :: x0(3), zvtot, qq
INTEGER :: ia, ip
REAL(DP) :: x0(3), zvtot, qq, quad
REAL(DP) :: e_dipole(0:3), e_quadrupole
!
! ... x0 is the center of charge of the system
@ -49,10 +49,21 @@ SUBROUTINE makov_payne( etot )
!
x0(:) = x0(:) / zvtot
!
quad = 0.D0
!
DO ia = 1, nat
!
DO ip = 1, 3
!
quad = quad + zv(ityp(ia))*( ( tau(ip,ia) - x0(ip) )*alat )**2
!
END DO
END DO
!
CALL compute_dipole( dfftp%nnr, nspin, rho%of_r, x0, e_dipole, e_quadrupole )
!
#ifdef __ENVIRON
IF ( do_environ ) CALL environ_makov_payne( dfftp%nnr, nspin, rho%of_r, x0 )
IF ( do_environ ) CALL environ_makov_payne( dfftp%nnr, nspin, rho%of_r, zvtot, quad, x0 )
#endif
!
CALL write_dipole( etot, x0, e_dipole, e_quadrupole, qq )