FORTRAN Reference Manual

Memory Organization
FORTRAN Reference Manual528615-001
12-8
Storage Areas
proceeds, but that cannot be on top of the run-time stack because they must remain
allocated after the procedure creating them has returned to its caller.
The #LOWBUF area contains space for the Saved Message Utility storage area, plus
the $RECEIVE file message queue area, plus a general area for file buffers. Given the
directives:
? LOWBUFFER b
? SAVE (STARTUP s, ASSIGNS a, PARAM p)
? RECEIVE (OPEN m, MAXREPLY r, SYNCDEPTH d, QDEPTH q)
the size of the #LOWBUFFER area is:
b + 1 +
s/2 + 3 + a * 57 + p/2 + 3 +
(m + 1) * 11 + ((r + 1)/2 + 4) * m * d + q * 4
words, where the default values are:
b = 512 if not specified in a LOWBUFFER directive
s = 0, a = 0, p = 0 if not specified in a SAVE directive
m = 1, r = 132, d = 1, q = 1 if not specified in a RECEIVE directive
Thus, in the absence of these directives, the #LOWBUFFER area is allocated 609
words.
The #HIGHBUFFER area contains the number of words specified in the HIGHBUFFER
directive, or is omitted if none is specified. During program execution, the FORTRAN
run-time library procedures call the GPLIB procedures GET^BUFFER and
PUT^BUFFER to allocate and release space in the buffer pool consisting of the
#LOWBUFFER and #HIGHBUFFER areas of memory. The FORTRAN run-time
system allocates and de-allocates space in this buffer pool as follows:
The Saved Message Utility area is allocated when the program begins execution. It
must be in the #LOWBUFFER area. Its size depends on the startup, assign, and
param system messages the process receives, and may be less than or greater
than the amount specified in the SAVE directive. This area might become larger or
smaller as the program calls Saved Message Utility routines to add, delete, and
alter saved messages.
The $RECEIVE area is allocated when the file named $RECEIVE is opened. It can
be in either the #LOWBUFFER or #HIGHBUFFER area. Its size is exactly as
specified in the RECEIVE directive, or 96 words by default.
When a FORTRAN program is running as a NonStop process, the system
allocates 169 words in the #LOWBUFFER area for each EDIT format file that is
open.
The system may allocate 512 words for each output file that is open for level-3
spooling. This can be in the #LOWBUFFER or #HIGHBUFFER area. It is not