I have downloaded ERA5 precipitation data for 20 years in grib fomat. I do not know how to work with this format. I tried many ways but no result. I am familiar just with R. Any suggesstion?
If you have a recent version of Windows 10, you might also be able to install an Ubuntu environment, and from the Ubuntu terminal simply install using:
apt install cdo
Once you have cdo installed, you can convert a grib file using the cdo copy command:
in R, use rgdal::readGDAL() or raster::raster() or rNOMADS::ReadGrib() for reading grib file, and use ncdf4 and raster::writeRaster() for writing it as .nc file.
A method mentioned by Luis E. Ortiz is one of the simplest way to convert GRIB file format data into NetCDF. Similarly, there is another method where you can convert huge size GRIB data to NetCDF in single line command with fastest mode. For that you need NCAR Command Language (NCL), in your system.
For installation NCL, you may follow this link:
https://www.ncl.ucar.edu/Download/
After installation, you just simply run this following command in terminal of same directory of data:
ncl_convert2nc ERA_precipitation.grb
The above will create a NetCDF file called "ERA_precipitation.nc" in same working directory.
Avinash N Parde Thank you I did not know this other system to convert .grib to .nc. Would it be possible to use this system in Windows 10? Are there any kind of limitations?