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

error #7836 : "If the actual argument is scalar, the corresponding dummy argument shall be scalar etc..."

vincent-torri
Beginner
806 Views
Hey

I'm trying to compile a program with the latest intel fortran compiler.

I have an error during compilation. The part of the code which is relevant is;

SUBROUTINE TNBC (N, IPIVOT)
INTEGER N, IPIVOT(N)

...

CALL MODLNP (IPIVOT)

...

END

SUBROUTINE MODLNP(IPIVOT)
INTEGER IPIVOT(1)

...

END

Error:

"If the actual argument is scalar, the corresponding dummy argument shall be scalar, unless the actual argument is an element of an array that is not an assumed-shape or pointer array, or a substring of such an element (IPIVOT)"

The error during the call of MODLNP()

I am not an expert, Im just trying to compile a fortran code. So I'm more looking for a solution rather than an explanation of the error.

thank you

Vincent Torri
0 Kudos
6 Replies
vincent-torri
Beginner
806 Views

a more precise code:

SUBROUTINE TNBC (N, IPIVOT)
INTEGER N, IPIVOT(N)

...

CALL MODLNP(IPIVOT)

...

END

SUBROUTINE MODLNP(N, IPIVOT)
INTEGER N, IPIVOT(1)

...

CALL ZTIME(N, R, IPIVOT)

...

END

SUBROUTINE ZTIME (N, X, IPIVOT)
INTEGER IPIVOT(N)

...

END


IPIVOT is only used with ZTIME

Vincent Torri
0 Kudos
Steven_L_Intel1
Employee
806 Views

I can't reproduce the exact error message you show - I suspect the actual code is different than what you posted here. But I think that instead of:

CALL MODLNP(IPIVOT)

you want

CALL MODLNP(N,IPIVOT)
0 Kudos
vincent-torri
Beginner
806 Views

I can't reproduce the exact error message you show - I suspect the actual code is different than what you posted here. But I think that instead of:

CALL MODLNP(IPIVOT)

you want

CALL MODLNP(N,IPIVOT)

Indeed, see the second code. Actually, i managed to get the code compiling. Strange thing:

* if I compile in debug mode, I have the error
* if I compile in release mode, i don't have the error anymore.

is there an explanation to such behavior ?
0 Kudos
Steven_L_Intel1
Employee
806 Views

Your second code has the error I noted. The difference between debug and release is that in a Debug configuration, the "Generated interface checking" diagnostic feature is enabled by default, where it is off by default in a Release configuration. With this on, the compiler checks for consistency of calls to "external" procedures that don't have explicit interfaces.

That you don't get an error message in Release mode doesn't mean your code is correct, only that the compiler is no longer checking for this kind of error.
0 Kudos
DavidWhite
Valued Contributor II
806 Views
Quoting - vtorri
Hey

I'm trying to compile a program with the latest intel fortran compiler.

I have an error during compilation. The part of the code which is relevant is;

SUBROUTINE TNBC (N, IPIVOT)
INTEGER N, IPIVOT(N)

...

CALL MODLNP (IPIVOT)

...

END

SUBROUTINE MODLNP(IPIVOT)
INTEGER IPIVOT(1)

...

END

Error:

"If the actual argument is scalar, the corresponding dummy argument shall be scalar, unless the actual argument is an element of an array that is not an assumed-shape or pointer array, or a substring of such an element (IPIVOT)"

The error during the call of MODLNP()

I am not an expert, Im just trying to compile a fortran code. So I'm more looking for a solution rather than an explanation of the error.

thank you

Vincent Torri

in TNBC, you are declaring IPIVOT with dimension (N)
in MODLNP, IPIOVT is declared as dimension (1), this should probably be (*). Declaring variable size arrays as dimension (1) is obsolete and (*) should be used, or the actual size.

David
0 Kudos
Steven_L_Intel1
Employee
806 Views

That's true, but it would not result in that error message and the Intel compiler treats (1) as (*).
0 Kudos
Reply