The record structure was defined in earlier versions of Intel® Fortran as a language extension. It is still supported in Intel® Visual Fortran, although its functionality has been replaced by standard Fortran 95/90 derived data types. Record structures in existing code can be easily converted to Fortran 95/90 derived type structures for portability, but can also be left in their old form. In most cases, an Intel Fortran record and a Fortran 95/90 derived type can be used interchangeably.
Intel Fortran record structures are similar to Fortran 95/90 derived types.
A record structure is an aggregate entity containing one or more elements. (Record elements are also called fields or components.) You can use records when you need to declare and operate on multi-field data structures in your programs.
Creating a record is a two-step process:
Examples
Intel Fortran record structures, using only intrinsic types, easily convert to Fortran 95/90 derived types. The conversion can be as simple as replacing the keyword STRUCTURE with TYPE and removing slash ( / ) marks. The following shows an example conversion:
Record Structure | Fortran 95/90 Derived-Type |
---|---|
|
|
The record structures can be used as subordinate record variables within another record, such as the employee_data
record. The equivalent Fortran 90 derived type would use the derived-type objects as components in a similar manner, as shown below:
Record Structure | Fortran 95/90 Derived-Type |
---|---|
|
|
The following topics are also related to record structures: