IntelĀ® Fortran Compiler 18.0 Developer Guide and Reference
The record structure was defined in earlier versions of Intel® Fortran as a language extension. It is still supported, although its functionality has been replaced by Standard Fortran derived data types. Record structures in existing code can be easily converted to Standard Fortran derived type structures for portability, but can also be left in their old form. In most cases, an Intel Fortran record and a Standard Fortran derived type can be used interchangeably.
Intel Fortran record structures are similar to Standard Fortran 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:
You must define the form of the record with a multistatement structure declaration.
You must use a RECORD statement to declare the record as an entity with a name. (More than one RECORD statement can refer to a given structure.)
Intel Fortran record structures, using only intrinsic types, easily convert to Standard Fortran 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 |
Standard Fortran Derived-Type |
---|---|
|
|
The record structures can be used as subordinate record variables within another record, such as the employee_data record. The equivalent Standard Fortran derived type would use the derived-type objects as components in a similar manner, as shown below:
Record Structure |
Standard Fortran Derived-Type |
---|---|
|
|