Go to the documentation of this file.
24 #define MALLOC(ptr,typ,num) { \
25 (ptr) = (typ *)malloc((num) * sizeof(typ)); \
27 fprintf(stderr,"-E- %s line %d: Memory allocation failure.\n", \
45 float p, qn, sig, un, *
u;
53 u[0] = (3.0 / (
x[1] -
x[0]))*((
y[1] -
y[0]) / (
x[1] -
x[0]) - yp1);
55 for (
i = 1;
i < n - 1;
i++) {
56 sig = (
x[
i] -
x[
i - 1]) / (
x[
i + 1] -
x[
i - 1]);
57 p = sig * y2[
i - 1] + 2.0;
58 y2[
i] = (sig - 1.0) /
p;
60 u[
i] = (6.0 *
u[
i] / (
x[
i + 1] -
x[
i - 1]) - sig *
u[
i - 1]) /
p;
66 un = (3.0 / (
x[n - 1] -
x[n - 2]))*(ypn - (
y[n - 1] -
y[n - 2]) / (
x[n - 1] -
x[n - 2]));
68 y2[n - 1] = (un - qn *
u[n - 2]) / (qn * y2[n - 2] + 1.0);
69 for (
k = n - 2;
k >= 0;
k--) {
70 y2[
k] = y2[
k] * y2[
k + 1] +
u[
k];
89 static int pklo = 0, pkhi = 1;
98 if (xa[pklo] <=
x && xa[pkhi] >
x) {
104 while (khi - klo > 1) {
105 k = (khi + klo) >> 1;
106 if (xa[
k] >
x) khi =
k;
111 h = xa[khi] - xa[klo];
113 fprintf(
stderr,
"-E- %s line %d: Bad xa input to function splint()\n",
117 a = (xa[khi] -
x) /
h;
118 b = (
x - xa[klo]) /
h;
119 *
y =
a * ya[klo] +
b * ya[khi] +
120 ((
a *
a *
a -
a) * y2a[klo] + (
b *
b *
b -
b) * y2a[khi])*(
h *
h) / 6.0;
void splint(float xa[], float ya[], float y2a[], int n, float x, float *y)
void spline(float x[], float y[], int n, float yp1, float ypn, float y2[])
#define MALLOC(ptr, typ, num)
PGE01 indicating that PGE02 PGE01 V6 for and PGE01 V2 for MOD03 were used to produce the granule By convention adopted in all MODIS Terra PGE02 code versions are The fourth digit of the PGE02 version denotes the LUT version used to produce the granule The source of the metadata environment variable ProcessingCenter was changed from a QA LUT value to the Process Configuration A sign used in error in the second order term was changed to a