爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 3560|回复: 2

[脚本编辑] fwrite问题:只所有时次都成为最后一个时间的数据

[复制链接]
发表于 2017-10-11 11:20:56 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
使用fwrite使nc数据转dat格式,dat格式数据所有时次都采用了最后一个时次的数据,麻烦大家帮忙看看,问题出在哪里,谢谢各位。nc数据的ctl和gs如下:
ctl:
dset e:\uwnd.mon.ltm.nc
title monthly ltm uwnd from the NCEP Reanalysis
undef -9.96921e+36
dtype netcdf
xdef 144 linear 0 2.5
ydef 73 linear -90 2.5
zdef 17 levels 1000 925 850 700 600 500 400 300
250 200 150 100 70 50 30 20 10
tdef 12 linear 00Z01JAN0001 1mo
vars 2
uwnd=>uwnd  17  t,z,y,x  Monthly Long Term mean u wind
valid_yr_count=>valid_yr_count  17  t,z,y,x  count of non-missing values used in mean
endvars


gs:
'reinit'
'sdfopen E:\uwnd.mon.ltm.nc'
'set gxout fwrite'
'set fwrite e:\uwnd.dat'
'set x 1 144'
'set y 1 73'
t=1
while(t<=12)
'set t ' t
'set lev 200'
'd uwnd'
t=t+1
endwhile
'disable fwrite'
;


密码修改失败请联系微信:mofangbao
发表于 2017-10-11 12:01:05 | 显示全部楼层
也许是ctl和sdfopen的原因,有ctl只要open ctl,没有ctl需要sdfopen  *.nc
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2017-10-11 15:47:51 | 显示全部楼层
男紫汗 发表于 2017-10-11 12:01
也许是ctl和sdfopen的原因,有ctl只要open ctl,没有ctl需要sdfopen  *.nc

你是说直接open打开nc数据的ctl吗?刚才试了一下,不行的,谢谢你的回答。
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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