Project

General

Profile

convert netcdf to grib1/2 format

Added by Sima Hamzeloo over 11 years ago

Dear CDO Support,
I have some netcdf files, I try to convert them to grib1/2 format for using as wrf model inputs,

first I try
cdo -f grb2 copy CCMP_2011-08-01_00\:00\:00.nc CCMP_2011-08-01_00:00:00.grb2
cdo copy: Processed 2712960 values from 3 variables over 1 timestep. ( 0.14s )

I can see the header of converted file with ncl_filedump command, but when i use data as input file of model, it's failed

ungrib - grib edition num 2
reading from grib file = CCMP_2011-08-01_00:00:00.grb2
Segmentation fault (core dumped)

I also try
cdo -f grb copy CCMP_2011-08-01_00\:00\:00.nc CCMP_2011-08-01_00:00:00.grb

but it didn't work and failed with
stream_gribapi.c at line 1983: grib_set_long(gh, "significanceOfReferenceTime", 1) failed: Key/value not found

I attached the header of my netcdf file
please help me