      program extf107ssn0
C...............................................................Sep 2021
C Extract F10.7 for SSN=0 1957-2021
C
	CHARACTER*2 AYR,AMN,ADY
	CHARACTER*64 outfile,infilekp
C	+,infile
		CHARACTER*4 AYEAR
C
      infilekp='d:\Apkp\kpap\kpYEAR'
	outfile='extf107ssn0.txt'
       OPEN(12,file=outfile,access='APPEND')
C
   31	format(1X,I4,1X,3I2,1X,I2,3(1X,F6.2),1X,F4.1)
   32	format(3I2,56X,I3,F6.2)
C cycle of SSN=0,kp>=3 days
Crem         DO 150 iyear=1957,2021
         DO 150 iyear=1948,1956
C	read(10,31,end=3) nn,iyr,imn,idy,iut,wu,wl,we,xkp3
      iyr=iyear-iyear/100*100
	call blet4(iyear,AYEAR)
	z1=iyear/4.0
      jz=int(z1)*4

      IF(jz.EQ.iyear) THEN
	idnr=366
        ELSE
	  	idnr=365
	       ENDIF
	delyr=1./idnr
	call blet2(iyr,AYR)
	infilekp(16:19)=AYEAR
	      OPEN(11,file=infilekp,action='READ')
C
       iev=0
         DO 250 lda=1,idnr
	call submmdd(lda,iyr,imn,idy)
      call blet2(imn,AMN)
	call blet2(idy,ADY)
	ryear=iyear+(lda-1)*delyr
C
	read(11,32,end=52) kyr,kmn,kdy,issn,f107
	if (issn.gt.0) goto 250
	iev=iev+1
      write(*,33) iev,ryear,amn,ady,f107
      write(12,33) iev,ryear,amn,ady,f107
  250	continue
   52	close(unit=11)
C
  150	CONTINUE
    3	close(unit=12)
	
   33	format(1X,I4,1X,F8.3,2(1X,A2),1X,F6.2)
      pause ' '
	STOP
	END
