Commit 84f9eb23 authored by Gregor Michalicek's avatar Gregor Michalicek

Refine commit 72326e12.

parent 0b79eff7
......@@ -115,15 +115,11 @@ CONTAINS
IF (PRESENT(rho)) ALLOCATE(rho(0:ifftd-1,jspins))
ENDIF
IF (l_noco) THEN
IF (l_rdm) THEN
ALLOCATE (rhodiag(0:SIZE(rho,1)-1,jspins))
ALLOCATE (sinsqu(0:SIZE(rho,1)-1),cossqu(0:SIZE(rho,1)-1),sincos(0:SIZE(rho,1)-1),exi(0:SIZE(rho,1)-1))
END IF
IF (dograds) THEN
ALLOCATE( mx(0:ifftxc3-1),my(0:ifftxc3-1),magmom(0:ifftxc3-1))
IF (l_rdm) THEN
ALLOCATE( der(0:ifftxc3-1,3,4),dder(0:ifftxc3-1,3,3,4),rhdd(0:ifftxc3-1,2,3,3) )
ALLOCATE( rhodiag(0:ifftxc3-1,jspins),der(0:ifftxc3-1,3,4),dder(0:ifftxc3-1,3,3,4),rhdd(0:ifftxc3-1,2,3,3) )
ALLOCATE( sinsqu(0:ifftxc3-1),cossqu(0:ifftxc3-1),sincos(0:ifftxc3-1),exi(0:ifftxc3-1) )
ELSE
ALLOCATE( dmagmom(0:ifftxc3-1,3),ddmagmom(0:ifftxc3-1,3,3) )
ENDIF
......@@ -154,13 +150,13 @@ CONTAINS
DO i=0,MIN(SIZE(rho,1),size(mx))-1
rhotot= 0.5*( rho(i,1) + rho(i,2) )
magmom(i)= SQRT( (0.5*(rho(i,1)-rho(i,2)))**2 + mx(i)**2 + my(i)**2 )
IF (l_rdm) THEN
IF (l_rdm.AND.dograds) THEN
rhodiag(i,1) = rho(i,1)
rhodiag(i,2) = rho(i,2)
ENDIF
rho(i,1)= rhotot+magmom(i)
rho(i,2)= rhotot-magmom(i)
IF (l_rdm) THEN ! prepare rotation matrix
IF (l_rdm.AND.dograds) THEN ! prepare rotation matrix
mmx = 2.0 * mx(i)
mmy = 2.0 * my(i)
mmz = rhodiag(i,1) - rhodiag(i,2)
......
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