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.
pasuka 发表于 2017-11-18 18:56
这种类似union的黑魔法请慎用
传送门 https://docs.oracle.com/cd/E1995 ... 07365fe9/index.html
vvt 发表于 2017-11-18 11:37
BYTE不是标准的fortran变量类型,尽量不要使用它。
可以用character或Integer(Kind=1)代替 ...
li913 发表于 2017-11-18 11:12
形参是标量,实参就只能是标量,不能是数组或数组片段。
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |