11! Copyright (c), The Regents of the University of California
22! Terms of use are as specified in LICENSE.txt
3+
4+ #include " language-support.F90"
5+
36module subdomain_test_m
47 ! ! Define subdomain tests and procedures required for reporting results
58 use julienne_m, only : &
69 diagnosis_function_i &
10+ ,operator (.all.) &
11+ ,operator (.approximates.) &
12+ ,operator (.and. ) &
713 ,operator (.csv.) &
14+ ,operator (.isAtLeast.) &
15+ ,operator (.isAtMost.) &
16+ ,operator (.within.) &
817 ,string_t &
918 ,test_t &
1019 ,test_description_t &
@@ -38,7 +47,7 @@ function results() result(test_results)
3847 test_descriptions = [ &
3948 test_description_t(" computing a concave Laplacian for a spatially constant operand with a step down at boundaries" , concave_laplacian) &
4049 ,test_description_t(" reaching the correct steady state solution" , correct_steady_state) &
41- ,test_description_t(" functional pattern results matching procedural results" functional_matches_procedural) &
50+ ,test_description_t(" functional pattern results matching procedural results" , functional_matches_procedural) &
4251 ]
4352#else
4453 procedure (diagnosis_function_i), pointer :: &
@@ -63,13 +72,17 @@ subroutine output(v)
6372 real , intent (in ) :: v(:,:,:)
6473 integer j, k
6574 sync all
75+ #ifdef HAVE_CRITICAL
6676 critical
77+ #endif
6778 do j = 1 , size (v,2 )
6879 do k = 1 , size (v,3 )
6980 print * ," image " ,this_image()," : " ,j,k,v(:,j,k)
7081 end do
7182 end do
83+ #ifdef HAVE_CRITICAL
7284 end critical
85+ #endif
7386 sync all
7487 end subroutine
7588
@@ -184,10 +197,7 @@ function correct_steady_state() result(test_diagnosis)
184197 end associate
185198
186199 associate(residual = > T% values() - T_steady)
187- test_diagnosis = test_diagnosis_t( &
188- test_passed = all (residual >= 0 . .and. residual <= tolerance) &
189- ,diagnostics_string = " expected 0 <= " & ! // string_t(residual) // "<= "// string_t(tolerance) &
190- )
200+ test_diagnosis = .all. ((residual .isAtLeast. 0 .) .and. (residual .isAtMost. tolerance))
191201 end associate
192202 end function
193203
@@ -200,13 +210,10 @@ function functional_matches_procedural() result(test_diagnosis)
200210
201211 associate( T_f = > T_functional(), T_p = > T_procedural())
202212 associate(L_infinity_norm = > maxval (abs (T_f - T_p)))
203- test_diagnosis = test_diagnosis_t( &
204- test_passed = L_infinity_norm < tolerance &
205- ,diagnostics_string = " expected " // string_t(L_infinity_norm) // " < " // string_t(tolerance) &
206- )
213+ test_diagnosis = .all. (T_f .approximates. T_p .within. tolerance)
207214 end associate
208215 end associate
209- &
216+
210217 contains
211218
212219 function T_functional ()
0 commit comments