Variables and the names of variables

Home Computational Physics FORTRAN Variables and the names of variables


Fundamentals of Fortran Computation
Variables and the names of variables
 
Integer
A whole number. It may be zero or any positive or negative number. Name of integer variables has 1 to 6 letters or digits, the first of witch is I,J,K,L,M or N. (The limit of six letters or digits is typical but may be different in some versions.)

Examples of acceptable names:
I, KLM, MATRIX, L123, I6M2K, KATWA

Example of unacceptable names:
J123456 Too many characters.
ABC Does not begins with the correct character.
5M Does not begin with the correct character.
J_ABC Contains a character other than a letter or digit.
 
Real
Real numbers are presented in floating point form. Name of integer variables has 1 to 6 letters or digits, the first of witch is a letter but not I,J,K,L,M or N.

Examples of acceptable names:
AVAR, R51TX, FRONT, G, F0009, SVECT, AMATRX

Example of unacceptable names:
A123456 Contains too many characters.
8BOX Does not begins with a letter.
KJL1 Does not begin with the correct letter.
*BCD Contains a character other than a letter or a digit.