- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is my question:
Suppose a particular a file contains the following line (pasted from you know which program):
124
I have the instruction (once):
READ(5,*) A,B,C
Do I get values of 1., 2., and 0.?
Do I get values of 1., 2., and 4.?
I am using the latest Intel Fortran compiler (or composer, I guess).
Does the fortran standard say anything about the repeated tabs should be treated (one separator or two)?
Thanks,
Gabriel
Suppose a particular a file contains the following line (pasted from you know which program):
1
I have the instruction (once):
READ(5,*) A,B,C
Do I get values of 1., 2., and 0.?
Do I get values of 1., 2., and 4.?
I am using the latest Intel Fortran compiler (or composer, I guess).
Does the fortran standard say anything about the repeated tabs should be treated (one separator or two)?
Thanks,
Gabriel
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Fortran standard doesn't include tabs as valid in list-directed input - indeed, tab is not even in the Fortran character set. However, the standard treats whitespace, "one or more contiguous blanks", as a value separator. Intel Fortran treats tabs identically to blanks in list-directed input, so your example would get values 1, 2 and 4. Since your input is non-standard, the results are implementation-dependent.
My advice is not to use tabs in list-directed input.
My advice is not to use tabs in list-directed input.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page