To: SC22 From: Miles Ellis, Convenor: SC22/WG5 Date: 1995-08-21 Subject:Request for subdivision of project JTC1.22.02.01 to produce a Technical Report (Type 2) on Enhanced Derived Type Facilities WG5 requests SC22 to subdivide project JTC1.22.02.01 in order to permit work on the following sub-project: 1. Title Enhancement of the derived type facilities in Fortran 2. Scope To define the extensions to the syntax and semantics of Fortran (as defined in the Fortran 95 standard) to extend to derived types the facility of parameterisation similar to that already supported for intrinsic types, and also to allow the components of a derived type to be allocatable. 3. Purpose and justification It is a major language irregularity in the current Fortran language that while intrinsic types are parameterised, derived types cannot be. As a result it is very inconvenient to mix parameterised intrinsic types and derived types in the same program. For example, a library of support procedures may be readily produced which is generic over real numeric precisions. Provided that this library employs only intrinsic real data, the end-user can write programs using the library that are fully parameterized via the real kind parameter mechanism. If, however, it were convenient for some of the data related to the library to be defined by a structure, the lack of derived type parameterization means that a separate type would be required for each different real kind involved. The end-user could not then fully parameterize his or her program. The intrinsic type entities could still be parameterized, but the derived type entities would require the use of the specific absolute types as appropriate for the particular target kind of the program. Should this be required to change, all the difficulties associated with precision changing, etc., which the kind parameterization mechanism was designed to alleviate would be encountered There is, therefore, a pressing need to extend the derived type facilities to correct this irregularity and to allow derived types to be parameterized in ways that are similar to those that apply for intrinsic types. Such an extension will also enhance the data abstraction capability of the language in a way which will improve its "object oriented programming" capabilities. The restriction which precludes components of a derived type from being allocatable is also a significant irregularity. It forces the use of pointer components even in applications which do not need the general indirection capabilities of pointers. This has a number of serious implications for program efficiency. There is, therefore, a need for allocatable components to provide for more efficient support for applications of this kind. At its meeting in Tokyo, Japan, 1995-04-17/21, WG5 resolved to adopt a new approach for accelerating standardization of certain key features which were deemed to be too urgent to wait for the next revision of the Fortran Standard. This approach, which is based on the production of Type 2 Technical Reports that would be incorporated unaltered in the next revision unless experience in their implementation and use demanded changes, is described in SC22 N1862. It is proposed, therefore, to produce a type 2 technical report to define the necessary language extensions and to place them in the public domain. It is intended that these extensions will be included without change in a subsequent revision of the Fortran standard, unless experience in implementing and using them indicates that there are serious inadequacies in the definition. It is hoped that this will allow for a rapid technical development and for early testing well before a subsequent language revision. 4. Programe of work A Type 2 Technical Report will be developed for this project. 5. Relevant documents to be considered ISO/IEC 1539-1 : Draft CD 1995Programming Language Fortran Part 1 (SC22 N1842 The following are the major relevant WG5 papers (minor papers responding to these are not cited here): N997 (1994-06) Parameterized Derived Types [B9/C2] (J L Schonfelder) N1040 (1994-08) Allocatable Components in Structures (X3J3) 6. Cooperation and liaison ANSI/X3J3 _ US Fortran Technical Committee 7. Preparatory work offered with target date(s) This topic has been considered in considerable detail by WG5 already and proposals already exist for both parameterization and allocatable components in derived types. These will form the basis of the proposed Technical Report. It is expected that a document will be ready for balloting as a PDTR by April 1996. Lawrie Schonfelder (UK) is the proposed editor for this technical report. There will be no requirement for a maintenance agency or registration authority for this project. There are no known requirements for coding. The proposed technical report does not concern any known patented items.