// count vertical axes
int countVertCooordAxes = 0;
List axes = ncd.getCoordinateAxes();
for (int i = 0; i < axes.size(); i++) {
CoordinateAxis axis = (CoordinateAxis) axes.get(i);
AxisType t = axis.getAxisType();
if ((t == AxisType.GeoZ) || (t == AxisType.Height) || (t == AxisType.Pressure) )
countVertCooordAxes++;
}
if (showCount) {
System.out.println(" grids=" + countGrids + ((ngrids < 0) ? " *" : ""));
System.out.println(" coordSys=" + countCoordSys + ((ncoordSys < 0) ? " *" : ""));
System.out.println(" coordAxes=" + countCoordAxes + ((ncoordAxes < 0) ? " *" : ""));
System.out.println(" vertAxes=" + countVertCooordAxes + ((nVertCooordAxes < 0) ? " *" : ""));
}
Iterator iter = gridDs.getGridsets().iterator();
while (iter.hasNext()) {
GridDataset.Gridset gridset = (GridDataset.Gridset) iter.next();
gridset.getGeoCoordSystem();
}
GridDatatype grid = gridDs.findGridDatatype(gridName);
assert (grid != null) : "Cant find grid "+gridName;
GridCoordSystem gcs = grid.getCoordinateSystem();
CoordinateAxis1DTime runtime = gcs.getRunTimeAxis();
assert (runtime != null) : "Cant find runtime for "+gridName;
CoordinateAxis time = gcs.getTimeAxis();
assert (time != null) : "Cant find time for "+gridName;
assert (time.getRank() == 2) : "Time should be 2D "+gridName;
if (showCount) {
System.out.println(" runtimes=" + runtime.getSize());
System.out.println(" ntimes=" + time.getDimension(1).getLength());
}
if (ngrids >= 0)
assert ngrids == countGrids : "Grids " + ngrids + " != " + countGrids;
//if (ncoordSys >= 0)
// assert ncoordSys == countCoordSys : "CoordSys " + ncoordSys + " != " + countCoordSys;
if (ncoordAxes >= 0)
assert ncoordAxes == countCoordAxes : "CoordAxes " + ncoordAxes + " != " + countCoordAxes;
if (nVertCooordAxes >= 0)
assert nVertCooordAxes == countVertCooordAxes : "VertAxes" + nVertCooordAxes + " != " + countVertCooordAxes;
if (nruns >= 0)
assert runtime.getSize() == nruns : runtime.getSize()+" != "+ nruns;
if (nruns >= 0)
assert time.getDimension(0).getLength() == nruns : " nruns should be "+ nruns;
if (ntimes >= 0)
assert time.getDimension(1).getLength() == ntimes : " ntimes should be "+ ntimes;
gridDs.close();
}