title: How to use fortran to read irregular lines
body: <p>I have a text file formatted like this:</p>
  
  <pre><code>1  2 
  3  4  5
  6  7    
  </code></pre>
  
  <p>and so on for many lines.</p>
  
  <p>I run this fortran program: </p>
  
  <pre><code>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
  </code></pre>
  
  <p>I want to assign three numbers in the same line to <code>lon</code>, <code>lat</code>, <code>h</code>. 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 <em>want</em> to set h(i,tt) to the missing value in some lines</p>
  
  <p>How can I do this?</p>