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

Declaring size of array using non-parameters

$
0
0

Hello,

I am working on Intel Visual Fortran 11.1 and have a question on declaring an array in a subroutine by defining the size of the array using an argument. The argument can vary each time the subroutine is called, and the compiler does not provide an error, nor a warning.

program main
call suppre(5)
call suppre(6)
stop
end

subroutine suppre(ivar)
integer ivar
real, dimension(ivar) :: array

end subroutine

My question: What are the drawbacks of this practice?


Viewing all articles
Browse latest Browse all 3270

Trending Articles



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