From: Phillip Helbig---undress to reply on
In article <4C32BD30.80601(a)net-b.de>, Tobias Burnus <burnus(a)net-b.de>
writes:

> e p chandler wrote:
> > vv.f90(1) : Error: This is not a valid initialization expression.
> > real :: pi=4.0*atan(1.0)
> > --------------^
>
> Using ATAN in initialization expressions is allowed since Fortran 2003,
> which one cannot expect from a "(c) 1997" compiler.

Whether this is the best way to parameterise pi is a different question.

From: Arjan on
> > > real :: pi=4.0*atan(1.0)
>
> Whether this is the best way to parameterise pi is a different question.


Completely off-topic, but the expression shown is an initialization
and not a parameterization. It allows for future re-assignment like

pi = 0.

This may happen by a typo in a code where someone meant

di = 0.

"implicit none" does not catch it... This is why I never use such an
approach, but have pi in a PARAMETER assignment instead.


Arjan
First  |  Prev  | 
Pages: 1 2
Prev: Why not 0?
Next: calling a real from C