You are on page 1of 21

Journal of Geodesy (2002) 76: 279299

DOI 10.1007/s00190-002-0216-2

A unied approach to the Clenshaw summation and the recursive


computation of very high degree and order normalised associated
Legendre functions
S. A. Holmes, W. E. Featherstone
Department of Spatial Sciences, Curtin University of Technology, GPO Box U1987, Perth, WA 6845, Australia
e-mail: holmes@vesta.curtin.edu.au/w.featherstone@curtin.edu.au; Tel.: +61-8-9266-2218; Fax: +61-8-9266-2703

Received: 30 June 2000 / Accepted: 12 June 2001

Abstract. Spherical harmonic expansions form partial harmonic expansions of the geopotential or topography.
sums of fully normalised associated Legendre functions For example, Wenzel (1998) released coecients up to
(ALFs). However, when evaluated increasingly close to degree 1800, which were empirically derived to describe
the poles, the ultra-high degree and order (e.g. 2700) the gravitational potential of the Earth. Wenzel (1998)
ALFs range over thousands of orders of magnitude. This states that the maximum degree of 1800 for the spherical
causes existing recursion techniques for computing values harmonic model was set by the numerical stability of the
of individual ALFs and their derivatives to fail. A recursion algorithm adopted to compute the required
common solution in geodesy is to evaluate these expan- fully normalised associated Legendre functions (ALFs).
sions using Clenshaws method, which does not compute The recent interest in synthetic Earth gravity models,
individual ALFs or their derivatives. Straightforward used for comparing and validating gravity eld
numerical principles govern the stability of this technique. determination techniques, has already seen the use of
Elementary algebra is employed to illustrate how these ultra-high-degree spherical harmonic expansions. These
principles are implemented in Clenshaws method. It is have taken the form of simple eects models (see e.g.
also demonstrated how existing recursion algorithms for Featherstone 1999; Novak et al. 2001) for which syn-
computing ALFs and their rst derivatives are easily thetic geopotential coecients up to degree and order
modied to incorporate these same numerical principles. 2700 and 2160, respectively, were produced without re-
These modied recursions yield scaled ALFs and rst ference to a mass distribution. There is also interest in
derivatives, which can then be combined using Horners source models in which synthetic geopotential coe-
scheme to compute partial sums, complete to degree and cients are generated by analytical or numerical New-
order 2700, for all latitudes (except at the poles for rst tonian integration over a synthetic global density
derivatives). This exceeds any previously published result. distribution and topography (see e.g. Pail 1999).
Numerical tests suggest that this new approach is at least Hybrids of source and eects models also exist. For
as precise and ecient as Clenshaws method. However, example, Haagmans (2000) combines empirically de-
the principal strength of the new techniques lies in their termined coecients with synthetic ones derived from
simplicity of formulation and implementation, since this numerical integration over isostatically compensated
quality should simplify the task of extending the approach source masses to degree and order 2160. Lastly, other
to other uses, such as spherical harmonic analysis. scientic disciplines, such as meteorology, quantum
physics and electronic engineering, are also showing
Keywords: Spherical Harmonic Expansions Fully increased interest in high-degree spherical harmonic
Normalised Associated Legendre Functions Clenshaw modelling and analysis.
Summation Recursion Horners Scheme The numerical means for including the necessary ALFs
constitutes the principal challenge to evaluating ultra-
high-degree spherical harmonic expansions. Therefore, it
is timely to critically examine the accuracy and numerical
eciency of algorithms that compute individual ALFs
1 Introduction and their partial sums.

Current geodetic practice is witnessing an increase in the 1.1 Spherical harmonic expansions
construction and use of ultra-high-degree spherical
Truncated spherical harmonic expansions of a function,
or its derivatives, reduce to sums S d of ALFs, or their
Correspondence to: S.A. Holmes derivatives, respectively. These are
280

X
M M  n
X a
S d c Xd
m 1 Xma Cnma Pnm h 7
m0 nl
r

where When evaluating gravimetric quantities (e.g. disturbing


2 
potential, geoid heights, gravity anomalies, etc.) in a
X d
Xma cos mk for a 1 sequence of points for which r and h are constant (i.e.
d
Xm d 2
a1 Xma sin mk for a 2 along a geodetic parallel), the form of Eq. (5) is
numerically more ecient than that of Eq. (4)
and (cf. Tscherning et al. 1983). This is because each Xma in
Eq. (3) is independent of k, and thus need only be
X
M
evaluated once for each parallel. If all such computation
d d
Xma Enma Pnm h 3
nl
points are equally spaced in longitude, further numerical
eciencies can be achieved through application of the
For arguments of spherical polar coordinates (r, k, h) recursion algorithm developed by Rizos (1979). Abd-
and for integer degree n  0 and order 0  m  n: M is Elmotaal (1997) contains a re-derivation of this
the maximum nite degree of the spherical harmonic algorithm which demonstrates that, contrary to the
expansion; l is an integer that may vary with m; c is a approach of Rizos (1979), the algorithm can be applied
real-numbered constant; Enma is a real number in full without prior rotation of the geopotential
incorporating the fully normalised spherical harmonic coecients.
coecients, Cnm1 and Cnm2 ; Pnm h are the fully
normalised ALFs; the superscript d indicates the
dth derivative with respect to h, or denite integration 1.2 Numerical considerations when evaluating Eq. (1)
(d 1) between two parallels. This paper deals only
with undierentiated functions (d 0) or rst deriva- The simplest approach to evaluating Eq. (1) is to use
tives of these functions (d 1). For d 0, the super- standard recursion relations, such as those found in
script d is omitted. Thus S 0 , X0
0 0 Colombo (1981) and described in Sect. 2.1 of this paper,
m , Xma and Pnm h
to compute the required values of Pnmd
h. These values
are written S, Xm , Xma and Pnm , respectively. First can then be multiplied by the corresponding values of
1
derivatives of these quantities are written S 1 , X1
m , Xma
d
Enma to yield the intermediate values for Xma in Eq. (3),
d
and Pnm
1
h, respectively. The general notation S d , and hence Xm in Eq. (2), which are then used to
d d
Xm , Xma and Pnm d
h is used whenever a textual or compute the nal sums S d in Eq. (1).
The principal problem with this approach is that,
mathematical reference applies to both the undier- for ultra-high values of M (e.g. 2700), the absolute
entiated quantities and the rst derivatives simulta- values of Pnm h will range over thousands of orders of
neously. magnitude. For example, Fig. 1 shows that, for
The example of a truncated spherical harmonic M 2700, jPnm d
hj ranges over 5000 orders of
expansion of the gravitational potential V r; h; k is magnitude towards the poles (h ! 0 or h ! 180 ; i.e.
instructive here. Often, it is written as cos h ! 1. This is impractical, because the Institute of
Electrical and Electronic Engineers (IEEE) standard
M  n X
GM GM X a n
754 for binary oating-point arithmetic (cf. Coonen
V r; h; k Cnm1 cos mk 1980) only allocates eight bytes to store each double
r r n2 r m0
precision oating-point number (R). Thus, jRj may
Cnm2 sin mkPnm h 4 only take values within the range of 10310 < jRj <
10310 . Any computed value where jRj < 10310 will
where GM is the product of the Universal gravitational
constant and the mass of the Earth. Alternatively,
Eq. (4) may be written as
"
M  n
GM GM X M X a  
V r; h; k cos mk Cnm1 Pnm h
r r m0 nl
r
#
XM  n
a  
sin mk Cnm2 Pnm h 5
nl
r

where l is either 2 or m, whichever is the greater.


Relating Eq. (5) to the form of Eqs. (1)(3) yields
 an
 ; for a 1
C
Enma ar n nm1 6
 for a 2
r Cnm2 ;
Fig. 1. Logarithm plot of maximum (upper line) and minimum (lower
and line) values of jPnm hj; 8n; m  2700
281

underow and be set to zero, whilst any computed 2 Forward recursions for the calculation of ALFs
values for which jRj > 10310 will overow and be
designated not a number (NaN), such that any The most direct approach for evaluating S d [Eq. (1)]
subsequent computation which employs this R will employs a recursive algorithm to compute Pnm h. Values
also be so designated. of Pnm
1
h, if required, are then computed directly from
Underow in the computation of any Pnm d
h excludes two previously computed values of Pnm h. These values
the corresponding (matching degree and order) coe- of Pnm
d
h are multiplied by the corresponding Enma terms
d
cients from contributing to S d , whereas an overow in to yield the required series values of Xma [Eq. (3)], which
d
the computation of one or more Pnm d
h prevents any subsequently yield Xm [Eq. (2)] and hence S d [Eq. (1)].
d
result for S from being achieved at all. Thus, IEEE The recursion relations for Pnm h can be obtained by
double precision only permits a maximum range of fully normalising standard relations for (un-normalised)
620 orders of magnitude within which to compute and Pnm h, which can be found, for example, in Magnus
store the required Pnmd
h values. Figure 1 shows that, et al. (1966) or Abramowitz and Stegan (1972). The full
for high latitudes, the range of values taken by the normalisation is given by [adapted from Heiskanen and
Pnm h values for M 2700 will eventually exceed Moritz 1967, Eq. (173)
the range of magnitudes capable of being stored within s
the IEEE double-precision format. Scaling all of the k2n 1n  m!
computations upwards by a factor of 10200 allowed Pnm h Pnm h 8
n m!
Wenzel (1998) to compute values of Pnm h to a max-
imum M 1900 for 20  h  160 in IEEE double where k 1 for m 0 and k 2 for m > 0. Similarly,
precision. quasi-normalised values of P~nm h are related to Pnm h
A numerically more stable alternative to these by (cf. Tscherning and Poder 1982)
standard recursion relations is the Clenshaw (1955) s
method (cf. Tscherning and Poder 1982; Gleason n  m!
1985; Deakin 1998). In Sect. 3, it will be shown that P~nm h Pnm h 9
n m!
this can be used to evaluate S in Eq. (1) up to
M 2700 (0  h  180 ), as well as S 1 up to Inspection of Eqs. (8) and (9) shows that
M 2700 (0 < h < 180 ). Standard derivations of p
Clenshaws method (cf. Gleason 1985; Deakin 1998) Pnm h k2n 1 P~nm h 10
utilise matrix algebra, and generally focus on the
means by which this method can be used to evaluate The relationships in Eqs. (8), (9) and (10) also hold for all
partial sums, S d , without computing individual values dth derivatives d d ~d
nm h, Pnm h and Pnm h. However,
of Pnm
d
h. Such derivations are complete, concise and cosPmk
unlike Pnm h sin mk , Pnm h sin mk is not normalised
d6 0 cos mk
rigorous, but they also obscure the numerical princi- in the correct usage of the word since its average squared
ples upon which the stability of the Clenshaw sum- value integrated over the unit sphere is not unity. This
mation is based. These principles are quite simple, paper focuses solely on the computation of fully normal-
both in concept and in application. ised ALFs and their rst derivatives. No numerical tests
This paper shows how existing algorithms for were conducted for the above quasi-normalisations.
computing ALFs and rst derivatives are easily modied However, it is a trivial task to apply Eq. (10) to the
to incorporate these same numerical principles. The algorithms presented in this paper.
modied algorithms can be used to compute scaled
ALFs and their rst derivatives, which can then be 2.1 Standard forward column methods
combined using Horners scheme (cf. Harris and Stocker
1998) to yield values for the required partial sums, S in The most popular recursive algorithm used for computing
up to M 2700 (0  h  180 ), as well as S 1 up to Pnm h in geodesy can be obtained by fully normalising,
M 2700 (0 < h < 180 ). Straightforward examples for example, Magnus et al. [1966, Eq. 4.3.3(2)]. This full
and elementary algebra are then used to illustrate the normalisation yields a recursion that computes non-
means by which these numerical principles are sectoral (i.e. n > m) Pnm h from previously computed
implemented in Clenshaws method. Pnm h. This recursion is given as (cf. Colombo 1981)
Results from numerical tests, presented in Sect. 4,
suggest that the modied algorithms are at least as Pnm h anm t Pn1;m h  bnm Pn2;m h; 8 n > m
ecient and precise as the standard Clenshaw techni-
11
ques for evaluating partial sums of Pnm h or Pnm 1
h.
However, it is the intuitive simplicity of the new ap- where t cos h
proaches, as well as the fact that they compute in- s
dividual scaled values of Pnm d
h, which constitutes their 2n  12n 1
principal strength over the standard Clenshaw meth- anm and
n  mn m
ods. These two properties should simplify the extension s
of these new approaches to other tasks, such as stabi- 2n 1n m  1n  m  1
lising current techniques for spherical harmonic ana- bnm 12
lysis (e.g. Lesur and Gubbins 1999). n  mn m2n  3
282

The sectoral (i.e. n m) Pmm h serve as seed values for 1 1 


Pnm h ntPnm h  fnm Pn1;m h ; 8 n  m 15
the recursion in Eq. (11). These are computed p using the u
initial values P0;0 h 1 and P1;1 h 3u, where
u sin h. The higher degree and order values of where
Pmm h are then computed using the recursion (cf. s
Colombo l981) n2  m2 2n 1
fnm 16
r 2n  1
 2m 1 
Pmm h u Pm1;m1 h; 8 m > 1 13 For all sectoral Pmm
1
h, fmm 0 and Eq. (15) reduces to
2m
such that 1 t 
Pmm h m Pmm h; 8 m  0 17
r u
p Ym
2i 1

Pmm h u m
3 ; 8m1 14 The rst derivative of Eq. (13) with respect to h also
i2
2i gives Eq. (17). For all n  M, each Pnm h of a given m
Q can be computed using Eqs. (11) and (13). These values
where is the product symbol (see e.g. Abramowitz
and Stegan 1972). can be substituted into Eq. (15) to compute, without the
The complete recursion process in Eqs. (11) and (13) need for any further recursion, all Pnm
1
h of the same
may be visualised using the lower triangular matrix in order m and 8 n  m.
Fig. 2, where each circle corresponds to a particular
combination of n and m. Thus, each circle represents a
value of Pnm h, as well as the corresponding pair of re- 2.2 Standard forward row methods
cursive terms anm t and bnm . Note that in Fig. 2, the de-
gree increases in rows down, the order increases in The next approach is termed the standard forward row
columns to the right, and the diagonal elements of the recursion (Fig. 3), and appears to be rarely used in
matrix are the sectoral values. The recursion in Eq. (11) geodesy. As with the standard forward column recursion
computes Pnm h of constant m (a column in Fig. 2) and (Sect. 2.1), the sectoral Pmm h serve as seed values for
sequentially increasing n [or down and away (i.e. for- the standard forward row recursion, and can be
ward) from the diagonal in Fig. 2]. Thus, Eq. (11) will be computed using Eq. (13). However, the standard
referred to as a standard forward column recursion. This forward row recursion computes non-sectoral Pnm h of
nomenclature will be employed throughout the paper. constant n (a row in Fig. 3) and sequentially decreasing
It appears from Eq. (11) that the computation of the m [to the left (i.e. forward) from the diagonal in Fig. 3].
rst value of Pm1;m h forward from the sectoral diag- Full normalisation of Magnus et al. [Eq. 4.3.3(1)] and
onal (Fig. 2) requires a value of Pm1;m h to be multi- substituting Pnm h 1m Pnm h yields
plied by the recursive term bm1;m . This Pm1;m h does 1  t  
not exist for ordinary Pnm h. However, the correspond- Pnm h p gnm Pn;m1 h  hnm Pn;m2 h ;
ing bm1;m coecient in Eq. (11) is always zero, thereby j u
allowing the (non-existant) Pm1;m h to be disregarded. 8n>m 18
For a forward column computation of Pnm 1
h, nor-
malisation of Magnus et al. [1966, Eq. 4.3.3(9)] gives (cf. where j 2 for m 0 and j 1 for m > 0, and
Colombo 1981) 2m 1
gnm p
n  mn m 1

Fig. 2. Schematic of the recursion sequences employed in the


standard, rst modied and second modied forward column Fig. 3. Schematic of the recursion sequences employed in the
algorithms to compute Pnm h, Pnm h=um and Pnm h=Pmm h standard and modied forward row algorithms to compute Pnm h
respectively and Pnm h=um , respectively
283

and magnitudes capable of being stored in IEEE double


s precision, thereby resulting in an underow. The failure
n m 2n  m  1 to compute and store values of Pmm h means that these
hnm 19 cannot serve as seed values for the standard forward
n  mn m 1
column and forward row recursions (Sect. 2.1 and 2.2,
Using the same argument to that introduced for the respectively). This ultimately limits the ranges of h and
forward column recursion, the non-existant value of M over which these recursions can be used, thereby
Pn;n1 h required to compute Pn;n1 h in Eq. (18) may restricting the practical application of spherical harmo-
be disregarded because the corresponding recursion nic expansions of ultra-high M at high latitudes.
coecient, hn;n1 , is always zero.
Note that, to compute Pnm h using the forward row
recursion, Eq. (18) uses the corresponding sectoral values 2.4 Other normalisations and the Edmonds recursion
of the same n, rather than the same m, as seed values. In
this case, these sectoral values are more correctly denoted Belikov (1991) and Belkov and Taybatorov (1991)
by Pnn h, which may be written in the form of Eq. (14) as present a suite of recursive algorithms for computing
r the quantities P^nm
d
, where P^nm
d
are related to un-
p Yn
2i 1 d
normalised Pnm according to the modied normalisation
Pnn h u n
3 ; 8n1 20
i2
2i
n!
P^nm h 2m Pnm h 25
The Pnm
1
h are obtained directly from Pnm h of n m!
matching n by fully normalising Abramowitz and Stegan
[1972, Eq. (8.5.2)] to yield However, this approach is also subject to numerical
limitations. As the computation approaches the poles,
1 t the range of jP^nm
d
hj is comparable to that of jPnm
d
hj,
Pnm h m Pnm h  enm Pn;m1 ; 8 n  m 21
u thereby resulting in an underow in IEEE double
precision. For example, the sectoral values are given by
where
s P^mm h um sinm h 26
n m 1n  m
enm 22 which for h 1 and M 2700 yields values that range
j
from 1 to 104747 . Therefore, employing the normal-
For all sectoral Pmm
1
h, or equivalently Pnn
1
h, emm 0 isation in Eq. (25) cannot solve the numerical problems
and Eq. (21) reduces to Eq. (17). discussed in Sect. 1.2.
Risbo (1996) claims that the Edmonds (1957) recur-
sion for D-matrices can be used to compute fully nor-
2.3 Numerical problems with the standard malised ALFs up to degree 200 000. However, the
forward methods description of the test results which support this claim
indicates that these computations were only performed
Even when applied in IEEE double precision, both the at the equator, although the point is not clear. Never-
standard forward column [Eq. (11)] and standard theless, Risbo (1996) includes a Fortran 77 subroutine
forward row [Eq. (18)] recursions will underow for for this recursion. It was found that, when implemented
M > 1900 in the co-latitude range 20  h  160 . in IEEE double precision, the Risbo subroutine under-
The numerical instability of both these forward ows for all polar distances h < 50 for M 2700. This
recursions is noted in the geodetic literature (e.g. was not suprising, given that the corresponding ALFs
Gleason 1985) and elsewhere (e.g. Libbrecht 1985). cannot even be stored in IEEE double precision
The cause of this instability is revealed by examining (Sect. 1.2), irrespective of the algorithm used to compute
Eq. (14), which is rst partitioned into the factors um
and Pm , such that
Pmm h um Pm ; 8 m  1 23
where um sinm h, and
r
p Ym
2i 1
Pm 3 8m1 24
i2
2i

Inspection of Fig. 4 shows that the Pm factor introduces


no computational diculties for an arbitrarily ultra-high
value of m 5400. In contrast, the um term in Eq. (23)
becomes increasingly small as u ! 0 (i.e. towards the
poles) and as m increases. Accordingly, the high degree
and order values of Pmm h will exceed the range of Fig. 4. Variation of Pm [Eq. (24)] with order (m)
284
"( "( ) #
them. Therefore, although it may be possible to in- X
M d d
d d XM XM1
corporate the new approaches presented here into the S c Xm c  u M1 u
uM u
Risbo (1996) approach, it is clear that the Edmonds m0
! ) #
recursion alone does not solve the numerical problems d d d
XM2 X2 X d
encountered towards the poles as described in Sect. 1.2. M2 u    2 u 11 u cX0
u u u
31
2.5 The modied forward row method
From Eq. (31), the running total is repeatedly multiplied
d
A simple, yet eective, method by which this problem of by u upon the addition of each Xm =um term. This allows
underowing Pmm h may be avoided is to eliminate the d
the sum S to be computed directly from the values of
um term from the recursion process in Eq. (13). To this d
Xm =um , and so avoids the need to compute under-
end, Libbrecht (1985) adapted the standard forward row owing values of um as u ! 0 and m increases. This will
recursion (Sect. 2.2) to yield a modied forward row be demonstrated numerically in Sect. 4.
recursion that computes the quantities Pnm h=um . A
recursive algorithm which computes the non-sectoral
Pnm h=um is obtained by dividing Eq. (18) by um to give 2.6 Modied Forward Column Method
 
Pnm h 1 Pn;m1 h 
2 Pn;m2 h
p gnm t  hnm u ; Values of Pnm
d
h=um may also be computed using what
um j um1 um2 will be termed the rst modied forward column
8n>m 27 recursion. To eect this computation, Eq. (28) is retained
 to compute the sectoral values of Pmm h=um . Equations
Equation (27) is seeded by the sectoral Pmmumh, the (11) and (15) are divided by um , to give, respectively
recursive algorithm for which is obtained by dividing
Eq. (13) by um to give Pnm h Pn1;m h Pn2;m h
anm t  bnm ; 8n>m 32
r u m u m um
Pmm h 2m 1 Pm1;m1 h
m
; 8m>1 28  
u 2m um1 Pnm
1
h 1 Pnm h Pn1;m h
p nt  fnm ; 8nm 33
The value P1;1 h=u1 3 serves as the seed for um u um um
Eq. (28). Equation (23) yields
A variation of the rst modied forward column
Pmm h recursion, herein termed the second modied forward
Pm ; 8 m  1 29 column recursion, is to compute values of Pnm d
h=
um
 
Pmm h in which the entire sectoral value of Pmm h has
Libbrechts (1985) original formula for computing been eliminated, rather than just the problematic um
Pnm h=um diers
p from Eq. (27) in that it does not component. An immediate result is that all the sectoral
include the 1= j term on the right-hand side. This is values of Pmm h=Pmm h equal 1. Dividing Eqs. (11)
because Libbrecht (1985) employs a dierent normal- and (15) by Pmm h gives, respectively
isation of Pnm h in which k 1; 8 m. Moreover,
Libbrecht (1985) focuses solely on the actual computa- Pnm h Pn1;m h Pn2;m h
a t  b ; 8n>m 34
tion of the values of Pnm h=um . This paper shows how Pmm h
nm
Pmm h
nm
Pmm h
Libbrechts (1985) method is easily extended to compute
the quantities Pnm 1
h=um . It also provides simple  
means by which values of Pnm d
h=um can be applied Pnm
1
h 1 Pnm h Pn1;m h
 nt   fnm  ;
in practice without dealing with the unmanageably small Pmm h u Pmm h Pmm h
um terms for u ! 0. 8nm 35
The modied forward row recursion for computing
Pnm
1
h=um is obtained by dividing Eq. (21) by um to Comparison of Eq. (11) with Eqs. (32) and (34) shows
yield these recursions to be of identical form; similarly for the
comparison of Eq. (15) with Eqs. (33) and (35). That is,
Pnm
1
h t Pnm h Pn;m1 h for Eqs. (32) and (34), and for Eqs. (33) and (35), the
m  enm u 8nm 30
u m u u m um1 entire computation has simply been divided by um or
Pmm h, respectively. Thus any computer program that
such that all Pnm 1
h=um may be computed directly
from previously computed Pnm h=um of the same m. already employs Eqs. (11) and (15) to compute Pnm d
h is
In order to evaluate Eq. (1), the values of quickly adapted to compute Pnm h=u or Pnm
d m d
h=
Pnm
d
h=um are multiplied by the corresponding values Pmm h by simply altering the sectoral subroutine to

of Enma [Eq. (3)] and the resulting products summed to return Pmm h=um Pm or Pmm h=Pmm h 1,
d d d
yield values of Xma =um and Xm =um , instead of Xma and respectively.
d
Xm , respectively. In order to compute S d , Eq. (1) is To evaluate S d in Eq. (1), the required Pnm
d
h=
factorised using Horners scheme in terms of u 
Pmm h of the same m may be multiplied by their
285

corresponding values of Enma [Eq. (3)] and the results for all of the modied forward methods introduced thus
d
added to give values of Xma =Pmm h and subsequently far simply by scaling all of the computations downwards
d d
Xm =Pmm h. These Xm =Pmm h can be multiplied by by a global scale factor of 10280 . This is achieved for all
Pm in Eq. (14) to yield Xd m
for use in Horners of the forward methods by simply multiplying the
m =u
sectoral values of Pmm h=um or Pmm h=Pmm h by
scheme in Eq. (31). Alternatively, inspection of Eq. (14) 10280 , and using these scaled sectoral values as the
shows that Pmm h may be factorised into recursive seeds in place of the original values. As such,
r this scale factor propagates linearly through all sub-
p Ym
2i 1 Y m

Pmm h u 3m
Ui ; 8 m  1 36 sequent computations, thereby generating values of
2i
i2 i1 Pnm
d
h=um  10280 or Pnm
d
h=Pmm h  10280 ,
where respectively. These scaled values are used to form
d
( p Xm =um  10280 or Xd 
m =Pmm h  10
280
which,
3
u; i1 d d
when used in place of Xm =u or Xm =Pmm h in
m
Ui q2i1 37
2i u; 8i>1 Horners scheme in Eqs. (31) or (38), respectively, will
yield values of S d  10280 . These are multiplied by
Thus, Eq. (31) may be written using Horners scheme in 10280 to yield S d .
terms of Um Importantly, this global scaling allows, in IEEE
X
M double precision, the computation of spherical harmonic
S d c d
Xm series S for 0  h  180 and S 1 for 0 < h < 180 up
m0 to M 2700. Note that the spherical coordinate system
"( "( ) # renders partial sums S 1 indeterminate at the poles,
d d
XM XM1 since here the meridian tangents no longer uniquely
c  UM 
PM;M h PM1;M1 h dene the direction of the derivative. There are useful
! ) ways around this problem (see e.g. Tscherning 1976),
d d
XM2 X2 but for the sake of continuity they will not be considered
 UM1  UM2    
PM2;M2 h P2;2 h here. Thus, for the remainder of this paper, no partial
# sums S 1 will be computed at the poles.
d
X d
 U2  1 U1 cX0 38
P1;1 h

Due to the numerically stable behaviour of Pm (Fig. 4),


using Pm in this way, rather than multiplying the values
of Xd 
m =Pmm h by Pm to yield Xm =u
d m
for use in
d
Eq. (31), gives identical results for S when performed
in IEEE double precision. Moreover, the rst and
second modied forward column recursions are essen-
tially the same, diering only in the treatment of Pm ,
which is irrelevant to the numerical stability of each
algorithm. The second modied forward column
recursion [Eqs. (34) and (35)] and the implementation
of Horners scheme in Eq. (38) are introduced here Fig. 5. Logarithm plot of maximum (upper line) and minimum (lower
line) values of jPnm h=um j; 8 n; m  2700
primarily because of their relevance to the Clenshaw-
based methods, discussed in Sect. 3. For the purposes of
numerical testing (Sect. 4.2, 4.3 and 4.4), the rst and
second modied forward column methods will be
treated as a single modied forward column recursion.

2.7 IEEE overows and global scale factors


in forward methods

The entire ranges of maximum and minimum values


taken by jPnm h=um j and jPnm
1
h=um j, for M 2700,
are shown in Figs. 5 and 6, respectively. Inspection of
Figs. 5 and 6 indicates that further factorisation is
required to prevent the computations from overowing Fig. 6. Logarithm plot of maximum (upper line) and minimum (lower
in IEEE double precision. Overows can be prevented line) values of jPnm
1
h=um j; 8 n; m  2700
286

3 Clenshaw-based methods 3.2 Reverse column method

3.1 The forward column factorisation Results from timing tests presented in Sect. 4.3 show the
reverse column methods, described below, to be highly
It is instructive at this stage to consider a simple example inecient in comparison with the other approaches
of the summation described in Eq. (3). The rectangle in presented in this paper for evaluating the required
Fig. 2 contains circles representing values of Pnm h and partial sums. The primary reason for describing the
Enma for m 2 and 2  n  5. A summation of these reverse column methods here is because these methods
elements in the form of Eq. (3) may be expanded as incorporate characteristics of both the modied forward
column methods (Sect. 2.6) and the standard Clenshaw
X
5
methods (Sect. 3.3). Thus, the reverse column methods
X2;a En;2;a Pn2 h E2;2;a P2;2 h E3;2;a P3;2 h
are used here to highlight the basic similarities and
n2
dierences between these two approaches.
E4;2;a P4;2 h E5;2;a P5;2 h 39 To compute any value of Pnm h=Pmm h, the second
modied forward column recursion [Eq. (34)] aggregates
The recursion relation in Eq. (11) gives the Pnm h
the necessary alm t and blm recursive terms in the se-
required in Eq. (39); these are
quence of increasing degree l (sequentially down each
 
P3;2 h a3;2 t P2;2 h 40 column in Fig. 2). An alternative is to reverse this process
and apply these same recursive terms in the sequence of
decreasing degree l (sequentially up each column in
P4;2 h a4;2 tP3;2 h  b4;2 P2;2 h 41 Fig. 2). That is, a recursion may be employed whereby the
alm t and blm recursive terms for which l n (i.e. the
P5;2 h a5;2 tP4;2 h  b5;2 P3;2 h 42 largest value of l) are applied rst and the recursive terms
for which l m 1 (i.e. the smallest value of l) are ap-
Substitution of Eq. (40) into Eq. (41) yields plied last. This will be called a reverse column recursion,
  and is illustrated schematically in Fig. 7.
P4;2 h a4;2 a3;2 t2  b4;2 P2;2 h 43 It is now necessary to introduce the recursive algo-
Likewise, substitution of Eqs. (40) and (43) into Eq. (42) rithm
gives slma al1;m t sl1;m;a  bl2;m sl2;m;a ylma 46
 
P5;2 h a5;2 a4;2 a3;2 t3  a5;2 b4;2 t  a3;2 b5;2 t P2;2 h where ylma are predetermined, real-numbered constants
44 (described later), and the subscript a (a 1; 2) is
included here as it will be referred to later when
Therefore, each Pn;2 h can be factored into two discussing the standard Clenshaw methods. Equation
components: the seed P2;2 h value and the aggregation (46) is used as follows. The recursion begins at the
of al;2 t and bl;2 recursive terms [within the square computation of a chosen snma . For this initial computa-
brackets in Eqs. (40), (43) and (44)], which constitute tion, sn1;m;a and sn2;m;a are set to predetermined values
polynomials in t cos h. This factorisation will be used and then used in the rst recursion to yield snma .
in Sect. 3.2 to introduce the reverse column algorithms. Equation (46) is then used to achieve the recursive
Note that l rather than n is used here to denote the
degree of the recursive terms, since each Pn;2 h of degree
n is comprised of an aggregation of all of the al;2 t and
bl;2 for 3  l  n. In general, any Pnm h may be factored
into Pmm h and an aggregation of all of the alm t and
blm terms for m 1  l  n. Inspection of Eqs. (40),
(43) and (44) shows that these aggregations are simply
values of Pnm h=Pmm h, which are generated using
Eq. (34). Substitution of Eqs. (40), (43) and (44) into
Eq. (39) gives
(
   
X2;a E2;2;a E3;2;a a3;2 t E4;2;a a4;2 a3;2 t2  b4;2
)
 
E5;2;a a5;2 a4;2 a3;2 t3  a5;2 b4;2 t  a3;2 b5;2 t P2;2 h

45 Fig. 7. A schematic of the recursion sequences employed in the reverse


column, and the rst and second Clenshaw algorithms to compute the
The quantity in curly brackets in Eq. (45) equates to quantities Pnm h=Pmm h; dP Pmm h=dt, Xma =Pmm h;
Pnm h=P
X2;a =P2;2 h, which is used to form X2 =P2;2 h or X2 =u2 dXma =PPmm h=dt and Xma =Pmm hqm ; dXma =P Pmm hqm =dt,
(Sect. 2.6) for use in Eqs. (31) or (38), respectively. respectively
287


nm h
computation of all slma , of constant m (a column in where, as above, smma PPmm h
and
Fig. 7), and sequentially increasing l [upwards and  
towards the diagonal (i.e. reverse) in Fig. 7], until the nm h
d PPmm h
recursion is terminated at the computation of the s_mma
sectoral smma (on the diagonal in Fig. 7). dt
Recursion algorithms resembling Eq. (46) form part
To compute all non-sectoral values of Pnm 1
h=Pmm h
of the standard Clenshaw methods (cf. Tscherning and
Poder 1982) for evaluating the partial sums S d without of order m and degree m 1  n  M, the reverse
computing individual scaled values of Pnm d
h (Sect. 3.3). column technique requires M  m2 =2 recursions of
However, Eq. (46) can be used in a dierent context to Eqs. (46) and (47), as well as M  m applications of
compute individual values of Pnm h=Pmm h. Setting Eq. (48). In the same manner as the reverse column
sn1;m;a 0, snma 1, and all ylma 0 allows the re- computation of Pnm h=Pmm h [Eq. (46)], the numer-
cursive computation of all slma , of constant m and se- ical eciency of this approach (Sect. 4.3) contrasts poorly
quentially decreasing l, from sn1;m;a to smma . The eect against the second modied forward column recursion
of using the recursion in Eq. (46) in this way is to se- (Sect. 2.6) in which the Pnm 1
h=Pmm h are obtained
quentially aggregate the (alm t) and blm recursive terms, in from previously computed values of Pnm h=Pmm h
the sequence of decreasing l, until the recursion termi- through only M  m applications of Eq. (35).
nates at the computation of smma Pnm h=Pmm h. As with the modied forward column and forward row
One drawback of this approach is that the inter- recursion techniques (Sect. 2.6 and 2.5, respectively), a
mediate values of slma in the recursion do not constitute global scale factor must be applied to the reverse column
actual values of Plm h=Pmm h. Instead, each computations to prevent an overow in the computation
Pnm h=Pmm h value must be computed in isolation of Pnmd
h=Pmm h. This is achieved by simply setting
from the others using n  m recursions of Eq. (46). This the initial value, snma , to 10280 (rather than 1) for use in
necessitates M  m2 =2 recursions to compute all Eq. (46). This scale factor of 10280 will propagate linearly
non-sectoral values of Pnm h=Pmm h of order m and through the subsequent computations to yield values of
degree m 1  n  M. This contrasts with the second Pnm
d
h=Pmm h  10280 . Importantly, this global
modied forward column recursion, where these same scaling allows, in IEEE double precision, the computation
values of Pnm h=Pmm h can be computed using only of spherical harmonic series S for 0  h  180 and S 1
M  m recursions of Eq. (34). The relative numerical for 0 < h < 180 up to M 2700.
eciency of these approaches is tested in Sect. 4.3.
To compute values of Pnm 1
h=Pmm h, the rst
derivative of Eq. (46) with respect to t cos h gives 3.3 Standard Clenshaw methods
 
s_lma al1;m s_l1;m;a t sl1;m;a  bl2m s_l2;m;a 47
The standard Clenshaw methods, summarised below,
where s_lma dslma =dt. The seed values for the recursion closely resemble the reverse column recursions
in Eq. (47) (i.e. sn;m;a and sn1;m;a ) are dierentiated with (Sect. 3.2). The Clenshaw (1955) approach, which was
respect to t to give s_nma s_n1;m;a 0. These initial formulated originally to evaluate partial sums of
values allow the recursion in Eq. (47) to compute all Chebyshev polynomials, was adapted for use in geodesy
s_lma , of constant m and sequentially decreasing l, from by Gulick (1970) to compute partial sums of Pnm d
h.
s_n1;m;a to s_mma . When used in this way, the recursion in Section 3.3.1 introduces a simple implementation of the
Eq. (47) terminates at the computation of Clenshaw (1955) approach, whilst Sect. 3.3.2 presents
  the implementation that is used more commonly in
nm h
d PPmm h
geodesy (cf. Gleason 1985).
s_mma
dt
Since sectoral 3.3.1 The rst Clenshaw method
  The simplest implementation of the Clenshaw (1955)
nm h
d PPmm h technique, herein termed the rst Clenshaw method,
dt uses the recursions in Eqs. (46) and (47) to compute,
d
directly, the intermediate sums Xma =Pmm h, without
are zero, their corresponding s_mma are simply set to zero evaluating individual values of Pnm d
h=Pmm h.
without the need for any recursion. Application of the 
Undierentiated values of Xma =Pmm h may be com-
product rule and the chain rule to puted using Eq. (46). Setting sM1;m;a sM2;m;a 0 and
  all ylma Elma [ylma 0; 8l < l in Eq. (3)], allows the
nm h
d PPmm h recursive computation of all slma , of constant m (a
dt column in Fig. 7), and sequentially increasing l
(upwards and towards the diagonal in Fig. 7), from
yields sMma to smma . As in the reverse column recursion
(Sect. 3.2), the recursive process terminates at the
Pnm
1
h t
m smma  us_mma ; 8 n  m 48 computation of smma (on the diagonal in Fig. 7), except
Pmm h u that, in this case, the sectoral smma Xma =Pmm h.
288

The rst Clenshaw method also may be extended to For undierentiated values of S, the required
compute partial sums S 1 , S 2 and S 1 , where d 1 Xm =Pmm hqm quantities are computed using a mod-
denotes denite integration (cf. Tscherning and Poder ied version of the reverse recursion algorithm in Eq.
1982). However, this study is conned to the computa- (46); this is (Gleason 1985)
tion of S 1 . For this task, the rst Clenshaw method
uses the recursion in Eq. (47). The rst derivative with slma al1;m t qsl1;m;a  bl2;m q2 sl2;m;a ylma 51
respect to t cos h of the seed values used above
(sM1;m;a sM2;m;a 0) gives s_M1;m;a s_M2;m;a 0. To produce the required values of Xma =Pmm hqm , the
These seed values allow the recursive computation of all recursion in Eq. (46) is initiated exactly as for the rst
s_lma , of constant m and sequentially decreasing l, from Clenshaw method (sM1;m;a sM2;m;a 0), except that
s_Mma to s_mma . As in the reverse column recursion all ylma are set to Elma =ql [ ylma 0; 8l < l in Eq. (3)],
(Sect. 3.2), this recursive process terminates at the rather than Elma . Thus, to evaluate the truncated
computation of s_mma , except that in this case expansion of geopotential in Eq. (5), these values of
  ylma are set to Clma , rather than a=rl Clma , as for the rst
Xma
d Pmm Clenshaw method. This allows the recursive computa-
h tion of all slma , of constant m (a column in Fig. 7), and
s_ mma
dt sequentially increasing l (upwards and towards the
diagonal in Fig. 7), from sMma to smma , where
Application of the product rule and the chain rule to the smma Xma =Pmm hqm .
1
quantity Similarly, values of Xma =Pmm hqm may be com-
  puted by dierentiating Eq. (51) with respect to t to give
Xma (Gleason 1985)
d Pmm h
dt s_lma al1;m qs_l1;m;a t sl1;m;a  bl2m q2 s_l2;m;a 52
yields (adapted from Gleason 1985) Dierentiation (with respect to t) of the seed values used
1 above (sM1;m;a sM2;m;a 0) gives s_M1;m;a s_M2;m;a
Xma t 0. These values allow the recursive computation of all
m smma  us_mma 49
Pmm h u s_lma , of the same m and sequentially decreasing l, from
s_Mma to s_mma . The recursive process terminates at the
where, as above, smma Xma =Pmm h and computation of s_mma , where
   
Xma
d Pmm h d PmmXhq
ma
s_mma s_mma
m

dt dt
Application of the product rule and the chain rule to the
3.3.2 The second Clenshaw method quantity
In geodesy, what is termed the second Clenshaw method
 
in this paper is more commonly used to evaluate
d PmmXhq
ma
spherical harmonic expansions such as Eq. (5) (e.g. m

Gleason 1985; Deakin 1998). For this task, Eq. (38) is dt


reformulated using Horners scheme in terms of Um q,
yields [adapted from Gleason (1985)]
where q a=r
1
X
M Xma t
S d
c Xd m smma  us_mma 53
m Pmm hqm u
m0
"( "( ) # where, as above, smma Xma =Pmm hqm and
d d
XM XM1
c  UM q   

PM;M hqM PM1;M1 hqM1 d PmmXhq
ma
m
! s_mma
d
XM2 dt
 UM1 q  d
PM2;M2 hqM2 Values of Xma =Pmm hqm , obtained from the second
) d
Clenshaw method, are used in place of Xma in Eq. (2) to
d
X2 d
form Xm =Pmm hqm . The standard approach (cf.
 UM2 q    
P2;2 hq2 Gleason 1985; Deakin 1998) is to combine these values
# using the implementation of Horners scheme given in
d
X1 d Eq. (50). Alternatively, values of Xm d
=Pmm hqm can
 U2 q  U1 q cX0 50 d
P1;1 hq either be multiplied by q to yield Xm =Pmm h, which
m

are combined using the implementation of Horners


Note that in the geodetic literature [see e.g. Gleason 1985, scheme in Eq. (38), or multiplied by qm Pm to yield
d
Eqs. (2.38), (2.39) and (2.40)], the use of Horners scheme values of Xm =um , which are combined using the
in Eq. (50) is presented as an implementation of Eq. (46). implementation of Horners scheme given in Eq. (31).
289

The resulting numerical values of S d are identical in all cision. The tests of numerical eciency will compare the
cases (Sect. 4.2). execution times of the algorithms. The tests of numerical
accuracy will use analytic solutions for the sum of the
square of Pnm
d
h, to compare the modied forward row
3.4 IEEE overows and global scale factors and modied forward column algorithms only.
in the standard Clenshaw methods
4.2 Relative numerical precision
Overows can be prevented in the both rst and second
Clenshaw methods by multiplying all ylma by the global The rst step in comparing dierent methods for
scale factor of 10280 . This scale factor propagates computing the partial sums S d in Eq. (1) is to choose
linearly through subsequent recursions to nally pro- some appropriate values for Enma and k. For Enma , we
duce values of
d
Xma =Pmm h  10280 and might use empirically generated coecients such as
d EGM96 (Lemoine et al. 1998) and/or GPM98B (Wenzel
Xma =Pmm hqm  10280 . These are used in place of 1998) to compute the lower degree Enma . Higher-degree
d
Xma in Eq. (2) to form Xd 
m =Pmm h  10
280
and coecients could be generated synthetically to conform
d  m 280
Xm =Pmm hq  10 , respectively. Again, this with the predicted spectral characteristics of the Earths
global scaling allows, in IEEE double precision, the gravity eld (e.g. Tscherning and Rapp 1974). However,
computation of spherical harmonic series S for the ubiquity of high-degree spherical harmonic expan-
sions across multiple scientic disciplines favours a more
0  h  180 and S 1 for 0 < h < 180 up to general approach. For this reason, the following
M 2700. comparisons have employed the testing regime utilised
by Gleason (1985), which is to set all Enma equal to 1 and
4 Numerical tests k equal to 0. This testing regime has the advantage of
being straightforward to present, as well as being
4.1 Viable methods suciently general for a rst assessment of the new
algorithms. In this approach, the computed estimates
The previous derivations have presented six apparently sd of the partial sums S d [Eq. (1)] reduce to
viable methods for computing S0  h  180 and 2700 X
X n
S 1 0 < h < 180 for M  2700. These algorithms are sd d
Pnm h 54
summarised in Table 1. n0 m0
As mentioned in Sect. 2.6, the rst (MFC-1) and
second (MFC-2) modied forward column recursions Each algorithm in Table 1 was evaluated in IEEE double
are, essentially, a single method. Therefore, for the re- precision on a Sun Ultra-10 workstation. The algorithms
mainder of this section they will be treated as one al- were encoded in Fortran 77 and compiled using the
gorithm, termed the modied forward column recursion. SparkworksTM v3:0:1 Fortran compiler. The values of s
This leaves, to this point, ve separate methods for were computed for integer values of colatitude
computing spherical harmonic expansions. The purpose 0  h  180 and values of s1 were computed for
of this section is to provide an initial, general assessment integer values of colatitude 1  h  179 . These were
of the relative merits of these algorithms using tests of compared with the corresponding control values,
precision, numerical eciency and accuracy. The tests of obtained from the second Clenshaw summation (Sect.
precision will compare partial sums, S d , computed in 3.3.2) which was implemented in IEEE extended double
IEEE double precision and IEEE extended double pre- precision (i.e. 16 bytes to store each oating-point
number) (cf. Coonen 1980). The relative precision (RP)
for each h was calculated using
 d 
Table 1. Summary of algorithms for computing partial sums S d s double  sd extended
RP    55
sd extended 
Methoda Section Formulae Computed
quantities
for S for S(d) where sd (double) is the value of Eq. (54) for the
d summation computed in double precision by each
Pnm h
MFC-1 2.6 (28) (32) (33) um respective method and sd (extended) is the result for
d
Pnm h the same sum computed using the second Clenshaw
MFC-2 2.6 (34) (35) Pmm h
d
Pnm h method in extended double precision. The values of RP
MFR 2.5 (28) (27) (30) um
d
are computed under the assumption that the results
Pnm h
RC 3.2 (46) (47) (48) Pmm h obtained from IEEE extended double precision are
CLEN-1 3.3.1 (46) (47) (49)
d
Xnma correct to at least one signicant gure more than those
Pmm h
d
Xnma
obtained from IEEE double precision.
CLEN-2 3.3.2 (51) (52) (53) Pmm hqm The term precision is used here since any systematic
a
MFC-1: rst modied forward column; MFC-2: second modied errors common to computations in both the double
forward column; MFR: modied forward row; RC: reverse precision and extended double precision formats will not
column; CLEN-1: rst Clenshaw; CLEN-2: second Clenshaw be revealed during such a comparison. Moreover, to
290

insure that such systematic errors did not bias the con- method. The two sets of sd (extended) control values
trol sd (extended) values in favour of the sd (double) agreed to a minimum of 25 signicant gures.
values computed using the second Clenshaw method, a For each of the algorithms, the computed quanti-
second set of control values was computed in extended ties (Table 1) were globally scaled to yield values
double precision using the modied forward column of Xm =um  10280 ; Xm =Pmm h  10280 or

Fig. 8. Logarithm of the


P relative
Pn precision
[Eq. (54)] to evaluate 2700
n0

m0 Pnm h
using the rst Clenshaw (solid line) and the
second Clenshaw (dashed line) methods

Fig. 9. Logarithm of the


P relative
Pn precision
[Eq. (54)] to evaluate 2700
n0

m0 Pnm h
using the modied forward column (solid
line) and the second Clenshaw (dashed line)
methods

Fig. 10. Logarithm ofP the relative


Pn precision
[Eq. (54)] to evaluate 2700
n0

m0 Pnm h
using the reverse column (solid line) and
second Clenshaw (dashed line) methods

Fig. 11. Logarithm ofP the relative


Pn precision
[Eq. (54)] to evaluate 2700
n0

m0 Pnm h
using the modied forward row (solid line)
and second Clenshaw (dashed line) methods
291

Xm =Pmm h qm  10280 , which were then substituted performance of the other ve methods can be assessed.
into the implementations of Horners scheme in To test the second Clenshaw method, an extreme, but
Eqs. (31), (38) and (50), respectively, to yield values of realistic, value for q was chosen to provide a contrast to
sd  10280 and then sd . Recall that Enma 1 and the rst Clenshaw method. Thus, q was set to
k 0, so Eqs. (31),(38) and (50) reduce to Eq. (54). It bGRS80 =aGRS80 6 356 752:3141=6 378 137, where
was found that, once the values of Xm =um  10280 ; aGRS80 and bGRS80 are the semi-major and semi-
Xm =Pmm h  10280 or Xm =Pmm hqm  10280 minor axes of the GRS80 ellipsoid (Mortiz 1980).
were computed, they could be appropriately factorised The relative precision signatures of the ve algo-
for use in any of the three implementations of Horners rithms for computing s are shown in Figs. 8 to 11, whilst
scheme with no change to the nal computed value of the relative precision signatures of the ve algorithms
sd . That is, all combinations of the ve algorithms with for computing s1 are shown in Figs. 12 to 15. To fa-
the three implementations of Horners scheme showed cilitate easier visual comparisons, the error signatures
that the choice of implementation of Horners scheme obtained from the second Clenshaw method in the
was irrelevant to the observed precision of the algorithm. computation of s and s1 have been superimposed (da-
Of the ve algorithms to be tested in this way, the shed line) over the corresponding error signatures ob-
second Clenshaw method is the most widely used in tained from each of the other four methods. P2700
geodesy. Thus, it is useful to employ the RP error sig-
PnFor the computation of the quantities s n0
nature of this method as a benchmark against which the 
m0 Pnm h, inspection of Figs. 8 and 9 shows no sys-

Fig. 12. Logarithm ofP the relative


Pn precision
[Eq. (54)] to evaluate 2700
n0
1
m0 Pnm h
using the rst Clenshaw (solid line) and the
second Clenshaw (dashed line) methods

Fig. 13. Logarithm ofP the relative


Pn precision
[Eq. (54)] to evaluate 2700
n0
1
m0 Pnm h
using the modied forward column (solid
line) and second Clenshaw (dashed line)
methods

Fig. 14. Logarithm ofP the relative


Pn precision
[Eq. (54)] to evaluate 2700
n0
1
m0 Pnm h
using the reverse column (solid line) and
second Clenshaw (dashed line) methods
292

Fig. 15. Logarithm ofP the relative


Pn precision
[Eq. (54)] to evaluate 2700
n0
1
m0 Pnm h
using the modied forward row (solid line)
and second Clenshaw (dashed line) methods

tematic dierences between the performance of the before combining them using Horners scheme. This
Clenshaw methods and the modied forward column suggests that, at least for the two modied forward al-
method. One interesting feature is that the relative pre- gorithms, the actual computation of Pnm h=um and
cision signatures obtained from all of the column Pnm
1
h=um is performed equally well in both hemi-
methods for the northern latitudes are almost identical, spheres. In this case, the lack of symmetry in the relative
whilst the signatures for the southern latitudes are not precision signatures returned by these algorithms might
(cf. Figs. 8 to 10). This is particularly evident for the result from the change in sign, across the equator, of half
relative precision signature for the reverse column re- the Pnm h=um and Pnm 1
h=um . This would create
cursion (Fig. 10), which contrasts poorly, in the south- dierent cancelling eects in each hemisphere when
ern latitudes, against the signature from the second these values are combined using Horners scheme. Such
Clenshaw method. Nevertheless, the relative precision is an eect would not be present when squared terms are
still < 109 . combined. Further work may validate this explanation.
Inspection of the relative precision signature for the
modied forward row recursion (Fig. 11) reveals a
slight, but clear, improvement in precision over the other 4.3 Numerical eciency
algorithms. This is particularly evident as computation
approaches the poles. P The ve methods that successfully computed S d , for
PnFor 1 the computation of the quantities s1 2700 n0 M 2700 and for integer values of h to the poles, were

m0 Pnm h, Fig. 12 reveals no clear dierences be- tested for their relative numerical eciency. Consider-
tween the relative precision signatures of the rst and able attention was given to eliminating all redundant
second Clenshaw methods. Figure 13 shows, in the computations from each algorithm. For example, the
northern latitudes only, a moderately improved relative square roots and inverted square roots required to
precision signature for the modied forward column construct the recursion coecients were computed once
method over that of the second Clenshaw method. Si- by each algorithm and then stored for multiple use in the
milarly, the relative precision signature for the modied synthesis subroutines. However, the latitude-indepen-
forward row recursion (Fig. 15) shows an increasing dent components of the recursion coecients were not
improvement over the second Clenshaw method towards computed and stored in this way, but were generated
the north pole. There is also a slight improvement to- from the square roots and inverted square roots as they
wards the south pole. As with the relative precision sig- were required. This was done so that the eciency
natures for s, the reverse column method gives a relative results would be applicable to the many PCs, still widely
poor relative precision signature for s1 in the southern used, which possess insucient RAM to store
latitudes (Fig. 14). This result is to be expected since the ~7.3 million recursion coecients.
values of Pnm1
h=um are computed from Pnm h=um . Table 2 shows the CPU time required by each of the
None of the ve recursion tested delivered a relative ve algorithms to computer the following:
error of >109 in the computation of either s or s1 . No P Pn
(1) s 2700
n0

m0 Pnm h, for integer values of
analysis was conducted to explain the hemisphere-de-
0  h  180 P Pn
pendent performance observed (Figs. 8 to 15) during
(2) s as above and s1 2700n0
1
m0 Pnm h, for integer
these tests. However, this phenomenon is not observed
values of 1  h  179 simultaneously.
in the accuracy tests for the two modied forward al-
gorithms (Sect. 4.4). These both produced relative ac- The CPU times for the reverse column algorithm are
curacy signatures (Figs. 16 and 17) that are noticeably excessively large and so were extrapolated from the
more symmetric about the equator than the precision computation times for a single parallel. All computations
signatures (Figs. 9, 13 and 11, 15) for the corresponding were performed, once again, on a Sun Ultra-10(333 MHz)
algorithms. workstation that uses a virtual or swapped RAM
For each algorithm, the accuracy tests used the same conguration, which is slower than actual RAM.
values of Pnm d
h=um as those used in the precision It should be noted that these CPU times, in addition
tests. However, the accuracy tests squared these values to showing the relative eciency of each approach, are
293
P Pn
Table 2. CPU time required to compute S 2700
n0

m0 Pnm h; 8 from which results

integer values of 0  h  180 , and the CPU time required to

computeP bothPn S, 18 integer values of 1  h  179 , and  n 
M X
X 2
S 1 2700
n0

m0 Pnm h; 8 integer values of 1  h  179 ,

R P1 h
together M
n0 m0
!
MM 12 M 2
(1)
Task S (sec) S and S (sec)
; 0 < h < 180 59
CLEN-1 192 282 4
CLEN-2 192 282
MFC 186 408 For M 2700, Eq. (57) gives R2700 7 295 401 and Eq.
MFR 174 258 (59) gives R2700 13 305 717 113 850. However, these
RC 41 862 67 778
analytic values of R2700 and R2700 cannot be used to
a
CLEN-1: rst Clenshaw; CLEN-2: second Clenshaw; MFC: verify the accuracy of the rst and second Clenshaw
modied forward column; MFR: modied forward row; RC: methods, because these methods do not compute
reverse column individual, scaled values of Pnm d
h. An alternative test
for the standad Clenshaw approaches is to compute
partial sums of second derivatives, S 2 , and then use
also functions of the computer architecture, compiler
these to evaluate Laplaces equation Df 0. However,
and programming language employed, as well as the
this study does not extend to the computation of second
programmers implementation of these algorithms.
derivatives, and so will be conned to testing the
Variations in any of these, particularly algorithmic
accuracy of the modied forward column approach
implementation, can slightly improve or worsen the
and the modied forward row approach only.
relative performance of each algorithm. However, the
To implement this accuracy test, both methods were
results presented in Table 2 are sucient for the current
applied, in IEEE double precision, to compute, for
purpose, which is to demonstrate that all algorithms,
M 2700, integer values of Pnm h=um  10280 0 
except the reverse column algorithm, appear to be of
h  180 and Pnm 1
h=um  10280 1  h  179 .
comparable numerical eciency in evaluating the
However, these values cannot be squared in IEEE
required parital sums. Lastly, for the reasons outlined in
double precesion without an underow. This neces-
Sect. 3.2, the reverse column algorithm is extremely in-
sitates that the squaring of Pnm d
h=um  10280 ,
ecient when compard with the other four approaches,
as well as their combination using Horners scheme,
and thus will be excluded from further examination.
be performed in IEEE extended double precision.
This means that the results from these tests will
only reect the accuracy with which Pnm d
h=um 
4.4 Accuracy 280
10 are computed, since this is the only operation
which can be performed in IEEE double precision for
As mentioned, the numerical evaluations presented in M 2700.
Sect. 4.2 are tests of precision only, since both the tested The values of Pnm
d
h=um  10280 were converted
algorithms and the control algorithm computed in to IEEE extended double precision, squared, and then
IEEE extended double precision may contain shared rescaled by 10560 to yield values of Pnm d
h2 =u2m . All
d 2 2m
systematic errors. These could be due to any one of the values of Pnm h =u of the same m were sum-
compiler, computer architecture or programming errors, med to give the quantities
for example. Therefore, it is prudent to supplement tests
of precision with accuracy assessments that utilise exact X Pnm h2
2700 
identities (i.e. analytic results) incorporating the com- Cm
nm
u2m
puted quantities. For this purpose, starting with the
well-known identity
and
X
n
Pnm h2 2n 1; 8 h 56 X P h2
2700 1
m0 Cm nm

nm
u2m
this can be shown to yield
These Cm were then combined using Horners scheme
M X
X n
R 2 2
Pnm h M 1 ; 8 h 57     
M C2700 2 C2699 2 C2698 2
n0 n0 R comp  u 5398 u 5396 u
2700 u5400 u u
 
Eq. (56) gives C2 C1
   4 u2 2 u2 C0 60
n 
X 2 nn 12n 1 u u
1

Pnm h ; 0 < h < 180 where R2700 (comp) are the computed estimates of R2700 .
m0
2
Exchanging Cm for Cm in Eq. (60) yields R2700 (comp),
58 which are the computed estimates of R2700 .
294

Fig. 16. Logarithm of the relative


accuracy
P2700 Pn[Eq. (61)] to evaluate
 2
n0 m0 Pnm h using the modied
forward row (solid line) and modied
forward column (dashed line) algorithms

Fig. 17. Logarithm of the relative


accuracy
P2700 Pn[Eq. (62)] to evaluate
1 2
n0 m0 Pnm h using the modied
forward row (solid line) and modied
forward column (dashed line) algorithms

The numerical accuracy (NA) of Pnm h was calculated 5 Summary, conclusions and recommendations
using the relation
  This paper has shown that standard Clenshaw methods
R2700 comp  7 295 401
NA 61 for evaluating high-degree spherical harmonic expan-
7 295 401 sions derive their stability from simple numerical
whereas the numerical accuracy NA of Pnm h was principles. IEEE underows are avoided by rst
calculated using the relation eliminating the numerically problematic um term from
   the fundamental recursive algorithms, and then employ-
R2700 comp  13 305 717 113 850 ing Horners scheme to gradually reintroduce this term
NA 62 into the nal computed value for the paritial sums S d .
13 305 717 113 850
Moreover, existing algorithms for computing individual
1
The resulting R2700 (comp) error signatures of both values of Pnm h and Pnm h are easily modied to
algorithms are plotted in Fig. 16 for integer values of incorporate these two fundamental characteristics of the
0  h  180 . The R2700 (comp) error signatures of both standard Clenshaw methods.
algorithms are plotted in Fig. 17 for integer values of This last statement is strongly supported by the re-
1  h  179 . sults of numerical tests. These show that the two new
Figures 16 and 17 show the accuracy of both meth- algorithms (the modied forward row and the modied
ods to be almost identical. In the computation of both forward column methods) can be applied in IEEE
R2700 (comp) (Fig. 16) and R2700 (comp) (Fig. 17), the double precision to compute the partial sums S, up to
modied forward column algorithm performs slightly, M 27000  h  180 , as well as S 1 , up to
but consistently, better than the modied forward row M 27000 < h < 180 , without IEEE underow or
algorithm in the lower latitudes. However, the modied overow. Moreover, the results also suggest that the new
forward column algorithm becomes increasingly less algorithms are equivalent to the standard Clenshaw
accurate than the modied forward row algorithm as the methods in both precision and eciency. No doubt a
computation approaches the poles. This observation is more rigorous testing regime, specic to geodesy, will
consistent with the results presented in Sect. 4.2, in incorporate realistic geopotential coecients into the
which, near the poles, the modied forward row algo- computed partial sums S d . The relatively stable per-
rithms remained relatively stable in comparison with the formance of the modied forward row method, near the
other methods tested. Lastly, note that neither the poles, might also warrant further examination.
modied forward row method, nor the modied forward Perhaps the most interesting characteristic of the new
column method, delivered values of NA or NA greater methods is their relative simplicity. Unlike the standard
than 1011 . These results support those obtained for Clenshaw methods, both the modied forward row and
these two algorithms in the precision tests (Sect. 4.2). modied forward column algorithms are easily for-
295

mulated using elementary algebra. More importantly, of Pnm1 h=um1 are then used in Eq. (30) to compute
the mechanisms within the computation process are all the required Pnm
1
h=um , which are stored in array 2.
highly intuitive and transparent. These qualities should m 1 m
Xm =u and Xm =u are obtained from the values of
simplify the process of adapting these approaches to Pn;m h=um and Pn;m
1
h=um , repectively. For the next
other tasks, such as evaluating partial sums of even d
higher degree and order (e.g. 5400), for all latitudes tes- round of computation Pn;m1 h=um1 , (corresponding
ted in this study. Two other useful adaptions include, for to the next column to the left in Fig. 3), the old array X
M 2700, evaluating partial sums of second derivatives, becomes the new array 1, the old array 1 becomes the new
and evaluating quantities that have been integrated over array 2, and the old array 2 becomes the new array X .
geographic squares bordered by meridians and parallels. This method employs the same number of mathe-
Another potentially useful property of the new matical operations as that which precomputes and stores
methods is the fact that they compute individual, scaled all the required Pn;m h=um and Pn;m1
h=um . However,
values of Pnm
d
h. This property, in conjunction with the the method of three rotated arrays requires a RAM
inherent simplicity of the principles presented here, allocation of only 3M array elements to compute and
renders the new approach an attractive starting point for use the required non-sectoral Pn;m h=um and
extending the maximum M over which existing algo- Pn;m
1
h=um . This contrasts with the pre-compute
rithms for spherical harmonic analysis can be applied. approach, which requires a RAM allocation of
MM 1=2 array elements for the same task.
Acknowledgements. The authors would like to oer their sincerest
thanks to Christian Tscherning and the other two reviewers. Their
suggestions were of considerable use to the authors in allowing
them to produce a much more rigorous and integrated document. A.2 Underows from problematic coecients

For spherical harmonic synthesis of very high degree


(e.g. M 2700), all of the methods presented here will
Appendix A
underow for suciently small values of Enma in Eq. (3).
For example, all methods will report underows (8h)
This Appendix deals with some miscellaneous points on
when EGM96 coecients are employed for the lower
implementing the new methods on a computer. degrees. The sole cause of this is C360;360  4:5  1025 ,
which underows when combined with P360;360 h=
u360  10280 using Horners scheme. In this case, setting
A.1 RAM conservation for the modied C360;360 to zero prevents the underow message and
forward row method yields an error which is undetectable in IEEE double
precision. Of course, an entire coecient set that is
The modied forward row method (Sect. 2.5) computes relatively homogenous in magnitude can be scaled
Pd h=um of matching degree. However, ecient
nm upwards or downwards as needed. Otherwise, a set of
evaluation of the partial sums S d requires that coecients which dier by 20 orders of magnitude or
Pnm
d
h=um of matching order be combined to yield more can be partitioned, according to magnitude, into
d
Xm =um for use using Horners scheme in Eq. (31). A subsets. Each subset is then scaled as a whole and then
used to compute a corresponding partial sum. The
straightforward approach is to precompute and store, resulting partial sums are then rescaled and combined to
for all degrees and orders, all the Pnm d
h=um and then yield the nal result.
combine the Pnm h=u of matching order. However,
d m

many PCs do not have sucient RAM to store, say,


3.7 million values of Pnm h=um and/or Pnm 1
h=um A.3 Combining components by degree
for M 2700.
The alternative is to use the modied forward row The modied forward column and modied forward
method to compute Pnm d
h=um for one order at a time. row recursions are immediately more versatile than the
 d m standard Clenshaw methods, since they do not auto-
The sectoral Pnm h=u are computed and stored as
matically combine quantities of the same order m. This
before. Referring again to Fig. 3, computation of all feature is necessary, for example, to form intermediate
non-sectoral Pnm d
h=um , of order m and degree sums of quantities which share the same n, rather than
m 1  n  M (a complete column in Fig. 3), re- the same m. For example, consider the spherical
quires only that previously computed Pn;m1 h=um1 harmonic expansion of gravitational potential V in
and Pn;m2 h=um2 have been stored. Eq. (4). Set
Three arrays are used in rotation. Arrays 1 and 2
M  n
contain all the previously computed values of GM GM X a
V r; h; k Xd
n A1
Pn;m1 h=um1 and Pn;m2 h=um2 , respectively. r r n2 r
These are used in Eq. (27) to compute all the required non-
sectoral Pnm h=um , which are stored in array X . Values where
296

X
n p
where q accounts for the k term [Eq. (8)] in the full
Xnd Zmd A2 normalisation of the Pnm h, and is given by q 2 for
m0
m 1 and q 1 8 m > 1. Note that, similar to the
and modied forward row recursion [Eq. (27), Sect. 2.5],
Eq. (A5) is ppresented
in Libbrecht [1985, Eq. (4)]
Zmd Cnm1 cos mk Cnm2 sin mkPnm
d
h A3 without the q term, due to a dierent normalisation
which uses k 1; 8 m > 0. A schematic of this staggered
For ultra-high values of M, the modied forward recursion algorithm is given in Fig. B1.
column or modied forward row algorithms are used To use the recursion in Eq. (A5), both the sectoral
to generate values of Pnm
d
h=um . These replace Pnm
d
h Pmm h=um ; 8 m  M (upper diagonal in Fig. (31), and
d m
in Eq. (A3) to yield Zm =u , which are combined using zonal Pn;0 h=u0 Pn;0 h; 8 n  M (leftmost column
Horners scheme in Fig. B1), must be computed independently before-
X
n hand. The sectoral values are computed as before using
Xnd Zmd Eq. (28), whilst the zonal values may be computed using
m0 the modied forward column algorithm [Eq. (32)].
"( " d
# d
! Eq. (A5) can then be used to compute each of the re-
Zmd Zm1 Zm2 maining Pnm h=um from the adjacent Pn1;m h=um
 u m1 u m2 u
um u u (immediately above in Fig. B1), and Pn1;m1 h=um1
) # (diagonally above and to the left in Fig. B1). That is,
d d
Z Z d once all of the sectoral and zonal values are known, this
   22 u 11 u Z0 A4
u u is sucient to compute all Pn;1 h=u1 (second column
to the right in Fig. B1), which may then be used to
to give each separate Xd
n ; 8 2  n  M. Inspection of compute all Pn;2 h=u2 (third column to the right) and
Eq. (A1) shows that this algorithm provides an ecient so on up to m M  1.
means for computing multiple values of V (or any other Libbrecht (1985, p. 372) claims that, provided that
gravimetric quantity) at multiple points along the the zonal Pn;0 h values are computed with sucient
geocentric radial through h and k. accuracy using a ...rapidly converging trigonometric
expansion..., ...one would have to go up to a very high
l [degree] and m [order] indeed before roundo errors
Appendix B
became a problem. That is, the claim seems to be that
the overall accuracy of this computing values of
In addition to the forward row recursion in Eq. (27),
Pnm h=um is superior to that of implied modied for-
Libbrecht (1985) provides a second algorithm for
ward row recursion. However, no numerical results are
computing values of Pnm h=um . Fully normalising
provided by Libbrecht (1985) for this staggered algo-
Magnus et al. [1966, Eq. 4.3.3(6)] and then dividing by
rithm. Moreover, results from numerical tests conducted
um gives
in the current study contradict this claim. For these
p  tests, sectoral Pmm h=um were computed using
Pnm h 2n 1 p Pn1;m h
m
p
nmt Eq. (28), whilst the zonal Pnm h were computed using
u 2n  1n m um
 the standard forward column recursion [Eq. (32)] ap-
p Pn1;m1 h plied in IEEE extended double precision. A procedure
qn m  1 ; 8 n > m; m > 0 identical to that used for the precision trials of the other
um1
recursion methods (Sect. 4.2) was employed to yield a
A5 relative precision signature for the computation of

Fig. B1. Schematic of the recursion sequences employed in staggered Logarithm


Fig. B2. P Pn of the relative precision [Eq. (54)] to
algorithm to compute Pnm h=um evaluate 2700
n0

m0 Pnm h using the staggered algorithm
297
P2700 Pn
n0 m0 Pnm h. The plot of the relative precision C.1.1 Standard forward row factorisation:
statistic is shown in Fig. B2. Pnm h=Pnn h
Inspection of Fig. B2 shows that the staggered algo- The rectangle in Fig. 3 for the forward row recursions
rithm for computing Pnm h=um is highly unstable, ex- contains all Pnm h, for which n 3 and 0  m  3. For
cept for points proximal to the poles and the equator. these values of Pnm h, the standard forward row
However, the relative precision of this algorithm close to recursion [Eq. (18)] gives
the poles does not exceed that of any of the approaches h  t i
presented in Sect. 4.2. Therefore, the staggered recursion P3;2 h g3;2 P3;3 h A6
algorithm should not be used to compute ultra-high u
degree and order spherical harmonic expansions.  
 t 2

P3;1 h g3;1 g3;2 h3;1 P3;3 h A7
u
Appendix C
   t 3 t
This Appendix explores the possibility of formulating  1
P3;0 h p g3;0 g3;1 g3;2 g3;0 h3;1
Clenshaw methods, based on row recursions rather than 2 u u
column recursions, for evaluating the partial sums S d .  t 
These formulations have proven, at present, less g3;2 h3;0 P3;3 h A8
u
successful than the other approaches presented in the
main body of the paper. The general approach in
where the aggregations of gnp t=u and hnp terms within
outlined below in the event that it may yet prove useful
the square brackets are equal to Pnm h=Pnn h. Here,
for future developments in this area.
p has been used instead of m to denote the order of each
recursive term gnp t=u and hnp , since each P3;m h or
order m is comprised of an aggregation of all gnp t=u
C.1 Two forward row factorisations
and hnp terms for m  p  2. In general, any Pnm h may
be factored into Pnn h and an aggregation of all of the
In Sect. 2.6, each of the standard [Eq. (11)], rst
gnp t=u and hnp terms for m  p  n  1. Note that the
modied [Eq. (32)] and second modied [Eq. (34)]
denominator of Pnm h=Pnn h is not Pmm h, but
forward column recursion algorithms are of identical
Pnn h, which is the sectoral value of the same n, rather
form such that only the initial sectoral seed values dier.
than that of the same m.
That is, Eqs. (11), (32) and (34) all employ the same
The quantity of Pnm h=Pnn h appears to be of no
recursive terms (alm t) and blm but use dierent sectoral
practical use. Inspection of Fig. C1, which gives the
seed values. In contrast, the modied forward row
range of magnitudes taken by Pnm h=Pnn h, shows
recursion [Eq. (27)] for computing Pnm h=um diers in
that there is no global scale factor, capable of storage in
form from the standard row recursion [Eq. (18)] for
IEEE double precision, that will allow these quantities
computing Pnm h because the denominator um varies
to be computed for 0 < h < 180 up to M 2700. As
with the order of each Pnm h=um in any given row.
such, the quantity Pnm h=Pnn h will not be used to
That is, the recursive terms, gnm t=u and hnm , used in
compute very high degree and order spherical harmonic
Eq. (18), are dierent from the equivalent terms, gnm t
expansions.
and hnm u2 , used in Eq. (27). Thus, the standard forward
row recursion and the modied forward row recursion
will each yield a separate factorisation of Pnm h. These
factorisations serve to introduce Q the quantities
Pnm h=Pnn h and Pnm h=um n , which will be
examined in the following two subsections.

Fig. C2. A schematic of the recursion sequences employed in the


p Pnm h
reverse row algorithm to compute the quantities j Pn um and
Fig. C1. Logarithm plot of maximum (upper line) and minimum p dPnm h=Pn um
(lower line) values of jPnm h=Pnn hj; 8 n; m  2700 j
dt
298

C.1.2 Modied forward row factorisation: j values (Sect. 2.2) is determined by the value of m in
Pnm h=um Pn Pnm h.
Expanding on the example in Sect. C.1.1, recall that the To compute Pnm 1
h=um Pn , dierentiating Eq.
rectangle in Fig. 3 for the forward row recursions (A12) with respect to t cos h gives
contains Pnm h for which n 3 and 0  m  3. For
these values of Pnm h, the modied forward row s_npa gn;p1 ts_n;p1;a sn;p1;a
recursion [Eq. (27)] gives  hn;p2 u2 s_n;p2;a  2tsn;p1;a A13
P3;2 h The seed values for the recursion in Eq. (A13), snma and
g3;2 tPn3 A9 sn;m1;a , are dierentiated with respect to t to give
u2
s_nma s_n;m1;a 0. These seed values allow the recursion
P3;1 h in Eq. (A13) to be used to compute all s_npa , of the same
g3;1 g3;2 t2  h3;1 u2 Pn3 A10 n, and sequentially increasing p, from s_n;m1;a to s_nna .
u1 When used in this way, the recursion in Eq. (A13) will
  terminate at the computation of
P3;0 h 1
p g3;0 g3;1 g3;2 t3  g3;0 h3;1 tu2  
u0 2 Pnm h
p d um Pn

2
s_nna j
 g3;2 h3;0 tu Pn3 A11 dt
The sectoral
where quantities in square brackets are Pnm h=um Pn .  
Note that the Pn term in the denominator renders any d Punnn Phn
Pnm h=um Pn dierent from the corresponding
Pnm h=um (Fig. 5) by no more than one order of dt
magnitude. are zero, and so their corresponding s_nna are simply set
to zero without the need for any recursion. Application
of the product rule and the chain rule to
C.2 Reverse row methods  
Pnm h
d
p um Pn
To compute any value of Pnm h=um , the modied j
dt
forward row recursion begins with the seed value Pm
and then aggregates the necessary gnp t and hnp u2 yields
recursive terms in order of decreasing p (sequentially left
across each row in Fig. 3). In a manner similar to the Pnm
1
h 1  t 
m
p m snna  us_nna ; 8 n  m A14
reverse column recursion [Eq. (46)], an alternative to the u Pn j u
modied forward row recursion [Eq. (27)] is to reverse
where, as above
this process and apply these same recursive terms in the
sequence of increasing p (sequentially right across each p Pnm h
row in Fig. C2). That is, a recursion may be employed snna j
Pn um
whereby the gnp t and hnp u2 recursive terms, for which
p m, and are applied rst and the recursive terms, for and
which p n  1, are applied last. This will be called a  
reverse row recursion and is illustrated schematically in Pnm h
p d um Pn
Fig. C2. s_nna j
The reverse row recursion is applied using the algo- dt
rithm In terms of the number of recursions required, the
eciency of the reverse row techniques for computing
snpa gn;p1 tsn;p1;a  hn;p2 u2 sn;p2;a ; ynpa A12 values of Pnm h=um Pn and Pnm
1
h=um Pn is the
same as for the reverse column methods (Sect. 3.2) for
To compute Pnm h=Pn um , the recursion in computing values of Pnm h=Pmm h and Pnm 1
h=
Eq. (A12) is used as follows. The seed values are set Pmm h, respectively.
to snma 1; sn;m1;a 0, and all ynpa 0. This allows Similarly, overows in the nal computed values of
the recursive computation of all snpa , of constant n (a Pnm
d
h=um Pn are prevented in the reverse row
row in Fig. C2), and sequentially increasing p (across
method by setting the seed value snma to 10280 (rather
to the right and towards the diagonal in Fig. C2),
from sn;m1;a to snna . The eect of using the recursion than 1) for use in Eq. (A12). This scaling propagates
p d
in Eq. (A12) in this way is to sequentially aggregate linearly though subsequent computationspof  j P
the gnp t and hnp u2 terms, in the sequence of
m
nm h=Pn u to generate values of j Pnm
d
h=
increasing p, until the p recursion terminates at the Pn um  10280 . However, while this will prevent an
computation of snna jPnm h= Pn um . Here, the overow, the reverse row method cannot be applied over
299

the same ranges of M and h as the reverse column al- Deakin RE (1998) Derivatives of the Earths potentials. Geom Res
gorithm due to underow problems during the compu- Aust 68: 3160
Edmonds AR (1957) Angular momentum in quantum mechanics,
tation. For example, for M 2700, the reverse row Princeton University Press, Princeton, NJ
method will underow for h < 76 and h > 104 . No Featherstone WE (1999) Tests of two forms of Stokess integral
investigation of this underow was conducted. using a synthetic gravity eld based on spherical harmonics. In:
Krumm F, Schwarze VS (eds) Quo vadis geodesia. Institute of
Geodesy, University of Stuttgart, pp 101112
Gleason DM (1985) Partial sums of Legendre series via Clenshaw
C.3 Row Clenshaw methods summation. Manuscr Geod 10: 115130
Gulick LJ (1970) A comparison of methods for computing grav-
The standard Clenshaw methods do not translate well to itational potential derivatives. Tech rep 40, Environmental
row-type recursions. The rst Clenshaw method uses the Sciences Services Administration, US Department of Com-
reverse column recursion in Eqs. (46) and (47) to merce, Washington, DC
d Haagmans RRN (2000) A synthetic Earth for use in geodesy.
compute Xma =Pmm h. An equivalent utilisation of J Geod 74: 531551
the reverse row recursion in Eq. (A12) proves to be of Harris JW, Stocker H (1998) Handbook of mathematics and
little use. In this case, setting sn;m1;a sn;m2;a 0 and computational science. Springer, Berlin Heidelberg New York
all ynpa Enpa allows the recursive computation of all Heiskanen WA, Moritz H (1967) Physical geodesy. Freeman, San
snpa , of constant n (a row in Fig. C2), and sequentially Francisco
increasing p (across to the right and towards the Lemoine FG, Kenyon SC, Factor JK, Trimmer RG, Pavlis NK,
Chinn DS, Cox CM, Klosko SM, Luthcke SB, Torrence MH,
diagonal in Fig. C2), from snma to snna . In this case Wang YM, Williamson RG, Pavlis EC, Rapp RH, Olson TR
recursion terminates at (1998) The development of the joint NASA GSFC and the
X n p  National Imagery and Mapping Agency (NIMA) geopotential
 Pnm h model EGM96. NASA/TP-1998-206861, National Aeronautics
snna j Enma m and Space Administration, Washington, DC
m0
u Pn
Lesur V, Gubbins D (1999) Evaluation of fast spherical transforms
p for geophysical applications. Geophys J Int 139: 547555
The j term notwithstanding, the principal problem Libbrecht KG (1985) Practical considerations for the generation of
with the quantity large order spherical harmonics. Solar Phys 99: 371373
X n p  Magnus W, Oberhettinger F, Soni RP (1966) Formulas and theo-
Pnm h rems for special functions of mathematical physics, 3rd edn.
snna j Enma m
u Pn Springer, Berlin Heidelberg New York
m0
Moritz H (1980) Geodetic reference system 1980. Bull Geod 54(4):
is that the denominator of Pnm h=um Pn varies with 395405
Novak P, Van cek P, Veronneau M, Holmes SA, Featherstone WE
both n and m. This means that this quantity has eectively (2001) On the accuracy of Stokess integration in the precise
summed components for which the scale factor is not high-frequency gravimetric geoid determination. J Geod 74:
constant, thereby preventing such sums from being 644654
combined and rescaled to achieve the nal sums S. Pail R (1999) Synthetic global gravity model for planetary bodies
and applications in satellite gravity gradiometry. PhD thesis,
Technical University of Graz
Risbo T (1996) Fourier transform summation of Legendere series
References and D-functions. J Geod 70: 383396
Rizos C (1979) An ecient computer technique for the evaluation
Abd-Elmotaal HA (1997) An ecient technique for the computa- of geopotential from spherical harmonic models. Aust J Geod
tion of the gravimetric quantities from geopotential earth Photogram Surv 31: 161169
models. Paper presented to the IAG Scientic Assembly, 39 Tscherning CC (1976) Computation of second-order derivatives of
September, Rio de Janeiro the normal potential based on the representation by a Legendre
Abramowitz W, Stegan IA (1972) Handbook of mathematical series. Manuscr Geod 1: 7192
functions, 9th edn. Dover Publications, New York Tschering CC, Poder K (1982) Some geodetic applications of
Belikov MV (1991) Spherical harmonic analysis and synthesis with Clenshaw summation. Boll Geos Sci A 4: 351364
the use of columnwise recurrence relations. Manuscr Geod 16: Tscherning CC, Rapp RH (1974) Closed covariance expressions for
384410 gravity anomalies, geoid undulations, and deections of the
Belikov MV, Taybatorov KA (1991) An ecient algorithm for vertical implied by anomaly degree variance models. Rep 208,
computing the Earths gravitational potential and its derivatives Department of Geodetic Science and Surveying, The Ohio State
at satellite altitudes. Manuscr Geod 17: 104116 University, Columbus
Clenshaw CW (1955) A note on the summation of the Chebyshev Tscherning CC, Rapp RH, Goad C (1983) A comparison of
series. Math Tab Automat Comput 9: 118120 methods for computing gravimetric quantities from high degree
Colombo C (1981) Numerical methods for harmonic analysis on spherical harmonic expansions. Manuscr Geod 8: 249272
the sphere. Rep 310, Department of Geodetic Science and Wenzel G (1998) Ultra-high degree geopotential models GPM98A,
Surveying, The Ohio State University, Columbus B, and C to degree 1800. Paper presented to the joint meeting of
Coonen JT (1980) An implementation guide to a proposed stan- the International Gravity Commission and International Geoid
dard for oating point arithmetic. Computer 13(1): 6879 Commission, 712 September, Trieste

You might also like