LCOV - code coverage report
Current view: top level - eigen_soc - sointg.f90 (source / functions) Hit Total Coverage
Test: combined.info Lines: 24 24 100.0 %
Date: 2019-09-08 04:53:50 Functions: 1 1 100.0 %

          Line data    Source code
       1             : MODULE m_sointg
       2             :   !*********************************************************************
       3             :   !     compute radial spin-orbit integrant
       4             :   !*********************************************************************
       5             : CONTAINS
       6        1752 :   SUBROUTINE sointg(ntyp,e,vr,v0,atoms,input, vso)
       7             :     !
       8             :     USE m_differentiate,ONLY:diff3
       9             :     USE m_constants,ONLY: c_light
      10             :     USE m_types
      11             :     IMPLICIT NONE
      12             : 
      13             :     TYPE(t_input),INTENT(IN)   :: input
      14             :     TYPE(t_atoms),INTENT(IN)   :: atoms
      15             :     !     ..
      16             :     !     .. Scalar Arguments ..
      17             :     INTEGER,INTENT(IN)   :: ntyp
      18             :     REAL,    INTENT (IN) :: e
      19             :     !     ..
      20             :     !     .. Array Arguments ..
      21             :     REAL, INTENT (IN)  ::  v0(atoms%jri(ntyp))
      22             :     REAL, INTENT (IN)  ::  vr(atoms%jmtd,input%jspins)
      23             :     REAL, INTENT (OUT) :: vso(atoms%jmtd,2)
      24             :     !     ..
      25             :     !     .. Local Scalars ..
      26             :     REAL dr,dxv,r,cin2
      27             :     INTEGER i,jspin
      28             :     !     ..
      29             :     !     .. Local Arrays ..
      30        3504 :     REAL dv(atoms%jri(ntyp)),xmrel(atoms%jri(ntyp))
      31             :     !     ..
      32             :     !     ..
      33        1752 :     cin2 = 1.0/c_light(1.0)**2
      34        1752 :     dr = EXP(atoms%dx(ntyp))
      35        1752 :     r = atoms%rmsh(1,ntyp)
      36             :     !
      37             :     !---> relativistic mass:
      38     1013364 :     DO i = 1,atoms%jri(ntyp)
      39     1011612 :        xmrel(i) = 1. + (e-v0(i)/r)/2.*cin2
      40     1013364 :        r = r*dr
      41             :     END DO
      42             :     !---> potential derivative (on logarithmic mesh) : v0 := r*v
      43             : 
      44        1752 :     CALL diff3(vr(:atoms%jri(ntyp),1),atoms%dx(ntyp),dv)
      45             :     !
      46        1752 :     r = atoms%rmsh(1,ntyp)
      47     1013364 :     DO i = 1,atoms%jri(ntyp)
      48     1011612 :        dxv = (dv(i) - vr(i,1))/(r**3)
      49     1011612 :        vso(i,2) = cin2*dxv/(4.*xmrel(i)**2)
      50     1013364 :        r = r*dr
      51             :     END DO
      52             : 
      53        1752 :     IF (input%jspins.EQ.2) THEN
      54        1592 :        CALL diff3(vr(:atoms%jri(ntyp),input%jspins),atoms%dx(ntyp), dv)
      55             :        !
      56        1592 :        r = atoms%rmsh(1,ntyp)
      57      922868 :        DO i = 1,atoms%jri(ntyp)
      58      921276 :           dxv = (dv(i) - vr(i,input%jspins))/(r**3)
      59      921276 :           vso(i,1) = cin2*dxv/(4.*xmrel(i)**2)
      60      922868 :           r = r*dr
      61             :        END DO
      62             :     ELSE 
      63      180832 :        DO i = 1,atoms%jri(ntyp)
      64         160 :           vso(i,1) =  vso(i,2)
      65             :        END DO
      66             :     ENDIF
      67             : 
      68        1752 :   END SUBROUTINE sointg
      69             : END MODULE m_sointg

Generated by: LCOV version 1.13