Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Allocate Source= question

A__Valle
Beginner
998 Views

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

0 Kudos
4 Replies
Roland_W_Intel1
Employee
998 Views

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.

0 Kudos
Roland_W_Intel1
Employee
998 Views

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

0 Kudos
A__Valle
Beginner
998 Views

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

0 Kudos
Steven_L_Intel1
Employee
998 Views

I believe it is DPD200250346.

0 Kudos
Reply