LCOV - code coverage report
Current view: top level - types - types_denCoeffsOffdiag.f90 (source / functions) Hit Total Coverage
Test: FLEUR test coverage Lines: 77 87 88.5 %
Date: 2024-03-29 04:21:46 Functions: 2 5 40.0 %

          Line data    Source code
       1             : !--------------------------------------------------------------------------------
       2             : ! Copyright (c) 2018 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
       3             : ! This file is part of FLEUR and available as free software under the conditions
       4             : ! of the MIT license as expressed in the LICENSE file in more detail.
       5             : !--------------------------------------------------------------------------------
       6             : 
       7             : MODULE m_types_denCoeffsOffdiag
       8             : 
       9             : IMPLICIT NONE
      10             : 
      11             : PRIVATE
      12             : 
      13             :    TYPE t_denCoeffsOffdiag
      14             :       LOGICAL              :: l_fmpl
      15             : 
      16             :       ! spherical
      17             :       COMPLEX, ALLOCATABLE :: uu21(:,:)
      18             :       COMPLEX, ALLOCATABLE :: dd21(:,:)
      19             :       COMPLEX, ALLOCATABLE :: du21(:,:)
      20             :       COMPLEX, ALLOCATABLE :: ud21(:,:)
      21             : 
      22             :       ! nonspherical
      23             :       COMPLEX, ALLOCATABLE :: uunmt21(:,:,:)
      24             :       COMPLEX, ALLOCATABLE :: ddnmt21(:,:,:)
      25             :       COMPLEX, ALLOCATABLE :: dunmt21(:,:,:)
      26             :       COMPLEX, ALLOCATABLE :: udnmt21(:,:,:)
      27             : 
      28             :       ! spherical - LOs
      29             :       COMPLEX, ALLOCATABLE :: uulo21(:,:)
      30             :       COMPLEX, ALLOCATABLE :: dulo21(:,:)
      31             :       COMPLEX, ALLOCATABLE :: ulou21(:,:)
      32             :       COMPLEX, ALLOCATABLE :: ulod21(:,:)
      33             : 
      34             :       COMPLEX, ALLOCATABLE :: uloulop21(:,:,:)
      35             : 
      36             :       ! norms
      37             :       REAL, ALLOCATABLE     :: uu21n(:,:)
      38             :       REAL, ALLOCATABLE     :: ud21n(:,:)
      39             :       REAL, ALLOCATABLE     :: du21n(:,:)
      40             :       REAL, ALLOCATABLE     :: dd21n(:,:)
      41             : 
      42             :       REAL, ALLOCATABLE     :: uulo21n(:,:)
      43             :       REAL, ALLOCATABLE     :: dulo21n(:,:)
      44             :       REAL, ALLOCATABLE     :: ulou21n(:,:)
      45             :       REAL, ALLOCATABLE     :: ulod21n(:,:)
      46             : 
      47             :       REAL, ALLOCATABLE     :: uloulop21n(:,:,:)
      48             : 
      49             :       CONTAINS
      50             : 
      51             :       PROCEDURE,PASS :: init => denCoeffsOffdiag_init
      52             :       PROCEDURE      :: addRadFunScalarProducts
      53             :       PROCEDURE      :: calcCoefficients
      54             : 
      55             :    END TYPE t_denCoeffsOffdiag
      56             : 
      57             : PUBLIC t_denCoeffsOffdiag
      58             : 
      59             : CONTAINS
      60             : 
      61        1140 : SUBROUTINE denCoeffsOffdiag_init(thisDenCoeffsOffdiag, atoms, noco,sphhar,l_jDOS, l_fmpl)
      62             : 
      63             :    USE m_types_setup
      64             : 
      65             :    IMPLICIT NONE
      66             : 
      67             :    CLASS(t_denCoeffsOffdiag), INTENT(INOUT) :: thisDenCoeffsOffdiag
      68             :    TYPE(t_atoms),      INTENT(IN)    :: atoms
      69             :    TYPE(t_noco),       INTENT(IN)    :: noco
      70             :    TYPE(t_sphhar),     INTENT(IN)    :: sphhar
      71             :    LOGICAL,            INTENT(IN)    :: l_jDOS
      72             :    LOGICAL,            INTENT(IN)    :: l_fmpl
      73             : 
      74        1140 :    thisDenCoeffsOffdiag%l_fmpl = l_fmpl
      75             : 
      76        1140 :    IF (noco%l_mperp.OR.l_jDOS) THEN
      77         272 :       ALLOCATE (thisDenCoeffsOffdiag%uu21(0:atoms%lmaxd,atoms%ntype))
      78         204 :       ALLOCATE (thisDenCoeffsOffdiag%ud21(0:atoms%lmaxd,atoms%ntype))
      79         204 :       ALLOCATE (thisDenCoeffsOffdiag%du21(0:atoms%lmaxd,atoms%ntype))
      80         204 :       ALLOCATE (thisDenCoeffsOffdiag%dd21(0:atoms%lmaxd,atoms%ntype))
      81             : 
      82         272 :       ALLOCATE (thisDenCoeffsOffdiag%uulo21(atoms%nlod,atoms%ntype))
      83         204 :       ALLOCATE (thisDenCoeffsOffdiag%dulo21(atoms%nlod,atoms%ntype))
      84         204 :       ALLOCATE (thisDenCoeffsOffdiag%ulou21(atoms%nlod,atoms%ntype))
      85         204 :       ALLOCATE (thisDenCoeffsOffdiag%ulod21(atoms%nlod,atoms%ntype))
      86             : 
      87         340 :       ALLOCATE (thisDenCoeffsOffdiag%uloulop21(atoms%nlod,atoms%nlod,atoms%ntype))
      88             : 
      89         272 :       ALLOCATE (thisDenCoeffsOffdiag%uu21n(0:atoms%lmaxd,atoms%ntype))
      90         204 :       ALLOCATE (thisDenCoeffsOffdiag%ud21n(0:atoms%lmaxd,atoms%ntype))
      91         204 :       ALLOCATE (thisDenCoeffsOffdiag%du21n(0:atoms%lmaxd,atoms%ntype))
      92         204 :       ALLOCATE (thisDenCoeffsOffdiag%dd21n(0:atoms%lmaxd,atoms%ntype))
      93             : 
      94         272 :       ALLOCATE (thisDenCoeffsOffdiag%uulo21n(atoms%nlod,atoms%ntype))
      95         204 :       ALLOCATE (thisDenCoeffsOffdiag%dulo21n(atoms%nlod,atoms%ntype))
      96         204 :       ALLOCATE (thisDenCoeffsOffdiag%ulou21n(atoms%nlod,atoms%ntype))
      97         204 :       ALLOCATE (thisDenCoeffsOffdiag%ulod21n(atoms%nlod,atoms%ntype))
      98             : 
      99         340 :       ALLOCATE (thisDenCoeffsOffdiag%uloulop21n(atoms%nlod,atoms%nlod,atoms%ntype))
     100             :    ELSE
     101        1072 :       ALLOCATE (thisDenCoeffsOffdiag%uu21(1,1))
     102        1072 :       ALLOCATE (thisDenCoeffsOffdiag%ud21(1,1))
     103        1072 :       ALLOCATE (thisDenCoeffsOffdiag%du21(1,1))
     104        1072 :       ALLOCATE (thisDenCoeffsOffdiag%dd21(1,1))
     105             : 
     106        1072 :       ALLOCATE (thisDenCoeffsOffdiag%uulo21(1,1))
     107        1072 :       ALLOCATE (thisDenCoeffsOffdiag%dulo21(1,1))
     108        1072 :       ALLOCATE (thisDenCoeffsOffdiag%ulou21(1,1))
     109        1072 :       ALLOCATE (thisDenCoeffsOffdiag%ulod21(1,1))
     110             : 
     111        1072 :       ALLOCATE (thisDenCoeffsOffdiag%uloulop21(1,1,1))
     112             : 
     113        1072 :       ALLOCATE (thisDenCoeffsOffdiag%uu21n(1,1))
     114        1072 :       ALLOCATE (thisDenCoeffsOffdiag%ud21n(1,1))
     115        1072 :       ALLOCATE (thisDenCoeffsOffdiag%du21n(1,1))
     116        1072 :       ALLOCATE (thisDenCoeffsOffdiag%dd21n(1,1))
     117             : 
     118        1072 :       ALLOCATE (thisDenCoeffsOffdiag%uulo21n(1,1))
     119        1072 :       ALLOCATE (thisDenCoeffsOffdiag%dulo21n(1,1))
     120        1072 :       ALLOCATE (thisDenCoeffsOffdiag%ulou21n(1,1))
     121        1072 :       ALLOCATE (thisDenCoeffsOffdiag%ulod21n(1,1))
     122             : 
     123        1072 :       ALLOCATE (thisDenCoeffsOffdiag%uloulop21n(1,1,1))
     124             :    END IF
     125             : 
     126        1140 :    IF (noco%l_mperp.AND.l_fmpl) THEN ! TODO: Why not 0:(atoms%lmaxd+1)**2-1?
     127         290 :       ALLOCATE (thisDenCoeffsOffdiag%uunmt21((atoms%lmaxd+1)**2,sphhar%nlhd,atoms%ntype))
     128         232 :       ALLOCATE (thisDenCoeffsOffdiag%udnmt21((atoms%lmaxd+1)**2,sphhar%nlhd,atoms%ntype))
     129         232 :       ALLOCATE (thisDenCoeffsOffdiag%dunmt21((atoms%lmaxd+1)**2,sphhar%nlhd,atoms%ntype))
     130         232 :       ALLOCATE (thisDenCoeffsOffdiag%ddnmt21((atoms%lmaxd+1)**2,sphhar%nlhd,atoms%ntype))
     131             :    ELSE
     132        1082 :       ALLOCATE (thisDenCoeffsOffdiag%uunmt21(1,1,1))
     133        1082 :       ALLOCATE (thisDenCoeffsOffdiag%udnmt21(1,1,1))
     134        1082 :       ALLOCATE (thisDenCoeffsOffdiag%dunmt21(1,1,1))
     135        1082 :       ALLOCATE (thisDenCoeffsOffdiag%ddnmt21(1,1,1))
     136             :    END IF
     137             : 
     138        4212 :    thisDenCoeffsOffdiag%uu21 = CMPLX(0.0,0.0)
     139        4212 :    thisDenCoeffsOffdiag%ud21 = CMPLX(0.0,0.0)
     140        4212 :    thisDenCoeffsOffdiag%du21 = CMPLX(0.0,0.0)
     141        4212 :    thisDenCoeffsOffdiag%dd21 = CMPLX(0.0,0.0)
     142             : 
     143        3550 :    thisDenCoeffsOffdiag%uulo21 = CMPLX(0.0,0.0)
     144        3550 :    thisDenCoeffsOffdiag%dulo21 = CMPLX(0.0,0.0)
     145        3550 :    thisDenCoeffsOffdiag%ulou21 = CMPLX(0.0,0.0)
     146        3550 :    thisDenCoeffsOffdiag%ulod21 = CMPLX(0.0,0.0)
     147             : 
     148        4968 :    thisDenCoeffsOffdiag%uloulop21 = CMPLX(0.0,0.0)
     149             : 
     150        4212 :    thisDenCoeffsOffdiag%uu21n = 0.0
     151        4212 :    thisDenCoeffsOffdiag%ud21n = 0.0
     152        4212 :    thisDenCoeffsOffdiag%du21n = 0.0
     153        4212 :    thisDenCoeffsOffdiag%dd21n = 0.0
     154             : 
     155        3550 :    thisDenCoeffsOffdiag%uulo21n = 0.0
     156        3550 :    thisDenCoeffsOffdiag%dulo21n = 0.0
     157        3550 :    thisDenCoeffsOffdiag%ulou21n = 0.0
     158        3550 :    thisDenCoeffsOffdiag%ulod21n = 0.0
     159             : 
     160        4968 :    thisDenCoeffsOffdiag%uloulop21n = 0.0
     161             : 
     162      469024 :    thisDenCoeffsOffdiag%uunmt21 = CMPLX(0.0,0.0)
     163      469024 :    thisDenCoeffsOffdiag%udnmt21 = CMPLX(0.0,0.0)
     164      469024 :    thisDenCoeffsOffdiag%dunmt21 = CMPLX(0.0,0.0)
     165      469024 :    thisDenCoeffsOffdiag%ddnmt21 = CMPLX(0.0,0.0)
     166             : 
     167        1140 : END SUBROUTINE denCoeffsOffdiag_init
     168             : 
     169          92 : SUBROUTINE addRadFunScalarProducts(thisDenCoeffsOffdiag, atoms, f, g, flo, iType)
     170             : 
     171             :    USE m_types_setup
     172             :    USE m_int21       ! integrate (spin) off-diagonal radial functions
     173             :    USE m_int21lo     ! -"- for u_lo
     174             : 
     175             :    IMPLICIT NONE
     176             : 
     177             :    CLASS(t_denCoeffsOffdiag), INTENT(INOUT) :: thisDenCoeffsOffdiag
     178             :    TYPE(t_atoms),             INTENT(IN)    :: atoms
     179             :    REAL,                      INTENT(IN)    :: f(:,:,0:,:)!(atoms%jmtd,2,0:atoms%lmaxd,input%jspins)
     180             :    REAL,                      INTENT(IN)    :: g(:,:,0:,:)!(atoms%jmtd,2,0:atoms%lmaxd,input%jspins)
     181             :    REAL,                      INTENT(IN)    :: flo(:,:,:,:)!(atoms%jmtd,2,atoms%nlod,input%jspins)
     182             :    INTEGER,                   INTENT(IN)    :: iType
     183             : 
     184             :    INTEGER :: l, ilo
     185             : 
     186         928 :    DO l = 0,atoms%lmax(iType)
     187             :       CALL int_21(f,g,atoms,iType,l,thisDenCoeffsOffdiag%uu21n,thisDenCoeffsOffdiag%ud21n,&
     188         928 :                                     thisDenCoeffsOffdiag%du21n,thisDenCoeffsOffdiag%dd21n)
     189             :    END DO
     190         266 :    DO ilo = 1, atoms%nlo(iType)
     191             :       CALL int_21lo(f,g,atoms,iType,flo,ilo,thisDenCoeffsOffdiag%uulo21n,thisDenCoeffsOffdiag%ulou21n,&
     192             :                                             thisDenCoeffsOffdiag%dulo21n,thisDenCoeffsOffdiag%ulod21n,&
     193         266 :                                             thisDenCoeffsOffdiag%uloulop21n)
     194             :    END DO
     195             : 
     196          92 : END SUBROUTINE addRadFunScalarProducts
     197             : 
     198           0 : SUBROUTINE calcCoefficients(thisDenCoeffsOffdiag,atoms,sphhar,sym,eigVecCoeffs,we,noccbd)
     199             :    USE m_juDFT
     200             :    USE m_types_setup
     201             :    USE m_types_cdnval, ONLY: t_eigVecCoeffs
     202             :    USE m_rhomt21     ! calculate (spin) off-diagonal MT-density coeff's
     203             :    USE m_rhonmt21    ! -"-                       non-MT-density coeff's
     204             : 
     205             :    IMPLICIT NONE
     206             : 
     207             :    CLASS(t_denCoeffsOffdiag), INTENT(INOUT) :: thisDenCoeffsOffdiag
     208             :    TYPE(t_atoms),             INTENT(IN)    :: atoms
     209             :    TYPE(t_sphhar),            INTENT(IN)    :: sphhar
     210             :    TYPE(t_sym),               INTENT(IN)    :: sym
     211             :    TYPE(t_eigVecCoeffs),      INTENT(IN)    :: eigVecCoeffs
     212             :    INTEGER,                   INTENT(IN)    :: noccbd
     213             :    REAL,                      INTENT(IN)    :: we(noccbd)
     214           0 :    CALL timestart("rhomt21")
     215             :    CALL rhomt21(atoms,we,noccbd,eigVecCoeffs,thisDenCoeffsOffdiag%uu21,thisDenCoeffsOffdiag%ud21,&
     216             :                 thisDenCoeffsOffdiag%du21,thisDenCoeffsOffdiag%dd21,thisDenCoeffsOffdiag%uulo21,&
     217             :                 thisDenCoeffsOffdiag%dulo21,thisDenCoeffsOffdiag%ulou21,thisDenCoeffsOffdiag%ulod21,&
     218           0 :                 thisDenCoeffsOffdiag%uloulop21)
     219           0 :     CALL timestop("rhomt21")
     220           0 :    IF (thisDenCoeffsOffdiag%l_fmpl) THEN
     221           0 :       CALL timestart("rhonmt21")
     222             :       CALL rhonmt21(atoms,sphhar,we,noccbd,sym,eigVecCoeffs,thisDenCoeffsOffdiag%uunmt21,thisDenCoeffsOffdiag%udnmt21,&
     223           0 :       thisDenCoeffsOffdiag%dunmt21,thisDenCoeffsOffdiag%ddnmt21)
     224           0 :       CALL timestop("rhonmt21")                                                            
     225             :    END IF
     226             : 
     227           0 : END SUBROUTINE calcCoefficients
     228             : 
     229           0 : END MODULE m_types_denCoeffsOffdiag

Generated by: LCOV version 1.14