Fortran Programming Guide

FORTRAN 77 and C Data Types

Table 11-1 shows the sizes and allowable alignments for FORTRAN 77 data types. It assumes no compilation options affecting alignment or promoting default data sizes are applied. (See also the FORTRAN 77 Language Reference Manual).

Table 11-1 Data Sizes and Alignments--(in Bytes) Pass by Reference (f77 and cc)

FORTRAN 77 Data Type 

C Data Type 

Size  

Default Alignment SPARC     x86  

BYTE X

CHARACTER X

CHARACTER*n X

char x

unsigned char x

unsigned char x[n]

1  

1  

1  

COMPLEX X

COMPLEX*8 X

DOUBLE COMPLEX X

COMPLEX*16 X

COMPLEX*32 X

struct {float r,i;} x;

struct {float r,i;} x;

struct {double dr,di;}x;

struct {double dr,di;}x;

struct {long double dr,di;} x;

16 

16 

32 

4  

4  

4/8  

4/8 

4/8/16  

-- 

DOUBLE PRECISION X

REAL X

REAL*4 X

REAL*8 X

REAL*16 X

double x

float x

float x

double x

long double x

16 

4/8  

4  

4  

4/8 

4/8/16 

-- 

INTEGER X

INTEGER*2 X

INTEGER*4 X

INTEGER*8 X

int x

short x

int x

long long int x

4  

2  

4  

LOGICAL X

LOGICAL*1 X

LOGICAL*2 X

LOGICAL*4 X

LOGICAL*8 X

int x

char x

short x

int x

long long int x

4  

1  

2  

4