我有一个派生自Vector的类型。
如果我像(a)这样调用子程序,一切都能正常工作,但是当使用(b)时,我会得到以下错误信息:
错误:参数'u'的级别不匹配(标量和秩-1)。
以下是更多详细信息:
这是一个测试程序的代码。
Type :: Vector
Real (Real32), Allocatable :: r32(:)
Real (Real64), Allocatable :: r64(:)
Real (Real128), Allocatable :: r128(:)
Contains
Procedure :: set => vector_set, &
vector_tutvc, &
vector_vctvc
如果我像(a)这样调用子程序,一切都能正常工作,但是当使用(b)时,我会得到以下错误信息:
错误:参数'u'的级别不匹配(标量和秩-1)。
(a) Call vcr % vector_tutvc (r)
(b) Call vcr % set (r)
以下是更多详细信息:
以下是更多详细信息
Subroutine vector_set (t, u, v, w)
Class (Vector), Intent(InOut) :: t
Class (*), Intent (In) :: u
Class (*), Intent (In), Optional :: v, w
Subroutine vector_tutvc (u, tu)
Class (Vector), Intent(InOut) :: u
Class (*), Intent (In) :: tu(:)
这是一个测试程序的代码。
Type (Vector) :: vcr
Real (Real32), Allocatable :: r(:)
r = [ &
1.0000000, 0.9999965, 0.9999931, 0.9999896, 0.9999862, &
0.9999829, 0.9999796, 0.9999763, 0.9999731, 0.9999699, &
0.9999668, 0.9999637, 0.9999607 &
]
Call vcr % set (r)