[ncl-talk] reading GRIB2 files
Matt Flournoy
mflournoy37 at gmail.com
Fri Sep 4 08:56:32 MDT 2015
Hi all,
Does anyone have experience reading RUC GRIB2 files? I'm trying to read
GRIB2 output from 13km RUC model data, which is available on the NOMADS
site (http://nomads.ncdc.noaa.gov/data.php#hires_weather_datasets).
Specifically, I am trying to read files from 06 July 2015, but I suspect
this problem is universal among at least all of the 13km RUC GRIB2 output
files.
I've tried a couple ways to read the GRIB2 data, including reading the
GRIB2 file and also trying to convert the GRIB2 file to netcdf. When I try
to read the GRIB2 data directly (specifically
"rap_130_20150706_0000_000.grb2"), I get the following warning message:
warning:getfilevarnames: rap_130_20150706_0000_000 contains no variables
readable by NCL
I've pasted my NCL script that yields this warning at the bottom of my
message.
Second, when I try to convert the GRIB2 file to netcdf using
"ncl_convert2nc" in the command line, I get this similar warning:
warning:getfilevarnames: rap_130_20150706_0000_000 contains no variables
readable by NCL
./rap_130_20150706_0000_000.grb2 contains no variables readable by NCL:
converting global attributes only
Then, when I "ncl_filedump" the created netcdf file, I get this:
Variable: f
Type: file
filename: rap_130_20150706_0000_000
path: rap_130_20150706_0000_000.nc
file global attributes:
creation_date : Fri Sep 4 09:52:47 CDT 2015
NCL_Version : 6.2.1
system : Linux bigbang.protect.nssl 2.6.32-504.12.2.el6.x86_64 #1 SMP
Sun Feb 1 12:14:02 EST 2015 x86_64 x86_64 x86_64 GNU/Linux
Conventions : None
grib_source : rap_130_20150706_0000_000.grb2
title : NCL: convert-GRIB-to-netCDF
dimensions:
variables:
Do you know how to address this issue? I am currently using NCL version
6.2.1 on bigbang, and this problem also appears in other NCL versions.
Thank you,
Matt
------------ begin NCL script ---------------
;******************************************************************************;
; Load libraries.
;******************************************************************************;
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
;-----------------------------------------------------------------------------;
; Synoptic overview plots of the July 06 2015 case from the RUC.
;-----------------------------------------------------------------------------;
begin
ruc_filepath =
("/home/matt.flournoy/PECAN/overview/data/RUC_data/rap_130_20150706_0000_000.grb2")
ruc_file = addfile(ruc_filepath,"r")
varnames = getfilevarnames(ruc_file)
if(.not.any(ismissing(varnames))) then
do i=0,dimsizes(varnames)-1
printFileVarSummary(ruc_file,varnames(i))
end do
end if
end
--------------- end NCL script ----------------
--
Matthew Flournoy
M.S. Meteorology Candidate, University of Oklahoma
B.S. Meteorology, Penn State University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150904/fc6500b5/attachment.html
More information about the ncl-talk
mailing list