      program extwpstrm0
C........................................................Sep 2022
C Select Wp tec_geom.txt storms at SSN = 0
C
      CHARACTER*120 infile,infssn,outfile,txt
	CHARACTER*2 AMN,ADY,AUT
C
      infile='d:\web\storm\tecstorm_geom.txt' 
	infssn='SSNd.txt'
	outfile='catwpstrm0.txt'
	OPEN(10,file=infile,action='READ')
	OPEN(11,file=infssn,action='READ')
	OPEN(12,file=outfile,access='APPEND')
C
   30	format(18X,I4,I2,I2,2X,I2,2X,F4.1)
   31	format(I4,2(1X,I2),1X,F8.3,2X,I3)
   32	format(1X,F8.3,1X,I3,3(1X,A2),1X,F4.1,1X,I3)
	DO i=1,8
	read(10,*) txt
	ENDDO
	nn=0
    1	read(10,30,end=51) iyear,imn,idy,iut,wp
    2	read(11,*,end=52) kyear,kmn,kdy,xyear,issn,dssn,iex
      if ((kyear.eq.iyear).and.(kmn.eq.imn).and.(kdy.eq.idy)) then  !+
	iyr=iyear-iyear/100*100
	lda=ndoy(iyr,imn,idy)
C++
         if(issn.eq.0) then                                   !++
	call blet2(imn,amn)
	call blet2(idy,ady)
	call blet2(iut,aut)
	nn=nn+1
	write(*,32) xyear,lda,amn,ady,aut,wp,nn
      write(12,32) xyear,lda,amn,ady,aut,wp,nn
	goto 1													 !++
	   else
	goto 1													 
	   endif												 !++
C++
	else                                                         !+
	  goto 2
	endif                                                      !+
  51  close(10)
  52  close(11)
      close(12)
	pause ' '
	STOP
	END