3 use fruit,
only : assert_equals, assert_not_equals, assert_true
20 integer,
dimension(3, 2) :: sizes
22 integer :: i,num_fields,max_y_point
24 call assert_equals(0,star_stencil%nfields,
"Test a stencil has been created")
25 current_state%global_grid%size(
z_index) = 2
27 current_state%local_grid%size(
y_index) = 3
28 current_state%local_grid%halo_size(
y_index) = 4
30 fields(num_fields)%ptr => current_state%u
31 sizes(num_fields,:) = (/ 2, 2 /)
33 allocate(interpolated_fields(0:num_fields))
34 allocate(interpolated_fields(num_fields)%data(current_state%global_grid%size(
z_index),&
36 max_y_point = (current_state%local_grid%size(
y_index)+ &
37 current_state%local_grid%halo_size(
y_index) *2)-1
39 interpolated_fields(num_fields)%active=.true.
40 star_stencil =
create_stencil(current_state%local_grid, fields, num_fields, 3, &
41 sizes,.true., .false.)
42 call assert_equals(max_y_point,star_stencil%max_y_point,
"Test max Y point within the stencil")
43 call assert_equals(-1,star_stencil%max_x_point,
"Test max X point within the stencil")
44 call assert_equals(num_fields+1,
size(interpolated_fields),
"Test size of interpolated_fields")
45 call assert_equals(num_fields,star_stencil%nfields,
"Test a stencil has been created")
53 integer,
dimension(3, 2) :: sizes
55 integer :: i,num_fields,max_y_point
56 logical,
dimension(3) :: interpolate_in_dimension
61 current_state%global_grid%size(
z_index) = 2
63 current_state%local_grid%size(
z_index)= 0
64 current_state%local_grid%size(
y_index) = 3
65 current_state%local_grid%halo_size(
y_index) = 4
67 fields(num_fields)%ptr => current_state%u
68 sizes(num_fields,:) = (/ 2, 2 /)
70 allocate(interpolated_fields(0:num_fields))
71 allocate(interpolated_fields(num_fields)%data(current_state%global_grid%size(
z_index),&
73 max_y_point = (current_state%local_grid%size(
y_index)+ &
74 current_state%local_grid%halo_size(
y_index) *2)-1
76 interpolated_fields(num_fields)%active=.true.
77 star_stencil =
create_stencil(current_state%local_grid, fields, num_fields, 3, &
78 sizes,.true., .false.)
79 e_value = 10_default_precision
80 star_stencil%interpolated_fields(1,1)%data(1,1,1) = e_value
83 star_stencil%fields(1), star_stencil%interpolated_fields(1,1)%data(:,1,1))
85 r_value = star_stencil%interpolated_fields(1,1)%data(1,1,1)
87 call assert_equals(e_value, r_value,
"Test")
96 use fruit,
only : init_fruit, run_test_case, fruit_summary
105 "Test the calculation of interpolated cell values")