LCOV - code coverage report
Current view: top level - propcalc/dos - types_slab.F90 (source / functions) Hit Total Coverage
Test: FLEUR test coverage Lines: 21 49 42.9 %
Date: 2024-05-15 04:28:08 Functions: 1 6 16.7 %

          Line data    Source code
       1             : !--------------------------------------------------------------------------------
       2             : ! Copyright (c) 2020 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             : MODULE m_types_slab
       7             :   use m_judft
       8             :   use m_types_eigdos
       9             :   implicit none
      10             :   PRIVATE
      11             :   public t_slab
      12             :    TYPE,extends(t_eigdos):: t_slab
      13             :       INTEGER              :: nsld, nsl
      14             : 
      15             :       INTEGER, ALLOCATABLE :: nmtsl(:,:)
      16             :       INTEGER, ALLOCATABLE :: nslat(:,:)
      17             :       REAL,    ALLOCATABLE :: zsl(:,:)
      18             :       REAL,    ALLOCATABLE :: volsl(:)
      19             :       REAL,    ALLOCATABLE :: volintsl(:)
      20             :       REAL,    ALLOCATABLE :: qintsl(:,:,:,:)
      21             :       REAL,    ALLOCATABLE :: qmtsl(:,:,:,:)
      22             : 
      23             :       CONTAINS
      24             :          PROCEDURE,PASS :: init => slab_init
      25             :          PROCEDURE      :: get_num_weights
      26             :          PROCEDURE      :: get_weight_eig
      27             :          PROCEDURE      :: get_weight_name
      28             :    END TYPE t_slab
      29             : CONTAINS
      30           0 :   integer function get_num_weights(this)
      31             :     class(t_slab),intent(in):: this
      32           0 :     get_num_weights=2*this%nsl
      33           0 :   END function
      34             : 
      35           0 :   character(len=20) function get_weight_name(this,id)
      36             :     class(t_slab),intent(in):: this
      37             :     INTEGER,intent(in)         :: id
      38             : 
      39             :     INTEGER :: ind,n
      40           0 :     ind=0
      41           0 :     DO n=1,this%nsl
      42           0 :       ind=ind+1
      43           0 :       if (ind==id) write(get_weight_name,"(a,i0)") "SLAB(INT):",n
      44           0 :       ind=ind+1
      45           0 :       if (ind==id) write(get_weight_name,"(a,i0)") "SLAB(MT):",n
      46           0 :       IF(ind>id) return
      47             :     ENDDO
      48             :   end function
      49             : 
      50           0 :   function get_weight_eig(this,id)
      51             :     class(t_slab),intent(in):: this
      52             :     INTEGER,intent(in)      :: id
      53             :     real,allocatable:: get_weight_eig(:,:,:)
      54             : 
      55             : 
      56             :     INTEGER :: ind,n
      57           0 :     ind=0
      58           0 :     DO n=1,this%nsl
      59           0 :       ind=ind+1
      60           0 :       if (ind==id) get_weight_eig=this%qintsl(n,:,:,:)
      61           0 :       ind=ind+1
      62           0 :       if (ind==id) get_weight_eig=this%qmtsl(n,:,:,:)
      63             :     ENDDO
      64             :   end function
      65             : 
      66             : 
      67             : 
      68         672 :   SUBROUTINE slab_init(thisSlab,banddos,atoms,cell,input,kpts)
      69             : 
      70             :    USE m_types_setup
      71             :    USE m_types_kpts
      72             :    USE m_slabdim
      73             :    USE m_slabgeom
      74             : 
      75             :    IMPLICIT NONE
      76             : 
      77             :    CLASS(t_slab),      INTENT(INOUT) :: thisSlab
      78             :    TYPE(t_banddos),    INTENT(IN)    :: banddos
      79             : 
      80             :    TYPE(t_atoms),      INTENT(IN)    :: atoms
      81             :    TYPE(t_cell),       INTENT(IN)    :: cell
      82             :    TYPE(t_input),      INTENT(IN)    :: input
      83             :    TYPE(t_kpts),       INTENT(IN)    :: kpts
      84             : 
      85             :    INTEGER :: nsld
      86         672 :    thisSlab%name_of_dos="SLAB"
      87         672 :    nsld=1
      88         672 :    IF (banddos%l_slab.AND.banddos%dos) THEN
      89           0 :       CALL slab_dim(atoms, nsld)
      90           0 :       ALLOCATE (thisSlab%nmtsl(atoms%ntype,nsld))
      91           0 :       ALLOCATE (thisSlab%nslat(atoms%nat,nsld))
      92           0 :       ALLOCATE (thisSlab%zsl(2,nsld))
      93           0 :       ALLOCATE (thisSlab%volsl(nsld))
      94           0 :       ALLOCATE (thisSlab%volintsl(nsld))
      95           0 :       ALLOCATE (thisSlab%qintsl(nsld,input%neig,kpts%nkpt,input%jspins))
      96           0 :       ALLOCATE (thisSlab%qmtsl(nsld,input%neig,kpts%nkpt,input%jspins))
      97             :       CALL slabgeom(atoms,cell,nsld,thisSlab%nsl,thisSlab%zsl,thisSlab%nmtsl,&
      98           0 :                     thisSlab%nslat,thisSlab%volsl,thisSlab%volintsl)
      99             :    ELSE
     100         672 :      allocate(thisSlab%dos(0,0,0))
     101         672 :       ALLOCATE (thisSlab%nmtsl(1,1))
     102         672 :       ALLOCATE (thisSlab%nslat(1,1))
     103         672 :       ALLOCATE (thisSlab%zsl(1,1))
     104         672 :       ALLOCATE (thisSlab%volsl(1))
     105         672 :       ALLOCATE (thisSlab%volintsl(1))
     106        2016 :       ALLOCATE (thisSlab%qintsl(1,1,1,input%jspins))
     107        1344 :       ALLOCATE (thisSlab%qmtsl(1,1,1,input%jspins))
     108             :    END IF
     109         672 :    thisSlab%nsld = nsld
     110             : 
     111        2016 :    thisSlab%nmtsl = 0
     112        2016 :    thisSlab%nslat = 0
     113        2016 :    thisSlab%zsl = 0.0
     114        1344 :    thisSlab%volsl = 0.0
     115        1344 :    thisSlab%volintsl = 0.0
     116        4944 :    thisSlab%qintsl = 0.0
     117        4944 :    thisSlab%qmtsl = 0.0
     118             : 
     119         672 : END SUBROUTINE slab_init
     120             : 
     121           0 : end module m_types_slab

Generated by: LCOV version 1.14