LCOV - code coverage report
Current view: top level - wannier - wann_perpmag.f (source / functions) Coverage Total Hit
Test: FLEUR test coverage Lines: 0.0 % 46 0
Test Date: 2025-06-09 04:34:38 Functions: 0.0 % 1 0

            Line data    Source code
       1              : !--------------------------------------------------------------------------------
       2              : ! Copyright (c) 2016 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              : 
       8              :       module m_wann_perpmag
       9              :             use m_juDFT
      10              :       contains
      11            0 :       SUBROUTINE wann_perpmag(
      12            0 :      >               nbnd,neq,mlh,nlhd,nlh,ntypsy,llh,lmax,
      13              :      >               nmem,ntype,ntypd,bbmat,bmat,
      14            0 :      >               nlod,llod,nlo,llo,flo,f,g,jri,rmsh,dx,jmtd,
      15              :      >               lmaxd,lmd,clnu,
      16            0 :      >               ujug,ujdg,djug,djdg,ujulog,djulog,
      17            0 :      >               ulojug,ulojdg,ulojulog,
      18            0 :      >               acof,bcof,ccof,
      19            0 :      <               perpmag)
      20              : c*************************************************************************
      21              : c    wann_perpmag calculates integrals of radial wave functions with
      22              : c    the exchange field and multiplies them with an angular factor.
      23              : c
      24              : c    Frank Freimuth, 2010
      25              : c************************************************************************* 
      26              : 
      27              :       use m_constants, only : pimach
      28              :       use m_sphbes
      29              :       use m_ylm
      30              :       use m_intgr, only : intgr3
      31              :       use m_gaunt, only: gaunt1
      32              : 
      33              :       IMPLICIT NONE
      34              :       integer, intent (in) :: nbnd
      35              :       integer, intent (in) :: neq(:) 
      36              :       INTEGER, INTENT (IN) :: mlh(:,0:,:)!(memd,0:nlhd,ntypsd)
      37              :       INTEGER, INTENT (IN) :: nlhd
      38              :       integer, intent (in) :: nlh(:)
      39              :       integer, intent (in) :: ntypsy(:)
      40              :       integer, intent (in) :: nmem(:,:)
      41              :       integer, intent (in) :: ntype,ntypd
      42              :       integer, intent (in) :: llh(:,:)
      43              :       INTEGER, INTENT (IN) :: lmaxd,jmtd,lmd
      44              :       real,    intent (in) :: bbmat(:,:)!(3,3)
      45              :       real,    intent (in) :: bmat(:,:)!(3,3)
      46              :       integer, intent (in) :: lmax(:)!(ntypd)
      47              :       integer, intent (in) :: nlod,llod
      48              :       integer, intent (in) :: jri(:)!(ntypd)
      49              :       integer, intent (in) :: nlo(:)!(ntypd)
      50              :       integer, intent (in) :: llo(:,:)!(nlod,ntypd)    
      51              :       real,    intent (in) :: f(:,:,:,0:,:)!(ntypd,jmtd,2,0:lmaxd,2)
      52              :       real,    intent (in) :: g(:,:,:,0:,:)!(ntypd,jmtd,2,0:lmaxd,2)
      53              :       real,    intent (in) :: flo(:,:,:,:,:)!(ntypd,jmtd,2,nlod,2)
      54              :       real,    intent (in) :: rmsh(:,:)!(jmtd,ntypd)
      55              :       real,    intent (in) :: dx(:)!(ntypd)
      56              :       complex, intent (in) :: clnu(:,0:,:)!(memd,0:nlhd,ntypsd)
      57              :       complex, intent (in) :: ujug(0:,0:,1:)!(0:lmd,0:lmd,1:ntype)
      58              :       complex, intent (in) :: ujdg(0:,0:,1:)!(0:lmd,0:lmd,1:ntype)
      59              :       complex, intent (in) :: djug(0:,0:,1:)!(0:lmd,0:lmd,1:ntype)
      60              :       complex, intent (in) :: djdg(0:,0:,1:)!(0:lmd,0:lmd,1:ntype)
      61              : 
      62              :       complex, intent (in) :: ujulog(0:,:,-llod:,:) !(0:lmd,nlod,-llod:llod,1:ntype)
      63              :       complex, intent (in) :: djulog(0:,:,-llod:,:) !(0:lmd,nlod,-llod:llod,1:ntype)
      64              :       complex, intent (in) :: ulojug(0:,:,-llod:,:) !(0:lmd,nlod,-llod:llod,1:ntype)
      65              :       complex, intent (in) :: ulojdg(0:,:,-llod:,:) !(0:lmd,nlod,-llod:llod,1:ntype)
      66              :       complex, intent (in) :: ulojulog(:,-llod:,:,-llod:,:) !(1:nlod,-llod:llod,1:nlod,-llod:llod,1:ntype)
      67              : 
      68              :       complex, intent (in) :: acof(:,0:,:,:) !acof(noccbd,0:lmd,natd,jspd)
      69              :       complex, intent (in) :: bcof(:,0:,:,:) !bcof(noccbd,0:lmd,natd,jspd)
      70              :       complex, intent (in) :: ccof(-llod:,:,:,:,:)!ccof(-llod:llod,noccbd,nlod,natd,jspd)
      71              : 
      72              :       complex, intent (inout):: perpmag(:,:)
      73              : 
      74              :       integer :: nat,n,nn,l,m,lm,lp,mp,lpmp,i,j,lo,lop
      75              : 
      76            0 :       call timestart("wann_perpmag")
      77            0 :       nat=0
      78            0 :       do n=1,ntype
      79            0 :        do nn=1,neq(n)
      80            0 :         nat=nat+1
      81            0 :         do l=0,lmax(n)
      82            0 :          do m=-l,l  
      83            0 :           lm=l*(l+1)+m  
      84            0 :           do lp=0,lmax(n)
      85            0 :            do mp=-lp,lp
      86            0 :             lpmp=lp*(lp+1)+mp              
      87            0 :             do i=1,nbnd
      88            0 :              do j=1,nbnd
      89              :               perpmag(j,i)=perpmag(j,i)+
      90              :      + conjg(acof(j,lpmp,nat,1))*acof(i,lm,nat,2)*ujug(lpmp,lm,n)+  
      91              :      + conjg(acof(j,lpmp,nat,1))*bcof(i,lm,nat,2)*ujdg(lpmp,lm,n)+
      92              :      + conjg(bcof(j,lpmp,nat,1))*acof(i,lm,nat,2)*djug(lpmp,lm,n)+
      93            0 :      + conjg(bcof(j,lpmp,nat,1))*bcof(i,lm,nat,2)*djdg(lpmp,lm,n)
      94              :              enddo !j
      95              :             enddo !i
      96              :            enddo !mp
      97              :           enddo !lp
      98              :          enddo !m
      99              :         enddo !l
     100              : 
     101            0 :         if(nlo(n).ge.1)then
     102            0 :          do lo=1,nlo(n)
     103            0 :           l=llo(lo,n)
     104            0 :           do m=-l,l
     105              :            
     106            0 :            do lop=1,nlo(n)
     107            0 :             lp=llo(lop,n)
     108            0 :             do mp=-lp,lp
     109              : 
     110            0 :              do i=1,nbnd
     111            0 :               do j=1,nbnd
     112              :                perpmag(j,i)=perpmag(j,i)+
     113              :      &            conjg(ccof(mp,j,lop,nat,1))*ccof(m,i,lo,nat,2)*
     114            0 :      &                    ulojulog(lop,mp,lo,m,n)
     115              :               enddo !j
     116              :              enddo !i
     117              : 
     118              :             enddo !mp
     119              :            enddo !lop   
     120              : 
     121              :           enddo !m
     122              :          enddo !lo 
     123              :         endif !lo-lo
     124              : 
     125            0 :         if(nlo(n).ge.1)then
     126            0 :          do lo=1,nlo(n)
     127            0 :           l=llo(lo,n)
     128            0 :           do m=-l,l
     129              :            
     130            0 :            do lp=0,lmax(n)
     131            0 :             do mp=-lp,lp
     132            0 :             lpmp=lp*(lp+1)+mp   
     133              : 
     134            0 :              do i=1,nbnd
     135            0 :               do j=1,nbnd
     136              :                perpmag(j,i)=perpmag(j,i)+
     137              :      &            conjg(acof(j,lpmp,nat,1))*ccof(m,i,lo,nat,2)*
     138            0 :      &                    ujulog(lpmp,lo,m,n)
     139              :                perpmag(j,i)=perpmag(j,i)+
     140              :      &            conjg(bcof(j,lpmp,nat,1))*ccof(m,i,lo,nat,2)*
     141            0 :      &                    djulog(lpmp,lo,m,n)
     142              : 
     143              :                perpmag(j,i)=perpmag(j,i)+
     144              :      &            acof(i,lpmp,nat,2)*conjg(ccof(m,j,lo,nat,1))*
     145            0 :      &                    ulojug(lpmp,lo,m,n)
     146              :                perpmag(j,i)=perpmag(j,i)+
     147              :      &            bcof(i,lpmp,nat,2)*conjg(ccof(m,j,lo,nat,1))*
     148            0 :      &                    ulojdg(lpmp,lo,m,n)
     149              : 
     150              :               enddo !j
     151              :              enddo !i
     152              : 
     153              :             enddo !mp
     154              :            enddo !lp   
     155              : 
     156              :           enddo !m
     157              :          enddo !lo 
     158              :         endif !lo-apw
     159              : 
     160              :   
     161              :        enddo !nn 
     162              :       enddo !n
     163              : 
     164            0 :       call timestop("wann_perpmag")
     165            0 :       end subroutine wann_perpmag
     166              : 
     167              :       end module m_wann_perpmag
        

Generated by: LCOV version 2.0-1