Skip to content
Snippets Groups Projects
Commit 31cd4cea authored by Nicolas Essing's avatar Nicolas Essing
Browse files

Output the external magnetic field angles in degrees, not radians.

parent 1a11fdbc
No related branches found
No related tags found
No related merge requests found
...@@ -243,22 +243,15 @@ contains ...@@ -243,22 +243,15 @@ contains
strength(:) = 0. strength(:) = 0.
end if end if
theta(:) = theta(:) / 360.0d0 * 8.d0 * datan(1.d0) ! Output before converting to radians and to carthesian coordinates.
phi(:) = phi(:) / 360.0d0 * 8.d0 * datan(1.d0)
do iatom = 1, number_of_atoms
bfields(iatom)%bfield_ext(1) = strength(iatom) * sin(theta(iatom)) * cos(phi(iatom))
bfields(iatom)%bfield_ext(2) = strength(iatom) * sin(theta(iatom)) * sin(phi(iatom))
bfields(iatom)%bfield_ext(3) = strength(iatom) * cos(theta(iatom))
end do
if (verbosity >= 3) then if (verbosity >= 3) then
! Write detailed information ! Write detailed information
write(*,'(79("#"))') write(*,'(79("#"))')
write(*,'(16X,A)') 'external non-collinear magnetic fields' write(*,'(16X,A)') 'external non-collinear magnetic fields'
write(*,'(79("#"))') write(*,'(79("#"))')
write(*,'(2X,A4,3(5X,A11,1X))') 'atom', ' theta ', ' phi ', 'bfield [Ry]' write(*,'(2X,A4,4X,A10,6X,A8,6X,A11)') 'atom', 'theta [°]', 'phi [°]', 'bfield [Ry]'
do iatom = 1, number_of_atoms do iatom = 1, number_of_atoms
write(*,'(2X,I4,3(2X,E15.8))') iatom, theta(iatom), phi(iatom), strength(iatom) write(*,'(2X,I4,2(2X,F12.8),2X,E15.8)') iatom, theta(iatom), phi(iatom), strength(iatom)
end do end do
write(*,'(79("#"))') write(*,'(79("#"))')
else if (verbosity >= 2) then else if (verbosity >= 2) then
...@@ -272,6 +265,14 @@ contains ...@@ -272,6 +265,14 @@ contains
else else
! No output ! No output
end if end if
theta(:) = theta(:) / 360.0d0 * 8.d0 * datan(1.d0)
phi(:) = phi(:) / 360.0d0 * 8.d0 * datan(1.d0)
do iatom = 1, number_of_atoms
bfields(iatom)%bfield_ext(1) = strength(iatom) * sin(theta(iatom)) * cos(phi(iatom))
bfields(iatom)%bfield_ext(2) = strength(iatom) * sin(theta(iatom)) * sin(phi(iatom))
bfields(iatom)%bfield_ext(3) = strength(iatom) * cos(theta(iatom))
end do
end subroutine end subroutine
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment