Quantcast
Channel: Fortran
Viewing all articles
Browse latest Browse all 3108

SIZE function on an ALLOCATABLE array

$
0
0

Hello,

The following code prints out 10 as the size of the ALLOCATABLE array after the array is deallocated. Is this the correct behavior or a compiler bug? I am using the latest version of the Intel Fortran compiler.

Thanks for any clarification.

PROGRAM Main
    IMPLICIT NONE

    INTEGER,ALLOCATABLE :: iTestArray(:)

    WRITE (*,*) SIZE(iTestArray)

    ALLOCATE (iTestArray(10))
    WRITE (*,*) SIZE(iTestArray)

    DEALLOCATE (iTestArray)
    WRITE (*,*) SIZE(iTestArray)

END

 


Viewing all articles
Browse latest Browse all 3108

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>