Loading in 2 Seconds...

Parameterized modules, BITS, and other features that may or may not be included

Loading in 2 Seconds...

- By
**taima** - Follow User

- 116 Views
- Uploaded on

Download Presentation
## PowerPoint Slideshow about 'Parameterized modules, BITS, and other features that may or may not be included' - taima

**An Image/Link below is provided (as is) to download presentation**

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript

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

Repository started 2004-05

Preliminary choice of significant features 2005-04Final choice of significant features 2006-02

Completion of separate edits 2006-05First working draft available 2007-05

First CD submitted for registration and approval 2007-10

Final CD submitted for approval 2008-09

WG5 approval of draft DIS 2009-04DIS ballot initiated 2009-05DIS ballot results available 2009-07Standard published 2009-08

For further detail

WG5 repository of requirements N1626

WG5 classification of items resolution D6 inN1630

WG5 severity level description N1594

WG5 schedule N1590

WG5 document archive: ftp://www.nag.co.uk/sc22wg5/

J3 document archive: http://j3-fortran.org/doc/

Severity Levels - Editorial

1. 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 meeting

To be implemented: 16 items

level 6: 1; level 5: 2; level 4: 8; level 3: 5

To be implemented if time permits: 18 items

level 7:1; level 6: 1; level 4/5: 1; level 4: 11; level 3: 4

Not to be pursued: 12 items

level 5: 2; level '>4': 1, level 4: 7; level 3/4: 2

Decision deferred: 19 items

level 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 modules

Provide 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 modulesexamples

Module 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

BITS

The 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 operations

The .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., ==, /=, <, <=, >, and >= 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/Output

The 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 Functions

Some existing intrinsic functions, especially those dealing with

boz-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 form

decision 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 declarations

do 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)

Expressions and assignment

do 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/Output

do 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 resolution

do if time:

- Use ALLOCATABLE and POINTER attributes in (ref J3-012)

generic resolution

- Use procedureness in generic resolution (ref UK-009)

Argument association

decision deferred:

- Disassociated or deallocated actual argument associated with

nonpointer nonallocatable optional dummy argument is

considered not to be present (ref J3-016)

Intrinsic procedures

do 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)

Interoperability

do 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 pursued

J3-007 Construct Name Local to Construct

J3-011 Coroutines

J3-017 Default initial values for absent optional dummy arguments

J3-021 Resolve generic without invoking a procedure or evaluating

arguments

J3-031 ANDTHEN and ORELSE pseudo-functions

J3-036 Use, Except

J3-037 Pointers and Targets

J3-040 Compute if actual arg is present

J3-045 Same Assumed Shape declaration

J3-049 Select between expressions

RU-004 Subset of Fortran Standard which does not include

redundant features

UK-010 Partial initialization of PARAMETERs

Outcome of items byJ3 classificationof its own submissions

Download Presentation

Connecting to Server..