J3/04-346r1
To: J3
From: Dan Nagle
Subject: Logical & Character Kinds
Date: 2004 August 9
There is no way to determine all the elements of a processor's set
of logical kinds; there is no way to determine all the elements
of a processor's set of character kinds. Furthermore,
extensive discussion over years has yeilded no satisfactory
design for a selected_log_kind function. The current
selected_char_kind function requires a name as input. The space
of all possible names is too large to permit a reasonable search.
This paper proposes a way to give a program access
to all available logical kind values and character kind names.
Number:
Title: Find all available logical and character kinds
Submitted By: J3
Status: For Consideration
References:
Basic Functionality: Add constants to iso_fortran_env which specify
all available logical kind values and
all available character kind names.
Rationale: A program (subject or not to preprocessing) or
an automatic code generator may have a preferred kind
or a preferred ranking of possibly available kinds
for entities of logical and character type. Currently,
the only means available is to RTFM and manually add
the specific values needed.
For example, a very large frequently used but infrequently
updated logical array may be best expressed as an array
of byte (the smallest kind) logical. Default logical may exhaust
the processor's fastest cache, leaving no space for numerical
data. Is byte logical availanle? And, in any case,
what is the smallest logical kind available?
There is no automatically available answer now.
Estimated Impact: The impact was estimated by JoR at 167 to be trivial.
Only iso_fortran_env is affected.
Detailed Specification: These edits assume paper 127, which reorganizes
13.8.2, passes.
Edits:
[360:3+] Add
"13.8.2.1- CHARACTER_KIND_NAMES
The values of the default character rank 1 array
CHARACTER_KIND_NAMES are the names, when any trailing
blanks are removed, which may be passed
to the SELECTED_CHAR_KIND procedure to obtain
a valid kind value.
The lower bound of CHARACTER_KIND_NAMES is one; the size
of CHARACTER_KIND_NAMES is the number of character names
supported by the processor. The names are stored
in non-decreasing order of storage size of objects
of the corresponding kind."
[360:26+] Add
"13.8.2.6+ LOGICAL_KIND_VALUES
The values of the default integer rank 1 array
LOGICAL_KIND_VALUES are the kind values of all available
logical kinds.
The lower bound of LOGICAL_KIND_VALUES is one; the size
of LOGICAL_KIND_VALUES is the number of logical kinds
supported by the processor. The values are stored
in non-decreasing order of storage size of objects
of the corresponding kind."
History: Originally proposed at 167 in paper 121.