I find the warnings and comments issued by FTN95 very informative and helpful, with one exception, and that is the message about comparing floating point quantities for equality (and, of course, the complementary message about inequality). Is there any way of turning this (these?) messages off selectively? I get a string of warnings against all of my IFs, and this obscures the more relevant and helpful warnings. I usually check the denominator of any division for being zero before I do it, especially as this usually means that there is some bad data, which I can trap and deal with. Not only that, but if, for example, I set both A and B to zero, then I expect that a test of either against zero should be .TRUE. or their difference to be zero, or the result of multiplying anything by A or B to be zero (perhaps I would accept the latter to be less reliable, although I don’t know why I would need to be less confident about this). So, for example, if I had: A=0.0 (and this could come from a pair of READ statements) B=0.0 IF (A .EQ. B) THEN or IF (A .EQ. 0.0) THEN … both IFs would be .TRUE. Indeed, if I had written A=0.1234 B=0.1234 I should expect A .EQ. B to be .TRUE. and also A .EQ. 0.1234 to be .TRUE. – although admittedly, I should not expect that if I wrote: C=0.2468/2.0 … then would A .EQ. C ? I should be prepared for this not to be assured because of the representation of numbers in the PC. Similarly, if I had READ the value for A, and specified the value for B, I might be prepared for some difference. It did occur to me to write two LOGICAL FUNCTIONs, named EXACTLY_EQUAL (A, B) and APPROX_EQUAL (A, B, TOLERANCE), although I then need to add a declaration of type for EXACTLY_EQUAL and APPROX_EQUAL in the routines that call them. Both are a few lines long, and in the course of writing them, I did find that an arithmetic IF does not generate the annoying warning! Similarly, if I convolute the process and write: IF (A .LT. B .OR. A .GT. B) THEN EXACTLY_EQUAL = .FALSE. ELSE EXACTLY_EQUAL = .TRUE. ENDIF Then I don’t get the warning. Can anyone help me to give these symbolic names a global scope - or even to produce a new operator – some of the finer points of Fortran-90 and Fortran-95 seem to have passed me by!
Eddie