Fill the column with index col_ix using linearly interpolated data
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(LT2_t), | intent(inout) | :: | my_lt | |||
| integer, | intent(in) | :: | col_ix | |||
| real(kind=dp), | intent(in) | :: | x1(:) | |||
| real(kind=dp), | intent(in) | :: | x2(:) | |||
| real(kind=dp), | intent(in) | :: | y(:,:) |
pure subroutine LT2_set_col(my_lt, col_ix, x1, x2, y) type(LT2_t), intent(inout) :: my_lt integer, intent(in) :: col_ix real(dp), intent(in) :: x1(:), x2(:), y(:, :) real(dp), allocatable :: tmp(:, :), c1(:), c2(:) integer :: ix allocate(c1(my_lt%n_points(1)),c2(my_lt%n_points(2))) c1 = LT_get_xdata(my_lt%x_min(1), my_lt%dx(1), my_lt%n_points(1)) c2 = LT_get_xdata(my_lt%x_min(2), my_lt%dx(2), my_lt%n_points(2)) allocate(tmp(my_lt%n_points(1), size(x2))) ! Interpolate along first coordinate do ix = 1, size(x2) tmp(:, ix) = LT_get_spaced_data(x1, y(:, ix), c1) end do ! Interpolate along second coordinate do ix = 1, my_lt%n_points(1) my_lt%rows_cols(ix, :, col_ix) = LT_get_spaced_data(x2, tmp(ix, :), c2) end do deallocate(c1,c2) end subroutine LT2_set_col