! !----------------------------------------------------------------------- subroutine fermiwindow !----------------------------------------------------------------------- ! ! find the band indices of the first ! and last state falling within the window e_fermi+-efermithickness ! !----------------------------------------------------------------------- ! #include "f_defs.h" ! USE kinds, only : DP USE io_global, ONLY : stdout use el_phon, only : etf, ibndmin, ibndmax, nksf use phcom, only : fsthick, nbndsub use pwcom, only : ef use control_flags, ONLY : iverbosity #ifdef __PARA use para #endif implicit none integer :: ik, ibnd, jbnd, ik0, mbnd, pbnd, i real(kind=DP) :: tmp, ebnd, ebndmin, ebndmax ! ! ibndmin = 100000 ibndmax = 0 ebndmin = 1.d8 ebndmax = -1.d8 ! do ik = 1, nksf do ibnd = 1, nbndsub ebnd = etf (ibnd, ik) ! if ( abs(ebnd - ef) .lt. fsthick ) then ibndmin = min(ibnd,ibndmin) ibndmax = max(ibnd,ibndmax) ebndmin = min(ebnd,ebndmin) ebndmax = max(ebnd,ebndmax) endif ! enddo enddo ! #ifdef __PARA tmp = float (ibndmin) call poolextreme( tmp, -1 ) ibndmin = nint (tmp) call poolextreme( ebndmin, -1 ) ! tmp = float (ibndmax) call poolextreme( tmp, +1 ) ibndmax = nint (tmp) call poolextreme( ebndmax, +1 ) #endif ! if (iverbosity.eq.1) then write(stdout,'(/14x,a,i5,2x,a,f9.3)') 'ibndmin = ', ibndmin, 'ebndmin = ', ebndmin write(stdout,'(14x,a,i5,2x,a,f9.3/)') 'ibndmax = ', ibndmax, 'ebndmax = ', ebndmax endif ! return end subroutine fermiwindow !