Steve Lantz, Adam Brazier (revisions)
Cornell Center for Advanced Computing

Revisions: 2/2023, 10/2014, 6/2012 (original)

Fortran's basic types can be expanded in various ways to make them more convenient to use. Characters can be expanded into strings; numerical types can be expanded into arrays, or given a specified precision; and derived datatypes can be formed from collections of other types. In this topic, we'll discover how to declare, initialize, and utilize variables of these advanced types.

Objectives

After you complete this topic, you should be able to:

  • Manipulate strings of characters
  • Explain the difference between static and dynamic arrays
  • Initialize arrays with data
  • Use indexing to access elements or sections of arrays
  • Specify or ascertain the precision of variables and constants
  • Declare a derived type and show how to access its components
Prerequisites
  • Familiarity with an editor
  • Knowledge of how to execute simple commands on the command line
  • Some basic understanding of what a computer language is
 
©   Cornell University  |  Center for Advanced Computing  |  Copyright Statement  |  Inclusivity Statement