program prnlist character*80 s80 character*1 yn real,allocatable::w(:,:),s(:,:) integer,allocatable::n(:) write(6,*) write(6,*)'list of spectra in SP.LST for sigmaplot etc plotting' write(6,*)'rewrites them in LIST.DAT' write(6,*) write(6,599) 599 format(' Repeat x-scale (y/n)? ',$) read(5,'(a)')yn if(yn.eq.'y')yn='Y' open(9,file='SP.LST',status='old') is=0 npmax=0 1 read(9,90,end=99,err=99)s80 90 format(a80) is=is+1 np=0 open(90,file=s80,status='old') 2 read(90,*,end=88,err=88)x,x np=np+1 goto 2 88 close(90) if(np.gt.npmax)npmax=np goto 1 99 close(9) write(6,*)is,' spectra' write(6,*)npmax,' maximal number of points' if(is.eq.0)then write(6,*)'no spectra in SP.LST' stop endif if(npmax.eq.0)then write(6,*)'no points found' stop endif allocate(w(npmax,is),s(npmax,is),n(is)) open(9,file='SP.LST') do 3 i=1,is read(9,90)s80 open(90,file=s80,status='old') np=0 5 read(90,*,end=77,err=77)x,x np=np+1 goto 5 77 close(90) n(i)=np open(90,file=s80,status='old') do 4 j=1,n(i) 4 read(90,*)w(j,i),s(j,i) 3 close(90) close(9) open(60,file='LIST.DAT') do 7 j=1,npmax do 6 i=1,is if(i.eq.1.or.yn.eq.'Y')then if(j.gt.n(i))then write(60,602) 602 format(10(1h ),$) else write(60,600)w(j,i) 600 format(f10.2,$) endif endif if(j.gt.n(i))then write(60,603) 603 format(14(1h ),$) else write(60,601)s(j,i) 601 format(g14.4,$) endif 6 continue 7 write(60,*) close(60) end