Commit dc354d5b authored by Robin Hilgers's avatar Robin Hilgers

outcdn.f90 now uses potDen types.

parent e8a1bb9e
......@@ -40,10 +40,7 @@
!+odim
! ..
! .. Array Arguments ..
COMPLEX qpw(:,:) !(stars%ng3,input%jspins)
COMPLEX rhtxy(:,:,:,:) !(vacuum%nmzxyd,oneD%odi%n2d-1,2,input%jspins)
REAL rho(:,0:,:,:) !(atoms%jmtd,0:sphhar%nlhd,atoms%ntype,input%jspins)
REAL rht(:,:,:) !(vacuum%nmzd,2,input%jspins)
REAL, INTENT (INOUT) :: p(3)
! ..
! .. Local Scalars ..
......@@ -59,10 +56,10 @@
REAL rcc(3),x(3)
!Temp. Variable Assignment TODO: Can be removed as soon as the potDen datatype has been implemented in the whole file.
qpw=potDen%pw
rhtxz=potDen%vacxy
rho=potDen%mt
rht=potDen%vacz
!qpw=potDen%pw
!rhtxz=potDen%vacxy
!rho=potDen%mt
!rht=potDen%vacz
ivac=iv
......@@ -76,7 +73,7 @@
& sym%nop,stars%ng3,sym%symor,stars%kv3,sym%mrot,sym%tau,rcc,sym%invtab,&
& sf3)
!
xdnout=dot_product(real(qpw(:,jsp)*sf3(:)),stars%nstr)
xdnout=dot_product(real(potDen%pw(:,jsp)*sf3(:)),stars%nstr)
RETURN
! ---> vacuum part
ENDIF
......@@ -90,18 +87,18 @@
!* we count 0 as point 1
jp3 = jp3 + 1
IF (jp3.LT.vacuum%nmz) THEN
xdnout = rht(jp3,ivac,jsp) + delta*&
& (rht(jp3+1,ivac,jsp)-rht(jp3,ivac,jsp))
xdnout = potDen%vacz(jp3,ivac,jsp) + delta*&
& (potDen%vacz(jp3+1,ivac,jsp)-potDen%vacz(jp3,ivac,jsp))
IF (jp3.LT.vacuum%nmzxy) THEN
xx1 = 0.
xx2 = 0.
DO k = 2,oneD%odi%nq2
m = oneD%odi%kv(2,k)
gzi = oneD%odi%kv(1,k)
xx1 = xx1 + real(rhtxy(jp3,k-1,ivac,jsp)*&
xx1 = xx1 + real(potDen%vacxy(jp3,k-1,ivac,jsp)*&
& exp(ImagUnit*m*phi)*exp(ImagUnit*gzi*cell%bmat(3,3)*p(3)))*&
& oneD%odi%nst2(k)
xx2 = xx2 + real(rhtxy(jp3+1,k-1,ivac,jsp)*&
xx2 = xx2 + real(potDen%vacxy(jp3+1,k-1,ivac,jsp)*&
& exp(ImagUnit*m*phi)*exp(ImagUnit*gzi*cell%bmat(3,3)*p(3)))*&
& oneD%odi%nst2(k)
ENDDO
......@@ -131,14 +128,14 @@
!* we count 0 as point 1
jp3 = jp3 + 1
IF (jp3.LT.vacuum%nmz) THEN
xdnout = rht(jp3,ivac,jsp) + delta*&
& (rht(jp3+1,ivac,jsp)-rht(jp3,ivac,jsp))
xdnout = potDen%vacz(jp3,ivac,jsp) + delta*&
& (potDen%vacz(jp3+1,ivac,jsp)-potDen%vacz(jp3,ivac,jsp))
IF (jp3.LT.vacuum%nmzxy) THEN
xx1 = 0.
xx2 = 0.
DO k = 2,stars%ng2
xx1 = xx1 + real(rhtxy(jp3,k-1,ivac,jsp)*sf2(k))*stars%nstr2(k)
xx2 = xx2 + real(rhtxy(jp3+1,k-1,ivac,jsp)*sf2(k))*&
xx1 = xx1 + real(potDen%vacxy(jp3,k-1,ivac,jsp)*sf2(k))*stars%nstr2(k)
xx2 = xx2 + real(potDen%vacxy(jp3+1,k-1,ivac,jsp)*sf2(k))*&
& stars%nstr2(k)
enddo
xdnout = xdnout + xx1 + delta* (xx2-xx1)
......@@ -198,15 +195,15 @@
s = s + real( sphhar%clnu(mem,lh,nd)*ylm(lm) )
ENDDO
IF (l_potential) THEN
xd1 = xd1 + rho(jr,lh,n,jsp)*s
xd1 = xd1 + potDen%mt(jr,lh,n,jsp)*s
ELSE
xd1 = xd1 + rho(jr,lh,n,jsp)*s/ (atoms%rmsh(jr,n)*atoms%rmsh(jr,n))
xd1 = xd1 + potDen%mt(jr,lh,n,jsp)*s/ (atoms%rmsh(jr,n)*atoms%rmsh(jr,n))
END IF
IF (jr.EQ.atoms%jri(n)) CYCLE
IF (l_potential) THEN
xd2 = xd2 + rho(jr+1,lh,n,jsp)*s
xd2 = xd2 + potDen%mt(jr+1,lh,n,jsp)*s
ELSE
xd2 = xd2 + rho(jr+1,lh,n,jsp)*s/&
xd2 = xd2 + potDen%mt(jr+1,lh,n,jsp)*s/&
& (atoms%rmsh(jr+1,n)*atoms%rmsh(jr+1,n))
END IF
ENDDO
......
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