LCOV - code coverage report
Current view: top level - types - types_regionCharges.f90 (source / functions) Hit Total Coverage
Test: combined.info Lines: 20 21 95.2 %
Date: 2019-09-08 04:53:50 Functions: 2 4 50.0 %

          Line data    Source code
       1             : !--------------------------------------------------------------------------------
       2             : ! Copyright (c) 2018 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_types_regionCharges
       8             : 
       9             : IMPLICIT NONE
      10             : 
      11             : PRIVATE
      12             : 
      13             :    TYPE t_regionCharges
      14             : 
      15             :       REAL,    ALLOCATABLE :: sqal(:,:,:)
      16             :       REAL,    ALLOCATABLE :: ener(:,:,:)
      17             :       REAL,    ALLOCATABLE :: sqlo(:,:,:)
      18             :       REAL,    ALLOCATABLE :: enerlo(:,:,:)
      19             :       REAL,    ALLOCATABLE :: svac(:,:)
      20             :       REAL,    ALLOCATABLE :: pvac(:,:)
      21             : 
      22             :       CONTAINS
      23             :          PROCEDURE,PASS :: init => regionCharges_init
      24             :          PROCEDURE      :: sumBandsVac
      25             :    END TYPE t_regionCharges
      26             : 
      27             : PUBLIC t_regionCharges
      28             : 
      29             : CONTAINS
      30             : 
      31         340 : SUBROUTINE regionCharges_init(thisRegCharges,input,atoms)
      32             : 
      33             :    USE m_types_setup
      34             : 
      35             :    IMPLICIT NONE
      36             : 
      37             :    CLASS(t_regionCharges), INTENT(INOUT) :: thisRegCharges
      38             :    TYPE(t_input),          INTENT(IN)    :: input
      39             :    TYPE(t_atoms),          INTENT(IN)    :: atoms
      40             : 
      41         340 :    ALLOCATE(thisRegCharges%sqal(0:3,atoms%ntype,input%jspins))
      42         340 :    ALLOCATE(thisRegCharges%ener(0:3,atoms%ntype,input%jspins))
      43             : 
      44         340 :    ALLOCATE(thisRegCharges%sqlo(atoms%nlod,atoms%ntype,input%jspins))
      45         340 :    ALLOCATE(thisRegCharges%enerlo(atoms%nlod,atoms%ntype,input%jspins))
      46         340 :    ALLOCATE(thisRegCharges%svac(2,input%jspins))
      47         340 :    ALLOCATE(thisRegCharges%pvac(2,input%jspins))
      48             : 
      49         948 :    thisRegCharges%sqal = 0.0
      50         948 :    thisRegCharges%ener = 0.0
      51         948 :    thisRegCharges%sqlo = 0.0
      52         948 :    thisRegCharges%enerlo = 0.0
      53         948 :    thisRegCharges%svac = 0.0
      54         948 :    thisRegCharges%pvac = 0.0
      55             : 
      56         340 : END SUBROUTINE regionCharges_init
      57             : 
      58          28 : SUBROUTINE sumBandsVac(thisRegCharges,vacuum,dos,noccbd,ikpt,jsp_start,jsp_end,eig,we)
      59             : 
      60             :    USE m_types_setup
      61             :    USE m_types_dos
      62             : 
      63             :    IMPLICIT NONE
      64             : 
      65             :    CLASS(t_regionCharges), INTENT(INOUT) :: thisRegCharges
      66             :    TYPE(t_vacuum),         INTENT(IN)    :: vacuum
      67             :    TYPE(t_dos),            INTENT(IN)    :: dos
      68             :    INTEGER,                INTENT(IN)    :: noccbd
      69             :    INTEGER,                INTENT(IN)    :: ikpt
      70             :    INTEGER,                INTENT(IN)    :: jsp_start, jsp_end
      71             :    REAL,                   INTENT(IN)    :: eig(noccbd)
      72             :    REAL,                   INTENT(IN)    :: we(noccbd)
      73             : 
      74             :    INTEGER                               :: ispin, ivac
      75             : 
      76             :    ! perform Brillouin zone integration and summation over the bands in order to determine the vacuum energy parameters.
      77          56 :    DO ispin = jsp_start, jsp_end
      78          84 :       DO ivac = 1,vacuum%nvac
      79             :          thisRegCharges%pvac(ivac,ispin) = thisRegCharges%pvac(ivac,ispin)+&
      80          28 :             dot_product(eig(:noccbd)*dos%qvac(:noccbd,ivac,ikpt,ispin),we(:noccbd))
      81             :          thisRegCharges%svac(ivac,ispin)=thisRegCharges%svac(ivac,ispin)+&
      82         223 :             dot_product(dos%qvac(:noccbd,ivac,ikpt,ispin),we(:noccbd))
      83             :       END DO
      84             :    END DO
      85             : 
      86          28 : END SUBROUTINE sumBandsVac
      87             : 
      88           0 : END MODULE m_types_regionCharges

Generated by: LCOV version 1.13