Commit 390d7f82 authored by Robin Hilgers's avatar Robin Hilgers

Got the angles working now too.

parent 49344fd9
......@@ -27,13 +27,15 @@ SUBROUTINE rotateMagnetToSpinAxis(noco,vacuum,sphhar,stars&
TYPE(t_oneD),INTENT(IN) :: oneD
TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_potden), INTENT(INOUT) :: den
REAL :: moments(atoms%ntype,3)
REAL :: phiTemp(atoms%ntype),thetaTemp(atoms%ntype)
phiTemp=atoms%phi_mt_avg
thetaTemp=atoms%theta_mt_avg
CALL magnMomFromDen(input,atoms,noco,den,moments)
CALL flipcdn(atoms,input,vacuum,sphhar,stars,sym,noco,oneD,cell,atoms%phi_mt_avg,atoms%theta_mt_avg,den)
CALL flipcdn(atoms,input,vacuum,sphhar,stars,sym,noco,oneD,cell,-atoms%phi_mt_avg,-atoms%theta_mt_avg,den)
atoms%phi_mt_avg=atoms%phi_mt_avg+phiTemp
atoms%theta_mt_avg=atoms%theta_mt_avg+thetaTemp
END SUBROUTINE rotateMagnetToSpinAxis
......@@ -51,7 +53,7 @@ SUBROUTINE rotateMagnetFromSpinAxis(noco,vacuum,sphhar,stars&
TYPE(t_potden), INTENT(INOUT) :: den
CALL flipcdn(atoms,input,vacuum,sphhar,stars,sym,noco,oneD,cell,-atoms%phi_mt_avg,-atoms%theta_mt_avg,den)
CALL flipcdn(atoms,input,vacuum,sphhar,stars,sym,noco,oneD,cell,atoms%phi_mt_avg,atoms%theta_mt_avg,den)
atoms%flipSpinPhi=0
atoms%flipSpinTheta=0
......
......@@ -87,8 +87,8 @@ DEALLOCATE(dummyResults)
phi = ATAN(my/mx) - pi_const
ENDIF
ENDIF
atoms%phi_mt_avg(i)=phi+atoms%phi_mt_avg(i)
atoms%theta_mt_avg(i)=theta+atoms%theta_mt_avg(i)
atoms%phi_mt_avg(i)=phi
atoms%theta_mt_avg(i)=theta
ENDDO
END SUBROUTINE magnMomFromDen
......
......@@ -245,6 +245,8 @@ END DO
END IF
IF(PRESENT(optDen)) optDen=den
END SUBROUTINE flipcdn
END MODULE m_flipcdn
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