爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 2666|回复: 3

[分享资料] grads画图时出错,求大家指导程序已贴上

[复制链接]

新浪微博达人勋

发表于 2015-10-18 16:32:38 | 显示全部楼层 |阅读模式

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

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

x
program main
implicit none
parameter n=348
real x(n),y(n),c(n),d(n),t(n)
real a,b,sx,sxy,sum2,ave2,sum1,ave1
integer i
!open(1,file='d:/interannual/q/nino3.txt')
!open(2,file='d:/interannual/q/tloop79.txt')
!open(3,file='d:/interannual/q/3.txt')
!open(4,file='d:/interannual/q/4.grd',form='binary')
!open(5,file='d:/interannual/q/5.grd',form='binary')
open(1,file='f:/wwt/lr/nino1+2.txt')
open(2,file='f:/wwt/lr/ssta.grd',form='unformatted',status='old',access='direct',recl=1)
open(3,file='f:/wwt/lr/y1.grd',form='unformatted',status='replace',access='direct',recl=1)
open(4,file='f:/wwt/lr/y2.grd',form='unformatted',status='replace',access='direct',recl=1)
open(5,file='f:/wwt/lr/t.grd',form='unformatted',status='replace',access='direct',recl=1)
do i=1,n
read(1,*) x(i)
read(2,rec=i) y(i)
enddo
do i=1,n
write(3,rec=i) y(i)
enddo
sum1=0.0
sum2=0.0
sx=0.0
sxy=0.0
do i=1,n
sum1=sum1+x(i)
sum2=sum2+y(i)
enddo
ave1=sum1/n
ave2=sum2/n
do i=1,n
c(i)=x(i)-ave1
d(i)=y(i)-ave2
enddo
do i=1,n
sx=sx+c(i)**2
sxy=sxy+c(i)*d(i)
enddo
sx=sx/n
sxy=sxy/n
b=sxy/sx
a=ave2-ave1*b
do i=1,n
t(i)=a+b*x(i)
y(i)=y(i)-t(i)
enddo
do i=1,n
write(4,rec=i) y(i)
write(5,rec=i) t(i)
enddo
end
为什么这样算出来的数据在画图的时候老是出错呢
类似这种
Low Level I/O Error: Read error on data file Data file name = 20091012_RCWF.dat Error reading 141 bytes at location 79524 Data Request Error: Error for variable 'dbz' Error ocurred at column 1 DISPLAY error: Invalid expression Expression = dbz
ctl:dset f:/wwt/lr/y1.grd
title y1
undef -9.99e+08
xdef 1 linear 80.0 1.0
ydef 1 linear -15.0 1.0
zdef 1 linear 0 1.0
TDEF 348 LINEAR jan1979 1mo
vars 3
y1 0 99 yuanshi
y2 0 99 huigui
t 0 99 huigui
endvars
gs:'reinit'
'open f:\wwt\lr\y1.ctl'
'set lon 80'
'set lat -15'
'set lev 0'
'set t 1 348'
'set gxout line'
'set ccolor 4'
'd y1'
'printim f:/wwt/lr/y.png white'
;
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2015-10-18 16:36:41 | 显示全部楼层
怎么没有人回复我呢
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2015-10-18 17:23:06 | 显示全部楼层
这个不用纠结后面,基本可以肯定是因为写数据格式有问题···
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2015-11-8 16:40:24 | 显示全部楼层
river 发表于 2015-10-18 17:23
这个不用纠结后面,基本可以肯定是因为写数据格式有问题···

这个我知道啦,谢谢呀,现在在做walker环流的t检验,用阴影怎么表示出来呀
'reinit'
*timeserials=reg2
'open f:/wwt/xiangguan/ashock/omegajja.ctl'
'open f:/wwt/xiangguan/ashock/uwnd12.ctl'
'open f:/wwt/xiangguan/ashock/regaave.ctl'
'enable print  f:/wwt/xiangguan/ashock/omega.gmf'
'set x 1'
'set y 1'
'set t 1 52'
*'define elnino='timeserials'.2'
'define elnino=reg.3'


'set x 1 144'
'set y 1 73'
'set z 1 12'
'set t 1 52'
'define co=tregr(elnino,omega,t=1,t=52)'
'define co1=tregr(elnino,uwnd.2,t=1,t=52)'

'define a=ave(co,lat=-10,lat=10)'
'define a1=ave(co1,lat=-10,lat=10)'


'set lon 90 280'
'set y 1'
'set z 1 12'
'set t 1'
'set gxout stream'
'd a1;a*(-100)'

'set lon 90 280'
'set y 1'
'set z 1 12'
'set t 1'
'define t=sqrt(50.0)*a/sqrt(1.0-a*a)'
while(t>2.009)
'set gxout shaded'
'd myp'
endwhile
'print'
'disable print '
;
求解答
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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