Skip to content

Commit b09b88e

Browse files
authored
Merge pull request #551 from sourceryinstitute/fix-false-positive
Make co_heat test numerically stable & stricter
2 parents bdff1d1 + e9f7d19 commit b09b88e

File tree

1 file changed

+7
-2
lines changed
  • src/tests/integration/pde_solvers/coarrayHeatSimplified

1 file changed

+7
-2
lines changed

src/tests/integration/pde_solvers/coarrayHeatSimplified/main.f90

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@
2626
!
2727

2828
program main
29+
use IEEE_arithmetic, only : IEEE_is_NaN
2930
use global_field_module, only : global_field
3031
implicit none
3132
type(global_field) :: T,laplacian_T,T_half
3233
real, parameter :: alpha=1.,dt=0.0001,final_time=1.,tolerance=1.E-3
3334
real :: time=0.
34-
call T%global_field_(internal_values=0.,boundary_values=[1.,0.],domain=[0.,1.],num_global_points=16384)
35+
call T%global_field_(internal_values=0.,boundary_values=[1.,0.],domain=[0.,1.],num_global_points=32)
3536
call T_half%global_field_()
3637
do while(time<final_time)
3738
T_half = T + (.laplacian.T)*(alpha*dt/2.)
@@ -40,6 +41,10 @@ program main
4041
end do
4142
call laplacian_T%global_field_()
4243
laplacian_T = .laplacian.T
43-
if (any(laplacian_T%state()>tolerance)) error stop "Test failed."
44+
block
45+
real, allocatable :: residual(:)
46+
residual = laplacian_T%state()
47+
if ( any(residual>tolerance) .or. any(IEEE_is_NaN(residual)) .or. any(residual<0) ) error stop "Test failed."
48+
end block
4449
if (this_image()==1) print *,"Test passed."
4550
end program

0 commit comments

Comments
 (0)