extension request - masked do loop

extension request - masked do loop

In the spirit of Run it up the flagpole and see if
anyone salutes, this proposes the following modest
language extension.

[name:] &
LOOP (triplet-spec [,triplet-spec]...[, mask-expr])
END LOOP [name]

Note the proposed syntax matches that of the FORALL
construct which was a DIGITAL F90 extension.
LOOP differs from FORALL in that any statement allowed
in the body of an ordinary DO loop is allowed within the
LOOP construct.

The first triplet-spec specifies the outermost loop.
Thus with two triplet-specs, the proposed construct
would execute exactly as the F77 construct:

DO i = i1, i2, i3 ! first triplet
DO j = j1, j2, j3 ! second triplet
IF (mask-expr) THEN

The keyword LOOP is tentative; other candidate keywords
include: DoFor, DoMask, DoOver, NEST, or VFDO. Compiler
writer to choose the keyword.

Arguments for this extension are: it is more F95-like;
it is a relatively common need; and it saves at least
one level of indentation. Anyone else think it worth

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

FYI - FORALL was a feature from High-Performance Fortran (HPF) that was subsequently adopted into Fortran 95. It wasn't our invention.


Retired 12/31/2016

Leave a Comment

Please sign in to add a comment. Not a member? Join today