      program extEUVssn0
C...............................................................Sep 2021
C Extract EUV (26 - 34 nm) and (0.1 - 50 nm) for SSN=0 1996-2021
C
	CHARACTER*2 AYR,AMN,ADY,BMN,BDY
	CHARACTER*64 outfile,infileuv,txt
	+,infile
      CHARACTER*4 AYEAR,BYEAR
	REAL xx(13)	      !xx(12)=EUV(22-24); xx(13)=EUV(0.1-50)
C
      infileuv='d:\Data\EUV\euvYEAR.txt'
C
		  infile='extf107ssn0.txt'  ! List of ~4000(SSN=0) days 1950-2021
	      OPEN(11,file=infile,action='READ')
	outfile='extEUVssn0.txt'
       OPEN(12,file=outfile,access='APPEND')		!++++++
C
   31	format(1X,I4,1X,F8.3,2(1X,A2),2(2X,1PE12.6))
   32	format(1X,A4,2A2,2X,F9.7)
   30	format(2X,A4,7X,A2,1X,A2,1X,F7.5)
C cycle of SSN=0 days
      nn=0
	nout=0
	iflag=0
	iyear_start=2021
         DO 150 iev=1,4000
    2	read(11,33,end=52) nn,ryear,amn,ady,f107 ! day of SSN=0
	iyear=int(ryear)
Crem	if (iyear.lt.1996) goto 2  !+++++++++++++++++
Crem	if (iyear.lt.1998) goto 2  !+++++++++++++++++
	if (iyear.lt.iyear_start) goto 2  !+++++++++++++++++
	if ((iyear.eq.2021).and.(amn.eq.'07')) GOTO 3
C
      iyr=iyear-iyear/100*100
	z1=iyr/4.0
      jz=int(z1)*4

      IF(jz.EQ.iyr) THEN
	nyr=366
        ELSE
	  	nyr=365
	       ENDIF
	call blet4(iyear,AYEAR)
	infileuv(16:19)=AYEAR
	if (iflag.gt.0) goto 59
	      OPEN(10,file=infileuv,action='READ')
	do k=1,48
	read(10,*) txt   ! title lines
	enddo
	iflag=1
C
   59	AYR=AYEAR(3:4)
C
    1	read(10,*,end=57) xyear,byear,lda,(xx(k),k=1,13)		   ! EUV param
C    1	read(10,*,end=52) YYYYMMDD,alpha,icnt
c-      BYEAR=YYYYMMDD(1:4)
	call submmdd(lda,iyr,imn,idy)
	call blet2(imn,BMN)
	call blet2(idy,BDY)
      if ((AYEAR.eq.BYEAR).and.(AMN.eq.BMN).and.(ADY.eq.BDY)) then
	GOTO 55
	                                   else
	GOTO 1
	                                  endif
   55 CONTINUE
      nout=nout+1
      write(*,31) nout,ryear,amn,ady,xx(12),xx(13)
      write(12,31) nout,ryear,amn,ady,xx(12),xx(13)
	if (lda.lt.nyr) then
	goto 150
	         endif
   57   close(unit=10)
      iflag=0
	if (iyear_start.lt.iyear) then
	iyear_start=iyear
	backspace(11)
	endif
  150	continue
   52	close(unit=11)
C
    3	close(unit=12)
	
   33	format(1X,I4,1X,F8.3,2(1X,A2),1X,F6.2)
      pause ' '
	STOP
	END
