看板Programming
标 题Re: [问题] 有关fortran写法
发信站中大资工二进位的世界 (Thu Dec 13 23:08:15 2007)
转信站ptt!ctu-reader!ctu-peer!ctu-gate!news.nctu!news.ncu!news.csie.ncu!Bina
subroutine rotate(xlat,xlon,count,sm,theta,rota,ctime)
dimension count(401,401,8)
real rota
character fti*10
character ctime*12,tt*2,ati*10
read(ctime(9:10),'(i2)')itime
if(itime.ge.3.and.itime.lt.9)then
itime=6
elseif(itime.ge.9.and.itime.lt.15)then
itime=12
elseif(itime.ge.15)then
itime=18
else
itime=0
endif
write(tt,'(i2)')itime
if(itime.lt.10)tt='0'//tt(2:2)
ctime=ctime(1:8)//tt
k=1
do i=1,1000
read(5,31,end=335)ati,ro
if(ctime(1:10).eq.ati)then
do while( k.le.7)
read(5,'(11x,f3.0)',end=335)ro
rota=ro
write(9,'(f3.0)') rota
k=k+1
enddo
endif
31 format(a10,1x,f3.0)
enddo
335 continue
do i = 1 , 401
do j = 1 , 401
call cir(i,j,lat,lon,dir,dis)
if(dis.gt.500.) cycle
do k = 2 , 8
dir=dir+rota !rotation angle
dx=sm*cos(theta*3.14159/180)*(k-2)
dy=sm*sin(theta*3.14159/180)*(k-2)
i2=lat+int(dx+0.5)
j2=lon+int(dy+0.5)
count(m,n,k)=count(i,j,1)
enddo
enddo
enddo
return
end
===========================================
2005080518 03.
2005080519 02.
2005080520 02.
2005080521 04.
2005080522 03.
2005080523 03.
2005080600 02.
2005080601 02.
2005080602 03.
以上这些资料是编号5的档案所截取部份
================================================
上面是一个副程式,假设ctime(1:10)=ati= 2005080518时,接着我就做我用红色标示
第一个区块,可以读出变数rota的资料为
02.
02.
04.
03.
03.
02.
02.
然後我想把这些资料分别丢进 dir=dir+rota 去计算,但是我现在只抓到最後一个rota
变数资料 02. ,意思就是变成程式只抓到02.资料,每次计算都是用02. 资料去计算,
我是要让程式每次分别去抓不同的rota值,变成每次计算依序抓 02. 02. 04. 03. 03.
.....不同资料,这是我现在碰到困难处,我要把用红色标示第一个区块的rota值丢
到用红色标示的第二个区块,麻烦大家能给我ㄧ些提示方向,谢谢
--
〒作者:chuee 来自:140.115.111.196
◎二进位的世界【140.115.50.50‧bbs.ncu.cc】
1F:→ bbsx:看某 不知道怎麽改 140.112.66.142 01/08 14:36