- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What you have declared is an array of one-byte character strings. What you evidently wanted instead was:
character(len=*) :: s
Steve
character(len=*) :: s
Steve

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page