next up previous contents index
Next: D. HPF Intrinsics and Up: ADAPTOR HPF Language Reference Previous: B. Fortran 95   Contents   Index

Subsections


C. Fortran Intrinsics

A lot of Fortran intrinsic functions can be translated with ADAPTOR but still remain Fortran intrinsic functions in the generated code. If they are FORTRAN 77 intrinsic functions they should be compiled by every FORTRAN 77 compiler. But Fortran 90 intrinsic functions might require a Fortran 90 compiler on the target system.

If an intrinsic function is available, it means that ADAPTOR translates it to corresponding FORTRAN 77 code with corresponding support in the runtime system. These functions can be used without any restrictions.

If an intrinsic is noted as restricted, it means that the functionality is not full available, e.g. a parameter value must be known at compile time or an optional parameter must not be available.

If an intrinsic is noted as not available, it means, that it cannot be used with ADAPTOR at all.

C..1 Numeric, mathematical, character, kind, logical and bit procedures

C..1.1 Numeric functions

The numeric functions are INT, REAL, DBLE, CMPLX, AIMAG, CONJG, AINT, ANINT, NINT, ABS, MOD, SIGN, DIM, DPROD, MODULO, FLOOR, CEILING, MAX and MIN. They are all elemental functions.

All numeric intrinsic functions are supported. Attention has to be paid to those functions that are not supported by the F77 compiler of the target machine.

Some of the Fortran intrinsic routines can have an optional KIND argument. ADAPTOR treats them in the following way:

C..1.2 Mathematical functions

The elemental functions SQRT, EXP, LOG, LOG10, SIN, COS, TAN, ASIN, ACOS, ATAN, ATAN2, SINH, COSH and TANH evaluate elementary mathematical functions.

They are all supported without any restrictions.

C..1.3 Character functions

The elemental functions ICHAR, CHAR, LGE, LGT, LLE, LLT, IACHAR, ACHAR are handled.

The elemental functions LEN_TRIM, SCAN, ADJUSTL, ADJUSTR, and VERIFY, as well as the transformational functions REPEAT and TRIM are not supported (do not belong to FORTRAN 77).

C..1.4 Character inquiry functions

The inquiry function LEN is supported.

C..1.5 Kind functions

Kind parameters provide are way to parameterize the selection of different possible machine representations for each of the intrinsic data types. This feature is now supported in ADAPTOR. This includes the inquiry function KIND as well as the transformational functions SELECTED_REAL_KIND and SELECTED_INT_KIND.

C..1.6 Logical function

The elemental function LOGICAL is not available.

C..1.7 Bit manipulation and inquiry procedures

Logical operations on bits are provided by the functions IOR, IAND, NOT and IEOR, shift operations are given by the functions ISHFT and ISHFTC. Bit subfields may be referenced by the function IBITS and by the subroutine MVBITS. Single-bit processing is provided by the functions BTEST, IBSET, and IBCLR.

All of these functions are checked by ADAPTOR, but their realization is passed to the compiler of the generated code.

C..2 Transfer function

The function TRANSFER is not available.

C..3 Numeric manipulation and inquiry functions

All the corresponding numeric inquiry functions RADIX, DIGITS, MINEXPONENT, MAXEXPONENT, PRECISION, RANGE, HUGE, TINY and EPSILON, and the floating point manipulation functions EXPONENT, SCALE, NEAREST, FRACTION, SET_EXPONENT, SPACING and RRSPACING cannot be used as long as the available Fortran compiler does not support these functions.

C..4 Intrinsic subroutines

C..4.1 Date and time subroutines

The timing routines of Fortran 90 are available to guarantee also a rather good portability of codes that are timed. These routines are DATE_AND_TIME, SYSTEM_CLOCK and CPU_TIME.

    DATA_AND_TIME ([DATE] [,TIME] [,ZONE], [,VALUES])
    SYSTEM_CLOCK ([COUNT] [,COUNT_RATE] [,COUNT_MAX])
    CPU_TIME (TIME)

C..4.2 Pseudorandom numbers

The intrinsic subroutines RANDOM_NUMBER and RANDOM_SEED are supported by ADAPTOR and realized by own library implementations.

         RANDOM_NUMBER (harvey)
         RANDOM_SEED ([SIZE][,PUT],[,GET])

C..5 Array intrinsic functions

C..5.1 Array inquiry functions

The functions LBOUND, UBOUND, SHAPE, SIZE are realized by ADAPTOR and own library functions.

The function ALLOCATED can be used, but the use of allocation is currently restricted (see section A.2.1).

C..5.2 Vector and matrix multiply functions

The functions DOT_PRODUCT and MATMUL can be used without any restrictions. For both routines parallel code will be generated.

C..5.3 Array reduction functions

The functions ALL, ANY, COUNT, MAXVAL, MINVAL, PRODUCT and SUM are supported by ADAPTOR. There are efficient realizations for these reductions in the context of distributed arrays.

C..5.4 Array construction functions

The functions MERGE and SPREAD are supported.

The functions PACK and UNPACK can be used but are not parallelized.

C..5.5 Array reshape function

The function RESHAPE can be used but is not parallelized so far.

C..5.6 Array manipulation functions

The array manipulation functions CSHIFT, EOSHIFT and TRANSPOSE are implemented, also rather efficiently for distributed arrays.

C..5.7 Array location functions

The array location functions MINLOC and MAXLOC are available, but cannot be used with the DIM argument.

C..5.8 Pointer association status functions

The functions ASSOCIATED and NULL are not available as ADAPTOR does not support pointer at all.


Table 4: Fortran Intrinsics.
Intrinsic Available Class Type
ABS F77 Elemental Numeric
ACHAR F90 Elemental Transfer
ACOS F77 Elemental Numeric
ADJUSTL F90 Elemental Character
ADJUSTR F90 Elemental Character
AIMAG F77 Elemental Transfer
AINT F77 Elemental Transfer
ALL Yes Transformational Array reduction
ALLOCATED No Inquiry Array inquiry
ANINT F77 Elemental Transfer
ANY Yes Transformational Array reduction
ASIN F77 Elemental Numeric
ASSOCIATED No Inquiry Pointer association
ATAN F77 Elemental Numeric
ATAN2 F77 Elemental Numeric
BIT_SIZE F90 Inquiry Bit inquiry
BTEST F90 Elemental Bit computation
CEILING F90 Elemental Numeric
CHAR F90 Elemental Transfer
CMPLX F77 Elemental Transfer
CONJG F77 Elemental Transfer
COS F77 Elemental Numeric
COSH F77 Elemental Numeric
COUNT Yes Transformational Array reduction
CPU_TIME Yes Subroutine Subroutine
CSHIFT Yes Transformational Array manipulation
DATE_AND_TIME Yes Subroutine Subroutine
DBLE F77 Elemental Transfer
DIGITS F90 Inquiry Numeric inquiry
DIM F77 Elemental Numeric
DOT_PRODUCT Yes Transformational Vector multiplication
DPROD F90 Elemental Numeric
EOSHIFT Yes Transformational Array manipulation
EPSILON F90 Inquiry Numeric inquiry
EXP F77 Elemental Numeric
EXPONENT F90 Elemental Floating point man.



Table 5: Fortran Intrinsics (continued).
Intrinsic Available Class Type
FLOOR F90 Elemental Numeric
FRACTION F90 Elemental Floating point man.
HUGE F90 Inquiry Numeric inquiry
IACHAR F90 Elemental Transfer
IAND Mil. Std. Elemental Bit computation
IBCLR Mil. Std. Elemental Bit computation
IBITS F90 Elemental Transfer
IBSET Mil. Std. Elemental Bit computation
ICHAR F90 Elemental Transfer
IEOR Mil. Std. Elemental Bit computation
INDEX F90 Elemental Character
INT F90 Elemental Transfer
IOR Mil. Std. Elemental Bit computation
ISHFT Mil. Std. Elemental Bit computation
ISHFTC Mil. Std. Elemental Bit computation
KIND Yes Inquiry Kind
LBOUND Yes Inquiry Array inquiry
LEN F90 Inquiry Char inquiry
LEN_TRIM F90 Elemental Character
LGE F77 Elemental Character
LGT F77 Elemental Character
LLE F77 Elemental Character
LLT F77 Elemental Character
LOG F77 Elemental Numeric
LOG10 F77 Elemental Numeric
LOGICAL F90 Elemental Transfer
MATMUL Yes Transformational Array multiplication
MAX F77 Elemental Numeric
MAXEXPONENT F90 Inquiry Numeric inquiry
MAXLOC restricted Transformational Array location
MAXVAL Yes Transformational Array reduction
MERGE Yes Elemental Array construction
MIN F77 Elemental Numeric
MINEXPONENT F90 Inquiry Numeric inquiry
MINLOC Restricted Transformational Array location
MINVAL Yes Transformational Array reduction
MOD F77 Elemental Numeric
MODULO F90 Elemental Numeric
MVBITS F90 Subroutine Subroutine
NEAREST F90 Elemental Floating point man.
NINT F77 Elemental Transfer
NOT Mil. Std. Elemental Bit Computation



Table 6: Fortran Intrinsics (continued).
Intrinsic Available Class Type
NULL No Transformational Pointer association
PACK serial Transformational Construction
PRECISION F90 Inquiry Numeric inquiry
PRESENT Yes Inquiry Argument
PRODUCT Yes Transformational Array reduction
RADIX F90 Inquiry Numeric inquiry
RANDOM_NUMBER Yes Subroutine Subroutine
RANDOM_SEED Yes Subroutine Subroutine
RANGE F90 Inquiry Numeric inquiry
REAL F77 Elemental Transfer
REPEAT F90 Transformational Character
RESHAPE serial Transformational Array reshape
RRSPACING F90 Elemental Floating point man.
SCALE F90 Elemental Floating point man.
SCAN F90 Elemental Character
SELECTED_INT_KIND Yes Transformational Kind
SELECTED_REAL_KIND Yes Transformational Kind
SET_EXPONENT F90 Elemental Floating point man.
SHAPE Yes Inquiry Array inquiry
SIGN F77 Elemental Numeric
SIN F77 Elemental Numeric
SINH F77 Elemental Numeric
SIZE Yes Inquiry Array inquiry
SPACING F90 Elemental Floating point man.
SPREAD Yes Transformational Array construction
SQRT F77 Elemental Numeric
SUM Yes Transformational Array reduction
SYSTEM_CLOCK Yes Subroutine Subroutine
TAN F77 Elemental Numeric
TANH F77 Elemental Numeric
TINY F90 Inquiry Numeric inquiry
TRANSFER F90 Transformational Transfer
TRANSPOSE Yes Transformational Array manipulation
TRIM F90 Transformational Character
UBOUND Yes Inquiry Array inquiry
UNPACK serial Transformational Array construction
VERIFY F90 Elemental Character



Table 7: Fortran Specific Mathematic Intrinsics.
Generic Number Specific Type of Type of
Name of Args Name Argument Result
ACOS 1 ACOS real real
  1 DACOS double precision double precision
ASIN 1 ASIN real real
  1 DASIN double precision double precision
ATAN 1 ATAN real real
  1 DATAN double precision double precision
ATAN2 1 ATAN2 real real
  1 DATAN2 double precision double precision
COS 1 COS real real
  1 DCOS double precision double precision
  1 CCOS complex complex
  1 CDCOS double complex double complex
COSH 1 COSH real real
  1 DCOSH double precision double precision
EXP 1 EXP real real
  1 DEXP double precision double precision
  1 CEXP complex complex
  1 CDEXP double complex double complex
LOG 1 ALOG real real
  1 DLOG double precision double precision
  1 CLOG complex complex
  1 CDLOG double complex double complex
LOG10 1 ALOG10 real real
  1 DLOG10 double precision double precision
SIN 1 SIN real real
  1 DSIN double precision double precision
  1 CSIN complex complex
  1 CDSIN double complex double complex
SINH 1 SINH real real
  1 DSINH double precision double precision
SQRT 1 SQRT real real
  1 DSQRT double precision double precision
  1 CSQRT complex complex
  1 CDSQRT double complex double complex
TAN 1 TAN real real
  1 DTAN double precision double precision
TANH 1 TANH real real
  1 DTANH double precision double precision



Table 8: Fortran Specific Numeric Intrinsics.
Generic Number Specific Type of Type of
Name of Args Name Argument Result
AIMAG 1 AIMAG complex real
  1 DIMAG double complex double precision
CONJG 1 CONJG complex complex
  1 DCONJG double complex double complex
ABS 1 IABS integer integer
  1 ABS real real
  1 DABS double precision complex
  1 CABS complex real
  1 CDABS double complex double precision
AINT 1 AINT real real
  1 DINT double precision double precision
ANINT 1 ANINT real real
  1 DNINT double precision double precision
NINT 1 NINT real integer
  1 IDNINT double precision integer
MIN $>$ 1 MIN0 integer integer
    MIN1 real integer
    AMIN0 integer real
    AMIN1 real real
    DMIN1 double precision double precision
MAX $>$ 1 MAX0 integer integer
    MAX1 real integer
    AMAX0 integer real
    AMAX1 real real
    DMAX1 double precision double precision
MOD 2 MOD integer integer
    AMOD real real
    DMOD double precision double precision
SIGN 2 ISIGN integer integer
    SIGN real real
    DSIGN double precision double precision
DIM 2 IDIM integer integer
    DIM real real
    DDIM double precision double precision



Table 9: Fortran Specific Numeric Intrinsics (contd).
Generic Number Specific Type of Type of
Name of Args Name Argument Result
INT 1   integer integer
  1 IFIX real integer
  1 IDINT double precision integer
  1   complex integer
  1   double complex integer
REAL 1 FLOAT integer real
  1   real real
  1 SNGL double precision real
  1   complex real
  1   double complex real
DBLE 1   integer double precision
  1   real double precision
  1   double precision double precision
  1   complex double precision
  1   double complex double precision
CMPLX 1   integer complex
  1   real complex
  1   double precision complex
  1   complex complex
  1   double complex complex
DCMPLX 2   integer double complex
  2   real double complex
  2   double precision double complex
DCMPLX 1   integer double complex
  1   real double complex
  1   double precision double complex
  1   complex double complex
  1   double complex double complex



next up previous contents index
Next: D. HPF Intrinsics and Up: ADAPTOR HPF Language Reference Previous: B. Fortran 95   Contents   Index
Thomas Brandes 2004-03-18