±±¾©Ê¯ÓÍ»¯¹¤Ñ§Ôº2026ÄêÑо¿ÉúÕÐÉú½ÓÊÕµ÷¼Á¹«¸æ
²é¿´: 2845  |  »Ø¸´: 6
µ±Ç°Ö»ÏÔʾÂú×ãÖ¸¶¨Ìõ¼þµÄ»ØÌû£¬µã»÷ÕâÀï²é¿´±¾»°ÌâµÄËùÓлØÌû

astringent

Í­³æ (ÖøÃûдÊÖ)

[½»Á÷] ¡¾ÇóÖú¡¿ÔÚ±àÒëʱ³ö´í ÒÑÓÐ5È˲ÎÓë

when i execute the program, the following error appear:

At line 111 of file readmd.f90 (unit = 20, file = 'TRAJ1')
Fortran runtime error: I/O past end of record on unformatted file

How can solve this, please help me, thanks.
»Ø¸´´ËÂ¥

» ²ÂÄãϲ»¶

» ±¾Ö÷ÌâÏà¹Ø¼ÛÖµÌùÍÆ¼ö£¬¶ÔÄúͬÑùÓаïÖú:

ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

gd88

½ð³æ (СÓÐÃûÆø)

¡ï ¡ï ¡ï
Сľ³æ(½ð±Ò+0.5):¸ø¸öºì°ü£¬Ð»Ð»»ØÌû½»Á÷
nono2009(½ð±Ò+2):¹ÄÀøÓ¦Öú 2010-11-17 10:14:06
LZ£¬½ñÌìFortranµÄÎÊÌâС±¬·¢Å¶¡£

´Ó´íÎóÐÅÏ¢À´¿´£¬TRAJ1Õâ¸öÎļþ£¬¸ñʽ´íÎó¡£

Áí£¬Äã¶ÁÈ¡Êý¾ÝµÄ³ÌÐò£¬ÓÃF90µÄÂð£¿
ÄÇô£¬open(nin,file='TRAJ1',status='old'
ÀïÃæµÄ  old
FortranµÄ±ê×¼Õâô¶àÄê¿ÉÒÔÊDZ仯µÄ£¬
ÄãÏÈÁ˽âһϠ f90 ºÍ f77 µÄ²»Í¬°Ñ£¬¸ñʽ·½Ãæ¡£
5Â¥2010-11-17 02:03:42
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
²é¿´È«²¿ 7 ¸ö»Ø´ð

zyj8119

ľ³æ (ÖøÃûдÊÖ)

ÒýÓûØÌû:
Originally posted by astringent at 2010-11-15 19:23:32:
when i execute the program, the following error appear:

At line 111 of file readmd.f90 (unit = 20, file = 'TRAJ1')
Fortran runtime error: I/O past end of record on unformatted file

How can s ...

ÎÞÔ´´úÂëÎÞÕæÏà¡£¡£
ºÃºÃѧϰ£¬ÌìÌìÏòÉÏ¡£
2Â¥2010-11-15 22:02:38
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

astringent

Í­³æ (ÖøÃûдÊÖ)

Õâ¸öÊÇÔ´Îļþ
open(nin,file='TRAJ1',status='old',form &
                ='unformatted')
      open(nout,file='csbw.out')
        do istep=1, nstep   
               call readmdinit (mdtype,nin)
               call readmd  &
                   (mdtype,nattot,nin,atomname,xxx,yyy,zzz,cell)

! loop over all waters

          do i=1, nattot
              if (('atomname'.eq.'O').and.('resname'.eq.'WAT')) then
                    io = i
                    ih1 = io+1
                    ih2 = io+2
              call test &
               (io,ih1,ia1,xxx,yyy,zzz,nattot,cell,atomname,resname,ihbnum)
                  if (ihbnum.eq.1)   then
                       acc(j)=ia1
                        call test  &
                    (io,ih2,ia2,xxx,yyy,zzz,nattot,cell, &
                     atomname,resname,ihbnum)
                        if (ihbnum.eq.1)   then
                             if (resindex(ia1).eq.resindex(ia2)+1 &
                               .or. resindex(ia1).eq. resindex(ia2)-1) then
                            write(*,*) 'not find a cswb'
                            else
                            write(*,*) 'find a cswb'
                            nhb=nhb+1  
                            endif
                        endif
                   endif
                 endif
              enddo
           sum=sum+nhb
          do j=1,nattot
          write (nout,"('acceptor is',i2)" acc(j)
          enddo
            enddo
          avgnhb=sum/nstep
          write (nout,"('avergaed number is',i2)" avgnhb
          close(nout)
         end
3Â¥2010-11-16 03:01:44
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

astringent

Í­³æ (ÖøÃûдÊÖ)

astringent  
гæ (СÓÐÃûÆø)



³ÌÐòÇ¿Ìû: 0
½ð±Ò: 72.5
Ìû×Ó: 112
ÔÚÏß: 14.9Сʱ
³æºÅ: 900839
×¢²á: 2009-11-12
״̬: ÔÚÏß
       
ÏÂÃæÊǸ÷¸ö×Ó³ÌÐò
subroutine findhbond &
          (io,ih,iat,xxx,yyy,zzz,nattot,cell,ihbnum)

      implicit none
      include 'constants.h'

      integer io,ih,iat,nattot,ihbnum
      double precision xxx(nattot),yyy(nattot),zzz(nattot)
      double precision cell(3)
      double precision theta,thetamax,roamax,rhamax
      double precision dx0,dy0,dz0,r0
      double precision dx1,dy1,dz1,r1
      double precision dx2,dy2,dz2,r2

      thetamax = 30.d0
      roamax = 3.5d0
      rhamax = 2.45d0
      ihbnum = 0

      call bondcalculation(io,ih,xxx,yyy,zzz,nattot,cell,dx0,dy0,dz0,r0)
      call bondcalculation(io,iat,xxx,yyy,zzz,nattot,cell,dx1,dy1,dz1,r1)
           if (r1.lt.roamax) then
              theta = dacos(dx0*dx1+dy0*dy1+dz0*dz1)
                  if(theta.lt.thetamax) then
                      call bondcalculation &
                         (ih,iat,xxx,yyy,zzz,nattot,cell,dx2,dy2,dz2,r2)
                        if (r2.lt.rhamax) then
                              ihbnum = 1
                        endif
                   endif
           endif
                 
      return
      end
subroutine test &
          (io,ih,ia,xxx,yyy,zzz,nattot,cell,atomname,resname,ihbnum)

      implicit none
      include 'constants.h'

      integer io,ih,ia,nattot,ihbnum
      double precision xxx(nattot),yyy(nattot),zzz(nattot)
      double precision cell(*)
      character*4 atomname(nattot),resname(nattot)

      integer iat

      ia = 0
      ihbnum = 0

      do iat=1, nattot
         if((('resname'.eq.'DC5').or.('resname'.eq.'DC')).and.&
          ('atomname'.eq.'N1'.or.'atomname'.eq.'N4'.or.'atomname'.eq.'N3'&
                &.or.'atomname'.eq.'O2')) then
                  call findhbond &
                   (io,ih,iat,xxx,yyy,zzz,nattot,cell,ihbnum)

          elseif (('resname'.eq.'DG3'.or.'resname'.eq.'DG').and.&
               &('atomname'.eq.'N9'.or.'atomname'.eq.'N7'.or.'atomname'.eq.&
                  &'O6'.or.'atomname'.eq.'N1'.or.'atomname'.eq.'N2'&
                &.or.'atomname'.eq.'N3')) then
              call findhbond &
                   (io,ih,iat,xxx,yyy,zzz,nattot,cell,ihbnum)

         elseif (('resname'.eq.'DA').and.('atomname'.eq.'N9'.or.&
               'atomname'.eq.'N7'.or.'atomname'.eq.  &
              'N6'.or.'atomname'.eq.'N1'&
                &.or.'atomname'.eq.'N3')) then
              call findhbond  &
                   (io,ih,iat,xxx,yyy,zzz,nattot,cell,ihbnum)

         elseif (('resname'.eq.'DT').and.('atomname'.eq.'N1'.or. &
              'atomname'.eq.'O4'.or.'atomname' &
               .eq.'N3'.or.'atomname'.eq.'O2')) then
              call findhbond &
                   (io,ih,iat,xxx,yyy,zzz,nattot,cell,ihbnum)
          endif
          if (ihbnum.eq.1) then
            ia=iat
          endif
         enddo
      
      return
      end
  subroutine bondcalculation &
          (i1,i2,xxx,yyy,zzz,nattot,cell,dx,dy,dz,roh)

      implicit none
      integer i1,i2,nattot
      double precision xxx(nattot),yyy(nattot),zzz(nattot)
      double precision cell(3),dx,dy,dz
      double precision xo,yo,zo,xh,yh,zh,roh

      xo = xxx(i1)
      yo = yyy(i1)
      zo = zzz(i1)
      xh = xxx(i2)
      yh = yyy(i2)
      zh = zzz(i2)
      dx = xh - xo
      dy = yh - yo
      dz = zh - zo
      dx = dx - anint(dx/cell(1))*cell(1)
      dy = dy - anint(dy/cell(2))*cell(2)
      dz = dz - anint(dz/cell(3))*cell(3)
      roh = dsqrt(dx**2+dy**2+dz**2)
      dx = dx / roh
      dy = dy / roh
      dz = dz / roh
      return
      end

subroutine readmd  &
          (mdtype,nattot,nin,atomname,xxx,yyy,zzz,cell)

      implicit none
      integer mdtype,nattot,nin
      double precision :: xxx(nattot),yyy(nattot),zzz(nattot)
      real*4 :: x_dcd(nattot),y_dcd(nattot),z_dcd(nattot)
      double precision cell(3)
      character*4 atomname(nattot)
      
      integer iatm,i
      double precision xtable(6)

      integer                             ::npdb=70
      
      if (mdtype.eq.0) then         ! original TINKER
         read(nin,*)
         do iatm=1, nattot
            read(nin,'(i6,2x,a2,x,3f12.6)')i,atomname(iatm),xxx(iatm),&
                yyy(iatm),zzz(iatm)
         enddo
      elseif (mdtype.eq.1) then     ! modified TINKER      
         read(nin,*)
         read(nin,*)
         do iatm=1, nattot
            read(nin,'(a2,9x,6f12.4)')atomname(iatm),xxx(iatm), &
                 yyy(iatm), zzz(iatm)
         enddo
      elseif ((mdtype.eq.2).or.(mdtype.eq.3)) then
      !  DLPOLY
         read(nin,*)
         read(nin,*)
         read(nin,*)
         read(nin,*)
         do iatm=1, nattot
            read(nin,'(a2,x,6f10.5)')atomname(iatm),xxx(iatm), &
                yyy(iatm), zzz(iatm)         
         enddo        
      elseif (mdtype.eq.4) then
      !   Orsay - FX COUDERT
         read(nin,*)
         read(nin,*)
         do iatm=1, nattot
            read(nin,'(2x,a2,6x,3f14.5)')atomname(iatm),xxx(iatm),&
              yyy(iatm),zzz(iatm)
         enddo        
      elseif (mdtype.eq.5) then
     !  xyz
         read(nin,*)
         read(nin,*)
         do iatm=1, nattot
            read(nin,'(a2,8x,3f12.4)')atomname(iatm),xxx(iatm),&
       yyy(iatm),zzz(iatm)
         enddo        

      elseif (mdtype.eq.6) then
  !    dcd binary
             read(nin) (xtable(i),i=1,6)
             read(nin) (x_dcd(i),i=1,nattot)
             read(nin) (y_dcd(i),i=1,nattot)
             read(nin) (z_dcd(i),i=1,nattot)
            

             cell(1)=xtable(1)
             cell(2)=xtable(3)
             cell(3)=xtable(6)


             OPEN(npdb,file='system.pdb',status='old')
             call read_pdb(atomname,npdb,nattot)


             CLOSE(npdb)

! send from single precision to double

             do i=1,nattot
                xxx(i)=x_dcd(i)
                yyy(i)=y_dcd(i)
                zzz(i)=z_dcd(i)
             enddo
            
      
      endif


      return
      end


      subroutine readmdinit(mdtype,nin)
         
      implicit none
      integer mdtype,nin

! local variables --------------

      integer      ntitle,nset,istart,icntrl(6),jcntrl(9)
      character*80 title(10)
      character*4 hdr
      double precision       delta
      integer      i,nfr,dfr,natms



      if (mdtype.eq.3) then
         read(nin,*)
         read(nin,*)
      elseif(mdtype.eq.6) then
         read(nin) hdr,nfr,istart,dfr,(icntrl(i),i=1,6),delta,(jcntrl(i) &
            ,i=1,9)         
         read(nin) ntitle,(title(i),i=1,ntitle)
         read(nin) natms
      endif

      return
      end



      subroutine read_pdb(atomname,n,nattot)
      
      integer                                            ::n,nattot
      character(len=4),dimension(nattot),intent(inout)   ::atomname
      character(len=4),dimension(nattot)                 ::resname
      character(len=4),dimension(nattot)                 ::itmp
      integer,dimension(nattot)                          ::resindex,label  
      
      
!--- local variables -------------------

      integer :: i

      do i=1,nattot

         read(n,1000,err=20,end=20) itmp,label(i),atomname(i),resname(i),&
       resindex(i)

      enddo
      

20   CONTINUE

1000 format(3x,a4,6x,i5,a4,x,a4,3x,i5)
4Â¥2010-11-16 03:22:17
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] ÉúÎïѧ308·ÖÇóµ÷¼Á£¨Ò»Ö¾Ô¸»ª¶«Ê¦´ó£© +9 ÏàÐűػá¹ââÍòÕ 2026-04-06 12/600 2026-04-06 21:49 by 52305043001
[¿¼ÑÐ] Ò»Ö¾Ô¸Ö£ÖÝ´óѧ²ÄÁÏÓ뻯¹¤085600£¬Çóµ÷¼Á +27 ³ÔµÄ²»ÉÙ 2026-04-02 27/1350 2026-04-06 15:19 by 495374996
[¿¼ÑÐ] 0817»¯Ñ§¹¤³ÌÓë¼¼ÊõÇóµ÷¼Á£¬Ò»Ö¾Ô¸Öк£Ñó319 +14 lv945 2026-04-04 14/700 2026-04-06 10:20 by À¶ÔÆË¼Óê
[¿¼ÑÐ] 332Çóµ÷¼Á +17 ССÃÏ... 2026-04-05 18/900 2026-04-06 09:51 by À¶ÔÆË¼Óê
[¿¼ÑÐ] Ò»Ö¾Ô¸Äϲý´óѧ£¬085600£¬344·ÖÇóµ÷¼Á +9 µ÷¼ÁÉϰ¶«^ 2026-04-05 10/500 2026-04-06 09:30 by dongzh2009
[¿¼ÑÐ] 0832ʳƷ¿ÆÑ§Ó빤³Ìѧ˶282µ÷¼Á +6 ÓãÔÚË®ÖÐÓÎa 2026-04-02 9/450 2026-04-05 11:45 by flysky1234
[¿¼ÑÐ] ר˶310Çóµ÷¼Á +5 ÀÌÀÌÎÒ¡­. 2026-04-04 6/300 2026-04-04 23:33 by barlinike
[¿¼ÑÐ] Äܶ¯µ÷¼Á326ר˶ +4 wan112233 2026-04-04 4/200 2026-04-04 22:47 by yu221
[¿¼ÑÐ] ²ÄÁϹ¤³Ì085601Êý¶þÓ¢Ò»335Çóµ÷¼Á +6 Ë«ÂíβƦÀϰå2 2026-03-31 6/300 2026-04-04 22:29 by hemengdong
[¿¼ÑÐ] µ÷¼Á +9 19945159693 2026-04-03 10/500 2026-04-04 20:16 by dongzh2009
[¿¼ÑÐ] 292Çóµ÷¼Á +11 2022080213 2026-04-04 13/650 2026-04-04 18:38 by macy2011
[¿¼ÑÐ] Ò»Ö¾Ô¸»ªÄÏʦ·¶361·Ö£¬»¯Ñ§Çóµ÷¼Á +7 Nicole88888 2026-04-01 7/350 2026-04-04 18:28 by macy2011
[¿¼ÑÐ] Ò»Ö¾Ô¸0817»¯Ñ§¹¤³ÌÓë¼¼Êõ£¬Çóµ÷¼Á +24 ÎÒ²»ÊÇÖ»Òò 2026-04-02 28/1400 2026-04-04 15:15 by dongzh2009
[¿¼ÑÐ] ÇóÉúÎïѧרҵµ÷¼Á-332·Ö +5 ÔÆ¶äåÞÍäÖ¸ÄÏ 2026-04-04 5/250 2026-04-04 10:05 by rzh123456
[¿¼ÑÐ] »¯¹¤µ÷¼Á303·Ö£¬¹ýËļ¶ +28 ÆÜÎà´ý·ç 2026-04-02 28/1400 2026-04-03 21:40 by qlm5820
[¿¼ÑÐ] Çóµ÷¼Á22408 288·Ö +5 new382 2026-04-02 5/250 2026-04-03 09:13 by ×íÔÚ·çÀï
[¿¼ÑÐ] 372·Ö²ÄÁÏÓ뻯¹¤£¨085600£©Ò»Ö¾Ô¸ºþÄÏ´óѧÇóµ÷¼Á +5 À¶¼ãƬ 2026-04-02 6/300 2026-04-02 21:37 by dongzh2009
[¿¼ÑÐ] ²ÄÁÏר˶322·Ö +11 ¹þ¹þ¹þºðºðºð¹þ 2026-04-01 11/550 2026-04-02 10:52 by lnilvy
[¿¼ÑÐ] Ò»Ö¾Ô¸±±¾©¿Æ¼¼£¬085601×Ü·Ö305Çóµ÷¼Á +9 °ëÉú¹Ï£¡ 2026-04-01 11/550 2026-04-02 08:28 by Wang200018
[¿¼ÑÐ] Ò»Ö¾Ô¸ ÄϾ©º½¿Õº½Ìì´óѧ £¬080500²ÄÁÏ¿ÆÑ§Ó빤³Ìѧ˶ +10 @taotao 2026-03-31 11/550 2026-04-01 09:43 by xiayizhi
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û