title: Read a line containing (large) N reals to an array in Fortran
body: <p>I've read() down past a header of an input file, and read the value of L on the way.</p>
  
  <p>Now I come to a line of L^2 consecutive reals, which I need to input to the elements of an allocatable array A(L,L).</p>
  
  <p>Trying</p>
  
  <pre><code>          character *100 :: buffer
            read (1,10) buffer
  10      format(a(L*10))
  </code></pre>
  
  <p>results in  </p>
  
  <pre><code>Error: Syntax error in FORMAT statement at (1)  
  Error: FORMAT label 10 at (1) not defined
  </code></pre>
  
  <p>but I'm not sure how else to deal with a (hugely) variable number of reals.</p>
  
  <p>Trying:</p>
  
  <pre><code>    do i=1,L
      do j=i,L
          read (1,"(f10.7)") buffer
          read (buffer,*) A(i,j)
      enddo
      enddo
  </code></pre>
  
  <p>throws:</p>
  
  <pre><code>Fortran runtime error: Expected REAL for item 2 in formatted transfer, got CHARACTER
      (f10.7)
  </code></pre>
  
  <p>I can't simply read(1,"(a1000)") as L will eventually end up huge, so what I really need is a way to parse the elements one by one.</p>
  
  <p>Please say there's a way?</p>