I have a big, old, FORTRAN 77 code that worked for many, many years without any problems. Double precision is no longer enough, so for converting to quadruple precision I have:
- Replaced all occurrences of REAL * 8 in REAL * 16
- Replaced all functions like DCOS () with functions like COS ()
- Replaced all built-in numbers, such as 0.d0 with 0.q0 and 1D + 01 to 1Q + 01
The program compiles without errors or warnings using the gcc-4.6 compiler on
- operating system
- : openSUSE 11.3 x86_64 (64-bit operating system)
- hardware: Intel Xeon E5-2650 (Sandy Bridge)
My LD_LIBRARY_PATH variable is set to the 64-bit library folder: / gcc -4.6 / lib64
The program reads the input file with numbers in it. These numbers were in the form 1.234D + 02 (for the double-precision version of the code that works). I changed them so that the number is 1.234Q + 02, however I get a runtime error:
Bad real number in list entry 1
Indicating that a routine that reads data from an input file (called read.f) does not find the first number in the input file to be compatible with the expected one.
It is strange that the version with four precision does not complain when the input file contains numbers, such as 1.234D + 02 or 123.4 (which, based on the output, seems to be automatically converted to form 1.234D + 02, rather than Q + 02), I just donβt like Q + 02, so it seems that gcc-4.6 does not allow reading four-point numbers from input files in scientific notation!
Has anyone ever read four times the exact number in scientific notation (for example, 1234Q + 02) from FORTRAN using a gcc compiler, and if so, how did you get it? (or do you need another compiler / operating system / hardware to make it work?)
source share