Commit 6fe8fd11 authored by giannozz's avatar giannozz

Merge branch 'develop01' into 'develop'

Use internal to EPW klists:

See merge request !410
parents 2be08d0e 5dc4bedc
...@@ -114,7 +114,8 @@ ...@@ -114,7 +114,8 @@
USE becmod, ONLY : becp, deallocate_bec_type USE becmod, ONLY : becp, deallocate_bec_type
USE elph2, ONLY : el_ph_mat, epf17, epsi, etf,& USE elph2, ONLY : el_ph_mat, epf17, epsi, etf,&
etq, et_all, wf, wkf, wqf, & etq, et_all, wf, wkf, wqf, &
xkq, xk_all, zstar, xkf, xqf, epmatwp, eps_rpa xkq, zstar, xkf, xqf, epmatwp, eps_rpa
USE klist_epw, ONLY : xk_all, xk_loc, xk_cryst
USE epwcom, ONLY : epbread, epwread USE epwcom, ONLY : epbread, epwread
USE modes, ONLY : npert, u, name_rap_mode, num_rap_mode USE modes, ONLY : npert, u, name_rap_mode, num_rap_mode
USE qpoint, ONLY : eigqts, igkq USE qpoint, ONLY : eigqts, igkq
...@@ -141,10 +142,8 @@ ...@@ -141,10 +142,8 @@
IF(ALLOCATED(wkf)) DEALLOCATE (wkf) IF(ALLOCATED(wkf)) DEALLOCATE (wkf)
IF(ALLOCATED(xqf)) DEALLOCATE (xqf) IF(ALLOCATED(xqf)) DEALLOCATE (xqf)
IF(ALLOCATED(wqf)) DEALLOCATE (wqf) IF(ALLOCATED(wqf)) DEALLOCATE (wqf)
IF(ALLOCATED(xk_all)) DEALLOCATE (xk_all)
IF(ALLOCATED(et_all)) DEALLOCATE (et_all) IF(ALLOCATED(et_all)) DEALLOCATE (et_all)
IF(ALLOCATED(eps_rpa)) DEALLOCATE (eps_rpa) IF(ALLOCATED(eps_rpa)) DEALLOCATE (eps_rpa)
IF(ALLOCATED(eps_rpa)) DEALLOCATE (eps_rpa)
! !
ELSE ELSE
! !
...@@ -212,7 +211,9 @@ ...@@ -212,7 +211,9 @@
IF(ALLOCATED(wkf)) DEALLOCATE (wkf) IF(ALLOCATED(wkf)) DEALLOCATE (wkf)
IF(ALLOCATED(xqf)) DEALLOCATE (xqf) IF(ALLOCATED(xqf)) DEALLOCATE (xqf)
IF(ALLOCATED(wqf)) DEALLOCATE (wqf) IF(ALLOCATED(wqf)) DEALLOCATE (wqf)
IF(ALLOCATED(xk_all)) DEALLOCATE (xk_all) IF(ALLOCATED(xk_all)) DEALLOCATE (xk_all)
IF(ALLOCATED(xk_loc)) DEALLOCATE (xk_loc)
IF(ALLOCATED(xk_cryst)) DEALLOCATE (xk_cryst)
IF(ALLOCATED(et_all)) DEALLOCATE (et_all) IF(ALLOCATED(et_all)) DEALLOCATE (et_all)
IF(ALLOCATED(eps_rpa)) DEALLOCATE (eps_rpa) IF(ALLOCATED(eps_rpa)) DEALLOCATE (eps_rpa)
ENDIF ! epwread .and. .not. epbread ENDIF ! epwread .and. .not. epbread
......
...@@ -364,7 +364,7 @@ ...@@ -364,7 +364,7 @@
USE cell_base, ONLY : at, bg USE cell_base, ONLY : at, bg
USE start_k, ONLY : nk1, nk2, nk3 USE start_k, ONLY : nk1, nk2, nk3
USE pwcom, ONLY : nkstot USE pwcom, ONLY : nkstot
USE epwcom, ONLY : xk_cryst USE klist_epw, ONLY : xk_cryst
USE io_global, ONLY : stdout, meta_ionode USE io_global, ONLY : stdout, meta_ionode
USE io_files, ONLY : prefix USE io_files, ONLY : prefix
USE io_epw, ONLY : iukgmap USE io_epw, ONLY : iukgmap
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
eps_rpa(:) ! screening eps_rpa(:) ! screening
REAL(KIND=DP), ALLOCATABLE ::& REAL(KIND=DP), ALLOCATABLE ::&
a_all(:,:), &! electronic spectral function du to electron-phonon interaction a_all(:,:), &! electronic spectral function du to electron-phonon interaction
xk_all(:,:), &! full k point grid, coarse (3, nkstot)
et_all(:,:), &! full eigenvalue list, coarse (nbnd, nkstot) et_all(:,:), &! full eigenvalue list, coarse (nbnd, nkstot)
et_ks(:,:), &! lda eigenvalues et_ks(:,:), &! lda eigenvalues
et_mb(:,:), &! gw eigenvalues et_mb(:,:), &! gw eigenvalues
......
...@@ -64,7 +64,8 @@ ...@@ -64,7 +64,8 @@
USE wavefunctions, ONLY : evc USE wavefunctions, ONLY : evc
USE io_files, ONLY : diropn, seqopn USE io_files, ONLY : diropn, seqopn
USE wvfct, ONLY : npwx USE wvfct, ONLY : npwx
USE pwcom, ONLY : current_spin, isk, lsda, nbnd, xk, nks USE pwcom, ONLY : current_spin, isk, lsda, nbnd, nks
USE klist_epw, ONLY : xk_loc, xk_all
USE cell_base, ONLY : tpiba USE cell_base, ONLY : tpiba
USE gvect, ONLY : ngm, g USE gvect, ONLY : ngm, g
USE uspp, ONLY : vkb USE uspp, ONLY : vkb
...@@ -77,7 +78,7 @@ ...@@ -77,7 +78,7 @@
USE lrus, ONLY : becp1 USE lrus, ONLY : becp1
USE becmod, ONLY : calbec USE becmod, ONLY : calbec
USE elph2, ONLY : shift, gmap, el_ph_mat, umat, umatq, igk_k_all, & USE elph2, ONLY : shift, gmap, el_ph_mat, umat, umatq, igk_k_all, &
umat_all, xk_all, et_all, xkq, etq, igkq, igk, & umat_all, et_all, xkq, etq, igkq, igk, &
ngk_all, lower_band, upper_band ngk_all, lower_band, upper_band
USE fft_base, ONLY : dffts USE fft_base, ONLY : dffts
USE constants_epw, ONLY : czero, cone, ci, zero USE constants_epw, ONLY : czero, cone, ci, zero
...@@ -233,7 +234,7 @@ ...@@ -233,7 +234,7 @@
! (we need to make sure that xk(:,ikq) is really k+q for the KB projectors ! (we need to make sure that xk(:,ikq) is really k+q for the KB projectors
! below and also that the eigenvalues are taken correctly in ephwann) ! below and also that the eigenvalues are taken correctly in ephwann)
! !
CALL ktokpmq( xk(:,ik), xq, +1, ipool, nkq, nkq_abs ) CALL ktokpmq( xk_loc(:,ik), xq, +1, ipool, nkq, nkq_abs )
! !
! we define xkq(:,ik) and etq(:,ik) for the current xq ! we define xkq(:,ik) and etq(:,ik) for the current xq
! !
...@@ -277,8 +278,8 @@ ...@@ -277,8 +278,8 @@
! With this option, different compilers and different machines ! With this option, different compilers and different machines
! should always give the same wavefunctions. ! should always give the same wavefunctions.
! !
CALL ktokpmq( xk(:,ik), zero_vect, +1, ipool, nkk, nkk_abs ) CALL ktokpmq(xk_loc(:,ik), zero_vect, +1, ipool, nkk, nkk_abs)
CALL ktokpmq( xkq(:,ik), zero_vect, +1, ipool, nkk, nkq_abs ) CALL ktokpmq(xkq(:,ik), zero_vect, +1, ipool, nkk, nkq_abs)
! !
IF ( .not. ALLOCATED(umat) ) ALLOCATE( umat(nbnd,nbnd,nks) ) IF ( .not. ALLOCATED(umat) ) ALLOCATE( umat(nbnd,nbnd,nks) )
IF ( .not. ALLOCATED(umatq) ) ALLOCATE( umatq(nbnd,nbnd,nks) ) IF ( .not. ALLOCATED(umatq) ) ALLOCATE( umatq(nbnd,nbnd,nks) )
...@@ -341,7 +342,7 @@ ...@@ -341,7 +342,7 @@
! Since in QE a normal rotation s is defined as S^-1 we have here ! Since in QE a normal rotation s is defined as S^-1 we have here
! sxk = S(k). ! sxk = S(k).
! !
CALL rotate_cart( xk(:,ik), s(:,:,isym), sxk ) CALL rotate_cart( xk_loc(:,ik), s(:,:,isym), sxk )
! !
! here we generate vkb on the igk() set and for k ... ! here we generate vkb on the igk() set and for k ...
CALL init_us_2( npw, igk, sxk, vkb ) CALL init_us_2( npw, igk, sxk, vkb )
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
USE ions_base, ONLY : nat, nsp, tau, ityp USE ions_base, ONLY : nat, nsp, tau, ityp
USE control_flags, ONLY : iverbosity USE control_flags, ONLY : iverbosity
USE io_epw, ONLY : iuepb, iuqpeig USE io_epw, ONLY : iuepb, iuqpeig
USE pwcom, ONLY : et, xk, nks, nbnd, nkstot USE pwcom, ONLY : et, nks, nbnd, nkstot
USE cell_base, ONLY : at, bg USE cell_base, ONLY : at, bg
USE symm_base, ONLY : irt, s, nsym, ft, sname, invs, s_axis_to_cart, & USE symm_base, ONLY : irt, s, nsym, ft, sname, invs, s_axis_to_cart, &
sr, nrot, copy_sym, set_sym_bl, find_sym, & sr, nrot, copy_sym, set_sym_bl, find_sym, &
...@@ -47,9 +47,10 @@ ...@@ -47,9 +47,10 @@
USE lr_symm_base, ONLY : minus_q, rtau, gi, gimq, irotmq, nsymq, invsymq USE lr_symm_base, ONLY : minus_q, rtau, gi, gimq, irotmq, nsymq, invsymq
USE epwcom, ONLY : epbread, epbwrite, epwread, lifc, etf_mem, vme, & USE epwcom, ONLY : epbread, epbwrite, epwread, lifc, etf_mem, vme, &
nbndsub, iswitch, kmaps, eig_read, dvscf_dir, lpolar nbndsub, iswitch, kmaps, eig_read, dvscf_dir, lpolar
USE elph2, ONLY : epmatq, dynq, sumr, et_all, xk_all, et_mb, et_ks, & USE elph2, ONLY : epmatq, dynq, sumr, et_all, et_mb, et_ks, &
zstar, epsi, cu, cuq, lwin, lwinq, bmat, igk_k_all, & zstar, epsi, cu, cuq, lwin, lwinq, bmat, igk_k_all, &
ngk_all, exband ngk_all, exband
USE klist_epw, ONLY : xk_all
USE constants_epw, ONLY : ryd2ev, zero, czero USE constants_epw, ONLY : ryd2ev, zero, czero
USE fft_base, ONLY : dfftp USE fft_base, ONLY : dfftp
USE control_ph, ONLY : u_from_file USE control_ph, ONLY : u_from_file
...@@ -266,22 +267,20 @@ ...@@ -266,22 +267,20 @@
ENDIF ENDIF
! !
! Do not recompute dipole matrix elements ! Do not recompute dipole matrix elements
IF ( epwread .and. .not. epbread ) THEN IF ( epwread .AND. .NOT. epbread ) THEN
CONTINUE CONTINUE
ELSE ELSE
! compute coarse grid dipole matrix elements. Very fast ! compute coarse grid dipole matrix elements. Very fast
IF (.not. vme) CALL compute_pmn_para IF (.NOT. vme) CALL compute_pmn_para
ENDIF ENDIF
! !
! gather electronic eigenvalues for subsequent shuffle ! gather electronic eigenvalues for subsequent shuffle
! !
ALLOCATE( xk_all(3,nkstot), et_all(nbnd,nkstot) ) ALLOCATE (et_all(nbnd, nkstot))
xk_all(:,:) = zero
et_all(:,:) = zero et_all(:,:) = zero
CALL poolgather( 3, nkstot, nks, xk(:,1:nks), xk_all)
CALL poolgather(nbnd, nkstot, nks, et(1:nbnd,1:nks), et_all) CALL poolgather(nbnd, nkstot, nks, et(1:nbnd,1:nks), et_all)
! !
IF (.not.kmaps) THEN IF (.NOT. kmaps) THEN
CALL start_clock('kmaps') CALL start_clock('kmaps')
CALL createkmap_pw2 CALL createkmap_pw2
CALL stop_clock('kmaps') CALL stop_clock('kmaps')
......
...@@ -17,9 +17,6 @@ ...@@ -17,9 +17,6 @@
!! This is the main EPW driver which sets the phases on the wavefunctions, !! This is the main EPW driver which sets the phases on the wavefunctions,
!! calls [[wann_run]] and [[elphon_shuffle_wrap]] !! calls [[wann_run]] and [[elphon_shuffle_wrap]]
!! !!
!! @Note
!! 8/14/08 lnscf is unnecessary, as is nqs, iq_start
!!
USE io_global, ONLY : stdout, ionode USE io_global, ONLY : stdout, ionode
USE mp, ONLY : mp_bcast, mp_barrier USE mp, ONLY : mp_bcast, mp_barrier
USE mp_world, ONLY : mpime USE mp_world, ONLY : mpime
...@@ -31,57 +28,55 @@ ...@@ -31,57 +28,55 @@
USE environment, ONLY : environment_start USE environment, ONLY : environment_start
USE elph2, ONLY : elph USE elph2, ONLY : elph
USE close_epw, ONLY : close_final, deallocate_epw USE close_epw, ONLY : close_final, deallocate_epw
! Flag to perform an electron-phonon calculation. If .true.
! the code will enter in [[elphon_shuffle_wrap]]
! !
IMPLICIT NONE IMPLICIT NONE
! !
CHARACTER (LEN=12) :: code = 'EPW' CHARACTER(LEN=12) :: code = 'EPW'
!! Name of the program !! Name of the program
! !
version_number = '5.1.0' version_number = '5.1.0'
! !
CALL init_clocks( .TRUE. ) CALL init_clocks(.TRUE.)
! !
CALL start_clock( 'EPW' ) CALL start_clock('EPW')
! !
gamma_only = .FALSE. gamma_only = .FALSE.
! !
CALL mp_startup(start_images=.true.) CALL mp_startup(start_images = .TRUE.)
! !
! Display the logo ! Display the logo
IF (mpime.eq.ionode_id) then IF (mpime == ionode_id) then
WRITE(stdout,'(a)') " " WRITE(stdout, '(a)') " "
WRITE(stdout,'(a)') " ``:oss/ " WRITE(stdout, '(a)') " ``:oss/ "
WRITE(stdout,'(a)') " `.+s+. .+ys--yh+ `./ss+. " WRITE(stdout, '(a)') " `.+s+. .+ys--yh+ `./ss+. "
WRITE(stdout,'(a)') " -sh//yy+` +yy +yy -+h+-oyy " WRITE(stdout, '(a)') " -sh//yy+` +yy +yy -+h+-oyy "
WRITE(stdout,'(a)') " -yh- .oyy/.-sh. .syo-.:sy- /yh " WRITE(stdout, '(a)') " -yh- .oyy/.-sh. .syo-.:sy- /yh "
WRITE(stdout,'(a)') " `.-.` `yh+ -oyyyo. `/syys: oys `.` " WRITE(stdout, '(a)') " `.-.` `yh+ -oyyyo. `/syys: oys `.` "
WRITE(stdout,'(a)') " `/+ssys+-` `sh+ ` oys` .:osyo` " WRITE(stdout, '(a)') " `/+ssys+-` `sh+ ` oys` .:osyo` "
WRITE(stdout,'(a)') " -yh- ./syyooyo` .sys+/oyo--yh/ " WRITE(stdout, '(a)') " -yh- ./syyooyo` .sys+/oyo--yh/ "
WRITE(stdout,'(a)') " `yy+ .-:-. `-/+/:` -sh- " WRITE(stdout, '(a)') " `yy+ .-:-. `-/+/:` -sh- "
WRITE(stdout,'(a)') " /yh. oys " WRITE(stdout, '(a)') " /yh. oys "
WRITE(stdout,'(a)') " ``..---hho---------` .---------..` `.-----.` -hd+---. " WRITE(stdout, '(a)') " ``..---hho---------` .---------..` `.-----.` -hd+---. "
WRITE(stdout,'(a)') " `./osmNMMMMMMMMMMMMMMMs. +NNMMMMMMMMNNmh+. yNMMMMMNm- oNMMMMMNmo++:` " WRITE(stdout, '(a)') " `./osmNMMMMMMMMMMMMMMMs. +NNMMMMMMMMNNmh+. yNMMMMMNm- oNMMMMMNmo++:` "
WRITE(stdout,'(a)') " +sy--/sdMMMhyyyyyyyNMMh- .oyNMMmyyyyyhNMMm+` -yMMMdyyo:` .oyyNMMNhs+syy` " WRITE(stdout, '(a)') " +sy--/sdMMMhyyyyyyyNMMh- .oyNMMmyyyyyhNMMm+` -yMMMdyyo:` .oyyNMMNhs+syy` "
WRITE(stdout,'(a)') " -yy/ /MMM+.`-+/``mMMy- `mMMh:`````.dMMN:` `MMMy-`-dhhy```mMMy:``+hs " WRITE(stdout, '(a)') " -yy/ /MMM+.`-+/``mMMy- `mMMh:`````.dMMN:` `MMMy-`-dhhy```mMMy:``+hs "
WRITE(stdout,'(a)') " -yy+` /MMMo:-mMM+`-oo/. mMMh: `dMMN/` dMMm:`dMMMMy..MMMo-.+yo` " WRITE(stdout, '(a)') " -yy+` /MMMo:-mMM+`-oo/. mMMh: `dMMN/` dMMm:`dMMMMy..MMMo-.+yo` "
WRITE(stdout,'(a)') " .sys`/MMMMNNMMMs- mMMmyooooymMMNo: oMMM/sMMMMMM++MMN//oh: " WRITE(stdout, '(a)') " .sys`/MMMMNNMMMs- mMMmyooooymMMNo: oMMM/sMMMMMM++MMN//oh: "
WRITE(stdout,'(a)') " `sh+/MMMhyyMMMs- `-` mMMMMMMMMMNmy+-` -MMMhMMMsmMMmdMMd/yy+ " WRITE(stdout, '(a)') " `sh+/MMMhyyMMMs- `-` mMMMMMMMMMNmy+-` -MMMhMMMsmMMmdMMd/yy+ "
WRITE(stdout,'(a)') " `-/+++oyy-/MMM+.`/hh/.`mNm:` mMMd+/////:-.` NMMMMMd/:NMMMMMy:/yyo/:.` " WRITE(stdout, '(a)') " `-/+++oyy-/MMM+.`/hh/.`mNm:` mMMd+/////:-.` NMMMMMd/:NMMMMMy:/yyo/:.` "
WRITE(stdout,'(a)') " +os+//:-..-oMMMo:--:::-/MMMo. .-mMMd+---` hMMMMN+. oMMMMMo. `-+osyso:` " WRITE(stdout, '(a)') " +os+//:-..-oMMMo:--:::-/MMMo. .-mMMd+---` hMMMMN+. oMMMMMo. `-+osyso:` "
WRITE(stdout,'(a)') " syo `mNMMMMMNNNNNNNNMMMo.oNNMMMMMNNNN:` +MMMMs:` dMMMN/` ``:syo " WRITE(stdout, '(a)') " syo `mNMMMMMNNNNNNNNMMMo.oNNMMMMMNNNN:` +MMMMs:` dMMMN/` ``:syo "
WRITE(stdout,'(a)') " /yh` :syyyyyyyyyyyyyyyy+.`+syyyyyyyyo:` .oyys:` .oyys:` +yh " WRITE(stdout, '(a)') " /yh` :syyyyyyyyyyyyyyyy+.`+syyyyyyyyo:` .oyys:` .oyys:` +yh "
WRITE(stdout,'(a)') " -yh- ```````````````` ````````` `` `` oys " WRITE(stdout, '(a)') " -yh- ```````````````` ````````` `` `` oys "
WRITE(stdout,'(a)') " -+h/------------------------::::::::://////++++++++++++++++++++++///////::::/yd: " WRITE(stdout, '(a)') " -+h/------------------------::::::::://////++++++++++++++++++++++///////::::/yd: "
WRITE(stdout,'(a)') " shdddddddddddddddddddddddddddddhhhhhhhhyyyyyssssssssssssssssyyyyyyyhhhhhhhddddh` " WRITE(stdout, '(a)') " shdddddddddddddddddddddddddddddhhhhhhhhyyyyyssssssssssssssssyyyyyyyhhhhhhhddddh` "
WRITE(stdout,'(a)') " " WRITE(stdout, '(a)') " "
WRITE(stdout,'(a)') " S. Ponce, E. R. Margine, C. Verdi, and F. Giustino, " WRITE(stdout, '(a)') " S. Ponce, E. R. Margine, C. Verdi, and F. Giustino, "
WRITE(stdout,'(a)') " Comput. Phys. Commun. 209, 116 (2016) " WRITE(stdout, '(a)') " Comput. Phys. Commun. 209, 116 (2016) "
WRITE(stdout,'(a)') " " WRITE(stdout, '(a)') " "
ENDIF ENDIF
! !
CALL environment_start ( code ) CALL environment_start(code)
! !
! Read in the input file ! Read in the input file
! !
...@@ -89,7 +84,7 @@ ...@@ -89,7 +84,7 @@
! !
CALL allocate_epwq CALL allocate_epwq
! !
IF ( epwread .AND. .NOT. epbread ) THEN IF (epwread .AND. .NOT. epbread) THEN
WRITE(stdout,'(a)') " " WRITE(stdout,'(a)') " "
WRITE(stdout,'(a)') " ------------------------------------------------------------------------ " WRITE(stdout,'(a)') " ------------------------------------------------------------------------ "
WRITE(stdout,'(a)') " RESTART - RESTART - RESTART - RESTART " WRITE(stdout,'(a)') " RESTART - RESTART - RESTART - RESTART "
...@@ -106,24 +101,24 @@ ...@@ -106,24 +101,24 @@
! !
CALL epw_summary CALL epw_summary
! !
IF ( ep_coupling ) THEN IF (ep_coupling) THEN
! !
! In case of restart with arbitrary number of cores. ! In case of restart with arbitrary number of cores.
IF ( epwread .AND. .NOT. epbread ) THEN IF (epwread .AND. .NOT. epbread) THEN
CONTINUE CONTINUE
ELSE ELSE
CALL openfilepw CALL openfilepw
ENDIF ENDIF
! !
CALL print_clock( 'EPW' ) CALL print_clock('EPW')
! !
IF ( epwread .AND. .NOT. epbread ) THEN IF (epwread .AND. .NOT. epbread) THEN
CONTINUE CONTINUE
ELSE ELSE
CALL epw_init(.true.) CALL epw_init(.TRUE.)
ENDIF ENDIF
! !
CALL print_clock( 'EPW' ) CALL print_clock('EPW')
! !
! Generates the perturbation matrix which fixes the gauge of ! Generates the perturbation matrix which fixes the gauge of
! the calculated wavefunctions ! the calculated wavefunctions
...@@ -143,7 +138,7 @@ ...@@ -143,7 +138,7 @@
trim(filukk) , ' from disk', repeat('-',67) trim(filukk) , ' from disk', repeat('-',67)
ENDIF ENDIF
! !
IF ( elph ) THEN IF (elph) THEN
! !
! CALL dvanqq2() ! CALL dvanqq2()
! !
...@@ -153,7 +148,7 @@ ...@@ -153,7 +148,7 @@
! !
! ... cleanup of the variables ! ... cleanup of the variables
! !
CALL clean_pw( .FALSE. ) CALL clean_pw(.FALSE.)
CALL deallocate_epw CALL deallocate_epw
! !
! ... Close the files ! ... Close the files
...@@ -162,11 +157,11 @@ ...@@ -162,11 +157,11 @@
! !
ENDIF ENDIF
! !
IF ( cumulant .and. ionode ) THEN IF (cumulant .AND. ionode) THEN
CALL spectral_cumulant() CALL spectral_cumulant()
ENDIF ENDIF
! !
IF ( eliashberg ) THEN IF (eliashberg) THEN
CALL eliashberg_eqs() CALL eliashberg_eqs()
ENDIF ENDIF
! !
......
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
USE lrus, ONLY : becp1 USE lrus, ONLY : becp1
USE uspp, ONLY : vkb USE uspp, ONLY : vkb
USE pwcom, ONLY : npwx, nbnd, nks, lsda, current_spin, & USE pwcom, ONLY : npwx, nbnd, nks, lsda, current_spin, &
isk, xk isk
USE klist_epw, ONLY : xk_loc
USE constants, ONLY : tpi USE constants, ONLY : tpi
USE constants_epw, ONLY : zero, czero, cone USE constants_epw, ONLY : zero, czero, cone
USE cell_base, ONLY : tpiba2, tpiba, bg, omega USE cell_base, ONLY : tpiba2, tpiba, bg, omega
...@@ -113,7 +114,7 @@ ...@@ -113,7 +114,7 @@
! !
! ... d) The functions vkb(k+G) ! ... d) The functions vkb(k+G)
! !
CALL init_us_2( ngk(ik), igk_k(1,ik), xk(1,ik), vkb ) CALL init_us_2( ngk(ik), igk_k(1,ik), xk_loc(1,ik), vkb )
! !
! ... read the wavefunctions at k ! ... read the wavefunctions at k
! !
...@@ -132,12 +133,12 @@ ...@@ -132,12 +133,12 @@
DO ibnd = 1, nbnd DO ibnd = 1, nbnd
DO ig = 1, ngk(ik) DO ig = 1, ngk(ik)
aux1(ig,ibnd) = evc(ig,ibnd) * tpiba * cone * & aux1(ig,ibnd) = evc(ig,ibnd) * tpiba * cone * &
( xk(ipol,ik) + g(ipol,igk_k(ig,ik)) ) ( xk_loc(ipol,ik) + g(ipol,igk_k(ig,ik)) )
ENDDO ENDDO
IF (noncolin) THEN IF (noncolin) THEN
DO ig = 1, ngk(ik) DO ig = 1, ngk(ik)
aux1(ig+npwx,ibnd) = evc(ig+npwx,ibnd) * tpiba *cone *& aux1(ig+npwx,ibnd) = evc(ig+npwx,ibnd) * tpiba *cone *&
( xk(ipol,ik) + g(ipol,igk_k(ig,ik)) ) ( xk_loc(ipol,ik) + g(ipol,igk_k(ig,ik)) )
ENDDO ENDDO
ENDIF ENDIF
ENDDO ENDDO
......
...@@ -20,9 +20,10 @@ ...@@ -20,9 +20,10 @@
!! SP: Image parallelization added !! SP: Image parallelization added
!! !!
USE ions_base, ONLY : nat, ntyp => nsp USE ions_base, ONLY : nat, ntyp => nsp
USE cell_base, ONLY : at
USE mp, ONLY : mp_bcast USE mp, ONLY : mp_bcast
USE wvfct, ONLY : nbnd USE wvfct, ONLY : nbnd
USE klist, ONLY : nks USE klist, ONLY : nks, xk, nkstot
USE lsda_mod, ONLY : lsda USE lsda_mod, ONLY : lsda
USE fixed_occ, ONLY : tfixed_occ USE fixed_occ, ONLY : tfixed_occ
USE qpoint, ONLY : xq USE qpoint, ONLY : xq
...@@ -58,6 +59,7 @@ ...@@ -58,6 +59,7 @@
restart_filq, prtgkk, nel, meff, epsiHEG, lphase, & restart_filq, prtgkk, nel, meff, epsiHEG, lphase, &
omegamin, omegamax, omegastep, n_r, lindabs, & omegamin, omegamax, omegastep, n_r, lindabs, &
mob_maxiter, use_ws, epmatkqread, selecqread mob_maxiter, use_ws, epmatkqread, selecqread
USE klist_epw, ONLY : xk_all, xk_loc, xk_cryst
USE elph2, ONLY : elph USE elph2, ONLY : elph
USE start_k, ONLY : nk1, nk2, nk3 USE start_k, ONLY : nk1, nk2, nk3
USE constants_epw, ONLY : ryd2mev, ryd2ev, ev2cmm1, kelvin2eV, zero USE constants_epw, ONLY : ryd2mev, ryd2ev, ev2cmm1, kelvin2eV, zero
...@@ -68,7 +70,7 @@ ...@@ -68,7 +70,7 @@
USE partial, ONLY : atomo, nat_todo USE partial, ONLY : atomo, nat_todo
USE constants, ONLY : AMU_RY USE constants, ONLY : AMU_RY
USE mp_global, ONLY : my_pool_id, me_pool USE mp_global, ONLY : my_pool_id, me_pool
USE io_global, ONLY : meta_ionode, meta_ionode_id USE io_global, ONLY : meta_ionode, meta_ionode_id, ionode_id
USE io_epw, ONLY : iunkf, iunqf USE io_epw, ONLY : iunkf, iunqf
#if defined(__NAG) #if defined(__NAG)
USE F90_UNIX_ENV, ONLY : iargc, getarg USE F90_UNIX_ENV, ONLY : iargc, getarg
...@@ -89,6 +91,8 @@ ...@@ -89,6 +91,8 @@
!! auxilary variable for saving the modenum !! auxilary variable for saving the modenum
INTEGER :: i INTEGER :: i
!! Counter for loops !! Counter for loops
INTEGER :: ik
!! Counter on k-points
INTEGER :: nk1tmp INTEGER :: nk1tmp
!! temp vars for saving kgrid info !! temp vars for saving kgrid info
INTEGER :: nk2tmp INTEGER :: nk2tmp
...@@ -185,13 +189,13 @@ ...@@ -185,13 +189,13 @@
! !
! added by @ RM ! added by @ RM
! !
! ephwrite : if true write el-phonon matrix elements on the fine mesh to file ! ephwrite : if true write el-phonon matrix elements on the fine mesh to file
! eps_acustic : min phonon frequency for e-p and a2f calculations (units of cm-1) ! eps_acustic : min phonon frequency for e-p and a2f calculations (units of cm-1)
! band_plot : if true write files to plot band structure and phonon dispersion ! band_plot : if true write files to plot band structure and phonon dispersion
! degaussq : smearing for sum over q in e-ph coupling (units of meV) ! degaussq : smearing for sum over q in e-ph coupling (units of meV)
! delta_qsmear : change in energy for each additional smearing in the a2f (units of meV) ! delta_qsmear: change in energy for each additional smearing in the a2f (units of meV)
! nqsmear : number of smearings used to calculate a2f ! nqsmear : number of smearings used to calculate a2f
! nqstep : number of bins for frequency used to calculate a2f ! nqstep : number of bins for frequency used to calculate a2f
! nswfc : nr. of grid points between (0,wsfc) in Eliashberg equations ! nswfc : nr. of grid points between (0,wsfc) in Eliashberg equations
! nswc : nr. of grid points between (wsfc,wscut) ! nswc : nr. of grid points between (wsfc,wscut)
! pwc : power used to define nswc for non-uniform grid real-axis calculations ! pwc : power used to define nswc for non-uniform grid real-axis calculations
...@@ -292,6 +296,7 @@ ...@@ -292,6 +296,7 @@
! omegastep : Photon energy step in evaluating phonon-assisted absorption spectra (in eV) ! omegastep : Photon energy step in evaluating phonon-assisted absorption spectra (in eV)
! n_r : constant refractive index ! n_r : constant refractive index
! lindabs : do phonon-assisted absorption ! lindabs : do phonon-assisted absorption
!
nk1tmp = 0 nk1tmp = 0
nk2tmp = 0 nk2tmp = 0
nk3tmp = 0 nk3tmp = 0
...@@ -307,13 +312,13 @@ ...@@ -307,13 +312,13 @@
! !
ENDIF ENDIF
! !
CALL mp_bcast(ios, meta_ionode_id, world_comm ) CALL mp_bcast(ios, meta_ionode_id, world_comm)
CALL errore( 'epw_readin', 'reading title ', ABS( ios ) ) CALL errore('epw_readin', 'reading title ', ABS( ios ))
CALL mp_bcast(title, meta_ionode_id, world_comm ) CALL mp_bcast(title, meta_ionode_id, world_comm)
! !
! Rewind the input if the title is actually the beginning of inputph namelist ! Rewind the input if the title is actually the beginning of inputph namelist
! !
IF( imatches("&inputepw", title) ) THEN IF(imatches("&inputepw", title)) THEN
WRITE(*, '(6x,a)') "Title line not specified: using 'default'." WRITE(*, '(6x,a)') "Title line not specified: using 'default'."
title='default' title='default'
IF (meta_ionode) REWIND(5, iostat=ios) IF (meta_ionode) REWIND(5, iostat=ios)
...@@ -611,8 +616,8 @@ ...@@ -611,8 +616,8 @@
! !
! thickness and smearing width of the Fermi surface ! thickness and smearing width of the Fermi surface
! from eV to Ryd ! from eV to Ryd
fsthick = fsthick / ryd2ev fsthick = fsthick / ryd2ev
degaussw = degaussw / ryd2ev degaussw = degaussw / ryd2ev
delta_smear = delta_smear / ryd2ev delta_smear = delta_smear / ryd2ev
! !
! smearing of phonon in a2f ! smearing of phonon in a2f
...@@ -686,18 +691,41 @@ ...@@ -686,18 +691,41 @@
! !
modenum_aux = modenum modenum_aux = modenum
! !
! SP: This initialized nspin and nspin_mag ! SP: This initialized xk, nspin and nspin_mag
IF ( epwread .and. .not. epbread ) THEN IF (epwread .AND. .NOT. epbread) THEN
CONTINUE CONTINUE
ELSE ELSE
CALL read_file CALL read_file()
!
! We define the global list of coarse grid k-points (cart and cryst)
ALLOCATE (xk_all(3, nkstot))
ALLOCATE (xk_cryst(3, nkstot))
xk_all(:,:) = zero
xk_cryst(:,:) = zero
DO ik=1, nkstot
xk_all(:, ik) = xk(:, ik)
xk_cryst(:, ik) = xk(:, ik)
ENDDO
! bring k-points from cartesian to crystal coordinates
CALL cryst_to_cart(nkstot, xk_cryst, at, -1)
! Only master has the correct full list of kpt. Therefore bcast to all cores
CALL mp_bcast(xk_all, ionode_id, world_comm)
CALL mp_bcast(xk_cryst, ionode_id, world_comm)
!
! We define the local list of kpt
ALLOCATE (xk_loc(3, nks))
xk_loc(:,:) = zero
DO ik=1, nks
xk_loc(:, ik) = xk(:, ik)
ENDDO
!
ENDIF ENDIF
! !
! nbnd comes out of readfile ! nbnd comes out of readfile
IF (nbndsub.eq.0) nbndsub = nbnd IF (nbndsub == 0) nbndsub = nbnd
! !
#if defined(__MPI) #if defined(__MPI)
IF (.not.(me_pool /=0 .or. my_pool_id /=0)) THEN IF (.NOT. (me_pool /=0 .OR. my_pool_id /=0)) THEN
nk1 = nk1tmp nk1 = nk1tmp
nk2 = nk2tmp nk2 = nk2tmp
nk3 = nk3tmp nk3 = nk3tmp
...@@ -711,10 +739,10 @@ ...@@ -711,10 +739,10 @@
IF (gamma_only) CALL errore('epw_readin',& IF (gamma_only) CALL errore('epw_readin',&