I have a derived type Vector
Type :: Vector
Real (Real32), Allocatable :: r32(:)
Real (Real64), Allocatable :: r64(:)
Real (Real128), Allocatable :: r128(:)
Contains
Procedure :: set => vector_set, &
vector_tutvc, &
vector_vctvc
If I call the subroutine, as in (a), I get everything that works correctly, however when using (b) I get
Error: rank mismatch in argument 'u' at (1) (scalar and rank-1)
(a) Call vcr % vector_tutvc (r)
(b) Call vcr % set (r)
More details ...
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(:)
Here is the code for the test program
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)