Commit 9cdd9786 authored by Gustav Bihlmayer's avatar Gustav Bihlmayer

Added the phase factors in the vacuum for nonsymmorphic films: affects

cdnovlp for the starting density and vgen_coulomb, vintcz, and vvacis.
Another modification in strgn for inversion and no z-reflection in the
film case added.
parent 698c9cbd
......@@ -116,7 +116,7 @@
REAL, INTENT (INOUT) :: rh(DIMENSION%msh,atoms%ntype)
! ..
! .. Local Scalars ..
COMPLEX czero,carg,VALUE,slope,ci
COMPLEX czero,carg,VALUE,slope,ci,c_ph
REAL dif,dxx,g,gz,dtildh,&
& rkappa,sign,signz,tol_14,z,zero,zvac,&
& g2,phi,gamma,qq
......@@ -300,6 +300,7 @@
! ---> sum over gz-stars
DO 250 kz = m0,stars%mx3
ig3 = stars%ig(k1,k2,kz)
c_ph = stars%rgphs(k1,k2,kz) ! phase factor for invs=T & zrfs=F
! ----> use only stars within the g_max sphere (oct.97 shz)
IF (ig3.NE.0) THEN
nz = 1
......@@ -308,8 +309,8 @@
DO 240 nrz = 1,nz
signz = 3. - 2.*nrz
carg = ci*sign*signz*gz
VALUE = VALUE + qpwc(ig3)* EXP(carg*cell%z1)
slope = slope + carg*qpwc(ig3)* EXP(carg*cell%z1)
VALUE = VALUE + c_ph*qpwc(ig3)* EXP(carg*cell%z1)
slope = slope + c_ph*carg*qpwc(ig3)* EXP(carg*cell%z1)
240 ENDDO
END IF
250 ENDDO
......
......@@ -37,7 +37,7 @@ CONTAINS
REAL gmi,gla,eps
REAL gfx,gfy,pon,pon2
INTEGER j,k,k1,k2,k3,m0,mxx1,mxx2,n
INTEGER ned1,nint,kdone,i
INTEGER ned1,nint,kdone,i,i_sym,n_sym
LOGICAL NEW,l_cdn1,l_xcExtended, l_error
INTEGER kfx,kfy,kfz,kidx,nfftx,nffty,nfftz,kfft
INTEGER nfftxy,norm,n1,kidx2,k2i
......@@ -70,6 +70,12 @@ CONTAINS
GOTO 270
END IF
IF (input%film.AND.sym%invs.AND.(.not.sym%zrfs).AND.(.not.sym%symor)) THEN
n_sym = 2 ! needs reordering of 2d-stars
ELSE
n_sym = 1 ! as before...
ENDIF
mxx1 = 0
mxx2 = 0
stars%ng2 = 0
......@@ -80,45 +86,53 @@ CONTAINS
kv(1) = k1
k2_loop:DO k2 = stars%mx2,-stars%mx2,-1
kv(2) = k2
DO j = 1,2
g(j) = kv(1)*cell%bmat(1,j) + kv(2)*cell%bmat(2,j)
ENDDO
s = SQRT(g(1)**2+g(2)**2)
!---> determine the angle of the G_{||} needed in odim calculations
!+odim YM cute little 'angle' is written by me to determine the phi2
phi = angle(g(1),g(2))
!-odim
!
!---> check if generated vector belongs to a star already
!---> stars should be within the g_max-sphere ! (Oct.97) sbluegel
!
IF (s.LT.stars%gmax) THEN
CALL spgrot(&
& sym%nop,sym%symor,sym%mrot,sym%tau,sym%invtab,&
& kv,&
& kr)
DO n = 1,sym%nop2
IF (mxx1.LT.kr(1,n)) mxx1 = kr(1,n)
IF (mxx2.LT.kr(2,n)) mxx2 = kr(2,n)
ENDDO
DO k = 1,stars%ng2
DO n = 1,sym%nop2
IF (kr(1,n).EQ.stars%kv2(1,k) .AND.&
& kr(2,n).EQ.stars%kv2(2,k)) CYCLE k2_loop
ENDDO
ENDDO
!---> new representative found
stars%ng2 = stars%ng2 + 1
IF (stars%ng2.GT.stars%ng2) THEN
WRITE (6,8070) stars%ng2,stars%ng2
CALL juDFT_error("nq2.GT.n2d",calledby="strgn")
ENDIF
DO j = 1,2
stars%kv2(j,stars%ng2) = kv(j)
ENDDO
stars%sk2(stars%ng2) = s
stars%phi2(stars%ng2) = phi
ENDIF
DO i_sym = 1, n_sym
IF (i_sym == 2) THEN
kv(1) = - kv(1) ; kv(2) = - kv(2)
ENDIF
DO j = 1,2
g(j) = kv(1)*cell%bmat(1,j) + kv(2)*cell%bmat(2,j)
ENDDO
s = SQRT(g(1)**2+g(2)**2)
!---> determine the angle of the G_{||} needed in odim calculations
!+odim YM cute little 'angle' is written by me to determine the phi2
phi = angle(g(1),g(2))
!-odim
!
!---> check if generated vector belongs to a star already
!---> stars should be within the g_max-sphere ! (Oct.97) sbluegel
!
IF (s.LT.stars%gmax) THEN
CALL spgrot(&
& sym%nop,sym%symor,sym%mrot,sym%tau,sym%invtab,&
& kv,&
& kr)
DO n = 1,sym%nop2
IF (mxx1.LT.kr(1,n)) mxx1 = kr(1,n)
IF (mxx2.LT.kr(2,n)) mxx2 = kr(2,n)
ENDDO
DO k = 1,stars%ng2
DO n = 1,sym%nop2
IF (kr(1,n).EQ.stars%kv2(1,k) .AND.&
& kr(2,n).EQ.stars%kv2(2,k)) CYCLE k2_loop
ENDDO
ENDDO
!---> new representative found
stars%ng2 = stars%ng2 + 1
IF (stars%ng2.GT.stars%ng2) THEN
WRITE (6,8070) stars%ng2,stars%ng2
CALL juDFT_error("nq2.GT.n2d",calledby="strgn")
ENDIF
DO j = 1,2
stars%kv2(j,stars%ng2) = kv(j)
ENDDO
stars%sk2(stars%ng2) = s
stars%phi2(stars%ng2) = phi
ENDIF
ENDDO ! i_sym
ENDDO k2_loop
ENDDO
8070 FORMAT ('nq2 = ',i5,' > n2d =',i5)
......
......@@ -158,6 +158,9 @@ CONTAINS
!
xint = CMPLX(af1(i),bf1(i))*ani
nzst1 = stars%nstr(irec3)/stars%nstr2(irec2)
IF (sym%invs.AND.(.NOT.sym%zrfs)) THEN
xint = xint*stars%rgphs(stars%kv2(1,irec2),stars%kv2(2,irec2),k3)
ENDIF
vCoul%pw(irec3,1) = vCoul%pw(irec3,1) + xint/nzst1
END IF
ENDIF
......
......@@ -32,7 +32,7 @@ CONTAINS
! ..
! .. Local Scalars ..
COMPLEX, PARAMETER :: ci = (0.0,1.0)
COMPLEX argr,sumrr,vcons1,test
COMPLEX argr,sumrr,vcons1,test,c_ph
REAL bj0,dh,fit,g,g3,q,qdh,signz,vcons2,zf
REAL e_m,e_p,cos_q,sin_q
INTEGER ig3n,im,iq,ivac,k1,k2,m0,nrz,nz
......@@ -112,11 +112,12 @@ CONTAINS
ig3n = stars%ig(k1,k2,iq)
! ----> use only stars within the g_max sphere (oct.97 shz)
IF (ig3n.NE.0) THEN
c_ph = stars%rgphs(k1,k2,iq)
! -----> v3(z)
q = iq*cell%bmat(3,3)
g = stars%sk2(nrec2)
g3 = stars%sk3(ig3n)
vcons1 = fpi_const*psq(ig3n)/ (g3*g3)
vcons1 = fpi_const*psq(ig3n)*c_ph / (g3*g3)
nz = 1
IF (sym%zrfs) nz = stars%nstr(ig3n)/stars%nstr2(nrec2)
IF (field%efield%dirichlet) THEN
......@@ -138,7 +139,7 @@ CONTAINS
END DO loop_vacua
vintcz = vintcz&
& + vcons1*(e_m*SINH(g*(field%efield%zsigma+dh-z))&
& +e_p*SINH(g*(field%efield%zsigma+dh+z)))
& +e_p*SINH(g*(field%efield%zsigma+dh+z)))
ELSE
sumrr = (0.0,0.0)
vcons2 = - 1.0 / (2.*g)
......
......@@ -28,7 +28,7 @@ CONTAINS
COMPLEX, INTENT (OUT):: vxy(vacuum%nmzxyd,stars%ng2-1,2)
! ..
! .. Local Scalars ..
COMPLEX arg,ci
COMPLEX arg,ci,c_ph
REAL dh,g,qz,sign,signz,vcons,z,e_m
REAL arg_r,arg_i
INTEGER i2d,ig3n,imz,imzxy,ivac,k1,k2,kz,m0,nrec2,nrz,nz
......@@ -63,6 +63,7 @@ CONTAINS
ig3n = stars%ig(k1,k2,kz)
! ----> use only stars within the g_max sphere (oct.97 shz)
IF (ig3n.NE.0) THEN
c_ph = stars%rgphs(k1,k2,kz)
nz = 1
IF (sym%zrfs) nz = stars%nstr(ig3n)/stars%nstr2(nrec2)
qz = kz*cell%bmat(3,3)
......@@ -74,7 +75,7 @@ CONTAINS
arg = EXP(-ci*signz*qz*dh)&
& /(2*(g**2 + qz**2)) * psq(ig3n)
IF (ivac == 1) THEN
sumr(ivac) = sumr(ivac) + EXP(-arg_r)*arg*(&
sumr(ivac) = sumr(ivac) + c_ph*EXP(-arg_r)*arg*(& ! c_ph not tested in this case
& (- EXP(2*g*(field%efield%zsigma+dh))&
& + EXP(2*(ci*signz*qz*dh+arg_r)))&
& *(g-ci*signz*qz)&
......@@ -82,7 +83,7 @@ CONTAINS
& + EXP(2*ci*signz*qz*dh))&
& *(g+ci*signz*qz) )
ELSE
sumr(ivac) = sumr(ivac) + arg*(&
sumr(ivac) = sumr(ivac) + c_ph*arg*(&
& EXP(arg_r)*(g+ci*signz*qz)&
& +(g-ci*signz*qz)*EXP(-arg_r)&
& +2*EXP(2*(ci*signz*qz*dh))&
......@@ -92,7 +93,7 @@ CONTAINS
ELSE
arg = g + sign*ci*signz*qz
arg_i = sign*signz*qz*dh
sumr(ivac) = sumr(ivac) + psq(ig3n)*(&
sumr(ivac) = sumr(ivac) + c_ph*psq(ig3n)*(&
& COS(arg_i)*( 1 - arg_r ) +&
& ci*SIN(arg_i)*( 1 + arg_r ) ) / arg
END IF
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment