Information Technology Reference
In-Depth Information
sufficient to be able to work with the subject matter of this chapter and some material
in later chapters.
5.2.1 Primary Fortran Operators
The primary Fortran operators are given in Table 5.1. Prior to execution of any state-
ment, all variables appearing on the right-hand side of an equal sign must be defined:
that is, contain either a numerical value or a value calculated with previous legal
statements.
A list of all the functions available is given in the Aspen Plus documentation About
the Interpreter.
5.2.2 Precedence of Calculations
The following rules apply when a Fortran statement is evaluated:
• Fortran statements may be organized in groups of operations within parentheses.
• The contents of each group is evaluated prior to evaluation of the complete state-
ment.
• Function calls precede group evaluation.
• Exponentiation precedes group evaluation.
• If part of a group, divisors are evaluated prior to numerators.
For example, the precedence of calculations for the Fortran statement
(f * dlog(b) + c)
(a + b) + (c d*e**f)
a =
(5.1)
is as follows:
TABLE 5.1 Fortran Operators
Operator
Definition
Example
Result
=
A = B
replacement
B
+
addition
A
=
A
+
A
2A
subtraction
A
=
A
A
0
/
division
A
=
A / A
1
A = A A
A 2
*
multiplication
A = A ∗∗ B
A B
**
exponentiation
.LT.
logical less than
.GT.
logical greater than
.EQ.
logical equal
..AND.
logical and
function call
A = Dlog ( B )
Ln(B)
subroutine call
CALL XYZ
XYZ executes
Search WWH ::




Custom Search