This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Hi Larry, > I'm trying to convert grib2 files to netcdf using the wgrib2 utility > and the syntax below, which is given at the NWS site: > > http://www.cpc.ncep.noaa.gov/products/wesley/wgrib2/netcdf.html > > wgrib2 infile.grib2 -netcdf outfile.nc > > I'm getting the error message: > > netcdf package not installed > > Netcdf 4.0 is in fact installed and has been used to run the example > fortran 77 files that came with the package. wgrib2 also runs fine > when using other options, just not the -netcdf option. > > Any suggestions on the possible cause of this problem would be > appreciated. Or, if you can suggest another way to convert grib2 to > netcdf files, I'm open to suggestions. Support for the wgrib2 -netcdf option is provided at compile time and is optional. I believe you will have to rebuild wgrib2, making sure that either USE_NETCDF3 or USE_NETCDF4 is defined (not commented out) in the config.h file that comes with the wgrib2 source. Also if the netCDF library is installed in someplace where the C compiler doesn't know to look, you will have to either modify the Makefile or the LDFLAGS and CC environment variables before building wgrib2. For example, if netcdf is installed in the /opt/netcdf directory, you might have to do something like (using the bash, sh, or ksh syntax, it's different for csh or tcsh): export CC="cc -I/opt/netcdf/include" export LDFLAGS="-L/opt/netcdf/lib -lnetcdf" before invoking "make". If that doesn't work, please contact wgrib2 support. --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: HOT-122007 Department: Support netCDF Priority: Normal Status: Closed