      program exticme
C..............................................................May 2016
C Extract information from ICME Catalogue
C
      CHARACTER*64 infile,outfile
	CHARACTER*128 txt
	CHARACTER*4 AYEAR
C	+,BYEAR
C	CHARACTER*5 AV1,AV2
	CHARACTER*2 AMN,ADY
C	 
      infile='listicme19962016.txt'
	outfile='listicme.txt'
	OPEN(10,file=infile,action='READ')
	OPEN(11,file=outfile)
C
   30	format(A128)
   31	format(A4,2(1X,A2),1X,2I2,A128)
c   32	format(A4,2(1X,A2),1X,F5.2,2(1X,A5))
c   32	format(A4,2(1X,A2),1X,F5.2,A128)
   32	format(A4,2(1X,A2),1X,F5.2)
   33	format(A4)
      do i=1,7
      read(10,30) txt ! extra lines
	enddo
C1996 05/27 1500	05/27 1500 	05/29 0300 	... 	... 	0 	+4 	N 	... 	2 	0 	370 	400 	9 	2 	-33 	... 	?	   
      icnt=0
C
  100	read(10,31,end=111,err=2) AYEAR,AMN,ADY,IUTh,IUTm,txt
C	 AV1=txt(55:59)
C	AV2=txt(60:64)
      icnt=icnt+1
	ut=iuth+iutm/60.
c	write(*,32)	AYEAR,AMN,ADY,UT,AV1,AV2
	write(*,32)	AYEAR,AMN,ADY,UT
		write(11,32) AYEAR,AMN,ADY,UT
C	write(11,32) AYEAR,AMN,ADY,UT,AV1,AV2  
C	pause ' '
	goto 100
  111	close(unit=10)
	close(unit=11)
	write(*,*) icnt
	goto 900
    2	write(*,*) 'Error in input file'
  900	pause ' '
      STOP
	END