34 g2int *idrstmpl,
unsigned char *cpack,
g2int *lcpack)
37 g2int *ifld, tmplsim[5];
39 float *pscale, tscale;
40 g2int Js, Ks, Ms, Ts, Ns, inc, incu, incp, n, Nm, m, ipos;
49 pscale = malloc((JJ + MM + 1) *
sizeof(
float));
50 tscale = (float)idrstmpl[4] * 1E-6;
51 for (n = Js; n <= JJ + MM; n++)
52 pscale[n] = pow((
float)(n * (n + 1)), tscale);
57 tfld = malloc(ndpts *
sizeof(
float));
58 unpk = malloc(ndpts *
sizeof(
float));
59 ifld = malloc(ndpts *
sizeof(
g2int));
63 for (m = 0; m <= MM; m++)
71 for (n = m; n <= Nm; n++)
73 if (n <= Ns && m <= Ms)
75 unpk[incu++] = fld[inc++];
76 unpk[incu++] = fld[inc++];
80 tfld[incp++] = fld[inc++] * pscale[n];
81 tfld[incp++] = fld[inc++] * pscale[n];
89 printf(
"specpack: Incorrect number of unpacked values %d given:\n", (
int)Ts);
90 printf(
"specpack: Resetting idrstmpl[8] to %d\n", (
int)incu);
100 tmplsim[1] = idrstmpl[1];
101 tmplsim[2] = idrstmpl[2];
102 tmplsim[3] = idrstmpl[3];
103 simpack(tfld, ndpts - Ts, tmplsim, cpack + ipos, lcpack);
104 *lcpack = (*lcpack) + ipos;
107 idrstmpl[0] = tmplsim[0];
108 idrstmpl[1] = tmplsim[1];
109 idrstmpl[2] = tmplsim[2];
110 idrstmpl[3] = tmplsim[3];