E3SM icon indicating copy to clipboard operation
E3SM copied to clipboard

EAMxx: make vertical remap handle fillval gracefully

Open mahf708 opened this issue 2 months ago • 1 comments

similar to #7839 but for vertical remap

mahf708 avatar Oct 30 '25 19:10 mahf708

I think the naive way to make the vremap fill-aware would be to make ekat's LinInterp fill-aware. That is, to notify ekat that if a certain particular value FV is hit during the linear interpolation of y1 and y2, then the result must be FV, regardless of the other y value. This would however prove a bit problematic, as LinInterp works with packs, and therefore packs update routines should be fill aware. Since this could potentially slow down regular updates by quite a bit (we don't want every pack binary op to check if any of the inputs is FillVal), we would have to duplicate a lot of code.

The "cheap" solution would be to loop over the results after the interpolation, and set any entry whose abs value is > LargeNumber to FV. The more robust solution may be to do away with LinInterp in the interpolation phase, using it only for the setup phase (where we find the src index pair that each tgt point needs to interpolate), and doing the actual interp in-house. At least for src fields that are marked as possibly filled.

bartgol avatar Oct 31 '25 16:10 bartgol