soinit.f90 2.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
MODULE m_soinit
  !
  !**********************************************************************
  !     1. generates radial spin-orbit matrix elements:sorad
  !     2. generates spin-angular spin-orbit matrix   :soorb (not implemented)
  !**********************************************************************
  !
CONTAINS
  SUBROUTINE soinit(atoms,input,enpara, vr,spav,&
       rsopp,rsoppd,rsopdp,rsopdpd,usdus,&
       rsoplop,rsoplopd,rsopdplo,rsopplo,rsoploplop)

    USE m_sorad
    USE m_types
    IMPLICIT NONE
    TYPE(t_enpara),INTENT(IN)  :: enpara
    TYPE(t_input),INTENT(IN)   :: input
    TYPE(t_atoms),INTENT(IN)   :: atoms
19
    TYPE(t_usdus),INTENT(INOUT)   :: usdus
20 21 22 23 24 25 26
    !
    !     .. Scalar Arguments ..
    !     ..
    !     .. Scalar Arguments ..
    LOGICAL, INTENT (IN) :: spav ! if T, spin-averaged pot is used
    !     ..
    !     .. Array Arguments ..
Daniel Wortmann's avatar
Daniel Wortmann committed
27 28 29 30 31 32 33 34 35 36
    REAL,    INTENT (IN) :: vr(:,0:,:,:) !(atoms%jmtd,0:sphhar%nlhd,atoms%ntype,dimension%jspd)
    REAL,    INTENT (OUT) :: rsopp  (atoms%ntype,atoms%lmaxd,2,2)
    REAL,    INTENT (OUT) :: rsoppd (atoms%ntype,atoms%lmaxd,2,2)
    REAL,    INTENT (OUT) :: rsopdp (atoms%ntype,atoms%lmaxd,2,2)
    REAL,    INTENT (OUT) :: rsopdpd(atoms%ntype,atoms%lmaxd,2,2)
    REAL,    INTENT (OUT) :: rsoplop (atoms%ntype,atoms%nlod,2,2)
    REAL,    INTENT (OUT) :: rsoplopd(atoms%ntype,atoms%nlod,2,2)
    REAL,    INTENT (OUT) :: rsopdplo(atoms%ntype,atoms%nlod,2,2)
    REAL,    INTENT (OUT) :: rsopplo (atoms%ntype,atoms%nlod,2,2)
    REAL,    INTENT (OUT) :: rsoploplop(atoms%ntype,atoms%nlod,atoms%nlod,2,2)
37 38 39 40 41 42 43
    !     ..
    !     .. Local Scalars ..
    INTEGER i,jspin,n
    !     ..
    !     .. Local Arrays ..
    REAL  vr0(atoms%jmtd,size(vr,4))
    !     ..
44 45 46 47 48 49 50 51 52
    rsopp  =0.0
    rsoppd =0.0
    rsopdp =0.0
    rsopdpd=0.0
    rsoplop =0.0
    rsoplopd=0.0
    rsopdplo=0.0
    rsopplo=0.0
    rsoploplop=0.0
53 54 55 56 57 58 59 60 61 62 63 64 65
    DO n = 1,atoms%ntype
       vr0=0.0
       vr0(:atoms%jri(n),:) = vr(:atoms%jri(n),0,n,:)
       
       CALL sorad(&
            atoms,input,n,vr0,enpara,spav,&
            rsopp,rsopdpd,rsoppd,rsopdp,usdus,&
            rsoplop,rsoplopd,rsopdplo,rsopplo,rsoploplop)
       
    END DO ! end-do-loop : atoms%ntype

  END SUBROUTINE soinit
END MODULE m_soinit