Using Fortran
When writing code fragments in Fortran, you need to follow these guidelines:
In general, you can use free-form syntax. You can enter more than one statement on a line if you separate the statements with semi-colons (;). However, you cannot continue a statement onto more than one line.
You can use
GOTO,
GO TO,
ENDIF, and
END IF statements; Although
ELSEIF statements aren’t allowed, you can use
ELSE IF statements.
Syntax is free-form. No column rules apply.
The space character is significant and is sometimes required. (Some Fortran 77 compilers ignore all space characters.) For example:
Valid | Invalid |
---|
DO 100 I=1,10 | DO100I=1,10 |
CALL RINGBELL | CALL RING BELL |
X .EQ. 1 | X.EQ.1 |
You can use the following data types and declarations in a Fortran expression:
You can use the
INTEGER,
REAL,
DOUBLE PRECISION, and
COMPLEX data types.
You can’t define or declare variables that have implied or derived data types.
You can only use simple declarations. You can’t use a
COMMON,
BLOCK DATA,
EQUIVALENCE,
STRUCTURE,
RECORD,
UNION, or array declaration.
You can refer to variables of any type in the target program.
TotalView assumes that
integer (kind=n) is an n-byte integer.