Project

General

Profile

Convert grib files into netcdf using CDO under win32 (64bit)

Added by Theodoros Gkousarov over 11 years ago

Hello all,

I am quite a new user of CDO as I am interested in visualizing climate data from CM SAF. I had no problem with cdo as far as handling .nc files, but the last 3 days I am trying to handle grib files and I face some difficulties.

what I am trying to do is: I have 30 grib files ( possibly grib2 not sure) and each file represents the 24hour accumulated precipitation estimate from the Hydrology SAF.

I want to combine all these files into one which will contain the 30day ( from 30 daily ) accumulated precipitation data and create a map showing the spatial distribution.

It could be done much easier if I could convert all the grb files inside the folder into netcdf and then run R to vizualize them.

Could anybody help me with that?

Thank you very much.

ps: i m running windows vista 64bit if that helps. and I am attaching 1 of the 30 files that i m gona use.

h05_20120602_0000_24_rom.grb (1.57 MB) h05_20120602_0000_24_rom.grb precipitation estimate from HSAF EUMETSAT

Replies (6)

RE: Convert grib files into netcdf using CDO under win32 (64bit) - Added by Jaison-Thomas Ambadan over 11 years ago

Hi,

I want to combine all these files into one which will contain the 30day ( from 30 daily ) accumulated precipitation data

You can try cdo "merge" or "mergetime" or "cat"

say, cdo -mergetime h*.grb outfile

if you want to convert to NetCDF: cdo -f nc -mergetime h*.grb outfile.nc

More info regarding the merging ca be found here:

https://code.zmaw.de/embedded/cdo/1.5.5/cdo.html#x1-720002.2.3

https://code.zmaw.de/embedded/cdo/1.5.5/cdo.html#x1-630002.2.1

Hope this helps!

Cheers,
J.

RE: Convert grib files into netcdf using CDO under win32 (64bit) - Added by Theodoros Gkousarov over 11 years ago

Thank you very much for the help, But I get an error message saying : Error<gribapiscanningstep1> : grib api support not compiled in.

as far as I know i cant install grib api support under windows. ( i m not running cdo under cygwin)

RE: Convert grib files into netcdf using CDO under win32 (64bit) - Added by Jaison-Thomas Ambadan over 11 years ago

Hi,

It could be done much easier if I could convert all the grb files inside the folder into netcdf and then run R to vizualize them.

you may use the "wgrib2" tool from NCEP, to covert the GRIB2 to NetCDF and then use CDO to merge the NetCDF files:

wgrib2 input_file.grb2 -netcdf output_file.nc

If the data is huge it will take some time to covert but it will work!

More details can be found in the following webpage

http://www.cpc.ncep.noaa.gov/products/wesley/wgrib2/netcdf.html

Cheers,
J.

RE: Convert grib files into netcdf using CDO under win32 (64bit) - Added by Theodoros Gkousarov over 11 years ago

Well unfortunately the site for wgrib2 from ncep doesnt work anymore. http://www.cpc.noaa.gov/products/wesley/wgrib2/ and i cant find other place to download he wgrib2.

could you send it via attachment here?

I tried to use wgrib using this command but it didnt work. wgrib d:/1.grb -netcdf 1.nc

found unidentified data.

Is there any chance that i could send you a zip file with the 30 files ( 32mb) so that you could convert them to .nc for me?

Thank you

RE: Convert grib files into netcdf using CDO under win32 (64bit) - Added by Theodoros Gkousarov over 11 years ago

Just downloaded grib2.exe from ftp . looks like its working when using ftp client. I ll give it a try.

RE: Convert grib files into netcdf using CDO under win32 (64bit) - Added by Theodoros Gkousarov over 11 years ago

I got wgrib2, and tried to read the 1.grb which is the precipitation file from hsaf. however, although i created a file 1.nc with wgrib2 it seems that the projection is quite wrong when i tried to open the file using mcidas v to visualize it.

any feedback on that?

C:\Users\theo>wgrib2 d:/1.grb -netcdf test.nc
cygwin warning:
MS-DOS style path detected: d:/1.grb
Preferred POSIX equivalent is: /cygdrive/d/1.grb
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
ALPHA: experimental space_view2ll scan=0
netcdf: doesn't support yet grid_template 90
1:0:d=2012063000:ESTP:no_level:anl:
2:783852:d=2012063000:var discipline=3 center=80 local_table=0 parmcat=0 parm=19
2:no_level:anl:

C:\Users\theo>

    (1-6/6)