- 积分
- 13665
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-6-13
- 最后登录
- 1970-1-1
|
发表于 2013-4-14 20:04:30
|
显示全部楼层
楼主 可以请您帮我看一下我的程序吗?谢谢哦 取的是1980-2008年的气温距平,可是得到之后无法生成map文件
program stngrid
real a1(160,62),a2(160,62),a3(160,62)
real a4(160,62),a5(160,62),a6(160,62)
real a7(160,62),a8(160,62),a9(160,62)
real a10(160,62),a11(160,62),a12(160,62),vvs(160,29,12)
real lat(160),lon(160),x(160,348),ave(160)
character*8 id(160)
open(1,file='e:\uv\da\t1601.txt')
open(2,file='e:\uv\da\t1602.txt')
open(3,file='e:\uv\da\t1603.txt')
open(4,file='e:\uv\da\t1604.txt')
open(5,file='e:\uv\da\t1605.txt')
open(6,file='e:\uv\da\t1606.txt')
open(7,file='e:\uv\da\t1607.txt')
open(8,file='e:\uv\da\t1608.txt')
open(9,file='e:\uv\da\t1609.txt')
open(10,file='e:\uv\da\t1610.txt')
open(11,file='e:\uv\da\t1611.txt')
open(12,file='e:\uv\da\t1612.txt')
open(13,file='e:\uv\da\160.txt')
open(14,file='e:\1979+\rain_temp\temp.grd',status='replace',
& form='binary')
ccccccccccccccc 读数据(经纬度、160站温度)
read(1,*)((a1(i,j),i=1,160),j=1,62)
ave=0
do i=1,160
do j=1,62
ave(i)=ave(i)+a1(i,j)
ave(i)=ave(i)/62
enddo;enddo
do i=1,160
do j=1,62
a1(i,j)=(a1(i,j)-ave(i))/10
enddo;enddo
read(2,*)((a2(i,j),i=1,160),j=1,62)
ave=0
do i=1,160
do j=1,62
ave(i)=ave(i)+a2(i,j)
ave(i)=ave(i)/62
enddo;enddo
do i=1,160
do j=1,62
a2(i,j)=(a2(i,j)-ave(i))/10
enddo;enddo
read(3,*)((a3(i,j),i=1,160),j=1,62)
ave=0
do i=1,160
do j=1,62
ave(i)=ave(i)+a3(i,j)
ave(i)=ave(i)/62
enddo;enddo
do i=1,160
do j=1,62
a3(i,j)=(a3(i,j)-ave(i))/10
enddo;enddo
read(4,*)((a4(i,j),i=1,160),j=1,62)
ave=0
do i=1,160
do j=1,62
ave(i)=ave(i)+a4(i,j)
ave(i)=ave(i)/62
enddo;enddo
do i=1,160
do j=1,62
a4(i,j)=(a4(i,j)-ave(i))/10
enddo;enddo
read(5,*)((a5(i,j),i=1,160),j=1,62)
ave=0
do i=1,160
do j=1,62
ave(i)=ave(i)+a5(i,j)
ave(i)=ave(i)/62
enddo;enddo
do i=1,160
do j=1,62
a5(i,j)=(a5(i,j)-ave(i))/10
enddo;enddo
read(6,*)((a6(i,j),i=1,160),j=1,62)
ave=0
do i=1,160
do j=1,62
ave(i)=ave(i)+a6(i,j)
ave(i)=ave(i)/62
enddo;enddo
do i=1,160
do j=1,62
a6(i,j)=(a6(i,j)-ave(i))/10
enddo;enddo
read(7,*)((a7(i,j),i=1,160),j=1,62)
ave=0
do i=1,160
do j=1,62
ave(i)=ave(i)+a7(i,j)
ave(i)=ave(i)/62
enddo;enddo
do i=1,160
do j=1,62
a7(i,j)=(a7(i,j)-ave(i))/10
enddo;enddo
read(8,*)((a8(i,j),i=1,160),j=1,62)
ave=0
do i=1,160
do j=1,62
ave(i)=ave(i)+a8(i,j)
ave(i)=ave(i)/62
enddo;enddo
do i=1,160
do j=1,62
a8(i,j)=(a8(i,j)-ave(i))/10
enddo;enddo
read(9,*)((a9(i,j),i=1,160),j=1,62)
ave=0
do i=1,160
do j=1,62
ave(i)=ave(i)+a9(i,j)
ave(i)=ave(i)/62
enddo;enddo
do i=1,160
do j=1,62
a9(i,j)=(a9(i,j)-ave(i))/10
enddo;enddo
read(10,*)((a10(i,j),i=1,160),j=1,62)
ave=0
do i=1,160
do j=1,62
ave(i)=ave(i)+a10(i,j)
ave(i)=ave(i)/62
enddo;enddo
do i=1,160
do j=1,62
a10(i,j)=(a10(i,j)-ave(i))/10
enddo;enddo
read(11,*)((a11(i,j),i=1,160),j=1,62)
ave=0
do i=1,160
do j=1,62
ave(i)=ave(i)+a11(i,j)
ave(i)=ave(i)/62
enddo;enddo
do i=1,160
do j=1,62
a11(i,j)=(a11(i,j)-ave(i))/10
enddo;enddo
read(12,*)((a12(i,j),i=1,160),j=1,62)
ave=0
do i=1,160
do j=1,62
ave(i)=ave(i)+a12(i,j)
ave(i)=ave(i)/62
enddo;enddo
do i=1,160
do j=1,62
a12(i,j)=(a12(i,j)-ave(i))/10
enddo;enddo
write(*,*)' ok 1'
do i=1,160
do j=1,29
vvs(i,j,1)=(a1(i,j+29))
vvs(i,j,2)=(a2(i,j+29))
vvs(i,j,3)=(a3(i,j+29))
vvs(i,j,4)=(a4(i,j+29))
vvs(i,j,5)=(a5(i,j+29))
vvs(i,j,6)=(a6(i,j+29))
vvs(i,j,7)=(a7(i,j+29))
vvs(i,j,8)=(a8(i,j+29))
vvs(i,j,9)=(a9(i,j+29))
vvs(i,j,10)=(a10(i,j+29))
vvs(i,j,11)=(a11(i,j+29))
vvs(i,j,12)=(a12(i,j+29))
enddo;enddo
do i=1,160
do j=1,29
do k=1,12
kk=k+(j-1)*12
x(i,kk)=vvs(i,j,k)
enddo
enddo
enddo
write(*,*)' ok 2'
cccccccccc读台站数据
do i=1,160
read(13,*)id(i),lat(i),lon(i)
enddo
write(*,*)' ok 3'
do i=1,348
do j=1,160
tim=0.0
nlev=1
nflag=1
write(14)id(j),lat(j),lon(j),tim,nlev,nflag,x(j,i)
enddo
tim=0.0
nlev=0
nflag=1
write(14)id(j-1),lat(j-1),lon(j-1),tim,nlev,nflag
end do
end
|
|