You are on page 1of 4

The six data types defined by the ANSI FORTRAN 77 specification are:

INTEGER
REAL
DOUBLE PRECISION
COMPLEX
LOGICAL
CHARACTER [*n], where n is between 1 and 32,767
The data type of a variable, symbolic constant, or function can be declared in a
specification statement. If its type is not declared, the compiler determines a data type
by the first letter of the variable, constant, or function name. A type statement can also
dimension an array variable.
Default requirements for these data types are listed in the following table.
Type Bytes
INTEGER
4
REAL 4
DOUBLE PRECISION
8
COMPLEX 8
LOGICAL
4
CHARACTER
1
CHARACTER*n (Maximum n is 32,767) n
Function syntax

Type of return value

ABS (gen)
Same as argument
ACOS (real)
Same as argument
AIMAG (cmp8) REAL
AINT (real)
Same as argument
ALOG (real4) REAL
ALOG10 (real4)
REAL
AMAX0 (intA, intB [, intC] ..)
REAL
AMAX1 (real4A, real4B, [, real4C]...)
REAL
AMIN0 (intA, intB [, intC]...)
REAL
AMIN1 (real4A, real4B [, real4C]...)
REAL
AMOD (value, mod)
REAL
ANINT (value) REAL
ASIN (real)
Same as argument
ATAN (real)
Same as argument
ATAN2 (realA, realB) Same as argument
CABS (cmp) Same as argument;
COMPLEX returns REAL
CCOS (cmp8) COMPLEX
CHAR (int)
CHARACTER
CLOG (cmp8) COMPLEX
CMPLX (genA [, genB]) COMPLEX
CONJG (cx8value)
COMPLEX

COS (gen)
Same as argument
COSH (real)
Same as argument
CSIN (cmp8) COMPLEX
CSQRT (cx8value)
COMPLEX
DABS (r8value) DOUBLE PRECISION
DACOS (dbl) DOUBLE PRECISION
DASIN (dbl)
DOUBLE PRECISION
DATAN (dbl) DOUBLE PRECISION
DATAN2 (dblA, dblB) DOUBLE
PRECISION
DBLE (value) DOUBLE PRECISION
DCOS (dbl)
DOUBLE PRECISION
DCOSH (dbl) DOUBLE PRECISION
DDIM (dblA, dblB)
DOUBLE
PRECISION
DEXP (dbl)
DOUBLE PRECISION
DIM (genA, genB)
Same as arguments
DINT (rvalue) DOUBLE PRECISION
DLOG (dbl)
DOUBLE PRECISION
DLOG10 (dbl) DOUBLE PRECISION
DMAX1 (dblA, dblB[, dblC]...) DOUBLE
PRECISION
DMIN1 (dblA, dblB[dblC]...)
DOUBLE
PRECISION
DMOD (value, mod)
DOUBLE
PRECISION

DNINT (dbl)
DOUBLE PRECISION
DPROD (real4A, real4B)
DOUBLE
PRECISION
DREAL (cxvalue)
DOUBLE
PRECISION
DSIGN (dblA, dblB)
DOUBLE
PRECISION
DSIN (dbl)
DOUBLE PRECISION
DSINH (dbl)
DOUBLE PRECISION
DSQRT (rvalue)
DOUBLE
PRECISION
DTAN (dbl)
DOUBLE PRECISION
DTANH (dbl) DOUBLE PRECISION
EXP (gen)
Same as argument
FLOAT (ivalue) REAL
IABS (int)
Same as argument
ICHAR (char) INTEGER
IDIM (intA, intB)INTEGER
IDINT (dbl)
INTEGER
IDNINT (dbl) INTEGER
IFIX (real4)
REAL
INDEX (charA, charB) INTEGER
INT (gen)
INTEGER
ISIGN (intA, intB)
INTEGER
LEN (char)
INTEGER

FORTRAN Statements
ASSIGN label TO variable
BACKSPACE {unitspec |
([UNIT=]unitspec
[, ERR=errlabel]
[, IOSTAT=iocheck])}
BLOCK DATA [blockdataname]
CALL sub [([actuals])]
CHARACTER [*chars] vname [*length][(dim)]
[, vname [*length][(dim)]
CLOSE ([UNIT=]unitspec
[, ERR=errlabel]
[, IOSTAT=iocheck]
[, STATUS=status])
COMMON [/[cname] /] nlist,]/[cname] /nlist ]...
COMPLEX vnam [(dim)]
[,vname [(dim)]]...
CONTINUE
DATA nlist /clist/ [ [,] nlist /clist/]...
DIMENSION array ([lower:]upper [, {[lower:]upper ])

LGE (charA, charB)


LOGICAL
LGT (charA, charB)
LOGICAL
LLE (charA, charB)
LOGICAL
LLT (charA, charB)
LOGICAL
LOG (gen)
Same as argument
LOG10 (real) Same as argument
MAX (genA, genB[, genC]...) INTEGER or
REAL
MAX0 (intA, intB[, intC]...)
INTEGER
MAX1 (realA, realB[, realC]...) INTEGER
MIN (genA, genB[, genC]...)
INTEGER or
REAL
MIN0 (intA, intB[, intC]...)
INTEGER
MIN1 (realA, real[, real]...)
INTEGER
MOD (genA, genB)
REAL
NINT (real)
INTEGER
REAL (gen)
REAL
SIGN (genA, genB)
INTEGER or REAL
SIN (gen)
Same as argument
SINH (real)
Same as argument
SNGL(dbl)
REAL
SQRT (gen)
Same as argument
TAN (real)
Same as argument
TANH (real)
Same as argument

DO [label [,] ] dovar = start, stop [, inc]


DOUBLE PRECISION vname [(dim)]
[,vname [(dim)] ]...
ELSE
statementblock
ELSE IF (expression) THEN
statementblock
END
END IF
ENDFILE {unitspec |
([UNIT=] unitspec
[, ERR=errlabel]
[, IOSTAT=iocheck] )}
ENTRY ename [ ( [formal [,formal ]...])]
EQUIVALENCE (nlist) [, (nlist)]...
EXTERNAL name [,name ]...
FORMAT [editlist]
[ type] FUNCTION func ([formal ][,formal ]...)
GOTO variable [ [,] (labels)]
GOTO (labels) [,] n
GOTO label
IF (expression) label1, label2, label3
IF (expression) statement
IF (expression) THEN
statementblock1
[ELSE IF (expression) THEN
statementblock2]...
[ELSE
statementblock3]
END IF
IMPLICIT type (letters) [, type (letters)]... INQUIRE ({[UNIT=]unitspec | FILE=file} [ ,
ACCESS=access]
[ , BLANK=blank] [ , DIRECT=direct] [ , ERR=errlabel] [ , EXIST=exist] [ , FORM=form]
[ , FORMATTED=formatted] [ , IOSTAT=iocheck]
[ , NAME=name] [ , NAMED=named]
[ , NEXTREC=nextrec] [ , NUMBER=num] [ , OPENED=opened]
[ , RECL=recl] [ , SEQUENTIAL=seq] [ , UNFORMATTED=unformatted])
INTEGER vname [(dim)]
[ , vname [ (dim)] ] ...
INTRINSIC names
LOGICAL vname [(dim)]
[, vname [(dim)]]...

OPEN ([UNIT=]unitspec [ , ACCESS=access] [ , BLANK=blanks]


[ , ERR=errlabel] [ , FILE=file]
[ , FORM=form] [ , IOSTAT=iocheck]
[ , RECL=recl] [ , STATUS=status])
PARAMETER (name=constexpr [, name=constexpr]...)
PAUSE [prompt]
PRINT { *, | formatspec | } [, iolist]
PROGRAM program-name
READ { formatspec, | ([UNIT=] unitspec [ , [FMT=]
formatspec] [ , END=endlabel ] [ , ERR=errlabel ]
[ , IOSTAT=iocheck] [ , REC=rec])} iolist
REAL vname [(dim)]
[, vname [(dim)]]...
RETURN [ordinal]
REWIND { unitspec |
([UNIT=]unitspec
[ , ERR=errlabel]
[ , IOSTAT=iocheck])}
SAVE [names]
STOP [ message]
SUBROUTINE subr [([ formal [ , formal ]...])]
WRITE ([UNIT=] unitspec
[ , [ FMT=] formatspec]
[ , ERR=errlabel]
[ , IOSTAT=iocheck]
[ , REC=rec] )
iolist

You might also like