REAL :: Area = 0. INTEGER :: Num_Months = 12 REAL, PARAMETER :: Pi = 3.1415927
declares Area to be a real variable with initial value 0., Num_Months to be an integer variable with the initial value 12, and Pi a real parameter with the value 3.1415927.
REAL Area_circle
or, equivalently
REAL :: Area_circle
The latter form is preferred for the purpose of uniform programming style.
REAL(KIND = SELECTED_REAL_KIND(10,34)) :: A
If the processor you are using is unable to support a variable with this type specification, a compile-time error will result.
To declare a real variable to have the equivalent of Fortran 77 accuracy DOUBLE PRECISION, simply do this:
INTEGER, PARAMETER :: DP = SELECTED_REAL_KIND(14) REAL(KIND = DP) :: A
This declares the variable A to be of type real and have at least 14 decimal places of accuracy.
The basic form of a Fortran 90 program is as follows:
PROGRAM name declarations executable statements END PROGRAM
Copyright © 1996-7 by Stanford University. All rights reserved.