|
|
Pointers
| F90 pointers
|
Update Link / Bad Link? |
|
Most scientific programs involve large amounts of data that the programmer is called upon to manage. If space is a problem, and it often is, using space efficiently becomes important. A pointer facility makes it possible to do this with efficiency and clarity. Versions of Fortran at most installations running large data codes have some form of pointers and a set of related memory-management functions as extensions to FORTRAN 77; the Cray pointer facility is one of these extensions. A pointer facility is also included in the Fortran 90 standard. However, Cray pointers are not like Fortran 90 pointers. While converting from Cray pointers to Fortran 90 pointers is possible, you will have to modify your existing programs to conform with the Fortran 90 standard. FORTRAN 77 did not have a pointer facility, and Cray pointers were added as an extension responding to user needs at the time.
Submitted Mar 29, 2000
Rating:
N/A
Rate this link
Total Visits: 84
|
| Dynamic memory allocation and pointers
|
Update Link / Bad Link? |
|
In standard FORTRAN 77, the sizes of all objects must be known at compile time (This does not apply to the sizes of formal arguments to subprograms, only to those of the actual arguments). This is inconvenient for many applications, as it means that the program may have to be recompiled before it can be run with a different problem size. Many operating environments let the user allocate contiguous blocks of memory whose sizes are determined at run time. Many implementations of FORTRAN 77 support an extension ("Cray pointers") that allows programs to make use of this facility. Cray pointers also allow the construction of linked data structures such as lists, trees, queues, ... More recently, the Fortran 90 standard introduced roughly equivalent functionality in the form of ALLOCATABLE arrays on the one hand, and of the POINTER attribute on the other.
Submitted Mar 29, 2000
Rating:
N/A
Rate this link
Total Visits: 61
|
| Fortran 90 Notes Pointer Variables, QUB
|
Update Link / Bad Link? |
|
A pointer variable, or simply a pointer, has the POINTER attribute, and may point to (be an alias of) another data object of the same type, which has the TARGET attribute, or an area of dynamically allocated memory. The introduction of pointer variables brings Fortran 90 into the league of languages like Pascal and C. But they are quite different from, for example, pointers in C. In Fortran 90, a pointer variable does not contain any data itself and should not be thought of as an address. Instead, it should be thought of as a variable associated dynamically with or aliased to another data object where the data is actually stored - the target.
Submitted Mar 29, 2000
Rating:
N/A
Rate this link
Total Visits: 38
|
| cnf_cptr - Convert a FORTRAN pointer to a C pointer
|
Update Link / Bad Link? |
|
Given a FORTRAN pointer, stored in a variable of type F77_POINTER_TYPE, this function returns the equivalent C pointer. Note that this conversion is only performed if the C pointer has originally been registered (using cnf_regp) for use from both C and FORTRAN. All pointers to space allocated by cnf_calloc and cnf_malloc are automatically registered in this way.
Submitted Mar 29, 2000
Rating:
N/A
Rate this link
Total Visits: 25
|
| Terms of Use: |
|
| NOTICE: Links you submit to Mathtools.net Link Exchange will
be accessible from any part of the world via the web. Any information such
links contain may be used by The MathWorks and the public, both within
and outside the country from which you posted. Read
complete disclaimer prior to use. |
|