24小时热门版块排行榜    

查看: 1283  |  回复: 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的回帖

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的回帖
查看全部 6 个回答

heyansheng12345

银虫 (小有名气)


astringent(金币+10): 2010-12-15 02:35:40
主程序和子程序之间的连接可能有问题,不很清楚,帮顶个
2楼2010-12-14 13:44:36
已阅   回复此楼   关注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的回帖

astringent

铜虫 (著名写手)


问题已解决,不过感谢各位参与,没人赠送10个金币,呵呵。
5楼2010-12-15 02:36:51
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 投票:  有多少人是今天查系统知道结果的? +16 爱看书的可乐 2026-08-26 18/900 2026-08-28 15:41 by winsaint
[教师之家] 导师吐槽:我怎么摊上了这么个极品研究生! +8 苏东坡二世 2026-08-23 8/400 2026-08-28 14:41 by lkforward
[基金申请] 基金系统什么内容也没有 30+4 winsaint 2026-08-27 9/450 2026-08-28 11:06 by maolC
[基金申请] 为什么资助数各大高校都创新高,自己申请怎么就这么难 +10 Kittylucky 2026-08-27 11/550 2026-08-28 10:45 by Kittylucky
[基金申请] 哪位高人中了,把查询到的截图贴出来让我看看,让我长长见识 +5 yuleib84 2026-08-26 6/300 2026-08-28 00:02 by yudaoqian88
[基金申请] 面上合作单位盖章 +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
[基金申请] 为什么 国际(地区)合作与交流项目 没有放榜? 10+3 majunge000 2026-08-26 11/550 2026-08-27 08:42 by 北京莱茵编辑
[基金申请] 系统查不到 +10 董八千 2026-08-26 10/500 2026-08-26 16:30 by Equinoxhua
[基金申请] 2026国自然函评费到账 +22 羊腰板 2026-08-21 25/1250 2026-08-26 15:00 by zuocuiping
[基金申请] 为什么国自然不能直接公布 +4 bjdxyxy 2026-08-26 4/200 2026-08-26 13:12 by qingmu1201
[基金申请] 国合里面能看到了 +7 一怀馨秋 2026-08-26 7/350 2026-08-26 11:23 by zhaosm1982
[基金申请] 国际合作可查了,中了面上 (EPI+1)(金币+50) +18 Ldrop2023 2026-08-26 18/900 2026-08-26 11:15 by cmrandy
[基金申请] 系统进不去 +4 yanglien 2026-08-26 5/250 2026-08-26 11:10 by wenfengw83
[基金申请] 项目信息和经费信息在系统里都可以看到了 +6 wittyboy 2026-08-26 14/700 2026-08-26 10:55 by wittyboy
[基金申请] 国合可查了 +3 paperzjh 2026-08-26 3/150 2026-08-26 10:41 by LemmonTr
[基金申请] 今天务委会开完了,明天出结果吗 +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
[基金申请] 在坚冰还盖着北海的时候,我看到了怒放的梅花。 (金币+10) +6 ziyangfang 2026-08-25 9/450 2026-08-25 20:26 by huagongfeihu
信息提示
请填处理意见