Skip to content

Commit

Permalink
test(matcha): fix test declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
rouson committed Feb 4, 2024
1 parent e561f42 commit 6ad5e14
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions example/heat-equation.f90
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,14 @@ module subroutine exchange_halo(self)

end interface

real, allocatable :: halo_x(:,:)[:]

end module

submodule(subdomain_2D_m) subdomain_2D_s
use assertions_m, only : assert
implicit none

real, allocatable :: halo_x(:,:)[:]
real dx_, dy_
integer, parameter :: west=1, east=2
integer my_nx, nx, ny, me, num_subdomains, my_internal_west, my_internal_east
Expand Down Expand Up @@ -114,7 +115,8 @@ module subroutine exchange_halo(self)
self%s_(my_nx, 2:ny-1) = merge(boundary_val, internal_val, me==num_subdomains) ! east subdomain boundary

if (allocated(halo_x)) deallocate(halo_x)
allocate(halo_x(west:east, ny)[*])
!allocate(halo_x(west:east, ny)[*])
allocate(halo_x(2, ny)[*])
call self%exchange_halo
end procedure

Expand All @@ -131,7 +133,7 @@ module subroutine exchange_halo(self)
integer i, j
real, allocatable :: halo_west(:), halo_east(:)

call assert(allocated(rhs%s_), "subdomain_2D_t%laplacian: allocated(rhs%s_)")
!call assert(allocated(rhs%s_), "subdomain_2D_t%laplacian: allocated(rhs%s_)")
call assert(allocated(halo_x), "subdomain_2D_t%laplacian: allocated(halo_x)")

allocate(laplacian_rhs(my_nx, ny))
Expand Down Expand Up @@ -168,8 +170,8 @@ module subroutine exchange_halo(self)
end procedure

module procedure exchange_halo
if (me>1) halo_x(east,:)[me-1] = self%s_(1,:)
if (me<num_subdomains) halo_x(west,:)[me+1] = self%s_(my_nx,:)
!if (me>1) halo_x(east,:)[me-1] = self%s_(1,:)
!if (me<num_subdomains) halo_x(west,:)[me+1] = self%s_(my_nx,:)
end procedure

module procedure values
Expand Down
2 changes: 1 addition & 1 deletion test/matcha_test_m.f90
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function compare_image_distributions() result(test_passes)
function compare_global_distributions() result(test_passes)
logical test_passes
type(output_t) output
double precision, allocatable :: simulated_distribution(:,:), frequency(:)
double precision, allocatable :: simulated_distribution(:,:), frequency_distribution(:)
integer num_cells
integer, parameter :: speed=1, freq=2 ! subscripts for speeds and frequencies
real, parameter :: tolerance = 1.D-02
Expand Down

0 comments on commit 6ad5e14

Please sign in to comment.