21 #include <grass/config.h>
26 #include <grass/gis.h>
27 #include <grass/glocale.h>
28 #include <grass/interpf.h>
43 static FCELL *array_cell =
NULL;
46 array_cell = G_malloc(
sizeof(FCELL) * params->
nsizc + 1);
48 for (j = ngstc; j <= nszc; j++)
49 array_cell[j - 1] = (FCELL) params->
az[j];
51 if (!fwrite(array_cell + ngstc - 1,
sizeof(FCELL), nszc - ngstc + 1,
56 for (j = ngstc; j <= nszc; j++)
58 array_cell[j - 1] = (FCELL) params->
adx[j];
60 array_cell[j - 1] = (FCELL) (params->
adx[j] * params->
scik1);
62 if (!fwrite(array_cell + ngstc - 1,
sizeof(FCELL), nszc - ngstc + 1,
67 for (j = ngstc; j <= nszc; j++) {
69 if (params->
ady[j] > 0. && params->
ady[j] < 0.5)
70 params->
ady[j] = 360.;
71 array_cell[j - 1] = (FCELL) params->
ady[j];
74 array_cell[j - 1] = (FCELL) (params->
ady[j] * params->
scik1);
77 if (!fwrite(array_cell + ngstc - 1,
sizeof(FCELL), nszc - ngstc + 1,
82 for (j = ngstc; j <= nszc; j++) {
83 array_cell[j - 1] = (FCELL) (params->
adxx[j] * params->
scik1);
86 if (!fwrite(array_cell + ngstc - 1,
sizeof(FCELL), nszc - ngstc + 1,
91 for (j = ngstc; j <= nszc; j++)
92 array_cell[j - 1] = (FCELL) (params->
adyy[j] * params->
scik2);
94 if (!fwrite(array_cell + ngstc - 1,
sizeof(FCELL), nszc - ngstc + 1,
99 for (j = ngstc; j <= nszc; j++)
100 array_cell[j - 1] = (FCELL) (params->
adxy[j] * params->
scik3);
102 if (!fwrite(array_cell + ngstc - 1,
sizeof(FCELL), nszc - ngstc + 1,