- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following simple code compiles with no errors or warnings, but generates a run-time error [forrtl: severe (408): fort: (10)..]. I think the code is alright, please correct me otherwise.
module m implicit none private type, public :: t(n) private integer, len :: n = 1 integer :: m_x(n) contains procedure, pass(this), public :: load => load_t_x end type t contains subroutine load_t_x(this, dat) class(t(*)), intent(inout) :: this integer(kind=kind(this%m_x)), intent(in) :: dat(:) this%m_x = dat return end subroutine load_t_x end module m program p use m, only : t type(t(n=2)) :: foo call foo%load( [ 1, 2 ] ) stop end program p
Upon execution,
forrtl: severe (408): fort: (10): Subscript #1 of the array M_X has value 1 whic h is greater than the upper bound of 0 Image PC Routine Line Source p.exe 000000013F9744B0 Unknown Unknown Unknown p.exe 000000013F9710BD M_mp_LOAD_T_X 22 m.f90 p.exe 000000013F971349 MAIN__ 7 p.f90 p.exe 000000013F99707E Unknown Unknown Unknown p.exe 000000013F997360 Unknown Unknown Unknown kernel32.dll 00000000772359ED Unknown Unknown Unknown ntdll.dll 000000007736BA01 Unknown Unknown Unknown Press any key to continue . . .
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
From what I can see, it's only the bounds checking error that is the problem, as the assignment is otherwise done successfully. Escalated as issue DPD200367073. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Steve. Yes, /check:bounds option was being used. Now I have a workaround.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I expect this to be fixed in Update 3, due in May.

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