!results using gfortran browning$ gfortran read_csv.f90 browning$ ./a.out ------------------------------------------------------------------------------------------ CASE 1 Read numbers from file into int/real variables: Results: I1 R1 R2 R3 I2 I3 1 1.00000000E+00 2.00000000E+00 3.00000000E+00 7 7 2 1.00000000E+00 0.00000000E+00 3.00000000E+00 0 7 0 1.00000000E+00 0.00000000E+00 3.00000000E+00 0 0 101 1.00000000E+00 2.00000000E+00 3.00000000E+00 7 7 102 1.00000000E+00 0.00000000E+00 3.00000000E+00 0 7 0 1.00000000E+00 0.00000000E+00 3.00000000E+00 0 0 End Of File Reached ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ CASE 2 Read numbers from file into string and then read from string into int/real variables: Results: I1 R1 R2 R3 I2 I3 1 1.00000000E+00 2.00000000E+00 3.00000000E+00 7 7 2 1.00000000E+00 0.00000000E+00 3.00000000E+00 0 7 0 1.00000000E+00 0.00000000E+00 3.00000000E+00 0 0 -99 -9.90000000E+01 -9.90000000E+01 -9.90000000E+01 -99 -99 -99 -9.90000000E+01 -9.90000000E+01 -9.90000000E+01 -99 -99 -99 -9.90000000E+01 -9.90000000E+01 -9.90000000E+01 -99 -99 End Of File Reached ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ CASE 3 Read numbers from file into string and then read from string into int/real variables: Add condition that if formatted read fails, then do list-directed read using * Results: I1 R1 R2 R3 I2 I3 1 1.00000000E+00 2.00000000E+00 3.00000000E+00 7 7 2 1.00000000E+00 0.00000000E+00 3.00000000E+00 0 7 0 1.00000000E+00 0.00000000E+00 3.00000000E+00 0 0 101 1.00000000E+00 2.00000000E+00 3.00000000E+00 7 7 102 1.00000000E+00 -9.90000000E+01 3.00000000E+00 -99 7 -99 1.00000000E+00 -9.90000000E+01 3.00000000E+00 -99 -99 End Of File Reached ------------------------------------------------------------------------------------------ NORMAL TERMINATION !results using ifort browning$ ifort read_csv.f90 browning$ ./a.out ------------------------------------------------------------------------------------------ CASE 1 Read numbers from file into int/real variables: Results: I1 R1 R2 R3 I2 I3 1 1.00000000E+00 2.00000000E+00 3.00000000E+00 7 7 2 1.00000000E+00 0.00000000E+00 3.00000000E+00 0 7 0 1.00000000E+00 0.00000000E+00 3.00000000E+00 0 0 101 1.00000000E+00 2.00000000E+00 3.00000000E+00 7 7 102 1.00000000E+00 0.00000000E+00 3.00000000E+00 0 7 0 1.00000000E+00 0.00000000E+00 3.00000000E+00 0 0 End Of File Reached ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ CASE 2 Read numbers from file into string and then read from string into int/real variables: Results: I1 R1 R2 R3 I2 I3 1 1.00000000E+00 2.00000000E+00 3.00000000E+00 7 7 2 1.00000000E+00 0.00000000E+00 3.00000000E+00 0 7 0 1.00000000E+00 0.00000000E+00 3.00000000E+00 0 0 101 1.00000000E+00 2.00000000E+00 3.00000000E+00 7 7 102 1.00000000E+00 0.00000000E+00 3.00000000E+00 0 7 0 1.00000000E+00 0.00000000E+00 3.00000000E+00 0 0 End Of File Reached ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ CASE 3 Read numbers from file into string and then read from string into int/real variables: Add condition that if formatted read fails, then do list-directed read using * Results: I1 R1 R2 R3 I2 I3 1 1.00000000E+00 2.00000000E+00 3.00000000E+00 7 7 2 1.00000000E+00 0.00000000E+00 3.00000000E+00 0 7 0 1.00000000E+00 0.00000000E+00 3.00000000E+00 0 0 101 1.00000000E+00 2.00000000E+00 3.00000000E+00 7 7 102 1.00000000E+00 0.00000000E+00 3.00000000E+00 0 7 0 1.00000000E+00 0.00000000E+00 3.00000000E+00 0 0 End Of File Reached ------------------------------------------------------------------------------------------ NORMAL TERMINATION