Modulefpreviousupnextcontentsindex[BIG][Normal][small]
Next: 3.3 Dynamic arrays management utilities Up: 3 Dynamic arrays Prev: 3.1 Example Index Contents


3.2 Declaration of the super-array

 

Recall that it is up to the user to estimate the size, LM, of the super-array (section 1.5). Virtual memory systems usually allow arrays of several million words, and it is current to declare:

PARAMETER (LM = 2 000 000)

It is possible that the super-array only contains integer or single precision real type arrays. These variables all occupy elements in memory of identical size, equal to one word. In principle, it will therefore suffice to write (by choosing type integer):

INTEGER M(LM)

The super-array can nevertheless also contain dynamic arrays in double precision. Each element in the array therefore occupies two words in memory, always aligned by an address of the same parity. In order that this alignment is ensured by the compiler, the following solution is described:

DOUBLE PRECISION M(LM/2)

But, in practice, some sub-programs do not have the super-array as a parameter and consider therefore that it is in the blank COMMON. The alignment of the COMMON in the case of double precision variables is normally ensured by the compiler. The following is in this case recommended:

COMMON M(LM)

or else, to be certain of the alignment in double precision:

DOUBLE PRECISION M

COMMON M(LM/2)

It must nevertheless be noted that the largest majority of sub-programs include the super-array as a parameter. Certain particular applications can thus use several super-arrays, however, this must be done with caution.


Modulefpreviousupnextcontentsindex[BIG][Normal][small]
Next: 3.3 Dynamic arrays management utilities Up: 3 Dynamic arrays Prev: 3.1 Example Index Contents