cdm/src/main/java/ucar/ma2/ArrayStructure.java
public double convertScalarDouble(int recnum, StructureMembers.Member m) {
    if (m.getDataType() == DataType.DOUBLE) return getScalarDouble(recnum, m);
    if (m.getDataType() == DataType.FLOAT) return (double) getScalarFloat(recnum, m);
    Object o = getScalarObject(recnum, m);
    if (o instanceof Number) return ((Number) o).doubleValue();
    throw new ForbiddenConversionException("Type is " + m.getDataType() + ", not convertible to double");
  }
public double convertScalarDouble(int recnum, StructureMembers.Member m) {
    if (m.getDataType() == DataType.DOUBLE) return getScalarDouble(recnum, m);
    if (m.getDataType() == DataType.FLOAT) return (double) getScalarFloat(recnum, m);
    Object o = getScalarObject(recnum, m);
    if (o instanceof Number) return ((Number) o).doubleValue();
    throw new ForbiddenConversionException("Type is " + m.getDataType() + ", not convertible to double");
  }
Get scalar value as a double, with conversion as needed. Underlying type must be convertible to double.

@param recnum get data from the recnum-th StructureData of the ArrayStructure. Must be less than getSize();
@param m      member Variable.
@return scalar double value
@throws ForbiddenConversionException if not convertible to double.