- 积分
- 28590
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-8-3
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
一 先把站点文件转化为二进制文件
假定站点资料为
station lat lon var
…. …. …. …..
1 单个时间变量,单个要素 bintd.f90
program bintd
parameter (st=3276) ! st means nums of station
character stid(st)*8
integer nflag,nlev
real lat(st),lon(st),std(st),tim
open(30,file='02070108.txt')
open(40,file='td.dat',form='binary')
do i=1,st
read(30,'(a5,2f8.2,f7.1)')stid(i),lat(i),lon(i),std(i)
write(*,*)stid(i),lat(i),lon(i),std(i)
end do
close(30)
tim=0.0
nflag=1
nlev=1
do i=1,st
write(40)stid(i),lat(i),lon(i),tim,nlev,nflag,std(i)
end do
nlev=0
write(40)stid(3276),lat(3276),lon(3276),tim,nlev,nflag
close(40)
end
2 多个时间变量,单个要素binstat.f90
假定站点资料为
time station lat lon var
……. …… … … ….
program binstat
character stid*8
integer nflag,nlev
real lat,lon,std,tim
open(30,file='st020120.txt')
open(40,file='bist020120.dat',form='binary')
iflag=0
i=0
10 read(30,'(i3,1x,a5,2f8.2,f7.1)',end=90)id,stid,lat,lon,var
if(iflag.eq.0)then
iflag=1
ims=im
ids=id
end if
if(ids.ne.id)then
nlev=0
write(40)stid,lat,lon,tim,nlev,nflag
i=i+1
write(*,*)i
end if
ims=im
ids=id
tim=0.0
nflag=1
nlev=1
write(40)stid,lat,lon,tim,nlev,nflag
write(40)var
go to 10
90 continue
nlev=0
write(40)stid,lat,lon,tim,nlev,nflag
stop
end
二 创建站点文件的描述文件
1单个时间变量 单个要素 td.ctl
dset td.dat
dtype station
stnmap td.map
undef 999.9
title daily td
tdef 1 linear Jan2002 1mo
vars 1
td 0 99 tdpoint data
endvars
2 多个时间变量 单个要素 stat.ctl
dset bist020120.dat
dtype station
stnmap svar020120.map
undef 999.9
title daily svar
tdef 31 linear Jan2002 1mo
vars 1
svar 0 99 svars data
endvars
三 stnmap –i xxx.ctl
四 生成相应的格点文件 wgrid.f90
program wgrid
! to get grids
real gtd(50,50)
! redefine the grids numbers when necessary
open(10,file='/Models/czh/wgrid.dat',form='binary')
do i=1,50
do j=1,50
gtd(i,j)=0
end do
end do
write(10)((gtd(i,j),i=1,50),j=1,50)
end
五 生成格点文件的描述文件 grid.ctl
dset wgrid.dat
title gtd
undef -9.99E33
xdef 50 linear 115.07 0.18
ydef 50 linear 39.29 0.18
zdef 1 linear 1 1
tdef 1 linear jan2002 1mo
vars 1
gtd 0 99 grid td
endvars
六 生成最后的gs文件 stat.gs
1 显示一张图
'reinit'
'open gtd.ctl'
'open td.ctl'
'set mpdset cnworld'
'set lon 102.2 125.8'
'set lat 31.4 46.4'
'set t 1'
'define tds=oacres(gtd,std.2)'
'set cint 0.5'
'set gxout shaded'
'd tds'
'set gxout contour'
'd tds'
'printim td.gif white'
;
2 同时显示多个时刻的图
'reinit'
'open gtd.ctl'
'open 200201.ctl'
'set mpdset cnworld'
'set lon 115.17 117.672'
'set lat 39.29 41.216'
tm=1
while(tm<=31)
'set t '%tm
'define statvar=oacres(gtd,svar.2)'
'set cint 0.5'
'set gxout shaded'
'd statvar'
'set gxout contour'
'd statvar'
'printim statvar'% tm % '.gif white'
'd statvar'
'c'
tm=tm+1
endwhile
|
评分
-
查看全部评分
|