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

old and new version of compiler

Marcos_Siqueira
Beginner
420 Views
Theversion 11 of Intel fortran compiler not execute the code above whenckeck bounds and routine interface options are activated.

In my case, it is not an error.

In old version, it was possible have bounds check without error.

What option can i use to run this program having check bpunds active.

Thank you,
Marcos

program test
implicit none
character*4 array_char_name(3*12)
array_char_name=''
! asssign values
call test_subroutin(array_char_name)
call print_read_values(array_char_name)
pause
stop
end

subroutine test_subroutin(names)
implicit none
character*12 names(3)
names(1)='one_xxxxxxxx'
names(2)='two_xxxxxxxx'
names(3)='tre_xxxxxxxx'
return
end

subroutine print_read_values(names)
implicit none
character*12 names(3)
write(*,*) names
return
end


0 Kudos
2 Replies
Steven_L_Intel1
Employee
420 Views
I think this is a compiler bug. If the argument was a scalar, it would be required that the length of the dummy argument be equal to or less than that of the actual argument, and the compiler now checks that. But it incorrectly does this check when the dummy argument is an array, where the only requirement is that the total length of the dummy can't exceed that of the actual, which it doesn't in your case. What's worse is that both generated interface checking and run-time bounds checking get this wrong.

I'll report this to the developers. The issue ID is DPD200139004. A workaround is to declare a second variable that is character*12 and EQUIVALENCE it to the CHARACTER*4 variable, passing the *12 variable, like this:

character*4 array_char_name(3*12)
character*12 array2(3*4)
equivalence (array_char_name, array2)
array_char_name=''
! asssign values
call test_subroutin(array2)
0 Kudos
Steven_L_Intel1
Employee
420 Views
I am told that this bug is fixed - the fix should appear in Update 3.
0 Kudos
Reply