[ncl-talk] Reading Grib file in NCL

David Brown dbrown at ucar.edu
Fri Dec 18 11:35:20 MST 2015


To add just a bit to Alan's excellent discussion of the contents, I
think it is possible to deduce from the information you have sent that
the 2m temperature you are looking for is contained in the variable
TMP_P0_L103_GLL0. If you look at the level coordinate variable
associated with this variable (lv_HGTL2) you can see from the
dimension list that it has 3 elements. Looking through your idx file
you find three TMP records with level type x "m above ground". They
have value 2, 80, and 100. If you print the lv_HTGL2 variable I think
you will find it has these three values. That means you  can get the
2m TMP data using
temp = inf->TMP_P0_L103_GLL0(0,:,:)   ; using Alan's example statement

The other possible candidate variable that Alan mentioned, with level
type "altitude above mean sea level (m)" has no 2m level. It's values
are 1829, 2743, and 3658.

It's generally considered a useful feature of NCL that GRIB records
are organized into arrays with level and time dimensions. But it does
mean that you sometimes need to look around the file to find what you
want.
 -dave


On Fri, Dec 18, 2015 at 9:13 AM, Alan Brammer <abrammer at albany.edu> wrote:
> Not sure this is really an NCL question.
> You have to take the time to understand your data.
> You want temperature, so look through the filedump for things with a long_name “Temperature”
>
>
> Here are two variables that are x metres above a surface.
>
>       float TMP_P0_L102_GLL0 ( lv_AMSL1, lat_0, lon_0 )
>          center :       US National Weather Service - NCEP (WMC)
>          production_status :    Operational products
>          long_name :    Temperature
>          units :        K
>          _FillValue :   1e+20
>          grid_type :    Latitude/longitude
>          parameter_discipline_and_category :    Meteorological products, Temperature
>          parameter_template_discipline_category_number :        ( 0, 0, 0, 0 )
>          level_type :   Specific altitude above mean sea level (m)
>          forecast_time :        12
>          forecast_time_units :  hours
>          initial_time : 12/14/2015 (06:00)
>
>       float TMP_P0_L103_GLL0 ( lv_HTGL2, lat_0, lon_0 )
>          center :       US National Weather Service - NCEP (WMC)
>          production_status :    Operational products
>          long_name :    Temperature
>          units :        K
>          _FillValue :   1e+20
>          grid_type :    Latitude/longitude
>          parameter_discipline_and_category :    Meteorological products, Temperature
>          parameter_template_discipline_category_number :        ( 0, 0, 0, 0 )
>          level_type :   Specified height level above ground (m)
>          forecast_time :        12
>          forecast_time_units :  hours
>          initial_time : 12/14/2015 (06:00)
>
>
> There are also these, which are specifically 2m above ground.
>
>       float DPT_P0_L103_GLL0 ( lat_0, lon_0 )
>          center :       US National Weather Service - NCEP (WMC)
>          production_status :    Operational products
>          long_name :    Dew point temperature
>          units :        K
>          _FillValue :   1e+20
>          grid_type :    Latitude/longitude
>          parameter_discipline_and_category :    Meteorological products, Temperature
>          parameter_template_discipline_category_number :        ( 0, 0, 0, 6 )
>          level_type :   Specified height level above ground (m)
>          level :         2
>          forecast_time :        12
>          forecast_time_units :  hours
>          initial_time : 12/14/2015 (06:00)
>
>       float APTMP_P0_L103_GLL0 ( lat_0, lon_0 )
>          center :       US National Weather Service - NCEP (WMC)
>          production_status :    Operational products
>          long_name :    Apparent Temperature
>          units :        K
>          _FillValue :   1e+20
>          grid_type :    Latitude/longitude
>          parameter_discipline_and_category :    Meteorological products, Temperature
>          parameter_template_discipline_category_number :        ( 0, 0, 0, 21 )
>          level_type :   Specified height level above ground (m)
>          level :         2
>          forecast_time :        12
>          forecast_time_units :  hours
>          initial_time : 12/14/2015 (06:00)
>
>
> The point of ncl_filedump is so you can go through and find the variable you want.
>
> If you need more information than is contained, then go to the datasource and look for further documentation.
>
> When you find the variable, the variable name, is in the top line of each section in the firedamp.
>
> e.g.
> temp = inf->TMP_P0_L103_GLL0(:,:,:)  ; level, lat, lon,
>
>
> Good luck,
>
> Alan.
>
>
>
>> On 18 Dec 2015, at 10:07, Debasish Hazra <debasish.hazra5 at gmail.com> wrote:
>>
>> Hi,
>>
>>  I was trying to read GFS output (in grib) using NCL V.6.3 and ncl_filedump produced the variable names which is confusing to figure out what variable is what. I have attached ncl filedump output as text and an .idx file associated with the grib output. If I want to read 2m temperature as in there in .idx, which one of the variables read by ncl correspond to that ? Is there any way to figure out which is what from grib table to make sense of the ncl_filedump.
>>
>> Sample gfs file is uploaded in the ftp. Any help is appreciated.
>>
>> Thanks.
>> Debasish.
>> <gfs.t06z.pgrb2.0p25.f012.idx.txt><vars.txt>_______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk


More information about the ncl-talk mailing list