# Geophysical Fields: Downloads

## GEOS 602

Spring 2010

Tu-Th 1:30-3:00, GI Auditorium

### Instructor: Jeff Freymueller

x7286 Elvey 413B jeff.freymueller@gi.alaska.eduLast Updated: February 9, 2010

### Spherical Harmonic Codes

MATLAB is an extremely useful tool for all sorts of computational problems. UAF has a site license for MATLAB, so it is very simple to install and use on any machine. You do need to be connected to the network to use the UAF license, and may need to be on the UAF network to use it (directly or through VPN).

The files below are MATLAB programs to calculate spherical harmonics. MATLAB has
a built-in function `legendre`

, which computes the associated Legendre
functions. It will compute un-normalized, Schmidt-normalized or fully normalized
functions.
Full documentation on the Mathworks web site.

A word of caution about normalizations. Although the Schmidt-normalized functions appear to have a completely standard definition, there are at least two different versions of "fully normalized" functions. MATLAB uses a normalization for the Legendre functions such that the Pnm(x) themselves are normalized for an integration over x. But the spherical harmonics themselves are based on Pnm(x)*{sin(phi),cos(phi)}, where x=cos(theta). The surface harmonic needs to be normalized based on an integration over the sphere over both theta and phi. This leads to a slightly different normalization for the harmonics. See for example, Hofmann-Wellenhof and Moritz, Physical Geodesy, 2nd ed., page 23 (section 1.10). As a result, in the spharm.m code on this page, I used MATLAB to compute the Schmidt-normalized functions, and then renormalized them myself. Acording to the equations in the MATLAB documentation, I should have been able to simply multiply the MATLAB fully-normalized functions by 2.0, but either I was making a mistake or something else went wrong, so I continue to use the Schmidt-normalized, and then renormalize again approach.

The program spharm.m calculates a single spherical harmonic function. The program spharm_example.m shows how to use spharm.m.

The program spharm_to_degree.m calculates spherical harmonic functions up to degree and order n. The program spharm_to_deg_ex.m shows how to use spharm_to_deg.m.

The functions schmit.f and schmit.m calculate the Schmidt-normalized harmonics. They are mostly useful if you want to use FORTRAN or want to see how they are calculated, because it is easier in MATLAB to use the built-in LEGENDRE function. The program runschmit.m shows how to call schmit.m.

### Gravity Fields

#### EGM96

The four files below are used to calculate the geoid heights or gravity anomalies based on the EGM96 gravity field. EGM96 is a gravity field model complete to degree and order 360 developed jointly by NASA and NIMA.

Filename |
Description |

geoidheight.m | Calculates geoid heights from EGM model, complete to selected degree |

gravanom_harmonic.m | Calculates gravity anomalies from EGM model, complete to selected degree |

readEGM96.m | Reads coefficients for EGM model from file (see next item) |

egm96_to360.ascii | File with coefficients for EGM model |

### GRACE

The GRACE gravity models are given below. The MATLAB mapping toolbox also provides a routine that can provide values of geoid height for the EGM96 model. The function is called egm96geoid.

Filename |
Description |

gravanom_grace.m | Calculates gravity anomalies from GRACE model, complete to selected degree |

readGRACE.m | Reads coefficients for GRACE model from file (see next item) |

GGM02C.GEO | File with coefficients for GRACE gravity model GGM02C |

GGM02S.GEO | File with coefficients for GRACE gravity model GGM02S |

Dr. Jeffrey T. Freymueller

Professor of Geophysics

Geophysical Institute

University of Alaska, Fairbanks

Fairbanks, AK 99775-7320