- #1
Saladsamurai
- 3,020
- 7
I am writing to a text file and a do not want any leading whitespace on each line. I have been trying the Write(*,'(a)') statement. This works just fine:
However, the value written is not always 2.00000000000 and hence I would like something like:
I am trying to avoid statement labels if possible.
However the latter produces nonsense in the file for PHI.
Code:
Program MyTest
Open(2,File = 'testFile.inp')
Write(2,'(a)')'DIAG'
Write(2,'(a)')'REAC C2H4F2 2.00000000000'
Close(2)
End
However, the value written is not always 2.00000000000 and hence I would like something like:
Code:
Program MyTest
Double Precision PHI
PHI = 2.0
Open(2,File = 'testFile2.inp')
Write(2,'(a)')'DIAG'
Write(2,'(a)')'REAC C2H4F2 ', [B]PHI[/B]
Close(2)
End
However the latter produces nonsense in the file for PHI.