Fortran Coder

查看: 15627|回复: 10
打印 上一主题 下一主题

[子程序] 关于assumed-shape array和assumed-size array的中文翻译

[复制链接]

712

帖子

4

主题

0

精华

大师

农村外出务工人员

F 币
607 元
贡献
311 点

新人勋章爱心勋章水王勋章元老勋章热心勋章

楼主
发表于 2017-8-11 08:51:26 | 显示全部楼层
Intel 的文档中写道:
If the lower bound is not specified, it is assumed to be 1.
The rank of the array is the number of colons (:) specified.
The value of the upper bound is the extent of the corresponding dimension of the associated actual argument array + lower-bound - 1.

根据反汇编分析。假定形状的数组,传递的依然是 array descriptor,里面也有下限的信息。
它包括以下内容:
Bytes 0 to 3 contain the base address.

Bytes 4 to 7 contain the size of a single element of the array.

Bytes 8 to 11 are reserved and should not be explicitly set.

Bytes 12 to 15 contain a set of flags used to store information about the array. This includes:

bit 1 (0x01): array is defined -- set if the array has been defined (storage allocated)

bit 2 (0x02): no deallocation allowed -- set if the array pointed to cannot be deallocated (that is, it is an explicit array target)

bit 3 (0x04): array is contiguous -- set if the array pointed to is a contiguous whole array or slice.

bit 8 (0x80): set if the array pointed to is ALLOCATABLE.

Other bits are reserved.

Bytes 16 to 19 contain the number of dimensions (rank) of the array.

Bytes 20 to 23 are reserved and should not be explicitly set.

The remaining bytes (24 to 107) contain information about each dimension (up to 31). Each dimension is described by a set of 3 4-byte entities:

The number of elements (extent)

The distance between the starting address of two successive elements in this dimension, in bytes.

The lower bound

然而,对于假定形状的参数,虚参并没有使用下限信息,而是视而不见。但对于 pointer 的参数,则取了 array descriptor 的下限信息。

为何对下限视而不见,我想这可能是为了兼顾语法规范的要求。
您需要登录后才可以回帖 登录 | 极速注册

本版积分规则

捐赠本站|Archiver|关于我们 About Us|小黑屋|Fcode ( 京ICP备18005632-2号 )

GMT+8, 2024-5-6 04:49

Powered by Tencent X3.4

© 2013-2024 Tencent

快速回复 返回顶部 返回列表