Re: increasing width
- From: "Michael Metcalf" <michaelmetcalf@xxxxxxxxxxxxxx>
- Date: Sat, 10 Mar 2007 22:46:58 GMT
"Lane Straatman" <invalid@xxxxxxxxxxx> wrote in message
news:goydnTXTWrZvtG7YnZ2dnUVZ_ompnZ2d@xxxxxxxxxxxxxx
I've been writing a fortran95 prog and was getting nine significantinteger, parameter :: dp=kind(0d0)
figures for a real-valued calculation.
Some fellow over in sci.math.num-analysis tells me I can get at least 6
more sig figs, if instead of declaring as type real, I declare as real(8).
My compiler complains:
numsci1.F95(3) : error 62 - Invalid KIND specifier
warning : comment 981 - Specifying the kind of the type REAL with the
constant '8' is non-portable - 'SELECTED_REAL_KIND(6,37)' would be better.
The error is from the line:
real(8) :: total, term
, which I get every time I want to declare real(8). The warning that it
issues would seem to point to the way out. How do I make a real variable
with 'SELECTED_REAL_KIND(6,37)'?
--
real(dp) :: total, term
You could also write
integer, parameter :: sp = SELECTED_REAL_KIND(6,37)
but I don't think that's what you want (that's only single precision,
surely)?
Regards,
Mike Metcalf
.
- Follow-Ups:
- Re: increasing width
- From: Lane Straatman
- Re: increasing width
- References:
- increasing width
- From: Lane Straatman
- increasing width
- Prev by Date: Re: increasing width
- Next by Date: Re: Aren't the fuddy-duddies in the group going to comment on Fortress
- Previous by thread: Re: increasing width
- Next by thread: Re: increasing width
- Index(es):