[ncl-talk] Error reading grib file

Kacie Shourd Kacie.Shourd at dri.edu
Tue Oct 25 16:41:11 MDT 2016


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<mailto: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<mailto:Kacie.Shourd at dri.edu>
Work: (775) 674-7049<tel:%28775%29%20674-7049>
________________________________
From: ncl-talk-bounces at ucar.edu<mailto:ncl-talk-bounces at ucar.edu> [ncl-talk-bounces at ucar.edu<mailto:ncl-talk-bounces at ucar.edu>] on behalf of Xin Zhou [xin.zhou.1 at stonybrook.edu<mailto:xin.zhou.1 at stonybrook.edu>]
Sent: Tuesday, October 25, 2016 2:03 PM
To: ncl-talk at ucar.edu<mailto: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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161025/abdbc1f9/attachment.html 


More information about the ncl-talk mailing list