Understanding how array sections and structure components interact requires a familiarity with the syntax for Derived type components.
What we defined at the beginning of this section as an array section is really only a subset of the possible array sections. An array name or array name with a section_subscript_list can be a subobject of a structure component:
>>-object_name--+------------------------------+----------------> '-(--section_subscript_list--)-' .----------------------------------------------------. V | >----+-%-+--comp_name--+------------------------------+-+-------> '-.-' '-(--section_subscript_list--)-' >--+-----------------+----------------------------------------->< '-substring_range-'
TYPE BUILDING_T
LOGICAL RESIDENTIAL
END TYPE BUILDING_T
TYPE STREET_T
TYPE (BUILDING_T) ADDRESS(500)
END TYPE STREET_T
TYPE CITY_T
TYPE (STREET_T) STREET(100,100)
END TYPE CITY_T
TYPE (CITY_T) PARIS
TYPE (STREET_T) S
TYPE (BUILDING_T) RESTAURANT
! LHS is not an array section, no subscript triplets or vector subscripts.
PARIS%STREET(10,20) = S
! None of the parts are array sections, but the entire construct
! is a section because STREET has a nonzero rank and is not
! the rightmost part.
PARIS%STREET%ADDRESS(100) = BUILDING_T(.TRUE.)
! STREET(50:100,10) is an array section, making the LHS an array section
! with rank=1, shape=(/51/).
! ADDRESS(123) must not be an array section because only one can appear
! in a reference to a structure component.
PARIS%STREET(50:100,10)%ADDRESS(123)%RESIDENTIAL = .TRUE.
END