Keywords:Sphere, Numerical method, Spectral method
Spherical harmonics composed of trigonometric and associated Legendre functions are used in geophysics and in other disciplines in science that deal with phenomena on the spherical surface. In meteorology, spherical harmonics are used to expand the prognostic variables of the atmosphere to compute the dynamical process in an atmospheric general circulation model or to analyze the energy spectrum. Recent increase in computing power allows us to use a large truncation wave number to achieve a horizontally high resolution. However, the values of associated Legendre functions of high order and degree cannot be computed accurately with the traditionally-used three-point recurrence in double precision. Alternatively, underflows can be avoided with the four-point recurrence in double precision or the three-point recurrence in extended floating arithmetic. Comparison of the two methods shows that the former and the latter have advantages in accuracy and speed, respectively. In addition, a method is shown to improve accuracy of the Fourier expansion of Legendre polynomials used along with the four-point recurrence.