- 积分
- 451
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2016-9-29
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
请教一下会grads的小伙伴,用grads画图出现了一个错误:
系统提示如下:
Data Request Error: Invalid grid coordinates
World coordinates convert to non-integer grid coordinates
Variable = uwndclim Dimension = 3
Error ocurred at column 6
原gs文件:(另附件可直接下载)
'reinit''open D:\grads2\ex4.ctl''open D:\grads2\clim_ex4.ctl''set lon 90 270''set lat -30 60''set lev 850''run define_colors.gs'len=0.25scale=5'set dfile 2''set t 1 12''define uwndclim=uwnd''define vwndclim=vwnd''define slpclim =slp''modify uwndclim seasonal''modify vwndclim seasonal''modify slpclim seasonal''set dfile 1''set t 1 24''define uwndanom=uwnd-uwndclim''define vwndanom=vwnd-vwndclim''define slpanom = slp/100.-slpclim't=11while(t<=16) monstr=getmonstr(t) if (t>12) mon=t-12 timestr=15%monstr%1998 else mon=t timestr=15%monstr%1997 endif 'set time ' timestr x0=math_int((t-11)/3) y0=math_mod((t-11),3) xl=0 xr=0 cb=0.8 wd=(11-xl*2-xr*2-cb)/2 xmin=xl+(wd+xl+xr)*x0 xmax=xmin+wd yt=0.1 yb=0.2 ht=(8.5-yt*3-yb*3)/3 ymax=8.5-yt-(ht+yt+yb)*y0 ymin=ymax-ht 'set parea 'xmin' 'xmax' 'ymin' 'ymax 'set gxout shaded' 'set grads off' 'set grid off' 'set clevs -10 -7 -5 -3 -2 -1 1 2 3 5 7 10' 'set ccols 99 97 95 94 93 92 0 82 83 84 85 87 89' 'd slpanom' 'set arrscl 'len' 'scale 'set arrowhead -0.4' 'set arrlab off' 'set ccolor 1' 'd skip(uwndanom,3);skip(vwndanom,3)' if (mon=3) 'cbarn 1 1' endif 'q w2xy 90 55' xl=subwrd(result,3) yl=subwrd(result,6) 'q w2xy 108 65' xo=subwrd(result,3) yo=subwrd(result,6) 'set line 1' 'draw rec 'xl' 'yl' 'xo' 'yo 'set line 0' 'draw recf 'xl' 'yl' 'xo' 'yo 'set string 1 c' 'draw string 'xo/2+xl/2' 'yo/2+yl/2' 'monstr t=t+1endwhile rc = arrow(10.3,0.8,len,scale)'gxprint D:\grads2\4-2.png white'function arrow(x,y,len,scale)'set line 1 1 4''draw line 'x-len/2.' 'y' 'x+len/2.' 'y'draw line 'x+len/2.-0.05' 'y+0.04' 'x+len/2.' 'y'draw line 'x+len/2.-0.05' 'y-0.04' 'x+len/2.' 'y'set string 1 c''set strsiz 0.12''draw string 'x' 'y-0.13' 'scalereturnfunction getmonstr(mon)mon=math_mod(mon,12)if(mon=1) monstr='JAN'endifif(mon=2) monstr='FEB'endifif(mon=3) monstr='MAR'endifif(mon=4) monstr='APR'endifif(mon=5) monstr='MAY'endifif(mon=6) monstr='JUN'endifif(mon=7) monstr='JUL'endifif(mon=8) monstr='AUG'endifif(mon=9) monstr='SEP'endifif(mon=10) monstr='OCT'endifif(mon=11) monstr='NOV'endifif(mon=12|mon=0) monstr='DEC'endifreturn monstr;这是我的上机作业,上传的gs文件是老师供我们参考的,若有侵犯版权问题,我会及时删帖的。最后,祝各位小伙伴们国庆节快乐!
|
-
-
temp.gs
3.24 KB, 下载次数: 2, 下载积分: 金钱 -5
|