ran intrinsic bug?

Steve Kargl sgk@troutmask.apl.washington.edu
Sat Feb 26 21:36:00 GMT 2005


On Sat, Feb 26, 2005 at 01:32:00PM -0800, Jerry DeLisle wrote:
> Jerry DeLisle wrote:
> >Is this a new bug?  Compiles and runs with no error with g77.
> >
> >[jerry@quantum bench]$ f95 -c bug1000.f
> > In file bug1000.f:12
> >
> >            a(i,j) = ran(init) - .5
> >                        1
> >Error: 'i' argument of 'ran' intrinsic at (1) must be a scalar
> >
> My apologies.  ran is defined in the program I extracted this from which 
>  is 1000d.f found at netlib.  It is defined (see below) and so is not 
> an intrinsic, but the error message implies that it is.
> 
>       DOUBLE PRECISION FUNCTION RAN( ISEED )

Add "EXTERNAL RAN" to your code; otherwise gfortran will see
RAN() as its intrinsic.

-- 
Steve



More information about the Fortran mailing list