17 #include <grass/gis.h>
19 #include <grass/interpf.h>
30 static FCELL *array_cell =
NULL;
36 (FCELL *) G_malloc(
sizeof(FCELL) * params->
nsizc + 1))) {
37 fprintf(stderr,
"Cannot allocate memory for array_cell\n");
42 for (j = ngstc; j <= nszc; j++)
43 array_cell[j - 1] = (FCELL) params->
az[j];
44 if (fseek(params->
Tmp_fd_z, (
long)offset2, 0) == -1) {
45 fprintf(stderr,
"Cannot fseek elev offset2=%d\n", (
int)offset2);
50 (array_cell + ngstc - 1,
sizeof(FCELL), nszc - ngstc + 1,
52 fprintf(stderr,
"Not enough disk space--cannot write files\n");
57 for (j = ngstc; j <= nszc; j++)
59 array_cell[j - 1] = (FCELL) params->
adx[j];
61 array_cell[j - 1] = (FCELL) (params->
adx[j] * params->
scik1);
62 if (fseek(params->
Tmp_fd_dx, (
long)offset2, 0) == -1) {
63 fprintf(stderr,
"Cannot fseek slope\n");
68 (array_cell + ngstc - 1,
sizeof(FCELL), nszc - ngstc + 1,
70 fprintf(stderr,
"Not enough disk space--cannot write files\n");
75 for (j = ngstc; j <= nszc; j++) {
77 if (params->
ady[j] > 0. && params->
ady[j] < 0.5)
78 params->
ady[j] = 360.;
79 array_cell[j - 1] = (FCELL) params->
ady[j];
82 array_cell[j - 1] = (FCELL) (params->
ady[j] * params->
scik1);
84 if (fseek(params->
Tmp_fd_dy, (
long)offset2, 0) == -1) {
85 fprintf(stderr,
"Cannot fseek aspect\n");
90 (array_cell + ngstc - 1,
sizeof(FCELL), nszc - ngstc + 1,
92 fprintf(stderr,
"Not enough disk space--cannot write files\n");
97 for (j = ngstc; j <= nszc; j++) {
98 array_cell[j - 1] = (FCELL) (params->
adxx[j] * params->
scik1);
100 if (fseek(params->
Tmp_fd_xx, (
long)offset2, 0) == -1) {
101 fprintf(stderr,
"Cannot fseek pcurv\n");
106 (array_cell + ngstc - 1,
sizeof(FCELL), nszc - ngstc + 1,
108 fprintf(stderr,
"Not enough disk space--cannot write files\n");
113 for (j = ngstc; j <= nszc; j++)
114 array_cell[j - 1] = (FCELL) (params->
adyy[j] * params->
scik2);
115 if (fseek(params->
Tmp_fd_yy, (
long)offset2, 0) == -1) {
116 fprintf(stderr,
"Cannot fseek tcurv\n");
121 (array_cell + ngstc - 1,
sizeof(FCELL), nszc - ngstc + 1,
123 fprintf(stderr,
"Not enough disk space--cannot write files\n");
128 for (j = ngstc; j <= nszc; j++)
129 array_cell[j - 1] = (FCELL) (params->
adxy[j] * params->
scik3);
130 if (fseek(params->
Tmp_fd_xy, (
long)offset2, 0) == -1) {
131 fprintf(stderr,
"Cannot fseek mcurv\n");
136 (array_cell + ngstc - 1,
sizeof(FCELL), nszc - ngstc + 1,
138 fprintf(stderr,
"Not enough disk space--cannot write files\n");
int IL_write_temp_2d(struct interp_params *, int, int, int)