Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29285 Discussions

Error: The type of the actual argument differs from the type of the dummy argument

hamid3252
Beginner
891 Views

Hi everybody!

I am a new user in writing code FORTRAN and I just want to compile a preexisting code which has been compiled and used previously, but with the new version, it seems to have some problems. The issue is I have a subroutine like:

SUBROUTINE UMAT(props, nprops)

dimensionprops(nprops)

But at this line

CALL ROTATION (PROPS(57), ROTATE)

the compiler gives me an error regarding data type conversion problem or something like that, which is "Error: The type of the actual argument differs from the type of the dummy argument"

I have read an article regarding the issue in

http://www.ncsa.illinois.edu/UserInfo/Resources/Software/Intel/Compilers/9.0/F_ReleaseNotes.htm

but as I told, since I am new to FORTRAN, the solution is not clear to me yet.I have a good background in C++ and JAVA, though. So please help me solve the issue.

Thank you,

Hamid,

P.S. I am using intel Fortran v10, x64

0 Kudos
3 Replies
ZlamalJakub
New Contributor III
891 Views

You did not say anything about declaration of subroutine ROTATION. It is hard to help where can be problem.

I think problem is that you do not declare data types of variables so implicit data types are used.

Jakub

0 Kudos
peterklaver
Beginner
891 Views

To amplify a little for someone who is "new to FORTRAN", the data types of the actual arguments (in the subroutine call) must be the same as the dummy arguments (in the subroutine itself). In particular, we see that "nprops" is used to dimension the array "props", which means it ought to be an integer. The variable "ROTATE", then, must also be an integer. If, however, you do not explictly declare the variable types, and instead rely on FORTRAN implicit variable types, then "ROTATE" will be a real (floating point) and "nprops" will be an integer. That would produce the compiler error you're getting.

0 Kudos
onkelhotte
New Contributor II
891 Views

Hi Hamid,

a little bit more code would be helpful.

As stated before, you have to make sure that the two data types of the arguments (as declared in SUBROUTINE ROTATION) has to be the same as Props and Rotate.

Example:

[bash]subroutine foo(Number)
real(kind=4) Number
...
end subroutine[/bash]

Later on you call foo:

[bash]integer(kind=4)::intNumber=5
call foo(intNumber)[/bash]

But that would cause your error. foo wants a real and gets an integer. A solution for that would be

[bash]call foo(real(intNumber))[/bash]

or your declare Number as integer.

Markus

0 Kudos
Reply