Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

f03 array allocation

$
0
0

IVF 16 compiles the following code with 0 errors, 0 warnings,

program main
    implicit none
      integer:: i
      real, allocatable:: a(:)
      real:: c(5) = [(i, i = 1,5)]
     a = c     !   allocation F03   
     print *, '  array a has ', size(a), ' elements:'
     print *, a

end program main

The output is that the array has 0 elements and of course no values. Apparently the F03 style allocation in the assignment statement a=c does not work as it should.

The program runs correctly with 2 other compilers.

Is the F03 allocation feature not implemented in IVF 16?

BR

Dimitris

 

 

 


Viewing all articles
Browse latest Browse all 3270

Trending Articles



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