- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I'm getting a strange array out of bounds error when I try to print a 2D array by row in a contained procedure. I'm using the latest version of IVF with VS Community 2015 and all the default settings.
I have a hacky fix which is included in the snippet below, but just wondered if anyone could help; am I at fault, or is this a bug? I think its something to do with allocating a temporary array for a write statement, but perhaps someone who knows a bit more could explain?
Thanks,
Michael
program LowerBoundError implicit none integer, parameter :: dim = 3 double precision :: bigVector( dim * dim ) integer :: iGlb ! Initialize bigVector = 0 call WriteArrays( dim, bigVector ) contains subroutine WriteArrays( d, b ) integer, intent(in) :: d double precision, intent(in) :: b(:) double precision :: tmp(d) integer :: i write(*,*) d write(*,*) b ! write by row do i = 1, d ! This crashes write(*,*) b( i : : d ) ! However this works tmp = b( i : : d ) write(*,*) tmp end do end subroutine WriteArrays end program LowerBoundError
and the error message:
an error forrtl: severe (408): fort: (3): Subscript #1 of the array B has value -858993460 which is less than the lower bound of 1
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am unable to reproduce this in VS2015 + ifort 17.0.4 or 18.0 Beta.
![](/skins/images/C4F7392A5C68ACA60290C9576F107044/responsive_peak/images/icon_anonymous_message.png)
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