LCOV - code coverage report
Current view: top level - vgen - int_nv.F90 (source / functions) Hit Total Coverage
Test: FLEUR test coverage Lines: 33 33 100.0 %
Date: 2024-04-16 04:21:52 Functions: 1 1 100.0 %

          Line data    Source code
       1             : MODULE m_intnv
       2             :   !     ************************************************
       3             :   !     calculates the integral of charge density 
       4             :   !     and potential in the unit cell
       5             :   !     ************************************************
       6             : CONTAINS
       7        1231 :   SUBROUTINE int_nv(ispin,stars,vacuum,atoms,sphhar,cell,sym,input ,vpot,den,RESULT)
       8             : 
       9             :     USE m_types
      10             :     USE m_constants
      11             :     USE m_intgr, ONLY : intgr3,intgz0
      12             : 
      13             :     IMPLICIT NONE
      14             :     !     ..
      15             :     !     .. Scalar Arguments ..
      16             :     REAL  RESULT
      17             :     INTEGER,INTENT(IN)        :: ispin
      18             :     TYPE(t_stars),INTENT(IN)  :: stars
      19             :     TYPE(t_vacuum),INTENT(IN) :: vacuum
      20             :     TYPE(t_atoms),INTENT(IN)  :: atoms
      21             :     TYPE(t_sphhar),INTENT(IN) :: sphhar
      22             :     TYPE(t_cell),INTENT(IN)   :: cell
      23             :     TYPE(t_sym),INTENT(IN)    :: sym
      24             :     TYPE(t_input),INTENT(IN)  :: input
      25             :      
      26             :     TYPE(t_potden),INTENT(IN) :: vpot,den
      27             : 
      28             :   
      29             :     !     ..
      30             :     !     .. Local Scalars ..
      31             :     REAL dpdot,facv,tis,tmt,tvac,tvact
      32             :     INTEGER i,ip,ivac,j,k2,lh,n,npz,nat
      33             :     LOGICAL tail
      34             :     !     ..
      35             :     !     .. Local Arrays ..
      36        1231 :     REAL dpj(atoms%jmtd),dpz(vacuum%nmzd)
      37             :     !     ..
      38             :     !     ..
      39             :     !     -----> CALCULATE DENSITY-POTENTIAL INTEGRALS
      40             :     !
      41             :     !  ******************* INTERSTITIAL REGION**********************
      42             :     !
      43             :     !  -> warping has been moved to vgen and visxc resp. ...gustav
      44             :     !
      45     2771923 :     tis = cell%omtil * REAL( DOT_PRODUCT(vpot%pw_w(:stars%ng3,ispin),den%pw(:stars%ng3,ispin)))
      46             : 
      47        1231 :     WRITE (oUnit,FMT=8020) tis
      48             : 8020 FORMAT (/,10x,'interstitial :',t40,ES20.10)
      49             : 
      50        1231 :     RESULT = RESULT + tis
      51             :     !
      52             :     !   ******************M.T. SPHERES*******************
      53             :     !
      54        1231 :     tmt = 0.
      55        3398 :     DO n = 1,atoms%ntype
      56        2167 :        nat = atoms%firstAtom(n)
      57       59990 :        DO lh = 0,sphhar%nlh(sym%ntypsy(nat))
      58    40486524 :           DO j = 1,atoms%jri(n)
      59    40486524 :              dpj(j) = den%mt(j,lh,n,ispin)*vpot%mt(j,lh,n,ispin)
      60             :           ENDDO
      61       56592 :           CALL intgr3(dpj,atoms%rmsh(1,n),atoms%dx(n),atoms%jri(n),dpdot)
      62       58759 :           tmt = tmt + dpdot*atoms%neq(n)
      63             :        ENDDO
      64             :     ENDDO
      65        1231 :     WRITE (oUnit,FMT=8030) tmt
      66             : 8030 FORMAT (/,10x,'muffin tin spheres :',t40,ES20.10)
      67        1231 :     RESULT = RESULT + tmt
      68             :     !
      69             :     ! *********** VACUUM REGION**************
      70             :     !
      71        1231 :     IF (input%film ) THEN
      72         146 :        npz = vacuum%nmz + 1
      73         146 :        tail = .TRUE.
      74         146 :        facv=2.0/vacuum%nvac
      75         146 :        tvac = 0.
      76         146 :        tvact = 0.
      77             :        !     set array dpz to zero
      78       36646 :        dpz=0.0
      79         332 :        DO ivac = 1,vacuum%nvac
      80       46686 :           DO ip = 1,vacuum%nmz
      81       46686 :              dpz(npz-ip) = REAL(den%vac(ip,1,ivac,ispin))*REAL(vpot%vac(ip,1,ivac,ispin))
      82             :              !         --->  WARPING REGION
      83             :           ENDDO
      84       61225 :           DO  k2 = 2,stars%ng2
      85     6165125 :              DO  ip = 1,vacuum%nmzxy
      86             :                 dpz(npz-ip) = dpz(npz-ip) + stars%nstr2(k2)*den%vac(ip,k2,ivac,ispin)*&
      87     6164939 :                      &                          CONJG(vpot%vac(ip,k2,ivac,ispin))
      88             :              ENDDO
      89             :           ENDDO
      90         186 :           CALL intgz0(dpz,vacuum%delz,vacuum%nmz,tvac,tail)
      91         332 :           tvact = tvact + cell%area*tvac*facv
      92             :        ENDDO
      93         146 :        WRITE (oUnit,FMT=8040) tvact
      94             : 8040   FORMAT (/,10x,'vacuum :',t40,f20.10)
      95         146 :        RESULT = RESULT + tvact
      96             :     
      97             :     END IF
      98             : 
      99        1231 :   END SUBROUTINE int_nv
     100             : END MODULE m_intnv

Generated by: LCOV version 1.14