49 #define NULL_ELEVATION -9999
50 #define INTEGER_NULL -99
51 #define POLYGON_SUFFIX "_polygons.txt"
52 #define LINE_SUFFIX "_lines.txt"
53 #define CONNECTION_SUFFIX "_connections.txt"
82 int ilength2d=iline_index+1;
83 int iP1_x=ilength2d+1;
92 if (ldata->
nch!=indata) printf(
"Warning in read_linevector: inconstancy on number of columns (data) : %ld %d \n",ldata->
nch,indata);
95 for (j=lines->
nl;j<=lines->nh;j++) {
96 ja=(long)ldata->element[j][iline_index];
97 if (j!=ja) printf(
"Error in read_linevector (line %ld of %ld): inconstancy on line index : %ld %ld \n",j,lines->
nh,j,ja);
107 if (print==1) printf(
"Function read_linevector (number of lines %ld) was successfully executed!! \n",lines->
nh);
125 int ipolygon_index=iy+1;
126 int iarea2d=ipolygon_index+1;
134 if (v_data->
nh<=n_data) printf (
"Error in read_polygon there no sufficient data !!\n");
137 if (!po)
t_error(
"Polygon in read_polygon struct was not allocated");
139 po->
area2D=v_data->element[iarea2d];
140 po->
index=v_data->element[ipolygon_index];
173 for (j=polygons->
nl;j<=polygons->nh;j++) {
175 if (polygons->
element[j]->
index!=j) printf (
"Error in read_polygonvector (polygon %ld) inconstancy: %ld %ld \n",j,j,polygons->
element[j]->
index);
179 if (print==1) printf(
"Function read_polygonvector (number of polygons %ld) was successfully executed!!",polygons->
nh);
201 int s=(v_data->
nh-1)%2;
202 if (s!=0) printf(
"Error in read_connections (index %ld) odd number of elements in the vector after the first one which is the polygon index",v_data->
nh);
204 long l=(v_data->
nh-1)/2;
208 if (!pca) printf(
"Error: polygon_connection_attributes was not allocated at %ld polygon",(
long)v_data->element[1]);
214 pca->
connections->element[j]=(long)(v_data->element[j*2]);
246 for (j=pca->
nl;j<=pca->nh;j++) {
253 if (print==1) printf(
"Function read_connection_attributes (number of polygons %ld) was successfully executed!!",pca->
nh);
270 if (!grid)
t_error(
"Grid in read_grid was not allocated");
282 if (grid->
polygons->
nh!=grid->
links->
nh) printf (
"Error in read_grid inconstancy betenn numbers of polygons %ld and of connection attributes %ld \n",grid->
lines->
nh,grid->
links->
nh);
287 for (j=grid->
links->
nl;j<=grid->links->nh;j++) {
295 if (print==1) printf(
"\n Function read_grid was successfully executed (number of polygons: %ld - number of lines: %ld - boundary indactor : %ld) \n",grid->
polygons->
nh,grid->
lines->
nh,grid->
boundary_indicator);
341 if (!sq)
t_error(
"Square Grid sq was not allocated");
356 printf(
"Warning: index matrix of SQUARE_GRID (already created) %s was not checked!!\n",keyname);
359 if (print==1) printf(
"Function read_square_grid (%s) was correctly executed!!! \n",keyname);
380 for (j=lm->
nl;j<=lm->nh;j++) {
381 if (print==1) printf(
"Function read_fine_indices element %ld of %ld is being defined \n",j,lm->
nh);
383 if (print==1) printf(
"Function read_fine_indices element %ld of %ld is read [%ld,%ld] f.e. %ld \n",j,lm->
nh,lm->
element[j]->
nrh,lm->
element[j]->
nrh,lm->
element[j]->element[1][1]);
384 if (!lm->
element[j])
t_error(
"lm->element[j] in read_fine_indices was not defined");
391 if (print==1) printf(
"Function read_fine_indices was successfully executed! \n");
419 for (j=0;j<=n_l-1;j++) {
423 for (j=vi->
nl;j<=vi->nh;j++) {
424 vi->element[j]=lv[j-1]->
nh;
427 for (j=lb->
index->
nl;j<=lb->index->nh;j++) {
428 for(c=1;c<=lb->
index->element[j];c++) {
429 lb->element[j][c]=lv[j-1]->element[c];
434 for (j=0;j<=n_l-1;j++) {
440 if (print==1) printf(
"Function read_line_indices was successfully executed! \n");
472 char *filename_c_polygon=
join_strings(keyname,
"_c_polygon.txt");
473 char *filename_c_line=
join_strings(keyname,
"_c_line.txt");
476 if (!dsq)
t_error(
"Double Square Grid dsq in read_doublesquare_grid was not allocated");
496 if (print==1) printf(
"Function read_doublesquare_grid was successfully executed! \n ");