	program cntAEstorms
c .......................................................Nov 2019
C counr number of AE storms with AE>=1000 and moderate storms 500 <= AE <1000
C
C
c
	CHARACTER(10) DD
      CHARACTER(10) TT
      CHARACTER(5) ZZ
	CHARACTER*94,infile
	CHARACTER*4 AYEAR
	CHARACTER*2 AMN,ADY
C
	CALL DATE_AND_TIME(DATE=DD,TIME=TT,ZONE=ZZ)
      TT(5:)='      '
      WRITE(*,*) 'PC Date: Year,Month,Day = ',DD,'Time = ',TT
C
  791 FORMAT(A10,1X,I4)
C
   36	format(19X,A4,2A2,1X,I2,2X,I4)

C
	infile='AEstorm500.txt'
		OPEN(10,FILE=infile,ACTION='READ')
C
	i1000=0
	i500=0
	icntot=0
	do 100 ii=1,3000
	read(10,36,end=102) AYEAR,AMN,ADY,IUT,IAE
      icntot=icntot+1
C
	if (IAE.ge.1000) then
	i1000=i1000+1
	goto 100
	endif
C
	if ((IAE.ge.500).and.(IAE.lt.1000)) then
	i500=i500+1
	endif
C
  100	CONTINUE

  102  CLOSE(unit=10)
	write(*,*) i500,i1000,icntot
  900 pause ' '
      STOP
      END

