derivylm Subroutine

public subroutine derivylm(v1, v2, v3, lmax, rabs, ylm, dydth, dydfi, d2ydth2, d2ydfi2, d2ydthdfi)

Uses

Calculate the 1st and 2nd derivatives of real spherical harmonics with respect to , . Use recursion relations for the assoc. Legendre functions to generate the derivatives. These are (taken from Abramowitz and Stegun, Handbook of Mathematical Functions, chapt. 8.): where , , Adding these equations: It is implied that if or . Also, the term is ambiguous for real , ; here it is interpreted as but otherwise the result from Eq.4 (which is cross-checked and correct) does not follow. For the 2nd derivative apply Eq.4 twice. Result: The -derivatives act on \cos{\phi},\sin{\phi} and are trivial. For the associated Legendre functions use the recursion formulas: ( with . Recursion algorithm for the calculation of and calculation of taken over from subr. ymy of KKR program (implemented there by M. Weinert, B. Drittler). For , use Taking into account the lm-prefactors of the spherical harmonics, we construct and use the functions whence Eq.4 and Eq.7 become Note on sign convension: For the needs of GGA PW91 as implemented here, ylm and derivatives come with a different sign convention compared to the usual in the program: . Thus some signs change.

Arguments

Type IntentOptional Attributes Name
real(kind=dp) :: v1
real(kind=dp) :: v2
real(kind=dp) :: v3
integer :: lmax
real(kind=dp) :: rabs
real(kind=dp) :: ylm(*)
real(kind=dp) :: dydth(*)
real(kind=dp) :: dydfi(*)
real(kind=dp) :: d2ydth2(*)
real(kind=dp) :: d2ydfi2(*)
real(kind=dp) :: d2ydthdfi(*)