12 Dec 2025 2:33
#32548
Paul, F2008 permits some calculations to be made at compile time. Here is an example program:
program ctitst
implicit none
integer, parameter :: N=4
integer :: i
integer,parameter :: sqr(*)=[(i*i,i=1,N)]
print *,sqr
end program ctitst
FTN95 rejects the declaration/initialisation of sqr():
ERROR S:\sieve\ctitst.F90 5: An assumed size array (bound of *) is not permitted in this context
Thank you.