Fortran Variable Declarations


Declaring the type of a Fortran variable is done with type statements. It has the following form:
type-specifier :: list
where the type-specifier is one of the following and list is a list of variable names separated with commas:

Types INTEGER and REAL are easy. The following are examples:

Type CHARACTER is more involved. Since a string has a length attribute, a length value must be attached to character variable declarations. There are two ways to do this: