Question

Is there an analog of the "-fdefault-real-8" gfortran (the GNU Fortran 95 compiler) option in g77 (the GNU Fortran 77 compiler)? This option sets the default real type to an 8-byte wide type.

I currently have code where single-precision arithmetic is limiting my accuracy, and so I need double-precision. (It's not just intermediate values that I want to be in double-precision, which is an FPU flag; I want everything to be in double-precision.) I know that I have some other approaches (using gfortran, using other compilers, or changing all REALs to DOUBLE PRECISIONs), but they're not ideal for my situation.

So, is there any way to set the default real type to be double precision, namely 8 bytes wide, in g77?

Was it helpful?

Solution

If you can't find a flag in the man pages, you might try a #define macro.

#define REAL DOUBLE PRECISION

OTHER TIPS

Since a lot of FORTRAN 77 is still legal, is it possible to use gfortran to compile your FORTRAN 77 code, and supply the -fdefault-real-8 option?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top