-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstencil_space_test.f08
38 lines (28 loc) · 1.03 KB
/
stencil_space_test.f08
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
program test
use iso_fortran_env
use stencil_space, only : create_stencil_space_factory, &
stencil_space_factory
use display, only : display2
implicit none
real(kind=real64), dimension(5, 5, 1), target :: field
real(kind=real64), dimension(:,:,:), pointer :: stencil
type(stencil_space_factory) :: sf
integer :: i, j
field = 5
print "(a)", "before:"
call display2(field(:,:,1), "f3.1")
! sf = create_stencil_space_factory(4, dimens=shape(field), forward=.false.)
sf = create_stencil_space_factory(4, field=field)
print *, sf%jmin, sf%jmax
print *, sf%imin, sf%imax
print "(a, 1x, 3(i0.2, 1x))", "size of field:", shape(field)
do j = sf%jmin, sf%jmax
do i = sf%imin, sf%imax
call sf%apply(stencil, field, i, j, 1)
stencil(:, :, :) = i + j
end do
end do
print "(a, 1x, 3(i0.2, 1x))", "size of stencil:", shape(stencil)
print "(a)", "after:"
call display2(field(:,:,1), "f3.1")
end program