program jointab parameter (io0=20000,n50=20) character*80 fn character*160 s160 dimension a(n50),aa(io0,n50) c write(6,*)'Joins several .tab files listed in TAB.LST' write(6,*)' wmin wmax:' read(5,*)wmin,wmax open(45,file='TAB.LST') open(46,file='DOG.TAB') write(46,101) 101 format(' PES ',/,/,'---------------') n=0 nf=0 ne=0 1 read(45,4500,end=999,err=999)fn 4500 format(a80) n=n+1 c open(48,file=fn) read(48,*) read(48,*) read(48,*) io=0 3 read(48,1600,end=900,err=900)s160 1600 format(a160) if(s160(1:1).eq.'-')goto 900 c c find number of numbers: nn=0 do 5 ii=1,159 5 if(s160(ii:ii).eq.' '.and.s160(ii+1:ii+1).ne.' ')nn=nn+1 if(nn.gt.n50)then write(6,*)'too many numbers' stop endif c number of "real" numbers: nn=nn-1 if(nn.lt.1)goto 900 read(s160,*,end=900,err=900)idumm,(a(i),i=1,nn) io=io+1 nf=nf+1 if(io.gt.io0)then write(6,*)fn write(6,*)io,io0 write(6,*)'too many vibrations' goto 900 endif do 2 i=1,nn 2 aa(io,i)=a(i) goto 3 900 close(48) c do 4 ii=1,io if(aa(ii,1).gt.wmin.and.aa(ii,1).le.wmax)then ne=ne+1 write(46,102)ii,(aa(ii,i),i=1,nn) 102 format(i5,25g15.6) endif 4 continue c goto 1 999 close(45) write(46,104) 104 format('-----------------------------------') close(46) write(6,*)n,' tabs, ',nf,' frequencies, ',ne,' in DOG.TAB' stop end