- 积分
- 100
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-11-26
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
使用writehz.gs汉子显示程序进行绘图,之前在grads2.0版本里都没有问题,但同样的程序在opengras2.1里就没办法正常显示,错误提示如下:
“Data Request Warning: Request is completely outside file limits”
以下是我的gs文件:
'reinit'
"open E:\research\yanjiu\WarmSeasoon_Test\data\results\QPF\rainobs24haddby1hjmgrd.ctl"
cdate=2014070608
fdate.1=2014070508
fdate.2=2014070408
fdate.3=2014070308
QPFpath="E:\research\yanjiu\WarmSeasoon_Test\data\results\QPF\"
picpath="E:\research\yanjiu\WarmSeasoon_Test\pics\synoptic_verification\"
i=1
while(i<4)
ftime=24*i
t1=1
while(t1<2)
'set lon 110 123'
'set lat 22 35'
'set z 1'
lon1=110
lon2=123
lat1=22
lat2=35
'set grads off'
'set grid off'
'set parea 1 9.5 1 7.8'
'set xlopts 1 1 0.2'
'set ylopts 1 1 0.2'
'set xlint 2'
'set ylint 2'
'set dfile 1'
'set t 't1
say result
rc1=subwrd(result,4)
year=substr(rc1,1,4)
mon=substr(rc1,6,1)
'set t 't1
'q time'
rc1=subwrd(result,3)
day=substr(rc1,4,2)
'set gxout shaded'
'set rgb 55 223 0 223'
'set rgb 20 0 0 255'
'set rgb 75 177 213 255'
'set rgb 56 54 228 63'
'set rgb 78 75 0 0'
'set rgb 79 192 192 192'
'set rgb 64 102 119 255'
*'set clevs 10 25 50 100 250 400'
*'set rbcols 0 56 75 20 55 78 79'
'set clevs 10 25 50 100'
'set rbcols 0 75 20 55 78'
'd rain'
'run cbarn 1 1 8.3 4.5'
'set mpdset C:\opengrads\Contents\Resources\SupportData\Chinamap_province_grads_fjl'
'set map 1 1 8'
'draw map'
'writehz 2.5 7.9 'year'年'mon'月'day'日08时1h加密自动站累加的24小时累积降水量(mm) 1 2 1 1.0 0.5'
year=substr(fdate.i,1,4)
mon=substr(fdate.i,5,2)
day=substr(fdate.i,7,2)
'writehz 2.3 8.2 'year'年'mon'月'day'日08时'ftime'h中央气象台定量降水预报落区(红色等值线) 1 2 1 1.0 0.5'
rc1=read(''QPFpath'QPFlines_'fdate.i'.0'ftime'')
*say ''QPFpath'QPFlines_'fdate.i'.0'ftime''
rc1=read(''QPFpath'QPFlines_'fdate.i'.0'ftime'')
nline=sublin(rc1,2)
nf=subwrd(nline,1)
nt=subwrd(nline,2)
is=1
while(is<nf+1)
it=1
ip=0
while(it<nt)
Po=subwrd(nline,3)
xo=subwrd(nline,4)
yo=subwrd(nline,5)
if(Po>=10)
if(xo>=lon1 & xo<=lon2 & yo>=lat1 & yo<=lat2)
ip=ip+1
'q w2xy 'xo' 'yo
x1=subwrd(result,3)
y1=subwrd(result,6)
x2=x1
y2=y1
if(ip=1)
'set string 1'
'set strsiz 0.1'
'draw string 'x2' 'y2' 'Po''
endif
if(ip>1)
'set line 2 1 7'
'draw line 'x' 'y' 'x1' 'y1''
endif
if(ip>1)
if(Po=50)
'set line 2 1 10'
'draw line 'x' 'y' 'x1' 'y1''
endif
endif
x=x1
y=y1
else
ip=0
endif
endif
it=it+1
rc1=read(''QPFpath'QPFlines_'fdate.i'.0'ftime'')
nline=sublin(rc1,2)
endwhile
is=is+1
rc1=read(''QPFpath'QPFlines_'fdate.i'.0'ftime'')
nline=sublin(rc1,2)
nt=subwrd(nline,2)
endwhile
*'print'
t1=t1+1
*'clear'
endwhile
'gxprint 'picpath''cdate'_'i'_QPF_3d_20141226.png white x1024 y768'
'clear'
i=i+1
endwhile
*'disable print'
'reinit'
*'quit'
请高手指点,非常感谢!
|
|