Hi Bill,
Thanks for the link, that helped to understand the structure of the ESRI BIL format. I tried the following just to attempt to read the data from the file 'faa.bil' into the allocatable variable (zdata), however it seems to fall over at the attempt to read from unit=26.
program binary_ESRI_bil
implicit none
integer :: nrows, ncols, nbands, nbits, bandrowbytes, totalrowbytes
real(kind=2) :: upperleft_x, upperleft_y, xdim, ydim
character(len=10) :: layout, pixeltype, byteorder
real, allocatable, dimension( :,: ) :: zdata
open (25, file='faa.hdr', status='old') ! get information from header file
read(25, '(15x,A)') byteorder
read(25, '(15x, A)') layout
read(25, '(15x,I3)') nrows ! 120
read(25, '(15x,I3)') ncols ! 120
read(25, '(15x,I1)') nbands
read(25, '(15x,I2)') nbits
read(25, '(15x,I3)') bandrowbytes
read(25, '(15x,I3)') totalrowbytes
read(25, '(15x,A)') pixeltype
read(25, '(15x,f15.6)') upperleft_x ! -4.99166666666667
read(25, '(15x,f15.6)') upperleft_y ! -3.00833333333333
read(25, '(15x,f15.6)') xdim ! 0.0166666666666667
read(25, '(15x,f15.6)') ydim ! 0.0166666666666667
open(26, file='faa.bil', form='formatted', access='sequential', status='old')
read(26) zdata ! dimensions (ncols*nrows)
close(25)
close(26)
end program binary_ESRI_bil
I tried various options with the open form = formatted/unformatted, access= sequential/transparent etc., but with no help. I am guessing it is the read access point, but not sure why? The data is square (120 * 120)
Thanks
Lester