From 370e7a498d2824945b341a61c506bb72250ad02b Mon Sep 17 00:00:00 2001 From: calandra Date: Wed, 18 Jul 2012 16:42:54 +0000 Subject: [PATCH] Some more comments added. MCB git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@9192 c92efa57-630b-4861-b058-cf58834340f0 --- PHonon/PH/ep_matrix_element_wannier.f90 | 30 ++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/PHonon/PH/ep_matrix_element_wannier.f90 b/PHonon/PH/ep_matrix_element_wannier.f90 index 3da045b9c..184450475 100644 --- a/PHonon/PH/ep_matrix_element_wannier.f90 +++ b/PHonon/PH/ep_matrix_element_wannier.f90 @@ -394,8 +394,8 @@ SUBROUTINE elphel_refolded (npe, imode0, dvscfins) ! We read here the wfc at the Gamma point, that is ! that saved by Wannier. - CALL davcio (evc, lrwfc, iunwfcwann, ik, - 1) - CALL davcio (evq, lrwfc, iunwfcwann, ikqg, - 1) +! CALL davcio (evc, lrwfc, iunwfcwann, ik, - 1) +! CALL davcio (evq, lrwfc, iunwfcwann, ikqg, - 1) @@ -410,8 +410,7 @@ SUBROUTINE elphel_refolded (npe, imode0, dvscfins) ! - - call calculate_and_apply_phase(ik, ikqg, igqg, npwq_refolded, g_kpq,xk_gamma, evq) + call calculate_and_apply_phase(ik, ikqg, igqg, npwq_refolded, g_kpq,xk_gamma, evq, .true.) DO ipert = 1, npe @@ -478,6 +477,14 @@ subroutine get_equivalent_kpq(xk,xq,kpq,g_kpq, igqg) ! ! ! Set up the k+q shell for electron-phonon coupling ! ! ! + ! This routine finds the G vectors such that ! + ! k+q+G=k' with k and k' belonging to nksq ! + ! for each k, the G vector is stored in g_kpq ! + ! k'=kpq(ik) ! + ! and finally igqg(ik) is the index that allows to find ! + ! the g vector g_kpq in the list of all the G vectors ! + ! ! + ! Matteo Calandra ! !=================================================================== USE kinds, ONLY : DP USE io_global, ONLY : stdout @@ -581,7 +588,7 @@ subroutine get_equivalent_kpq(xk,xq,kpq,g_kpq, igqg) end subroutine get_equivalent_kpq -subroutine calculate_and_apply_phase(ik, ikqg, igqg, npwq_refolded, g_kpq, xk_gamma, evq) +subroutine calculate_and_apply_phase(ik, ikqg, igqg, npwq_refolded, g_kpq, xk_gamma, evq, lread) USE kinds, ONLY : DP USE fft_base, ONLY : dffts USE fft_interfaces, ONLY : fwfft, invfft @@ -590,11 +597,14 @@ subroutine calculate_and_apply_phase(ik, ikqg, igqg, npwq_refolded, g_kpq, xk_ga USE gvecs, ONLY : nls USE cell_base, ONLY : bg, tpiba2 USE qpoint, ONLY : nksq, npwq + USE wavefunctions_module, ONLY : evc ! USE eqv, ONLY : evq USE noncollin_module, ONLY : npol + USE el_phon, ONLY:iunwfcwann, lrwfcr IMPLICIT NONE + LOGICAL :: lread INTEGER :: ik, ikqg, npwq_refolded INTEGER :: igqg(nksq) INTEGER :: g_kpq(3,nksq) @@ -624,8 +634,18 @@ subroutine calculate_and_apply_phase(ik, ikqg, igqg, npwq_refolded, g_kpq, xk_ga igkq_=0 + if(lread) then + call gk_sort (xk_gamma(1,ik), ngm, g_scra, ecutwfc / tpiba2, npw_, igk_, g2kin) + call read_wfc_rspace_and_fwfft( evc , ik , lrwfcr , iunwfcwann , npw_ , igk_ ) + endif + + call gk_sort (xk_gamma(1,ikqg), ngm, g_scra, ecutwfc / tpiba2, npw_, igk_, g2kin) + if(lread) then + call read_wfc_rspace_and_fwfft( evq , ikqg , lrwfcr , iunwfcwann , npw_ , igk_ ) + endif + call gk_sort (xkqg, ngm, g_scra, ecutwfc / tpiba2, npwq_refolded, igkq_, g2kin) phase(:) = CMPLX(0.d0,0.d0)