      program aaapregr
C.............................................................Apr 2022
C extend d:/Apkp/aa/aakp2021, aakp2022 files
C
      character*64 infile,outfile
	dimension ikp(0:7),iap(0:7),aa(0:7),iaa(0:7)
	character*2 AYR,AMN,ADY,AUT
	character*4 AYEAR
C
       p1 =   -0.004135
       p2 =       1.716
       p3 =       3.627
	AYEAR='2000'
       outfile='d:\Apkp\aa\aakp2022'
	OPEN(10,file=outfile,access='APPEND')
	infile='d:\Apkp\kpap\kp2022'
      OPEN(11,file=infile,action='READ')
   30	format(3A2,6X,8(I2),3X,8(I3))
   31	format(A4,3(1X,A2),1X,I2,2(1X,I3))
    1	read(11,30,end=50) AYR,AMN,ADY,(ikp(k),k=0,7),(iap(k),k=0,7)
C	if (AMN.eq.'12') then
	do i=0,7
	x=iap(i)
	aa(i) = p1*x**2 + p2*x + p3
	iaa(i)=nint(aa(i))
	enddo
	i=0
	do iut=0,23,3
      call blet2(iut,AUT)
	AYEAR(3:4)=AYR
	write(*,31) AYEAR,AMN,ADY,AUT,ikp(i),iap(i),iaa(i)
      write(10,31) AYEAR,AMN,ADY,AUT,ikp(i),iap(i),iaa(i)
	i=i+1
	enddo
C	endif
	    goto 1
   50 close(unit=11)
      close(10)
	pause ' '
	stop
	END