- 积分
- 13665
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-6-13
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2013-4-14 15:45:46
|
显示全部楼层
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')
ccccccccccccccccccccc6,7,8月的资料
open(13,file='e:\uv\da\160.txt')
open(14,file='e:\1979+\rain_temp\temp.grd',status='replace',
& form='binary')
cccccccccccccccccccccccc台站数据
c open(11,file='ave.txt')
c open(13,file='ave.grd',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
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,348
t=int((j-1)/12)+1
x(i,j)=(vvs(i,t,k),k=1,12)
enddo;enddo
cccccccccc读台站数据
do i=1,160
read(13,*)id(i),lat(i),lon(i)
enddo
write(*,*)' ok 1'
cccccccccccccc写站点数据
do i=1,348
cccccccccccccccccccccccccccc多时次读取,这里是62年,自己改值
do j=1,160
cccccccccccccccccccccccccccc160站,使用其他站的资料,也可以照样改值即可
c id(j)=char(j)
tim=0.0
nlev=1
nflag=1
write(14)id(j),lat(j),lon(j),tim,nlev,nflag,x(j,i)
ccccccccccccccccccccccccccc单时次为x(i)即可
enddo
ccccccccccccccccccccccccccccccccccccccccc
tim=0.0
nlev=0
nflag=1
write(14)id(j-1),lat(j-1),lon(j-1),tim,nlev,nflag
end do
ccccccccccccccccccccccccccccccccccccccccccc若不是多时次,则此do循环,enddo则不用了
end |
|