program chopk character*80 s80,fn character*160 s160 logical lw write(6,*)'Chops Gaussian output to individual jobs' if(iargc().ne.1)then write(6,*)' Usage: chopk filename' else call getarg(1,fn) open(22,file=fn) il=0 ij=0 lw=.false. 1 read(22,160,end=99,err=99)s160 160 format(a160) il=il+1 if(s160(2:17).eq.'Entering Link 1 ')then ij=ij+1 write(s80,80)ij 80 format(i80) is=0 5 is=is+1 if(s80(is:is).eq.' ')goto 5 open(23,file=s80(is:len(s80))//'.G.out') write(6,*)'job ',ij,' at line ',il, 1 ' to ',s80(is:len(s80))//'.G.out' lw=.true. endif do 6 ie=len(s160),1,-1 6 if(s160(ie:ie).ne.' ')goto 7 7 if(lw)write(23,161)(s160(i:i),i=1,ie) 161 format(160a1) if(s160(2:2).eq.'#')write(6,161)(s160(i:i),i=1,ie) if(s160(2:12).eq.' File length')then close(23) lw=.false. endif goto 1 99 close(22) if(lw)close(23) write(6,*)il,' lines in total, ',ij,' jobs' endif stop end