11! Copyright (c) 2024-2025, The Regents of the University of California and Sourcery Institute
22! Terms of use are as specified in LICENSE.txt
3+
4+ #include " language-support.F90"
5+
36module julienne_test_diagnosis_m
47 ! ! Define an abstraction for describing test outcomes and diagnostic information
58 use julienne_string_m, only : string_t
@@ -23,10 +26,20 @@ module julienne_test_diagnosis_m
2326
2427 integer , parameter :: default_real = kind (1 .), double_precision = kind (1D0 )
2528
29+ #if HAVE_DERIVED_TYPE_KIND_PARAMETERS
2630 type operands_t (k)
2731 integer , kind :: k = default_real
2832 real (k) actual, expected
2933 end type
34+ #else
35+ type operands_t
36+ real actual, expected
37+ end type
38+
39+ type double_precision_operands_t
40+ double precision actual, expected
41+ end type
42+ #endif
3043
3144 interface operator (.approximates. )
3245
@@ -39,7 +52,11 @@ pure module function approximates_real(actual, expected) result(operands)
3952 pure module function approximates_double_precision(actual, expected) result(operands)
4053 implicit none
4154 double precision , intent (in ) :: actual, expected
55+ #if HAVE_DERIVED_TYPE_KIND_PARAMETERS
4256 type (operands_t(double_precision)) operands
57+ #else
58+ type (double_precision_operands_t) operands
59+ #endif
4360 end function
4461
4562 end interface
@@ -65,7 +82,11 @@ pure module function within_real(operands, tolerance) result(test_diagnosis)
6582
6683 pure module function within_double_precision(operands, tolerance) result(test_diagnosis)
6784 implicit none
85+ #if HAVE_DERIVED_TYPE_KIND_PARAMETERS
6886 type (operands_t(double_precision)), intent (in ) :: operands
87+ #else
88+ type (double_precision_operands_t), intent (in ) :: operands
89+ #endif
6990 double precision , intent (in ) :: tolerance
7091 type (test_diagnosis_t) test_diagnosis
7192 end function
0 commit comments