Using Expanded and Extended Memory with Microsoft FORTRANSome DOS applications can use an expanded memory manager (EMM) driver program and expanded memory board(s) to access memory beyond the 1 MB limit of conventional memory. Microsoft FORTRAN, however, does not have the capability to use expanded memory. It can utilize extended memory (above 1 MB), but only when used with the OS/2 operating system and protected mode libraries. Extended memory is the term used to refer to the memory at physical addresses above 1 MB that can be accessed by an 80286 or 80386 CPU in protected mode.
Using a Direct Access Disk File to Store Large Amounts of DataA disk drive can be used to store large amounts of data in a direct- access disk file, thus freeing up the memory that would otherwise be used by the data. By using a direct-access file, records can be read from or written to in any order, simulating the use of an array. If expanded or extended memory is available, it can be used for a RAM drive. By using a RAM drive, I/O access to the data is much faster than when using a fixed disk drive.
Using Allocatable Arrays in FORTRAN Version 5.00An ALLOCATABLE array is an array that is dynamically sized at run time by using the ALLOCATE statement and the ALLOCATABLE attribute (see pages 21-25 of the "Microsoft FORTRAN Reference" manual). The ALLOCATE statement (see pages 113-114 of the "Microsoft FORTRAN Reference" manual) establishes the upper and lower bounds of each ARRAY dimension and reserves sufficient memory. The array can then be DEALLOCATED at run time by using the DEALLOCATE statement (see page 143 of the "Microsoft FORTRAN Reference" manual) to free memory for use by other arrays.
INTEGER data [ALLOCATABLE] (:,:)
DATA i, j / 10,50 /
ALLOCATE (data (i,j), STAT=error)
DEALLOCATE (data, STAT=error)
Using Overlays in FORTRAN Versions 4.00, 4.01, 4.10, and 5.00Overlays (see pages 366-367 of the "Microsoft FORTRAN Reference" manual for versions 5.00 and pages 258-260 of the "Microsoft FORTRAN CodeView and Utilities User's Guide") allow several program modules to use the same memory area. When needed, a module or group of modules is loaded into memory from the disk. Module access time can be shortened if a RAM drive is used to store the executable. Modules that are to be overlaid are enclosed in parentheses. CODE (but NEVER DATA) is overlaid. Note: If the program consists of mostly DATA, then this procedure will be of little help.
The following example is for versions 4.00, 4.01, 4.10, and 5.00:
The following example is for versions 4.10 and 5.00:
Article ID: 67194 - Last Review: Dec 1, 2003 - Revision: 1