next up previous
Next: Extensions of the Up: Implementation in Fortran Previous: Fortran Variable Names

Fortran 90 Type Declarations

In Fortran each variable is defined to hold exactly one kind of data. For example, a variable named X might be able to hold integers, or it might be able to hold real numbers, but it can't hold both kinds of numbers. The Type of a variable is the kind of data it can hold.

Every variable in a Fortran program has a specific type. Right now, the types that are of interest to us are the numerical types. The names of the Fortran numerical types are:

To declare a variable in a Fortran program, you put a line containing the variable's type and name on a line after the program line. For example, the statement:

      integer :: count
declares that there is a variable named count and that it can contain integer values (and only integer values). You can declare several variables of the same type on a single line by separating the variable names with commas. For example:
      real :: shoulderx, shoulderY
declares that there are two variables named shoulderx and shouldery that can contain real values. Look at the rbtjnts.f program and identify the variable declarations.



next up previous
Next: Extensions of the Up: Implementation in Fortran Previous: Fortran Variable Names


J. C. Diaz