Skip to content

Commit 6e4576a

Browse files
authored
Merge pull request #4 from dustinswales/feature/equivalent_units_djs04182025
Check that equivalent units did change the answer.
2 parents db6b33c + 5a0c53c commit 6e4576a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/var_compatibility_test/test_host_mod.F90

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ logical function compare_data()
5252
real(kind_phys), parameter :: effri_expected = 7.5E-5 ! 75 microns, in meter
5353
real(kind_phys), parameter :: effrs_expected = 5.1E-4 ! 510 microns, in meter
5454
real(kind_phys), parameter :: scalar_expected = 2.0E3 ! 2 km, in meter
55+
real(kind_phys), parameter :: tke_expected = 10.0 ! 10 J kg-1
5556
real(kind_phys), parameter :: tolerance = 1.0E-6 ! used as scaling factor for expected value
5657

5758
compare_data = .true.
@@ -86,6 +87,11 @@ logical function compare_data()
8687
compare_data = .false.
8788
end if
8889

90+
if (abs( phys_state%tke - tke_expected) > tolerance*tke_expected) then
91+
write(6, '(a,e16.7,a,e16.7)') 'Error: max diff of tke from expected value exceeds tolerance: ', &
92+
abs( phys_state%tke - tke_expected), ' > ', tolerance*tke_expected
93+
compare_data = .false.
94+
end if
8995
end function compare_data
9096

9197
end module test_host_mod

0 commit comments

Comments
 (0)