diff --git a/preprocess.c b/preprocess.c index dbbddd65..3b08e731 100644 --- a/preprocess.c +++ b/preprocess.c @@ -445,7 +445,10 @@ void process_grdecl(const struct grdecl *in, double z1 = sign*in->zcorn[i+2*nx*(j+2*ny*(k))]; double z2 = sign*in->zcorn[i+2*nx*(j+2*ny*(k+1))]; - if (z2 < z1){ + int c1 = i/2 + nx*(j/2 + ny*k/2); + int c2 = i/2 + nx*(j/2 + ny*(k+1)/2); + + if (in->actnum[c1] && in->actnum[c2] && (z2 < z1)){ fprintf(stderr, "\nZCORN should be strictly nondecreasing along pillars!\n"); error = 1; goto end;