calc_torque Subroutine

public subroutine calc_torque(iatom, lmax, irmdnew, nspin, bfield, rpan_intervall, ipan_intervall, npan_log, npan_eq, npan_tot, ncheb, theta, phi, rho2nsc, vpot, ifunm, iend, icleb, cleb, thetasnew, bconstr, fix_direction, icell)

Uses

Calculation of the magnetic torque in the new solver The routine uses rho2nsc to calculate the magnetic moment in the global frame from which the torque is calculated using the xc magnetic field. The XC magnetic field is extracted from the potential (convoluted with the shape function) thus rho2nsc has to be used instead of cden and cdenns!

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: iatom

Currently treated atom index

integer, intent(in) :: lmax

Maximum l component in wave function expansion

integer, intent(in) :: irmdnew
integer, intent(in) :: nspin
type(type_bfield), intent(inout) :: bfield

Information about the external and constraint magnetic fields

real(kind=dp), intent(in), dimension (0:ntotd) :: rpan_intervall
integer, intent(in), dimension (0:ntotd) :: ipan_intervall
integer, intent(in) :: npan_log
integer, intent(in) :: npan_eq
integer, intent(in) :: npan_tot
integer, intent(in) :: ncheb

Number of Chebychev pannels for the new solver

real(kind=dp), intent(in) :: theta
real(kind=dp), intent(in) :: phi
complex(kind=dp), intent(in), dimension (irmdnew,lmpotd , 2*nspin) :: rho2nsc
real(kind=dp), dimension (irmdnew,lmpotd ,nspin) :: vpot
integer, intent(in), dimension (1:(2*lmax+1)**2) :: ifunm
integer, intent(in) :: iend
integer, intent(in), dimension (ncleb, 4) :: icleb

Pointer array

real(kind=dp), intent(in), dimension (ncleb) :: cleb

GAUNT coefficients (GAUNT) ! CHECK THE DIMENSION AND HOW IT IS USED!!!

real(kind=dp), intent(in), dimension (irmdnew, nfund) :: thetasnew
real(kind=dp), intent(out), dimension (4) :: bconstr
logical, intent(in) :: fix_direction
integer, intent(in) :: icell