| 查看: 361 | 回复: 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 |
» 猜你喜欢
过年走亲戚时感受到了所开私家车的鄙视链
已经有10人回复
今年春晚有几个节目很不错,点赞!
已经有12人回复
情人节自我反思:在爱情中有过遗憾吗?
已经有13人回复
体制内长辈说体制内绝大部分一辈子在底层,如同你们一样大部分普通教师忙且收入低
已经有12人回复
基金正文30页指的是报告正文还是整个申请书
已经有5人回复
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













回复此楼