24小时热门版块排行榜    

查看: 1287  |  回复: 5
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

astringent

铜虫 (著名写手)


[交流] 【求助】高手请进

调试正常,为什么运行的时候出现 segmentation fault,请大家帮忙看看,这个程序哪里有问题,我调试了很长时间,总是这个错误,请大家帮帮忙,不甚感激。
sum = 0


      open(nin,file='TRAJ1',status='old',form &
                ='unformatted')
      open(nout,file='cswb.out',form='formatted')
      open(21,file='check')
        call readmdinit (mdtype,nin)
      loop1:  do istep=1, nstep
               call readmd  &
                   (mdtype,nattot,nin,atomname,xxx,yyy,zzz,&
                   cell,resname,resindex)
               open(npdb,file='newsystem.pdb',status='old')
               call readpdb (atomname,npdb,nattot,resname,resindex)
               close(npdb)
! loop over all waters
               nhb=0

            loop2:   do i=1, nattot
                  if ((atomname(i).eq.' O  ').and.(resname(i).eq.'WAT')) then
                     io = i
                  loop3:   do j=1,2
                                ih=io+j

loop4:  do iat=1,nattot
                          if((resname(iat).eq.'DC5'.or.resname(iat).eq.'DC ').and.&
                              (atomname(iat).eq.' N1 '.or.atomname(iat).eq.' N4 '.or.&
                              atomname(iat).eq.' N3 '.or.atomname(iat).eq.' O2 '))   then
                              call findhbond &
                                   (io,ih,iat,xxx,yyy,zzz,nattot,cell,ihbnum)
                              if (ihbnum==1) then
                                  acc(j)=iat
                              else
                                 exit loop3
                              endif
                            endif
                        enddo loop4
                     enddo loop3
                    if (acc(1)*acc(2)/=0) then
                       if (resindex(acc(1)).ne.resindex(acc(2))+1 &
                         .or. resindex(acc(1)).ne. resindex(acc(2))-1) then
                            nhb=nhb+1
                        endif
                     endif
                endif
          enddo loop2
          sum=sum+nhb
        enddo loop1
        avgnhb=sum/nstep
        write (nout,*) ihbnum
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

astringent

铜虫 (著名写手)


问题已解决,不过感谢各位参与,没人赠送10个金币,呵呵。
5楼2010-12-15 02:36:51
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 6 个回答

heyansheng12345

银虫 (小有名气)


astringent(金币+10): 2010-12-15 02:35:40
主程序和子程序之间的连接可能有问题,不很清楚,帮顶个
2楼2010-12-14 13:44:36
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

zyj8119

木虫 (著名写手)


astringent(金币+10): 2010-12-15 02:35:31
引用回帖:
Originally posted by astringent at 2010-11-23 17:28:39:
调试正常,为什么运行的时候出现 segmentation fault,请大家帮忙看看,这个程序哪里有问题,我调试了很长时间,总是这个错误,请大家帮帮忙,不甚感激。
sum = 0


      open(nin,file='TRAJ1',status='ol ...

这个翻译过来,貌似叫做段错误。
3楼2010-12-14 13:47:15
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

cean

金虫 (职业作家)


astringent(金币+10): 2010-12-15 02:35:13
我前些天也遇到segmentation fault的问题,知道是肯定连接的不对.多变变连接的设置.

你的程序不全,没法试.光读不好调.
4楼2010-12-14 19:46:39
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 国自然评审意见 +10 wangmingqi 2026-08-28 12/600 2026-08-28 22:06 by water_still
[基金申请] 国自然面上复盘~欢迎讨论 (金币+15) +13 晴天加油 2026-08-26 14/700 2026-08-28 18:36 by huagongfeihu
[基金申请] 系统查不到 +11 董八千 2026-08-26 11/550 2026-08-28 18:06 by Leogzhya
[基金申请] 投票:  有多少人是今天查系统知道结果的? +16 爱看书的可乐 2026-08-26 18/900 2026-08-28 17:09 by winsaint
[教师之家] 导师吐槽:我怎么摊上了这么个极品研究生! +8 苏东坡二世 2026-08-23 8/400 2026-08-28 14:41 by lkforward
[基金申请] 基金不中,共勉 +11 eulota 2026-08-26 11/550 2026-08-28 14:22 by 火星超人xi
[基金申请] 麻烦专家们看看评委们的意见(F口面上) +4 gdd2018 2026-08-28 9/450 2026-08-28 14:22 by jklily
[基金申请] 面上合作单位盖章 +5 ssyjh 2026-08-27 5/250 2026-08-27 20:50 by gdfollow
[基金申请] 基金未中,这种答复是模板吗? +5 zhaosm1982 2026-08-27 6/300 2026-08-27 16:00 by lfy8008
[基金申请] 怎么看青基中了没有啊 +5 叶九微 2026-08-26 5/250 2026-08-27 10:35 by l_zh2008
[基金申请] 2026年8月25日国自然放榜前突然收到列入评审专家邮件,有关系吗? +25 木水思豆 2026-08-25 28/1400 2026-08-26 14:53 by draco1987
[基金申请] 能否退出参与的面上项目解除限项 +23 koalala 2026-08-24 26/1300 2026-08-26 14:29 by 宝贝虫子
[基金申请] 出来了 +9 trojank 2026-08-26 9/450 2026-08-26 14:25 by 宝贝虫子
[基金申请] 国际合作可查了,中了面上 (EPI+1)(金币+50) +18 Ldrop2023 2026-08-26 18/900 2026-08-26 11:15 by cmrandy
[基金申请] 今天务委会开完了,明天出结果吗 +19 angus9576 2026-08-25 23/1150 2026-08-26 10:03 by zp519
[基金申请] 国合现在查不到了吗? +10 chengyan1220 2026-08-24 20/1000 2026-08-26 08:57 by peasantsprig
[基金申请] 牛来!米来!面来! +8 beefly 2026-08-26 8/400 2026-08-26 08:37 by xuzhipiao
[基金申请] 明天应该可查了!? +6 chengyan1220 2026-08-23 6/300 2026-08-25 19:45 by zfd97
[基金申请] 某些机构,以效率低为荣,以效率低作为存在感 +9 yuleib84 2026-08-25 10/500 2026-08-25 17:14 by alexon
[基金申请] 没有任何消息-是不是就凉了 +9 图啦图啦 2026-08-24 10/500 2026-08-25 11:59 by 南海小哥
信息提示
请填处理意见