Commit 38e798ee authored by giannozz's avatar giannozz

h_psiq hack: I think it is preferrable to give to igkq the correct value

in the external loop over k-points, rather than passing it as an argument.
Just two lines in TD-DFPT needed. Routine commutator_Hx_psi, used only by
linear-response code, moved to PHonon: no reason to have it in PW


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/[email protected] c92efa57-630b-4861-b058-cf58834340f0
parent af20c5cc
......@@ -19,7 +19,6 @@ subroutine ch_psi_all2 (n, h, ah, e, ik, m)
use phcom
USE mp_global, ONLY: intra_pool_comm
USE mp, ONLY: mp_sum
USE qpoint, ONLY : igkq
implicit none
integer :: n, m, ik
......@@ -58,7 +57,7 @@ subroutine ch_psi_all2 (n, h, ah, e, ik, m)
!
! compute the product of the hamiltonian with the h vector
!
call h_psiq (npwx, n, m, h, hpsi, spsi, igkq)
call h_psiq (npwx, n, m, h, hpsi, spsi)
call start_clock ('last')
!
......
# Makefile for PH
# Adapted from TDDFPT main Makefile
default: all
......
......@@ -40,6 +40,7 @@ check_restart_recover.o \
clean_pw_ph.o \
clinear.o \
close_phq.o \
commutator_Hx_psi.o \
compute_alphasum.o \
compute_becalp.o \
compute_becsum_ph.o \
......
......@@ -22,7 +22,7 @@ subroutine cch_psi_all (n, h, ah, e, ik, m)
USE control_ph, ONLY : alpha_pv, nbnd_occ
USE eqv, ONLY : evq
USE qpoint, ONLY : ikqs, igkq
USE qpoint, ONLY : ikqs
USE mp_global, ONLY: intra_pool_comm
USE mp, ONLY: mp_sum
......@@ -62,7 +62,7 @@ subroutine cch_psi_all (n, h, ah, e, ik, m)
!
! compute the product of the hamiltonian with the h vector
!
call h_psiq (npwx, n, m, h, hpsi, spsi, igkq)
call h_psiq (npwx, n, m, h, hpsi, spsi)
call start_clock ('last')
!
......
......@@ -25,7 +25,7 @@ SUBROUTINE ch_psi_all (n, h, ah, e, ik, m)
USE control_ph, ONLY : alpha_pv, nbnd_occ
USE eqv, ONLY : evq
USE qpoint, ONLY : ikqs, igkq
USE qpoint, ONLY : ikqs
USE mp_global, ONLY : intra_pool_comm
USE mp, ONLY : mp_sum
......@@ -70,7 +70,7 @@ SUBROUTINE ch_psi_all (n, h, ah, e, ik, m)
!
! compute the product of the hamiltonian with the h vector
!
CALL h_psiq (npwx, n, m, h, hpsi, spsi, igkq)
CALL h_psiq (npwx, n, m, h, hpsi, spsi)
CALL start_clock ('last')
!
......
......@@ -7,7 +7,7 @@
!
!
!-----------------------------------------------------------------------
SUBROUTINE h_psiq (lda, n, m, psi, hpsi, spsi, igkq)
SUBROUTINE h_psiq (lda, n, m, psi, hpsi, spsi)
!-----------------------------------------------------------------------
!
! This routine computes the product of the Hamiltonian
......@@ -32,9 +32,8 @@ SUBROUTINE h_psiq (lda, n, m, psi, hpsi, spsi, igkq)
USE scf, ONLY : vrs
USE uspp, ONLY : vkb
USE wvfct, ONLY : g2kin, npwx
!Needed only for TDDFPT
USE control_flags, ONLY : gamma_only, tddfpt
USE qpoint, ONLY: igkq
USE control_flags, ONLY : gamma_only ! Needed only for TDDFPT
IMPLICIT NONE
......@@ -42,8 +41,6 @@ SUBROUTINE h_psiq (lda, n, m, psi, hpsi, spsi, igkq)
! input: the leading dimension of the array psi
! input: the real dimension of psi
! input: the number of psi to compute
INTEGER,INTENT(IN) :: igkq(npwx)
! input: map of wavefunctions of hpsi (e.g. at k+q in phonon)
COMPLEX(DP), INTENT(INOUT) :: psi (lda*npol, m)
COMPLEX(DP), INTENT(OUT) :: hpsi (lda*npol, m), spsi (lda*npol, m)
! input: the functions where to apply H and S
......
......@@ -231,6 +231,17 @@ close_phq.o : elph.o
close_phq.o : phcom.o
close_phq.o : ramanm.o
close_phq.o : write_rec.o
commutator_Hx_psi.o : ../../Modules/cell_base.o
commutator_Hx_psi.o : ../../Modules/control_flags.o
commutator_Hx_psi.o : ../../Modules/io_global.o
commutator_Hx_psi.o : ../../Modules/ions_base.o
commutator_Hx_psi.o : ../../Modules/kind.o
commutator_Hx_psi.o : ../../Modules/recvec.o
commutator_Hx_psi.o : ../../Modules/uspp.o
commutator_Hx_psi.o : ../../Modules/wavefunctions.o
commutator_Hx_psi.o : ../../PW/src/becmod.o
commutator_Hx_psi.o : ../../PW/src/noncol.o
commutator_Hx_psi.o : ../../PW/src/pwcom.o
compute_alphasum.o : ../../Modules/ions_base.o
compute_alphasum.o : ../../Modules/kind.o
compute_alphasum.o : ../../Modules/paw_variables.o
......@@ -678,6 +689,7 @@ h_psiq.o : ../../PW/src/noncol.o
h_psiq.o : ../../PW/src/pwcom.o
h_psiq.o : ../../PW/src/realus.o
h_psiq.o : ../../PW/src/scf_mod.o
h_psiq.o : phcom.o
hdiag.o : ../../Modules/cell_base.o
hdiag.o : ../../Modules/kind.o
hdiag.o : ../../Modules/recvec.o
......@@ -1068,6 +1080,8 @@ q_points.o : phcom.o
q_points_wannier.o : ../../Modules/io_global.o
q_points_wannier.o : ../../Modules/kind.o
q_points_wannier.o : ../../Modules/mp_global.o
q_points_wannier.o : dfile_autoname.o
q_points_wannier.o : dfile_star.o
q_points_wannier.o : elph.o
q_points_wannier.o : phcom.o
qdipol_cryst.o : ../../Modules/cell_base.o
......
# Makefile for PW
# Adapted from TDDFPT main Makefile
default: all
......
......@@ -41,7 +41,6 @@ cdiaghg.o \
cegterg.o \
clean_pw.o \
close_files.o \
commutator_Hx_psi.o \
compute_becsum.o \
compute_deff.o \
compute_dip.o \
......
......@@ -248,17 +248,6 @@ close_files.o : ../../Modules/wannier_new.o
close_files.o : bp_mod.o
close_files.o : buffers.o
close_files.o : pwcom.o
commutator_Hx_psi.o : ../../Modules/cell_base.o
commutator_Hx_psi.o : ../../Modules/control_flags.o
commutator_Hx_psi.o : ../../Modules/io_global.o
commutator_Hx_psi.o : ../../Modules/ions_base.o
commutator_Hx_psi.o : ../../Modules/kind.o
commutator_Hx_psi.o : ../../Modules/recvec.o
commutator_Hx_psi.o : ../../Modules/uspp.o
commutator_Hx_psi.o : ../../Modules/wavefunctions.o
commutator_Hx_psi.o : becmod.o
commutator_Hx_psi.o : noncol.o
commutator_Hx_psi.o : pwcom.o
compute_becsum.o : ../../Modules/cell_base.o
compute_becsum.o : ../../Modules/control_flags.o
compute_becsum.o : ../../Modules/io_files.o
......
......@@ -7,7 +7,6 @@
!
!----------------------------------------------------------------------
!
!
! Modified by Osman Baris Malcioglu (2009)
! Rebased wrt PHONON routines. S J Binnie (2011)
......@@ -38,6 +37,7 @@ SUBROUTINE lr_dvpsi_e(ik,ipol,dvpsi)
USE realus, ONLY : npw_k
USE lr_variables, ONLY : lr_verbosity
USE io_global, ONLY : stdout
USE qpoint, ONLY : igkq
!
!
IMPLICIT NONE
......@@ -107,7 +107,6 @@ SUBROUTINE lr_dvpsi_e(ik,ipol,dvpsi)
! d0psi contains P^+_c [H-eS,x] psi_v for the polarization direction ipol
! Now solve the linear systems (H-e_vS)*P_c(x*psi_v)=P_c^+ [H-e_vS,x]*psi_v
!
! eprec is now calculated on the fly for each k point
ALLOCATE(eprec(nbnd))
CALL lr_calc_eprec(eprec)
......@@ -127,6 +126,8 @@ SUBROUTINE lr_dvpsi_e(ik,ipol,dvpsi)
!
dvpsi(:,:) = (0.d0, 0.d0)
!
igkq => igk ! PG: needed by h_psiq, called by ch_psi_all
!
CALL cgsolve_all (ch_psi_all, cg_psi, et (1, ik), d0psi, dvpsi, &
h_diag, npwx, npw_k(ik), thresh, ik, lter, conv_root, anorm, &
nbnd_occ(ik), 1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment