Linux ifort still fails to recognize an integer variable

Linux ifort still fails to recognize an integer variable

Bild des Benutzers Kathy R.

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)

5 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.
Bild des Benutzers Ronald W Green (Intel)

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

Bild des Benutzers mecej4

Zitat:

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.

Bild des Benutzers Steve Lionel (Intel)

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.)

Steve
Bild des Benutzers Ronald W Green (Intel)

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

Melden Sie sich an, um einen Kommentar zu hinterlassen.