# Nearest-neighbor interpolation would do this: data = model( 1.5 + (t-t0)/dt) # This is likewise but with _linear_ interpolation. module lint1 { real :: o1,d1 real, dimension (:), pointer :: coordinate #% _init ( o1,d1, coordinate) #% _lop ( mm, dd) integer i, im, id real f, fx,gx do id= 1, size(dd) { f = (coordinate(id)-o1)/d1; i=f ; im= 1+i if( 1<=im && im< size(mm)) { fx=f-i; gx= 1.-fx if( adj) { mm(im ) += gx * dd(id) mm(im+1) += fx * dd(id) } else dd(id) += gx * mm(im) + fx * mm(im+1) } } }