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

Linux ifort still fails to recognize an integer variable

Kathy_R_
Beginner
586 Views

Are you guys ever going to fix this? $ % cat test2.f program modtest c integer kno ! uncomment this and you're fine call getk( kno ) ! external subroutine c kno = 2 ! comment out the subroutine and uncomment this and you're fine if( kno .gt. 0 ) call dimen contains subroutine dimen real x(kno) if( kno .ge. 2 ) then x(1) = 1. x(2) = 2. print *, x(1), x(2) end if return end subroutine dimen end program modtest $ % ifort test2.f test2.f(5): error #6402: prPromoteSym : Illegal KIND & CLASS mix [KNO] call getk( kno ) ! external subroutine -----------------^ test2.f(7): error #6402: prPromoteSym : Illegal KIND & CLASS mix [KNO] if( kno .gt. 0 ) call dimen ----------^ test2.f(5): error #6279: A specification expression object must be a dummy argument, a COMMON block object, or an object accessible through host or use association [KNO] call getk( kno ) ! external subroutine -----------------^ test2.f(15): error #6402: prPromoteSym : Illegal KIND & CLASS mix [KNO] if( kno .ge. 2 ) then ----------^ compilation aborted for test2.f (code 1)

0 Kudos
4 Replies
Ron_Green
Moderator
586 Views

We fix things when bugs are reported.  Did you report this in the past, and if so when and was it on this Forum or in Premier?

I can get a bug report started but first let me know if there is one already open.

Thanks.

ron

0 Kudos
mecej4
Honored Contributor III
586 Views

Are you guys ever going to fix this?
There is no indication of what you want fixed. Perhaps, you are unaware that you could be misleading the compiler: your program source file has a ".f" ending, which signifies "fixed format Fortran source".

As a result, if the "c" of line with "contains" is in column-1, that gets treated as an indication that the line is a comment. Similarly for other lines with "c" or "C" in column-1.

After that, things go downhill for the compiler as far as understanding the program goes.

Change your program source file name to "test2.f90" and try again.

0 Kudos
Steven_L_Intel1
Employee
586 Views

When code is posted directly in the forum, all leading blanks are removed. From the error messages shown, it seems pretty clear that Kathy's code is formatted correctly/

To make it look better in the forum, bracket the code with [ fortran ] and [ /fortran ] (without the spaces.)

0 Kudos
Ron_Green
Moderator
586 Views

Kathy,

I entered a bug report for this.  We reply back when the issue is resolved in a released compiler.  Thank you for sending this in and helping us improve our compiler.

ron

0 Kudos
Reply