jacobwilliams / finterp

Multidimensional (1D-6D) Linear and Nearest-Neighbor Interpolation with Modern Fortran
Other
54 stars 11 forks source link

`linear_interp_*` type allow `intent(in)` in `evaluate` method #7

Closed epagone closed 4 months ago

epagone commented 9 months ago

The evaluate method of a linear_interp_* object in a procedure, requires the latter to be intent(inout) while I would like to make sure that it is intent(in) to avoid accidental modification of the input arrays used for the interpolation. Furthermore, evaluate only returns a real variable, nothing user-facing is changed in the object.

jacobwilliams commented 4 months ago

No, it has to be inout because of the dintrv function, so it can keep track of the last element accessed. This makes it way more efficient that having to do the search every time from scratch.