- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
SubroutineFlareLoad (ANAME,...)
character*8 ANAME
...
end
CallFlareLoad ('signal',...)
forrtl: severe (408): fort: (18) Dummy character variable 'ANAME' has length 8
which is greater than actual variable length 6
Oh, the horror. Can I catch a break here? I can pad the argument 'signal ', or define ANAME as character*(*), but is there some compiler switch that will pad the argument for me? This worked right in 1998. Hmph.
character*8 ANAME
...
end
CallFlareLoad ('signal',...)
forrtl: severe (408): fort: (18) Dummy character variable 'ANAME' has length 8
which is greater than actual variable length 6
Oh, the horror. Can I catch a break here? I can pad the argument 'signal ', or define ANAME as character*(*), but is there some compiler switch that will pad the argument for me? This worked right in 1998. Hmph.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Section 12.4.1.2 of the Fortran 2003 standard says:
If a scalar dummy argument is of type default character, the length len of the dummy argument shall be less than or equal to the length of the actual argument. The dummy argument becomes associated with the leftmost len characters of the actual argument.
You probably had some run-time checking enabled in order to receive the #408 message for, otherwise, you could have run into an illegal access violation instead.
The following complete version of your program suffers an access violation when compiled and run with CVF 6.6.
If a scalar dummy argument is of type default character, the length len of the dummy argument shall be less than or equal to the length of the actual argument. The dummy argument becomes associated with the leftmost len characters of the actual argument.
You probably had some run-time checking enabled in order to receive the #408 message for, otherwise, you could have run into an illegal access violation instead.
The following complete version of your program suffers an access violation when compiled and run with CVF 6.6.
[fortran]Subroutine FlareLoad (ANAME) character*8 ANAME ANAME(8:8)='$' return end program buggy Call FlareLoad ('signal') write(*,'(1x,A90)')'Signal' end [/fortran]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It never worked "right" - you just never noticed. Use character(*).
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