My question is why the following is allowed:
integer, intent(in) :: x(:)
integer :: dx(size(x))
while this is not:
integer, intent(in) :: x(:)
integer :: max_size = size(x)
(let alone defining max_size as a parameter).
I can wrap my head around why a value unknown for the compiler (i.e., size(x)) might be problematic to be used for initialization, but using an unknown value to define array size is much much worse! How come one is allowed bu not the other? Why size() cannot be used for initialization in Fortran?