next up previous index
Next: N103 Detect Indefinite Up: CERNLIB Previous: N002 Error Processing

N100 Address of a Variable

Routine ID: N100
Author(s): CDCLibrary: KERNLIB
Submitter: J.ZollSubmitted: 01.03.1968
Language: Fortran or Assembler or CRevised: 16.09.1991

The function LOCB returns the absolute address of the variable given as its argument.

LOCF returns the absolute address measured in terms of Fortran machine words.

Structure:

FUNCTION subprogram
User Entry Names: LOCF, LOCB

Usage:

    IAD = LOCB(X)
where X is the name of a variable of any type, or a name declared EXTERNAL in the calling program.
    IAD = LOCF(X)
where X is the name of a variable of type INTEGER or REAL.

Notes:

On CDC, LOCF is included in the FTN library, and documented in the Fortran manual.

On all machines LOCF is intended to measure the displacement between variables, thus for example for:

      COMMON /X/ M(12),A(4),LAST
      N = LOCF(LAST) - LOCF(M(1))
N will be set to contain 16 on all machines, whilst SPM_quot LOCB(LAST) - LOCB(M(1)) " will give some multiple of 16.

N103


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995