Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Read Statement

erheiqin
Beginner
368 Views
I am using read statement to read data from file, which contains data as types as 1 0.845149. I want to read these data into real numbers. What is the right format to do here? I tried many different ways. I could not get it.
Thanks
Erhei
0 Kudos
1 Reply
Jugoslav_Dujic
Valued Contributor II
368 Views

Use either list-directed input ("don't care about format"):

READ(11, *) F1, F2

or use "zero-precision" with F edit descriptor. Note that this is actually preferred method to read reals, as it does not care where the decimal point is actually located in the file:

READ(11, "(F3.0, F10.0)") F1, F2

Jugoslav

0 Kudos
Reply