Commit 707e5824 authored by timrov's avatar timrov

TDDFPT routines, which compute the response density, now use the original PH...

TDDFPT routines, which compute the response density, now use the original PH routines, which allows us to delete the duplicated parts of the code. Some documentation of the PH routines.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@12120 c92efa57-630b-4861-b058-cf58834340f0
parent 1f2cd6fa
......@@ -769,6 +769,7 @@ nlcc.o : pseudopot.o
nlcc.o : smallbox.o
nlcc.o : smallbox_gvec.o
nlcc.o : spline.o
ortho.o : ../../LAXlib/dspev_drv.o
ortho.o : ../../LAXlib/la_types.o
ortho.o : ../../Modules/control_flags.o
ortho.o : ../../Modules/electrons_base.o
......
......@@ -8,6 +8,10 @@ fft_parallel.o : scatter_mod.o
scatter_mod.o : fft_types.o
stick_set.o : fft_types.o
stick_set.o : stick_base.o
test.o : fft_parallel.o
test.o : fft_support.o
test.o : fft_types.o
test.o : stick_set.o
fft_scalar.o : fft_param.f90
fft_scalar.o : fft_param.f90
fft_scalar.o : fft_param.f90
......
dspev_drv.o : la_types.o
ptoolkit.o : dspev_drv.o
ptoolkit.o : la_types.o
ptoolkit.o : zhpev_drv.o
test.o : dspev_drv.o
test.o : la_types.o
dspev_drv.o : la_param.f90
ptoolkit.o : la_param.f90
test.o : la_param.f90
transto.o : la_param.f90
zhpev_drv.o : la_param.f90
!
! Copyright (C) 2001-2008 Quantum ESPRESSO group
! Copyright (C) 2001-2016 Quantum ESPRESSO group
! 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 addusdbec (ik, wgt, psi, dbecsum)
subroutine addusdbec (ik, wgt, dpsi, dbecsum)
!----------------------------------------------------------------------
!
! This routine adds to dbecsum the contribution of this
! k point. It implements Eq. B15 of PRB 64, 235118 (2001).
!
USE kinds, only : DP
USE ions_base, ONLY : nat, ityp, ntyp => nsp
USE becmod, ONLY : calbec
USE wvfct, only: npw, npwx, nbnd
USE uspp, only: nkb, vkb, okvan, ijtoh
USE uspp_param, only: upf, nh, nhm
USE kinds, ONLY : DP
USE ions_base, ONLY : nat, ityp, ntyp => nsp
USE becmod, ONLY : calbec
USE wvfct, ONLY : npw, npwx, nbnd
USE uspp, ONLY : nkb, vkb, okvan, ijtoh
USE uspp_param, ONLY : upf, nh, nhm
USE mp_bands, ONLY : intra_bgrp_comm
USE lrus, ONLY : becp1
USE qpoint, ONLY : npwq, ikks
USE lrus, ONLY : becp1
USE qpoint, ONLY : npwq, ikks
USE control_lr, ONLY : nbnd_occ
!
USE mp_bands, ONLY : intra_bgrp_comm
!
implicit none
IMPLICIT NONE
!
! the dummy variables
!
complex(DP) :: dbecsum (nhm*(nhm+1)/2, nat), psi(npwx,nbnd)
COMPLEX(DP) :: dbecsum (nhm*(nhm+1)/2, nat), dpsi(npwx,nbnd)
! inp/out: the sum kv of bec *
! input : contains delta psi
integer :: ik
INTEGER :: ik
! input: the k point
real(DP) :: wgt
REAL(DP) :: wgt
! input: the weight of this k point
!
! here the local variables
!
integer :: na, nt, ih, jh, ibnd, ikk, ikb, jkb, ijh, startb, &
INTEGER :: na, nt, ih, jh, ibnd, ikk, ikb, jkb, ijh, startb, &
lastb, ijkb0
! counter on atoms
! counter on atomic type
......@@ -54,25 +52,25 @@ subroutine addusdbec (ik, wgt, psi, dbecsum)
! divide among processors the sum
! auxiliary variable for counting
complex(DP), allocatable :: dbecq (:,:)
COMPLEX(DP), ALLOCATABLE :: dbecq (:,:)
! the change of becq
if (.not.okvan) return
call start_clock ('addusdbec')
allocate (dbecq( nkb, nbnd))
IF (.NOT.okvan) RETURN
!
CALL start_clock ('addusdbec')
!
ALLOCATE (dbecq( nkb, nbnd))
ikk = ikks(ik)
!
! First compute the product of psi and vkb
! First compute the product of dpsi and vkb
!
call calbec (npwq, vkb, psi, dbecq)
CALL calbec (npwq, vkb, dpsi, dbecq)
!
! And then we add the product to becsum
!
! Band parallelization: each processor takes care of its slice of bands
!
call divide (intra_bgrp_comm, nbnd_occ (ikk), startb, lastb)
CALL divide (intra_bgrp_comm, nbnd_occ (ikk), startb, lastb)
!
ijkb0 = 0
do nt = 1, ntyp
......@@ -110,8 +108,10 @@ subroutine addusdbec (ik, wgt, psi, dbecsum)
endif
enddo
!
deallocate (dbecq)
call stop_clock ('addusdbec')
return
DEALLOCATE (dbecq)
!
CALL stop_clock ('addusdbec')
!
RETURN
!
end subroutine addusdbec
!
! Copyright (C) 2007 Quantum ESPRESSO group
! Copyright (C) 2001-2016 Quantum ESPRESSO group
! 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 addusdbec_nc (ik, wgt, psi, dbecsum_nc)
subroutine addusdbec_nc (ik, wgt, dpsi, dbecsum_nc)
!----------------------------------------------------------------------
!
! This routine adds to the dbecsum the term which correspond to this
! k point. After the accumulation the additional part of the charge
! is computed in addusddens.
!
USE kinds, only : DP
USE lsda_mod, ONLY : nspin
USE ions_base, ONLY : nat, ityp, ntyp => nsp
USE becmod, ONLY : calbec
USE wvfct, only: npw, npwx, nbnd
USE uspp, only: nkb, vkb, okvan
USE kinds, ONLY : DP
USE lsda_mod, ONLY : nspin
USE ions_base, ONLY : nat, ityp, ntyp => nsp
USE becmod, ONLY : calbec
USE wvfct, ONLY : npw, npwx, nbnd
USE uspp, ONLY : nkb, vkb, okvan
USE noncollin_module, ONLY : noncolin, npol
USE uspp_param, only: upf, nh, nhm
USE uspp_param, ONLY : upf, nh, nhm
USE mp_bands, ONLY : intra_bgrp_comm
USE qpoint, ONLY : npwq, ikks
USE lrus, ONLY : becp1
USE control_lr, ONLY : nbnd_occ
!
USE mp_bands, ONLY : intra_bgrp_comm
USE lrus, ONLY : becp1
USE qpoint, ONLY : npwq, ikks
USE control_lr, ONLY : nbnd_occ
!
implicit none
IMPLICIT NONE
!
! the dummy variables
!
complex(DP) :: dbecsum_nc (nhm,nhm,nat,nspin), psi(npwx*npol,nbnd)
COMPLEX(DP) :: dbecsum_nc (nhm,nhm,nat,nspin), dpsi(npwx*npol,nbnd)
! inp/out: the sum kv of bec *
! input : contains delta psi
integer :: ik
INTEGER :: ik
! input: the k point
real(DP) :: wgt
REAL(DP) :: wgt
! input: the weight of this k point
!
! here the local variables
!
integer :: na, nt, ih, jh, ibnd, ikk, ikb, jkb, startb, &
INTEGER :: na, nt, ih, jh, ibnd, ikk, ikb, jkb, startb, &
lastb, ijkb0, is1, is2, ijs
! counter on atoms
! counter on atomic type
......@@ -57,24 +55,25 @@ subroutine addusdbec_nc (ik, wgt, psi, dbecsum_nc)
! divide among processors the sum
! auxiliary variable for counting
complex(DP), allocatable :: dbecq_nc(:,:,:)
COMPLEX(DP), ALLOCATABLE :: dbecq_nc(:,:,:)
! the change of becq
if (.not.okvan) return
call start_clock ('addusdbec_nc')
allocate (dbecq_nc( nkb,npol, nbnd))
IF (.NOT.okvan) RETURN
!
CALL start_clock ('addusdbec_nc')
!
ALLOCATE (dbecq_nc( nkb,npol, nbnd))
ikk = ikks(ik)
!
! First compute the product of psi and vkb
! First compute the product of dpsi and vkb
!
call calbec (npwq, vkb, psi, dbecq_nc)
CALL calbec (npwq, vkb, dpsi, dbecq_nc)
!
! And then we add the product to becsum
!
! Band parallelization: each processor takes care of its slice of bands
!
call divide (intra_bgrp_comm, nbnd_occ (ikk), startb, lastb)
CALL divide (intra_bgrp_comm, nbnd_occ (ikk), startb, lastb)
!
ijkb0 = 0
do nt = 1, ntyp
......@@ -108,8 +107,10 @@ subroutine addusdbec_nc (ik, wgt, psi, dbecsum_nc)
endif
enddo
!
deallocate (dbecq_nc)
call stop_clock ('addusdbec_nc')
return
DEALLOCATE (dbecq_nc)
!
CALL stop_clock ('addusdbec_nc')
!
RETURN
!
end subroutine addusdbec_nc
!
! Copyright (C) 2001-2008 Quantum ESPRESSO group
! Copyright (C) 2001-2016 Quantum ESPRESSO group
! 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,
......@@ -13,54 +13,55 @@ subroutine incdrhoscf (drhoscf, weight, ik, dbecsum, dpsi)
! perturbation. It is called at the end of the computation of the
! change of the wavefunction for a given k point.
!
!
USE kinds, only : DP
USE cell_base, ONLY : omega
USE ions_base, ONLY : nat
USE fft_base, ONLY: dffts
USE fft_interfaces, ONLY: invfft
USE gvecs, ONLY : nls
USE wvfct, ONLY : npw, igk, npwx, nbnd
USE uspp_param,ONLY: nhm
USE wavefunctions_module, ONLY: evc
USE qpoint, ONLY : npwq, igkq, ikks
USE control_lr, ONLY : nbnd_occ
USE mp_bands, ONLY : me_bgrp, inter_bgrp_comm, ntask_groups
USE mp, ONLY : mp_sum
USE kinds, ONLY : DP
USE cell_base, ONLY : omega
USE ions_base, ONLY : nat
USE fft_base, ONLY: dffts
USE fft_interfaces, ONLY: invfft
USE gvecs, ONLY : nls
USE wvfct, ONLY : npw, igk, npwx, nbnd
USE uspp_param, ONLY: nhm
USE wavefunctions_module, ONLY: evc
USE qpoint, ONLY : npwq, igkq, ikks
USE control_lr, ONLY : nbnd_occ
USE mp_bands, ONLY : me_bgrp, inter_bgrp_comm, ntask_groups
USE mp, ONLY : mp_sum
implicit none
IMPLICIT NONE
!
! I/O variables
integer, INTENT (IN) :: ik
INTEGER, INTENT (IN) :: ik
! input: the k point
real(DP), INTENT (IN) :: weight
REAL(DP), INTENT (IN) :: weight
! input: the weight of the k point
complex(DP), INTENT (IN) :: dpsi (npwx,nbnd)
COMPLEX(DP), INTENT (IN) :: dpsi (npwx,nbnd)
! input: the perturbed wfc for the given k point
complex(DP), INTENT (INOUT) :: drhoscf (dffts%nnr), dbecsum (nhm*(nhm+1)/2,nat)
COMPLEX(DP), INTENT (INOUT) :: drhoscf (dffts%nnr), dbecsum (nhm*(nhm+1)/2,nat)
! input/output: the accumulated change to the charge density and dbecsum
!
! here the local variables
!
! here the local variable
!
real(DP) :: wgt
REAL(DP) :: wgt
! the effective weight of the k point
complex(DP), allocatable :: psi (:), dpsic (:)
COMPLEX(DP), ALLOCATABLE :: psi (:), dpsic (:)
! the wavefunctions in real space
! the change of wavefunctions in real space
complex(DP), allocatable :: tg_psi(:), tg_dpsi(:), tg_drho(:)
COMPLEX(DP), ALLOCATABLE :: tg_psi(:), tg_dpsi(:), tg_drho(:)
integer :: ibnd, ikk, ir, ig, incr, v_siz, idx, ioff
INTEGER :: ibnd, ikk, ir, ig, incr, v_siz, idx, ioff
! counters
call start_clock ('incdrhoscf')
CALL start_clock ('incdrhoscf')
!
IF (ntask_groups > 1) dffts%have_task_groups=.TRUE.
allocate (dpsic( dffts%nnr))
allocate (psi ( dffts%nnr))
!
ALLOCATE(dpsic(dffts%nnr))
ALLOCATE(psi(dffts%nnr))
!
wgt = 2.d0 * weight / omega
ikk = ikks(ik)
incr=1
incr = 1
!
IF (dffts%have_task_groups) THEN
!
......@@ -70,7 +71,7 @@ subroutine incdrhoscf (drhoscf, weight, ik, dbecsum, dpsi)
ALLOCATE( tg_dpsi( v_siz ) )
ALLOCATE( tg_drho( v_siz ) )
!
incr = dffts%nogrp
incr = dffts%nogrp
!
ENDIF
!
......@@ -131,38 +132,54 @@ subroutine incdrhoscf (drhoscf, weight, ik, dbecsum, dpsi)
DO ir = 1, dffts%nnr
drhoscf(ir) = drhoscf(ir) + tg_drho(ir+ioff)
END DO
!
ELSE
!
! Normal case: no task groups
!
! FFT to R-space of the unperturbed wfct's evc
!
psi (:) = (0.d0, 0.d0)
do ig = 1, npw
psi (nls (igk (ig) ) ) = evc (ig, ibnd)
enddo
CALL invfft ('Wave', psi, dffts)
!
! FFT to R-space of the perturbed wfct's dpsi
!
dpsic(:) = (0.d0, 0.d0)
do ig = 1, npwq
dpsic (nls (igkq (ig) ) ) = dpsi (ig, ibnd)
enddo
CALL invfft ('Wave', dpsic, dffts)
!
! Calculation of the response charge-density
!
do ir = 1, dffts%nnr
drhoscf (ir) = drhoscf (ir) + wgt * CONJG(psi (ir) ) * dpsic (ir)
enddo
!
ENDIF
enddo
call addusdbec (ik, weight, dpsi, dbecsum)
deallocate (psi)
deallocate (dpsic)
!
enddo ! loop on bands
!
! Ultrasoft contribution
! Calculate dbecsum = <evc|vkb><vkb|dpsi>
!
CALL addusdbec (ik, weight, dpsi, dbecsum)
!
DEALLOCATE(psi)
DEALLOCATE(dpsic)
!
IF (dffts%have_task_groups) THEN
DEALLOCATE(tg_psi)
DEALLOCATE(tg_dpsi)
DEALLOCATE(tg_drho)
ENDIF
dffts%have_task_groups=.FALSE.
call stop_clock ('incdrhoscf')
return
!
CALL stop_clock ('incdrhoscf')
!
RETURN
!
end subroutine incdrhoscf
!
! Copyright (C) 2001-2009 Quantum ESPRESSO group
! Copyright (C) 2001-2016 Quantum ESPRESSO group
! 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,
......@@ -13,26 +13,25 @@ subroutine incdrhoscf_nc (drhoscf, weight, ik, dbecsum, dpsi)
! perturbation. It is called at the end of the computation of the
! change of the wavefunction for a given k point.
!
!
USE kinds, only : DP
USE ions_base, ONLY : nat
USE cell_base, ONLY : omega
USE fft_base, ONLY : dffts, dfftp
USE fft_interfaces, ONLY: invfft
USE gvecs, ONLY : nls
USE lsda_mod, ONLY : nspin
USE spin_orb, ONLY : domag
USE noncollin_module, ONLY : npol, nspin_mag
USE uspp_param,ONLY : nhm
USE wvfct, ONLY : npw, npwx, igk, nbnd
USE wavefunctions_module, ONLY: evc
USE qpoint, ONLY : npwq, igkq, ikks
USE control_lr, ONLY : nbnd_occ
USE mp_bands, ONLY : me_bgrp, inter_bgrp_comm, ntask_groups
USE mp, ONLY : mp_sum
implicit none
USE kinds, ONLY : DP
USE ions_base, ONLY : nat
USE cell_base, ONLY : omega
USE fft_base, ONLY : dffts, dfftp
USE fft_interfaces, ONLY : invfft
USE gvecs, ONLY : nls
USE lsda_mod, ONLY : nspin
USE spin_orb, ONLY : domag
USE noncollin_module, ONLY : npol, nspin_mag
USE uspp_param, ONLY : nhm
USE wvfct, ONLY : npw, npwx, igk, nbnd
USE wavefunctions_module, ONLY : evc
USE qpoint, ONLY : npwq, igkq, ikks
USE control_lr, ONLY : nbnd_occ
USE mp_bands, ONLY : me_bgrp, inter_bgrp_comm, ntask_groups
USE mp, ONLY : mp_sum
IMPLICIT NONE
!
! I/O variables
INTEGER, INTENT(IN) :: ik
! input: the k point
......@@ -43,26 +42,27 @@ subroutine incdrhoscf_nc (drhoscf, weight, ik, dbecsum, dpsi)
COMPLEX(DP), INTENT(INOUT) :: drhoscf (dfftp%nnr,nspin_mag), dbecsum (nhm,nhm,nat,nspin)
! input/output: the accumulated change of the charge density and dbecsum
!
!
! here the local variable
!
real(DP) :: wgt
REAL(DP) :: wgt
! the effective weight of the k point
complex(DP), allocatable :: psi (:,:), dpsic (:,:)
!
COMPLEX(DP), ALLOCATABLE :: psi (:,:), dpsic (:,:)
! the wavefunctions in real space
! the change of wavefunctions in real space
complex(DP), allocatable :: tg_psi (:,:), tg_dpsi (:,:), tg_drho(:,:)
integer :: ibnd, jbnd, ikk, ir, ig, incr, v_siz, idx, ioff, ipol
!
COMPLEX(DP), ALLOCATABLE :: tg_psi (:,:), tg_dpsi (:,:), tg_drho(:,:)
!
INTEGER :: ibnd, jbnd, ikk, ir, ig, incr, v_siz, idx, ioff, ipol
! counters
call start_clock ('incdrhoscf')
!
CALL start_clock ('incdrhoscf')
!
IF (ntask_groups > 1 ) dffts%have_task_groups=.TRUE.
allocate (dpsic(dffts%nnr, npol))
allocate (psi (dffts%nnr, npol))
!
ALLOCATE (dpsic(dffts%nnr, npol))
ALLOCATE (psi (dffts%nnr, npol))
!
wgt = 2.d0 * weight / omega
ikk = ikks(ik)
incr = 1
......@@ -154,7 +154,13 @@ subroutine incdrhoscf_nc (drhoscf, weight, ik, dbecsum, dpsi)
drhoscf(ir,ipol) = drhoscf(ir,ipol) + tg_drho(ir+ioff,ipol)
END DO
END DO
!
ELSE
!
! Normal case: no task groups
!
! FFT to R-space of the unperturbed wfct's evc
!
psi = (0.d0, 0.d0)
do ig = 1, npw
psi (nls (igk (ig) ), 1) = evc (ig, ibnd)
......@@ -162,15 +168,19 @@ subroutine incdrhoscf_nc (drhoscf, weight, ik, dbecsum, dpsi)
enddo
CALL invfft ('Wave', psi(:,1), dffts)
CALL invfft ('Wave', psi(:,2), dffts)
!
! FFT to R-space of the perturbed wfct's dpsi
!
dpsic = (0.d0, 0.d0)
do ig = 1, npwq
dpsic (nls (igkq (ig)), 1 ) = dpsi (ig, ibnd)
dpsic (nls (igkq (ig)), 2 ) = dpsi (ig+npwx, ibnd)
enddo
CALL invfft ('Wave', dpsic(:,1), dffts)
CALL invfft ('Wave', dpsic(:,2), dffts)
!
! Calculation of the response charge density
!
do ir = 1, dffts%nnr
drhoscf(ir,1)=drhoscf(ir,1)+wgt*(CONJG(psi(ir,1))*dpsic(ir,1) + &
CONJG(psi(ir,2))*dpsic(ir,2) )
......@@ -186,20 +196,28 @@ subroutine incdrhoscf_nc (drhoscf, weight, ik, dbecsum, dpsi)
CONJG(psi(ir,2))*dpsic(ir,2) )
enddo
END IF
!
END IF
!
enddo
call addusdbec_nc (ik, weight, dpsi, dbecsum)
deallocate (psi)
deallocate (dpsic)
!
! Ultrasoft contribution
! Calculate dbecsum_nc = <evc|vkb><vkb|dpsi>
!
CALL addusdbec_nc (ik, weight, dpsi, dbecsum)
!
DEALLOCATE(psi)
DEALLOCATE(dpsic)
!
IF (dffts%have_task_groups) THEN
DEALLOCATE( tg_psi )
DEALLOCATE( tg_dpsi )
DEALLOCATE( tg_drho )
DEALLOCATE(tg_psi)
DEALLOCATE(tg_dpsi)
DEALLOCATE(tg_drho)
END IF
dffts%have_task_groups=.FALSE.
call stop_clock ('incdrhoscf')
return
!
CALL stop_clock ('incdrhoscf')
!
RETURN
!
end subroutine incdrhoscf_nc
......@@ -456,6 +456,7 @@ projwfc.o : ../../Modules/ions_base.o
projwfc.o : ../../Modules/kind.o
projwfc.o : ../../Modules/mp.o
projwfc.o : ../../Modules/mp_global.o
projwfc.o : ../../Modules/mp_pools.o
projwfc.o : ../../Modules/mp_world.o
projwfc.o : ../../Modules/noncol.o
projwfc.o : ../../Modules/paw_variables.o
......
......@@ -146,7 +146,6 @@ bp_c_phase.o : ../../Modules/becmod.o
bp_c_phase.o : ../../Modules/cell_base.o
bp_c_phase.o : ../../Modules/constants.o
bp_c_phase.o : ../../Modules/fft_base.o
bp_c_phase.o : ../../Modules/gvecw.o
bp_c_phase.o : ../../Modules/io_files.o
bp_c_phase.o : ../../Modules/io_global.o
bp_c_phase.o : ../../Modules/ions_base.o
......@@ -204,7 +203,6 @@ c_phase_field.o : ../../Modules/becmod.o
c_phase_field.o : ../../Modules/cell_base.o
c_phase_field.o : ../../Modules/constants.o
c_phase_field.o : ../../Modules/fft_base.o
c_phase_field.o : ../../Modules/gvecw.o
c_phase_field.o : ../../Modules/io_files.o
c_phase_field.o : ../../Modules/io_global.o
c_phase_field.o : ../../Modules/ions_base.o
......@@ -594,7 +592,6 @@ forces_bp_efield.o : ../../Modules/cell_base.o
forces_bp_efield.o : ../../Modules/clocks.o
forces_bp_efield.o : ../../Modules/constants.o
forces_bp_efield.o : ../../Modules/fft_base.o
forces_bp_efield.o : ../../Modules/gvecw.o
forces_bp_efield.o : ../../Modules/io_files.o
forces_bp_efield.o : ../../Modules/io_global.o
forces_bp_efield.o : ../../Modules/ions_base.o
......@@ -712,7 +709,6 @@ h_epsi_her_set.o : ../../Modules/becmod.o
h_epsi_her_set.o : ../../Modules/cell_base.o
h_epsi_her_set.o : ../../Modules/constants.o
h_epsi_her_set.o : ../../Modules/fft_base.o
h_epsi_her_set.o : ../../Modules/gvecw.o
h_epsi_her_set.o : ../../Modules/io_files.o
h_epsi_her_set.o : ../../Modules/ions_base.o
h_epsi_her_set.o : ../../Modules/kind.o
......@@ -1101,7 +1097,6 @@ orbm_kubo.o : ../../Modules/becmod.o
orbm_kubo.o : ../../Modules/cell_base.o
orbm_kubo.o : ../../Modules/constants.o
orbm_kubo.o : ../../Modules/fft_base.o
orbm_kubo.o : ../../Modules/gvecw.o
orbm_kubo.o : ../../Modules/io_files.o
orbm_kubo.o : ../../Modules/io_global.o
orbm_kubo.o : ../../Modules/kind.o
......
......@@ -7,7 +7,7 @@
#RUNNER = openmpi-1.4.3/bin/mpirun -np 8
#PWSCF = "../../../bin/pw.x" -ndiag 4
RUNNER =
RUNNER = mpirun -np 8
PWSCF = "../../../bin/pw.x"
TDDFPT_LANCZOS = "../../../bin/turbo_lanczos.x"
TDDFPT_DAVIDSON = "../../../bin/turbo_davidson.x"
......
!
! Copyright (C) 2001-2015 Quantum ESPRESSO group
! Copyright (C) 2001-2016 Quantum ESPRESSO group
! 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,
......@@ -12,7 +12,6 @@ SUBROUTINE lr_calc_dens_eels (drhoscf, dpsi)
! Calculates response charge-density from linear-response
! orbitals and ground-state orbitals.
! See Eq.(36) in B. Walker and R. Gebauer, J. Chem. Phys. 127, 164106 (2007)
! Inspired by PH/incdrhoscf.f90 and PH/solve_linter.f90
!
! It does:
! 1) Calculates the response charge-density
......@@ -20,32 +19,22 @@ SUBROUTINE lr_calc_dens_eels (drhoscf, dpsi)
! 3) Sums up the normal and ultrasoft terms
! 4) Symmetrizes the total response charge-density
!
! TODO: Make a call to the routine PH/incdrhoscf.f90 and remove
! all the duplicated stuff here.
!
! Written by Iurii Timrov (2013)
!
USE kinds, ONLY : DP
USE io_global, ONLY : stdout
USE cell_base, ONLY : omega
USE ions_base, ONLY : nat
USE gvecs, ONLY : nls
USE gvect, ONLY : ngm, g
USE fft_base, ONLY : dfftp, dffts
USE fft_interfaces, ONLY : invfft
USE klist, ONLY : xk, wk
USE lr_variables, ONLY : evc0, lr_periodic
USE wvfct, ONLY : nbnd,wg,npwx,npw,igk,g2kin
USE wvfct, ONLY : nbnd, npwx, npw, igk, g2kin
USE gvecw, ONLY : gcutw
USE qpoint, ONLY : npwq, igkq, nksq, ikks, ikqs
USE control_lr, ONLY : nbnd_occ
USE units_ph, ONLY : lrwfc, iuwfc
USE wavefunctions_module, ONLY : evc
USE eqv, ONLY : evq
USE uspp_param, ONLY : nhm
USE uspp, ONLY : okvan, vkb
USE mp_global, ONLY : inter_pool_comm, intra_bgrp_comm
USE mp_bands, ONLY : me_bgrp, ntask_groups
USE mp, ONLY : mp_sum
!
IMPLICIT NONE
......@@ -54,53 +43,24 @@ SUBROUTINE lr_calc_dens_eels (drhoscf, dpsi)