title: Using do loop in a Fortran 90 program to read different number of lines for n frames?
body: <p>There is a file that has,say, 1000 frames. Each frame contains different number of lines.Each line has two columns of integers.But,I do not know how many number of lines each frame contains. Every frame is separated by one blank line.I want to read these values and store them in an array. But,I cannot allocate the array size as I do not know how many lines every frame has. So, I have two questions:  </p>
  
  <ul>
  <li>How can I use a "do" loop to read the different number of lines in a fortran90 program ? I cannot use "count-controlled do" loop as I do not know the exact number of lines in each frame.</li>
  <li>How do I store the numbers in an array if I cannot allocate the size of it earlier ?
  The file looks something like this:</li>
  </ul>
  
  
  
  <pre><code>1   2  
  2   1
  
  3   2
  
  2   8   
  4   5  
  4   17  
  2   10
  </code></pre>
  
  <p>and so on...</p>
  
  <p>Any suggestions?</p>