Commit f204e127 authored by Henning Janssen's avatar Henning Janssen

Some cleanup replace some 2*pi_const by corresponding tpi_const

parent d42a5b4c
......@@ -51,29 +51,31 @@ MODULE m_gfDOS
DO ipm = 1, 2 !Sum over G^+ and G^-
!Get the full gf matrix at the energy point
CALL g%get_gf(gmat,atoms,input,iz,l,nType,ipm.EQ.2)
!Convert to eV^-1
gmat%data_c = gmat%data_c/hartree_to_eV_const
!Calculate up/down dos
DO i = 1, ns
dos(1,i) = dos(1,i) - 1.0/(2*pi_const*hartree_to_eV_const) * (-1)**(ipm-1) * gmat%data_c(i,i)
dos(1,i) = dos(1,i) - 1.0/tpi_const * (-1)**(ipm-1) * gmat%data_c(i,i)
ENDDO
DO i = ns+1, 2*ns
dos(2,i-ns) = dos(2,i-ns) - 1.0/(2*pi_const*hartree_to_eV_const) * (-1)**(ipm-1) * gmat%data_c(i,i)
dos(2,i-ns) = dos(2,i-ns) - 1.0/tpi_const * (-1)**(ipm-1) * gmat%data_c(i,i)
ENDDO
!Transform to |J,mj> basis
jmat%data_c = matmul(gmat%data_c,cmat%data_r)
jmat%data_c = matmul(transpose(cmat%data_r),jmat%data_c)
!Calculate low/high dos
DO i = 1, ns-1
dos(3,i) = dos(3,i) - 1.0/(2*pi_const*hartree_to_eV_const) * (-1)**(ipm-1) * jmat%data_c(i,i)
dos(3,i) = dos(3,i) - 1.0/tpi_const * (-1)**(ipm-1) * jmat%data_c(i,i)
ENDDO
DO i = ns, 2*ns
dos(4,i-ns+1) = dos(4,i-ns+1) - 1.0/(2*pi_const*hartree_to_eV_const) * (-1)**(ipm-1) * jmat%data_c(i,i)
dos(4,i-ns+1) = dos(4,i-ns+1) - 1.0/tpi_const * (-1)**(ipm-1) * jmat%data_c(i,i)
ENDDO
!Real part
DO i = 1, ns
re(1) = re(1) - 1.0/(2*pi_const*hartree_to_eV_const) * gmat%data_c(i,i)
re(1) = re(1) - 1.0/tpi_const * gmat%data_c(i,i)
ENDDO
DO i = ns+1, 2*ns
re(2) = re(2) - 1.0/(2*pi_const*hartree_to_eV_const) * gmat%data_c(i,i)
re(2) = re(2) - 1.0/tpi_const* gmat%data_c(i,i)
ENDDO
CALL gmat%free()
ENDDO
......
......@@ -50,7 +50,7 @@ MODULE m_hybridization
tr = tr + (-1)**(ipm-1) * gmat%data_c(i,i)
ENDDO
ENDDO
Delta(iz) = -1/(2.0*pi_const) * AIMAG(tr)
Delta(iz) = -1/(tpi_const*gmat%matsize1) * AIMAG(tr)
WRITE(1337,"(2f14.8)") REAL(gf%e(iz)), Delta(iz)
!Free up the gmat matrix (it is initialized in gf%get_gf)
CALL gmat%free()
......
MODULE m_ind_greensf
!--------------------------------------------------------------------
! The information on which index i_gf in the green's function arrays
! corresponds to which (l,lp,nType,nTypep) block of the system is stored
! in the gfelem array in atoms
! This fucntion returns the index i_gf by supplying the four indices
! If lp or nTypep are not given in the call they are assumed to be equal
! to l/nType
!--------------------------------------------------------------------
CONTAINS
......@@ -28,39 +36,29 @@ CONTAINS
DO WHILE(search)
i_gf = i_gf + 1
IF(atoms%gfelem(i_gf)%l.EQ.l.AND.atoms%gfelem(i_gf)%atomType.EQ.nType) THEN
IF(PRESENT(lp).OR.PRESENT(nTypep)) THEN
!Check second l-argument
IF(PRESENT(lp)) THEN
IF(atoms%gfelem(i_gf)%lp.EQ.lp) THEN
search = .FALSE.
ELSE
search = .TRUE.
ENDIF
ELSE IF(atoms%gfelem(i_gf)%lp.EQ.l) THEN
search = .FALSE.
ELSE
search = .TRUE.
ENDIF
!check second type argument
IF(PRESENT(nTypep)) THEN
IF(atoms%gfelem(i_gf)%atomTypep.EQ.nTypep) THEN
search = .FALSE.
ELSE
search = .TRUE.
ENDIF
ELSE IF(atoms%gfelem(i_gf)%atomTypep.EQ.nType) THEN
search = .FALSE.
ELSE
search = .TRUE.
ENDIF
ELSE IF(atoms%gfelem(i_gf)%lp.EQ.l.AND.atoms%gfelem(i_gf)%atomTypep.EQ.nType) THEN
search = .FALSE.
ENDIF
ENDIF
IF(search.AND.i_gf.EQ.atoms%n_gf) THEN
IF(i_gf.GT.atoms%n_gf) THEN
!Something went wrong here
CALL juDFT_error("Greens function element not found", calledby="ind_greensf")
ENDIF
!--------------------------------------------
! Check the current element
!--------------------------------------------
IF(atoms%gfelem(i_gf)%l.NE.l) CYCLE
IF(atoms%gfelem(i_gf)%atomType.NE.nType) CYCLE
IF(PRESENT(lp)) THEN
IF(atoms%gfelem(i_gf)%lp.NE.lp) CYCLE
ELSE
IF(atoms%gfelem(i_gf)%lp.NE.l) CYCLE
ENDIF
IF(PRESENT(nTypep)) THEN
IF(atoms%gfelem(i_gf)%atomTypep.NE.nTypep) CYCLE
ELSE
IF(atoms%gfelem(i_gf)%atomTypep.NE.nType) CYCLE
ENDIF
!If we are here we found the element
search = .FALSE.
ENDDO
END FUNCTION ind_greensf
......
......@@ -16,7 +16,9 @@ MODULE m_lsTOjmj
INTEGER jj,j,mj,s,ml,i,k
IF(.NOT.ALLOCATED(cmat%data_r)) CALL juDFT_error("matrix not initialized",calledby="lsTOjmj")
IF(.NOT.ALLOCATED(cmat%data_r)) THEN
CALL cmat%init(.TRUE.,2*(2*l+1),2*(2*l+1))
ENDIF
!Calculate the matrix of CG-coefficients to transform from |l,ml,ms> to |j=l\pm1/2,mjz>
!compare utils/occup.f90 from libedsolver
......
......@@ -70,7 +70,7 @@ CONTAINS
ind2 = 0
DO mp = -lp_loop,lp_loop
ind2 = ind2 + 1
mmpMat(m,mp,ispin) = mmpMat(m,mp,ispin) - 1/(2.0*pi_const*ImagUnit) * (-1)**(ipm-1) * gmat%data_c(ind1,ind2) &
mmpMat(m,mp,ispin) = mmpMat(m,mp,ispin) + ImagUnit/tpi_const * (-1)**(ipm-1) * gmat%data_c(ind1,ind2) &
* MERGE(g%de(iz),conjg(g%de(iz)),ipm.EQ.1)
ENDDO
ENDDO
......@@ -86,7 +86,7 @@ CONTAINS
ind2 = 0
DO mp = -lp_loop,lp_loop
ind2 = ind2 + 1
mmpMat(m,mp,ispin) = mmpMat(m,mp,ispin) - 1/(2.0*pi_const) * gmat%data_c(ind1,ind2) &
mmpMat(m,mp,ispin) = mmpMat(m,mp,ispin) - 1/tpi_const * gmat%data_c(ind1,ind2) &
* MERGE(g%de(1),conjg(g%de(1)),ipm.EQ.1)
ENDDO
ENDDO
......@@ -99,7 +99,7 @@ CONTAINS
ind2 = 0
DO mp = -lp_loop,lp_loop
ind2 = ind2 + 1
mmpMat(m,mp,ispin) = mmpMat(m,mp,ispin) + 1/(2.0*pi_const) * gmat%data_c(ind1,ind2) &
mmpMat(m,mp,ispin) = mmpMat(m,mp,ispin) + 1/tpi_const * gmat%data_c(ind1,ind2) &
* MERGE(g%de(g%nz),conjg(g%de(g%nz)),ipm.EQ.1)
ENDDO
ENDDO
......
......@@ -181,7 +181,7 @@ SUBROUTINE postprocessInput(mpi,input,field,sym,stars,atoms,vacuum,obsolete,kpts
IF (atoms%nlo(n).GE.1) THEN
DO j = 1, atoms%nlo(n)
IF ((ABS(atoms%llo(j,n)).EQ.l) .AND. (.NOT.atoms%l_dulo(j,n)) ) &
WRITE (*,*) 'LO and LDA+Hubbard1 for same l not implemented'
WRITE (*,*) 'LO and LDA+Hubbard1 for same l not implemented/tested'
END DO
END IF
END DO
......
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