Fortran Coder

查看: 14749|回复: 6

[求助] ivf中如何设置使用BYTE数据类型?

[复制链接]

13

帖子

4

主题

0

精华

入门

F 币
51 元
贡献
30 点
发表于 2017-11-17 19:45:40 | 显示全部楼层 |阅读模式
今天用IVF编译固定格式的源文件(注该文件可以在cvf编译成功)出现如下错误:形参与实参不匹配如图:
1.PNG
下面是一些具体的定义:
2.PNG
3.PNG
感觉ivf中对BYTE类型处理跟cvf不同,不知道如何设置,请大神赐教。
另外我把图1中call entier1(tab(num_octet:num_octet),iresult(num_champ),bsigne)
改成 call entier1(tab(num_octet),iresult(num_champ),bsigne)是可以编译的,但是不知道是否正确?


790

帖子

2

主题

0

精华

大宗师

F 币
3765 元
贡献
2255 点
发表于 2017-11-18 11:12:17 | 显示全部楼层
形参是标量,实参就只能是标量,不能是数组或数组片段。

953

帖子

0

主题

0

精华

大师

F 币
180 元
贡献
73 点

规矩勋章元老勋章新人勋章水王勋章热心勋章

QQ
发表于 2017-11-18 11:37:40 | 显示全部楼层
BYTE不是标准的fortran变量类型,尽量不要使用它。
可以用character或Integer(Kind=1)代替

490

帖子

4

主题

0

精华

大宗师

F 币
3298 元
贡献
1948 点

水王勋章元老勋章热心勋章

发表于 2017-11-18 18:56:31 | 显示全部楼层
本帖最后由 pasuka 于 2017-11-18 18:58 编辑

这种类似union的黑魔法请慎用

传送门 https://docs.oracle.com/cd/E1995 ... 07365fe9/index.html
BYTE @
The BYTE data type provides a data type that uses only one byte of storage. It is a logical data type, and has the synonym, LOGICAL*1.

A variable of type BYTE can hold any of the following:

One character

An integer between -128 and 127

The logical values, .TRUE. or .FALSE.

If it is interpreted as a logical value, a value of 0 represents .FALSE., and any other value is interpreted as .TRUE.

f77 allows the BYTE type as an array index, just as it allows the REAL type, but it does not allow BYTE as a DO loop index (where it allows only INTEGER, REAL, and DOUBLE PRECISION). Wherever the compiler expects INTEGER explicitly, it will not allow BYTE.

Examples:

         BYTE         Bit3 / 8 /, C1 / 'W' /,
&                 Counter / 0 /, Switch / .FALSE. /
A BYTE item occupies 1 byte (8 bits) of storage, and is aligned on 1-byte boundaries.

13

帖子

4

主题

0

精华

入门

F 币
51 元
贡献
30 点
 楼主| 发表于 2017-11-27 09:36:12 | 显示全部楼层
pasuka 发表于 2017-11-18 18:56
这种类似union的黑魔法请慎用

传送门 https://docs.oracle.com/cd/E1995 ... 07365fe9/index.html

好的,谢谢

13

帖子

4

主题

0

精华

入门

F 币
51 元
贡献
30 点
 楼主| 发表于 2017-11-27 09:36:41 | 显示全部楼层
vvt 发表于 2017-11-18 11:37
BYTE不是标准的fortran变量类型,尽量不要使用它。
可以用character或Integer(Kind=1)代替 ...

好的,谢谢

13

帖子

4

主题

0

精华

入门

F 币
51 元
贡献
30 点
 楼主| 发表于 2017-11-27 09:37:07 | 显示全部楼层
li913 发表于 2017-11-18 11:12
形参是标量,实参就只能是标量,不能是数组或数组片段。

好的,谢谢
您需要登录后才可以回帖 登录 | 极速注册

本版积分规则

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

GMT+8, 2024-3-29 13:58

Powered by Tencent X3.4

© 2013-2024 Tencent

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