program divide character*160 s character*80 fn,sf character*1 sp write(6,*) 1'The program divides Gaussian output into separate calculations:' if(iargc().eq.0)then write(6,*)'Filename:' read(5,*)fn write(6,*)'Outputs all odd even (a o e):' read(5,*)sp else call getarg(1,fn) if(iargc().eq.2) call getarg(2,sp) endif if(sp.eq.'o')then write(6,*)'Odd outputs only' else if(sp.eq.'e')then write(6,*)'Even outputs only' else sp='a' write(6,*)'All outputs' endif endif open(8,file=fn) it=0 il=0 iw=0 8 read(8,800,end=888,err=888)s 800 format(a160) il=il+1 c if(s(2:17).eq.'Initial command:')it=it+1 c if(s(2:17).eq.'Initial command:'.and.(sp.eq.'a'.or. if(s(2:17).eq.'Entering Link 1 ')it=it+1 if(s(2:17).eq.'Entering Link 1 '.and.(sp.eq.'a'.or. 1 (sp.eq.'o'.and.(it+1)/2*2.eq.it+1).or. 1 (sp.eq.'e'.and. it /2*2.eq.it )).and.it.gt.0)then write(sf,500)it 500 format(i10) do 3 is=1,80 3 if(sf(is:is).ne.' ')goto 4 4 do 5 ie=80,1,-1 5 if(sf(ie:ie).ne.' ')goto 6 6 if(iw.gt.1)close(9) iw=iw+1 open(9,file=sf(is:ie)//'.out') write(6,*)iw,it,sf(is:ie)//'.out' endif do 1 ie=160,1,-1 1 if(s(ie:ie).ne.' ')goto 2 2 if(ie.lt.1)then if(it.gt.0)then if(sp.eq.'a'.or. 1 (sp.eq.'o'.and.(it+1)/2*2.eq.it+1).or. 1 (sp.eq.'e'.and. it /2*2.eq.it ))then write(9,*) endif endif else if(it.gt.0)then if(sp.eq.'a'.or. 1 (sp.eq.'o'.and.(it+1)/2*2.eq.it+1).or. 1 (sp.eq.'e'.and. it /2*2.eq.it ))then write(9,801)(s(ii:ii),ii=1,ie) endif endif 801 format(180a1) endif goto 8 888 close(9) close(8) write(6,*)il,' lines' write(6,*)it,' files' write(6,*)iw,' files written' stop end