VEC_MERGEE(ARG1,ARG2)
Purpose
Merges the values of even-numbered elements of two vectors.
Class
Elemental function
Argument type and attributes
- ARG1
- An INTENT(IN) vector(integer(4)) or vector(unsigned(4))
- ARG2
- An INTENT(IN) vector of the same type as ARG1
Result type and attributes
The result is of the same type as ARG1.
Result value
Assume that the elements of each vector are numbered beginning with zero. The even-numbered elements of the result are obtained, in order, from the even-numbered elements of ARG1. The odd-numbered elements of the result are obtained, in order, from the even-numbered elements of ARG2.
Example
PROGRAM main
IMPLICIT NONE
VECTOR(INTEGER(4)) v1, v2, v3
INTEGER(4) i4(4), j4(4)
i4 = [0, 1, 2, 3]
j4 = [5, 6, 7, 8]
v1 = VEC_XL(0, i4)
v2 = VEC_XL(0, j4)
v3 = VEC_MERGEE(v1,v2)
CALL VEC_XST(v3, 0, i4)
PRINT *, 'v3:', i4
END
The output is as follows:v3: 0 2 5 7