title: Best way to write a large array to file in fortran? Text vs Other
body: <p>I wanted to know what the best way to write a large fortran array ( 5000 x 5000 real single precision numbers) to a file. I am trying to save the results of a numerical calculation for later use so they do not need to be repeated. From calculation 5000 x 5000 x 4bytes per number number is 100 Mb, is it possible to save this in a form that is only 100Mb? Is there a way to save fortran arrays as a binary file and read it back in for later use? </p>
  
  <p>I've noticed that saving numbers to a text file produces a file much larger than the size of the data type being saved. Is this because the numbers are being saved as characters? </p>
  
  <p>The only way I am familiar with to write to file is </p>
  
  <pre><code>open (unit=41, file='outfile.txt')
  
  do  i=1,len
      do j=1,len
  
          write(41,*) Array(i,j)
      end do
  end do
  </code></pre>
  
  <p>Although I'd imagine there is a better way to do it. If anyone could point me to some resources or examples to approve my ability to write and read larger files efficiently (in terms of memory) that would be great. 
  Thanks!</p>