Project

General

Profile

Wrong values in the grib file converted from netcdf by CDO

Added by Annie Jasmine about 5 years ago

Hi everyone,

I encountered a problem of wrong values in the grib file "soilt2_cropped.grb" which is converted from the netcdf file "soilt00.175_cropped_domain.nc" by CDO. All values in the converted file are 0. The original file, converted file and zaxis file are attached and the CDO command is as below.

cdo -f grb setzaxis,zaxis5_25 -setltype,112 -selname,tsl -setcode,11 -setreftime,2006-01-01,00:00:00,1day -settaxis,2013-09-27,18:00:00,1month soilt00.175_cropped_domain.nc soilt2_cropped.grb

Any suggestion to fix this error is much appreciated!


Replies (4)

RE: Wrong values in the grib file converted from netcdf by CDO - Added by Uwe Schulzweida about 5 years ago

Your NetCDF data contains missing values which are not registered by the attribute missing_value. Unfortunately the missing values are NaNs, which are not supported by the GRIB library. You can use "setctomiss,nan" to convert the NaNs to the default missing_value:

cdo -f grb setctomiss,nan -setzaxis,zaxis5_25 -setltype,112 -selname,tsl -setcode,11 -setreftime,2006-01-01,00:00:00,1day -settaxis,2013-09-27,18:00:00,1month soilt00.175_cropped_domain.nc soilt2_cropped.grb

RE: Wrong values in the grib file converted from netcdf by CDO - Added by Annie Jasmine about 5 years ago

It works! Thank you so much, Uwe! Could you please show me any documentation about missing_value supported by the GRIB library

RE: Wrong values in the grib file converted from netcdf by CDO - Added by Uwe Schulzweida about 5 years ago

Sorry, we don't have any documentation about missing_value supported in our GRIB library.

RE: Wrong values in the grib file converted from netcdf by CDO - Added by Annie Jasmine about 5 years ago

Uwe Schulzweida wrote:

Sorry, we don't have any documentation about missing_value supported in our GRIB library.

anyway, thank you Uwe!

    (1-4/4)