Locating Run-Time Errors

This topic provides some guidelines for locating the cause of exceptions and run-time errors. Intel Fortran run-time error messages do not usually indicate the exact source location causing the error. The following compiler options are related to handling errors and exceptions:

Example 1: Allocatable variable not allocated

        real, allocatable:: a(:)

!       allocate(a(4)) ! if a is unallocated, the next statement gets an error with "check pointers"

        a=17

        print *,a

        end

 Output 1:

forrtl: severe (408): fort: (8): Attempt to fetch from allocatable variable A when it is not allocated

 

Example 2: Pointer not associated

        real, pointer:: a(:)

        allocate(a(5))

        a=17

        print *,a

        deallocate(a)   ! once a is deallocated, the next statement gets an error with "check pointers"

        a=20

        print *,a

        end

 

Output 2:

   17.00000       17.00000       17.00000       17.00000       17.00000

forrtl: severe (408): fort: (7): Attempt to use pointer A when it is not associated with a target

 

Example 3: Cray pointer with zero value

        pointer(p,a)

        real, target:: b

!       p=loc(b)        ! if integer pointer p has no address assigned to it,

!                       ! the next statement gets an error with "check pointers"

        b=17.

        print *,a

        end

 

Output 3:

forrtl: severe (408): fort: (9): Attempt to use pointee A when its corresponding integer pointer P has the value zero

See also Understanding Run-Time Errors.