This routine computes the normalized spherical harmonic, Ylm(x), where x=cos(theta) and to complete the function a factor of (-1)m ei*m*phi is needed.
function sph_harm_Ylm extends Modelica.Icons.Function; input Integer l, m; input Real x; output Real y; end sph_harm_Ylm;