Re: Is it time to legitimise REAL*8 etc?
- From: Paul van Delst <Paul.vanDelst@xxxxxxxx>
- Date: Fri, 27 Jun 2008 16:26:28 -0400
Richard Maine wrote:
Paul van Delst <Paul.vanDelst@xxxxxxxx> wrote:
Could someone explain to me the cumbersomeness ofSELECTED_REAL(INT)_KIND() ??I agree the syntax is a bit wordy,
Yes, that's one thing - one that I think is more important than you make
it out to be. Another is that it just doesn't match the way most people
want/need to specify things. Decimal digits of precision might seem fine
in theory, but that just isn't a good match the reality of programming.
When what you want to do is select between the 32-, 84- and 128-bit
options for real, it is cumbersome to translate that into numbers of
decimal digits.
O.k., I understand what people take issue with. The interface to people's perceptions is ass-about, but you grapple with the strangeness up front and only once, right? I think the first piece of f90 code I wrote (back in '95) was my Type_Kinds.f90 module that contained definitions for these things (True, I have a test program that output my type kinds results). I've hardly thought about it since then... I just use it. If I want single precision (==real*4) I do
REAL(Single) :: x
or
REAL(sp) :: x
and if I want double (==real*8) I do
REAL(Double) :: x
or
REAL(dp) :: x
(similarly for ints)
It has worked on all platforms I've had access to so far: Sun Solaris, SGI-IRIX, IBM-AIX, HP-UX, PC(linux using pgi, intel, lahey, gfortran, g95), and Macs (intel,gfortran,g95). I definitely do not attribute that portability to my skill as a programmer but to the construct itself.
I mean, if you want to measure the length of various things, you don't construct a brand new measuring stick every time - you get a good one up front and reuse it until you wear it out.
cheers,
paulv
.
- Follow-Ups:
- Re: Is it time to legitimise REAL*8 etc?
- From: Richard Maine
- Re: Is it time to legitimise REAL*8 etc?
- References:
- Is it time to legitimise REAL*8 etc?
- From: Clive Page
- Re: Is it time to legitimise REAL*8 etc?
- From: dpb
- Re: Is it time to legitimise REAL*8 etc?
- From: Paul van Delst
- Re: Is it time to legitimise REAL*8 etc?
- From: Richard Maine
- Is it time to legitimise REAL*8 etc?
- Prev by Date: Re: Is it time to legitimise REAL*8 etc?
- Next by Date: Re: Is it time to legitimise REAL*8 etc?
- Previous by thread: Re: Is it time to legitimise REAL*8 etc?
- Next by thread: Re: Is it time to legitimise REAL*8 etc?
- Index(es):
Relevant Pages
|
|