- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following code generates an internal compiler error with 14.0.3.202:
MODULE rng_state
TYPE StateType
INTEGER, ALLOCATABLE :: s(:)
END TYPE StateType
TYPE (StateType) :: state
CONTAINS
SUBROUTINE get()
INTEGER :: i
CALL RANDOM_SEED(size=i)
IF (.NOT. ALLOCATED(state%s)) ALLOCATE( state%s(i) )
CALL random_seed(get=state%s)
END SUBROUTINE get
END MODULE rng_state
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, we'll check it out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can reproduce this and have escalated it to development as issue DPD200358912.
A workaround is to do this:
SUBROUTINE get()
INTEGER :: i
integer, allocatable :: state_temp(:)
CALL RANDOM_SEED(size=i)
ALLOCATE(state_temp(i))
CALL random_seed(get=state_temp)
CALL move_alloc(FROM=state_temp, TO=state%s)
END SUBROUTINE get
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This bug has been fixed for an update later this year (not in the initial 15.0 release.)
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