Interpolation Module Ref) Press, Numerical Recipes, Chap. 3. Abstract data types - Linear : linear interpolation . F Linear_create(x(N), y(N)) . F Linear_interpolate(L, x) - Spline : cubic spline interpolation . F Spline_create(x(N), y(N), yp1, ypn) : yp1 and ypn are optional. . F Spline_interpolate(S, x)
Auxiliary functions and subroutines - F locate(table(N), x) : find the right place of x in table
spline interpolation
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(spline), | intent(in) | :: | s | |||
| real(kind=long), | intent(in) | :: | x |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(spline), | intent(in) | :: | s | |||
| real(kind=long), | intent(in) | :: | xx(:) |
linear interpolation
spline interpolation
creates linear interpolation structure
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=long), | intent(in), | dimension(:) | :: | x | ||
| real(kind=long), | intent(in), | dimension(:) | :: | y |
linearly interpolate
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(linear), | intent(in) | :: | l | |||
| real(kind=long), | intent(in) | :: | x |
removes linear interpolation structure
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(linear), | intent(inout) | :: | l |
creates spline interpolation structure
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=long), | intent(in), | dimension(:) | :: | x | ||
| real(kind=long), | intent(in), | dimension(:) | :: | y | ||
| type(spline), | intent(out) | :: | s | |||
| real(kind=long), | intent(in), | optional | :: | yp1 | ||
| real(kind=long), | intent(in), | optional | :: | ypn |
reuse spline structure and fill it with new values
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(spline), | intent(inout) | :: | s | |||
| real(kind=long), | intent(in), | dimension(:) | :: | y | ||
| real(kind=long), | intent(in), | optional | :: | yp1 | ||
| real(kind=long), | intent(in), | optional | :: | ypn |
removes spline interpolation structure
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(spline), | intent(inout) | :: | s |