next up previous contents
Next: More on Storage Association Up: The Building Blocks of Previous: BLOCK DATA statements   Contents

Include files

To avoid the problems of inconsistent common block declarations it is common practice to place the common blocks and their variable declarations in a file, and then to include the file in different program units which use the common block. For example, the file coeff.cmm may contain

 
  integer :: n
  real, dimension(0:10) :: b
  common /coeff/ n, b
and we may use
 
  include 'coeff.cmm'
This is equivalent to inserting (rewritting) the content of coeff.cmm at each place where the file is included. We therefore avoid repeating the same declarations and are sure of the declaration consistency.



Adrian Sandu 2001-08-26