Page 131 - Standard Handbook Of Petroleum & Natural Gas Engineering
P. 131
116 Mathematics
Dimension statement-Specifies number and size of dimensions for each array
(may be included in Type statement); lower bound default is 1
DIMENSION A1(5:10),A2( 15)
DIMENSION A3(0:5,0: 10,lO: 100),A4( 10,10,10,10)
or
INTEGER Al(5: 10),A2( 15)
Common statement-Defines a common block of global variables (one common
block may have no specified name)
COMMON/blockname/varnames/blockname/varnames
COMMON X,Y,Z/C2BLK/A,B,C
Data may be entered into variables declared in a labeled COMMON block by
an assignment or an input statement or through a BLOCK DATA subprogram
as defined in subprogram statements.
Equivalence statement-Assigns two or more variable names to the same
memory location
EQUIVALENCE(A,B,C)
Parameter statement-Declares the name of a constant whose value cannot
be changed in the program
PARAMETER name
End statement-Compiler signal for end of unit
END
Executable Statements
Assignment statements may be DATA statements and are used mainly to
assign initial values to variables
DATA A,B,C,D,E/ 1. ,2 .,3. ,4. ,5./X,Y,Z/S * IO.
or values assigned by numerical or character constants or by expressions (see
Table 1-25 for arithmetic operators and precedence)
PI = 3.1415927
C1 = ‘This is a test’
X(1,J) X(I - 1J) + Y(J)*Z**3
Input/Output statements may be either list-directed (stream) or formatted.
List-directed I/O statements may be
READ(device#,*)varl,var2, . . .
WRITE(device#,*)varl,var2, . . .
PRINT * varl,var2, . . .

