Allocate Source= question

Allocate Source= question

Dear all,

I have a question regarding the following code snippet:

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 !}

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

5 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项

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.

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).

Thanks Roland. Do you have a bug ID for me to track?

I believe it is DPD200250346.

Steve - Intel Developer Support

发表评论

登录添加评论。还不是成员?立即加入