Skip to content

Commit 6f45a7c

Browse files
committed
raw_moment_dev: correction of test_rawmoment
1 parent 2121304 commit 6f45a7c

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

src/tests/stats/test_moment.f90

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,6 @@ subroutine test_csp(x1, x2)
627627
complex(sp), intent(in) :: x1(:), x2(:, :)
628628

629629
integer :: order
630-
complex(sp), allocatable :: x3(:, :, :)
631630

632631
order = 1
633632

src/tests/stats/test_rawmoment.f90

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,6 @@ subroutine test_sp(x1, x2)
4545
zero2_1 = 0
4646
zero2_2 = 0
4747

48-
allocate(zero3_1(size(x3, 2), size(x3, 3))&
49-
,zero3_2(size(x3, 1), size(x3, 3))&
50-
,zero3_3(size(x3, 1), size(x3, 2)))
51-
zero3_1 = 0
52-
zero3_2 = 0
53-
zero3_3 = 0
54-
5548
order = 1
5649

5750
!1dim
@@ -110,6 +103,13 @@ subroutine test_sp(x1, x2)
110103
x3(:,:,2)=x2*2;
111104
x3(:,:,3)=x2*4;
112105

106+
allocate(zero3_1(size(x3, 2), size(x3, 3))&
107+
,zero3_2(size(x3, 1), size(x3, 3))&
108+
,zero3_3(size(x3, 1), size(x3, 2)))
109+
zero3_1 = 0
110+
zero3_2 = 0
111+
zero3_3 = 0
112+
113113
print*,' test_sp_3dim', order
114114
call assert( abs(moment(x3, order, center = 0.) - mean(x3)) < sptol)
115115
call assert( all( abs( moment(x3, order, dim = 1, center = 0._sp) -&
@@ -270,14 +270,6 @@ subroutine test_int32(x1, x2)
270270
zero2_1 = 0
271271
zero2_2 = 0
272272

273-
allocate(zero3_1(size(x3, 2), size(x3, 3))&
274-
,zero3_2(size(x3, 1), size(x3, 3))&
275-
,zero3_3(size(x3, 1), size(x3, 2)))
276-
zero3_1 = 0
277-
zero3_2 = 0
278-
zero3_3 = 0
279-
280-
281273
order = 1
282274

283275
!1dim
@@ -337,6 +329,13 @@ subroutine test_int32(x1, x2)
337329
x3(:,:,2)=x2*2;
338330
x3(:,:,3)=x2*4;
339331

332+
allocate(zero3_1(size(x3, 2), size(x3, 3))&
333+
,zero3_2(size(x3, 1), size(x3, 3))&
334+
,zero3_3(size(x3, 1), size(x3, 2)))
335+
zero3_1 = 0
336+
zero3_2 = 0
337+
zero3_3 = 0
338+
340339
print*,' test_sp_3dim', order
341340
call assert( abs(moment(x3, order, center = 0._dp) - mean(x3)) < sptol)
342341
call assert( all( abs( moment(x3, order, dim = 1, center = 0._dp) -&
@@ -500,7 +499,6 @@ subroutine test_csp(x1, x2)
500499
complex(sp), intent(in) :: x1(:), x2(:, :)
501500

502501
integer :: order
503-
complex(sp), allocatable :: x3(:, :, :)
504502
complex(sp), allocatable :: zero2_1(:), zero2_2(:)
505503

506504
allocate(zero2_1(size(x2, 2)), zero2_2(size(x2, 1)))

0 commit comments

Comments
 (0)