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

constant string passing as dummy argument

channel5
Beginner
516 Views
Dear all,

A fortran90 subroutine, with an argument which is character
array type, accepts a constant string as its dummy argument.
The real argument is declared as:

character, dimention(*) :: s

The constant string looks like

'I am a string...'

But the compiler reports:

"This subroutine has the wrong
number of arguments or arguments with the wrong name, type
or rank"

What is the problem with this?

Please reply to yxie@doc.ic.ac.uk as well.
0 Kudos
1 Reply
Steven_L_Intel1
Employee
516 Views
What you have declared is an array of one-byte character strings. What you evidently wanted instead was:

character(len=*) :: s

Steve
0 Kudos
Reply