Browse Prior Art Database

Dynamic Storage for Fortran

IP.com Disclosure Number: IPCOM000080263D
Original Publication Date: 1973-Nov-01
Included in the Prior Art Database: 2005-Feb-27
Document File: 3 page(s) / 15K

Publishing Venue

IBM

Related People

Weinert, GS: AUTHOR

Abstract

The techniques described here provide FORTRAN Programs with a GETMAIN or dynamic storage allocation facility, where such a facility is provided by the 0perating System. When using dynamic storage, the size capability of a program can be changed by changing the region size, but without having to recompile the programs, and for small jobs, the unused storage need not be allocated.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 58% of the total text.

Page 1 of 3

Dynamic Storage for Fortran

The techniques described here provide FORTRAN Programs with a GETMAIN or dynamic storage allocation facility, where such a facility is provided by the 0perating System. When using dynamic storage, the size capability of a program can be changed by changing the region size, but without having to recompile the programs, and for small jobs, the unused storage need not be allocated.

Two routines are available, CORE uses subroutine linkage to achieve dynamic storage, GTMAIN uses subscripting. CORE.

The argument list of a subroutine consists of a table of addresses, which will point to the actual locations that are to be used when the subroutine is called. When an argument is an array (or is picked up by address /X/) references to this variable will use the storage that is provided by the calling routine.

CORE is a routine that will allocate a block of storage using a GETMAIN and then pass the storage to a called subroutine. The called subroutine need never know that the storage was not provided by FORTRAN.

The call sequence is: EXTERNAL NAME

CALL CORE (NAME, N, . . . )

NAME is the Name (Address) of a subroutine. N is a 4-byte integer that contains the number of bytes to be obtained, . . . any additional information.

NOTE: The last address in the table is tagged, hence, an assembler routine can determine the length of the call list. After CORE gets the storage, it will build a new argument list. The first argument contains the address of the new array. Any parameters after the "N" are added to the list, and a call is made to the subroutine address that was specified. EXTERNAL ABC

N = 2000

CALL CORE (ABC, N. XX, YY, Z)

;CALL ABC (ARRAY, XX, YY, Z);

SUBROUTINE ABC (W, X, Y, Z)

DIMENSION W (1), X(1), etc.

"W" will be the storage that was obtained from CORE.

When using an ENTRY statement, and a parameter is passed in only through the entry point, it will remain unchanged until that entry is entered again (or gets lost because of an overlay). EXTERNAL AA1

CALL CORE (AA1, N)

END

SUBROUTINE AAA (X, Y)

DIMENSION B(1)

ENTRY AA1 (B)

1

Page 2 of 3

RETURN.

After AA1 has been entered, the address "B" will be available to the entire routine.

The storage from a system GETMAIN will always be on a double word boundary. CORE gets its storage fro...