XMM-Newton SAS Home Page
XMM-Newton Science Analysis System


cal (cal-3.184) [xmmsas_20070308_1802-6.6.0]

Input/Output values Conventions Array indices Home Index

Meta Index / Home Page / Developer's notes / Using CAL in a / Using CAL from Fortran-90 / Conventions

Memory management

Several routines return to the caller one- or two-dimensional arrays which hold the results of performed computations. The CAL declares these output arrays as:
    real, dimension(:), pointer :: vector
    real, dimension(:,:), pointer :: image
which means the task can either pass as actual argument an uninitialized pointer or a pointer which points to an allocated array. As an example of the latter case, the task may have gotten a pointer to a Dal [*] table column and want the CAL to write the result into that directly (e.g. populating the DETX/DETY columns with the output of CAL_rawXY2mm).

When uninitialized pointers are passed the CAL newly allocates memory for the output array which leaves the caller with the burden to de-allocate that memory when it is no longer needed. A routine CAL_releaseMemory is provided for that purpose. For examples on the above topics, please consult the CAL example task mentioned below.


Input/Output values Conventions Array indices Home Index

XMM-Newton SOC/SSC -- 2007-03-08