J3/15-131r1 To: J3 Subject: Variables in a BLOCK construct in a DO CONCURRENT construct From: Van Snyder Date: 2015 February 18 Reference: 15-007 There was some correspondence about variables being separately private to each iteration of a DO CONCURRENT construct. Declaring them in a BLOCK construct within a DO CONCURRENT construct makes them separately private to each iteration. NOTE 8.11 mentions this, but the interesting case is a variable that is conditionally defined within the construct. [180:4+8-5-1 NOTE 8.11] Revise NOTE 8.11 "NOTE 8.11 A variable that is effectively local to each iteration of a DO CONCURRENT construct can be declared in a BLOCK construct within it. For example: T = ... ... DO CONCURRENT ( I = 1 : N ) BLOCK REAL :: T IF ( A(I) > 0 ) THEN T = SQRT(A(I)) B(I) = T + T**3 END IF END BLOCK END DO The variable T that is declared within the BLOCK construct does not exist outside the construct. There is therefore no question whether the T that exists outside the DO CONCURRENT construct has been modified in one iteration (and therefore retains that value), or more than one iteration (and therefore becomes undefined). "