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

Error: The shapes of the array expressions do not conform. [YY]

TommyCee
Beginner
5,026 Views
I'm trying to rearrange some Fortran code that was initially F77 and compile it as F90. So far so good. I have a MAIN program and am, little by little, moving subroutines up into a MODULE (for ease in maintenance). Several subroutines have been mofed w/ no issues for compile/link.

In one of the functions I just moved up to MODULE, I got this error message from the CVF compiler:

Error: The shapes of the array expressions do not conform. [YY]

Strangely, YY is not an array in this function - it's just a real variable

Has anyone else seen this kind of error trigger, and if so, what is it probably really complaining about?
Any thoughts are appreciated.
0 Kudos
4 Replies
netphilou31
New Contributor III
5,026 Views
Hi,
It's difficult to have a clear idea of what happens w/o looking at the source code.
Wich version of IVF do you use?
One Possibility could be that you have defined a variable local to the module with the same name YY?

0 Kudos
abhimodak
New Contributor I
5,026 Views
Hi TommyCee

A sample code would give you more chance of an exact answer. Please see if you can give a small snippet. (I am thinking that the compiler is reporting that somewhere scalar == array is happening. )

Meanwhile below is a one program that will give the error you are getting. Perhaps that will give you a clue. {In the program k is integer scalar whereas intrinsic function maxloc will return an integer array (of size 1 in this case) and that gives a mismatch.}

In your case may be the function also returns an array and you are assigning it to a scalar.

Abhi

[fxfortran]      Program Main
         Integer :: k
         Integer :: J(2)
         J(1) = 1
         J(2) = 2
         k = maxloc(J)
      End Program Main[/fxfortran]


0 Kudos
Steven_L_Intel1
Employee
5,026 Views
Be careful about module-scope variables when moving routines to a module. It can get you in trouble if you're not careful.
0 Kudos
TommyCee
Beginner
5,026 Views
No, I actualy don't have any YY variable appearing in the Module. And I should mention that the compiler actually gave the same error regarding 2 other variables that also were not arrays.

It's probably something pretty tricky. I'm doing some testing to help isolate the problem.
0 Kudos
Reply