I'm in trouble to read NetCDF file data. Basically NetCDF file contains Ocean current data. How do you convert a NetCDF file to a Grib2 or Grib file? I already have procedure to read data from Grib2 file using OpenGrads version 2.0. What I need overall is to generate image for ocean current components available in netCDF and display on map.

Can anyone direct/correct me how to accomplish this task.

3 Answers 3


GRIB is more limited than NetCDF. You can use a tool like the NetCDF-Java library to read both NetCDF and GRIB1 and GRIB2 files: https://www.unidata.ucar.edu/software/thredds/current/netcdf-java/documentation.htm However, it can write only NetCDF files.

If you use Matlab, the https://github.com/nctoolbox/nctoolbox can read and plot both.


What is the problem when you try to read a netcdf file in grads?

The command in grads to read netcdf file is

sdfopen filename.nc

Verify the content with

q file 1

From this point the procesure is pretty much the same of a grib file.



use the command gdalwarp which is able also to convert the CRS (Coordinate Reference System)

gdalwarp -t_srs EPSG:4326 -of netCDF filename.grb2 filename.nc

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.