Re: conversion grib data to nc

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Tue Apr 03 2012 - 15:08:37 MDT

Hi Naoki,
It appears you are getting the original grib lat/lon values from a source other than NCL, is that correct? You are correct that GRIB grid 110 is documented with the lower left corner at lat 25.0625 lon -124.9375 in the NCEP GRIB 1 documents (see http://www.nco.ncep.noaa.gov/pmb/docs/on388/tableb.html#GRID110). However, due to limitations of the GRIB 1 format, lat and lon end points can be expressed only to a precision of .001 degree in the GDS (Grid Description Section). (FYI, the GRIB 2 format increases the precision to 10e-6 degree.) The values for the lower left, as given by the GDS sections in this GRIB file, are lat 25.063 lon -124.938. Based on those values and the values for the other endpoint, NCL calculates the remaining coordinate values. Note that wgrib gives the same values. Based on my tests, the lat/lon coordinate values that NCL gives for the GRIB file are exactly the same as the values contained in the NetCDF file obtained from running ncl_convert2nc on the GR
 IB file.

Calculation of coordinate values is entirely separate from the methods used to unpack the data. The data unpacking uses algorithms defined in the GRIB documentation, and the data should undergo no change (within the limits of floating point precision) when converted to NetCDF.

I should note that only a few of the pre-defined GRIB 1 grids defined on the web page cited above have coordinate values where the precision exceeds the limitations of the GRIB 1 GDS encoding. Some of these few have special code in NCL that bypasses the GDS and allows the coordinates to be defined exactly. We can put it on our to do list to create a special code for grid 110 and we will get to it when we can.
 -dave

On Apr 3, 2012, at 10:43 AM, Naoki Mizukami wrote:

> I have grib data and use ncl_convert2nc to convert them to netcdf (just
> simply type ncl_convert2nc <grib_file_name>). I noticed coordinate
> values (lat/long) changed slightly after the conversion. The fraction
> changed, e.g.
>
> grib file
> 25.0625 -124.9375
>
> to
>
> nc file
> 25.0629997 -124.938004
>
> This makes wonder values for all the other variables in grib file
> changed too. I will need to figure out what is causing this and fix it.
>
> The grib file can be downloaded from
> ftp://nomad6.ncep.noaa.gov/pub/raid2/wd20yx/nldas/NLDASII_Forcing/2008/20080101/2008010100.nldasforce-a.grb
>
> Any help appreciated.
>
> Naoki
>
>
> _______________________________________________
> 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
Received on Tue Apr 3 15:08:57 2012

This archive was generated by hypermail 2.1.8 : Mon Apr 09 2012 - 13:43:03 MDT