Commit 51bf9063 authored by Henning Janssen's avatar Henning Janssen

Removed unnecessary debug output from kk_cutoff; Moved other output to debug version

parent 2149fee1
......@@ -3,7 +3,7 @@ greensf/greensfImag.f90
greensf/greensfImag21.f90
greensf/onsite.f90
greensf/kkintgr.f90
greensf/kk_cutoff.f90
greensf/kk_cutoff.F90
greensf/gfcalc.F90
greensf/crystalfield.f90
greensf/j0.f90
......
......@@ -6,8 +6,6 @@ MODULE m_kk_cutoff
IMPLICIT NONE
LOGICAL, PARAMETER :: l_debug=.FALSE.
CONTAINS
SUBROUTINE kk_cutoff(im,noco,l,jspins,ne,del,e_bot,e_top,cutoff)
......@@ -45,16 +43,17 @@ MODULE m_kk_cutoff
fDOS = -1/pi_const*fDOS
IF(l_debug) THEN
DO ispin = 1, jspins
WRITE(filename,9010) ispin
OPEN(unit=1337,file=filename,status="replace")
DO i = 1, ne
WRITE(1337,"(2f14.8)") (i-1)*del+e_bot,fDOS(i,ispin)
ENDDO
CLOSE(unit=1337)
ENDDO
ENDIF
!#ifdef CPP_DEBUG
!DO ispin = 1, jspins
! WRITE(filename,9010) ispin
!9010 FORMAT("fDOS",I1)
! OPEN(unit=1337,file=filename,status="replace")
! DO i = 1, ne
! WRITE(1337,"(2f14.8)") (i-1)*del+e_bot,fDOS(i,ispin)
! ENDDO
! CLOSE(unit=1337)
!ENDDO
!#endif
spins_cut = MERGE(1,jspins,noco%l_noco.AND.noco%l_mperp)
n_states = (2*l+1) * MERGE(2.0,2.0/jspins,noco%l_noco.AND.noco%l_mperp)
......@@ -69,12 +68,21 @@ MODULE m_kk_cutoff
!----------------------------------------
IF(spins_cut.EQ.1.AND.jspins.EQ.2) fDOS(:,1) = fDOS(:,1) + fDOS(:,2)
integral = trapz(fDOS(:,ispin),del,ne)
IF(l_debug) WRITE(*,*) "Integral over DOS: ", integral
#ifdef CPP_DEBUG
WRITE(*,*) "Integral over DOS: ", integral
#endif
IF(integral.LT.n_states) THEN
!If we are calculating the greens function for a d-band this is expected to happen
IF(l.EQ.2) THEN
scale = (2*l+1)/integral
IF(l_debug) WRITE(*,9000) l,ispin,scale
#ifdef CPP_DEBUG
WRITE(*,9000) l,ispin,scale
9000 FORMAT("Scaling the DOS for l=",I1," and spin ",I1," factor: ",f14.8)
#endif
IF(scale.GT.1.25) CALL juDFT_warn("scaling factor >1.25 -> increase elup(<1htr) or numbands",calledby="kk_cutoff")
im(:,-l:l,-l:l,ispin) = scale * im(:,-l:l,-l:l,ispin)
ELSE IF(integral.LT.n_states-0.1) THEN
......@@ -103,17 +111,14 @@ MODULE m_kk_cutoff
ENDDO
IF(l_debug) THEN
WRITE(*,*) "CALCULATED CUTOFF: ", cutoff(ispin,2)
WRITE(*,*) "CORRESPONDING ENERGY", e_cut
WRITE(*,*) "INTEGRAL OVER fDOS with cutoff: ", integral
ENDIF
#ifdef CPP_DEBUG
WRITE(*,*) "CALCULATED CUTOFF: ", cutoff(ispin,2)
WRITE(*,*) "CORRESPONDING ENERGY", e_cut
WRITE(*,*) "INTEGRAL OVER fDOS with cutoff: ", integral
#endif
IF(spins_cut.EQ.1.AND.jspins.EQ.2) cutoff(2,2) = cutoff(1,2)
ENDIF
ENDDO
9000 FORMAT("Scaling the DOS for l=",I1," and spin ",I1," factor: ",f14.8)
9010 FORMAT("fDOS",I1)
END SUBROUTINE kk_cutoff
END MODULE m_kk_cutoff
\ No newline at end of file
END MODULE m_kk_cutoff
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