[ncl-talk] Error reading grib file

David Brown dbrown at ucar.edu
Tue Oct 25 16:51:09 MDT 2016


Hi Kacie,
I think you are mistaken. It is definitely possible to print a
variable representing a file (a variable of type "file") in NCL.
 -dave

On Tue, Oct 25, 2016 at 4:41 PM, Kacie Shourd <Kacie.Shourd at dri.edu> wrote:
> Is the only thing you are trying in your code "print(f)"??
> I'm not sure that will work. Try adding something like this:
>
> getfilevarnames(f)
>
> or something else from the listed functions at
> https://www.ncl.ucar.edu/Document/Functions/Built-in/addfile.shtml
>
> It may be reading your file after all, but the print statement isn't the way
> to access information in the file.
>
> Best
> Kacie
> ________________________________
> From: xinzhou.sys at gmail.com [xinzhou.sys at gmail.com] on behalf of Xin Zhou
> [xin.zhou.1 at stonybrook.edu]
> Sent: Tuesday, October 25, 2016 3:04 PM
> To: Kacie Shourd
> Cc: ncl-talk at ucar.edu
> Subject: Re: [ncl-talk] Error reading grib file
>
> Hi Kacie,
>
> Thank you! I tried adding adding different file extensions (.grib, .grib1
> etc.), but none of them worked. For some unknown reason, the file still
> cannot be opened by addfile.
>
> Best,
> Xin
>
> On Tue, Oct 25, 2016 at 5:26 PM, Kacie Shourd <Kacie.Shourd at dri.edu> wrote:
>>
>> Hi, Xin!
>>
>> Try adding the file extension, like this:
>>
>> f = addfile("./gage.hrly.prcp.20020101.grib1","r")
>>
>> Best,
>> Kacie
>>
>> ---
>> Kacie N. Shourd
>> 드림
>>
>> Graduate Research Assistant
>> Desert Research Institute
>> Kacie.Shourd at dri.edu
>> Work: (775) 674-7049
>> ________________________________
>> From: ncl-talk-bounces at ucar.edu [ncl-talk-bounces at ucar.edu] on behalf of
>> Xin Zhou [xin.zhou.1 at stonybrook.edu]
>> Sent: Tuesday, October 25, 2016 2:03 PM
>> To: ncl-talk at ucar.edu
>> Subject: [ncl-talk] Error reading grib file
>>
>> Dear All,
>>
>> I'm looking at the 4km resolution hourly precipitation from NCEP/CPC
>> (http://rda.ucar.edu/datasets/ds507.5/). The documented data format is
>> GRIB1, but when using "addfile" no variables were printed.
>>
>> ncl 0> f = addfile("./gage.hrly.prcp.20020101","r")
>> ncl 1> print(f)
>>
>> Variable: f
>> Type: file
>> (0) File Missing Value : -1
>>
>>
>> Does anyone have a clue how to access the data?
>> Thank you all!
>>
>> Best,
>> Xin
>>
>>
>>
>> PUBLIC RECORDS NOTICE: In accordance with NRS Chapter 239, this email and
>> responses, unless otherwise made confidential by law, may be subject to the
>> Nevada Public Records laws and may be disclosed to the public upon request.
>
>
>
> _______________________________________________
> 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