}
Dimension obsDim = null;
if (z.getRank() > 0)
obsDim = z.getDimension(z.getRank() - 1); // may be z(z) or alt(profile, z)
else if (z.getParentStructure() != null) {
Structure parent = z.getParentStructure(); // if time axis is a structure member, try pulling dimension out of parent structure
obsDim = parent.getDimension(parent.getRank() - 1);
}
if (obsDim == null) {
errlog.format("Must have a non-scalar Height coordinate%n");
return null;
}