Re: increasing width




"Lane Straatman" <invalid@xxxxxxxxxxx> wrote in message
news:goydnTXTWrZvtG7YnZ2dnUVZ_ompnZ2d@xxxxxxxxxxxxxx
I've been writing a fortran95 prog and was getting nine significant
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)'?
--
integer, parameter :: dp=kind(0d0)
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


.