parameterized modules, bits, and other features that may or may not be included

27
Parameterized modules, BITS, and other features that may or may not be included in the revision of Fortran 2003 David Muxworthy BSI Fortran Convenor Prepared for the BCS FSG AGM on 2 June 2005

Upload: taima

Post on 05-Jan-2016

19 views

Category:

Documents


0 download

DESCRIPTION

Parameterized modules, BITS, and other features that may or may not be included in the revision of Fortran 2003 David Muxworthy BSI Fortran Convenor Prepared for the BCS FSG AGM on 2 June 2005. F2003+ Revision Schedule. Repository started2004-05 - PowerPoint PPT Presentation

TRANSCRIPT

  • Parameterized modules, BITS, and otherfeatures that may or may not be includedin the revision of Fortran 2003

    David MuxworthyBSI Fortran Convenor

    Prepared for the BCS FSG AGM on 2 June 2005

  • Repository started2004-05Preliminary choice of significant features2005-04 Final choice of significant features2006-02

    Completion of separate edits2006-05 First working draft available2007-05 First CD submitted for registration and approval2007-10 Final CD submitted for approval2008-09

    WG5 approval of draft DIS2009-04 DIS ballot initiated2009-05 DIS ballot results available2009-07 Standard published2009-08 F2003+ Revision Schedule

  • For further detailWG5 repository of requirements N1626WG5 classification of items resolution D6 inN1630WG5 severity level descriptionN1594WG5 scheduleN1590

    WG5 document archive: ftp://www.nag.co.uk/sc22wg5/J3 document archive: http://j3-fortran.org/doc/

  • Severity Levels - Editorial1.Minor editorial (less than 10 lines altered). 2.Significant editorial (up to a page altered) with no technical change. 3.Major editorial (up to a chapter altered) with no technical change.

  • Severity Levels Technical (1)3.Very minor technical change.An example is adding the optional argument KIND to IACHAR.

    Minor technical change.An example is changing type-bound generics to be sets of specific named type-bound procedures. 5.Technical change likely to need more than two J3 meetings to develop. An example is reallocation of allocatable arrays.

  • Severity Levels Technical (2)6.Technical change likely to need more than a year to develop. The modules and allocatable TRs are examples. 7.Technical change likely to need more than 2 years to develop. The IEEE TR is an example. 8.Technical change likely to need more than 3 years to develop. Interfacing with C and the OO features are examples.

  • Summary of decisions on requirementsat May 2005 WG5 meetingTo be implemented:16 itemslevel 6: 1; level 5: 2; level 4: 8; level 3: 5

    To be implemented if time permits:18 itemslevel 7:1; level 6: 1; level 4/5: 1; level 4: 11; level 3: 4

    Not to be pursued:12 itemslevel 5: 2; level '>4': 1, level 4: 7; level 3/4: 2

    Decision deferred:19 itemslevel 4: 2; level 3: 16; level 2: 1

  • Two large"Do if time" items

    - Parameterized modules(ref J3-014)

    - BITS renamed from TYPELESS(ref J3-047)

  • Parameterized modulesProvide a facility whereby a module or subprogram can be developed in a generic form, and then applied to any appropriate type.

    A generic module is a template or pattern for generating specific instances. It has "generic parameters" but is otherwise structurally similar to a nongeneric module. A generic parameter can be a type, a data object, a procedure, a generic interface, a nongeneric module, or a generic module.

  • Parameterized modulesexamplesModule with type having at least a specified component module LinkedLists ( MyType ) type :: MyType type(myType), pointer :: Next! "next" component is required. ! Type is allowed to have other components, and TBPs. end type MyType .... Module with type having separately-specified kind parameter module LinkedLists ( MyType, ItsKind ) type :: MyType(itsKind) integer, kind :: itsKind end type MyType integer, kind :: ItsKind

  • BITSThe BITS type has values that are contiguous, ordered sequences of bits. The bit_size is the number of bits in the sequence.

    A processor shall provide BITS sizes with bit_size values corresponding to the storage sizes of each of the INTEGER kinds provided, as well as the storage sizes of twice and four times the size of the default INTEGER storage size.

    Each provided bit_size is characterized by a value for a type parameter called the kind type parameter. The kind type parameter is of type default integer. The kind type parameter of a BITS object is returned by the intrinsic inquiry function KIND. The number of bits of a BITS object is returned by the intrinsic function BIT_SIZE. The intrinsic function SELECTED_BITS_KIND returns a kind value based on the specified number of bits.

  • BITS operationsThe .and., .or., .xor., and .not. operators are defined for BITS operands. The computations are bitwise operations. The result of the expression evaluation is of type BITS. If the operands are of unequal bit_size, the smaller is padded on the left with zero bits before the operation is performed.

    The .eq., .ne., .lt., .le., .gt., .ge., ==, /=, = operators are defined for BITS operands. If the operands are of unequal KIND, the smaller is padded on the left with zero bits before the operation is performed. Operands A and B are equal if their corresponding bits are the same, and are unequal otherwise.If A and B are unequal, and the leftmost unequal corresponding bit of A is 1 and of B is 0, then A > B, otherwise A < B.

  • BITS Input/OutputThe format specifiers for BITS objects are I, B, O, and Z. For output, if the .d part of the Bw.d, Ow.d, or Zw.d specifier is omitted, the value assumed for d is >= 1 and large enough to represent the bits in the I/O list item excluding leading 0 bits.

    For the I format specifier, the object value is interpreted as an unsigned base 10 integer. For input using the B, O, and Z edit descriptors, the character string shall consist of binary, octal, or hexadecimal digits in the respective input field. For input using the I format, the input character string shall consist of an unsigned decimal integer. For list directed output, the format used is Zw.d where d is (bit_size of the I/O list item + 3)/4 and w = d+1.

    For list directed input, hexadecimal constants are valid for BITS I/O list items.

  • BITS Intrinsic FunctionsSome existing intrinsic functions, especially those dealing withboz-literal-constants, are extended to deal with variables of type BITS.

    Some new intrinsic functions are introduced to deal with such things as shifting, masking, merging and counting the number of leading and trailing zero bits.

  • Source formdecision deferred:- Allow SUBROUTINE name & FUNCTION name to be(ref J3-025) optional for module and internal subprograms- Allow semicolon to start a line(ref J3-035)

  • Types and declarationsdo if time:- Non-null initial targets for pointers(ref J3-018)- Determine named array constant length from its(ref J3-023) initialization expression- Rewrite the requirements on attributes (editorial)(ref J3-008)

    decision deferred:- Find all available logical & character kinds(ref J3-006)- Simplified means to select the most commonly desired real and integer kinds(ref J3-030)- KIND environment specification(ref UK-004)- Provide a table of attribute compatibility (editorial)(ref RU-006)- Allow forward type for allocatable components(ref J3-028)- Add MOLD keyword to ALLOCATE(ref J3-034)

  • Execution controldo if time:- EXIT from any labelled construct(ref J3-024and RU-002)

  • Expressions and assignmentdo if time:- Updating complex parts(ref J3-015)- Allow polymorphic allocatable variable in intrinsic(ref J3-022) assignment- Pointer function references on lhs in assignment(ref UK-008)

    decision deferred:- Multiple Nonzero-Rank Part References(ref UK-006)

  • Input/Outputdo if time:- Write files in comma separated values (CSV) format(ref J3-048)- Standard derived type for I/O units(ref J3-009)

    decision deferred:- Intrinsic procedure to get I/O unit(ref J3-002)

  • Generic resolutiondo if time:- Use ALLOCATABLE and POINTER attributes in (ref J3-012) generic resolution- Use procedureness in generic resolution (ref UK-009)

  • Argument associationdecision deferred:- Disassociated or deallocated actual argument associated with nonpointer nonallocatable optional dummy argument is considered not to be present (ref J3-016)

  • Intrinsic proceduresdo if time:- Add array reduction functions from HPF(ref RU-005)- Add Bessel functions, erf, etc as in C(ref J3-038)

    decision deferred:- Add STORAGE_SIZE procedure(ref J3-004)- Allow ATAN with two arguments(ref J3-026)- Get more information on GET_COMMAND failure(ref J3-029)- Procedure to return compiler version(ref J3-033)- FINDLOC procedure(ref J3-032)

  • Arithmeticdo if time:- Conformance to IEEE 754R(ref UK-003)

  • Interoperabilitydo if time:- Interoperability of pointers, allocatables, (ref J3-041) assumed-shape arrays- Interoperability of optional arguments(ref J3-042)

    decision deferred:- Add C_SIZEOF, same as sizeof in C(ref J3-005)

  • Items not to be pursuedJ3-007Construct Name Local to ConstructJ3-011CoroutinesJ3-017Default initial values for absent optional dummy argumentsJ3-021Resolve generic without invoking a procedure or evaluatingargumentsJ3-031ANDTHEN and ORELSE pseudo-functionsJ3-036Use, ExceptJ3-037Pointers and TargetsJ3-040Compute if actual arg is presentJ3-045Same Assumed Shape declarationJ3-049Select between expressionsRU-004Subset of Fortran Standard which does not includeredundant featuresUK-010Partial initialization of PARAMETERs

  • Outcome of items by countrywhich proposed them

    Source

    WG5 classification

    total

    must do

    do if time

    defer

    drop

    J3

    11

    14

    14

    10

    49

    RU

    1

    1

    3

    1

    6

    UK

    4

    3

    2

    1

    10

    total

    16

    18

    19

    12

    65

  • Outcome of items byJ3 classificationof its own submissions

    J3 classification

    WG5 classification

    total

    must do

    do if time

    defer

    drop

    must do

    5

    2

    0

    1

    8

    do if time

    5

    11

    11

    6

    33

    do not allocate resources

    1

    1

    3

    3

    8

    total

    11

    14

    14

    10

    49