- 积分
- 7694
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-9-5
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 刷牙 于 2014-12-1 21:46 编辑
写了一个gs文件,实在不知道错在哪里啊
运行时是这样的
运行出来的结果大小是合适的,但是只有第一年的数据,后面都没了
gs文件如下:
大家帮忙找找茬
'reinit'
'set fwrite D:\study\era\data\hgt\month\hgtmonth.dat'
'set gxout fwrite'
*calculate the month mean tropopause height
yr=1979
while(yr<=2012)
'open D:\study\era\data\hgt\'yr'.ctl'
'set lat 15 55.5'
'set lon 72 135'
*判定闰平年
if(yr=1980|yr=1984|yr=1988|yr=1992|yr=1996|yr=2000|yr=2004|yr=2008|yr=2012)
'define monthhgt=ave(hgt,time=00Z01JAN'yr',time=12Z31JAN'yr')'
'd monthhgt'
'define monthhgt=ave(hgt,time=00Z01FEB'yr',time=12Z29FEB'yr')'
'd monthhgt'
'define monthhgt=ave(hgt,time=00Z01MAR'yr',time=12Z31MAR'yr')'
'd monthhgt'
'define monthhgt=ave(hgt,time=00Z01APR'yr',time=12Z30APR'yr')'
'd monthhgt'
'define monthhgt=ave(hgt,time=00Z01MAY'yr',time=12Z31MAY'yr')'
'd monthhgt'
'define monthhgt=ave(hgt,time=00Z01JUN'yr',time=12Z30JUN'yr')'
'd monthhgt'
'define monthhgt=ave(hgt,time=00Z01JUL'yr',time=12Z31JUL'yr')'
'd monthhgt'
'define monthhgt=ave(hgt,time=00Z01AUG'yr',time=12Z31AUG'yr')'
'd monthhgt'
'define monthhgt=ave(hgt,time=00Z01SEP'yr',time=12Z30SEP'yr')'
'd monthhgt'
'define monthhgt=ave(hgt,time=00Z01OCT'yr',time=12Z31OCT'yr')'
'd monthhgt'
'define monthhgt=ave(hgt,time=00Z01NOV'yr',time=12Z30NOV'yr')'
'd monthhgt'
'define monthhgt=ave(hgt,time=00Z01DEC'yr',time=12Z31DEC'yr')'
'd monthhgt'
else
'define monthhgt=ave(hgt,time=00Z01JAN'yr',time=12Z31JAN'yr')'
'd monthhgt'
'define monthhgt=ave(hgt,time=00Z01FEB'yr',time=12Z28FEB'yr')'
'd monthhgt'
'define monthhgt=ave(hgt,time=00Z01MAR'yr',time=12Z31MAR'yr')'
'd monthhgt'
'define monthhgt=ave(hgt,time=00Z01APR'yr',time=12Z30APR'yr')'
'd monthhgt'
'define monthhgt=ave(hgt,time=00Z01MAY'yr',time=12Z31MAY'yr')'
'd monthhgt'
'define monthhgt=ave(hgt,time=00Z01JUN'yr',time=12Z30JUN'yr')'
'd monthhgt'
'define monthhgt=ave(hgt,time=00Z01JUL'yr',time=12Z31JUL'yr')'
'd monthhgt'
'define monthhgt=ave(hgt,time=00Z01AUG'yr',time=12Z31AUG'yr')'
'd monthhgt'
'define monthhgt=ave(hgt,time=00Z01SEP'yr',time=12Z30SEP'yr')'
'd monthhgt'
'define monthhgt=ave(hgt,time=00Z01OCT'yr',time=12Z31OCT'yr')'
'd monthhgt'
'define monthhgt=ave(hgt,time=00Z01NOV'yr',time=12Z30NOV'yr')'
'd monthhgt'
'define monthhgt=ave(hgt,time=00Z01DEC'yr',time=12Z31DEC'yr')'
'd monthhgt'
endif
*取第yr年数据
yr=yr+1
endwhile
'disable fwrite'
;
问题已经解决,就是忘了在最后加一句关闭文件的操作'close 1'
|
|