This function returns a new lookup table
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | x_min(3) |
Minimum coordinate |
||
| real(kind=dp), | intent(in) | :: | x_max(3) |
Maximum coordinate |
||
| integer, | intent(in) | :: | n_points(3) |
How many values to store |
||
| integer, | intent(in) | :: | n_cols |
Number of variables that will be looked up |
function LT3_create(x_min, x_max, n_points, n_cols) result(my_lt) real(dp), intent(in) :: x_min(3) !< Minimum coordinate real(dp), intent(in) :: x_max(3) !< Maximum coordinate integer, intent(in) :: n_points(3) !< How many values to store integer, intent(in) :: n_cols !< Number of variables that will be looked up type(LT3_t) :: my_lt if (any(x_max <= x_min)) stop "LT3_create error: x_max <= x_min" if (any(n_points <= 1)) stop "LT3_create error: n_points <= 1" my_lt%n_points = n_points my_lt%x_min = x_min my_lt%dx = (x_max - x_min) / (n_points - 1) my_lt%inv_dx = 1 / my_lt%dx allocate(my_lt%rows_cols(n_points(1), n_points(2), n_points(3), n_cols)) my_lt%rows_cols = 0 my_lt%n_cols = n_cols end function LT3_create