float conversion error

Richard E Maine Richard.Maine@nasa.gov
Thu Aug 18 20:13:00 GMT 2005


On Aug 17, 2005, at 10:34 PM, Steve Kargl wrote:

> On Thu, Aug 18, 2005 at 05:04:06AM +0000, Jack Howarth wrote:
>> Error: Type of argument 'a' in call to 'float' at (1) should be
>> INTEGER(4), not INTEGER(2)
>
> You might try to change FLOAT to REAL.

That would be the "workaround" that conforms to the standard. Note that 
FLOAT is a hold-over from Fortran 66. Yes, I mean 66, not 77. It 
remains part of the standard, but there has been very little reason to 
use it since f77 compilers became ubiquitous.

FLOAT is the name of a specific procedure, specific procedures being 
all that f66 had. The corresponding generic name is REAL. I'd find it a 
bit strange to expect a procedure to act generically (which is what 
this code clearly does), yet use a specific name from before the 
introduction of generics. Ok, I've seen things far stranger; I can even 
imagine how code might evolve to a form like this.

-- 
Richard Maine                |  Good judgment comes from experience;
Richard.Maine@nasa.gov       |  experience comes from bad judgment.
                             |        -- Mark Twain



More information about the Fortran mailing list