program asc_xyz integer imax, jmax parameter(imax=360, jmax=180) integer igrid, jgrid parameter(igrid=2, jgrid=2) 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 = 90.00000 s = 0.5 open(11,file='glp95agi.asc',status='old') do j=1,jmax*jgrid read(11,*) (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)*s y(i,j)=(y0 - s/2.0) - float(j-1)*s c----- remove "0" -------- ccccc if(data(i,j) .ne. 0) then write(12,*) x(i,j),y(i,j), float(data(i,j)) ccccc end if end do end do close(12) stop end