Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: Re: [OMPI devel] MPI_REAL16
From: N.M. Maclaren (nmm1_at_[hidden])
Date: 2009-06-22 12:34:03


On Jun 22 2009, Iain Bason wrote:
>Jeff Squyres wrote:
>
>> Thanks for looking into this, David.
>>
>> So if I understand that correctly, it means you have to assign all
>> literals in your fortran program with a "_16" suffix. I don't know if
>> that's standard Fortran or not.
>
>Yes, it is.

Sorry - no, it isn't. It's syntactically standard, but has an undefined
meaning.

KIND parameters are processor dependent, and do NOT mean the size in bytes,
words or anything else. On a VAX or Alpha, and potentially on IBM and Intel
systems in the future, you could have several different floating-point types
of the same length. Currently, not all compilers use the same conventions,
even on the same system.

The correct way to do it is to have a module that defines a suitable
parameter, include that module everywhere, and use that parameter. For
example:

MODULE double
    INTEGER, PARAMETER :: dp = SELECTED_REAL_KIND(12)
END MODULE double

Include 'USE double' at the start of every procedure and module, and then
use 1.23_DP.

Regards,
Nick Maclaren,
University of Cambridge Computing Service,
New Museums Site, Pembroke Street, Cambridge CB2 3QH, England.
Email: nmm1_at_[hidden]
Tel.: +44 1223 334761 Fax: +44 1223 334679