Replace nans by minimum value in surface mode