Re: Reading GRiB1 from ECMWF, parameter table 140

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Wed, 24 Jun 2009 10:01:35 -0600

NCL is 'mostly' successful.
http://www.ncl.ucar.edu/Document/Tools/ncl_filedump.shtml
http://www.ncl.ucar.edu/Document/Tools/ncl_convert2nc.shtml
------------
[1]
I have attached an 'ncl_filedump' of the GRIB file's contents
The .grb file extension is required so the NCL will treat the file
as a grib file.

%> ncl_filedump od_wave_an_20060601_20060630.grb > od_wave_an.overview

NOTE:
NCL will look for a file named "od_wave_an_20060601_20060630.grb"
If it does not find a file with that name, it will look for the file
"od_wave_an_20060601_20060630" and 'remember' to treat it as a GRIB file.

[2]
When I tried to convert the *entire file* to netCDF via

%> ncl_convert od_wave_an_20060601_20060630.grb

NCL returned some messages
"warning:GenericUnPack: NCL does not yet handle gridded data with
  complex packing: no valid values returned"

[3]
If you look at the attached "od_wave_an.overview", you can select
a subset of the variables. You mention 'slope' and 'wave height'.
I selected a few variables with these descriptions and was successful
in creating a netCDF file.

%> ncl_convert2nc od_wave_an_20060601_20060630.grb -v
initial_time0_hours, g0_lat_1,
g0_lon_2,initial_time0,AWH_GDS0_MSL_10,MSQS_GDS0_MSL_10

I have placed the resulting file at:

http://www.cgd.ucar.edu/~shea/od_wave_an_20060601_20060630.nc

When you have downloaded the file, let me know so I can delete it.

[4]
Actually, NCL could do what you want rather easily.
[a] Read directly from the GRIB file(s)
[b] Use
http://www.ncl.ucar.edu/Document/Functions/Contributed/linint2_points_Wrap.shtml
to bilinearly interpolate to user specified locations
[c] plot
[d] create netCDF

Of course, the 'rub' is you have to invest time to learn NCL.

Good luck.
D
> Lonneke Goddijn-Murphy wrote:
>
>> Hi, I have a data set concerning waves from ECMWF encoded in GRIB Ed. 1 (FM92-VIII), and want to extract the data. I am used to using MATLAB, but the MATLAB GRiB reader I found can't read ECMWF's parameter table 140. I suspect it would be too slow anyway. I have never used NCL, and I don't know anyone who has, and I would like to find out if I can get GRiB data out reasonably straightforward. The data is gridded, 0.25 resolution (the area is 10 x 7 degrees), and 4 times daily (period is one month). There are 30 parameters. What I want to achieve is: get the values of certain parameters (eg wave height, slope etc.) at 170 times and locations (stations during a cruise). Can I do this using NCL? I know how to read NetCDF in MATLAB. I would do it station for station if I had to.
>>
>> I don't expect an answer explaining how to do it, just an indication if NCL is the way to go or not.
>>
>>

 Copyright (C) 1995-2009 - All Rights Reserved
 University Corporation for Atmospheric Research
 NCAR Command Language Version 5.1.1
 The use of this software is governed by a License Agreement.
 See http://www.ncl.ucar.edu/ for more details.
Variable: f (file variable)

filename: od_wave_an_20060601_20060630
path: od_wave_an_20060601_20060630
   file global attributes:
   dimensions:
      initial_time0_hours = 120
      g0_lat_1 = 41
      g0_lon_2 = 29
   variables:
      float WMB_GDS0_MSL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : Model bathymetry
         units : m
         _FillValue : 1e+20
         level_indicator : 102
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 219
         forecast_time : 0
         forecast_time_units : hours

      float MP1_GDS0_MSL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : Mean wave period based on first moment
         units : s
         _FillValue : 1e+20
         level_indicator : 102
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 220
         forecast_time : 0
         forecast_time_units : hours

      float MP2_GDS0_MSL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : Mean wave period based on second moment
         units : s
         _FillValue : 1e+20
         level_indicator : 102
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 221
         forecast_time : 0
         forecast_time_units : hours

      float WDW_GDS0_MSL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : Wave spectral directional width
         units : -
         _FillValue : 1e+20
         level_indicator : 102
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 222
         forecast_time : 0
         forecast_time_units : hours

      float P1WW_GDS0_MSL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : Mean wave period based on first moment for wind waves
         units : s
         _FillValue : 1e+20
         level_indicator : 102
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 223
         forecast_time : 0
         forecast_time_units : hours

      float P2WW_GDS0_MSL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : Mean wave period based on second moment for wind waves
         units : s
         _FillValue : 1e+20
         level_indicator : 102
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 224
         forecast_time : 0
         forecast_time_units : hours

      float DWWW_GDS0_MSL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : Wave spectral directional width for wind waves
         units : -
         _FillValue : 1e+20
         level_indicator : 102
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 225
         forecast_time : 0
         forecast_time_units : hours

      float P1PS_GDS0_MSL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : Mean wave period based on first moment for swell
         units : s
         _FillValue : 1e+20
         level_indicator : 102
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 226
         forecast_time : 0
         forecast_time_units : hours

      float P2PS_GDS0_MSL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : Mean wave period based on second moment for swell
         units : s
         _FillValue : 1e+20
         level_indicator : 102
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 227
         forecast_time : 0
         forecast_time_units : hours

      float DWPS_GDS0_MSL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : Wave spectral directional width for swell
         units : -
         _FillValue : 1e+20
         level_indicator : 102
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 228
         forecast_time : 0
         forecast_time_units : hours

      float SWH_GDS0_MSL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : Significant wave height
         units : m
         _FillValue : 1e+20
         level_indicator : 102
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 229
         forecast_time : 0
         forecast_time_units : hours

      float MWD_GDS0_MSL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : Mean wave direction
         units : degrees
         _FillValue : 1e+20
         level_indicator : 102
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 230
         forecast_time : 0
         forecast_time_units : hours

      float PP1D_GDS0_MSL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : Peak period of 1D spectra
         units : s
         _FillValue : 1e+20
         level_indicator : 102
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 231
         forecast_time : 0
         forecast_time_units : hours

      float MWP_GDS0_MSL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : Mean wave period
         units : s
         _FillValue : 1e+20
         level_indicator : 102
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 232
         forecast_time : 0
         forecast_time_units : hours

      float CDWW_GDS0_HTGL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : Coefficient of drag with waves
         units : -
         _FillValue : 1e+20
         level_indicator : 105
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 233
         level : 10
         forecast_time : 0
         forecast_time_units : hours

      float SHWW_GDS0_MSL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : Significant height of wind waves
         units : m
         _FillValue : 1e+20
         level_indicator : 102
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 234
         forecast_time : 0
         forecast_time_units : hours

      float MDWW_GDS0_MSL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : Mean direction of wind waves
         units : degrees
         _FillValue : 1e+20
         level_indicator : 102
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 235
         forecast_time : 0
         forecast_time_units : hours

      float MPWW_GDS0_MSL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : Mean period of wind waves
         units : s
         _FillValue : 1e+20
         level_indicator : 102
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 236
         forecast_time : 0
         forecast_time_units : hours

      float SHTS_GDS0_MSL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : Significant height of total swell
         units : m
         _FillValue : 1e+20
         level_indicator : 102
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 237
         forecast_time : 0
         forecast_time_units : hours

      float MDTS_GDS0_MSL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : Mean direction of total swell
         units : degrees
         _FillValue : 1e+20
         level_indicator : 102
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 238
         forecast_time : 0
         forecast_time_units : hours

      float MPTS_GDS0_MSL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : Mean period of total swell
         units : s
         _FillValue : 1e+20
         level_indicator : 102
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 239
         forecast_time : 0
         forecast_time_units : hours

      float MSQS_GDS0_MSL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : Mean square slope of waves
         units : dimensionless
         _FillValue : 1e+20
         level_indicator : 102
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 244
         forecast_time : 0
         forecast_time_units : hours

      float WIND_GDS0_HTGL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : 10 metre wind speed
         units : m s**-1
         _FillValue : 1e+20
         level_indicator : 105
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 245
         level : 10
         forecast_time : 0
         forecast_time_units : hours

      float AWH_GDS0_MSL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : Altimeter wave height
         units : m
         _FillValue : 1e+20
         level_indicator : 102
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 246
         forecast_time : 0
         forecast_time_units : hours

      float ACWH_GDS0_MSL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : Altimeter corrected wave height
         units : m
         _FillValue : 1e+20
         level_indicator : 102
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 247
         forecast_time : 0
         forecast_time_units : hours

      float ARRC_GDS0_MSL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : Altimeter range relative correction
         units : -
         _FillValue : 1e+20
         level_indicator : 102
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 248
         forecast_time : 0
         forecast_time_units : hours

      float 2DFD_GDS0_MSL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : 2D wave spectra (single)
         units : m**2 s radian**-1
         _FillValue : 1e+20
         level_indicator : 102
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 251
         forecast_time : 0
         forecast_time_units : hours

      float WSK_GDS0_MSL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : Wave spectral kurtosis
         units : -
         _FillValue : 1e+20
         level_indicator : 102
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 252
         forecast_time : 0
         forecast_time_units : hours

      float BFI_GDS0_MSL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : Benjamin-Feir index
         units : -
         _FillValue : 1e+20
         level_indicator : 102
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 253
         forecast_time : 0
         forecast_time_units : hours

      float WSP_GDS0_MSL_10 ( initial_time0_hours, g0_lat_1, g0_lon_2 )
         center : European Center for Medium-Range Weather Forecasts (RSMC)
         long_name : Wave spectral peakedness
         units : s**-1
         _FillValue : 1e+20
         level_indicator : 102
         gds_grid_type : 0
         parameter_table_version : 140
         parameter_number : 254
         forecast_time : 0
         forecast_time_units : hours

      double initial_time0_hours ( initial_time0_hours )
         long_name : initial time
         units : hours since 1800-01-01 00:00

      double initial_time0_encoded ( initial_time0_hours )
         long_name : initial time encoded as double
         units : yyyymmddhh.hh_frac

      float g0_lat_1 ( g0_lat_1 )
         long_name : latitude
         GridType : Cylindrical Equidistant Projection Grid
         units : degrees_north
         Dj : 0.25
         Di : 0.25
         Lo2 : 352
         La2 : 50
         Lo1 : 345
         La1 : 60

      float g0_lon_2 ( g0_lon_2 )
         long_name : longitude
         GridType : Cylindrical Equidistant Projection Grid
         units : degrees_east
         Dj : 0.25
         Di : 0.25
         Lo2 : 352
         La2 : 50
         Lo1 : 345
         La1 : 60

      string initial_time0 ( initial_time0_hours )
         long_name : Initial time of first record
         units : mm/dd/yyyy (hh:mm)

 

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jun 24 2009 - 10:01:35 MDT

This archive was generated by hypermail 2.2.0 : Wed Jul 01 2009 - 06:11:45 MDT