Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29235 ディスカッション

Intel fortran complier error #8284.

Shaun_B_
ビギナー
2,088件の閲覧回数

I am trying to compile lsode(livermore solver for ordinary differential equation), I have the error:

lsode.f(1529): error #8284: A scalar actual argument must be passed to a scalar dummy argument unless the actual argument is of type character or is an element of an array that is neither assumed shape nor pointer.   [MSG]

lsode.f(1533): error #8284: A scalar actual argument must be passed to a scalar dummy argument unless the actual argument is of type character or is an element of an array that is neither assumed shape nor pointer. [MSG]

lsode.f(1535): error #8284: A scalar actual argument must be passed to a scalar dummy argument unless the actual argument is of type character or is an element of an array that is neither assumed shape nor pointer. [MSG]

 Here are the codes(in lsode.f):

80 call xerrwv(30hintdy-- k (=i1) illegal ,
1 30, 51, 0, 1, k, 0, 0, 0.0d0, 0.0d0)
iflag = -1
return
90 call xerrwv(30hintdy-- t (=r1) illegal ,
1 30, 52, 0, 0, 0, 0, 1, t, 0.0d0)
call xerrwv(
1 60h t not in interval tcur - hu (= r1) to tcur (=r2) ,
1 60, 52, 0, 0, 0, 0, 2, tp, tn)
iflag = -2
return

Is there any solution to this error.

Thanks,

Shaun

0 件の賞賛
7 返答(返信)
Steven_L_Intel1
従業員
2,088件の閲覧回数

Hollerith constants!  Fun! We really shouldn't be giving this error for passing Hollerith constants to an array, as that is how it was done "back in the day". Funny that this hadn't come up before.

I don't suppose I could convince you to rewrite the calls and the routine to use character arguments?

Here's the simple solution for now.  In your Visual Studio project, right click on the project, select Properties. Go to Fortran > Diagnostics.  Change "Check routine interfaces" to No and click OK.

I will report this to the developers.

TimP
名誉コントリビューター III
2,088件の閲覧回数

You could look up previous posts on this issue; the non-compliance of such legacy code can be ignored by disabling the /warn-interfaces option, or corrected by replacing the scalar arguments by arrays of size 1.

At the time this was written it was definitely non-portable but Fortran standard didn't require a warning on machines where it worked OK.

Steven_L_Intel1
従業員
2,088件の閲覧回数

It doesn't work in this case to "replace the scalar arguments by arrays of size 1", though in other cases that can be a fine approach.

The use of Hollerith here is exactly how one would have done this in F66. We should allow it.

bmchenry
新規コントリビューター II
2,088件の閲覧回数

i would suggest that you put in the effort and change the code from the dark hollerith ages...simply enclose the formerly hollerith messages in simple quotes, makes for cleaner code (count them hollerith characters!)

80 call xerrwv('intdy-- k (=i1) illegal',30, 51, 0, 1, k, 0, 0, 0.0d0, 0.0d0)
90 call xerrwv('intdy-- t (=r1) illegal' ,30, 52, 0, 0, 0, 0, 1, t, 0.0d0)
etc

andrew_4619
名誉コントリビューター III
2,088件の閲覧回数

that would still complain about arguament types as in this case you are passing a 30 character string into a dim 30 array of default integers of whatever KIND those my be. And depenant on what the KIND (word size) was some manipulation of the array may then follow...

Not a pleasant job if there is lots of code.....

mecej4
名誉コントリビューター III
2,088件の閲覧回数

bmcherry wrote:
simply enclose the formerly hollerith messages in simple quotes, makes for cleaner code (count them hollerith characters!)

For any but the shortest source files, that kind of gruntwork should not be done by hand -- especially the counting of characters! Silverfrost/Salford Fortran has a /CONVERT option that takes reads source files with Hollerith strings as in the snippet above and prints out quoted strings.That converter does not pad lines on the right, so make sure that the text editor used does not truncate lines by removing terminal blanks! For example, the line "call xerrwv(30hintdy-- k (=i1) illegal ," does not contain the necessary 30 characters after "30h".

Steven_L_Intel1
従業員
2,088件の閲覧回数

I expect the inappropriate error message to be resolved in a release later this year.

返信