24小时热门版块排行榜    

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

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的回帖

astringent

铜虫 (著名写手)


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

pjhxmc

铁虫 (初入文坛)



小木虫: 金币+0.5, 给个红包,谢谢回帖
引用回帖:
5楼: Originally posted by astringent at 2010-12-15 02:36:51
问题已解决,不过感谢各位参与,没人赠送10个金币,呵呵。

楼主问题是怎么解决的呀?
6楼2015-04-27 15:22:45
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 astringent 的主题更新
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考博] 售SCI一区T0P文章,我:8.O.55.1.O54,科目全,可伽急 +3 ASdOkHsho7FD 2026-08-28 5/250 2026-08-29 09:49 by G6APbkg8SA6w
[硕博家园] 售SCI一区文章,我:8.O.55.1.O.54,科目齐全,可伽急 +4 ASdOkHsho7FD 2026-08-28 7/350 2026-08-29 09:38 by G6APbkg8SA6w
[基金申请] 投票:  有多少人是今天查系统知道结果的? +16 爱看书的可乐 2026-08-26 18/900 2026-08-29 09:36 by winsaint
[基金申请] 国自然评审意见 +12 wangmingqi 2026-08-28 17/850 2026-08-29 08:43 by appleren
[基金申请] 有没有仍没收到信息的 +3 德尚中行 2026-08-27 3/150 2026-08-28 15:24 by rongshuxia
[教师之家] 导师吐槽:我怎么摊上了这么个极品研究生! +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
[基金申请] 怎么查啊 +6 huang1991js 2026-08-26 6/300 2026-08-28 08:42 by winsaint
[基金申请] 申请删除本帖 +6 lyz123lyz 2026-08-27 7/350 2026-08-27 17:31 by 宁静致远sy
[基金申请] 看板上这么多中的,有点像50人群里49个人都是骗子的那种感觉…… +5 a089 2026-08-26 6/300 2026-08-27 14:05 by jonewore
[基金申请] 为什么 国际(地区)合作与交流项目 没有放榜? 10+3 majunge000 2026-08-26 11/550 2026-08-27 08:42 by 北京莱茵编辑
[基金申请] 2026年8月25日国自然放榜前突然收到列入评审专家邮件,有关系吗? +25 木水思豆 2026-08-25 28/1400 2026-08-26 14:53 by draco1987
[基金申请] 为什么国自然不能直接公布 +4 bjdxyxy 2026-08-26 4/200 2026-08-26 13:12 by qingmu1201
[基金申请] 国际合作可查了,中了面上 (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
[基金申请] 国合可查了 +3 paperzjh 2026-08-26 3/150 2026-08-26 10:41 by LemmonTr
[基金申请] 国合现在查不到了吗? +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
[基金申请] 在坚冰还盖着北海的时候,我看到了怒放的梅花。 (金币+10) +6 ziyangfang 2026-08-25 9/450 2026-08-25 20:26 by huagongfeihu
[基金申请] 明天应该可查了!? +6 chengyan1220 2026-08-23 6/300 2026-08-25 19:45 by zfd97
信息提示
请填处理意见