Modified TricubicSpline to handle descending z values.