int_21lo.f90 2.95 KB
Newer Older
1 2 3 4 5 6 7 8
MODULE m_int21lo
  !-----------------------------------------------------------
  !
  ! Integrates combinations of flo(:,:,llo,s) with itself, f(:,:,l,s) 
  ! and g(:,:,l,s) (s=1,2) for given llo and itype with different 
  ! spins (s).
  ! Output is ..n21(l,itype), where .. is a combination of (u,d) and
  ! ulo dependent on the (f,g) combination used. Also ..n12 and 
9
  ! uloulop21n are calculated.
10 11 12
  !
  !-----------------------------------------------------------
CONTAINS
13
  SUBROUTINE int_21lo(f,g,atoms,n,flo,ilo,uulo21n,ulou21n,dulo21n,ulod21n,uloulop21n)
14 15

    USE m_intgr, ONLY : intgr3
16
    USE m_types_setup
17
    IMPLICIT NONE
18 19 20 21 22 23
    TYPE(t_atoms),             INTENT(IN)    :: atoms
    REAL,                      INTENT(INOUT) :: uulo21n(atoms%nlod,atoms%ntype)
    REAL,                      INTENT(INOUT) :: ulou21n(atoms%nlod,atoms%ntype)
    REAL,                      INTENT(INOUT) :: dulo21n(atoms%nlod,atoms%ntype)
    REAL,                      INTENT(INOUT) :: ulod21n(atoms%nlod,atoms%ntype)
    REAL,                      INTENT(INOUT) :: uloulop21n(atoms%nlod,atoms%nlod,atoms%ntype)
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
    !     ..
    !     .. Scalar Arguments ..
    INTEGER, INTENT (IN) :: ilo,n
    !     ... Array Arguments
    REAL,    INTENT (IN) :: f(:,:,0:,:)!(atoms%jmtd,2,0:atoms%lmaxd,dimension%jspd)
    REAL,    INTENT (IN) :: g(:,:,0:,:)!(atoms%jmtd,2,0:atoms%lmaxd,dimension%jspd)
    REAL,    INTENT (IN) :: flo(:,:,:,:)!(atoms%jmtd,2,atoms%nlod,dimension%jspd)

    !     ...local scalars
    INTEGER iri,l,lp,ilop
    !     ...local arrays
    REAL    uu_tmp(atoms%jri(n))

    !
    ! --> norm of product of u and ulo:
    !
    l = atoms%llo(ilo,n)
    DO iri = 1, atoms%jri(n)
       uu_tmp(iri) = f(iri,1,l,2)*flo(iri,1,ilo,1)+ f(iri,2,l,2)*flo(iri,2,ilo,1)
    ENDDO
44
    CALL intgr3(uu_tmp,atoms%rmsh(:,n),atoms%dx(n),atoms%jri(n),uulo21n(ilo,n))
45 46 47
    DO iri = 1, atoms%jri(n)
       uu_tmp(iri) = f(iri,1,l,1)*flo(iri,1,ilo,2)+ f(iri,2,l,1)*flo(iri,2,ilo,2)
    ENDDO
48
    CALL intgr3(uu_tmp,atoms%rmsh(:,n),atoms%dx(n),atoms%jri(n),ulou21n(ilo,n))
49 50 51 52 53 54
    !
    ! --> norm of product of du and ulo:
    !
    DO iri = 1, atoms%jri(n)
       uu_tmp(iri) = g(iri,1,l,2)*flo(iri,1,ilo,1) + g(iri,2,l,2)*flo(iri,2,ilo,1)
    ENDDO
55
    CALL intgr3(uu_tmp,atoms%rmsh(:,n),atoms%dx(n),atoms%jri(n),dulo21n(ilo,n))
56 57 58
    DO iri = 1, atoms%jri(n)
       uu_tmp(iri) = g(iri,1,l,1)*flo(iri,1,ilo,2) + g(iri,2,l,1)*flo(iri,2,ilo,2)
    ENDDO
59
    CALL intgr3(uu_tmp,atoms%rmsh(:,n),atoms%dx(n),atoms%jri(n),ulod21n(ilo,n))
60 61 62 63 64 65 66 67 68
    !
    ! --> norm of product of ulo and ulo':
    !
    DO ilop = 1, atoms%nlo(n)
       lp = atoms%llo(ilop,n)
       IF (l.EQ.lp) THEN
          DO iri = 1, atoms%jri(n)
             uu_tmp(iri) = flo(iri,1,ilo,2)*flo(iri,1,ilop,1) + flo(iri,2,ilo,2)*flo(iri,2,ilop,1)
          ENDDO
69
          CALL intgr3(uu_tmp,atoms%rmsh(:,n),atoms%dx(n),atoms%jri(n),uloulop21n(ilo,ilop,n))
70 71

       ELSE
72
          uloulop21n(ilo,ilop,n) = 0.0
73 74 75 76 77
       ENDIF
    ENDDO

  END SUBROUTINE int_21lo
END MODULE m_int21lo