[Fortran] 纯文本查看 复制代码
subroutine read_obstacles(obst)
implicit none
include "head.inc"
EXTERNAL SUM
!EXTERNAL RANDOM_NUMBER
!integer k,l,m,n,P,Q,obst
integer k,l
integer m,n
integer P,Q
integer obst
complex h(k,l),z(obst),h1(k,l),z1(obst)
real*8 sum_1,sum_2,sum_3,random_number,F(P,Q),F1(P,Q)
do 11 k= 1, 300
do 10 l = 1, 300
F(P,Q)=0.675*0.675*(exp(-2.3*((k/50)*(k/50)+(l/10)*
& (l/10))**0.5))*((-1)**(2*k*P/300+2*l*Q/300))
if (k==(1,300).and.l==(1,300))then
F1(P,Q)=sum_1(F(P,Q))
end if
10 continue
11 continue
do 20 P=1,300
do 21 Q=1, 300
h(k,l)=1/90000*F1(P,Q)*(-1)**((k*P+l*Q)/150)
if (P==(1,300).and.Q==(1,300))then
h1(k,l)=sum_2(h(k,l))
end if
21 continue
20 continue
do 22 k= 1, 300
do 23 l = 1, 300
!call RANDOM_NUMBER
z(obst)=h1(k,l)*random_number
if (m==(1,300).and.n==(1,300))then
z1(obst)=sum_3(z(obst))
end if
23 continue
22 continue
end