Fortran Programming Guide

SAVELAST

The SAVELAST qualifier specifies that all private scalars and arrays are STOREBACK for the DOALL loop. A STOREBACK variable or array is one whose value is computed in a DOALL loop; this computed value can be used after the termination of the loop. In other words, the last loop iteration values of STOREBACK scalars and arrays may be visible outside of the DOALL loop.

Example: Specify SAVELAST:


C$PAR DOALL PRIVATE(x,y), SAVELAST 
      do i = 1, n
        x = ...
        y = ...
      end do
      ... = i
      ... = x
      ... = y

In the preceding example, variables x, y, and i are STOREBACK variables.