Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Pointers

umitkeskin
Beginner
503 Views

I am a PhD student. I have been trying to understand any differences in the efficiency of the working of the programme between these three cases in (FORTRAN) programming:

1. Using a pointer linked to a whole array.

2. A pointer which is linked to the first element of an array, and the pointer link is changed in a loop in calculations so that the pointer is following the each element of the same array.

3. Only using an array.

As far as I know, in Fortran a value is passed by its reference. I think a pointer is used for the same purpose. So, why do we use pointers in Fortran?

Thank you very much for your time.

Umit Keskin

0 Kudos
1 Reply
TimP
Honored Contributor III
503 Views
You appear to be confusing legacy Cray pointers with Fortran 90 pointers, both of which ifort supports. A good article on the latter is at the top of my browser search:
http://www.personal.psu.edu/jhm/f90/lectures/42.html

While many Fortran compilers to use pass by reference, portable source code must not be dependent on that implementation, even if you solve the common problem of differing pointer sizes among common CPU modes.
0 Kudos
Reply