Go To Top Go Up Go Back Go Forward

FMSIMG
FMSRMG
FMSCMG

PURPOSE: Get Memory

To allocate memory for data storage.

SYNOPSIS

CALL FMSIMG (IMD, LOC, LEN)
CALL FMSRMG (RMD, LOC, LEN)
CALL FMSCMG (CMD, LOC, LEN)

INPUT PARAMETERS:

OUTPUT PARAMETERS:

FMS PARAMETERS:

The following FMS Parameters are especially important to this routine:

Parameter Description
MAXMD Amount of memory to use
MDUSED Amount of memory already used
SHOW Display reports

DESCRIPTION:

These subroutines provide your program with access to the FMS memory manager.

The first step is to declare an array in your program that you will use to reference the allocated memory. There are currently two mechanisms used to do this.

Once the reference arrays are established in your subroutine, you call FMSIMG to allocate LEN integer words starting at IMD(LOC), FMSRMG to allocate LEN REAL*8 words starting at RMD(LOC), or FMSCMG to allocate LEN COMPLEX*16 words starting at CMD(LOC).

The value of LOC returned is relative to the array value you provide on the call. For example, if you make the call:

        CALL FMSIMG (IMD(10), LOC, LEN)
the allocated memory will start at IMD(10+LOC).

You may make the value of LOC be an actual subscript of the array by dimensioning the array to start at 0,

	INTEGER IMD (0:1)
Then when you call the memory allocation subroutine
	CALL FMSIMG (IMD, LOC, LEN)
the allocated memory will start at IMD(LOC).

Examples

As an example, to allocate storage for the FMS profile vector LOWEQ(NUMEQ) call FMSIMG as follows:
	CALL FMSIMG (IMD, LLOWEQ, NUMEQ)
You may address LOWEQ(I) as
	IMD(LLOWEQ-1+I)
You may also pass the LOWEQ array to a subroutine as
	CALL RSDI (IMD(LLOWEQ), NUMEQ, 'LUA', LUA)
When storage for LOWEQ(NUMEQ) is no longer required, you may return it to FMS.
	CALL FMSIMR (IMD, LLOWEQ, NUMEQ)
You may allocate storage for several arrays with a single call by requesting the total length. For example, to allocate storage for A(N), B(N) and C(N) use
	CALL FMSRMG (RMD, LA, 3*N)
	LB = LA + N
	LC = LB + N

Go To Top Go Up Go Back Go Forward
Copyright © Multipath Corporation