FORTRAN Reference Manual

Program Units
FORTRAN Reference Manual528615-001
4-16
The Block Data Subprogram
The following sample program specifies that the variables COMMISSION, TAX,
SHIPPING, and VAT are in the named common block COST, and that the array
QUANTITY is in the named common block PRODUCT:
BLOCK DATA cost data INTEGER*4 quantity
REAL commission, tax, shipping
COMMON /product/quantity(1000)
COMMON /cost/commission, tax, shipping, vat
DATA commission, tax, shipping/.20, .06, .15/
DATA quantity/1000 * 0/
END
The first DATA statement initializes three of the variables in COST to the values shown.
The second DATA statement initializes each element in the QUANTITY array to zero.