Message from discussion
example of KIND to replace DOUBLE PRECISION
Path: g2news2.google.com!news2.google.com!news.glorb.com!feeder.erje.net!newsfeed.sovam.com!goblin1!goblin3!goblin.stu.neva.ru!lon-transit.news.telstra.net!pit-transit.telstra.net!news.telstra.net!news-server.bigpond.net.au!53ab2750!not-for-mail
From: "robin" <robi...@bigpond.com>
Newsgroups: comp.lang.fortran
References: <puk80557jmsa4kmd2heorr73jiooavdvts@4ax.com>
Subject: Re: example of KIND to replace DOUBLE PRECISION
Lines: 34
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Message-ID: <37pNl.9980$y61.3604@news-server.bigpond.net.au>
Date: Sun, 10 May 2009 00:22:23 GMT
NNTP-Posting-Host: 144.139.71.168
X-Complaints-To: abuse@bigpond.net.au
X-Trace: news-server.bigpond.net.au 1241914943 144.139.71.168 (Sun, 10 May 2009 10:22:23 EST)
NNTP-Posting-Date: Sun, 10 May 2009 10:22:23 EST
Organization: BigPond Internet Services
"Luka Djigas" <ldigas@@gmail.com> wrote in message
news:puk80557jmsa4kmd2heorr73jiooavdvts@4ax.com...
> I'm looking over some examples from Ramsden & Lin's "Fortran 90
> conversion course for F77 programmers", and glancing over the chapter
> which shows KIND parameter. I've never used it before, sticking to old
> DOUBLE PRECISION when it was needed.
>
> One of the simplest examples was this:
>
> INTEGER, PARAMETER :: idp = KIND(1.0D)
> REAL(KIND=idp) :: ra
>
> WRITE(*,*)KIND(ra)
> END
>
>
> onto which cvf66c and ifort gave an error, reporting syntax error in
> the first line (INTEG .... 1.0D)
It must be 1.0D0
> Also, the mentioned compilers do not seem to support KIND=2 type. Is
> there something I'm doing wrong, or is the mentioned book just written
> for some other compiler?
You don't need to specify any kind numbers.
Doing so can make the program non-portable.
All that's necessary is to specify something like:
INTEGER, PARAMETER :: idp = KIND(1.0D0)