mirror of https://gitlab.com/QEF/q-e.git
Bug fix: plot_num=12 was not working.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@1772 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
parent
79f461531a
commit
44fa24b7a5
|
@ -53,7 +53,7 @@ SUBROUTINE punch_plot (filplot, plot_num, sample_bias, z, dz, &
|
|||
CHARACTER(len=*) :: filplot
|
||||
INTEGER :: kpoint, kband, spin_component, plot_num
|
||||
LOGICAL :: stm_wfc_matching, lsign
|
||||
REAL(kind=DP) :: sample_bias, z, dz
|
||||
REAL(kind=DP) :: sample_bias, z, dz, dummy
|
||||
REAL(kind=DP) :: emin, emax, wf, charge
|
||||
|
||||
INTEGER :: is, ik, ibnd, ir, ninter, nspin_eff
|
||||
|
@ -202,11 +202,11 @@ SUBROUTINE punch_plot (filplot, plot_num, sample_bias, z, dz, &
|
|||
if (noncolin) nspin_eff=1
|
||||
CALL v_h (rho(1,1), nr1, nr2, nr3, nrx1, nrx2, nrx3, nrxx, &
|
||||
nl, ngm, gg, gstart, nspin_eff, alat, omega, ehart, charge, raux)
|
||||
IF (tefield.AND.dipfield) CALL add_efield(raux)
|
||||
IF (tefield.AND.dipfield) CALL add_efield(rho,raux,dummy,1)
|
||||
ELSEIF (plot_num == 12) THEN
|
||||
raux=0.d0
|
||||
IF (tefield) THEN
|
||||
CALL add_efield(raux)
|
||||
CALL add_efield(rho,raux,dummy,1)
|
||||
ELSE
|
||||
CALL errore('punch_plot','e_field is not calculated',-1)
|
||||
ENDIF
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#include "f_defs.h"
|
||||
!
|
||||
!--------------------------------------------------------------------------
|
||||
SUBROUTINE add_efield(rho,vpoten,etotefield)
|
||||
SUBROUTINE add_efield(rho,vpoten,etotefield,iflag)
|
||||
!--------------------------------------------------------------------------
|
||||
!
|
||||
! This routine adds an electric field to the local potential. The
|
||||
|
@ -60,6 +60,8 @@ SUBROUTINE add_efield(rho,vpoten,etotefield)
|
|||
REAL(KIND=DP) :: rho(nrxx,nspin) ! the density whose dipole is computed
|
||||
REAL(KIND=DP) :: vpoten(nrxx) ! the ef is added to this potential
|
||||
REAL(KIND=DP) :: etotefield ! the contribution to etot due to ef
|
||||
|
||||
INTEGER :: iflag
|
||||
!
|
||||
! local variables
|
||||
!
|
||||
|
@ -78,7 +80,7 @@ SUBROUTINE add_efield(rho,vpoten,etotefield)
|
|||
|
||||
|
||||
IF (.NOT.tefield) RETURN
|
||||
IF ((.NOT.dipfield).AND. (.NOT.first)) RETURN
|
||||
IF ((.NOT.dipfield).AND. (.NOT.first).and. (iflag.EQ.0)) RETURN
|
||||
|
||||
bmod=SQRT(bg(1,edir)**2+bg(2,edir)**2+bg(3,edir)**2)
|
||||
IF(edir.EQ.1) THEN
|
||||
|
|
|
@ -57,7 +57,7 @@ subroutine setlocal
|
|||
!
|
||||
|
||||
if (tefield.and.(.not.dipfield)) then
|
||||
call add_efield(rho,vltot,etotefield)
|
||||
call add_efield(rho,vltot,etotefield,0)
|
||||
! NB rho is not actually used by add_efield in this case ...
|
||||
! it should be fixed and removed from this routine
|
||||
endif
|
||||
|
|
|
@ -71,7 +71,7 @@ subroutine v_of_rho (rho, rho_core, nr1, nr2, nr3, nrx1, nrx2, &
|
|||
! add an electric field
|
||||
!
|
||||
do is=1,nspin
|
||||
call add_efield(rho,v(1,is),etotefield)
|
||||
call add_efield(rho,v(1,is),etotefield,0)
|
||||
enddo
|
||||
call stop_clock ('v_of_rho')
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue