- 积分
- 141
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-3-1
- 最后登录
- 1970-1-1
|
发表于 2012-12-15 16:41:15
|
显示全部楼层
偶依样画葫芦试了一下,于是出现了很多问题,如下:
偶需要用多个时次的站点插值成格点资料画图,fortran如下:
program main
implicit none
integer,parameter :: nt=12,tt=144
character*3 stid(nt,tt)
real:: lat(nt,tt),lon(nt,tt),uwnd(nt,tt),vwnd(nt,tt),tim
integer :: i,j
integer nflag,nlev
open(11,file='d:/wang/new/sta_speed.txt',status='old')
open(40,file='d:/wang/new/Sta_uwnd.dat',form='binary',access='sequential',status='replace')
open(50,file='d:/wang/new/Sta_vwnd.dat',form='binary',access='sequential',status='replace')
do j=1,tt
do i=1,nt
read(11,'(a3,5x,f5.2,5x,f6.2,5x,f10.5,5x,f10.5)') stid(i,j),lat(i,j),lon(i,j),uwnd(i,j),vwnd(i,j)
end do
end do
close(11)
do j=1,2
do i=1,nt
write(*,'(a3,5x,f5.2,5x,f6.2,5x,f10.5,5x,f10.5)') stid(i,j),lat(i,j),lon(i,j),uwnd(i,j),vwnd(i,j)
end do
end do
!======write station file======!
!!!!!!!!=====uwnd=======!!!!!!!!
do j=1,tt
tim=0.0
do i=1,nt
nlev=1
nflag=1
write(40) stid(i,j),lat(i,j),lon(i,j),tim,nlev,nflag,uwnd(i,j)
end do
nlev=0
write(40) stid(nt,j),lat(nt,j),lon(nt,j),tim,nlev,nflag
!write(40) stid,lat,lon,tim,nlev,nflag
end do
close(40)
!!!!!!!!=====vwnd=======!!!!!!!!
do j=1,tt
tim=0.0
do i=1,nt
nlev=1
nflag=1
write(50) stid(i,j),lat(i,j),lon(i,j),tim,nlev,nflag,vwnd(i,j)
end do
nlev=0
write(50) stid(nt,j),lat(nt,j),lon(nt,j),tim,nlev,nflag
end do
close(50)
stop
end
然后其中sta_uwnd.dat的ctl文件如下:
dset d:/wang/new/Sta_uwnd.dat
dtype station
stnmap d:/wang/new/Sta_uwnd.map
undef -99.9
title daily sta
tdef 144 linear 00Z01Jul2012 1hr
vars 1
uwnd 0 99 stapoint data
endvars
然后在grads输入!stnmap -i d:/wang/new/sta_uwnd.ctl,grads里面就提示如下:
Name of binary data set:d:/wang/new/Sta_uwnd.dat
Number of times in the data set: 144
Number of surface variables: 1
Number of level dependent variables: 0
Starting scan of station data binary file.
Binary data file open: d:/wang/new/Sta_uwnd.dat
Processing time step 1
Invalid station hdr found in station binary file
Possible causes: Invalid level count in hdr
Descriptor file mismatch
File not station data
Invalid relative time
levs = -50331648 flag = 1379892243 time = 2.35099e=33
请教各位这个问题该怎么解决呢?
|
|