- 积分
- 155
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-7-6
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 lumux 于 2018-3-5 10:11 编辑
IDL读GFS数据,代码如下:
PRO grib_read
hdata= GRIB2_READ('E:\gfs\gfs.t18z.pgrb2b.0p50.f000','RHprs','1000')
PRINT, 'Hello!'
END
FUNCTION GRIB2_READ,filename,var,lev
IF ~FILE_TEST(filename) THEN RETURN,-1
fid = GRIB_OPEN(filename)
handle = GRIB_NEW_FROM_FILE(fid)
WHILE(handle ne !NULL) DO BEGIN
kiter=GRIB_KEYS_ITERATOR_NEW(handle)
name=" & level="
WHILE GRIB_KEYS_ITERATOR_NEXT(kiter) DO BEGIN
key = GRIB_KEYS_ITERATOR_GET_NAME(kiter)
if key eq 'shortname' then name = grib_get(handle,key)
if key eq 'level' then level = grib_get(handle,key)
if name ne " and level ne " then break
ENDWHILE
GRIB_KEYS_ITERATOR_DELETE, kiter
if name eq vname and level eq vlevel then begin
data = GRIB_GET_VALUES(handle)
GRIB_RELEASE, handle
break
endif
GRIB_RELEASE, handle
handle = GRIB_NEW_FROM_FILE(fid)
ENDWHILE
GRIB_CLOSE,fid
if N_ELEMENTS(data) ne 0 then begin
return,data
endif else begin
return,-1
endelse
END
编译通过,运行出错
% GRIB_OPEN: Dynamically loadable module is unavailable on this platform: GRIB.
% Execution halted at: GRIB2_READ 9 C:\Users\DELL\IDLWorkspace82\Default\grib_read.pro
% GRIB_READ 2 C:\Users\DELL\IDLWorkspace82\Default\grib_read.pro
% $MAIN$
求大神帮忙,是哪里的问题
出错行是 fid = GRIB_OPEN(filename)
和hdata= GRIB2_READ('E:\gfs\gfs.t18z.pgrb2b.0p50.f000','RHprs','1000')
用的IDL8.2版本
|
|