- 积分
- 12047
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-6-4
- 最后登录
- 1970-1-1
|
5金钱
问题:在利用wrf-python中的getvar函数提取slp的时候报出错误,但很疑惑前后时次都正常,在遍历的时候就仅仅03这个时刻出错,而且该时刻提取其他变量如10m风速都正常,就只有slp提取的时候报错,我不禁怀疑是不是数据有问题了。。。脑壳疼希望有大神能帮忙指点一下,感激不尽{:soso__4953025489317195156_4:}
原代码如下
- from wrf import getvar
- from netCDF4 import Dataset
- fplist='i:/wrfout_d01_2015-09-29_03_00_00'
- data = Dataset(fplist)
- slp= getvar(data,"slp",units="hPa")
复制代码
出错如下
- File "E:\getv.py", line 11, in <module>
- slp= getvar(data,"slp",units="hPa")
- File "D:\Anaconda3\envs\py37\lib\site-packages\wrf\routines.py", line 355, in getvar
- meta, _key, **kwargs)
- File "D:\Anaconda3\envs\py37\lib\site-packages\wrf\metadecorators.py", line 129, in func_wrapper
- result = wrapped(*new_args)
- File "D:\Anaconda3\envs\py37\lib\site-packages\wrf\decorators.py", line 45, in func_wrapper
- return do_conversion(wrapped(*args, **kwargs), unit_type,
- File "D:\Anaconda3\envs\py37\lib\site-packages\wrf\g_slp.py", line 79, in get_slp
- meta=False, _key=_key)
- File "D:\Anaconda3\envs\py37\lib\site-packages\wrf\util.py", line 2291, in extract_vars
- for var in varlist}
- File "D:\Anaconda3\envs\py37\lib\site-packages\wrf\util.py", line 2291, in <dictcomp>
- for var in varlist}
- File "D:\Anaconda3\envs\py37\lib\site-packages\wrf\util.py", line 2220, in _extract_var
- result = wrfin.variables[varname][timeidx, :]
- File "src\netCDF4\_netCDF4.pyx", line 4406, in netCDF4._netCDF4.Variable.__getitem__
- File "src\netCDF4\_netCDF4.pyx", line 5350, in netCDF4._netCDF4.Variable._get
- File "src\netCDF4\_netCDF4.pyx", line 1927, in netCDF4._netCDF4._ensure_nc_success
- RuntimeError: NetCDF: HDF error
复制代码
|
|