LCOV - code coverage report
Current view: top level - types - types_misc.F90 (source / functions) Hit Total Coverage
Test: combined.info Lines: 31 44 70.5 %
Date: 2019-09-08 04:53:50 Functions: 1 6 16.7 %

          Line data    Source code
       1             : !--------------------------------------------------------------------------------
       2             : ! Copyright (c) 2016 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_misc
       8             : 
       9             :    IMPLICIT NONE
      10             : 
      11             :    !*************************************************************
      12             :    !     This module contains definitions for all kind of types
      13             :    !*************************************************************
      14             : 
      15             :    ! Type for the HF total energy
      16             :    TYPE t_energy_hf
      17             :       REAL :: valence
      18             :       REAL :: core
      19             :    END TYPE t_energy_hf
      20             : 
      21             :    TYPE prodtype
      22             :       INTEGER :: l1,l2,n1,n2
      23             :    END TYPE prodtype
      24             : 
      25             :    TYPE t_hybdat
      26             :       INTEGER              :: lmaxcd,maxindxc
      27             :       REAL,  ALLOCATABLE   ::  gridf(:,:)                                    !alloc in util.F
      28             :       INTEGER , ALLOCATABLE::  nindxc(:,:)                                   !alloc in eigen_HF_init
      29             :       INTEGER,ALLOCATABLE  :: lmaxc(:)                                       !alloc in eigen_HF_init
      30             :       REAL,    ALLOCATABLE ::  core1(:,:,:,:),core2(:,:,:,:)                 !alloc in eigen_HF_init
      31             :       REAL,    ALLOCATABLE ::  eig_c(:,:,:)                                  !alloc in eigen_HF_init
      32             :       INTEGER , ALLOCATABLE::  kveclo_eig(:,:)                               !alloc in eigen_HF_setup
      33             :       INTEGER              ::  maxfac
      34             :       REAL,    ALLOCATABLE ::  sfac(:),fac(:)                                !alloc in eigen_HF_init
      35             :       REAL,    ALLOCATABLE ::  gauntarr(:,:,:,:,:,:)                         !alloc in eigen_HF_init
      36             :       REAL,    ALLOCATABLE ::  bas1(:,:,:,:),bas2(:,:,:,:)                   !alloc in eigen_HF_init
      37             :       REAL ,   ALLOCATABLE ::  bas1_MT(:,:,:),drbas1_MT(:,:,:)               !alloc in eigen_HF_init
      38             :       REAL, ALLOCATABLE    ::  prodm(:,:,:,:)                                !alloc in eigen_HF_setup
      39             :       TYPE(PRODTYPE),ALLOCATABLE :: prod(:,:,:)                              !alloc in eigen_HF_setup
      40             :       INTEGER, ALLOCATABLE :: pntgptd(:)                                     !alloc in eigen_HF_setup
      41             :       INTEGER, ALLOCATABLE :: pntgpt(:,:,:,:)                                !alloc in eigen_HF_setup
      42             :       INTEGER,ALLOCATABLE   ::  nindxp1(:,:)
      43             :       REAL, ALLOCATABLE   ::  stepfunc_r(:,:,:)
      44             :       COMPLEX,ALLOCATABLE ::  stepfunc_c(:,:,:)
      45             :    END TYPE t_hybdat
      46             : 
      47             :    TYPE t_results
      48             :       REAL, ALLOCATABLE    :: force(:,:,:)   !< Forces calculated on all atoms (for each spin)
      49             :       REAL, ALLOCATABLE    :: force_old(:,:) !< Forces on all atoms from last iteration
      50             :       REAL                 :: ef        !<Fermie energy
      51             :       REAL                 :: seigc     !<sum of the core eigenvalues
      52             :       REAL                 :: seigsc    !<weighted sum of the semi-core eigenvalues
      53             :       REAL                 :: seigv     !<weighted sum of the occupied valence eigenvalues
      54             :       REAL                 :: seigscv   !<sum of seigv and seigsc
      55             :       REAL                 :: ts        !<entropy contribution to the free energy
      56             :       REAL                 :: te_vcoul  !<charge density-coulomb potential integral
      57             :       REAL                 :: te_veff   !<charge density-effective potential integral
      58             :       REAL                 :: te_exc    !<charge density-ex-corr.energy density integral
      59             :       REAL                 :: e_ldau    !<total energy contribution of LDA+U
      60             :       REAL                 :: tote
      61             :       REAL                 :: last_distance
      62             :       REAL                 :: bandgap
      63             :       COMPLEX, ALLOCATABLE    :: unfolding_weights(:,:,:) !weights for unfolding a supercell bandstructure
      64             :       TYPE(t_energy_hf)    ::  te_hfex
      65             :       REAL                 ::  te_hfex_loc(2)
      66             :       REAL, ALLOCATABLE    :: w_iks(:,:,:)
      67             :       REAL, ALLOCATABLE    :: eig(:,:,:)
      68             :       INTEGER, ALLOCATABLE :: neig(:,:) ! neig(nkpts,jspins) number of calculated eigenvalues for each k point, spin
      69             : 
      70             :    CONTAINS
      71             :       PROCEDURE,PASS :: init => results_init
      72             :    END TYPE t_results
      73             : 
      74             :    TYPE t_zMat
      75             :       LOGICAL              :: l_real
      76             :       INTEGER              :: nbasfcn
      77             :       INTEGER              :: nbands
      78             :       REAL,    ALLOCATABLE :: z_r(:,:) ! z_r(nbasfcn,nbands)
      79             :       COMPLEX, ALLOCATABLE :: z_c(:,:) ! z_c(nbasfcn,nbands)
      80             : 
      81             :    CONTAINS
      82             :       PROCEDURE,PASS :: init => zMat_init
      83             :    END TYPE t_zMat
      84             : 
      85             :    TYPE t_hamOvlp
      86             :       LOGICAL              :: l_real
      87             :       INTEGER              :: matsize
      88             :       REAL,    ALLOCATABLE :: a_r(:), b_r(:)
      89             :       COMPLEX, ALLOCATABLE :: a_c(:), b_c(:)
      90             :    END TYPE t_hamOvlp
      91             : 
      92             : CONTAINS
      93             : 
      94           0 :    SUBROUTINE zMat_init(thisZMat,l_real,nbasfcn,nbands)
      95             : 
      96             :       IMPLICIT NONE
      97             : 
      98             :       CLASS(t_zMat),      INTENT(INOUT) :: thisZMat
      99             :       LOGICAL,            INTENT(IN)    :: l_real
     100             :       INTEGER,            INTENT(IN)    :: nbasfcn,nbands
     101             : 
     102           0 :       thisZMat%l_real = l_real
     103           0 :       thisZMat%nbasfcn = nbasfcn
     104           0 :       thisZMat%nbands = nbands
     105             : 
     106           0 :       IF (ALLOCATED(thisZMat%z_r)) DEALLOCATE(thisZMat%z_r)
     107           0 :       IF (ALLOCATED(thisZMat%z_c)) DEALLOCATE(thisZMat%z_c)
     108           0 :       IF (l_real) THEN
     109           0 :          ALLOCATE(thisZMat%z_r(nbasfcn,nbands))
     110           0 :          thisZMat%z_r = 0.0
     111             :       ELSE
     112           0 :          ALLOCATE(thisZMat%z_c(nbasfcn,nbands))
     113           0 :          thisZMat%z_c = CMPLX(0.0,0.0)
     114             :       END IF
     115             : 
     116           0 :    END SUBROUTINE zMat_init
     117             : 
     118          76 :    SUBROUTINE results_init(thisResults,dimension,input,atoms,kpts,noco)
     119             : 
     120             :       USE m_types_setup
     121             :       USE m_types_kpts
     122             : 
     123             :       IMPLICIT NONE
     124             : 
     125             :       CLASS(t_results),      INTENT(INOUT) :: thisResults
     126             :       TYPE(t_dimension),     INTENT(IN)    :: dimension
     127             :       TYPE(t_input),         INTENT(IN)    :: input
     128             :       TYPE(t_atoms),         INTENT(IN)    :: atoms
     129             :       TYPE(t_kpts),          INTENT(IN)    :: kpts
     130             :       TYPE(t_noco),          INTENT(IN)    :: noco
     131             : 
     132             :       INTEGER                              :: neigd2
     133             : 
     134          76 :       thisResults%seigc           = 0.0
     135          76 :       thisResults%seigsc          = 0.0
     136          76 :       thisResults%seigv           = 0.0
     137          76 :       thisResults%seigscv         = 0.0
     138          76 :       thisResults%e_ldau          = 0.0
     139          76 :       thisResults%ts              = 0.0
     140             : 
     141          76 :       thisResults%te_vcoul        = 0.0
     142          76 :       thisResults%te_veff         = 0.0
     143          76 :       thisResults%te_exc          = 0.0
     144          76 :       thisResults%te_hfex%valence = 0.0
     145          76 :       thisResults%te_hfex%core    = 0.0
     146         228 :       thisResults%te_hfex_loc     = 0.0
     147             : 
     148          76 :       thisResults%tote            = 0.0
     149          76 :       thisResults%last_distance   = -1.0
     150          76 :       thisResults%bandgap         = 0.0
     151          76 :       thisResults%ef              = 0.0
     152             : 
     153          76 :       neigd2 = MIN(dimension%neigd,dimension%nbasfcn)
     154             : !   neigd2 = dimension%neigd
     155          76 :       IF (noco%l_soc.AND.(.NOT.noco%l_noco)) neigd2 = 2*neigd2
     156             : 
     157          76 :       ALLOCATE (thisResults%force(3,atoms%ntype,input%jspins));thisResults%force=0.0
     158          76 :       ALLOCATE (thisResults%force_old(3,atoms%ntype));thisResults%force_old=0.0
     159          76 :       ALLOCATE (thisResults%w_iks(neigd2,kpts%nkpt,input%jspins))
     160          76 :       ALLOCATE (thisResults%neig(kpts%nkpt,input%jspins))
     161          76 :       ALLOCATE (thisResults%eig(neigd2,kpts%nkpt,input%jspins))
     162          76 :       ALLOCATE (thisResults%unfolding_weights(neigd2,kpts%nkpt,input%jspins))
     163             : 
     164         182 :       thisResults%force = 0.0
     165         250 :       thisResults%force_old = 0.0
     166         182 :       thisResults%w_iks = 0.0
     167         182 :       thisResults%neig = 0
     168         182 :       thisResults%eig = 0.0
     169             : 
     170          76 :    END SUBROUTINE results_init
     171             : 
     172           0 : END MODULE m_types_misc

Generated by: LCOV version 1.13