30.01.2013 Views

TotalView Users Guide - CI Wiki

TotalView Users Guide - CI Wiki

TotalView Users Guide - CI Wiki

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Using Programming Language Elements<br />

� You can use assignment, break, continue, if/else structures, for, goto, and<br />

while statements. Creating a goto that branches to another <strong>TotalView</strong><br />

evaluation is undefined.<br />

Using Fortran<br />

When writing code fragments in Fortran, you need to follow these guidelines:<br />

� In general, you can use free-form syntax. You can enter more than one<br />

statement on a line if you separate the statements with semi-colons (;).<br />

However, you cannot continue a statement onto more than one line.<br />

� You can use GOTO, GO TO, ENDIF, and END IF statements; Although<br />

ELSEIF statements aren’t allowed, you can use ELSE IF statements.<br />

� Syntax is free-form. No column rules apply.<br />

� The space character is significant and is sometimes required. (Some Fortran<br />

77 compilers ignore all space characters.) For example:<br />

Valid Invalid<br />

DO 100 I=1,10 DO100I=1,10<br />

CALL RINGBELL CALL RING BELL<br />

X .EQ. 1 X.EQ.1<br />

You can use the following data types and declarations in a Fortran expression:<br />

� You can use the INTEGER, REAL, DOUBLE PRE<strong>CI</strong>SION, and COMPLEX data<br />

types.<br />

� You can’t define or declare variables that have implied or derived data<br />

types.<br />

� You can only use simple declarations. You can’t use a COMMON, BLOCK<br />

DATA, EQUIVALENCE, STRUCTURE, RECORD, UNION, or array declaration.<br />

� You can refer to variables of any type in the target program.<br />

� <strong>TotalView</strong> assumes that integer (kind=n) is an n-byte integer.<br />

Fortran Statements<br />

You can use the Fortran language statements:<br />

� You can use assignment, CALL (to subroutines, functions, and all intrinsic<br />

functions except CHARACTER functions in the target program),<br />

CONTINUE, DO, GOTO, IF (including block IF, ENDIF, ELSE, and ELSE IF), and<br />

RETURN (but not alternate return) statements.<br />

� If you enter a comment in an expression, precede the comment with an<br />

exclamation point (!).<br />

� You can use array sections within expressions. For more information, see<br />

“Array Slices and Array Sections” on page 336.<br />

� A GOTO statement can refer to a line number in your program. This line<br />

number is the number that appears in the Source Pane. For example, the<br />

following GOTO statement branches to source line number 432:<br />

GOTO $432;<br />

You must use a dollar sign ($) before the line number so that <strong>TotalView</strong><br />

knows that you’re referring to a source line number rather than a statement<br />

label.<br />

<strong>TotalView</strong> <strong>Users</strong> <strong>Guide</strong>: version 8.7 387

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

Saved successfully!

Ooh no, something went wrong!