| 查看: 344 | 回复: 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 |
» 猜你喜欢
参与限项
已经有3人回复
假如你的研究生提出不合理要求
已经有7人回复
实验室接单子
已经有4人回复
全日制(定向)博士
已经有4人回复
对氯苯硼酸纯化
已经有3人回复
求助:我三月中下旬出站,青基依托单位怎么办?
已经有12人回复
不自信的我
已经有12人回复
所感
已经有4人回复
要不要辞职读博?
已经有7人回复
北核录用
已经有3人回复
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












回复此楼