.clr file format

Layer Polynomials

All physical parameters are defined by polynominals of n-th degree, with normalized radius as free variable. This type of model representation has been used successfully in several well known models as PREM (Dziewonski & Anderson, 1981) or IASP91 (Kennett & Anderson, 1991).

So if a layer and its P wave velocity is given by lines like

!planet !radius rp
!layer !start SampleLayer
!layer !depth z1 z2
!layer !vp p1 p2 p3 ... pn
!layer !end

Then the velocity in the depth interval [min(z1, z2),max(z1,z2)] is given by
vp = p1+ p2x+ p3x2+ ...+ pnx(n-1)
where x is the normalized radius
x = (rp-z)/rp for min(z1,z2)<=z<=max(z1,z2)

(Note that it is not defined which of z1 and z2 is the larger one!)

The first element listed in the .clr file is the constant term and will be stored in the first element of the respective vector of a CLR structure. The last element listed in the .clr file is the coefficient of the highest power and will be stored in the last element of the respective vector of a CLR structure.

Evaluation of vp in matlab will read like this:

x=(clr.rp-depth(indies))./clr.rp;
vp=clr.vp(1)+clr.vp(2).*x+clr.vp(3).*x^2+...;

(which is not the way a polynomial should be evaluated) or, when using polyval:

vp=polyval(flipud(clr.vp),x);

NOTE that you have to enter a "0" as coefficient if a certain power of x is "not present" in your polynomial!


eof.