Project

General

Profile

Converting d4pdf surface data

Added by Kevin Hodges over 2 years ago

I'm trying to convert some data from the d4pdf simulations from grads to netcdf using cdo however there seems to be a problem. The grads ctl is:

DSET ^%y4%m2/sfc_snp_6hr_2byte_HPB_m001_%y4%m2.dr
TITLE sfc_snp_6hr_2byte_HPB_m001
OPTIONS template big_endian
UNDEF -32768
XDEF 640 LINEAR 0 0.5625
YDEF 320 LEVELS
-89.570 -89.013 -88.453 -87.892 -87.331
-86.769 -86.208 -85.647 -85.085 -84.523
-83.962 -83.400 -82.839 -82.277 -81.716
-81.154 -80.592 -80.031 -79.469 -78.908
-78.346 -77.784 -77.223 -76.661 -76.100
-75.538 -74.976 -74.415 -73.853 -73.291
-72.730 -72.168 -71.607 -71.045 -70.483
-69.922 -69.360 -68.799 -68.237 -67.675
-67.114 -66.552 -65.990 -65.429 -64.867
-64.306 -63.744 -63.182 -62.621 -62.059
-61.498 -60.936 -60.374 -59.813 -59.251
-58.689 -58.128 -57.566 -57.005 -56.443
-55.881 -55.320 -54.758 -54.196 -53.635
-53.073 -52.512 -51.950 -51.388 -50.827
-50.265 -49.704 -49.142 -48.580 -48.019
-47.457 -46.895 -46.334 -45.772 -45.211
-44.649 -44.087 -43.526 -42.964 -42.402
-41.841 -41.279 -40.718 -40.156 -39.594
-39.033 -38.471 -37.909 -37.348 -36.786
-36.225 -35.663 -35.101 -34.540 -33.978
-33.416 -32.855 -32.293 -31.732 -31.170
-30.608 -30.047 -29.485 -28.924 -28.362
-27.800 -27.239 -26.677 -26.115 -25.554
-24.992 -24.431 -23.869 -23.307 -22.746
-22.184 -21.622 -21.061 -20.499 -19.938
-19.376 -18.814 -18.253 -17.691 -17.129
-16.568 -16.006 -15.445 -14.883 -14.321
-13.760 -13.198 -12.636 -12.075 -11.513
-10.952 -10.390 -9.828 -9.267 -8.705
-8.144 -7.582 -7.020 -6.459 -5.897
-5.335 -4.774 -4.212 -3.651 -3.089
-2.527 -1.966 -1.404 -0.842 -0.281
0.281 0.842 1.404 1.966 2.527
3.089 3.651 4.212 4.774 5.335
5.897 6.459 7.020 7.582 8.144
8.705 9.267 9.828 10.390 10.952
11.513 12.075 12.636 13.198 13.760
14.321 14.883 15.445 16.006 16.568
17.129 17.691 18.253 18.814 19.376
19.938 20.499 21.061 21.622 22.184
22.746 23.307 23.869 24.431 24.992
25.554 26.115 26.677 27.239 27.800
28.362 28.924 29.485 30.047 30.608
31.170 31.732 32.293 32.855 33.416
33.978 34.540 35.101 35.663 36.225
36.786 37.348 37.909 38.471 39.033
39.594 40.156 40.718 41.279 41.841
42.402 42.964 43.526 44.087 44.649
45.211 45.772 46.334 46.895 47.457
48.019 48.580 49.142 49.704 50.265
50.827 51.388 51.950 52.512 53.073
53.635 54.196 54.758 55.320 55.881
56.443 57.005 57.566 58.128 58.689
59.251 59.813 60.374 60.936 61.498
62.059 62.621 63.182 63.744 64.306
64.867 65.429 65.990 66.552 67.114
67.675 68.237 68.799 69.360 69.922
70.483 71.045 71.607 72.168 72.730
73.291 73.853 74.415 74.976 75.538
76.100 76.661 77.223 77.784 78.346
78.908 79.469 80.031 80.592 81.154
81.716 82.277 82.839 83.400 83.962
84.523 85.085 85.647 86.208 86.769
87.331 87.892 88.453 89.013 89.570
ZDEF 1 LEVELS 1000.000
TDEF 1464 LINEAR 00Z01JAN1951 6HR
VARS 7
SLP 0 -1,40,2,-1 (SEA LEVEL PRESSSURE -100000)/1.0 Pa
UAOPN 0 -1,40,2,-1 (Surface Velocity (X) -0.0 )/0.01 m/s
VAOPN 0 -1,40,2,-1 (Surface Velocity (Y) -0.0 )/0.01 m/s
TA 0 -1,40,2,-1 (Surface Air Temp -273.15)/0.005 K
QA 0 -1,40,2,-1 (Surface Air Specific Humidity -2.0e-2 )/1.0e-6 kg/kg
PS 0 -1,40,2,-1 (Surface Pressure -75000 )/1.0 Pa
PRECIPI 0 -1,40,2,-1 (Total Precipitation -0.03 )/1.0e-6 kg/m**2/s
ENDVARS

using grads to convert the slp field gives:

netcdf slp {
dimensions:
lon = 641 ;
lat = 320 ;
time = 1464 ;
variables:
double lon(lon) ;
lon:units = "degrees_east" ;
lon:long_name = "Longitude" ;
double lat(lat) ;
lat:units = "degrees_north" ;
lat:long_name = "Latitude" ;
double time(time) ;
time:long_name = "Time" ;
time:units = "minutes since 1951-01-01 00:00" ;
double slp(time, lat, lon) ;
slp:_FillValue = -999000000. ;

but cdo gives:

dimensions:
lon = 640 ;
lat = 320 ;
time = UNLIMITED ; // (1460 currently)
variables:
double lon(lon) ;
lon:standard_name = "longitude" ;
lon:long_name = "longitude" ;
lon:units = "degrees_east" ;
lon:axis = "X" ;
double lat(lat) ;
lat:standard_name = "latitude" ;
lat:long_name = "latitude" ;
lat:units = "degrees_north" ;
lat:axis = "Y" ;
double time(time) ;
time:standard_name = "time" ;
time:units = "hours since 1951-01-01 00:00:00" ;
time:calendar = "standard" ;
short slp(time, lat, lon) ;
slp:long_name = "(SEA LEVEL PRESSSURE -100000)/1.0 Pa" ;
slp:grid_type = "gaussian" ;
slp:_FillValue = -32768s ;
slp:missing_value = -32768s ;

and the data is rubbish. I'd prefer to use cdo as its faster, does anyone know how to fix this.

Kevin


Replies (8)

RE: Converting d4pdf surface data - Added by Uwe Schulzweida over 2 years ago

Hi Kevin,

Can you please upload some time steps of the data, that would help us a lot to solve the problem.

Cheers,
Uwe

RE: Converting d4pdf surface data - Added by Kevin Hodges over 2 years ago

hi Uwe

it seems the grads format data is too big to upload (~350MB) and I'm not sure how to subset it, is there another way to upload?

Regards

Kevin

RE: Converting d4pdf surface data - Added by Kevin Hodges over 2 years ago

Uwe

the data can be downloaded from the d4pdf download webpages:

http://d4pdf.diasjp.net/d4PDF.cgi

choose: HPB, 6-hourly instantaneous 2D data : sfc_snp_6hr_2byte, m001

Kevin

RE: Converting d4pdf surface data - Added by Uwe Schulzweida over 2 years ago

Hi Kevin,

There is an error converting big_endian to little_endian with 2 byte binary data. This bug will be fixed in the next CDO version!

Cheers,
Uwe

RE: Converting d4pdf surface data - Added by Kevin Hodges over 2 years ago

Uwe

any idea when this will be ready or if a pre-release version is available?

Kevin

RE: Converting d4pdf surface data - Added by Uwe Schulzweida over 2 years ago

A new CDO release is planned for October. A pre-release with the bugfix is available now.

RE: Converting d4pdf surface data - Added by Kevin Hodges over 2 years ago

Thanks Uwe, will give it a go.

Kevin

RE: Converting d4pdf surface data - Added by Kevin Hodges over 2 years ago

The latest 2.0.0 r7 version worked.

Kevin

    (1-8/8)