-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.f90
45 lines (37 loc) · 1.09 KB
/
test.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
program test_filter
use fortfilt
implicit none
double precision, dimension(12,8) :: data
double precision, dimension(12,8) :: filtered_data
integer :: i,j
print *, 'filter test'
! fill data with checkerboard pattern
! do i = 1, 12
! do j = 1, 8
! data(i,j) = mod(i+j,2)
! end do
! end do
data = 0
filtered_data = 0
data(6,4) = 15
write(*,"(12f4.1)") data
call naiveGauss(data, filtered_data, 3)
print *, "naive Gauss filtered:"
write(*,"(12f4.1)") filtered_data
print *, "sum:", sum(filtered_data)
call fastGauss(data, filtered_data, 1)
print *, "three times box filtered:"
write(*,"(12f4.1)") filtered_data
print *, "sum:", sum(filtered_data)
data = 0
data(6,4) = 15
filtered_data = 0
call naiveBox(data, filtered_data, 1)
print *, "naive box filtered:"
write(*,"(12f4.1)") filtered_data
print *, "sum:", sum(filtered_data)
call BoxBlur(data, filtered_data, 1)
print *, "fast box filtered:"
write(*,"(12f4.1)") filtered_data
print *, "sum:", sum(filtered_data)
end program test_filter