The issue is involved, but it has boiled down missing restrictions
on DATA statements in BLOCK constructs. The objects in a DATA
statement must have their rank known and their type and type
parameter values known before they can appear. That is all OK
here, so I see nothing in the standard that makes the program I
provided nonconforming. I do not doubt that it is intended to be
nonconforming, but I do not think the standard makes it
nonconforming.
There is a statement in subclause 19.4 that seems to require the
DATA statement to appear in the specification part of the BLOCK
construct, but the statement in 19.4 is overridden by a more general
statement in the description of the BLOCK construct.
I have since constructed a new example where the DATA
statement appears in the specification part of the BLOCK
construct and the problem still occurs. Getting it right does not
seem easy, and the feature is of little consequence.
If the standard requires this case to be conforming, it will add
pain for compiler writers for little practical benefit to programmers.
The feature of DATA statements among executable statements
was made obsolescent in Fortran 90.