Quantcast
Viewing latest article 7
Browse Latest Browse All 14

Since Fortran pointers

Since Fortran pointers/allocatables contain information about the upper and lower limits of indices, I mainly use them to obtain summation indices. Thus if I pass a pointer, it may look like this:

SUBROUTINE (a)

INTEGER, POINTER, DIMENSION(:) :: a

INTEGER :: i

DO i = LBOUND(a,1), UBOUND(a,1)

a(i) = ...

END DO

END SUBROUTINE

On the CONTIGUOUS-attribute: I didn't specify it anywhere, but all my arrays are actually contiguous. Does it make sense to explicitly specify it everywhere? Or will the Compiler know that a pointer array, pointing at an allocated array is contiguous if i specify a contiguous range of indices?


Viewing latest article 7
Browse Latest Browse All 14

Trending Articles