Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Annonces
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29285 Discussions

Question about tabs as separators in list-directed read

grtoro
Débutant
420 Visites
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

0 Compliments
1 Répondre
Steven_L_Intel1
Employé
420 Visites
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.
0 Compliments
Répondre