I am having trouble reading a large ascii file (with a 6 line header) into an array. Here is the relevant code...
! skip ahead 6 lines in the ascii file
do i=1, 6
read (20, *)
end do
do row = 1, nrow
read(20,*) data(row,:)
end do
I get the message "Fortran runtime error: Bad integer for item 3991 in list input". I've looked col 3991 and nothing looks out of the ordinary. Does anyone know how to skip past the header properly? I am compiling an .f90 file with gfortran. Thanks.
edit: I also tried this instead of the first do loop...
read (20, *) temp, ncol
read (20, *) temp, nrow
read (20, *) temp, xcord
read (20, *) temp, ycord
read (20, *) temp, cell
read (20, *) temp, nodata
My header is:
ncols 4193
nrows 2322
xllcorner 604374.4763
yllcorner 810341.0601
cellsize 30
NODATA_value -9999