- 积分
- 17
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2023-6-25
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2023-11-19 20:26:36
|
显示全部楼层
这是用copy_VarMeta方法转换的代码
begin
setfileoption("nc", "Format", "NetCDF4Classic")
do ye = 2009, 2023
y = tostring(ye)
do mon = 1, 12
; 用来生成数据索引
if(ye .eq. 2023) .and. (mon .eq. 7)
break
end if
if(mon.lt.10)
m = tostring(0) + tostring(mon)
else
m = tostring(mon)
end if
path0 = tostring("/mnt/e/data/")+y+m+tostring(".grib") ; 待转换文件
path1 = tostring("/mnt/e/data/")+y+m+tostring(".nc") ; 保存文件
infile = addfile(path0, "r")
outfile = addfile(path1,"c")
copy_VarMeta(infile, outfile)
print(outfile)
exit()
end do
end do
end |
|