陣列區段的等級和形狀
對於不是結構元件子物件的陣列區段,等級是 section_subscript_list中的下標三元組及向量下標數目。 形狀陣列中的元素數與下標三元組和向量下標數相同,形狀陣列中的每個元素數是對應下標三元組或向量下標所指定序列中的整數值數。
對於作為結構元件子物件的陣列區段,等級和形狀與元件部分 (陣列名稱或陣列區段) 的等級和形狀相同。
DIMENSION :: ARR1(10,20,100)
TYPE STRUCT2_T
LOGICAL SCALAR_COMPONENT
END TYPE
TYPE STRUCT_T
TYPE (STRUCT2_T), DIMENSION(10,20,100) :: SECTION
END TYPE
TYPE (STRUCT_T) STRUCT
! One triplet + one vector subscript, rank = 2.
! Triplet designates an extent of 10, vector subscript designates
! an extent of 3, thus shape = (/ 10,3 /).
ARR1(:, (/ 1,3,4 /), 10) = 0
! One triplet, rank = 1.
! Triplet designates 5 values, thus shape = (/ 5 /).
STRUCT%SECTION(1,10,1:5)%SCALAR_COMPONENT = .TRUE.
! Here SECTION is the part of the component that is an array,
! so rank = 3 and shape = (/ 10,20,100 /), the same as SECTION.
STRUCT%SECTION%SCALAR_COMPONENT = .TRUE.