爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
123
返回列表 发新帖
楼主: 花楹

[其他] NCL读取二进制文件时的问题

[复制链接]

新浪微博达人勋

发表于 2017-7-11 15:40:04 | 显示全部楼层
刚好解决了我的问题
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2018-11-19 16:01:46 | 显示全部楼层
本帖最后由 subtropical 于 2018-11-19 16:30 编辑
hzwjy 发表于 2012-4-19 19:28
顺序存储和直接存储的数据分开讲,
1.
FORTRAN程序写直接存储无格式数据的代码是:

您好  我要把wrfout里面的变量写成.bin二进制文件(为了方面业务运行再绘制成图形),我看NCL官网,然后学着用ncl函数
fbinrecwrite (file_out,-1, (/ times /))   
   fbinrecwrite (file_out,-1, (/ LAT(0,:,:) /))     
   fbinrecwrite (file_out,-1, (/ LON(0,:,:) /))
   fbinrecwrite (file_out,-1, (/ vis(0,:,:) /))
其中lat,lon,还有变量vis都是(times(1),lat(288),lon(288))
然后顺序再用ncl读取
a = fbinrecread (fili, 0, 1, "integer")        ; 1st record is zero
     x = fbinrecread (fili, 1, (/ 288,288 /), "float")          ; 2nd           one
     y = fbinrecread (fili, 2, (/ 288,288 /), "float")          ; 3rd record is two
     z = fbinrecread (fili, 3, (/ 288,288 /), "float") ; 4th record is three
读了之后,我print看了下,x,y,z好像都是正确的存储,但是我就简单的画张图 22.png 11.png
fatal:Argument type mismatch on argument (0) of (wrf_contour) can not coerce
fatal:["Execute.c":8578]:Execute: Error occurred at or near line 62 in file read_bin_vis1.ncl
请问要怎么改?
不太懂要怎么给变添加属性之类的,为了方便画图,有例子可以参考下吗?,谢谢
还有我为了简单,先写了一个时次的,那很多个时次的话,变量要怎么写呢?


密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2018-12-16 16:03:45 | 显示全部楼层
菜鸟,学习ing
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2021-12-28 10:47:39 | 显示全部楼层
{:eb502:}{:eb502:}{:eb502:}{:eb502:}{:5_213:}{:5_213:}{:5_213:}
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表