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 : MODULE m_dosef
7 : !
8 : !--- > obtain dos at ei (here: ef)
9 : !
10 : USE m_constants
11 : USE m_types
12 : USE m_trisrt
13 :
14 : IMPLICIT NONE
15 :
16 : CONTAINS
17 :
18 0 : SUBROUTINE dosef(ei,nemax,jspins,kpts,sfac,eig,l_output)
19 :
20 : INTEGER, INTENT(IN) :: jspins
21 : TYPE(t_kpts), INTENT(IN) :: kpts
22 : REAL, INTENT(IN) :: ei,sfac
23 : INTEGER, INTENT(IN) :: nemax(:)
24 : REAL, INTENT(IN) :: eig(:,:,:) !(neig,nkpt,jspins)
25 : LOGICAL,INTENT(IN) :: l_output
26 :
27 : REAL :: e1,e2,e21,e3,e31,e32,s
28 : INTEGER :: iBand,jspin,k1,k2,k3,itria,neig
29 :
30 0 : DO jspin = 1,jspins
31 0 : neig = nemax(jspin)
32 0 : s = 0.0
33 0 : DO iBand = 1,neig
34 0 : DO itria = 1,kpts%ntet
35 : !Get the k-points and eigenvalues
36 : !of the current triangle
37 0 : k1 = kpts%ntetra(1,itria)
38 0 : k2 = kpts%ntetra(2,itria)
39 0 : k3 = kpts%ntetra(3,itria)
40 0 : e1 = eig(iBand,k1,jspin)
41 0 : e2 = eig(iBand,k2,jspin)
42 0 : e3 = eig(iBand,k3,jspin)
43 : !Sort by ascending eigenvalues
44 0 : CALL trisrt(e1,e2,e3,k1,k2,k3)
45 0 : IF (e1.LE.-9999.0) cycle !Not all eigenvalues available
46 0 : IF ((ei.LT.e1) .OR. (ei.GE.e3)) cycle !triangle not contributing
47 0 : IF (ei.GT.e2) THEN
48 : !---> e2<ei<e3
49 0 : e31 = e3 - e1
50 0 : e32 = e3 - e2
51 : s = s + 2.0*kpts%voltet(itria)/kpts%ntet &
52 0 : * (e3-ei)/ (e31*e32)
53 : ELSE
54 : !---> e1<ei<e2
55 0 : e31 = e3 - e1
56 0 : e21 = e2 - e1
57 : s = s + 2.0*kpts%voltet(itria)/kpts%ntet &
58 0 : * (ei-e1)/ (e31*e21)
59 : ENDIF
60 : ENDDO
61 : ENDDO
62 : !gb s = (2./jspins)*s
63 0 : s = sfac * s
64 0 : if (l_output) then
65 0 : WRITE (oUnit,FMT=8000) ei,jspin,s
66 : 8000 FORMAT (/,10x,'density of states at',f12.6,&
67 : ' har for spin',i2,'=',e20.8,' states/har')
68 : end if
69 : ENDDO
70 :
71 0 : END SUBROUTINE dosef
72 : END MODULE m_dosef
|