- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The subroutine below will crash when the LEN keyword refers directly to the array W. I am using IVF 11.1, maybe this has been corrected in later versions.
[fortran]SUBROUTINE ANOTHER_TEST IMPLICIT NONE TYPE T_F CHARACTER(LEN=:),ALLOCATABLE :: VAL END TYPE T_F TYPE(T_F),ALLOCATABLE :: F(:) INTEGER :: N = 2 INTEGER :: W(2) = [6,12] INTEGER :: I,W_TEMP ALLOCATE(F(N)) DO I=1,N W_TEMP = W(I) !ALLOCATE(CHARACTER(LEN=W(I)) :: F(I)%VAL) ! This doesn't work. ALLOCATE(CHARACTER(LEN=W_TEMP) :: F(I)%VAL) ! This is ok. END DO END SUBROUTINE ANOTHER_TEST[/fortran]Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You don't say what the "crash" is nor the options being used - I'm not sure if I'm seeing the same thing you are. I do see, with uninitialized variable checking, an error for a use of I uninitialized which seems inappropriate. Is that what you see? I reported that as issue DPD200181457.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
I get the following error, in Debug mode:
forrtl: severe (408): fort (11): Subscript #1 of the array W has value 0 which is less than the lower bound of 1.
This is probably what you observed as well.
Olivier
I get the following error, in Debug mode:
forrtl: severe (408): fort (11): Subscript #1 of the array W has value 0 which is less than the lower bound of 1.
This is probably what you observed as well.
Olivier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, I didn't see that. But I can reproduce that too.
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