30.01.2013 Views

TotalView Users Guide - CI Wiki

TotalView Users Guide - CI Wiki

TotalView Users Guide - CI Wiki

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Printing an Array Slice<br />

}<br />

}<br />

[string range $ij 0 $width] " "<br />

}<br />

puts $row_out<br />

The CLI’s dprint command lets you specify a slice. For example, you can type:<br />

dprint a(1:4,1:4).<br />

After invoking this macro, the CLI prints a two-dimensional slice (i1:i2:i3,<br />

j1:j2:j3) of a Fortran array to a numeric field whose width is specified by the<br />

width argument. This width doesn’t include a leading minus sign (-).<br />

All but one line is standard Tcl. This line uses the dprint command to<br />

obtain the value of one array element. This element’s value is then captured<br />

into a variable. The CLI capture command allows a value that is normally<br />

printed to be sent to a variable. For information on the difference<br />

between values being displayed and values being returned, see “About CLI<br />

Output” on page 205.<br />

The following shows how this macro is used:<br />

d1. pf2Dslice a 1 4 1 4<br />

0.841470956802 0.909297406673 0.141120001673-<br />

0.756802499294<br />

0.909297406673-0.756802499294-0.279415488243<br />

0.989358246326<br />

0.141120001673-0.279415488243 0.412118494510-<br />

0.536572933197<br />

-0.756802499294 0.989358246326-0.536572933197-<br />

0.287903308868<br />

d1. pf2Dslice a 1 4 1 4 1 1 17<br />

0.841470956802 0.909297406673 0.141120001673-<br />

0.756802499294<br />

0.909297406673-0.756802499294-0.279415488243<br />

0.989358246326<br />

0.141120001673-0.279415488243 0.412118494510-<br />

0.536572933197<br />

-0.756802499294 0.989358246326-0.536572933197-<br />

0.287903308868<br />

d1. pf2Dslice a 1 4 1 4 2 2 10<br />

0.84147095 0.14112000<br />

0.14112000 0.41211849<br />

d1. pf2Dslice a 2 4 2 4 2 2 10<br />

-0.75680249 0.98935824<br />

0.98935824-0.28790330<br />

d1.<br />

216 Chapter 11: Seeing the CLI at Work

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

Saved successfully!

Ooh no, something went wrong!