- 积分
- 512
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-11-28
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
问题如题,单独画站点都能正常显示,一旦使用oacres命令画插值等值线就报错。但是前几天还能正常画图,今天只是增加了几个变量,就频繁报错,可是如果将gs中ctl文件的读取顺序颠倒一下,就能绘出图。可是感觉图还是有问题,请大家多多指教!
fortran程序如下:
real lat(50000),lon(50000),tim
real t(50000),td(50000),dmb(24),fx(50000),fs(50000),u(50000),v(50000),r(50000),p(50000)
character*8 stid(50000)
integer lev,flag,i,j,n
character*100 fname
character*100 fname1
character*100 sourcename
!**********read stid,lon,lat****************
open(10,file='../aws/plot/filename.lst',form='formatted')
!input the file
888 read(10,*,err=999,end=999) sourcename
close(11)
open(11,file='../aws/plot/'//sourcename)
write(*,*) 'input filename:sourcename=',sourcename
sourcename=trim(sourcename)
k=len_trim(sourcename)
!output the file
write(fname,*) sourcename(:k-4),'.dat'
write(fname1,*) sourcename(:k-4),'.ctl'
open(21,file='../aws/p-grd/'//fname(2:15),form='binary')
write(*,*) 'output filename:fname=',fname
!---------------------------------------------------------------
!read the first useless lines
read(11,*)
read(11,*)
!read the station data
n=0
DO i=1,50000
READ(11,*,END=5,ERR=5) dmb
n=n+1
lon(i)=dmb(2)
lat(i)=dmb(3)
fx(i)=DMB(7)
fs(i)=DMB(8)
p(i)=DMB(9)
r(i)=DMB(13)
td(i)=DMB(17)
t(i)=DMB(20)
5 continue
enddo
write(*,*) n
!--------------------------------------------------------------------------
do i=1,n
stid(i)=char(i)
enddo
tim=0.0
flag=1
lev=1
do i=1,n
if(fs(i)/=9999.and.fx(i)/=9999) then
u(i)=fs(i)*sin((fx(i)-180)*3.14159/180)
v(i)=fs(i)*cos((fx(i)-180)*3.14159/180)
write(21) stid(i),lat(i),lon(i),tim,lev,flag,t(i),td(i),u(i),v(i),p(i),r(i)
endif
enddo
lev=0
write(21)stid(i-1),lat(i-1),lon(i-1),tim,lev,flag
!---------------------------------------------------------------------------
!write the ctl files
open(22,file='../aws/ctl/'//fname1(2:15))
write(22,'(a5,a46)')'dset','e:/work/station/aws/p-grd/'//fname(2:15)
write(22,'(a15)')'dtype station'
write(22,'(a40)')'stnmap e:/work/station/aws/ctl/map.map'
write(22,'(a12)')'undef 9999'
write(22,'(a24)')'title station 1hr data'
!----------------------------------------------------------------------
write(22,'(a30)')'tdef 1 linear oct2009 1hr'
write(22,'(a18)')'zdef 1 linear 1 1'
write(22,'(a9)')'vars 6'
write(22,'(a11)')'t 0 99 t'
write(22,'(a11)')'td 0 99 td'
write(22,'(a11)')'u 0 99 u'
write(22,'(a11)')'v 0 99 v'
write(22,'(a11)')'p 0 99 p'
write(22,'(a12)')'r1 0 99 r1'
write(22,'(a7)')'ENDVARS'
!-----------------------------------------------------------------------------
close(21)
close(22)
900 goto 888
999 close(10)
END
gs文件如下:
'reinit'
'open e:\work\station\09aws\ctl\grid.ctl' !grid 是1*1的
'open e:\work\station\09aws\ctl\09103120.ctl'
'set lon 110 119'
'set lat 35 45'
'set mpdset cnworld'
'd oacres(g,t.2,1,10,7,4,2,1)'
'printim e:\work\station\aws\ctl\aws.png white'
;
标红色的地方如果按照这个顺序,就会提示错误:Warning from OACRES:Less than two stations
但是如果将这两行颠倒一下,'d oacres(g,t.2,1,10,7,4,2,1)'改为'd oacres(g.2,t.1,1,10,7,4,2,1)'就能画图,但也会有一个提示:Data Request Warning:Request is completely outside file limits
用这个方法如果插值到0.1*0.1的话,图形完全不对
|
|