24小时热门版块排行榜    

查看: 1279  |  回复: 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 的主题更新
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 什么时候开奖? +10 CrisMessi 2026-08-18 11/550 2026-08-24 06:50 by 开心的小狮子
[基金申请] 范进中举一文的中心思想 +5 炎黄贵胄 2026-08-22 6/300 2026-08-24 06:34 by sincosx
[基金申请] 建议基金发布提前给出明确的时间点 +11 kulium 2026-08-21 14/700 2026-08-24 02:12 by 流流伤
[基金申请] 2026国自然函评费到账 +16 羊腰板 2026-08-21 17/850 2026-08-23 23:02 by tianxiaochun
[基金申请] 2026年的国家社科基金项目通讯评审的新规则与新动向、新挑战 +4 process2012 2026-08-23 5/250 2026-08-23 19:58 by jurkat.1640
[教师之家] 跳槽后在研项目怎么办? +5 简单化xn 2026-08-22 10/500 2026-08-23 12:38 by 简单化xn
[基金申请] 93BebMhtakh前后11位开头都是大写 +7 且听虎啸 2026-08-17 8/400 2026-08-22 21:55 by 医学老男孩
[基金申请] 人气不行了 +8 fansofjerry 2026-08-21 8/400 2026-08-22 16:30 by zyqchem
[基金申请] 今天基金会出结果吗?20260819 +16 kkkl_v 2026-08-19 17/850 2026-08-22 16:12 by 阿布Abu
[基金申请] 时间戳今天,20号变了 +5 archvillain 2026-08-20 5/250 2026-08-22 06:12 by hui_daxiao
[基金申请] 放榜前的不淡定 40+4 snowwithsea 2026-08-19 14/700 2026-08-21 23:51 by cratir
[基金申请] 科研孤儿太难了 +17 我4大白菜 2026-08-20 18/900 2026-08-21 20:57 by zhangev
[基金申请] 看来今天不会放榜了? +8 chengyan1220 2026-08-21 11/550 2026-08-21 17:52 by dcqxinyang
[基金申请] 时间戳又变了 +13 wuchongjun 2026-08-20 19/950 2026-08-21 17:21 by 紫杉醇
[基金申请] 感觉是下周放榜了 +7 angus9576 2026-08-17 12/600 2026-08-21 13:38 by weiyin
[基金申请] 应该是下周三26日公布了吧? +4 哈哈蛤? 2026-08-21 4/200 2026-08-21 10:58 by Vivilian
[基金申请] 基金啊基金 +4 longfie172 2026-08-20 4/200 2026-08-21 08:58 by mark mao
[基金申请] 估计是周四 +3 archvillain 2026-08-18 3/150 2026-08-21 01:48 by jnhyjjm
[基金申请] 时间戳变了,能看出什么问题? +18 基诺咪客 2026-08-17 23/1150 2026-08-20 17:19 by Godzela
[基金申请] 重要消息,中午系统在维护 +11 yuleib84 2026-08-18 12/600 2026-08-20 11:09 by xskun
信息提示
请填处理意见