| 查看: 427 | 回复: 1 | ||
zhanwentao铜虫 (初入文坛)
|
[求助]
麻烦各位解释一下这个Fortran程序
|
|
c input the parameter and initiate array write(*,*) 'input the parameters:' write(*,*) 'ps,u,thrham,LT:' read (*,*) ps,u,thrham,LT print *, ps,u,thrham,LT print *,'number=',N ,' 2K=',2*k pt=1 pr=1 do j2=0,M mdensity(j2)=0 mvnum(j2)=0 mavn(j2)=0 mr(j2)=0 enddo do jp=1,njp print *,jp iseed=13251*jp useed=ustart(iseed) 10 do i=1,N do j=1,NK link(i,j)=0 enddo enddo do i=1,N nlink(i)=2*K enddo c construct N vertice and 2K nearest neighbour edges regular network do i=1,N do j=1,k if((i+j).gt.n) then link(i,j)=i+j-n else link(i,j)=i+j endif enddo do j=k+1,(2*k) if((i+k-j).le.0) then link(i,j)=i+k-j+n else link(i,j)=i+k-j endif enddo enddo c construct the probability ps small world network do i=1,N do j=1,K p=uni() if(p.lt.ps) then 20 lc=nint(uni()*(n-1))+1 do j1=1,nlink(i) if(link(i,j1).eq.lc) goto 20 enddo nlink(lc)=nlink(lc)+1 if(nlink(lc).gt.NK) then goto 10 endif link(lc,nlink(lc))=i link(i,j)=0 endif enddo enddo c save the num of nearest neighbour of the i vertice do i=1,N j1=0 do j=1,Nlink(i) if(link(i,j).gt.0) then j1=j1+1 link(i,j1)=link(i,j) endif enddo nlink(i)=j1 enddo c sum the num(i) to check the program nlink(0)=0 do i=1,N nlink(0)=nlink(0)+nlink(i) enddo if(nlink(0).ne.(2*N*K)) then print *,'return to debug the program!' endif do i=1,N if(nlink(i).le.0) then print *,'reconstruct the network!' goto 10 endif enddo |
» 猜你喜欢
导师想让我从独立一作变成了共一第一
已经有8人回复
博士读完未来一定会好吗
已经有23人回复
到新单位后,换了新的研究方向,没有团队,持续积累2区以上论文,能申请到面上吗
已经有11人回复
读博
已经有4人回复
JMPT 期刊投稿流程
已经有4人回复
心脉受损
已经有5人回复
Springer期刊投稿求助
已经有4人回复
小论文投稿
已经有3人回复
申请2026年博士
已经有6人回复
» 本主题相关价值贴推荐,对您同样有帮助:
在linux下编FORTRAN程序
已经有14人回复
如何改变fortran的浮点精度
已经有28人回复
求助计算机高人,编写个Fortran程序
已经有13人回复
请教一个fortran小程序编译出错的问题,谢谢
已经有9人回复
有关fortran的一次而问题,希望大家能帮帮忙,谢谢
已经有4人回复
写了一个fortran90的小程序,编译通不过,请大侠帮忙
已经有59人回复
【求助】如何写FORTRAN程序实现求平均最近邻距离
已经有34人回复
【求助】用fortran怎么描述下面这样的情况,我是新手,请大家帮忙
已经有8人回复
【求助】初学fortran,
已经有15人回复
【求助】请问一下fortran的可视化编程
已经有7人回复
【分享】C/C++常用算法设计方法,fortran其他语言编程也可以参考下
已经有8人回复
【交流】Fortran语言答疑专帖
已经有157人回复

seaso
金虫 (正式写手)
- 应助: 5 (幼儿园)
- 金币: 1317.3
- 帖子: 379
- 在线: 458.5小时
- 虫号: 1443545
- 注册: 2011-10-15
- 专业: 凝聚态物性 II :电子结构
2楼2012-02-20 19:44:18













回复此楼