|
|
[求助]
DLA模型,Fortran 代码,出现问题
一个DLA模型的Fortran代码,能编译,能运行,但是出来的结构不对。画出的图形除了中间有点外,四个角上也有点存在,不知道哪里有问题。希望各位虫友看看,不胜感激!
program dla
implicit none
parameter M=100
parameter N=100
parameter Particles=2000
integer :: A(M,N)
integer :: i, j, counter, p
real(4):: s, num1, num2, num3
open (30,file="dla2d.dat"
do i =1, M
do j=1, N
A(i,j)=0
enddo
enddo
A(50,50)=1
counter=0
do while (counter .LT. Particles)
counter=counter+1
write (*,*) 'Current Particles is ', counter
call random_number(num1)
i=1+int(num1*(N-1))
call random_number(num2)
j=1+int(num2*(N-1))
p=0
55 do while (p.EQ.0)
call random_number(num3)
s = num3
if(s.LE.0.25) then
j=j+1
elseif(s.LE.0.50) then
j=j-1
elseif(s.LE. 0.75) then
i=i+1
else
i=i-1
endif
if (j.EQ.N+1) then
j=1
goto 55
endif
if (j.EQ.0) then
j=N
goto 55
endif
if (i .EQ. M+1) then
i=1
goto 55
endif
if (i.EQ.0) then
i=M
goto 55
endif
if(A(i,j-1).EQ.1.OR.A(i,j+1).EQ.1.OR.A(i+1,j).EQ.1.OR.A(i-1,j).EQ.1) then
A(i,j)=1
write(30,*) i, j
p=10
endif
enddo
enddo
end program dla
![]()
DLA结果 |
» 本帖已获得的红花(最新10朵)
» 猜你喜欢
售SCI-T0P文章,我:8O.5.5.1.O.54,科目齐全,可+急
已经有13人回复
售SCI-T0P文章,我:8O.5.5.1.O.54,科目齐全,可+急
已经有18人回复
售SCI一区T0P文章,我:8.O.55.1.O.5.4,科目全,可+急
已经有18人回复
2027博士申请-临床检验诊断学、病原生物学、微生物方向
已经有4人回复
售SCI一区T0P文章,我:8.O.55.1.O.54,科目齐全,可+急
已经有10人回复
售SCI文章,我:8O.5.5.1O.54,科目全,可十急
已经有22人回复
越来越担心硕士毕业后没有竞争力了
已经有14人回复
论文的挂名怎么评判贡献?基金申请中,排名第一的挂名文章
已经有3人回复
申博自荐 2篇一区TOP+1篇EI+2公开发明专利 2027博士申请
已经有3人回复
闲聊
已经有6人回复
» 本主题相关价值贴推荐,对您同样有帮助:
|