From 725e7187a02f25f206b7a032d9eef53e3b0d05bd Mon Sep 17 00:00:00 2001 From: Bill Ladwig Date: Mon, 29 Oct 2018 16:03:52 -0600 Subject: [PATCH] Updated tests --- test/utests.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/test/utests.py b/test/utests.py index 41d6201..44fca92 100644 --- a/test/utests.py +++ b/test/utests.py @@ -153,10 +153,15 @@ def make_test(varname, wrf_in, referent, multi=False, repeat=3, pynio=False): tol = 1/100. atol = .1 # Note: NCL uses 273.16 as conversion for some reason nt.assert_allclose(to_np(my_vals), ref_vals, tol, atol) + elif (varname == "height_agl"): + # Change the vert_type to height_agl when NCL gets updated. + my_vals = getvar(in_wrfnc, "z", timeidx=timeidx, msl=False) + tol = 1/100. + atol = .1 # Note: NCL uses 273.16 as conversion for some reason + nt.assert_allclose(to_np(my_vals), ref_vals, tol, atol) elif (varname == "cfrac"): # Change the vert_type to height_agl when NCL gets updated. - my_vals = getvar(in_wrfnc, "cfrac", timeidx=timeidx, - vert_type="pres") + my_vals = getvar(in_wrfnc, "cfrac", timeidx=timeidx) tol = 1/100. atol = .1 # Note: NCL uses 273.16 as conversion for some reason nt.assert_allclose(to_np(my_vals), ref_vals, tol, atol) @@ -203,7 +208,11 @@ def make_test(varname, wrf_in, referent, multi=False, repeat=3, pynio=False): try: nt.assert_allclose(to_np(my_vals), ref_vals, tol, atol) except: - print (np.amax(np.abs(to_np(my_vals) - ref_vals))) + absdiff = np.abs(to_np(my_vals) - ref_vals) + maxdiff = np.amax(absdiff) + print (maxdiff) + print np.argwhere(absdiff == maxdiff) + raise