Project

General

Profile

Help! Convert netCDF to GRIB1 - "settaxis" fails to convert forecast verifying date into forecast lead time after 240hour forecast

Added by Vera Li about 8 years ago

I am trying to convert a netCDF file into GRIB1, but the CDO fails to represent the correct forecast lead time if I used cdo -f grb -setparam,1.2 -setltype,102 -settaxis,2002-06-05,06:00,24hour mslp.nc mslp.grb

For -settaxis, if I change 24hour into 1day, it works well. But I really need forecast lead time with hourly information. Many thanks! The detailed information is as below:

The netCDF has the structure:
dimensions:
lat = 181 ;
lon = 360 ;
time = UNLIMITED ; // (33 currently)
variables:
double lat(lat) ;
lat:long_name = "Latitude" ;
lat:units = "degrees_north" ;
double lon(lon) ;
lon:long_name = "Longitude" ;
lon:units = "degrees_east" ;
float mslp(time, lat, lon) ;
mslp:_FillValue = -9.99e+08f ;
mslp:units = "Pa" ;
mslp:long_name = "sea level pressure" ;
double time(time) ;
time:long_name = "Time" ;
time:units = "minutes since 2002-06-05 06:00" ;
time:calendar = "JULIAN" ;

And after using command:
cdo -f grb -setparam,1.2 -setltype,102 -settaxis,2002-06-05,06:00,24hour mslp.nc mslp.grb

The GRIB1 file looks like:
1:0:d=02060506:TMP:MSL:anl:NAve=0
2:130408:d=02060506:TMP:MSL:24hr fcst:NAve=0
3:260816:d=02060506:TMP:MSL:48hr fcst:NAve=0
4:391224:d=02060506:TMP:MSL:72hr fcst:NAve=0
5:521632:d=02060506:TMP:MSL:96hr fcst:NAve=0
6:652040:d=02060506:TMP:MSL:120hr fcst:NAve=0
7:782448:d=02060506:TMP:MSL:144hr fcst:NAve=0
8:912856:d=02060506:TMP:MSL:168hr fcst:NAve=0
9:1043264:d=02060506:TMP:MSL:192hr fcst:NAve=0
10:1173672:d=02060506:TMP:MSL:216hr fcst:NAve=0
11:1304080:d=02060506:TMP:MSL:240hr fcst:NAve=0
12:1434488:d=02061606:TMP:MSL:anl:NAve=0
13:1564896:d=02061706:TMP:MSL:anl:NAve=0
14:1695304:d=02061806:TMP:MSL:anl:NAve=0
15:1825712:d=02061906:TMP:MSL:anl:NAve=0
16:1956120:d=02062006:TMP:MSL:anl:NAve=0
17:2086528:d=02062106:TMP:MSL:anl:NAve=0
18:2216936:d=02062206:TMP:MSL:anl:NAve=0
19:2347344:d=02062306:TMP:MSL:anl:NAve=0
20:2477752:d=02062406:TMP:MSL:anl:NAve=0
21:2608160:d=02062506:TMP:MSL:anl:NAve=0
22:2738568:d=02062606:TMP:MSL:anl:NAve=0
23:2868976:d=02062706:TMP:MSL:anl:NAve=0
24:2999384:d=02062806:TMP:MSL:anl:NAve=0
25:3129792:d=02062906:TMP:MSL:anl:NAve=0
26:3260200:d=02063006:TMP:MSL:anl:NAve=0
27:3390608:d=02070106:TMP:MSL:anl:NAve=0
28:3521016:d=02070206:TMP:MSL:anl:NAve=0
29:3651424:d=02070306:TMP:MSL:anl:NAve=0
30:3781832:d=02070406:TMP:MSL:anl:NAve=0
31:3912240:d=02070506:TMP:MSL:anl:NAve=0
32:4042648:d=02070606:TMP:MSL:anl:NAve=0
33:4173056:d=02070706:TMP:MSL:anl:NAve=0

Or using wgrib -PDS mslp.grb
1:0:d=02060506:TMP:kpds5=11:kpds6=102:kpds7=0:TR=0:P1=0:P2=0:TimeU=1:MSL:anl:NAve=0:PDS=00001c020000ff800b66000002060506000100000000000015000000
2:130408:d=02060506:TMP:kpds5=11:kpds6=102:kpds7=0:TR=0:P1=24:P2=0:TimeU=1:MSL:24hr fcst:NAve=0:PDS=00001c020000ff800b66000002060506000118000000000015000000
3:260816:d=02060506:TMP:kpds5=11:kpds6=102:kpds7=0:TR=0:P1=48:P2=0:TimeU=1:MSL:48hr fcst:NAve=0:PDS=00001c020000ff800b66000002060506000130000000000015000000
4:391224:d=02060506:TMP:kpds5=11:kpds6=102:kpds7=0:TR=0:P1=72:P2=0:TimeU=1:MSL:72hr fcst:NAve=0:PDS=00001c020000ff800b66000002060506000148000000000015000000
5:521632:d=02060506:TMP:kpds5=11:kpds6=102:kpds7=0:TR=0:P1=96:P2=0:TimeU=1:MSL:96hr fcst:NAve=0:PDS=00001c020000ff800b66000002060506000160000000000015000000
6:652040:d=02060506:TMP:kpds5=11:kpds6=102:kpds7=0:TR=0:P1=120:P2=0:TimeU=1:MSL:120hr fcst:NAve=0:PDS=00001c020000ff800b66000002060506000178000000000015000000
7:782448:d=02060506:TMP:kpds5=11:kpds6=102:kpds7=0:TR=0:P1=144:P2=0:TimeU=1:MSL:144hr fcst:NAve=0:PDS=00001c020000ff800b66000002060506000190000000000015000000
8:912856:d=02060506:TMP:kpds5=11:kpds6=102:kpds7=0:TR=0:P1=168:P2=0:TimeU=1:MSL:168hr fcst:NAve=0:PDS=00001c020000ff800b660000020605060001a8000000000015000000
9:1043264:d=02060506:TMP:kpds5=11:kpds6=102:kpds7=0:TR=0:P1=192:P2=0:TimeU=1:MSL:192hr fcst:NAve=0:PDS=00001c020000ff800b660000020605060001c0000000000015000000
10:1173672:d=02060506:TMP:kpds5=11:kpds6=102:kpds7=0:TR=0:P1=216:P2=0:TimeU=1:MSL:216hr fcst:NAve=0:PDS=00001c020000ff800b660000020605060001d8000000000015000000
11:1304080:d=02060506:TMP:kpds5=11:kpds6=102:kpds7=0:TR=0:P1=240:P2=0:TimeU=1:MSL:240hr fcst:NAve=0:PDS=00001c020000ff800b660000020605060001f0000000000015000000
12:1434488:d=02061606:TMP:kpds5=11:kpds6=102:kpds7=0:TR=10:P1=0:P2=0:TimeU=1:MSL:anl:NAve=0:PDS=00001c020000ff800b66000002061006000100000a00000015000000
13:1564896:d=02061706:TMP:kpds5=11:kpds6=102:kpds7=0:TR=10:P1=0:P2=0:TimeU=1:MSL:anl:NAve=0:PDS=00001c020000ff800b66000002061106000100000a00000015000000
14:1695304:d=02061806:TMP:kpds5=11:kpds6=102:kpds7=0:TR=10:P1=0:P2=0:TimeU=1:MSL:anl:NAve=0:PDS=00001c020000ff800b66000002061206000100000a00000015000000

Is this due to CDO version? I'm using the CDO with versions:
Climate Data Operators version 1.6.3 (http://code.zmaw.de/projects/cdo)
Compiled: by kenneth on keeling-a01 (x86_64-unknown-linux-gnu) Jun 17 2014 15:33:23
Compiler: gcc -std=gnu99 -g -O2 -pthread
version: gcc (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4)
Features: PTHREADS NC4 OPeNDAP SZ Z UDUNITS2 PROJ.4 XML2 CURL
Libraries: proj/4.7 xml2/2.7.6 curl/7.19.7
Filetypes: srv ext ieg grb grb2 nc nc2 nc4 nc4c
CDI library version : 1.6.3 of Jun 17 2014 15:33:10
CGRIBEX library version : 1.6.3 of Jan 8 2014 19:55:18
GRIB_API library version : 1.12.3
netCDF library version : 4.2 of Dec 17 2012 13:15:01 $
HDF5 library version : 1.8.9
SERVICE library version : 1.3.1 of Jun 17 2014 15:32:55
EXTRA library version : 1.3.1 of Jun 17 2014 15:32:50
IEG library version : 1.3.1 of Jun 17 2014 15:32:53
FILE library version : 1.8.2 of Jun 17 2014 15:32:50

I really need this GRIB1 data, thanks a lot for your help!


Replies (1)

RE: Help! Convert netCDF to GRIB1 - "settaxis" fails to convert forecast verifying date into forecast lead time after 240hour forecast - Added by David Wojtowicz about 8 years ago

(I provide IT support for the above poster, and am providing the following information in case it may be helpful to others who area also experiencing this issue)

This is a bug in CDO. I have just filed a bug report at the link below, which includes a suggested patch to fix the issue.

https://code.zmaw.de/issues/6600

The patch is for version 1.7.1 If you wish to apply the patch before the maintainers of CDO are able to correct the problem, you can download the patch file from the link above. Put it in the top level directory of the CDO source code and use the following command to apply the patch:

patch -p1 -i stream_cgribex.c.patch

Then recompile.

    (1-1/1)