1
subroutine test_tensormul
7
real, dimension(4, 5, 6, 7) :: tensorA
8
real, dimension(6) :: vec6
9
real, dimension(7) :: vec7
11
real, dimension(4, 5, 7) :: resA
12
real, dimension(4, 5, 6) :: resB
14
real, dimension(2, 2, 2, 2) :: tensorB
15
real, dimension(2) :: vec2
17
real, dimension(2, 2, 2) :: resC
21
tensorA = 1.0 ; vec6 = 1.0 ; vec7 = 1.0
23
resA = tensormul(tensorA, vec6, 3)
26
if (any(resA /= 6.0)) fail = .true.
28
call report_test("[tensormul_4_1]", fail, .false., "Tensormul should give &
29
& known output for known input.")
31
resB = tensormul(tensorA, vec7, 4)
34
if (any(resB /= 7.0)) fail = .true.
36
call report_test("[tensormul_4_1]", fail, .false., "Tensormul should give &
37
& known output for known input.")
39
tensorB = 1.0 ; vec2 = 1.0
41
resC = tensormul(tensorB, vec2, 3)
44
if (any(resC /= 2.0)) fail = .true.
46
call report_test("[tensormul_4_1]", fail, .false., "Tensormul should give &
47
& known output for known input.")
49
end subroutine test_tensormul