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

          Line data    Source code
       1             : MODULE m_mkgl0
       2             : !      ------------------------------------------------------------------
       3             : !      make quantities for vxcallg. for paramag. case
       4             : !        dens,drr,ddrr are charge density and its gradient for nonmag.
       5             : !        one spin.
       6             : 
       7             : !      agr: abs(grad(ro)), g2r: laplacian(ro),
       8             : !      gggr: grad(ro)*grad(agr),
       9             : !      grgru,d: grad(ro)*grad(rou),for rod., gzgr: grad(zeta)*grad(ro).
      10             : !      ------------------------------------------------------------------
      11             : CONTAINS
      12         704 :    SUBROUTINE mkgl0(jspins,rad, densi,drri,ddrri, grad)
      13             : 
      14             :       USE m_types
      15             :       IMPLICIT NONE
      16             : 
      17             :       INTEGER, INTENT (IN) :: jspins
      18             :       REAL,    INTENT (IN) :: rad(:),densi(:,:)
      19             :       REAL,    INTENT (IN) :: drri(:,:),ddrri(:,:)
      20             :       TYPE(t_gradients)::grad
      21             : 
      22             :       REAL dagrr,dagrru,ddrr,ddrrd,ddrru,drr,drrd,drru,dzdr,ro,rod,rou,rv,spnf
      23             :       INTEGER i
      24             : !     ------------------------------------------------------------------
      25             : 
      26         704 :       spnf = 1./(3-jspins)
      27         704 :       IF (allocated(grad%sigma)) THEN
      28       16825 :          DO i=1,size(rad)
      29       16800 :             grad%sigma(1,i)=spnf * drri(i,1)*spnf * drri(i,1)
      30       16825 :             IF (jspins>1) THEN
      31       16800 :                grad%sigma(2,i)=spnf * drri(i,1)*spnf * drri(i,2)
      32       16800 :                grad%sigma(3,i)=spnf * drri(i,2)*spnf * drri(i,2)
      33             :             ENDIF
      34             :          ENDDO
      35          25 :          RETURN
      36             :       ENDIF
      37      483713 :       DO i = 1,size(rad)
      38             : 
      39      483034 :          rv = rad(i)
      40      483034 :          ro =  spnf * (densi(i,1) + densi(i,jspins))
      41      483034 :          rou = spnf * densi(i,1)
      42      483034 :          rod = spnf * densi(i,jspins)
      43             : 
      44      483034 :          drr =   spnf * (drri(i,1) + drri(i,jspins))
      45      483034 :          drru =  spnf * drri(i,1)
      46      483034 :          drrd =  spnf * drri(i,jspins)
      47      483034 :          ddrr =  spnf * (ddrri(i,1) + ddrri(i,jspins))
      48      483034 :          ddrru = spnf * ddrri(i,1)
      49      483034 :          ddrrd = spnf * ddrri(i,jspins)
      50             : 
      51      483034 :          grad%agrt(i) = abs(drr)
      52      483034 :          grad%agru(i) = abs(drru)
      53      483034 :          grad%agrd(i) = grad%agru(i)
      54             : 
      55      483034 :          dagrr = drr*ddrr/grad%agrt(i)
      56      483034 :          dagrru = drru*ddrru/grad%agru(i)
      57             : 
      58      483034 :          grad%gggrt(i) = drr*dagrr
      59      483034 :          grad%gggru(i) = drru*dagrru
      60      483034 :          grad%gggrd(i) = grad%gggru(i)
      61             : 
      62      483034 :          dzdr = ((drru-drrd)*ro- (rou-rod)*drr)/ro**2
      63             : 
      64      483034 :          grad%gzgr(i) = dzdr*drr
      65             : 
      66      483034 :          grad%g2rt(i) = ddrr + 2*drr/rv
      67      483034 :          grad%g2ru(i) = ddrru + 2*drru/rv
      68      483034 :          grad%g2rd(i) = ddrrd + 2*drrd/rv
      69             : 
      70      483034 :          grad%grgru(i) = drr*drru
      71      483713 :          grad%grgrd(i) = drr*drrd
      72             : 
      73             :       ENDDO
      74             : 
      75             :    END SUBROUTINE mkgl0
      76             : END MODULE m_mkgl0

Generated by: LCOV version 1.13