Prism 6.0 User's Guide

Setting the Context

You can precede the print or display command with a where statement that can make elements of a variable or array inactive. Inactive elements are not printed in the command window; " Overview of Data Visualization" describes how they are treated in visualizers. Making elements inactive is referred to as setting the context.

To set the context, follow the where keyword with an expression in parentheses. The expression must evaluate to true or false for every element of the variable or array being printed.

For example,

where (i .gt. 0) print i

prints (in the command window) only the values of i that are greater than 0.

You can use certain Fortran intrinsics in the where statement. For example,

where (a .eq. maxval(a)) print a

prints the element of a that has the largest value. (This is equivalent to the MAXLOC intrinsic function.) See " Writing Expressions in Prism" for more information on writing expressions in Prism.

Note that setting the context affects only the printing or displaying of the variable. It does not affect the actual context of the program as it executes.