- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi!
I have a problem with the character length check and optional variables (ifort 11.1.056). Maybe someone can help me with this problem....
With the code:
!-------------------- test.f90
If I compile with : ifort -g -check all -o test test.f90
the result is:
forrtl: severe (408): fort: (18): Dummy character variable 'STRING2' has length 20 which is greater then actual variable length 0
Image PC Routine Line Source
test_chars 000000000047140D Unknown Unknown Unknown
test_chars 000000000046FF15 Unknown Unknown Unknown
test_chars 00000000004215F9 Unknown Unknown Unknown
test_chars 000000000040401F Unknown Unknown Unknown
test_chars 0000000000404422 Unknown Unknown Unknown
test_chars 0000000000402C32 Unknown Unknown Unknown
test_chars 0000000000402B7B Unknown Unknown Unknown
test_chars 0000000000402AFC Unknown Unknown Unknown
libc.so.6 00007F0BA4FF1466 Unknown Unknown Unknown
test_chars 0000000000402A29 Unknown Unknown Unknown
If I just use : ifort -g -o test test.f90, the results its OK.
Thanks
I have a problem with the character length check and optional variables (ifort 11.1.056). Maybe someone can help me with this problem....
With the code:
!-------------------- test.f90
[cpp]module strings!-----------------------------------
public
integer, parameter :: namesize = 20
end module strings
program test
character(30) :: string1, string2
interface
subroutine sub_chars_1(string1,string2)
use strings
character(namesize), optional, intent(in) :: string1
character(namesize), optional, intent(in) :: string2
end subroutine sub_chars_1
end interface
string1 = ' this is string 1'
string2 = ' this is string 2'
call sub_chars_1(string1=string1)
end program test
subroutine sub_chars_1(string1,string2)
use strings
character(namesize), optional, intent(in) :: string1
character(namesize), optional, intent(in) :: string2
interface
subroutine sub_chars_2(string1,string2)
use strings
character(namesize), optional, intent(in) :: string1
character(namesize), optional, intent(in) :: string2
end subroutine sub_chars_2
end interface
call sub_chars_2(string1,string2)
end subroutine sub_chars_1
subroutine sub_chars_2(string1,string2)
use strings
character(namesize), optional, intent(in) :: string1
character(namesize), optional, intent(in) :: string2
if(present(string1)) print*,' String 1 :',trim(string1)
if(present(string2)) print*,' String 2 :',trim(string2)
end subroutine sub_chars_2[/cpp]
If I compile with : ifort -g -check all -o test test.f90
the result is:
forrtl: severe (408): fort: (18): Dummy character variable 'STRING2' has length 20 which is greater then actual variable length 0
Image PC Routine Line Source
test_chars 000000000047140D Unknown Unknown Unknown
test_chars 000000000046FF15 Unknown Unknown Unknown
test_chars 00000000004215F9 Unknown Unknown Unknown
test_chars 000000000040401F Unknown Unknown Unknown
test_chars 0000000000404422 Unknown Unknown Unknown
test_chars 0000000000402C32 Unknown Unknown Unknown
test_chars 0000000000402B7B Unknown Unknown Unknown
test_chars 0000000000402AFC Unknown Unknown Unknown
libc.so.6 00007F0BA4FF1466 Unknown Unknown Unknown
test_chars 0000000000402A29 Unknown Unknown Unknown
If I just use : ifort -g -o test test.f90, the results its OK.
Thanks
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is a compiler bug that was previously reported - the issue ID is DPD200140203.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Steve.
Do you know when will be available the next update of the ifort?
Do you know when will be available the next update of the ifort?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The next update is scheduled for late October, but the fix for this bug is unlikely to be in that. It should be in the next one (Update 4), which I think is planned for late November.
This error occurs only if you use a fixed length in the subroutine's declaration of the argument. I recommend using CHARACTER(*) instead - this is less error prone and will avoid this bug.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This issue is resolved in Update 4, available now.

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