- 积分
- 33
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-10-22
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
Enter stn ctl filename: E:\taizhan\temp\zhandian\111p.ctl
Name of binary data set: E:\taizhan\temp\zhandian\111p.grd
Number of times in the data set: 50
Number of surface variables: 1
Number of level dependent variables: 0
Starting scan of station data binary file.
Processing time = 1
Binary data file open: E:\taizhan\temp\zhandian\111p.grd
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 = 1 flag = 1 time = 1961
File name = E:\taizhan\temp\zhandian\111p.grd
这是在grads运行ctl的结果,说是二进制文件有问题。下面是原始txt被转为二进制的fortran程序
program sta2grd
implicit none
character*8 stid
real :: lon,lat,pre,year
integer :: nlev=1
integer :: flag=1
integer i
open(10,file='E:\taizhan\temp\zhandian\111p.txt',status='old',action='read')
open(11,file='E:\taizhan\temp\zhandian\111p.grd',status='replace',action='write',access='direct',form='unformatted',&
recl=2500*5)
do i=1,2500
read(10,*) stid,lat,lon,year,pre
!if(i==10 .or. i==11) then
write(11,rec=i) stid,lat,lon,year,nlev,flag,pre
!write(*,*) stid,lat,lon,tim,nlev,flag,rain
!endif
enddo
close(10)
nlev=0
write(11,rec=i+1) stid,lat,lon,year,nlev,flag,pre
close(11)
end program
求指点,到底是哪里错了?
|
|