[ncl-talk] Read correctely WAFS_blended GRIB2 file

Dennis Shea shea at ucar.edu
Thu Aug 21 13:30:48 MDT 2014


wgrib2 -netcdf ....    works.  The generated nc file is 'technically
correct'.   However, it is not the way most nc files are constructed.

Going back a bit, GRIB is a record format *not* a file format like, say,
 netCDF or HDF. Each GRIB record is for one level only.
There are *no rules* for how a collection of GRIB records should be
structured
within a file.

Hence, the GRIB records could be in random order and placed within one
file.
The great feature of NCL is that it reorders the GRIB records according to
time and, if multiple level, collects the levels, etc. It does this 'on the
fly'. The output looks like the variable came from a netCDF file.


It looks like  'wgrib2 -netcdf ...' took each grib record and created a
different variable for one time step.

      float CTP_700mb ( time, latitude, longitude )
         _FillValue :    9.999e+20
         short_name :    CTP_700mb
         long_name :    In-Cloud Turbulence
         level :    700 mb
         units :    percent

      float CTP_600mb ( time, latitude, longitude )
         _FillValue :    9.999e+20
         short_name :    CTP_600mb
         long_name :    In-Cloud Turbulence
         level :    600 mb
         units :    percent

[snip]

A common netCDF file might have

     level = 5

     float CTP (time, level, latitude, longitude)

     level(level) ....





On Thu, Aug 21, 2014 at 12:35 PM, HAVENER, KEVIN F GS-12 USAF AFWA 14
WS/WXED <kevin.havener at us.af.mil> wrote:

> Rabah,
>
> I can't say with too much authority what is going on here, but I think the
> grib2 file was created by concatenating a bunch of single-level grib files
> together and ncl_filedump sees the two differently named fields and the
> first two or so of identically named fields (that have some different
> metadata) and that’s all.
>
> I found the same problem you did when you view the file with ncl_filedump
> and not surprisingly ncl_convert2nc gave the same result.  However, I used
> wgrib2's -netcdf option to convert the file to netcdf and got a netcdf file
> that looks much more like the original grib (gzip'ed netcdf attached) and
> probably what you expected to see.
>
> I've attached the ncl_filedump of my converted file to this email and will
> mail you a copy of the converted file (3 mb) directly to you rather than
> the list.
>
> Kevin Havener
>
>
> -----Original Message-----
> From: ncl-talk-bounces at ucar.edu [mailto:ncl-talk-bounces at ucar.edu] On
> Behalf Of Rabah Hachelaf
> Sent: Thursday, August 21, 2014 1:34 PM
> To: ncl-talk
> Subject: [ncl-talk] Read correctely WAFS_blended GRIB2 file
>
>
> Hi all,
>
> I am trying to plot icing, turbulence for several pressure levels from
> WAFS_blended GRIB2 files, which can be find attached.
>
> The inventory of this file type is in this link:
> http://www.nco.ncep.noaa.gov/pmb/products/gfs/WAFS_blended_2012010606f06.grib2.shtml
>
> When i use ncl_filedump i can't find any information about pressure
> levels, it seems like there only one level although in the inventory file
> there is several levels.
>
> Thanks to help me about this.
>
> Rabah
> --
>
> ------------------------------
> Cordialement,
> Best regards,
> Rabah Hachelaf
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140821/5d2b891f/attachment.html 


More information about the ncl-talk mailing list