wann_2dvacabcof.F 4.63 KB
 Markus Betzinger committed Apr 26, 2016 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 `````` MODULE m_wann_2dvacabcof use m_juDFT c******************************************************** c calculate a-, and b-coefficients of 2d-vacuum c Frank Freimuth, November 2006 c******************************************************** CONTAINS SUBROUTINE wann_2dvacabcof( >nv2d,nslibd,nvac,nmzd,nmz,omtil,vz,nv,bkpt,z1, >nvd,k1,k2,k3,evac,bbmat,delz,bmat,nbasfcn,neigd,z, nv2d) CALL juDFT_error("wann_plot: vac",calledby + ="wann_2dvacabcof") kvac1(n2) = k1(k) kvac2(n2) = k2(k) map2(k) = n2 40 continue nv2=n2 do ivac=1,nvac evacp=evac(ivac) sign=3-2*ivac do ik = 1,nv2 v(1) = bkpt(1) + kvac1(ik) v(2) = bkpt(2) + kvac2(ik) v(3) = 0. ev = evacp - 0.5*dotirp(v,v,bbmat) call vacuz(ev,vz(1,ivac),vz0(ivac),nmz,delz,t(ik), + dt(ik), + u(1,ik,ivac)) call vacudz(ev,vz(1,ivac),vz0(ivac),nmz,delz,te(ik), + dte(ik),tei(ik),ue(1,ik,ivac),dt(ik), + u(1,ik,ivac)) scale = wronk/ (te(ik)*dt(ik)- - dte(ik)*t(ik)) te(ik) = scale*te(ik) dte(ik) = scale*dte(ik) tei(ik) = scale*tei(ik) do j = 1,nmz ue(j,ik,ivac) = scale*ue(j,ik,ivac) enddo enddo c do l=1,nv2 c do j=1,nmz c if (abs(ue(j,l,ivac)).gt.10)then c print*,"l=",l c print*,"j=",j c print*,"ue(j,l,ivac)=",ue(j,l,ivac) c endif c enddo c enddo jvac=ivac symvacvac=1 if (nvac==1) symvacvac=2 do symvac=1,symvacvac if(symvac==2) then sign=-1.0 jvac=2 endif do i = 1,nv2d do n = 1,nslibd ac(i,n,jvac) = cmplx(0.0,0.0) bc(i,n,jvac) = cmplx(0.0,0.0) enddo enddo do k = 1,nv l = map2(k) zks = k3(k)*bmat(3,3)*sign arg = zks*z1 c_1 = cmplx(cos(arg),sin(arg)) * const av = -c_1 * cmplx( dte(l),zks*te(l) ) bv = c_1 * cmplx( dt(l),zks* t(l) ) c-----> loop over basis functions do n = 1,nslibd ac(l,n,jvac) = ac(l,n,jvac) + z(k,n)*av bc(l,n,jvac) = bc(l,n,jvac) + z(k,n)*bv enddo enddo enddo !symvac enddo !loop over ivac deallocate (dt,dte,t,te,tei) END SUBROUTINE END MODULE m_wann_2dvacabcof``````