<div dir="ltr">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").<div>
-dave</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 21, 2014 at 1:30 PM, Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>wgrib2 -netcdf .... works. The generated nc file is 'technically correct'. However, it is not the way most nc files are constructed. <br>
</div><br></div>Going back a bit, GRIB is a record format *not* a file format like, say, <br>
netCDF or HDF. Each GRIB record is for one level only. <br>There are *no rules* for how a collection of GRIB records should be structured<br>within a file.<br><br>Hence, the GRIB records could be in random order and placed within one file. <br>
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.<br>
<br></div><div><br></div>It looks like 'wgrib2 -netcdf ...' took each grib record and created a different variable for one time step.<br><div><div><div><br> float CTP_700mb ( time, latitude, longitude )<br>
_FillValue : 9.999e+20<br>
short_name : CTP_700mb<br> long_name : In-Cloud Turbulence<br> level : 700 mb<br> units : percent<br><br> float CTP_600mb ( time, latitude, longitude )<br> _FillValue : 9.999e+20<br>
short_name : CTP_600mb<br> long_name : In-Cloud Turbulence<br> level : 600 mb<br> units : percent<br><br></div><div>[snip]<br><br></div><div>A common netCDF file might have<br>
<br></div><div> level = 5<br></div><div><br></div><div> float CTP (time, level, latitude, longitude)<br><br></div><div> level(level) ....<br><br><br></div><div><br></div></div></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote"><div><div class="h5">On Thu, Aug 21, 2014 at 12:35 PM, HAVENER, KEVIN F GS-12 USAF AFWA 14 WS/WXED <span dir="ltr"><<a href="mailto:kevin.havener@us.af.mil" target="_blank">kevin.havener@us.af.mil</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">Rabah,<br>
<br>
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.<br>
<br>
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.<br>
<br>
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.<br>
<span><font color="#888888"><br>
Kevin Havener<br>
</font></span><div><div><br>
<br>
-----Original Message-----<br>
From: <a href="mailto:ncl-talk-bounces@ucar.edu" target="_blank">ncl-talk-bounces@ucar.edu</a> [mailto:<a href="mailto:ncl-talk-bounces@ucar.edu" target="_blank">ncl-talk-bounces@ucar.edu</a>] On Behalf Of Rabah Hachelaf<br>
Sent: Thursday, August 21, 2014 1:34 PM<br>
To: ncl-talk<br>
Subject: [ncl-talk] Read correctely WAFS_blended GRIB2 file<br>
<br>
<br>
Hi all,<br>
<br>
I am trying to plot icing, turbulence for several pressure levels from WAFS_blended GRIB2 files, which can be find attached.<br>
<br>
The inventory of this file type is in this link: <a href="http://www.nco.ncep.noaa.gov/pmb/products/gfs/WAFS_blended_2012010606f06.grib2.shtml" target="_blank">http://www.nco.ncep.noaa.gov/pmb/products/gfs/WAFS_blended_2012010606f06.grib2.shtml</a><br>
<br>
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.<br>
<br>
Thanks to help me about this.<br>
<br>
Rabah<br>
--<br>
<br>
------------------------------<br>
Cordialement,<br>
Best regards,<br>
Rabah Hachelaf<br>
<br>
</div></div><br></div></div><div class="">_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></div></blockquote></div><br></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>