REAL, implied-do-loop, and initialization expression?

Steve Kargl sgk@troutmask.apl.washington.edu
Fri Jun 26 14:07:00 GMT 2015


On Fri, Jun 26, 2015 at 10:23:15AM +0100, N.M. Maclaren wrote:
> Oops.  I meant:
> 
>   integer, parameter :: n = 4
>   integer, parameter :: k(n) = [4, 8, 10, 16]
>   real :: a(20)
>   call fred(real(a,k))
> 
> Sorry.
> 

Seems to be irrelevant as the Fortran defines that
the KIND argument to REAL() is a scalar initialization
expression. 

laptop-kargl:kargl[205] gfc -c a.f90
a.f90:4:20:

    call fred(real(a,k))
                    1
Error: 'kind' argument of 'real' intrinsic at (1) must be a scalar

-- 
Steve



More information about the Fortran mailing list