next up [*] [*]
Next: 4.1 NAMLST Up: I. Utility Modules Previous: 3. Input / Output

4. Memory Manager Module Algorithms

The aim of the memory manager module is to provide some form of dynamic allocation to a FORTRAN program. This is not truly possible within the framework of standard FORTRAN so the closest that can be achieved is to define large arrays at the start of PHYSICA and then write routines which manage the splitting up of these arrays. In this way portions of these arrays can be associated with variables the size of which are only known at run time. The code in the memory manager module provides this functionality. The user should use only the functions to assign memory to a variable. These routines respectively make a request for memory, return memory for reuse and change the size of a variable already existing in the memory manager. The arguments to these routines are
allocate_memory ( Vrname, Vrtype, Vrlnth, Vrwdth, Vradrs, Errinf, Failed)
free_memory     ( Vrname, Errinf, Failed)
resize_memory_area  (Ia, Ra, Xa, Dra, La, Cha, 
                     Vrname, Vrlnth Vrwdth, Vradrs, Errinf, Failed)
where the variables are as follows

Name Type Description
Vrname Character*20 Variable name (IN)
Vrtype Integer Variable type indicator (IN)
Vrlnth Integer If positive the length of one component of the variable. Can also be set to the spatial reference for the variable to indicate that the quantity is vertex, face or element based and the overlap level to be stored on each processor. (IN)
Vrwdth Integer The width of the variable. Can be set to SCALAR, VECTOR, TENSOR or to any positive value of the width. (IN)
Vradrs Integer Position in the relevant array where the starts (OUT)
Errinf Integer Value of any error raised (OUT)
Failed Logical Flag which indicates if an error has been raised (OUT)

The other arrays in the call to resize_memory_area are the arrays from which the memory is being allocated.

In the memory manager module several arrays are used to hold information relating to what memory is available, what is used and several link lists. The main arrays are



 
next up [*] [*]
Next: 4.1 NAMLST Up: I. Utility Modules Previous: 3. Input / Output

2002-12-09