- Integer, 4 or 8 bytes, depending on the machine,
- Real, 8 bytes,
- Complex, 16 bytes.
The figure above shows a line representing increasing address space. At the lower end of address space is your program containing data to be referenced by FMS. At a higher point in memory is FMS. By using negative subscripts in an array, FMS may directly address your data.
In order for FMS to address data in your program, your data must begin on an address boundary that is an integer multiple of the word length. For example, if you are processing 64-bit data on a byte-addressable machine, your data must begin on an address that is divisible by 8.
You may control the address alignment of your data by the following methods:
- Allocate the memory from the FMS memory pool by calling one of the memory management routines FMSIGT, FMSRGT, FMSCGT to allocate integer, real or complex data. FMS automatically aligns data in its memory pool on the appropriate boundary.
-
Place your data in a properly aligned common block.
When addresses are generated for your program during linking, your computer may be directed to locate the common block on a specified address boundary.The order that you place data in a common block is also important. If possible, place integers, reals and complex data in separate common blocks as shown:
COMMON/IDATA/IARRAY INTEGER IARRAY COMMON/RDATA/RARRAY REAL*8 RARRAY COMMON/CDATA/CARRAY COMPLEX*16 CARRAY
If you must mix data types within a common block, the longest word data types should be first. For example, all complex data must be at the beginning of the common block, followed by real data then integer data.
COMMON/DATA/CARRAY,RARRAY,IARRAY COMPLEX*16 CARRAY REAL*8 RARRAY INTEGER IARRAY
This will prevent an odd number of short words from destroying the alignment of longer word data.
FMS automatically checks the alignment of your data on each appropriate subroutine call. If an error is found, fatal error condition, DATA DOES NOT START ON AN APPROPRIATE ADDRESS, is printed along with the array address information.