LCOV - code coverage report
Current view: top level - types - types_regionCharges.f90 (source / functions) Hit Total Coverage
Test: FLEUR test coverage Lines: 20 21 95.2 %
Date: 2024-04-23 04:28:20 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         682 : SUBROUTINE regionCharges_init(thisRegCharges,input,atoms)
      32             : 
      33             :    USE m_types_input
      34             :    USE m_types_atoms
      35             : 
      36             :    IMPLICIT NONE
      37             : 
      38             :    CLASS(t_regionCharges), INTENT(INOUT) :: thisRegCharges
      39             :    TYPE(t_input),          INTENT(IN)    :: input
      40             :    TYPE(t_atoms),          INTENT(IN)    :: atoms
      41             : 
      42        2728 :    ALLOCATE(thisRegCharges%sqal(0:3,atoms%ntype,input%jspins))
      43        2046 :    ALLOCATE(thisRegCharges%ener(0:3,atoms%ntype,input%jspins))
      44             : 
      45        3410 :    ALLOCATE(thisRegCharges%sqlo(atoms%nlod,atoms%ntype,input%jspins))
      46        2728 :    ALLOCATE(thisRegCharges%enerlo(atoms%nlod,atoms%ntype,input%jspins))
      47        2046 :    ALLOCATE(thisRegCharges%svac(2,input%jspins))
      48        1364 :    ALLOCATE(thisRegCharges%pvac(2,input%jspins))
      49             : 
      50       11110 :    thisRegCharges%sqal = 0.0
      51       11110 :    thisRegCharges%ener = 0.0
      52        5604 :    thisRegCharges%sqlo = 0.0
      53        5604 :    thisRegCharges%enerlo = 0.0
      54        3916 :    thisRegCharges%svac = 0.0
      55        3916 :    thisRegCharges%pvac = 0.0
      56             : 
      57         682 : END SUBROUTINE regionCharges_init
      58             : 
      59         140 : SUBROUTINE sumBandsVac(thisRegCharges,vacuum,vacdos,noccbd,ikpt,jsp_start,jsp_end,eig,we)
      60             : 
      61             :   USE m_types_vacuum
      62             :   USE m_types_dos
      63             :   USE m_types_vacdos
      64             : 
      65             :    IMPLICIT NONE
      66             : 
      67             :    CLASS(t_regionCharges), INTENT(INOUT) :: thisRegCharges
      68             :    TYPE(t_vacuum),         INTENT(IN)    :: vacuum
      69             :    TYPE(t_vacdos),         INTENT(IN)    :: vacdos
      70             :    INTEGER,                INTENT(IN)    :: noccbd
      71             :    INTEGER,                INTENT(IN)    :: ikpt
      72             :    INTEGER,                INTENT(IN)    :: jsp_start, jsp_end
      73             :    REAL,                   INTENT(IN)    :: eig(noccbd)
      74             :    REAL,                   INTENT(IN)    :: we(noccbd)
      75             : 
      76             :    INTEGER                               :: ispin, ivac
      77             : 
      78             :    ! perform Brillouin zone integration and summation over the bands in order to determine the vacuum energy parameters.
      79         280 :    DO ispin = jsp_start, jsp_end
      80         460 :       DO ivac = 1,vacuum%nvac
      81             :          thisRegCharges%pvac(ivac,ispin) = thisRegCharges%pvac(ivac,ispin)+&
      82        3903 :             dot_product(eig(:noccbd)*vacdos%qvac(:noccbd,ivac,ikpt,ispin),we(:noccbd))
      83             :          thisRegCharges%svac(ivac,ispin)=thisRegCharges%svac(ivac,ispin)+&
      84        4043 :             dot_product(vacdos%qvac(:noccbd,ivac,ikpt,ispin),we(:noccbd))
      85             :       END DO
      86             :    END DO
      87             : 
      88         140 : END SUBROUTINE sumBandsVac
      89             : 
      90           0 : END MODULE m_types_regionCharges

Generated by: LCOV version 1.14