for (GridDatatype g : grids) {
GridCoordSystem gsys = g.getCoordinateSystem();
CoordinateAxis t = gsys.getTimeAxis();
Variable v = g.getVariable();
String level = v.findAttribute("GRIB_level_type_name").getStringValue();
Attribute att = v.findAttribute("GRIB_interval_stat_type");
String stat = (att == null) ? "" : att.getStringValue();
att = v.findAttribute("GRIB_ensemble");
String ens = "";
if (att != null) ens = att.getStringValue();
else {
att = v.findAttribute("GRIB_ensemble_derived_type");
if (att != null) ens = att.getStringValue();
}
att = v.findAttribute("GRIB_probability_type");
String prob = (att == null) ? "" : att.getStringValue();
System.out.printf(format, v.getFullName(), level, stat, ens, prob);
}
System.out.printf("%n");
ncd.close();
}