nctoolbox

242 views
Skip to first unread message

Lianyuan Zheng

unread,
Mar 10, 2014, 2:48:19 PM3/10/14
to ncto...@googlegroups.com
Hello,

 I download the nctoolbox 20130305 to my Linux
 machine.  After I run "setup_nctoolbox" on matlab v2012b, I access the
 "demos" and run "demo2", it is successful.  But when I run "geodemo_1c", it
 shows:
 
 libGL error: failed to load driver: swrast
 libGL error: Try again with LIBGL_DEBUG=cerbose for more details
 
  Also I downloaded a grib2 file from NOAA WWI "multi_1.at_4m.hs.201006.grb2",
 then I use the following command:
 
  nc=ncgeodataset('multi_1.at_4m.hs.201006.grb2');
 
  It shows the following error message:
 
  2014-03-10 13:10:52,949 [main] WARN  ucar.nc2.grib.grib2.Grib2Index  -
 Grib2Index bad size = -1 for multi_1.at_4m.hs.201006.grb2 index =
 multi_1.at_4m.hs.201006.grb2.gbx9
 Error using ncdataset (line 91)
 Failed to open multi_1.at_4m.hs.201006.grb2
 Error in cfdataset (line 55)
             obj = obj@ncdataset(url);
 Error in ncgeodataset (line 20)
             obj = obj@cfdataset(url);
 Caused by:
     Error using ncdataset (line 75)
     Java exception occurred:
     java.lang.RuntimeException: java.lang.NoSuchFieldError:
 alwaysUseFieldBuilders
      at ucar.nc2.NetcdfFile.<init>(NetcdfFile.java:1535)
      at ucar.nc2.NetcdfFile.open(NetcdfFile.java:887)
      at ucar.nc2.NetcdfFile.open(NetcdfFile.java:496)
      at ucar.nc2.dataset.NetcdfDataset.openOrAcquireFile(NetcdfDataset.java:693)
      at ucar.nc2.dataset.NetcdfDataset.openDataset(NetcdfDataset.java:424)
      at ucar.nc2.dataset.NetcdfDataset.openDataset(NetcdfDataset.java:407)
      at ucar.nc2.dataset.NetcdfDataset.openDataset(NetcdfDataset.java:392)
      at ucar.nc2.dataset.NetcdfDataset.openDataset(NetcdfDataset.java:379)
     Caused by: java.lang.NoSuchFieldError: alwaysUseFieldBuilders
      at ucar.nc2.grib.grib2.Grib2IndexProto$Grib2Index.access$5400(Grib2IndexProto.java:2635)
      at ucar.nc2.grib.grib2.Grib2IndexProto$Grib2Index$Builder.maybeForceBuilderInitialization(Grib2IndexProto.java:2914)
      at ucar.nc2.grib.grib2.Grib2IndexProto$Grib2Index$Builder.<init>(Grib2IndexProto.java:2906)
      at ucar.nc2.grib.grib2.Grib2IndexProto$Grib2Index$Builder.create(Grib2IndexProto.java:2920)
      at ucar.nc2.grib.grib2.Grib2IndexProto$Grib2Index$Builder.access$5200(Grib2IndexProto.java:2891)
      at ucar.nc2.grib.grib2.Grib2IndexProto$Grib2Index.newBuilder(Grib2IndexProto.java:2878)
      at ucar.nc2.grib.grib2.Grib2Index.makeIndex(Grib2Index.java:231)
      at ucar.nc2.grib.GribIndex.makeGribCollectionFromSingleFile(GribIndex.java:112)
      at ucar.nc2.grib.grib2.Grib2Iosp.open(Grib2Iosp.java:310)
      at ucar.nc2.NetcdfFile.<init>(NetcdfFile.java:1499)
      ... 7 more
 
This is the first time I use nctoolbox to read the grib2 file and I am not
 sure the error is coming from the grib2 file or nctoolbox cannot run on
 matlab v2012b. Please advice.

Thanks,
Lianyuan

 

Rich Signell

unread,
Mar 10, 2014, 3:02:40 PM3/10/14
to ncto...@googlegroups.com
Lianyuan,

I just tried running geodemo_1c on Matlab 2012a and it worked okay.    From the error on "LIBGL", perhaps this is some non-NCTOOLBOX related graphics problem?

What happens if you type

 
>> peaks;shading flat



Regarding the grib file reading, can you read this file?

http://geoport.whoi.edu/thredds/fileServer/usgs/data1/rsignell/models/ncep/history/fix/4m/multi_1.at_4m.hs.201006.grb2

I just tried opening it with Matlab 2012a and it worked fine:

>> nc = ncgeodataset('multi_1.at_4m.hs.201006.grb2')

nc
=

  ncgeodataset handle

 
Properties:
     location
: 'multi_1.at_4m.hs.201006.grb2'
       netcdf
: [1x1 ucar.nc2.dataset.NetcdfDataset]
    variables
: {4x1 cell}

 
Methods, Events, Superclasses

>> nc.variables

ans
=

   
'Significant_height_of_combined_wind_waves_and_swell_surface'
   
'lat'
   
'lon'
   
'time'

Lianyuan Zheng

unread,
Mar 10, 2014, 3:24:19 PM3/10/14
to ncto...@googlegroups.com
Hi, Rich,

Thanks.  The following is what I do.

I access the nctoolbox directory and start the matlab.  Then I run "setup_nctoolbox" and run "peaks; shading flat", it shows the following message:

>> peaks; shading flat
 
z =  3*(1-x).^2.*exp(-(x.^2) - (y+1).^2) ...
   - 10*(x/5 - x.^3 - y.^5).*exp(-x.^2-y.^2) ...
   - 1/3*exp(-(x+1).^2 - y.^2)
 
>> libGL error: failed to load driver: swrast
libGL error: Try again with LIBGL_DEBUG=verbose for more details.


Next, I run the following command to read the grb2 file:


It shows the same error message as I reported previously:

Error using ncdataset (line 91)
Failed to open
I use matlab version 2012b.

Lianyuan

Lianyuan Zheng

unread,
Mar 10, 2014, 3:57:18 PM3/10/14
to ncto...@googlegroups.com
Hi, Rich,

The error might relate to Linux OS.  The above error I reported is for the CentOS 6.5.  However, when I run the same at the CentOS 5.10, everything is fine.

If nctoolbox will be updated to run on CentOD 6.5, please let me when it is ready so I can run nctoolbox on the new Linux CentOS 6.5.  Otherwise, I will run it on CentOS 5.10.

Thanks,
Lianyuan
Reply all
Reply to author
Forward
0 new messages