      program catseaskp
C.......................................................Dec. 2021
C
      CHARACTER*132 infhsskp,outfjan,outfjul,outfeqn
C
	      infhsskp='hsskpapaa3.txt'
C
   31	format(A70,I4)
   32 format(A46,2(1X,I4))
   33	format(A70,I4,1X,I4)
		outfjan='cathsskpjan.txt'
	outfjul='cathsskpjul.txt'
	outfeqn='cathsskpeqn.txt'
	OPEN(11,file=outfjan)
	OPEN(12,file=outfjul)
	OPEN(13,file=outfeqn)
C
   28 format(1X,F8.3,1X,I3,2(1X,I2),1X,I3,1X,I4,1X,I3,2(1X,I4),1X,I3
     +,1X,F4.1,2(1X,I3,1X,I4),1X,I4)
   29 format(1X,F8.3,1X,I3,2(1X,I2),1X,I3,1X,I4,1X,I3,2(1X,I4),1X,I3
     +,1X,F4.1,2(1X,I3,1X,I4),2(1X,I4))
      icnjan=0
	icnjul=0
	icneqn=0
C read select JAN
      	open(10,file=infhsskp,action='READ')
	DO 177 iev=1,380	!HSS/Dst storm 1996-2021
       read(10,28,end=27) ryear1,lda1,imn1,idy1,iut1,ivsmin,itvs,ivsmax
	+,idvs,itkp,xkp,itap,iap,itaa,iaa,ninp
C
      if ((imn1.eq.1).or.(imn1.eq.2).or.(imn1.eq.11).or.(imn1.eq.12)) 
	+then
	 icnjan=icnjan+1
	write(*,29)	ryear1,lda1,imn1,idy1,iut1,ivsmin,itvs,ivsmax
	+,idvs,itkp,xkp,itap,iap,itaa,iaa,icnjan,ninp
      write(11,29) ryear1,lda1,imn1,idy1,iut1,ivsmin,itvs,ivsmax
	+,idvs,itkp,xkp,itap,iap,itaa,iaa,icnjan,ninp
 	 goto 177
	endif
C
      if ((imn1.eq.3).or.(imn1.eq.4).or.(imn1.eq.9).or.(imn1.eq.10)) 
	+then
	 icneqn=icneqn+1
	write(*,29)	ryear1,lda1,imn1,idy1,iut1,ivsmin,itvs,ivsmax
	+,idvs,itkp,xkp,itap,iap,itaa,iaa,icneqn,ninp
      write(13,29) ryear1,lda1,imn1,idy1,iut1,ivsmin,itvs,ivsmax
	+,idvs,itkp,xkp,itap,iap,itaa,iaa,icneqn,ninp
	 goto 177
	endif
C
      if ((imn1.eq.5).or.(imn1.eq.6).or.(imn1.eq.7).or.(imn1.eq.8)) 
	+then
	 icnjul=icnjul+1
	write(*,29)	ryear1,lda1,imn1,idy1,iut1,ivsmin,itvs,ivsmax
	+,idvs,itkp,xkp,itap,iap,itaa,iaa,icnjul,ninp
      write(12,29) ryear1,lda1,imn1,idy1,iut1,ivsmin,itvs,ivsmax
	+,idvs,itkp,xkp,itap,iap,itaa,iaa,icnjul,ninp
	 goto 177
	endif
  177	CONTINUE
   27	close(10)
      close(11)
	close(12)
	close(13)
       pause	' '
	STOP
	 END
C


