24小时热门版块排行榜    

北京石油化工学院2026年研究生招生接收调剂公告
查看: 461  |  回复: 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
回复此楼
相信自己,只能靠自己
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

seaso

金虫 (正式写手)

【答案】应助回帖

感谢参与,应助指数 +1
输入参数和初始化

[ 发自手机版 http://muchong.com/3g ]
2楼2012-02-20 19:44:18
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 zhanwentao 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 413求调剂 +3 柯某某 2026-03-31 3/150 2026-04-02 16:59 by zzsw+
[考研] 材料340分调剂 +6 夏夜晚风_long 2026-04-02 8/400 2026-04-02 16:48 by yunlongyang
[考研] 301求调剂 +4 细胞相关蛋白 2026-04-02 8/400 2026-04-02 16:30 by 271179835
[考研] 326求调剂 +3 崽崽仔 2026-04-02 3/150 2026-04-02 14:54 by 1753564080
[考研] 一志愿南师大0703化学 275求调剂 +6 Ripcord上岸 2026-03-27 6/300 2026-04-02 11:19 by TTTpp
[考研] 324求调剂 +5 想上学求调 2026-04-01 6/300 2026-04-02 10:16 by sanrepian
[考研] 求调剂推荐 材料 304 +21 荷包蛋hyj 2026-03-26 21/1050 2026-04-01 21:09 by lijunpoly
[考研] 290求调剂 +5 dfffsar 2026-03-29 5/250 2026-04-01 19:45 by 6781022
[考研] 材料科学与工程339求调剂 +11 hyz0119 2026-03-31 12/600 2026-04-01 18:40 by 伟大河北
[考研] 求调剂 +4 图鉴212 2026-03-30 5/250 2026-04-01 15:32 by 图鉴212
[考研] 0710生物学求调剂! +6 叙述文 2026-03-31 6/300 2026-04-01 09:39 by JourneyLucky
[考研] 0856材料化工调剂 总分330 +18 zhubinhao 2026-03-27 18/900 2026-04-01 09:37 by oooqiao
[考研] 材料科学与工程求调剂 +13 深V宿舍吧 2026-03-29 13/650 2026-03-31 19:50 by Dyhoer
[考研] 263求调剂 +3 DDDDuu 2026-03-27 3/150 2026-03-31 16:21 by 土木硕士招生
[考研] 282求调剂 不挑专业 求收留 +4 Yam. 2026-03-30 5/250 2026-03-31 14:41 by 王亮_大连医科大
[考研] 282求调剂 +3 呼吸都是减肥 2026-03-31 3/150 2026-03-31 10:00 by wangjy2002
[考研] 11408总分309,一志愿东南大学求调剂,不挑专业 +5 天赋带到THU 2026-03-29 6/300 2026-03-30 20:49 by dick_runner
[考研] 求调剂 +7 青春裁为三截 2026-03-29 7/350 2026-03-30 13:14 by laoshidan
[考研] 求调剂 +7 争取九点睡 2026-03-28 8/400 2026-03-28 21:07 by 争取九点睡
[考研] 324求调剂 +5 hanamiko 2026-03-26 5/250 2026-03-27 10:33 by wangjy2002
信息提示
请填处理意见