Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
E77790.pdf
Скачиваний:
2
Добавлен:
16.05.2024
Размер:
1.29 Mб
Скачать

4.6 Fortran 200x Features

4.6.12Fortran 2003 Enhanced Array Constructor

Use of square brackets in place of (/ and /) in array constructors is allowed:

X = [ 3.2, 4.01, 6.5 ]

The Fortran 2003 standard allows the use of square brackets as array constructors.

The array components within an array constructor can have two forms:

type-spec ::

or

[type-spec ::] ac-value-list

When the optional type-spec is present, the types and kinds of the array components do not have to be the same as long as they are type compatible to the type-spec.

type-spec can be an intrinsic type or a derived type.

4.6.13Object-Oriented Fortran Support

Complete support for polymorphism in Fortran 2003 is available.

4.6.14FINAL Subroutine Support

FINAL subroutines, a Fortran 2003 feature, is supported.

4.6.15Procedure Pointer Support

Procedure pointers, a Fortran 2003 feature, is supported.

4.6.16Parameterized Derived Type

The parameterized derived type (PDT), as defined in the Fortran 2015 standard, is now supported. The Fortran 2015 standard does not allow derived type with the SEQUENCE attribute

Chapter 4 • Oracle Developer Studio Fortran Features and Extensions

185

4.6 Fortran 200x Features

to have type parameters. Therefore, SEQUENCE and BIND(C) will result in errors when used in a parameterized derived type declaration.

Example of a parameterized derived type:

TYPE matrix(k,m,n)

 

INTEGER, KIND :: k=KIND(0.0D0) !

default value

INTEGER, LEN :: m,n

! no default value

REAL(kind) :: element(m,n)

 

END TYPE

 

TYPE (matrix(10,20)) dm

 

TYPE (matrix(4,10,20)) sm

 

Each usage of a declared Parameterized Derived Type (PDT) to declare a symbol must specify all kind of parameter values as constant integers, either specifically or by default. Each instance of such usage creates a usage PDT whose name, in this implementation convention contains all the kind parameter values in the order the kind parameters are declared, separated by commas and enclosed by parentheses. For the above example, the symbol dm has the usage PDT matrix

(8) and the symbol sm has the type matrix(4). This convention establishes matrix(8) and matrix(4) as two different usage PDTs and the assignment:

sm=dm

will result in the error:

sm = dm

^

pdt_matrix.f90, Line = 10, Column = 4: ERROR: Assignment of a

type (MATRIX(8)) expression to a type(MATRIX(4)) variable is not allowed.

4.6.17Additional Fortran 2003 and Fortran 2008 Features

Refer to the published Fortran 2003 and Fortran 2008 standards for details.

2003 extensions to allocatable arrays — reallocation on assignment, and allocatable scalars.

2003 extensions to ALLOCATE/DEALLOCATE statements — ERRMSG and SOURCE.

2003 extensions MOVE_ALLOC intrinsic.

2003 extensions pointer assignment with remapping.

2003 extensions MIN/MAX, MIN/MAXVAL and MIN/MAXLOC with character arguments.

2003 intrinsics IS_IOSTAT_END, IS_IOSTAT_EOR, NEW_LINE.

2003 intrinsic SELECTED_CHAR_KIND.

186 Oracle Developer Studio 12.6: Fortran User's Guide • July 2017

4.6 Fortran 200x Features

2003 REAL type for argument COUNT_RATE of intrinsic SYSTEM_CLOCK.

2003 new restriction on complex SQRT intrinsic result.

2008: Use of null pointers as missing optional arguments.

2008 Bit Intrinsics: BGE, BGT, BLE, BLT, DSHIFTL, DSHIFTR, LEADZ, POPCNT,

POPPAR, TRAILZ, MASKL, MASKR, SHIFTA, SHIFTL, SHIFTR, MERGE_BITS, IALL, IANY, IPARITY.

Enhanced structure constructor: using component names to construct a structure constant.

Enhanced PUBLIC/PRIVATE access control on module derived types and components.

More Fortran 2008 math intrinsic function support. Most Fortran 2008 math intrinsic functions are now supported except for ERFC_SCALED, NORM2 and some REAL*16 variants on x86 platforms.

Derived types with no components.

The KIND argument was added to ICHAR, IACHAR, ACHAR, SHAPE, UBOUND, LBOUND,

SIZE, MINLOC, MAXLOC, COUNT, LEN, LEN_TRIM, INDEX, SCAN and VERIFY intrinsics.

The BACK argument was added to MINLOC and MAXLOC intrinsics.

New intrinsics FINDLOC and STORAGE_SIZE were added.

New keywords ERRMSG, SOURCE and MOLD were added to ALLOCATE statement, and ERRMSG was added to DEALLOCATE statement.

Enumeration with ENUM.

VOLATILE keyword.

PUBLIC/PRIVATE accessibility on individual components.

Public entities of private types.

Enhanced complex constants.

Fortran 2003 ISO_FORTRAN_ENV module.

New KIND= optional argument to intrinsics.

Names of length up to 127 characters, except for module names, which are limited to 31 characters.

ID= and PENDING= specifier in INQUIRE statement.

POS= specifier in data transfer and INQUIRE statements.

BLANK, DECIMAL,

DELIM, PAD,

ROUND, SIZE specifiers.

DC, DP, RD, RC,

RN, RP, RU,

RZ edit descriptors.

INTRINSIC and NON_INTRINSIC keywords in USE.

IS_IOSTAT_END and IS_IOSTAT_EOR intrinsics.

Support for deferred-length character declarations. For example, CHARACTER (LEN=:), POINTER :: STR.

Support passing TARGET objects to INTENT(IN) pointer dummies. This is a Fortran 2008 feature.

Chapter 4 • Oracle Developer Studio Fortran Features and Extensions

187

Соседние файлы в предмете Информационные и сетевые технологии