Fortran offers the programmer a variety of ways to store and refer to data. You can refer to data literally, as in the real numbers 4.73 and 6.23E5, the integers -3000 and 65536, or the CHARACTER literal "Continue (y/n)?". Or, you can store and reference variable data, using names such as x or y, DISTANCE_FROM_ORIGIN or USER_NAME. Constants such as pi or the speed of light can be given names and constant values. You can store data in a fixed-size area in memory, or allocate memory as the program needs it. Finally, Fortran offers various means of creating, storing, and referring to structured data, through use of arrays, pointers, and derived types.
In the following sections, these topics are covered:
- Data Types describes the various intrinsic data types available in Fortran 95 and introduces the concept of KIND.
- Literal Data describes data constants, and how to express a constant as a given intrinsic type and kind.
- Named Data describes named data constants, variables and function results, and describes various attributes that these objects may exhibit.
- Character Substrings describes character data, and describes how to extract substrings from character variables.
- Arrays covers the complex topic of array variables. Subtopics describe dynamically sized arrays, array references, array sections, subscript triplets, vector subscripts and initialization of array data using array constructors
- Derived Types describes creating user defined data types. Subtopics cover defining and declaring derived type variables, reference to derived type components, and initialization of derived type data
- Pointers describes declaration and rules of association for pointer variables.