Make double-precision default in g77, Fortran compiler

doublefortranfortran77g77

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?

Best Answer

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

#define REAL DOUBLE PRECISION
Related Topic