- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following simple code encounters an unexpected run-time error:
module m type, public :: t( m, n ) private integer, len :: m integer, len :: n real :: m_a( m:n ) contains private procedure, pass(this), public :: init => init_a_t end type t contains subroutine init_a_t( this ) class(t(*,*)), intent(inout) :: this print *, " lbound of this%m_a = ", lbound(this%m_a, dim=1) print *, " ubound of this%m_a = ", ubound(this%m_a, dim=1) this%m_a = 0.0 return end subroutine init_a_t end module m program p use m, only : t implicit none type(t(-1,1)) :: foo call foo%init() stop end program p
Upon execution with Intel Fortran compiler version 2015, update 4:
lbound of this%m_a = -1 ubound of this%m_a = 1 forrtl: severe (408): fort: (11): Subscript #1 of the array M_A has value -1 whi ch is less than the lower bound of 0 Image PC Routine Line Source p64.exe 000000013FF3BAD0 Unknown Unknown Unknown p64.exe 000000013FF316EE M_mp_INIT_A_T 22 m.f90 p64.exe 000000013FF31931 MAIN__ 9 p.f90 p64.exe 000000013FFBDE6E Unknown Unknown Unknown p64.exe 000000013FFBE93C Unknown Unknown Unknown p64.exe 000000013FFBEA7E Unknown Unknown Unknown kernel32.dll 00000000776159DD Unknown Unknown Unknown ntdll.dll 00000000779AA551 Unknown Unknown Unknown Press any key to continue . . .
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, we'll check it out. Escalated as issue DPD200372522. It seems to be just the bounds checking - the assignment is done correctly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Steve.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve Lionel (Intel) wrote:
.. - the assignment is done correctly.
Steve,
Can you please look into this variation involving an ASSOCIATE construct as well? So as you indicate, the assignment is done correctly if bounds checking is removed. However, the array information doesn't seem to extend to the ASSOCIATE block:
module m type, public :: t( m, n ) private integer, len :: m integer, len :: n real :: m_a( m:n ) contains private procedure, pass(this), public :: init => init_a_t end type t contains subroutine init_a_t( this ) class(t(*,*)), intent(inout) :: this print *, " lbound of this%m_a = ", lbound(this%m_a, dim=1) print *, " ubound of this%m_a = ", ubound(this%m_a, dim=1) this%m_a = 0.0 print *, " this%m_a = ", this%m_a asc: associate ( a => this%m_a ) print *, " lbound of a = ", lbound(a, dim=1) print *, " ubound of a = ", ubound(a, dim=1) print *, " a = ", a end associate asc return end subroutine init_a_t end module m
program p use m, only : t implicit none type(t(-1,1)) :: foo call foo%init() stop end program p
Upon execution,
lbound of this%m_a = -1 ubound of this%m_a = 1 this%m_a = 0.000000 0.000000 0.000000 lbound of a = 0 ubound of a = 0 a = 0.000000 Press any key to continue . . .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is pretty much the same as the issue you reported in https://software.intel.com/en-us/forums/topic/542743 I've added this example to that issue, DPD200367383.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Good catch about issue ID DPD200367383. I was under the impression that was fixed. I'm having a tough time keeping track of what works with PDTs in what Ifort version and what all issues are still pending, even those submitted by me. It looks like I need to wait a while before I can consider incorporating PDTs into my code designs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I expect the initial problem reported here to get fixed in 16.0 Update 1.

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