²é¿´: 2808  |  »Ø¸´: 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µÄ»ØÌû

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µÄ»ØÌû

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µÄ»ØÌû

cean

½ð³æ (Ö°Òµ×÷¼Ò)

ŒÅÉþÒ»Ìõ

¡ï ¡ï
Сľ³æ(½ð±Ò+0.5):¸ø¸öºì°ü£¬Ð»Ð»»ØÌû½»Á÷
nono2009(½ð±Ò+1):¹ÄÀø²ÎÓë 2010-11-21 07:15:28
¡°Fortran runtime error: I/O past end of record on unformatted file¡±

There is not enough data to be read.
To do great work, you have to have a pure mind.
6Â¥2010-11-20 20:39:35
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

yangdafaok

Ìú¸Ëľ³æ (ÕýʽдÊÖ)

nono2009:ºÎ½â£¿ 2010-11-21 07:15:49
mayishi
ÕÆÎÕÃüÔ˵IJ»ÊÇÈ˵ÄÖ¸ÎÆ£¬¶øÊÇÈ­Í·£¡
7Â¥2010-11-20 20:47:24
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
Ïà¹Ø°æ¿éÌø×ª ÎÒÒª¶©ÔÄÂ¥Ö÷ astringent µÄÖ÷Ìâ¸üÐÂ
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] 283Çóµ÷¼Á +10 С¥¡£ 2026-03-12 14/700 2026-03-16 16:08 by 13811244083
[¿¼ÑÐ] ²ÄÁÏÓ뻯¹¤×¨Ë¶µ÷¼Á +3 heming3743 2026-03-16 3/150 2026-03-16 15:05 by peike
[¿¼ÑÐ] »·¾³¹¤³Ìµ÷¼Á +4 ´ó¿Édigkids 2026-03-16 4/200 2026-03-16 14:00 by laoshidan
[¿¼ÑÐ] 326Çóµ÷¼Á +3 ŵ±´¶û»¯Ñ§½±êéê 2026-03-15 3/150 2026-03-16 13:51 by houyaoxu
[¿¼ÑÐ] 304Çóµ÷¼Á +6 СÐÜjoy 2026-03-14 6/300 2026-03-16 12:59 by Iveryant
[¿¼ÑÐ] 308Çóµ÷¼Á +3 ÊÇLupa°¡ 2026-03-16 3/150 2026-03-16 10:07 by Çóµ÷¼Ázz
[¿¼ÑÐ] ²ÄÁϹ¤³Ìר˶274Ò»Ö¾Ô¸211Çóµ÷¼Á +5 Ñ¦ÔÆÅô 2026-03-15 5/250 2026-03-15 20:38 by Logic2024
[¿¼ÑÐ] 22408×Ü·Ö284Çóµ÷¼Á +3 InAspic 2026-03-13 3/150 2026-03-15 11:10 by zhq0425
[¿¼ÑÐ] ²ÄÁÏÓ뻯¹¤£¨0856£©304ÇóBÇøµ÷¼Á +7 Çñgl 2026-03-10 11/550 2026-03-14 12:18 by Çñgl
[¿¼ÑÐ] ¿¼ÑвÄÁÏÓ뻯¹¤£¬Çóµ÷¼Á +8 Ï·¾«µ¤µ¤µ¤ 2026-03-09 8/400 2026-03-14 01:14 by JourneyLucky
[¿¼ÑÐ] 271Çóµ÷¼Á +10 ÉúÈçÏÄ»¨¡­ 2026-03-11 10/500 2026-03-14 00:35 by Âô±¨Ô±Ð¡Óê
[¿¼ÑÐ] ÕÐÊÕ0805£¨²ÄÁÏ£©µ÷¼Á +3 18595523086 2026-03-13 3/150 2026-03-14 00:33 by 123%¡¢
[¿¼ÑÐ] ²ÄÁϹ¤³Ì,326·Ö£¬Çóµ÷¼Á +6 KRSLSR 2026-03-10 6/300 2026-03-13 23:47 by JourneyLucky
[¿¼ÑÐ] 0703£¬333·ÖÇóµ÷¼Á Ò»Ö¾Ô¸Ö£ÖÝ´óѧ-ÎïÀí»¯Ñ§ +3 Àîħٶ·Åñ 2026-03-11 3/150 2026-03-13 22:24 by JourneyLucky
[¿¼ÑÐ] Çó²ÄÁϵ÷¼Á +5 ¸ô±Ú³ÂÏÈÉú 2026-03-12 5/250 2026-03-13 22:03 by ÐÇ¿ÕÐÇÔÂ
[¿¼ÑÐ] 304Çóµ÷¼Á +7 7712b 2026-03-13 7/350 2026-03-13 21:42 by peike
[¿¼ÑÐ] ¹¤¿Æ²ÄÁÏ085601 279Çóµ÷¼Á +8 À§ÓÚÐdz¿ 2026-03-12 10/500 2026-03-13 15:42 by ms629
[¿¼ÑÐ] 333Çóµ÷¼Á +3 152697 2026-03-12 4/200 2026-03-13 07:08 by Iveryant
[¿¼²©] 2026Ä격ʿÉêÇë +3 QwQwQW10 2026-03-11 3/150 2026-03-12 17:58 by gxch43
[¿¼ÑÐ] 0856²ÄÁÏÓ뻯¹¤353·ÖÇóµ÷¼Á +11 NIFFFfff 2026-03-09 11/550 2026-03-10 18:36 by suyuanhai
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û