*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> f90/loc (3)              
Title
Content
Arch
Section
 

Contents


LOC(3F)								       LOC(3F)


NAME    [Toc]    [Back]

     loc - return the address of an object

SYNOPSIS    [Toc]    [Back]

     In	a 32 bit program:
     function loc(arg)

     In	a 64 bit program:
     integer *8	function loc(arg)

DESCRIPTION    [Toc]    [Back]

     The returned value	will be	the address of arg.

NOTES    [Toc]    [Back]

     In	64 bit program loc will	return a 64 bit	address.  Programs should
     declare the return	type as	integer	*8.

FILES    [Toc]    [Back]

     /usr/lib/libU77.a




































									Page 1



LOC(3I)						       Last changed: 2-5-98

NAME    [Toc]    [Back]

     LOC - Obtains the word address of a variable

SYNOPSIS    [Toc]    [Back]

     LOC ([I=]i)

IMPLEMENTATION    [Toc]    [Back]

     UNICOS, UNICOS/mk,	and IRIX systems

STANDARDS    [Toc]    [Back]

     CF90 and MIPSpro 7	Fortran	90 compiler extension to Fortran 90

DESCRIPTION    [Toc]    [Back]

     LOC returns the address of	a variable, constant, or array.	 On UNICOS
     systems, the address returned is a	word address.  On UNICOS/mk and
     IRIX systems, the address returned	is a byte address.  It accepts the
     following arguments:

     i	  The address to be returned.  Specify a variable or constant of
	  Boolean, integer, real, logical, complex, Cray pointer, or
	  character type.

     LOC can be	used to	define a Cray pointer.	Just like a variable in
     common storage, a Cray pointee, Cray pointer, or the i argument to	LOC
     is	stored in memory before	a call to an external procedure	and is read
     out of memory at its next reference.  The variable	is also	stored
     before a RETURN or	END statement of a subprogram.

     The name of this intrinsic	cannot be passed as an argument.

WARNINGS    [Toc]    [Back]

     LOC is often used to compute the difference of two	addresses as an
     offset.  The offset is then used to access	one of the arrays by
     overindexing the other array.  UNICOS/mk systems, unlike UNICOS
     systems, have several address spaces (called memory segments), and
     memory references with offsets outside of the segment are not allowed.
     If	the arrays are in different memory segments, the corresponding
     offset generates memory references	outside	of the segment.	 These
     references	cause run-time Translation Not Valid errors.

RETURN VALUES    [Toc]    [Back]

     The value returned	is of type Cray	pointer.

EXAMPLES    [Toc]    [Back]

     Example 1:	 Consider the following	code:

	  SUBROUTINE SUB(N)
	  COMMON POOL(100000)
	  INTEGER BLK(128), WORD64
	  REAL A(1000),	B(N), C(100000-N-1000)
	  POINTER(PBLK,BLK),(IA,A),(IB,B),(IC,C),(ADDRESS,WORD64)
	  DATA ADDRESS /64/
	  PBLK = 0
	  IA = LOC(POOL)
	  IB = IA + 1000
	  IC = IB + N

     In	effect,	WORD64 in this example refers to the contents of absolute
     address 64; BLK is	an array occupying the first 128 words of memory; A
     is	an array of length 1000	located	in blank common; B follows A and is
     of	length N; C follows B.	A, B, and C are	associated with	POOL.
     Similarly,	WORD64 is the same as BLK(65), because BLK(1) is at address
     0.

     Example 2:	 Consider the following	code:

	  POINTER (P,B),(P,C)
	  REAL X,B,C
	  P = LOC(X)
	  B = 1.0
	  C = 2.0
	  PRINT	*,B

     Because B and C have the same Cray	pointer, the assignment	of 2.0 to C
     gives the same value to B;	therefore, B will print	as 2.0 even though
     it	was assigned 1.0.

SEE ALSO    [Toc]    [Back]

      
      
     Intrinsic Procedures Reference Manual, publication	SR-2138, for the
     printed version of	this man page.
LOC(3I)						       Last changed: 2-5-98

NAME    [Toc]    [Back]

     LOC - Obtains the word address of a variable

SYNOPSIS    [Toc]    [Back]

     LOC ([I=]i)

IMPLEMENTATION    [Toc]    [Back]

     UNICOS, UNICOS/mk,	and IRIX systems

STANDARDS    [Toc]    [Back]

     CF90 and MIPSpro 7	Fortran	90 compiler extension to Fortran 90

DESCRIPTION    [Toc]    [Back]

     LOC returns the address of	a variable, constant, or array.	 On UNICOS
     systems, the address returned is a	word address.  On UNICOS/mk and
     IRIX systems, the address returned	is a byte address.  It accepts the
     following arguments:

     i	  The address to be returned.  Specify a variable or constant of
	  Boolean, integer, real, logical, complex, Cray pointer, or
	  character type.

     LOC can be	used to	define a Cray pointer.	Just like a variable in
     common storage, a Cray pointee, Cray pointer, or the i argument to	LOC
     is	stored in memory before	a call to an external procedure	and is read
     out of memory at its next reference.  The variable	is also	stored
     before a RETURN or	END statement of a subprogram.

     The name of this intrinsic	cannot be passed as an argument.

WARNINGS    [Toc]    [Back]

     LOC is often used to compute the difference of two	addresses as an
     offset.  The offset is then used to access	one of the arrays by
     overindexing the other array.  UNICOS/mk systems, unlike UNICOS
     systems, have several address spaces (called memory segments), and
     memory references with offsets outside of the segment are not allowed.
     If	the arrays are in different memory segments, the corresponding
     offset generates memory references	outside	of the segment.	 These
     references	cause run-time Translation Not Valid errors.

RETURN VALUES    [Toc]    [Back]

     The value returned	is of type Cray	pointer.

EXAMPLES    [Toc]    [Back]

     Example 1:	 Consider the following	code:

	  SUBROUTINE SUB(N)
	  COMMON POOL(100000)
	  INTEGER BLK(128), WORD64
	  REAL A(1000),	B(N), C(100000-N-1000)
	  POINTER(PBLK,BLK),(IA,A),(IB,B),(IC,C),(ADDRESS,WORD64)
	  DATA ADDRESS /64/
	  PBLK = 0
	  IA = LOC(POOL)
	  IB = IA + 1000
	  IC = IB + N

     In	effect,	WORD64 in this example refers to the contents of absolute
     address 64; BLK is	an array occupying the first 128 words of memory; A
     is	an array of length 1000	located	in blank common; B follows A and is
     of	length N; C follows B.	A, B, and C are	associated with	POOL.
     Similarly,	WORD64 is the same as BLK(65), because BLK(1) is at address
     0.

     Example 2:	 Consider the following	code:

	  POINTER (P,B),(P,C)
	  REAL X,B,C
	  P = LOC(X)
	  B = 1.0
	  C = 2.0
	  PRINT	*,B

     Because B and C have the same Cray	pointer, the assignment	of 2.0 to C
     gives the same value to B;	therefore, B will print	as 2.0 even though
     it	was assigned 1.0.

SEE ALSO    [Toc]    [Back]

      
      
     Intrinsic Procedures Reference Manual, publication	SR-2138, for the
     printed version of	this man page.
[ Back ]
 Similar pages
Name OS Title
xlate IRIX the address translation object file section of an ELF object
glGetPointerv Tru64 return the address of the specified pointer
glgetpointerv IRIX return the address of the specified pointer
glgetpointervext IRIX return the address of a buffer or vertex array
dladdr FreeBSD find the shared object containing a given address
dlsym IRIX get the address of a symbol in shared object
dlsym Tru64 obtain the address of a symbol from a dlopen() object
pthread_attr_setstackaddr_np Tru64 Changes the stack address and size of the specified thread attributes object
pthread_attr_setstackaddr Tru64 Changes the stack address attribute of the specified thread attributes object
pthread_attr_getstackaddr Tru64 Obtains the stack address attribute of the specified thread attributes object
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service