这种传递方式不需要传递数组的大小,使用内置的size,shape函数可以直接获得数组大小,减少了参数个数。 传递的是一个数组对象,可以进行数组的整体操作。 本身有数组的形状检查,需要显式接口。 只能接受指定rank的数组。 虚参的数组存放可能不连续,比如使用数组切片操作调用。 4 Assumed-rank Array 这是比较现代的数组传递...
Assumed-Size ArrayThe array is called an assumed-size array when the dimension declarator contains an asterisk. In such cases, the upper bound of that dimension is not stipulated. An asterisk can only appear for formal arrays and as the upper bound of the last dimension in an array ...
use an assumed-size array as a runtime format specifier in an I/O statement. Example: Assumed-size with the upper bound of the last dimension an asterisk: SUBROUTINE PULLDOWN ( A, B, C ) INTEGER A(5, *), B(*), C(0:1, 2:*) ...
示例程序中,sub77就是这么做的,这被称为adjustable-size array,符合FORTRAN 77的语法。 于是我就在想,这么传递参数很麻烦,每次调用子程序都要多传好几个参数,有没有类似C++里vector的做法呢?搜索了一下,发现答案是有的,并且Fortran 90原生支持,这被称为assumed-shape array。主程序里数组的定义不变,但不再将...
Error1 Error: An assumed-size array shall not be written as a whole array reference except as an actual argument in a procedure reference for which the shape is not required. [NUCLIDEBURNUPSTEP] The argument, This, is a scalar, not an array. There...
第9章Fortran中的数组 第9章Fortran中的数组 •数组是Fortran语言中功能最为强大、运用最为灵活的一种数据结构。数组(ARRAY)在科学和工程计算中通常用来表示矩阵和向量。同一般的变量声明相比,数组能够同时保存多个数据。它是一种使用大规模数据的方法。配合Fortran语言中的数组操作,可用于对大量不同的数据进行处理...
get their shape information passed, whereas assumed size arrays basically get nothing but a starting address passed. 运行python遇到这个错误 error: Unable to find vcvarsall.bat 可以这么解决: 报错原因:在生成的时候,编译器从%PythonInstallPath%\distutils\msvc9compiler.py里的219行find_vcvarsall(version)...
True, the only thing I can think of that would work is that you pass the array as an assumed-size array (in the FORTRAN 77 tradition) and pass it on as either a 4- or a 5-dimensional array. Though I think that would be rather error-prone. Assumed-rank arrays are very limited ...
Shared arrays that are not dummy arguments may be declared as assumed-size arrays; that is, the last dimension of a shared array may have an asterisk as its upper bound: real, shared :: x(*) Such an array has special significance. Its size is determined at run time by the call to ...
(3)用星号(*)来声明形参数组的长度,定义不定大小的形参数组(assumed-sizedummyarray)。不会进行越界检测。如果数组datal和data2的长度大于或等于比nvals,则正常,否则出错。是早期版本的一个过 渡行为,不再使用。例7-4子程序数组越界 7.1.5传递字符变量给子程序 字符变量作为子程序的形参时,用*来声明字符...