      program extkpssn0yr
C......................................................Aug. 2021
C Count annual number of days 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='kpssn0yr.txt'
      OPEN(12,file=outfile,access='APPEND')
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')
	icnt=0
C
C
   30	format(3A2,6X,8(I2),34X,I3)
   31	format(1X,A4,1X,I4,1X,F6.2)
   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
	GOTO 1
  150 close(unit=10)
      peryr=icnt/3082.*100.
      write(*,31) AYEAR,icnt,peryr
	write(12,31) AYEAR,icnt,peryr
C
   50 CONTINUE
  151 close(unit=12)
	pause ' '
	STOP
	END
