2 out of 3 compilers reject this:
module m
implicit none
integer, parameter :: iarr = selected_int_kind( 8 )
interface
integer( kind=iarr ) module function f( space )
! module function f( space )
integer( kind=iarr ), intent(in), allocatable :: space(:,:,:) [:,:,:]
! integer( kind=iarr ) :: f
end function f
end interface
end module m
claiming that "iarr" is not a constant:
1) "IARR" is used in a constant expression, therefore it must be a constant.
2) A kind type parameter must be a compile-time constant. [IARR]
Changing the declaration to:
module m
implicit none
integer, parameter :: iarr = selected_int_kind( 8 )
interface
! integer( kind=iarr ) module function f( space )
module function f( space )
integer( kind=iarr ), intent(in), allocatable :: space(:,:,:) [:,:,:]
integer( kind=iarr ) :: f
end function f
end interface
end module m
makes all 3 compilers happy.
I think both forms are allowed,
or have I missed something?
Anton
|