	real*8 header(64)
	real*8 data(1000000)
	integer*8 hi(45)
	equivalence(hi,header)
 	integer ndata
	real*4 mn,mx,mdi

	open(unit=99,file='in.pp',form='unformatted',status='old')
	read(99) header
	do i=1,45 
	  print *,i,hi(i)
	enddo
	do i=46,64
	  print *,i,header(i)
	enddo
	mdi=header(63)
	ndata=hi(15)
	call read_data(data,ndata,mx,mn,mdi)
	print *,'Data range: ',mn,mx
	
	end

	subroutine read_data(data,n,mx,mn,mdi)
	integer n
	real*4 mn,mx,mdi
	real*8 data(n)

	read (unit=99) data
	mx=data(1)
	mn=data(1)

	do i=1,n
	  if (data(i) .ne. mdi) then
  	    mx=max(mx,data(i))
	    mn=min(mn,data(i))
	  endif
	enddo
	return
	end
