Re: how to handle varying variable name in list of grib files

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Fri Jul 19 2013 - 12:16:37 MDT

Hi Samir,
There is a setfileoption that allows you to strip off the time period suffixes and treat these variables as the same. It is a True/False logical type option called TimePeriodSuffix.


will cause all these variable names to be shortened to "PRATE_4_SFC_ave", allowing them to be concatenated into a single variable using addfiles. The forecast_time dimension should then contain the varying intervals starting from the initial time for each element. Of course it will be up to you to decide how to deal with the varying length of the averaging period.

On Jul 19, 2013, at 5:57 AM, samir pokhrel <> wrote:

> Dear NCL users,
> I have a series of daily forecast (in grib2 format) from GFS T574 of varying hours
> the first day forcast has 3 hour intervals (6 files)
> the 2nd to 5th day forecast has 6 hour intervals (4 files each day for 4 days = total 16 files)
> the 6th day forecast has 12 hour intervals (i.e 2 files)
> and the 7th (last) day forecast has 24 hour interval (i.e 1 file)
> so total I have 25 forecast file of one day
> I am reading all this file together using addfiles and also adding the extra time dimension using setfileoption
> it is working fine with all other variable (viz. wind, temp etc), however in case of precipitaion the variable name varies in each file so I am not able to retrieve it
> Now I am having following two queries on these data
> First Query
> 1) How to handle same variable with different name in different files so I can club them all together for further analysis
> File Name Variable Name
> gfs.t00z.pgrbf03.grb PRATE_4_SFC_ave3h
> gfs.t00z.pgrbf06.grb PRATE_4_SFC_ave6h
> gfs.t00z.pgrbf09.grb PRATE_4_SFC_ave9h
> gfs.t00z.pgrbf12.grb PRATE_4_SFC_ave12h
> gfs.t00z.pgrbf18.grb PRATE_4_SFC_ave18h
> gfs.t00z.pgrbf24.grb PRATE_4_SFC_ave24h
> gfs.t00z.pgrbf30.grb PRATE_4_SFC_ave6h
> gfs.t00z.pgrbf36.grb PRATE_4_SFC_ave12h
> gfs.t00z.pgrbf42.grb PRATE_4_SFC_ave18h
> gfs.t00z.pgrbf48.grb PRATE_4_SFC_ave24h
> gfs.t00z.pgrbf54.grb PRATE_4_SFC_ave6h
> gfs.t00z.pgrbf60.grb PRATE_4_SFC_ave12h
> gfs.t00z.pgrbf66.grb PRATE_4_SFC_ave18h
> gfs.t00z.pgrbf72.grb PRATE_4_SFC_ave24h
> gfs.t00z.pgrbf78.grb PRATE_4_SFC_ave6h
> gfs.t00z.pgrbf84.grb PRATE_4_SFC_ave12h
> gfs.t00z.pgrbf90.grb PRATE_4_SFC_ave18h
> gfs.t00z.pgrbf96.grb PRATE_4_SFC_ave24h
> gfs.t00z.pgrbf102.grb PRATE_4_SFC_ave6h
> gfs.t00z.pgrbf108.grb PRATE_4_SFC_ave12h
> gfs.t00z.pgrbf114.grb PRATE_4_SFC_ave18h
> gfs.t00z.pgrbf120.grb PRATE_4_SFC_ave24h
> gfs.t00z.pgrbf132.grb PRATE_4_SFC_ave12h
> gfs.t00z.pgrbf144.grb PRATE_4_SFC_ave24h
> gfs.t00z.pgrbf168.grb PRATE_4_SFC_ave24h
> Second Query
> 2) How to put time value of irregular interval in the clubbed variable of all 25 files together
> Hope I am clear enough to make you all understand the issues.
> Thanks you all in advance.
> Regards
> Samir Pokhrel
> Climate and Global Modelling Division
> Indian Institute of Tropical Meteorology
> NCL Post, Pashan
> Pune-411008
> INDIA _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:

ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Fri Jul 19 12:16:47 2013

This archive was generated by hypermail 2.1.8 : Fri Jul 19 2013 - 15:39:06 MDT