String parameter = testdata[ i +1];
int[][]tb = timeBounds.get( testdata[ i +2] );
try {
System.out.println("Open "+grib);
NetcdfFile ncf = NetcdfFile.open( grib );
Variable var = ncf.findVariable( parameter );
Dimension dim = var.getDimension( 0 );
String bounds = dim.getName() +"_bounds";
Variable interval = ncf.findVariable( bounds );
Array data = interval.read();
IndexIterator iter = data.getIndexIterator();
int idx = 0;
while (iter.hasNext()) {
int start = iter.getIntNext();
int end = iter.getIntNext();
if( start != tb[idx][0] || end != tb[idx][1]) {
System.out.printf( "bounds for file %s, parameter %s failed%n", grib, parameter);
System.out.printf( "interval %d - %d known %d - %d%n",
start, end, tb[idx][0], tb[idx][1] );
}
assert( start == tb[idx][0]);
assert( end == tb[idx][1]);
idx++;
}
ncf.close();
} catch (Exception exc) {
exc.printStackTrace();
}
}