fortran_realsize


Introduction:

FORTRAN_REALSIZE describes how a FORTRAN program, which uses
the “real” (single precision) datatype, can be compiled with a flag that
will essentially convert all single precision data and arithmetic to
double precision.

Simple compiler flags are available in gfortran, ifort, and pgfort:

  • gfortran -c -fdefault-real-8 myprog.f90
  • ifort -c -real-size 64 myprog.f90
  • pgf90 -c -r8 myprog.f90

Web site:

Usage:

On any ARC cluster, check the installation details
for the gfortran, ifort, or pgfort compiler by typing:

  • module spider gcc
  • module spider intel
  • module spider pgi

Examples:

This batch script uses a compiler switch with gfortran to compile and
execute a program, in which REAL variables are to be stored and handled
as though they were double precision:

#! /bin/bash
#
#PBS -l walltime=00:05:00
#PBS -l nodes=1:ppn=1
#PBS -W group_list=newriver
#PBS -q open_q
#PBS -j oe
#
cd $PBS_O_WORKDIR
#
module purge
module load gcc/6.1.0

gfortran -c -fdefault-real-8 myprog.f90

gfortran -o myprog myprog.o

./myprog

A complete set of files to carry out a similar example calculation are
available in
fortran_realsize.tar