- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear all,
I have a question regarding the following code snippet:
[fortran]
MODULE TestModule !{
TYPE X0Type
REAL(KIND=8), DIMENSION(:),ALLOCATABLE :: X
ENDTYPE
TYPE SL_DataStrucType
REAL(KIND=8), DIMENSION(:), POINTER :: X
TYPE(X0Type), DIMENSION(:), POINTER :: StoredX0 => null()
ENDTYPE SL_DataStrucType
TYPE(SL_DataStrucType), POINTER :: DB_MMxSL_Data => null()
TYPE(X0Type), DIMENSION(:), POINTER :: StoredX0 => null()
CONTAINS
SUBROUTINE Test()
ALLOCATE(DB_MMxSL_Data%StoredX0(1))
ALLOCATE(DB_MMxSL_Data%X, SOURCE=StoredX0(1)%X)
ALLOCATE(DB_MMxSL_Data%X, SOURCE=DB_MMxSL_Data%StoredX0(1)%X)
END SUBROUTINE
ENDMODULE TestModule !}
[/fortran]
There seems not to be any problem with the upper allocate statement, but when the allocate option Source= is encompassed in a structure, I get the following compiler diagnostic:
error #8152: Neither the ERRMSG= variable nor any part of the source expression in SOURCE= or MOLD= specifiers may be allocated in the ALLOCATE statement in which it appears. [DB_MMXSL_DATA]
Can anyone explain the fundamental difference between the two allocate statements, that is causing in this error.
Dirk
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It looks like both these statements should be accepted by the compiler. I'll run this by our developers and let you know what they have to say.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Our developers agree this is a bug and will have a fix for it in the next update of our 14.0 Compiler (Composer XE 2013 SP1 Update 3).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Roland. Do you have a bug ID for me to track?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I believe it is DPD200250346.

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