c This program reads header of the binary grid file and c displays the header information on screen character*40, fin, fout integer nx, ny real xres,yres,xleft,xright,ytop,ybot vmin = 1.e6 vmax = -1.e6 print *, 'fin' read *, fin print *,'fout' read *, fout open(1, file=fin, form='unformatted') open(2, file=fout, form='formatted') read(1) nx,ny, xres,yres,xleft,xright,ytop,ybot c display header information to the screen write(*,101)nx,ny write(*,102)xleft write(*,103)xright write(*,104)ytop write(*,105)ybot write(*,106)xres write(*,107)yres c write header information to the output file write(2,101)nx,ny write(2,102)xleft write(2,103)xright write(2,104)ytop write(2,105)ybot write(2,106)xres write(2,107)yres 101 format('Grid Dimensions: ', i4,' X ', i3) 102 format('Left X Grid Point:' , f9.2) 103 format('Right X Grid Point:' , f9.2) 104 format('Top Y Grid Point:' ,f7.2) 105 format('Bottom Y Grid Point:' , f7.2) 106 format('Grid Resolution in X direction: ', f7.2) 107 format('Grid Resolution in Y direction: ', f7.2) close(1) stop end