A colleague in college came up with a solution to the “i” problem - he defined the constant EYE to be sqrt(-1.0). Hardly any conflicts, and yet everyone “got it” easily.
Cheers,
Bill
> On Jun 7, 2017, at 6:40 AM, Clune, Thomas L. (GSFC-6101) <[log in to unmask]> wrote:
>
>
> z = a + b * I_dp
>
> Then all my usual intuition about precision in Fortran arithmetic expressions can be reasonably relied upon.
>
> The only thing I don’t like about this, is that part of me really wants to call the constant “i”, but that is impractical in nontrivial codes to the the convention of using “i” as a loop index. Maybe with ASSOCIATE the following would be doable:
>
>
> associate (i => SQRT_OF_NEGATIVE_ONE_DOUBLE_PRECISION)
> z = a + b * i
> ...
> end associate
Bill Long [log in to unmask]
Principal Engineer, Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9143
Cray Inc./ 2131 Lindau Lane/ Suite 1000/ Bloomington, MN 55425
|