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

Input Errorreal constant with a kind-parameter

asymptotic
Beginner
592 Views

real(kind = 8):: x
read(*, *) x

when I input -- 1.0_8 List-Directed I/O syntax errorIntel Fortran 12.0 Compiler.
I don't know whyreal constant with kind-parameter as a input, the compiler message
a error? The Fortran 2003 Standard mention this situation?

Thanks a lot.

0 Kudos
2 Replies
Steven_L_Intel1
Employee
592 Views
I understand why you might try that, but it's not allowed in Fortran. The kind is taken from the corresponding variable in the I/O list.
0 Kudos
asymptotic
Beginner
592 Views

Thanks a lot.

These days I look through --- The Fortran 2003 Handbook chapter 10, and I find the following sentences:

the input values are not actually Fortran constants. They do not have to follow all the rules for Fortran literal constants and they are not allowed to have kind parameter.

0 Kudos
Reply