Prev: Why not 0?
Next: calling a real from C
From: Phillip Helbig---undress to reply on 6 Jul 2010 01:42 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 6 Jul 2010 04:49
> > > 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 |