- 积分
- 127
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2018-10-18
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
报错信息:fatal:FileAddVar: an error occurred while adding variable <times> to file <wrfout2021100100>, check to make sure data type is supported by the output format,求助,为什么新的nc文件写不了times变量,是因为她是string型吗?要如何实现把它写入新的nc文件(别的变量都可以正常写入)
这是我写的代码:
a1 = addfiles(FILES1+".nc","r")
numFILES1 = dimsizes(FILES1)
;*******read data******************
it = -1 ;-1 is all times
TIMES = wrf_user_getvar(a1,"times",it) ; get all times in the file
Lat = wrf_user_getvar(a1,"lat",it)
Lon = wrf_user_getvar(a1,"lon",it)
Tk = wrf_user_getvar(a1,"tk",it) ;Temperature [K]
U = wrf_user_getvar(a1,"ua",it)
V = wrf_user_getvar(a1,"va",it)
P = wrf_user_getvar(a1,"pressure",it) ;Full model pressure [hPa]
RH = wrf_user_getvar(a1,"rh",it) ;Relative Humidity [%]
SLP = wrf_user_getvar(a1,"slp",it) ;Sea level pressure [hPa]
U10 = wrf_user_getvar(a1,"U10",it) ; u at 10 m
V10 = wrf_user_getvar(a1,"V10",it) ; v at 10 m
T2 = wrf_user_getvar(a1,"T2",it)
TD2 = wrf_user_getvar(a1,"td2",it);2m dew point temperature [C]
rain_exp = wrf_user_getvar(a1,"RAINNC",-1) ;累计格点降水
rain_con = wrf_user_getvar(a1,"RAINC",-1) ;累计积云对流降水
;*******creat new file******************
outfile = outdir + "wrfout"+DATE + ".nc"
print(outfile)
if (isfilepresent(outfile)) then
system("rm -rf "+outfile)
end if
setfileoption(outfile,"Format","LargeFile")
fout = addfile(outfile, "c")
fout->times = TIMES
fout->lat = Lat
fout->lon = Lon
fout->tk = Tk
fout->u = U
fout->v = V
fout->p = P
fout->rh = RH
fout->slp = SLP
fout->u10 = U10
fout->v10 = V10
fout->t2 = T2
fout->td2 = TD2
fout->RAINNC = rain_exp
fout->RAINC = rain_con
|
|