[J3] [SC22WG5.6537] question about storage sequences and default kind modification

Jeff Hammond jehammond at nvidia.com
Thu Feb 1 16:30:27 UTC 2024


Bill has mentioned this to me before but I want to verify my understand of storage sequences.

If I have a compiler like Intel Fortran that offers many options to the size of INTEGER to 2/4/8 bytes and REAL to 4/8/16 bytes, the only conforming options set INTEGER and REAL to the same size and DOUBLE PRECISION to twice that, correct?

This is not intended to pick on Intel because most implementations have these options, they just have the most as far as I can see.  My goal is to bound the scope of the MPI ABI proposal by only bothering to support conforming uses of these options, or these plus the most widely used non-conforming use (-integer-size 8 -double-size 8).

Thanks,

Jeff

19.5.3.2 Storage sequence

A storage sequence is a sequence of storage units. The size of a storage sequence is the number of storage units in the storage sequence. A storage unit is a character storage unit, a numeric storage unit, a file storage unit (12.3.5), or an unspecified storage unit. The sizes of the numeric storage unit, the character storage unit and the file storage unit are the values of constants in the ISO_FORTRAN_ENV intrinsic module (16.10.2).

In a storage association context

(1) a nonpointer scalar object that is default integer, default real, or default logical occupies a single numeric storage unit,
(2) a nonpointer scalar object that is double precision real or default complex occupies two contiguous numeric storage units,


$ ifort -help data

Data
----

-i{2|4|8}
          set default KIND of integer and logical variables to 2, 4, or 8
-integer-size <size>
          specifies the default size of integer and logical variables
            size:  16, 32, 64
-r{8|16}  set default size of real to 8 or 16 bytes
-real-size <size>
          specify the size of REAL and COMPLEX declarations, constants,
          functions, and intrinsics
            size: 32, 64, 128
-autodouble
          same as -real-size 64 or -r8
-double-size <size>
          defines the size of DOUBLE PRECISION and DOUBLE COMPLEX declarations,
          constants, functions, and intrinsics
            size:  64, 128
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20240201/2318738d/attachment.htm>


More information about the J3 mailing list