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

IVF doc error? TYPE

jimdempseyatthecove
Honored Contributor III
257 Views

Index:

TYPE | TYPE Statement (Derived Type)

In the following example, a and b are both variable arrays of derived type pair:

 TYPE (pair)
   INTEGER i, j
 END TYPE
 TYPE (pair), DIMENSION (2, 2) :: a, b(3)

Is that correct? If so, explain further.

Jim Dempsey

0 Kudos
3 Replies
Steven_L_Intel1
Employee
257 Views

No, that first TYPE(pair) is incorrect. I will let the writers know - thanks.

I also don't like the use of b(3) in the declaration that has DIMENSION(2,2). It's legal but bad style in my opinion.

0 Kudos
jimdempseyatthecove
Honored Contributor III
257 Views

>>I also don't like the use of b(3) in the declaration that has DIMENSION(2,2). It's legal but bad style in my opinion.

Then what is b?

(1:3) or (1:2,1:2,1:3)

Jim Dempsey

0 Kudos
Steven_L_Intel1
Employee
257 Views

(1:3).

The type declaration statement also specifies the attributes whose keywords appear in the attr-spec, except that the DIMENSION attribute may be specified or overridden for an entity by the appearance of array-spec in its entity-decl , and the CODIMENSION attribute may be specified or overridden for an entity by the appearance of coarray-spec in its entity-decl .

0 Kudos
Reply