[ncl-talk] Read correctely WAFS_blended GRIB2 file

David Brown dbrown at ucar.edu
Thu Aug 21 17:59:30 MDT 2014


NCL 6.2.1 is going to be released very soon. I am hoping that I will be
able to get this fix into the code in time.
 -dave


On Thu, Aug 21, 2014 at 5:57 PM, Rabah Hachelaf <hachelaf at sca.uqam.ca>
wrote:

> Hi Dave and all,
>
> Thanks for your answers,
> When do you plan the next NCL release, Dave ?
>
> Rabah
>
>
> 2014-08-21 19:19 GMT-04:00 David Brown <dbrown at ucar.edu>:
>
> I have determined that there is indeed a bug in the NCL GRIB2 module. I am
>> creating a ticket and expect to have a fix in time for the next release.
>> (6.2.1) Sorry for the inconvenience.
>>  -dave
>>
>>
>> On Thu, Aug 21, 2014 at 1:57 PM, David Brown <dbrown at ucar.edu> wrote:
>>
>>> I am currently trying to figure out where wgrib2 finds the level
>>> numbers. The NCEP g2clib (the low-level GRIB2 library that NCL relies on)
>>> reports all the fields with multiple levels as having level type 255 (which
>>> means undefined or missing), and the level values as 0. So I am trying to
>>> go through the wgrib2 code to figure out where it is getting the various
>>> level numbers (and the units of "mb").
>>>  -dave
>>>
>>>
>>> On Thu, Aug 21, 2014 at 1:30 PM, Dennis Shea <shea at ucar.edu> wrote:
>>>
>>>> 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
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>
>>>>
>>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
>
> --
> ------------------------------
> Cordialement,
> Best regards,
> Rabah Hachelaf
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140821/c6286717/attachment.html 


More information about the ncl-talk mailing list