| 查看: 404 | 回复: 1 | |||
astringent铜虫 (著名写手)
|
[交流]
【求助】segmentation fault 已有1人参与
|
|
when i execute the following program, segmentation fault always occur. program main -- 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 ')).or.& ((resname(iat).eq.'DG3'.or.resname(iat).eq.'DG ').and.& (atomname(iat).eq.' N9 '.or.atomname(iat).eq.' N7 '.or.& atomname(iat).eq.' O6 '.or.atomname(iat).eq.' N1 '.or.& atomname(iat).eq.' N2 '.or.atomname(iat).eq.' N3 ')).or.& ((resname(iat).eq.'DA ').and.(atomname(iat).eq.' N9 '.or.& atomname(iat).eq.' N7 '.or.atomname(iat).eq.' N6 '.or.& atomname(iat).eq.' N1 '.or.atomname(iat).eq.' N3 ')).or.& ((resname(iat).eq.'DT ').and.(atomname(iat).eq.' N1 '.or.& atomname(iat).eq.' O4 '.or.atomname(iat).eq.' N3 '.or.& atomname(iat).eq.' O2 '))) then call findhbond & (io,ih,iat,xxx,yyy,zzz,nattot,cell,ihbnum) if(ihbnum.eq.1) then acc(j)=iat else goto 200 endif endif enddo enddo if (acc(1)*acc(2)/=0) then if ((resindex(acc(1))/=resindex(acc(2))+1).or. & (resindex(acc(1))/=resindex(acc(2))-1)) then nhb=nhb+1 endif endif 200 continue endif enddo sum=sum+nhb enddo avgnhb=sum/nstep write (nout,*) 'average cswb number is', avgnhb close(nout) end how to solve this problem? thanks |
» 猜你喜欢
这种情况还有戏吗
已经有11人回复
微信指数没变化,科研之友没阅读
已经有4人回复
同事接到电话了,我却没有
已经有4人回复
准备明年的基金了
已经有5人回复
今年的WR进展到哪一步了?
已经有6人回复
时间戳他又来了
已经有11人回复
小木虫看见有人已经知道结果了
已经有15人回复
这个自发加氧反应的机理是什么?
已经有6人回复
J-J-W不为人知的一面
已经有18人回复
没消息就是被刷了呗
已经有13人回复
astringent
铜虫 (著名写手)
- 应助: 16 (小学生)
- 金币: 2210.7
- 散金: 1233
- 红花: 4
- 帖子: 1180
- 在线: 354.8小时
- 虫号: 900839
- 注册: 2009-11-12
- 专业: 理论和计算化学
|
this is my program, the last is wrong. program main open(nin,file='TRAJ1',status='old',form & ='unformatted') open(nout,file='cswb.out',form='formatted') open(21,file='check') call readmdinit (mdtype,nin) nhb = 0 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) sum=0 do i=1, nattot if((atomname(i).eq.' O ').and.(resname(i).eq.'WAT')) then io = i do j=1,2 acc(j)=0 ih=io+j 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 ')).or.& ((resname(iat).eq.'DG3'.or.resname(iat).eq.'DG ').and.& (atomname(iat).eq.' N9 '.or.atomname(iat).eq.' N7 '.or.& atomname(iat).eq.' O6 '.or.atomname(iat).eq.' N1 '.or.& atomname(iat).eq.' N2 '.or.atomname(iat).eq.' N3 ')).or.& ((resname(iat).eq.'DA ').and.(atomname(iat).eq.' N9 '.or.& atomname(iat).eq.' N7 '.or.atomname(iat).eq.' N6 '.or.& atomname(iat).eq.' N1 '.or.atomname(iat).eq.' N3 ')).or.& ((resname(iat).eq.'DT ').and.(atomname(iat).eq.' N1 '.or.& atomname(iat).eq.' O4 '.or.atomname(iat).eq.' N3 '.or.& atomname(iat).eq.' O2 '))) then call findhbond & (io,ih,iat,xxx,yyy,zzz,nattot,cell,ihbnum) if(ihbnum.eq.1) then acc(j)=iat else goto 200 endif endif enddo enddo if (acc(1)*acc(2)/=0) then if ((resindex(acc(1))/=resindex(acc(2))+1).or. & (resindex(acc(1))/=resindex(acc(2))-1)) then nhb=nhb+1 endif endif 200 continue endif enddo sum=sum+nhb enddo avgnhb=sum/nstep write (nout,*) 'average cswb number is |
2楼2010-11-22 18:36:45











回复此楼