Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP Fortran Compiler for HP-UX: HP Fortran Programmer's Reference > Chapter 10 HP Fortran statements

BLOCK DATA

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

Introduces a block data program unit.

Syntax

BLOCK DATA [block-data-name]
block-data-name

is an optional name. If a name is given in the END BLOCK DATA statement terminating a block data program unit, it must be the same as the block-data-name given in the BLOCK DATA statement introducing the program unit.

Description

A block data program unit is used to give initial values to variables in a named common blocks by means of DATA statements and must start with a BLOCK DATA statement. The block data program unit is an obsolescent feature of Fortran 90 and is effectively superseded by the module, as described in “Modules”.

As an extension, HP Fortran allows blank—or unnamed—common blocks to be initialized.

Examples

The following block data program unit gives initial values to variables in the common blocks cb1 and cb2. All variables in each common block are specified completely.

BLOCK DATA
REAL b(4) DOUBLE PRECISION z(3)
COMPLEX c
COMMON /cb1/c,a,b /cb2/z,y
DATA b, z, c /1.0, 1.2 ,2*1.3, 3*7.654321D0, (2.4,3.76)/
END

Related statements

COMMON, DATA, and END

Related concepts

The structure and syntax of the block data program unit is described in “Block data program unit”.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.