- 积分
- 2438
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2019-4-14
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 wtydfg 于 2020-4-9 00:24 编辑
我找不出哪儿错了,新手求助,下面是程序 program raindr
parameter(pi=3.14159)
integer raindrop2(32,32),n,nn
real dipu(32,32),s(10000,32),v(32),dia(32),dbz(100000),
*inten(100000),dipu1(32,32),s1(10000,32)
character*2000 c,cc(2000)
character*19 time1(10000)
character*2 raindrop(32,32)
character*7 intensity(100000), precipitation(100000),
*radar(100000),visibility(100000),particles(100000)
open(10,file='20070827.mis')
open(30,file='diameter.txt')
open(40,file='dbz.txt')
do j=1,32
read(30,*) dia(j)
write(*,*) j,dia(j)
enddo
i=1
do while(.not.eof(10))
read(10,*)c
time1(i)=c(1:19)
print *, c
i_number=0
do i2=21,100
if(c(i2:i2)==';')then
i_number=i_number+1
select case (i_number)
case(1)
i2_1=i2-1
intensity(i)=c(21:i2_1)
case(2)
i2_2=i2-1
precipitation(i)=c(i2_1+2:i2_2)
case(5)
i2_5=i2-1
case(6)
i2_6=i2-1
radar(i)=c(i2_5+2:i2_6)
case(7)
i2_7=i2-1
visibility(i)=c(i2_6+2:i2_7)
!case(8)
! i2_8=i2-1
!case(9)
!i2_9=i2-1
! particles(i)=c(i2_8+2:i2_9)
end select
end if
enddo
cc='-'!赋初值,防止循环使用cc时出现覆盖不完全的情况
do j=1,1000
if(c(j:j+7)=='SPECTRUM')then
if(c(j+9:j+12)==';;;;')then
n=j+9
nn=1
do while(c(n:n)/='<')
if((c(n:n)/=';').and.(c(n+1:n+1)==';'))then
cc(nn)=c(n:n)
n=n+2
elseif((c(n:n)/=';').and.(c(n+1:n+1)/=';'))then
cc(nn)=c(n:n+1)
n=n+3
else
cc(nn)=c(n:n)
n=n+1
endif
nn=nn+1
enddo
!write(*,*)cc(nn-1),nn
! cc=c(j+9:j+9+32*32-1)
do ii=1,32
do kk=1,32
raindrop(ii,kk)=cc(kk+32*(ii-1))
enddo
enddo
else
go to 100
endif
endif
enddo
do ii=1,32
do kk=1,32
if(raindrop(ii,kk)==';')then
raindrop2(ii,kk)=0
else
!raindrop2(ii,kk)=int(raindrop(ii,kk))
read(raindrop(ii,kk),*)raindrop2(ii,kk)
endif
enddo
enddo
c write(3,200)((raindrop2(ii,kk),ii=1,32),kk=1,32) !jxc
do ii=1,32
select case(ii)
case(1:10)
v(ii)=(ii-1)*0.1+0.05
case(11:16)
v(ii)=1.0+(ii-11)*0.2+0.1
case(17:20)
v(ii)=2.0+(ii-17)*0.4+0.2
case(21:25)
v(ii)=4.0+(ii-21)*0.8+0.4
case(26:30)
v(ii)=8.0+(ii-26)*1.6+0.8
case(31:32)
v(ii)=16.0+(ii-31)*3.2+1.6
end select
do kk=1,32
dipu(ii,kk)=raindrop2(ii,kk)/(180*30*v(ii)*10.0)*1e6
dipu1(ii,kk)=raindrop2(ii,kk)/(180*30*10.0)*1e6
enddo
enddo
do kk=1,32
do ii=1,32
s(i,kk)=s(i,kk)+dipu(ii,kk)
s1(i,kk)=s1(i,kk)+dipu1(ii,kk)
enddo
dbz(i)=dbz(i)+(s(i,kk)*dia(kk)**6.)
inten(i)=inten(i)+pi/6*(s1(i,kk)*dia(kk)**3)*3600*1e-6
enddo
dbz(i)=10*log10(dbz(i))
!write(*,'(32i5)')s
!deallocate s
!write(20,*)
!deallocate(cc)
i=i+1
100 enddo
c 200 format(1024(f5,1x))
!write(*,*)cc(nn-1),nn
open(20,file='result-0827.txt')
write(*,'(a19)')(time1(iii),iii=1,i-1)
!write(20,'(a19,32(i5,1x))')(time1(iii),iii=1,i-1),
*! (s(iii,ii),ii=1,32),iii=1,i-1)
!(s(iii,ii),ii=1,32)),
*! iii=1,i-1)
write(20,*)' 时间 雨强 雨量 雷达发射率
* 能见度 每档粒子数'
do ik=1,i-1
write(20,'(a21,4x,4(a7,4x),32(f8.3,1x))')time1(ik),intensity(ik),
* precipitation(ik),radar(ik),visibility(ik),
* (s(ik,ii),ii=1,32)
write(40,'(a21,4x,2(a7,4x,f8.3,4x))')time1(ik),radar(ik),dbz(ik)
*,intensity(ik),inten(ik)
enddo
end
|
-
|