previous up next print clean
Next: Modules Up: FORTRAN90 BASICS Previous: Dynamic Allocation

Structures

Structures mean the same thing in Fortran90 as in C. They give the user the ability to incorporate data of different types into several variables. This has obvious benefits. For example, in Three Dimensional Filtering (TDF), subroutines are always passed arrays and the arrays' dimensions. A simple use of a structure would be to define one that contained the dimensions as well as the array. Structures can make code much easier to read, by greatly reducing the numbers of arguments being passed to subroutines and functions. This same reduction also makes it possible to turn many subroutine operations (convolution, for example) into binary functions, which may be called as operators. Well thought out, this can result in very easy coding and expository code. The structures that we use in our SEP data structure are described elsewhere in this paper, but a simple example is given in the Modules paragraph below.


previous up next print clean
Next: Modules Up: FORTRAN90 BASICS Previous: Dynamic Allocation
Stanford Exploration Project
11/12/1997