user3383831
user3383831

Reputation: 1

Opening grb2 files re-visited

I have downloaded and installed NCTOOLBOX into MATLAB (2013a) to read netcdf and grb files. As a test, I copied a netcdf, grb and grb2 file to a directory on my computer. This is placed within my script as:

pathnc = 'c:\test\era40_moda_200205.nc'
pathgrb = 'c:\test\era40_moda_200205.grb'
pathgrb2 = 'c:\test\multi_1.at_4m.dp.200607.grb2'

I used the following code to read the *.nc file:

nc = ncdataset(pathnc);
nc.variables

The code works great....with no error messages..and all variables listed..on netcdf files...... however, when I run it for the grb files using:

nc = ncdataset(pathgrb);
nc.variables

I get this very long list of errors:

2014-03-05 08:40:15,744 [main] WARN  ucar.nc2.grib.grib2.Grib2Index  - Grib2Index bad size = -1 for c:/test/multi_1.at_4m.dp.200607.grb2 index = c:\test\multi_1.at_4m.dp.200607.grb2.gbx9

Warning: Escape sequence '\m' is not valid. See 'help
sprintf' for valid escape sequences. 
> In ncdataset>ncdataset.ncdataset at 89
  In GRIB_and_NC_Reader_Prog at 14 
Error using ncdataset (line 91)
Failed to open c:   est

Error in GRIB_and_NC_Reader_Prog (line 14)
nc = ncdataset(pathgrb2);

Caused by:
    Error using ncdataset (line 75)
    Java exception occurred:
    java.lang.RuntimeException: java.lang.NoSuchFieldError:
    alwaysUseFieldBuilders...............etc, etc....ad nauseum...............

In case it was just a bad file, I tried the code on a different grb file and got the same results. Yes I have read the previous posts on reading grb with NCTOOLBOX...but still 'dead in the water.' I would greatly appreciate any insight to get my script reading grb and grb2 files.

Upvotes: 0

Views: 1085

Answers (1)

Lee Burchett
Lee Burchett

Reputation: 11

I was getting a similar java error: java.lang.NoSuchFieldError:alwaysUseFieldBuilders. I tried running the same code in R2014a and it worked.

Upvotes: 1

Related Questions