title: Reading writing fortran direct access unformatted files with different compilers
body: <p>I have a section in a program that writes a direct-access binary file as follows:</p>
  
  <pre><code>open (53, file=filename, form='unformatted', status='unknown',
  &amp; access='direct',action='write',recl=320*385*8)
  write (53,rec=1) ulat
  write (53,rec=2) ulng
  close(53)
  </code></pre>
  
  <p>This program is compiled with ifort. However, I cannot reconstruct the data correctly if I read the data file from a different program compiled with gfortran. If the program reading the data is also compiled in ifort, then I can correctly reconstruct the data. Here's the code reading the data file:</p>
  
  <pre><code>OPEN(53, FILE=fname, form="unformatted", status="unknown", access="direct", action="read", recl=320*385*8)
  READ(53,REC=2) DAT
  </code></pre>
  
  <p>I do not understand why this is happening? I can read the first record correctly with both compilers, it's the second record that I cannot reconstruct properly if I mix the compilers. </p>