24.05.2014 Views

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

NEW<br />

Use the NEW directive to specify which variables should be local in a PARALLEL<br />

DO loop or a PARALLEL SECTIONS construct. This directive per<strong>for</strong>ms the same<br />

function as the PRIVATE clause of the PARALLEL DO directive and PARALLEL<br />

SECTIONS directive.<br />

Background In<strong>for</strong>mation<br />

The NEW directive only takes effect if you specify the -qsmp compiler option.<br />

Syntax<br />

►► NEW named_variable_list ►◄<br />

The NEW directive must immediately follow either a PARALLEL DO directive or<br />

a PARALLEL SECTIONS directive.<br />

If you specify the NEW directive, you must specify the corresponding PARALLEL<br />

DO or PARALLEL SECTIONS directive with no clauses.<br />

If the NEW directive follows the PARALLEL DO directive, the first noncomment<br />

line (not including other directives) following the NEW directive must be a DO<br />

loop. This line cannot be an infinite DO or DO WHILE loop.<br />

A variable name in the named_variable_list of the NEW directive has the same<br />

restrictions as a variable name appearing in the PRIVATE clause of the PARALLEL<br />

DO directive or a PRIVATE clause of the PARALLEL SECTIONS directive. See<br />

the sections on the PARALLEL DO directive and the PARALLEL SECTIONS<br />

construct in the <strong>XL</strong> <strong>Fortran</strong> <strong>Enterprise</strong> <strong>Edition</strong> <strong>for</strong> <strong>AIX</strong> Language Reference.<br />

Examples<br />

INTEGER A(10), C(10)<br />

REAL B(10)<br />

INTEGER FUNC(100)<br />

!SMP$ PARALLEL DO<br />

!SMP$ NEW I, TMP<br />

DO I = 1, 10<br />

TMP = A(I) + COS(B(I))<br />

C(I) = TMP + FUNC(I)<br />

END DO<br />

Porting Programs to <strong>XL</strong> <strong>Fortran</strong> 399

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!