title: Fortran 90 how to write very long output lines of different length
body: <p>I've spent hours scouring the internet for a solution to this problem and can't find anything. I have been trying to write unformatted output to a CSV output file with multiple very long lines of varying length and multiple data types. I'm trying to first write a long header that indicates the variables that will be written below, separated by commas. Then on the lines below that, I am writing the values specified in the header. However, with sequential access, the long output lines are broken into multiple shorter lines, which is not what I was hoping for. I tried controlling the line length using recl in the open statement, but that only added a bunch of garble text and symbol after the output with the same problem still occurring. I also tried using direct access but the lines are not the same length so that would not work either. I've read about using stream i/o in Fortran2003 but I'm using Fortran90, so that won't work either. I am using Fortran 90 with the Plato IDE which uses the FTN95 compiler. I included an example program similar to what I want to do below, using an array and some dummy text, and I've included the output below that illustrating the problem. Anyone know how I can just one line per write statement? Any help would be greatly appreciated.</p>
  
  <pre><code>module types
    integer, parameter :: dp=selected_real_kind(15)
  end module types
  
  program blah
    use types
    use inputoutput
  
    implicit none
  
    integer :: i
    character(50)::fileNm
    integer :: unitout2=20
    real(dp), dimension(100) :: bigArray
  
    fileNm='predictout2.csv'
    open(unit=unitout2,file=fileNm,status="replace")
  
    do i=1,100
      bigArray(i)=i
    end do
  
    write(unitout2,*)"word,word,word,word,word,word,word,word,word,word,word,word,word,word,word,word,word,&amp;
    &amp;word,word,word,word,word,word,word,word,word,word,word,word,word,word,word,word,word,word,word,word,&amp;
    &amp;word,word,word,word,word,word,word,word,word,word,word,word,word,word,word,word"
    write(unitout2,*)bigArray
  
    close(unitout2)
  
  end program
  </code></pre>
  
  <p>Here's the output for the program above (without recl):</p>
  
  <pre><code> word,word,word,word,word,word,word,word,word,word,word,word,word,word,word,word,word,word,word,word,word,word,word,word
    ,word,word,word,word,word,word,word,word,word,word,word,word,word,word,word,word,word,word,word,word,word,word,word,wo
    rd,word,word,word,word,word
             1.00000000000              2.00000000000              3.00000000000              4.00000000000
             5.00000000000              6.00000000000              7.00000000000              8.00000000000
             9.00000000000              10.0000000000              11.0000000000              12.0000000000
             13.0000000000              14.0000000000              15.0000000000              16.0000000000
             17.0000000000              18.0000000000              19.0000000000              20.0000000000
             21.0000000000              22.0000000000              23.0000000000              24.0000000000
             25.0000000000              26.0000000000              27.0000000000              28.0000000000
             29.0000000000              30.0000000000              31.0000000000              32.0000000000
             33.0000000000              34.0000000000              35.0000000000              36.0000000000
             37.0000000000              38.0000000000              39.0000000000              40.0000000000
             41.0000000000              42.0000000000              43.0000000000              44.0000000000
             45.0000000000              46.0000000000              47.0000000000              48.0000000000
             49.0000000000              50.0000000000              51.0000000000              52.0000000000
             53.0000000000              54.0000000000              55.0000000000              56.0000000000
             57.0000000000              58.0000000000              59.0000000000              60.0000000000
             61.0000000000              62.0000000000              63.0000000000              64.0000000000
             65.0000000000              66.0000000000              67.0000000000              68.0000000000
             69.0000000000              70.0000000000              71.0000000000              72.0000000000
             73.0000000000              74.0000000000              75.0000000000              76.0000000000
             77.0000000000              78.0000000000              79.0000000000              80.0000000000
             81.0000000000              82.0000000000              83.0000000000              84.0000000000
             85.0000000000              86.0000000000              87.0000000000              88.0000000000
             89.0000000000              90.0000000000              91.0000000000              92.0000000000
             93.0000000000              94.0000000000              95.0000000000              96.0000000000
             97.0000000000              98.0000000000              99.0000000000              100.000000000
  </code></pre>