I have a text file formatted like this:
1 2
3 4 5
6 7
and so on for many lines.
I run this fortran program:
i=1
tt=1
do while(.true.)
read(unit=1,*,IOSTAT=status) lon(i,tt),lat(i,tt),h(i,tt)
i=i+1
if(status/=0)exit
enddo
I want to assign three numbers in the same line to lon
, lat
, h
. However, because the first line doesn't have the third element , the program will read the first element in the second line (i.e., 3 to h(i,tt)), and that's not what I want. I want to set h(i,tt) to the missing value in some lines
How can I do this?