LCOV - code coverage report
Current view: top level - wannier - wann_socmat.F (source / functions) Coverage Total Hit
Test: FLEUR test coverage Lines: 0.0 % 31 0
Test Date: 2025-06-14 04:34:23 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              :       module m_wann_socmat
       8              :       contains
       9            0 :       subroutine wann_socmat(
      10              :      >               fmpi,enpara,input,noco,nococonv,atoms,
      11              :      >               lmaxd,natd,neigd,
      12              :      >               llod,jspd,
      13              :      >               theta_in,phi_in,jspins,irank,
      14            0 :      >               vr,
      15            0 :      >               acof,bcof,chelp,
      16            0 :      <               hsomtx)
      17              : c***********************************************************************
      18              : c     Calculate matrix elements of the spin-orbit interaction for those
      19              : c     Bloch functions out of which the Wannier functions are
      20              : c     constructed. From these matrix elements the spin-orbit Hamiltonian
      21              : c     in the basis set of Wannier functions may be constructed.
      22              : c
      23              : c     Frank Freimuth
      24              : c***********************************************************************
      25              :       USE m_types
      26              :       USE m_spnorb
      27              :       USE m_hsoham
      28              :       implicit none
      29              : 
      30              :       TYPE(t_mpi),INTENT(IN)      :: fmpi
      31              : 
      32              :       TYPE(t_enpara),INTENT(IN)   :: enpara
      33              :       TYPE(t_input),INTENT(IN)    :: input
      34              :       TYPE(t_noco),INTENT(IN)     :: noco
      35              :       TYPE(t_nococonv),INTENT(IN) :: nococonv
      36              :       TYPE(t_atoms),INTENT(IN)    :: atoms
      37              : 
      38              :       integer, intent(in) :: lmaxd
      39              :       integer, intent(in) :: natd
      40              :       integer, intent(in) :: neigd
      41              : 
      42              :       integer, intent(in) :: llod
      43              :       integer, intent(in) :: jspd
      44              : 
      45              : 
      46              :       real,    intent(in) :: theta_in
      47              :       real,    intent(in) :: phi_in
      48              :       integer, intent(in) :: jspins
      49              :       integer, intent(in) :: irank
      50              : 
      51              : 
      52              :       real,    intent(in) :: vr(:,0:,:,:)    ! jmtd,0:nlhd,ntypd,jspd
      53              : 
      54              :       complex, intent(in) :: acof(:,0:,:,:) !acof(noccbd,0:lmd,natd,jspd)
      55              :       complex, intent(in) :: bcof(:,0:,:,:) !bcof(noccbd,0:lmd,natd,jspd)
      56              :       complex, intent(in) :: chelp(-llod:,:,:,:,:) !chelp(-llod:llod,neigd,nlod,natd,jspd)
      57              : 
      58              :       complex, intent(out):: hsomtx(:,:,:,:) !(neigd,neigd,2,2)
      59              : 
      60              :       integer :: n,l,nwdd,nw,ispin,ie,na,ll1,m,lm,i,nsz(2)
      61              :       real    :: s(3),r2
      62              :       logical :: l_all
      63              :       CHARACTER*3 chntype
      64              :       real    :: theta,phi,pi
      65              : 
      66              : !      real,allocatable :: ddn(:,:,:) ! 0:lmaxd,ntypd,jspd
      67              : !      real,allocatable :: us(:,:,:)  ! 0:lmaxd,ntypd,jspd
      68              : !      real,allocatable :: dus(:,:,:) ! 0:lmaxd,ntypd,jspd
      69              : !      real,allocatable :: uds(:,:,:) ! 0:lmaxd,ntypd,jspd
      70              : !      real,allocatable :: duds(:,:,:)! 0:lmaxd,ntypd,jspd
      71              : 
      72              : !      real,allocatable :: ulos(:,:,:)  ! nlod,ntypd,jspd
      73              : !      real,allocatable :: dulos(:,:,:) ! nlod,ntypd,jspd
      74              : !      real,allocatable :: uulon(:,:,:) ! nlod,ntypd,jspd
      75              : !      real,allocatable :: dulon(:,:,:) ! nlod,ntypd,jspd
      76              : 
      77            0 :       COMPLEX,ALLOCATABLE :: ahelp(:,:,:,:)
      78            0 :       complex,allocatable :: bhelp(:,:,:,:)
      79              : 
      80            0 :       TYPE(t_rsoc)::rsoc
      81            0 :       TYPE(t_usdus):: usdus
      82              : 
      83            0 :       call timestart("wann_socmat")
      84              : 
      85            0 :       nwdd=1
      86            0 :       nw=1
      87            0 :       nsz=neigd
      88              : 
      89              :       IF (.true.) THEN
      90            0 :         theta= theta_In
      91            0 :         phi= phi_In
      92              :       ELSE
      93              :         pi= 4.*ATAN(1.)
      94              :         theta= -theta_In
      95              :         phi=   phi_In+pi
      96              :         ! now the definition of rotation matrices
      97              :         ! is equivalent to the def in the noco-routines
      98              :       ENDIF
      99              : 
     100            0 :       ALLOCATE ( ahelp(lmaxd*(lmaxd+2),natd,neigd,input%jspins) )
     101            0 :       ALLOCATE ( bhelp(lmaxd*(lmaxd+2),natd,neigd,input%jspins) )
     102              : 
     103            0 :       do ispin=1,input%jspins
     104            0 :        DO ie = 1, neigd
     105            0 :         DO na = 1, natd
     106            0 :          DO l = 1, lmaxd
     107            0 :           ll1 = l*(l+1)
     108            0 :           DO m = -l,l
     109            0 :              lm = ll1 + m
     110            0 :              ahelp(lm,na,ie,ispin) = (acof(ie,lm,na,ispin))
     111            0 :              bhelp(lm,na,ie,ispin) = (bcof(ie,lm,na,ispin))
     112              :           ENDDO !m
     113              :          ENDDO !l
     114              :         ENDDO !na
     115              :        ENDDO !ie
     116              :       enddo !ispin
     117              : 
     118              :       ALLOCATE(usdus%us(0:atoms%lmaxd,atoms%ntype,jspd),
     119              :      +         usdus%dus(0:atoms%lmaxd,atoms%ntype,jspd),
     120              :      +         usdus%uds(0:atoms%lmaxd,atoms%ntype,jspd),
     121              :      +         usdus%duds(0:atoms%lmaxd,atoms%ntype,jspd),
     122              :      +         usdus%ddn(0:atoms%lmaxd,atoms%ntype,jspd),
     123              :      +         usdus%ulos(atoms%nlod,atoms%ntype,jspd),
     124              :      +         usdus%dulos(atoms%nlod,atoms%ntype,jspd),
     125              :      +         usdus%uulon(atoms%nlod,atoms%ntype,jspd),
     126            0 :      +         usdus%dulon(atoms%nlod,atoms%ntype,jspd))
     127              : 
     128              : !      ALLOCATE( us(0:lmaxd,ntypd,jspd), dus(0:lmaxd,ntypd,jspd),
     129              : !     +          uds(0:lmaxd,ntypd,jspd),duds(0:lmaxd,ntypd,jspd),
     130              : !     +          ddn(0:lmaxd,ntypd,jspd),
     131              : !     +          ulos(nlod,ntypd,jspd),dulos(nlod,ntypd,jspd),
     132              : !     +          uulon(nlod,ntypd,jspd),dulon(nlod,ntypd,jspd))
     133              : 
     134              :       CALL spnorb(
     135              :      >         atoms,noco,nococonv,input,fmpi, enpara,
     136            0 :      >         vr,usdus,rsoc,.true.)
     137              : 
     138            0 :       rsoc%soangl= conjg(rsoc%soangl)
     139              : 
     140              :       CALL hsoham(atoms,noco,input,nsz,neigd,chelp,rsoc,ahelp,
     141              :      >            bhelp,1,natd,fmpi%n_rank,fmpi%n_size,fmpi%SUB_COMM,
     142            0 :      <            hsomtx)
     143              : 
     144            0 :       call timestop("wann_socmat")
     145            0 :       end subroutine wann_socmat
     146              :       end module m_wann_socmat
        

Generated by: LCOV version 2.0-1