Commit dd817a57 authored by Samuel Poncé's avatar Samuel Poncé

Cleaning and optimization in EPW

1) Complete re-writing of the IBTE (at least an order of magnitude faster).
2) Supporting both k-point symmetry and no-symmetry
3) Creating of a few new modules
4) Addition of a epw_mob_ibte_sym for testing the IBTE using k-point symmetry.
Both epw_mob_ibte_sym and epw_mob_ibte should give the same result but
epw_mob_ibte_sym is much faster.
parent b1f3181f
......@@ -23,6 +23,7 @@ epwcom.o \
constants_epw.o \
io_epw.o \
elph2.o \
division.o \
eliashbergcom.o \
superconductivity.o \
superconductivity_aniso.o \
......@@ -30,6 +31,7 @@ superconductivity_iso.o \
io_eliashberg.o \
io_scattering.o \
transportcom.o \
close_epw.o \
printing.o \
transport.o \
transport_iter.o \
......@@ -39,9 +41,7 @@ allocate_epwq.o \
bcast_epw_input.o \
bloch2wan.o \
broyden.o \
close_epw.o \
createkmap.o \
deallocate_epw.o \
dvanqq2.o \
dvqpsi_us3.o \
dvqpsi_us_only3.o \
......@@ -60,7 +60,6 @@ gmap_sym.o \
indabs.o \
io_dyn_mat2.o \
kfold.o \
kpointdivision.o \
kpoint_grid_epw.o \
ktokpmq.o \
loadkmesh.o \
......@@ -72,6 +71,7 @@ openfilepw.o \
rgd_blk_epw_fine_mem.o \
plot_band.o \
poolgather.o \
print_ibte.o \
readdvscf.o \
readgmap.o \
readmat_shuffle2.o \
......
......@@ -49,7 +49,7 @@
restart, restart_freq, prtgkk, nel, meff, epsiHEG, &
scatread, restart, restart_freq, restart_filq, &
lphase, omegamin, omegamax, omegastep, n_r, lindabs,&
mob_maxiter, use_ws
mob_maxiter, use_ws, epmatkqread, selecqread
USE elph2, ONLY : elph
USE mp, ONLY : mp_bcast
USE mp_world, ONLY : world_comm
......@@ -133,6 +133,8 @@
CALL mp_bcast (lphase , meta_ionode_id, world_comm)
CALL mp_bcast (lindabs , meta_ionode_id, world_comm)
CALL mp_bcast (use_ws , meta_ionode_id, world_comm)
CALL mp_bcast (epmatkqread , meta_ionode_id, world_comm)
CALL mp_bcast (selecqread , meta_ionode_id, world_comm)
!
! integers
!
......
This diff is collapsed.
......@@ -64,6 +64,8 @@
REAL(DP), PARAMETER :: eps16 = 1.0E-16_DP
REAL(DP), PARAMETER :: eps24 = 1.0E-24_DP
REAL(DP), PARAMETER :: eps32 = 1.0E-32_DP
REAL(DP), PARAMETER :: eps80 = 1.0E-80_DP
REAL(DP), PARAMETER :: eps160 = 1.0E-160_DP
!
END MODULE constants_epw
!
! Copyright (C) 2010-2016 Samuel Ponce', Roxana Margine, Carla Verdi, Feliciano Giustino
! Copyright (C) 2007-2009 Jesse Noffsinger, Brad Malone, Feliciano Giustino
!
! 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 .
!
! Code adapted from PH/deallocate_phq - Quantum-ESPRESSO group
!
!----------------------------------------------------------------------
SUBROUTINE deallocate_epw
!----------------------------------------------------------------------
!!
!! deallocates the variables allocated by allocate_epw
!! this routine is unchanged as of 3/9/09 and should be cleaned and fixed
!! 09/2009 Cleanup still necessary
!! 12/2009 Added variables from elph.f90
!!
!! RM - Nov/Dec 2014
!! Imported the noncolinear case implemented by xlzhang
!!
!----------------------------------------------------------------------
USE phcom, ONLY : alphap, alphasum, alphasum_nc, &
becsum_nc, dmuxc, dpsi,&
drc, dpsi, dyn, evq, dvpsi,&
int5, vlocq, int2_so, int5_so
USE lrus, ONLY : becp1, int3, int3_nc
USE phus, ONLY : int1, int1_nc, int2, int4, int4_nc
USE lr_symm_base, ONLY : rtau
USE noncollin_module, ONLY : m_loc
USE control_lr, ONLY : nbnd_occ
USE becmod, ONLY : becp, deallocate_bec_type
USE elph2, ONLY : el_ph_mat, epf17, epsi, etf,&
etq, et_all, wf, wkf, wqf, &
xkq, xk_all, zstar, xkf, xqf, epmatwp, eps_rpa
USE epwcom, ONLY : epbread, epwread
USE modes, ONLY : npert, u, name_rap_mode, num_rap_mode
USE qpoint, ONLY : eigqts, igkq
USE klist, ONLY : nks
!
IMPLICIT NONE
INTEGER :: ik, ipol
!
IF ( epwread .and. .not. epbread ) THEN
! EPW variables ONLY
!
IF(ALLOCATED(el_ph_mat)) DEALLOCATE (el_ph_mat)
IF(ALLOCATED(epmatwp)) DEALLOCATE (epmatwp)
IF(ALLOCATED(epf17)) DEALLOCATE (epf17)
IF(ALLOCATED(etq)) DEALLOCATE (etq)
IF(ALLOCATED(etf)) DEALLOCATE (etf)
IF(ALLOCATED(wf)) DEALLOCATE (wf)
IF(ALLOCATED(xkq)) DEALLOCATE (xkq)
IF(ALLOCATED(xkf)) DEALLOCATE (xkf)
IF(ALLOCATED(wkf)) DEALLOCATE (wkf)
IF(ALLOCATED(xqf)) DEALLOCATE (xqf)
IF(ALLOCATED(wqf)) DEALLOCATE (wqf)
IF(ALLOCATED(xk_all)) DEALLOCATE (xk_all)
IF(ALLOCATED(et_all)) DEALLOCATE (et_all)
IF(ALLOCATED(eps_rpa)) DEALLOCATE (eps_rpa)
IF(ALLOCATED(eps_rpa)) DEALLOCATE (eps_rpa)
!
ELSE
!
IF(ASSOCIATED(evq)) DEALLOCATE(evq)
IF(ASSOCIATED(igkq)) DEALLOCATE(igkq)
!
IF(ALLOCATED(dvpsi)) DEALLOCATE (dvpsi)
IF(ALLOCATED(dpsi)) DEALLOCATE ( dpsi)
!
IF(ALLOCATED(vlocq)) DEALLOCATE (vlocq)
IF(ALLOCATED(dmuxc)) DEALLOCATE (dmuxc)
!
IF(ALLOCATED(eigqts)) DEALLOCATE (eigqts)
IF(ALLOCATED(rtau)) DEALLOCATE (rtau)
IF(ASSOCIATED(u)) DEALLOCATE (u)
if(allocated(name_rap_mode)) deallocate (name_rap_mode)
if(allocated(num_rap_mode)) deallocate (num_rap_mode)
IF(ALLOCATED(dyn)) DEALLOCATE (dyn)
IF(ALLOCATED(epsi)) DEALLOCATE (epsi)
IF(ALLOCATED(zstar)) DEALLOCATE (zstar)
!
IF(ALLOCATED(npert)) DEALLOCATE (npert)
!
IF(ALLOCATED(int1)) DEALLOCATE (int1)
IF(ALLOCATED(int2)) DEALLOCATE (int2)
IF(ALLOCATED(int3)) DEALLOCATE (int3)
IF(ALLOCATED(int4)) DEALLOCATE (int4)
IF(ALLOCATED(int5)) DEALLOCATE (int5)
IF(ALLOCATED(int1_nc)) DEALLOCATE(int1_nc)
IF(ALLOCATED(int3_nc)) DEALLOCATE(int3_nc)
IF(ALLOCATED(int4_nc)) DEALLOCATE(int4_nc)
IF(ALLOCATED(becsum_nc)) DEALLOCATE(becsum_nc)
IF(ALLOCATED(alphasum_nc)) DEALLOCATE(alphasum_nc)
IF(ALLOCATED(int2_so)) DEALLOCATE(int2_so)
IF(ALLOCATED(int5_so)) DEALLOCATE(int5_so)
IF(ALLOCATED(alphasum)) DEALLOCATE (alphasum)
!
if(allocated(alphap)) then
do ik=1,nks
do ipol=1,3
call deallocate_bec_type ( alphap(ipol,ik) )
enddo
end do
deallocate (alphap)
endif
if(allocated(becp1)) then
do ik=1,size(becp1)
call deallocate_bec_type ( becp1(ik) )
end do
deallocate(becp1)
end if
call deallocate_bec_type ( becp )
IF(ALLOCATED(nbnd_occ)) DEALLOCATE(nbnd_occ)
IF(ALLOCATED(m_loc)) DEALLOCATE(m_loc)
!
IF(ALLOCATED(drc)) DEALLOCATE(drc)
!
! EPW variables
!
IF(ALLOCATED(el_ph_mat)) DEALLOCATE (el_ph_mat)
IF(ALLOCATED(epmatwp)) DEALLOCATE (epmatwp)
IF(ALLOCATED(epf17)) DEALLOCATE (epf17)
IF(ALLOCATED(etq)) DEALLOCATE (etq)
IF(ALLOCATED(etf)) DEALLOCATE (etf)
IF(ALLOCATED(wf)) DEALLOCATE (wf)
IF(ALLOCATED(xkq)) DEALLOCATE (xkq)
IF(ALLOCATED(xkf)) DEALLOCATE (xkf)
IF(ALLOCATED(wkf)) DEALLOCATE (wkf)
IF(ALLOCATED(xqf)) DEALLOCATE (xqf)
IF(ALLOCATED(wqf)) DEALLOCATE (wqf)
IF(ALLOCATED(xk_all)) DEALLOCATE (xk_all)
IF(ALLOCATED(et_all)) DEALLOCATE (et_all)
IF(ALLOCATED(eps_rpa)) DEALLOCATE (eps_rpa)
ENDIF ! epwread .and. .not. epbread
!
END SUBROUTINE deallocate_epw
!
! Copyright (C) 2010-2016 Samuel Ponce', Roxana Margine, Carla Verdi, Feliciano Giustino
! Copyright (C) 2007-2009 Jesse Noffsinger, Brad Malone, Feliciano Giustino
!
! 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 .
!
!----------------------------------------------------------------------
MODULE division
!----------------------------------------------------------------------
!!
!! This module contains various core splitting routines
!!
IMPLICIT NONE
!
CONTAINS
!
!---------------------------------------------------------------------
SUBROUTINE kpointdivision ( ik0 )
!---------------------------------------------------------------------
!!
!! This is just to find the first kpoint block in the pool
!!
!---------------------------------------------------------------------
!
USE mp_global, ONLY : my_pool_id,npool
USE pwcom, ONLY : nkstot
!
implicit none
integer :: ik0
integer :: nkl, nkr, iks
!
#if defined(__MPI)
!
! number of kpoint blocks, kpoints per pool and reminder
!
nkl = 1 * ( nkstot / npool )
nkr = ( nkstot - nkl * npool ) / 1
!
! the reminder goes to the first nkr pools
! (0...nkr-1)
!
IF ( my_pool_id < nkr ) nkl = nkl + 1 !kunit
!
! the index of the first k point in this pool
!
iks = nkl * my_pool_id + 1
IF ( my_pool_id >= nkr ) iks = iks + nkr * 1 !kunit
!
! the index of the first k point block in this pool - 1
! (I will need the index of ik, not ikk)
!
ik0 = ( iks - 1 )
!
#else
ik0 = 0
#endif
!
END SUBROUTINE kpointdivision
!
!-----------------------------------------------------------------------
SUBROUTINE fkbounds( nktot, lower_bnd, upper_bnd )
!-----------------------------------------------------------------------
!!
!! Subroutine finds the lower and upper bounds a k-grid in parallel
!!
!! @ Note:
!! If you have 19 kpts and 2 pool, this routine will return
!! lower_bnd= 1 and upper_bnd=10 for the first pool
!! lower_bnd= 1 and upper_bnd=9 for the second pool
!-----------------------------------------------------------------------
!
USE mp_global, ONLY : my_pool_id, npool
!
IMPLICIT NONE
!
INTEGER, INTENT (in) :: nktot
!! nktot k-points splited over pools
INTEGER, INTENT (out) :: lower_bnd
!! Lower kpt bounds for that image pool
INTEGER, INTENT (out) :: upper_bnd
!! Upper kpt for that image pool
!
#if defined(__MPI)
!
INTEGER :: nkl, nkr
!
! find the bounds of k-dependent arrays in the parallel case
! number of kpoint blocks, kpoints per pool and reminder
!
nkl = nktot / npool
nkr = nktot - nkl * npool
!
! the reminder goes to the first nkr pools (0...nkr-1)
!
IF (my_pool_id < nkr ) nkl = nkl + 1
!
! the index of the first k point in this pool
!
lower_bnd = my_pool_id * nkl + 1
IF ( my_pool_id >= nkr ) lower_bnd = my_pool_id * nkl + 1 + nkr
!
! the index of the last k point in this pool
!
upper_bnd = lower_bnd + nkl - 1
!
#else
!
! In serial the definitions are much easier
!
lower_bnd = 1
upper_bnd = nktot
!
#endif
!
RETURN
!
END SUBROUTINE fkbounds
!
!-----------------------------------------------------------------------
!
!
!-----------------------------------------------------------------------
SUBROUTINE fkbounds2( nktot, lower_bnd, upper_bnd )
!-----------------------------------------------------------------------
!!
!! Subroutine finds the lower and upper bounds a k-grid in parallel
!!
!! @ Note:
!! If you have 19 kpts and 2 pool, this routine will return
!! lower_bnd= 1 and upper_bnd=10 for the first pool
!! lower_bnd= 1 and upper_bnd=9 for the second pool
!-----------------------------------------------------------------------
!
USE mp_global, ONLY : my_pool_id, npool
USE parallel_include, ONLY : MPI_OFFSET_KIND
!
IMPLICIT NONE
!
#if defined(__MPI)
INTEGER (kind=MPI_OFFSET_KIND), INTENT (in) :: nktot
!! nktot k-points splited over pools
#else
INTEGER (KIND=8), INTENT (IN) :: ind_tot
!! nktot k-points splited over pools
#endif
INTEGER, INTENT (out) :: lower_bnd
!! Lower kpt bounds for that image pool
INTEGER, INTENT (out) :: upper_bnd
!! Upper kpt for that image pool
!
#if defined(__MPI)
!
INTEGER :: nkl, nkr
!
! find the bounds of k-dependent arrays in the parallel case
! number of kpoint blocks, kpoints per pool and reminder
!
nkl = nktot / npool
nkr = nktot - nkl * npool
!
! the reminder goes to the first nkr pools (0...nkr-1)
!
IF (my_pool_id < nkr ) nkl = nkl + 1
!
! the index of the first k point in this pool
!
lower_bnd = my_pool_id * nkl + 1
IF ( my_pool_id >= nkr ) lower_bnd = my_pool_id * nkl + 1 + nkr
!
! the index of the last k point in this pool
!
upper_bnd = lower_bnd + nkl - 1
!
#else
!
! In serial the definitions are much easier
!
lower_bnd = 1
upper_bnd = nktot
!
#endif
!
RETURN
!
END SUBROUTINE fkbounds2
!
!-----------------------------------------------------------------------
!-----------------------------------------------------------------------
!-----------------------------------------------------------------------
SUBROUTINE fkbounds_bnd( nbnd, lower_bnd, upper_bnd )
!-----------------------------------------------------------------------
!!
!! Subroutine finds the lower and upper bounds in band parallelization
!!
!! @ Note:
!! If you have 20 bands and 2 images, this routine will return
!! lower_bnd= 1 and upper_bnd=10 for the first pool
!! lower_bnd= 11 and upper_bnd=19 for the second pool
!-----------------------------------------------------------------------
!
USE mp_images, ONLY: nimage, my_image_id
! number of images, number of processor within an image, index of the proc within an image
!
IMPLICIT NONE
!
INTEGER, INTENT (in) :: nbnd
!! Total number of band to be splitted among images
INTEGER, INTENT (out) :: lower_bnd
!! Lower band bounds for that image pool
INTEGER, INTENT (out) :: upper_bnd
!! Upper band bound for that image pool
!
#if defined(__MPI)
!
INTEGER :: nkl, nkr
!
! find the bounds of k-dependent arrays in the parallel case
! number of kpoint blocks, kpoints per pool and reminder
!
nkl = nbnd / nimage
nkr = nbnd - nkl * nimage
!
! the reminder goes to the first nkr pools (0...nkr-1)
!
IF (my_image_id < nkr ) nkl = nkl + 1
!
! the index of the first k point in this pool
!
lower_bnd = my_image_id * nkl + 1
IF ( my_image_id >= nkr ) lower_bnd = my_image_id * nkl + 1 + nkr
!
! the index of the last k point in this pool
!
upper_bnd = lower_bnd + nkl - 1
!
#else
!
! In serial the definitions are much easier
!
lower_bnd = 1
upper_bnd = nbnd
!
#endif
!
RETURN
!
END SUBROUTINE fkbounds_bnd
!
!-----------------------------------------------------------------------
!
END MODULE division
......@@ -59,12 +59,6 @@
sigmar_all(:,:), &! To store sigmar, sigmai and zi globally
sigmai_all(:,:), &!
sigmai_mode(:,:,:), &!
Fi_all(:,:,:,:), &!
F_current(:,:,:,:), &!
F_SERTA(:,:,:,:), &!
Fi_allcb(:,:,:,:), &!
F_currentcb(:,:,:,:), &!
F_SERTAcb(:,:,:,:), &!
zi_all(:,:), &!
esigmar_all(:,:,:), &!
esigmai_all(:,:,:), &!
......@@ -100,8 +94,6 @@
igkq(:), &! Index for k+q+G vector
igk_k_all(:,:), &! Global index (in case of parallel)
ngk_all(:), &! Global number of plane wave for each global k-point
s_BZtoIBZ(:,:,:), &! Save the symmetry operation that brings BZ k into IBZ
BZtoIBZ(:), &! Map between the full uniform k-grid and the IBZ
map_rebal(:), &! Map between the k-point and their load rebalanced one
map_rebal_inv(:) ! Map between the k-point and their load rebalanced one
INTEGER, allocatable :: &
......
......@@ -60,7 +60,7 @@
USE mp, ONLY : mp_barrier, mp_bcast, mp_put,mp_sum
USE kinds, ONLY : DP
USE io_global, ONLY : stdout
USE wavefunctions, ONLY: evc
USE wavefunctions, ONLY : evc
USE io_files, ONLY : diropn, seqopn
USE wvfct, ONLY : npwx
USE pwcom, ONLY : current_spin, isk, lsda, nbnd, xk, nks
......@@ -82,7 +82,8 @@
USE constants_epw, ONLY : czero, cone, ci
USE control_flags, ONLY : iverbosity
USE klist, ONLY : nkstot
USE noncollin_module, ONLY : noncolin, npol, nspin_mag
USE division, ONLY : kpointdivision, fkbounds, fkbounds_bnd
USE noncollin_module, ONLY : noncolin, npol, nspin_mag
!
implicit none
!
......
This diff is collapsed.
This diff is collapsed.
......@@ -30,6 +30,7 @@
USE epwcom, ONLY : filukk, eliashberg, ep_coupling, epwread, epbread, cumulant
USE environment, ONLY : environment_start
USE elph2, ONLY : elph
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]]
!
......@@ -158,7 +159,7 @@ write(stdout,'(a)') "
!
! ... Close the files
!
CALL close_epw()
CALL close_final()
!
ENDIF
!
......
......@@ -59,7 +59,7 @@
scattering_0rta, longrange, shortrange, scatread, &
restart_filq, prtgkk, nel, meff, epsiHEG, lphase, &
omegamin, omegamax, omegastep, n_r, lindabs, &
mob_maxiter, use_ws
mob_maxiter, use_ws, epmatkqread, selecqread
USE elph2, ONLY : elph
USE start_k, ONLY : nk1, nk2, nk3
USE constants_epw, ONLY : ryd2mev, ryd2ev, ev2cmm1, kelvin2eV
......@@ -104,7 +104,7 @@
filukk, filukq, epbread, epbwrite, epwread, epwwrite, etf_mem, kmaps, &
eig_read, wepexst, epexst, vme, &
degaussw, fsthick, eptemp, nsmear, delta_smear, &
dvscf_dir, ngaussw, &
dvscf_dir, ngaussw, epmatkqread, selecqread, &
wannierize, dis_win_max, dis_win_min, dis_froz_min, dis_froz_max, &
num_iter, proj, bands_skipped, wdata, iprint, write_wfn, &
wmin, wmax, nw, eps_acustic, a2f, nest_fn, plselfen, &
......@@ -285,6 +285,8 @@
! lphase : If .true., fix the gauge on the phonon eigenvectors and electronic eigenvectors - DS
! mob_maxiter : Maximum number of iteration for the IBTE.
! use_ws : If .true., use the Wannier-center to create the Wigner-Seitz cell.
! epmatkqread : If .true., restart an IBTE calculation from scattering written to files.
! selecqread : If .true., restart from the selecq.fmt file
!
! Added by Manos Kioupakis
! omegamin : Photon energy minimum
......@@ -482,6 +484,8 @@
lindabs = .false.
mob_maxiter= 50
use_ws = .false.
epmatkqread = .false.
selecqread = .false.
!
! reading the namelist inputepw
!
......
......@@ -248,6 +248,10 @@
!! if .true., perform phonon-assisted absorption calculations
LOGICAL :: use_ws
!! if .true., use Wannier-centers to compute the Wigner-Seitz cell.
LOGICAL :: epmatkqread
!! if .true., restart and IBTE calculation from the scattering rates written to files.
LOGICAL :: selecqread
!! if .true., restart from the selecq.fmt file
!
! Superconductivity
LOGICAL :: ephwrite
......
......@@ -766,6 +766,7 @@
USE mp_global, ONLY : inter_pool_comm, npool
USE mp_world, ONLY : mpime
USE mp, ONLY : mp_bcast, mp_barrier, mp_sum
USE division, ONLY : fkbounds
!
IMPLICIT NONE
!
......@@ -1052,6 +1053,7 @@
USE constants_epw, ONLY : ryd2ev, zero
USE mp, ONLY : mp_barrier, mp_bcast, mp_sum
USE mp_global, ONLY : inter_pool_comm, npool
USE division, ONLY : fkbounds
!
IMPLICIT NONE
!
......@@ -1200,7 +1202,7 @@
END SUBROUTINE read_ephmat
!
!-----------------------------------------------------------------------
SUBROUTINE write_ephmat( iq )
SUBROUTINE write_ephmat( iqq, iq, totq )
!-----------------------------------------------------------------------
!!
!! This subroutine writes the elph matrix elements in a format required
......@@ -1220,17 +1222,22 @@
efermi_read, fermi_energy
USE pwcom, ONLY : ef
USE elph2, ONLY : etf, ibndmin, ibndmax, nkqf, epf17, wkf, nkf, &
nqtotf, wf, xqf, nkqtotf, efnew
wf, xqf, nkqtotf, efnew
USE eliashbergcom, ONLY : equivk, nkfs, ekfs, wkfs, xkfs, dosef, ixkf, ixkqf, nbndfs
USE superconductivity, ONLY : mem_size_eliashberg, mem_integer_size_eliashberg
USE constants_epw, ONLY : ryd2ev, two
USE mp, ONLY : mp_barrier, mp_sum
USE mp_global, ONLY : inter_pool_comm, my_pool_id, npool
USE division, ONLY : fkbounds
!
IMPLICIT NONE
!
INTEGER, INTENT (in) :: iqq
!! Current q-points from selecq
INTEGER, INTENT (in) :: iq
!! Current q-points
INTEGER, INTENT (in) :: totq
!! Total number of q-point from selecq
!
! Local variables
!
......@@ -1273,9 +1280,9 @@
! write phonon frequencies to file
IF ( my_pool_id == 0 ) THEN
filfreq = trim(tmp_dir) // trim(prefix) // '.freq'
IF ( iq .eq. 1 ) THEN
IF ( iqq == 1 ) THEN
OPEN(iufilfreq, file = filfreq, form = 'unformatted')
WRITE(iufilfreq) nqtotf, nmodes
WRITE(iufilfreq) totq, nmodes
WRITE(iufilfreq) xqf(1,iq), xqf(2,iq), xqf(3,iq)
DO imode = 1, nmodes
WRITE(iufilfreq) wf(imode,iq)
......@@ -1312,7 +1319,7 @@
nkftot = nkqtotf / 2
CALL fkbounds( nkftot, lower_bnd, upper_bnd )
!
IF (iq.eq.1) THEN
IF (iqq == 1) THEN
!
! find fermicount - nr of k-points within the Fermi shell per pool
! for mp_mesh_k=true. femicount is the nr of irreducible k-points within the Fermi shell per pool
......@@ -1360,7 +1367,7 @@
CLOSE(iufilegnv)
ENDIF
!
ENDIF ! iq
ENDIF ! iqq
!
! write the e-ph matrix elements in the Bloch representation on the fine mesh
! in .ephmat files (one for each pool)
......@@ -1371,14 +1378,14 @@
#else
filephmat = trim(tmp_dir) // trim(prefix) // '.ephmat'
#endif
IF ( iq .eq. 1 ) THEN
IF ( iqq == 1 ) THEN
OPEN(iufileph, file = filephmat, form = 'unformatted')
ELSE
OPEN(iufileph, file = filephmat, position='append', form = 'unformatted')
ENDIF
!
!IF ( iq .eq. 1 ) WRITE(iufileph,'(2i7)') my_pool_id+1, fermicount
IF ( iq .eq. 1 ) WRITE(iufileph) my_pool_id+1, fermicount
IF ( iqq == 1 ) WRITE(iufileph) my_pool_id+1, fermicount
!
! nkf - nr of k-points in the pool (fine mesh)
! for mp_mesh_k = true nkf is nr of irreducible k-points in the pool
......@@ -1428,7 +1435,7 @@
ENDDO ! ik's
CLOSE(iufileph)
!
IF ( iq .eq. nqtotf ) THEN
IF ( iqq == totq ) THEN
IF ( ALLOCATED(ekfs) ) DEALLOCATE(ekfs)
IF ( ALLOCATED(wkfs) ) DEALLOCATE(wkfs)
IF ( ALLOCATED(xkfs) ) DEALLOCATE(xkfs)
......@@ -1441,7 +1448,7 @@
CALL mem_size_eliashberg( -imelt )
!
! remove memory allocated for ixkqf
imelt = nqtotf * nkfs
imelt = totq * nkfs
CALL mem_integer_size_eliashberg( -imelt )
!