Commit d62530e8 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

gridDefYsize: check grid size

parent 6f094172
...@@ -1220,10 +1220,13 @@ void gridDefXsize(int gridID, int xsize) ...@@ -1220,10 +1220,13 @@ void gridDefXsize(int gridID, int xsize)
gridptr->xsize = xsize; gridptr->xsize = xsize;
if ( gridInqType(gridID) != GRID_UNSTRUCTURED && if ( gridInqType(gridID) != GRID_UNSTRUCTURED )
gridptr->xsize*gridptr->ysize > gridInqSize(gridID) ) {
Error("inconsistent grid declaration! (xsize %d ysize %d gridsize %d)", long gridsize = gridptr->xsize*gridptr->ysize;
gridptr->xsize, gridptr->ysize, gridInqSize(gridID)); if ( gridsize > 0 && gridsize != gridInqSize(gridID) )
Error("Inconsistent grid declaration! (xsize=%d ysize=%d gridsize=%d)",
gridptr->xsize, gridptr->ysize, gridInqSize(gridID));
}
} }
...@@ -1328,10 +1331,13 @@ void gridDefYsize(int gridID, int ysize) ...@@ -1328,10 +1331,13 @@ void gridDefYsize(int gridID, int ysize)
gridptr->ysize = ysize; gridptr->ysize = ysize;
if ( gridInqType(gridID) != GRID_UNSTRUCTURED && if ( gridInqType(gridID) != GRID_UNSTRUCTURED )
gridptr->xsize*gridptr->ysize > gridInqSize(gridID) ) {
Error("inconsistent grid declaration! (xsize %d ysize %d gridsize %d)", long gridsize = gridptr->xsize*gridptr->ysize;
gridptr->xsize, gridptr->ysize, gridInqSize(gridID)); if ( gridsize > 0 && gridsize != gridInqSize(gridID) )
Error("Inconsistent grid declaration! (xsize=%d ysize=%d gridsize=%d)",
gridptr->xsize, gridptr->ysize, gridInqSize(gridID));
}
} }
/* /*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment