Re: java-netcdf2.2v10, offset on reading nc files

Heiko Klein wrote:

Hi John,

thanks for your feedback concerning grib/BUFR. Reading your argument about the netcdf-library being able to read grib-data, I don't think it will be a problem for us when the collaboration will decide for grib, though I still will prefer the netcdf-library.

Today, I ran into another problem with reading netcdf-files with 2.2.09 and 2.2.10 . At first I got a EOFException: at at
        at ucar.nc2.N3raf.readData(
        at ucar.nc2.N3iosp.readData(
        at ucar.nc2.NetcdfFile.readData(
        at ucar.nc2.Variable._read(
at<init>( at

(linenumbers might not be exactly the same as yours, since I included up to 4 println statements.)

The error occurs when reading the last variable from the file with

        variables = ncIn.getVariables();
        for (Variable var : variables) {
            try {
                System.err.println("Writing variable: "+var.getName());
            } catch (InvalidRangeException ire) {
throw new IOException("InvalidRangeException: "+ire.toString());

Looking at the copied file with ncview, I see that all data looks misplaced. With the println I got for the last variable:
Writing variable: WDEP_RDN
Trying to read 14652 floats
Fetching 58608 starting at 4138964, but filesize is just: 4194340

Can you send me the file or a URL to it? How was the file written? From the java library or the c library?

BTW: I've seen that unidata has a netcdf mailing list. Do you prefer me to send such messages to the list, or directly to you?

Ive cc'ed it to netcdf-java, which is a good place to send all such problems, so that others can "follow along" if they wish.

Best regards,


thanks for your help debugging.