Hi, I recently used wrf.interplevel to interpolate a 3d field onto a single pressure level 50000 Pa. I found a very wired result that every time when the 50000 Pa appears in the sample points, the result is NaN. If I added a little value to 50000Pa, it returns the correct value (approximately). Below is just a simple example to reproduce the issue. Please help!
# construct vert array
xx = np.linspace(0,1,11)
xg = np.zeros((11,4,3))
for j in np.arange(4):
for i in np.arange(3):
xg[:,j,i] = xx
Hi, I recently used wrf.interplevel to interpolate a 3d field onto a single pressure level 50000 Pa. I found a very wired result that every time when the 50000 Pa appears in the sample points, the result is NaN. If I added a little value to 50000Pa, it returns the correct value (approximately). Below is just a simple example to reproduce the issue. Please help!
# construct vert array xx = np.linspace(0,1,11) xg = np.zeros((11,4,3)) for j in np.arange(4): for i in np.arange(3): xg[:,j,i] = xx
# assign field3d array yg = np.random.rand(11,4,3)
# print results for comparison print(' True answer: ', yg[5,:,:]) print(' NaN result: ', wrf.interplevel(yg,xg,0.5).to_numpy()) print('Corrected result: ', wrf.interplevel(yg,xg,0.5+1e-8).to_numpy())