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

Shape matching rules of actual and dummy arguments have been violated

Ashley_Weinstein
Beginner
1,827 Views
OK, so it's obvious this old source has lots of issues.

So even though this exact same code has compiled just fine in other IVF project instances, I am getting the following error with regards to one project:

error #6634: Shape matching rules of actual and dummy arguments have been violated [CVAR]

Below are the snippets related to this variable:

SUBROUTINE SUBX

PARAMETER (NEQU1=1)
CHARACTER*8 CVAR(NEQU1)
DOUBLE PRECISION DVAR(NEQU1)
EQUIVALENCE ( CVAR(1), DVAR(1) )

CALL SUBY(a,b,c,d,e,f)

SUBROUTINE SUBY(a,b,c,d,e,f)
CHARACTER*8 b

DO I = 1, 8
b(I:I) = SUBZ(a,Ind1+Count+I,Key(I:I))
ENDDO

I get why the compiler is having issues. 'CVAR' is defined in 'SUBX' as being 'CVAR(1)' (i.e. an array with one slot, ha ha). Then 'CVAR' is passed to 'SUBY' into variable 'b' and then in 'SUBY' the code is asking to fill 'b(I)' from I=1 to 8.

Can anyone explain why it would compile ok in one IVF project then not ok in another IVF project???
0 Kudos
1 Solution
Anonymous66
Valued Contributor I
1,827 Views
The most likely explanation is that the project giving an error message has been compiled with the option /warn:interfaces or /warn:all and the other project was not.

The option/warn:interfaces checks if calls to a procedure matches with its definition.

View solution in original post

0 Kudos
2 Replies
Anonymous66
Valued Contributor I
1,828 Views
The most likely explanation is that the project giving an error message has been compiled with the option /warn:interfaces or /warn:all and the other project was not.

The option/warn:interfaces checks if calls to a procedure matches with its definition.
0 Kudos
Ashley_Weinstein
Beginner
1,827 Views
Thanks Annalee, it was exactly what you mentioned in your post.
0 Kudos
Reply