Commit a8f48812 authored by Matthias Redies's avatar Matthias Redies

remove unused routine

parent 413c00ad
......@@ -411,121 +411,4 @@ CONTAINS
wfolap2 = wfolap2 + dot_product(cpw1, matmul(olappw, cpw2))
END FUNCTION wfolap2
! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
! Calculates overlap between core and valence wavefunctions
SUBROUTINE olap_cv(hybrid, kpts, maxlcutc, maxindxc, atoms,&
& lmaxc, lmaxcd, nindxc,&
& core1, core2, bas1, bas2, cmt, dimension,&
& gridf)
USE m_util, ONLY: intgrf, intgrf_init, chr
USE m_types
IMPLICIT NONE
TYPE(t_dimension), INTENT(IN) :: dimension
TYPE(t_hybrid), INTENT(IN) :: hybrid
TYPE(t_kpts), INTENT(IN) :: kpts
TYPE(t_atoms), INTENT(IN) :: atoms
! - scalars -
INTEGER, INTENT(IN) :: maxlcutc, maxindxc, lmaxcd
! - arrays -
INTEGER, INTENT(IN) :: lmaxc(atoms%ntype)
INTEGER, INTENT(IN) :: nindxc(0:maxlcutc, atoms%ntype)
REAL, INTENT(IN) :: core1(atoms%jmtd, 0:lmaxcd, maxindxc, atoms%ntype),&
& core2(atoms%jmtd, 0:lmaxcd, maxindxc, atoms%ntype)
REAL, INTENT(IN) :: bas1(atoms%jmtd, hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype),&
& bas2(atoms%jmtd, hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype)
COMPLEX, INTENT(IN) :: cmt(dimension%neigd, kpts%nkpt, hybrid%maxlmindx, atoms%nat)
! - local scalars -
INTEGER :: itype, icent, l, m, lm, i, j
! - local arrays -
INTEGER, ALLOCATABLE :: olapcv_loc(:, :, :, :, :)
REAL, ALLOCATABLE :: gridf(:, :)
REAL, ALLOCATABLE :: olapcb(:)
REAL, ALLOCATABLE :: olapcv_avg(:, :, :, :), olapcv_max(:, :, :, :)
COMPLEX, ALLOCATABLE :: olapcv(:, :)
CHARACTER, PARAMETER :: lchar(0:38) =&
& (/'s', 'p', 'd', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',&
& 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x',&
& 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'/)
! CALL intgrf_init(ntype,jmtd,jri,dx,rmsh,gridf)
WRITE (6, '(/A)') 'Overlap <core|basis>'
ALLOCATE (olapcb(hybrid%maxindx), olapcv(dimension%neigd, kpts%nkpt),&
& olapcv_avg(-maxlcutc:maxlcutc, maxindxc, 0:maxlcutc, atoms%ntype),&
& olapcv_max(-maxlcutc:maxlcutc, maxindxc, 0:maxlcutc, atoms%ntype),&
& olapcv_loc(2, -maxlcutc:maxlcutc, maxindxc, 0:maxlcutc, atoms%ntype))
DO itype = 1, atoms%ntype
IF (atoms%ntype > 1) WRITE (6, '(A,I3)') 'Atom type', itype
DO l = 0, lmaxc(itype)
IF (l > atoms%lmax(itype)) THEN
WRITE (*, *) 'l greater then atoms%lmax(itype)'
EXIT ! very improbable case
END IF
! WRITE(6,8001) (lchar(l),i=1,min(3,nindx(l,itype)))
DO i = 1, nindxc(l, itype)
WRITE (6, '(I1,A,2X)', advance='no') i + l, lchar(l)
DO j = 1, hybrid%nindx(l, itype)
olapcb(j) = intgrf(core1(:, l, i, itype)*bas1(:, j, l, itype) +&
& core2(:, l, i, itype)*bas2(:, j, l, itype),&
& atoms%jri, atoms%jmtd, atoms%rmsh, atoms%dx, atoms%ntype, itype, gridf)
WRITE (6, '(F10.6)', advance='no') olapcb(j)
ENDDO
lm = sum((/(hybrid%nindx(j, itype)*(2*j + 1), j=0, l - 1)/))
icent = sum(atoms%neq(1:itype - 1)) + 1 ! take first of group of equivalent atoms
DO M = -l, l
olapcv = 0
DO j = 1, hybrid%nindx(l, itype)
lm = lm + 1
olapcv(:, :) = olapcv(:, :) + olapcb(j)*cmt(:, :, lm, icent)
END DO
olapcv_avg(M, i, l, itype) = sqrt(sum(abs(olapcv(:, :))**2)&
& /kpts%nkpt/dimension%neigd)
olapcv_max(M, i, l, itype) = maxval(abs(olapcv(:, :)))
olapcv_loc(:, M, i, l, itype) = maxloc(abs(olapcv(:, :)))
END DO
WRITE (6, *)
END DO
END DO
END DO
WRITE (6, '(/A)') 'Average overlap <core|val>'
DO itype = 1, atoms%ntype
IF (atoms%ntype > 1) write (6, '(A,I3)') 'Atom type', itype
DO l = 0, lmaxc(itype)
DO i = 1, nindxc(l, itype)
WRITE (6, '(I1,A,2X)', advance='no') i + l, lchar(l)
WRITE (6, '('//chr(2*l + 1)//'F10.6)') olapcv_avg(-l:l, i, l, itype)
END DO
END DO
END DO
WRITE (6, '(/A)') 'Maximum overlap <core|val> at (band/kpoint)'
DO itype = 1, atoms%ntype
IF (atoms%ntype > 1) write (6, '(A,I3)') 'Atom type', itype
DO l = 0, lmaxc(itype)
DO i = 1, nindxc(l, itype)
WRITE (6, '(I1,A,2X)', advance='no') i + l, lchar(l)
WRITE (6, '('//chr(2*l + 1)//&
& '(F10.6,'' ('',I3.3,''/'',I4.3,'')''))')&
& (olapcv_max(M, i, l, itype),&
& olapcv_loc(:, M, i, l, itype), M=-l, l)
END DO
END DO
END DO
DEALLOCATE (olapcb, olapcv, olapcv_avg, olapcv_max, olapcv_loc)
END SUBROUTINE olap_cv
END MODULE m_olap
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