Commit 032240ba authored by sponce's avatar sponce

Reading external eigenenergies files.



git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@14017 c92efa57-630b-4861-b058-cf58834340f0
parent f9ce93ac
......@@ -54,8 +54,8 @@
!
! allocate space for the quantities needed in EPW
!
ALLOCATE (evq ( npwx*npol, nbnd))
ALLOCATE (dpsi ( npwx*npol, nbnd))
ALLOCATE (evq ( npwx*npol, nbnd))
ALLOCATE (dpsi ( npwx*npol, nbnd))
ALLOCATE (vlocq ( ngm, ntyp))
! SP: nrxx is not used in QE 5 ==> tg_nnr is the maximum among nnr
! This SHOULD have the same dim as nrxx had.
......
......@@ -149,7 +149,7 @@
! SP: Bound for band parallelism
CALL fkbounds_bnd( nbnd, lower_band, upper_band )
!
IF ( .not. ALLOCATED (aux3) ) ALLOCATE ( aux3( npwx*npol, lower_band:upper_band) )
IF ( .not. ALLOCATED (aux3) ) ALLOCATE ( aux3( npwx*npol, lower_band:upper_band) )
IF ( .not. ALLOCATED (dvpsi) ) ALLOCATE ( dvpsi( npwx*npol, lower_band:upper_band) )
! setup for k+q folding
!
......
......@@ -35,7 +35,7 @@
USE ions_base, ONLY : nat, nsp, tau, ityp
USE control_flags, ONLY : iverbosity
USE io_global, ONLY : stdout
USE io_epw, ONLY : iuepb
USE io_epw, ONLY : iuepb, QPeig_read
USE kinds, ONLY : DP
USE pwcom, ONLY : et, xk, nks, nbnd, nkstot
USE cell_base, ONLY : at, bg
......@@ -73,6 +73,8 @@
!! Name of the file
character (len=3) :: filelab
!! Append the number of the core that works on that file
character(len=80) :: line
!! Use to read external eigenvalues
character(len=6), external :: int_to_char
!! Transfor an int to a character
logical :: sym(48)
......@@ -231,16 +233,16 @@
WRITE (stdout,'(5x,a,i5,a,i5,a)') "Reading external electronic eigenvalues (", &
nbnd, ",", nkstot,")"
tempfile=trim(prefix)//'.eig'
OPEN(1, file=tempfile, form='formatted', action='read', iostat=ios)
OPEN(QPeig_read, file=tempfile, form='formatted', action='read', iostat=ios)
IF (ios /= 0) CALL errore ('elphon_shuffle_wrap','error opening' // tempfile, 1)
READ (QPeig_read,'(a)') line
DO ik = 1, nkstot
DO ibnd = 1, nbnd
READ (1,*) dummy1, dummy2, et_tmp (ibnd,ik)
IF (dummy1.ne.ibnd) CALL errore('elphon_shuffle_wrap', "Incorrect eigenvalue file", 1)
IF (dummy2.ne.ik) CALL errore('elphon_shuffle_wrap', "Incorrect eigenvalue file", 1)
ENDDO
! We do not save the k-point for the moment ==> should be read and
! tested against the current one
READ (QPeig_read,'(a)') line
READ (QPeig_read,*) et_tmp (:,ik)
ENDDO
CLOSE(1)
CLOSE(QPeig_read)
! from eV to Ryd
et_tmp = et_tmp / ryd2ev
ENDIF
......@@ -429,9 +431,9 @@
invs, s, irt, rtau)
ENDIF
CALL mp_bcast (zstar, meta_ionode_id, world_comm)
CALL mp_bcast (epsi, meta_ionode_id, world_comm)
CALL mp_bcast (dynq, meta_ionode_id, world_comm)
CALL mp_bcast (sumr, meta_ionode_id, world_comm)
CALL mp_bcast (epsi , meta_ionode_id, world_comm)
CALL mp_bcast (dynq , meta_ionode_id, world_comm)
CALL mp_bcast (sumr , meta_ionode_id, world_comm)
!
! now dynq is the cartesian dyn mat (NOT divided by the masses)
!
......@@ -804,6 +806,7 @@
! This function test if two tridimensional vectors are equal
!
USE kinds
!
implicit none
real(kind=DP) :: x (3), y (3)
! input: input vector
......@@ -829,12 +832,12 @@
USE io_global, ONLY : meta_ionode, meta_ionode_id
USE mp, ONLY : mp_bcast
USE mp_global, ONLY : world_comm
!
IMPLICIT NONE
INTEGER, INTENT(IN) :: current_iq,iunpun
INTEGER, INTENT(OUT) :: ierr
INTEGER :: imode0, imode, irr, ipert, iq
!
INTEGER, INTENT(IN) :: current_iq,iunpun
INTEGER, INTENT(OUT) :: ierr
INTEGER :: imode0, imode, irr, ipert, iq
!
ierr=0
IF (meta_ionode) THEN
......@@ -876,13 +879,13 @@
!
ENDIF
CALL mp_bcast( nirr, meta_ionode_id, world_comm )
CALL mp_bcast( npert, meta_ionode_id, world_comm )
CALL mp_bcast( nsymq, meta_ionode_id, world_comm )
CALL mp_bcast( minus_q, meta_ionode_id, world_comm )
CALL mp_bcast( u, meta_ionode_id, world_comm )
CALL mp_bcast( name_rap_mode, meta_ionode_id, world_comm )
CALL mp_bcast( num_rap_mode, meta_ionode_id, world_comm )
CALL mp_bcast( nirr , meta_ionode_id, world_comm )
CALL mp_bcast( npert , meta_ionode_id, world_comm )
CALL mp_bcast( nsymq , meta_ionode_id, world_comm )
CALL mp_bcast( minus_q , meta_ionode_id, world_comm )
CALL mp_bcast( u , meta_ionode_id, world_comm )
CALL mp_bcast( name_rap_mode, meta_ionode_id, world_comm )
CALL mp_bcast( num_rap_mode , meta_ionode_id, world_comm )
RETURN
END SUBROUTINE read_modes
......@@ -46,7 +46,7 @@
USE io_epw, ONLY : lambda_phself, linewidth_phself, iunepmatwe, &
iunepmatwp, crystal
USE elph2, ONLY : nrr_k, nrr_q, cu, cuq, lwin, lwinq, irvec, ndegen_k,&
ndegen_q, wslen, chw, chw_ks, cvmew, cdmew, rdw, &
ndegen_q, wslen, chw, chw_ks, cvmew, cdmew, rdw, &
epmatwp, epmatq, wf, etf, etf_k, etf_ks, xqf, xkf, &
wkf, dynq, nqtotf, nkqf, epf17, nkf, nqf, et_ks, &
ibndmin, ibndmax, lambda_all, dmec, dmef, vmef, &
......@@ -200,7 +200,7 @@
COMPLEX(kind=DP), ALLOCATABLE :: cfac(:)
!! Used to store $e^{2\pi r \cdot k}$ exponential
COMPLEX(kind=DP), ALLOCATABLE :: cfacq(:)
!! Used to store $e^{2\pi r \cdot k+q}$ exponential
!! Used to store $e^{2\pi r \cdot k+q}$ exponential
!
IF (nbndsub.ne.nbnd) &
WRITE(stdout, '(/,14x,a,i4)' ) 'band disentanglement is used: nbndsub = ', nbndsub
......@@ -1255,7 +1255,7 @@
IF ( ALLOCATED(sigmai_all) ) DEALLOCATE( sigmai_all )
IF ( ALLOCATED(sigmai_mode) ) DEALLOCATE( sigmai_mode )
IF ( ALLOCATED(w2) ) DEALLOCATE( w2 )
IF ( ALLOCATED(epf17) ) DEALLOCATE( epf17 )
IF ( ALLOCATED(epf17) ) DEALLOCATE( epf17 )
DEALLOCATE(cfac)
DEALLOCATE(cfacq)
DEALLOCATE(rdotk)
......
......@@ -104,7 +104,7 @@
degaussw, fsthick, eptemp, nsmear, delta_smear, &
dvscf_dir, ngaussw, &
wannierize, dis_win_max, dis_win_min, dis_froz_min, dis_froz_max, &
num_iter, proj, wdata, iprint, write_wfn, wmin, wmax, nw, &
num_iter, proj, wdata, iprint, write_wfn, wmin, wmax, nw, &
eps_acustic, a2f, nest_fn, plselfen, &
elecselfen, phonselfen, parallel_k, parallel_q, &
rand_q, rand_nq, rand_k, rand_nk, specfun_pl, &
......
......@@ -24,7 +24,7 @@
PUBLIC :: lambda_phself, linewidth_phself, linewidth_elself, iospectral, &
iua2ffil, iudosfil, iufillambda, iuqdos, iufe, iufilker, &
iufilgap, iospectral_sup, iua2ftrfil, iufilgapFS, iufillambdaFS, &
iospectral_cum, iuwanep, iuwane, iunukk, iudvscf
iospectral_cum, iuwanep, iuwane, iunukk, iudvscf, QPeig_read
PUBLIC :: epwdata, iundmedata, iunvmedata, iunksdata, iudyn, iukgmap, iuepb,&
iufilfreq, iufilegnv, iufileph, iufilkqmap, &
iufilikmap, iueig, iunepmatwp, iunepmatwe, iunkf, iunqf, &
......@@ -35,6 +35,7 @@
!
! Output of physically relevant quantities (60-100)
!
INTEGER :: QPeig_read = 59 ! Reading qp eigenenergies from file
INTEGER :: lambda_phself = 60 ! Lambda factor of the phonon self-energy
! [lambda.phself]
INTEGER :: linewidth_phself= 61 ! Imaginary part of the phonon self-energy
......
......@@ -495,7 +495,12 @@ SUBROUTINE run_wannier
USE mp_world, ONLY : world_comm
USE cell_base, ONLY : celldm
USE io_files, ONLY : prefix
USE wannierEPW
USE io_epw, ONLY : QPeig_read
USE pwcom, ONLY : nkstot
USE wannierEPW,ONLY : u_mat, lwindow, wann_centers, wann_spreads, eigval, &
n_wannier, spreads, nnb, rlatt, glatt, kpt_latt, &
iknum, seedname2, num_bands, u_mat_opt, atsym, a_mat,&
atcart, m_mat, mp_grid
USE epwcom, ONLY : eig_read
USE wvfct, ONLY : nbnd
USE constants_epw, ONLY : czero, bohr
......@@ -504,6 +509,7 @@ SUBROUTINE run_wannier
!
integer :: i, ik, ibnd, dummy1, dummy2, ios
character (len=256) :: tempfile
character (len=80) :: line
!
ALLOCATE(u_mat(n_wannier,n_wannier,iknum))
ALLOCATE(u_mat_opt(num_bands,n_wannier,iknum))
......@@ -514,38 +520,35 @@ SUBROUTINE run_wannier
u_mat_opt = czero
!
IF (meta_ionode) THEN
! read in external eigenvalues, e.g. GW
IF (eig_read) then
WRITE (stdout,'(5x,a,i5,a,i5,a)') "Reading electronic eigenvalues (", &
nbnd, ",", iknum,")"
tempfile=trim(prefix)//'.eig'
OPEN(1, file=tempfile, form='formatted', action='read', iostat=ios)
IF (ios /= 0) CALL errore ('run_wannier','error opening' // tempfile, 1)
!
! the form should be band, kpt, eigenvalue
!
DO ik = 1, iknum
DO ibnd = 1, nbnd
READ (1,*) dummy1, dummy2, eigval (ibnd,ik)
IF (dummy1.ne.ibnd) CALL errore('run_wannier', "Incorrect eigenvalue file", 1)
IF (dummy2.ne.ik) CALL errore('run_wannier', "Incorrect eigenvalue file", 1)
ENDDO
ENDDO
CLOSE(1)
ENDIF
!
! read in external eigenvalues, e.g. GW
IF (eig_read) then
WRITE (stdout,'(5x,a,i5,a,i5,a)') "Reading external electronic eigenvalues (", &
nbnd, ",", nkstot,")"
tempfile=trim(prefix)//'.eig'
OPEN(QPeig_read, file=tempfile, form='formatted', action='read', iostat=ios)
IF (ios /= 0) CALL errore ('run_wannier','error opening' // tempfile, 1)
READ (QPeig_read,'(a)') line
DO ik = 1, nkstot
! We do not save the k-point for the moment ==> should be read and
! tested against the current one
READ (QPeig_read,'(a)') line
READ (QPeig_read,*) eigval (:,ik)
ENDDO
CLOSE(QPeig_read)
ENDIF
! SP : This file is not used for now. Only required to build the UNK file
! tempfile=trim(prefix)//'.mmn'
! OPEN(iummn, file=tempfile, iostat=ios, form='unformatted')
! WRITE(iummn) m_mat
! CLOSE(iummn)
CALL wannier_run(seedname2, mp_grid, iknum, & ! input
rlatt, glatt, kpt_latt, num_bands, & ! input
n_wannier, nnb, nat, atsym, & ! input
atcart, .false., m_mat, a_mat, eigval, & ! input
u_mat, u_mat_opt, lwindow, wann_centers, & ! output
wann_spreads, spreads) ! output
CALL wannier_run(seedname2, mp_grid, iknum, & ! input
rlatt, glatt, kpt_latt, num_bands, & ! input
n_wannier, nnb, nat, atsym, & ! input
atcart, .false., m_mat, a_mat, eigval, & ! input
u_mat, u_mat_opt, lwindow, wann_centers, & ! output
wann_spreads, spreads) ! output
ENDIF
!
......
This diff is collapsed.
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