program bil_xyz integer imax, jmax parameter(imax=360, jmax=143) integer igrid, jgrid parameter(igrid=24, jgrid=24) integer data(imax*igrid, jmax*igrid) real x(imax*igrid, jmax*jgrid), y(imax*igrid, jmax*jgrid) real x0, y0, s x0 = -180.000 y0 = 85.00000 s = 1.0/24.0 open(10,file='glp95agi.bil',access="direct",recl=4*imax*igrid) do j=1,jmax*jgrid read(10,rec=j) (data(i,j), i=1,imax*igrid) end do close(10) c----------------------------------------------------------- open(12, file='glp95agi.xyz',status='new') do j=1,jmax*jgrid do i=1,imax*igrid x(i,j)=( x0 + s/2.0 ) + float(i-1)/24.0 y(i,j)=(y0 - s/2.0) - float(j-1)/24.0 c----- remove "0" -------- if(data(i,j) .ne. 0) then write(12,*) x(i,j),y(i,j), float(data(i,j)) end if end do c write(6,*) ' writing', j , ' rows' end do close(12) stop end