      program extkpssn0
C......................................................Aug. 2021
C extract all Kp for SSN2=0 1954-2021
C
      character*128 infilkp,outfile
      character*2 AYR,AMN,ADY
	character*4 AYEAR
	dimension inkp(0:7)
c-	+,inkp0(0:7),inkp3(0:7)
C
      infilkp='d:\apkp\kpap\kpYEAR'
	outfile='kpssn0.txt'
      OPEN(12,file=outfile,access='APPEND')
	icnt=0
C
C      DO 50 iyear=1996,2021
      DO 50 iyear=1954,2021
	call blet4(iyear,AYEAR)
	iyr=iyear-(iyear/100)*100
	AYR=AYEAR(3:4)
	infilkp(16:19)=AYEAR
	OPEN(10,file=infilkp,action='READ')

C
C
   30	format(3A2,6X,8(I2),34X,I3)
   31	format(1X,I4,1X,3A2,8(1X,I3))
   1	read(10,30,end=150) Ayr,Amn,Ady,inkp,issn
      if (issn.gt.0) GOTO 1
C extract Kp (SSN=0)
c-       iflag0=0
		icnt=icnt+1
      write(*,31) icnt,AYR,AMN,ADY,(inkp(k),k=0,7)
	write(12,31) icnt,AYR,AMN,ADY,(inkp(k),k=0,7)
	GOTO 1
  150 close(unit=10)
C
   50 CONTINUE
  151 close(unit=12)
	pause ' '
	STOP
	END
