Commit 96a25ef9 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Check parent array.

parent 7724defa
......@@ -192,6 +192,11 @@ void compute_child(cellindex_type *cellindex1, cellindex_type *cellindex2)
{
int ncells1 = cellindex1->ncells;
int *parent1 = cellindex1->parent;
{
int i;
for ( i = 0; i < ncells1; ++i ) if ( parent1[i] >= 0 ) break;
if ( i == ncells1 ) cdoAbort("Missing parent index of %s!", cellindex1->filename);
}
int *idx1 = (int*) Malloc(ncells1*sizeof(int));
for ( int i = 0; i < ncells1; ++i ) idx1[i] = i;
for ( int i = 1; i < ncells1; ++i )
......
Markdown is supported
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