Path: utzoo!attcan!uunet!pyrdc!pyrnj!rutgers!apple!well!rchrd From: rchrd@well.UUCP (Richard Friedman) Newsgroups: comp.lang.fortran Subject: Re: Pointers in FORTRAN Message-ID: <7306@well.UUCP> Date: 5 Oct 88 17:49:16 GMT Reply-To: rchrd@well.UUCP (Richard Friedman) Organization: RCHRD 2855 Telegraph #415 Berkeley CA 94705 Lines: 17 The CRAY compiler CFT has a POINTER syntax that is very useful: POINTER (P2XYZ,XYZ(100) ) COMMON //BLOCK(1000000) ... P2XYZ= LOC(BLOCK) + NSIZE ... XYZ(K) = ... Here the POINTER statement defines P2XYZ as a pointer variable for the "pointee"XYZ, which is a 1-dim array. THe LOC function returns the address of its argument. Note that the CRAY is not a virtual memory machine, so LOC returns an actual memory address. POINTERS and LOC are typically used in engineering codes on the Cray to apportion COMMON dynamically. E.g., the size of arrays in common may be determined by input data. -- ...Richard Friedman [rchrd] uucp: {ucbvax,lll-lcc,ptsfa,hplabs}!well!rchrd - or - rchrd@well.uucp