Get the value of a single column at a location
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(LT2_t), | intent(in) | :: | my_lt | |||
| integer, | intent(in) | :: | col_ix | |||
| type(LT2_loc_t), | intent(in) | :: | loc |
elemental function LT2_get_col_at_loc(my_lt, col_ix, loc) result(col_value) type(LT2_t), intent(in) :: my_lt integer, intent(in) :: col_ix type(LT2_loc_t), intent(in) :: loc integer :: ix(2) real(dp) :: w(2, 2) real(dp) :: col_value ! Bilinear interpolation w(1, 1) = loc%low_frac(1) * loc%low_frac(2) w(2, 1) = (1 - loc%low_frac(1)) * loc%low_frac(2) w(1, 2) = loc%low_frac(1) * (1 - loc%low_frac(2)) w(2, 2) = (1 - loc%low_frac(1)) * (1 - loc%low_frac(2)) ix = loc%low_ix col_value = sum(w * my_lt%rows_cols(ix(1):ix(1)+1, ix(2):ix(2)+1, col_ix)) end function LT2_get_col_at_loc