      program extrsch
C.........................................................Jan 2018
C Extract Cor.Mega-Hole S-Andreeva area from pixels data
      CHARACTER*4 CRNN
      CHARACTER*65 infile,outfile
C
	infile='sdatacmh.txt'
	outfile='sdatacmh.dat'
C
   31 format(F4.1,1X,F4.2)
   32 format(A4,1X,F4.2)
   33 format(1X,A4,1X,F7.2)

	open(10,file=infile,action='READ')
	open(11,file=outfile,access='APPEND')
C
      read(10,31,end=41) y0,z0
	read(10,31,end=41) y1,z1
	dz=z0-z1
    1	read(10,32,end=41)	CRNN,zi
      if (dz.gt.0.) yi=-(zi-z0)/dz*y1
	write(*,33) CRNN,yi
	write(11,33) CRNN,yi
	GOTO 1
   41	close(unit=10)
      close(unit=11)
	pause ' '
	STOP
	END