192. Implied do loop can access arbitrary derived type array sections.#

topic: Derived types

Note

This tip is a draft1.

An implied do loop can be used to access a derived type array section at more than one level.

t(1:n)%c

is invalid for array component c but

[(t(i)%c,i=1,n)]

or the transpose

[((t(i)%c(j),i=1,size(t)),j=1,size_c)]

are allowed expressions.



1

From the perspective of FortranTip Browser, “draft” means that it hasn’t been edited for formatting, hasn’t had corresponding Fortran programs added, the text content hasn’t been enhanced, etc. Draft texts are extracted from the corresponding Tweet using the Twitter API.