Line data Source code
1 : MODULE m_intnv
2 : ! ************************************************
3 : ! calculates the integral of charge density
4 : ! and potential in the unit cell
5 : ! ************************************************
6 : CONTAINS
7 1210 : SUBROUTINE int_nv(ispin,stars,vacuum,atoms,sphhar,cell,sym,input ,vpot,den,RESULT)
8 :
9 : USE m_types
10 : USE m_constants
11 : USE m_intgr, ONLY : intgr3,intgz0
12 :
13 : IMPLICIT NONE
14 : ! ..
15 : ! .. Scalar Arguments ..
16 : REAL RESULT
17 : INTEGER,INTENT(IN) :: ispin
18 : TYPE(t_stars),INTENT(IN) :: stars
19 : TYPE(t_vacuum),INTENT(IN) :: vacuum
20 : TYPE(t_atoms),INTENT(IN) :: atoms
21 : TYPE(t_sphhar),INTENT(IN) :: sphhar
22 : TYPE(t_cell),INTENT(IN) :: cell
23 : TYPE(t_sym),INTENT(IN) :: sym
24 : TYPE(t_input),INTENT(IN) :: input
25 :
26 : TYPE(t_potden),INTENT(IN) :: vpot,den
27 :
28 :
29 : ! ..
30 : ! .. Local Scalars ..
31 : REAL dpdot,facv,tis,tmt,tvac,tvact
32 : INTEGER i,ip,ivac,j,k2,lh,n,npz,nat
33 : LOGICAL tail
34 : ! ..
35 : ! .. Local Arrays ..
36 1210 : REAL dpj(atoms%jmtd),dpz(vacuum%nmzd)
37 : ! ..
38 : ! ..
39 : ! -----> CALCULATE DENSITY-POTENTIAL INTEGRALS
40 : !
41 : ! ******************* INTERSTITIAL REGION**********************
42 : !
43 : ! -> warping has been moved to vgen and visxc resp. ...gustav
44 : !
45 2681371 : tis = cell%omtil * REAL( DOT_PRODUCT(vpot%pw_w(:stars%ng3,ispin),den%pw(:stars%ng3,ispin)))
46 :
47 1210 : WRITE (oUnit,FMT=8020) tis
48 : 8020 FORMAT (/,10x,'interstitial :',t40,ES20.10)
49 :
50 1210 : RESULT = RESULT + tis
51 : !
52 : ! ******************M.T. SPHERES*******************
53 : !
54 1210 : tmt = 0.
55 3335 : DO n = 1,atoms%ntype
56 2125 : nat = atoms%firstAtom(n)
57 59003 : DO lh = 0,sphhar%nlh(sym%ntypsy(nat))
58 40148004 : DO j = 1,atoms%jri(n)
59 40148004 : dpj(j) = den%mt(j,lh,n,ispin)*vpot%mt(j,lh,n,ispin)
60 : ENDDO
61 55668 : CALL intgr3(dpj,atoms%rmsh(1,n),atoms%dx(n),atoms%jri(n),dpdot)
62 57793 : tmt = tmt + dpdot*atoms%neq(n)
63 : ENDDO
64 : ENDDO
65 1210 : WRITE (oUnit,FMT=8030) tmt
66 : 8030 FORMAT (/,10x,'muffin tin spheres :',t40,ES20.10)
67 1210 : RESULT = RESULT + tmt
68 : !
69 : ! *********** VACUUM REGION**************
70 : !
71 1210 : IF (input%film ) THEN
72 125 : npz = vacuum%nmz + 1
73 125 : tail = .TRUE.
74 125 : facv=2.0/vacuum%nvac
75 125 : tvac = 0.
76 125 : tvact = 0.
77 : ! set array dpz to zero
78 31375 : dpz=0.0
79 290 : DO ivac = 1,vacuum%nvac
80 41415 : DO ip = 1,vacuum%nmz
81 41415 : dpz(npz-ip) = REAL(den%vac(ip,1,ivac,ispin))*REAL(vpot%vac(ip,1,ivac,ispin))
82 : ! ---> WARPING REGION
83 : ENDDO
84 49444 : DO k2 = 2,stars%ng2
85 4977344 : DO ip = 1,vacuum%nmzxy
86 : dpz(npz-ip) = dpz(npz-ip) + stars%nstr2(k2)*den%vac(ip,k2,ivac,ispin)*&
87 4977179 : & CONJG(vpot%vac(ip,k2,ivac,ispin))
88 : ENDDO
89 : ENDDO
90 165 : CALL intgz0(dpz,vacuum%delz,vacuum%nmz,tvac,tail)
91 290 : tvact = tvact + cell%area*tvac*facv
92 : ENDDO
93 125 : WRITE (oUnit,FMT=8040) tvact
94 : 8040 FORMAT (/,10x,'vacuum :',t40,f20.10)
95 125 : RESULT = RESULT + tvact
96 :
97 : END IF
98 :
99 1210 : END SUBROUTINE int_nv
100 : END MODULE m_intnv
|