The follwing code does not work, as it is not conforming to the standard:
TYPE CQUAD ! 200/00 QuadElements
SEQUENCE
INTEGER NR ! elementnumber
INTEGER NODE(4) ! nodenumbers
INTEGER MAT ! materialnumber
REAL*4 DET(0:2) ! Parameter of Jacobi Determinant
REAL*4 THICK(0:4) ! element thickness
REAL*4 T(3,3) ! transformation matrix
END TYPE CQUAD
TYPE, EXTENDS(CQUAD) :: C_QUAD ! EXTENDED QUAD STRUCTURE
INTEGER, POINTER :: SGRP(:) ! OPTIONAL LIST OF SECONDARY GROUPS
END TYPE C_QUAD
TYPE (CQUAD) :: DQ
TYPE (C_QUAD) :: CQ
call c_read_stream(DQ)
cq%CQUAD=DQ
END
The SEQUENCE or a BIND is required to allow passing the structure to a C-Program. I can not see any reason for the restrictions not to allow those types to be extended. (A Sequence type should not contain pointers etc, that is evident)
One solution to this problem is to use the UNION / MAP statements available in /DEC/IBM/INTEL Compilers, but they are not part of the standard.