This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: legacy code with real*16
- From: Richard E Maine <Richard dot Maine at nasa dot gov>
- To: James Mitchell Allmond <gte203h at prism dot gatech dot edu>
- Cc: fortran at gcc dot gnu dot org
- Date: Mon, 28 Nov 2005 16:10:15 -0800
- Subject: Re: legacy code with real*16
- References: <8A093AC4-7079-4FA8-809E-088C7FE768AE@prism.gatech.edu>
On Nov 28, 2005, at 1:52 PM, James Mitchell Allmond wrote:
I'd appreciate any help. I'm compiling some old legacy code that makes
use of real*16 variables in computations....
I want to have this legacy code compatible with standard compilers, is
there an alternative to real*16 I can use?
In f77 and earlier, there is no standard-conforming way to do this. In
f90, the standard-conforming solution is to use the selected_real_kind
intrinsic to define an appropriate KIND parameter. That's exactly what
selected_real_kind is about. See any f90 text for details. Of course,
by using an f90 feature, you would lose compatibility with old f77
compilers. You have to choose between standard and portable to f77.
SInce f77 didn't have a standard solution, you can't have both.
And even with f90, the standard doesn't require that compilers have an
appropriate precision. The standard just defines how the user asks for
it. If the compiler doesn't support that precision, then nothing in the
code is going to help (short of defining an extended precision
user-defined type, which is a major undertaking and likely would have
very poor performance).
--
Richard Maine | Good judgment comes from experience;
Richard.Maine@nasa.gov | experience comes from bad judgment.
| -- Mark Twain