      program rewritehss2
C...................................................Jan 2020
C add Dst-min to catalog-HSS
C
      CHARACTER*52 infile,infdst,outfile,text
	DIMENSION idst(0:71)
	infdst='hssds1m.txt'
	infile='cathss48m.txt'
	outfile='cathss48dst.txt'
	OPEN(10,file=infile,action='READ')
	OPEN(11,file=outfile)
	OPEN(12,file=infdst,action='READ')
C
   30 FORMAT(A52)
   31 FORMAT(A52,1X,I3,1X,I4)
      nn=0
    1	nn=nn+1
      read(10,30,end=40) text
	read(12,*,end=41) idst
	idstmin=0
	do i=0,71
	if (idstmin.gt.idst(i)) then
	idstmin=idst(i)
	iut=i-24
	endif
	enddo
	write(*,31) text,iut,idstmin
	write(11,31) text,iut,idstmin
	goto 1
   40	close(unit=10)
   41	close(unit=12)
      close(unit=11)
	pause ' '
	STOP
	end


